@anvil-works/anvil-cli 0.3.11 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -94,6 +94,704 @@ var __webpack_modules__ = {
94
94
  exports1.deferred = deferred;
95
95
  exports1.createDeferred = deferred;
96
96
  },
97
+ "./node_modules/.pnpm/@napi-rs+keyring@1.2.0/node_modules/@napi-rs/keyring/index.js" (module, __unused_rspack_exports, __webpack_require__) {
98
+ var require1;
99
+ const { createRequire } = __webpack_require__("node:module");
100
+ require1 = createRequire(__filename);
101
+ const { readFileSync } = __webpack_require__("node:fs");
102
+ let nativeBinding = null;
103
+ const loadErrors = [];
104
+ const isMusl = ()=>{
105
+ let musl = false;
106
+ if ('linux' === process.platform) {
107
+ musl = isMuslFromFilesystem();
108
+ if (null === musl) musl = isMuslFromReport();
109
+ if (null === musl) musl = isMuslFromChildProcess();
110
+ }
111
+ return musl;
112
+ };
113
+ const isFileMusl = (f)=>f.includes('libc.musl-') || f.includes('ld-musl-');
114
+ const isMuslFromFilesystem = ()=>{
115
+ try {
116
+ return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl');
117
+ } catch {
118
+ return null;
119
+ }
120
+ };
121
+ const isMuslFromReport = ()=>{
122
+ let report = null;
123
+ if ('function' == typeof process.report?.getReport) {
124
+ process.report.excludeNetwork = true;
125
+ report = process.report.getReport();
126
+ }
127
+ if (!report) return null;
128
+ if (report.header && report.header.glibcVersionRuntime) return false;
129
+ if (Array.isArray(report.sharedObjects)) {
130
+ if (report.sharedObjects.some(isFileMusl)) return true;
131
+ }
132
+ return false;
133
+ };
134
+ const isMuslFromChildProcess = ()=>{
135
+ try {
136
+ return __webpack_require__("child_process").execSync('ldd --version', {
137
+ encoding: 'utf8'
138
+ }).includes('musl');
139
+ } catch (e) {
140
+ return false;
141
+ }
142
+ };
143
+ function requireNative() {
144
+ if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
145
+ nativeBinding = require1(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
146
+ } catch (err) {
147
+ loadErrors.push(err);
148
+ }
149
+ else if ('android' === process.platform) if ('arm64' === process.arch) {
150
+ try {
151
+ return __webpack_require__(Object(function() {
152
+ var e = new Error("Cannot find module './keyring.android-arm64.node'");
153
+ e.code = 'MODULE_NOT_FOUND';
154
+ throw e;
155
+ }()));
156
+ } catch (e) {
157
+ loadErrors.push(e);
158
+ }
159
+ try {
160
+ const binding = __webpack_require__(Object(function() {
161
+ var e = new Error("Cannot find module '@napi-rs/keyring-android-arm64'");
162
+ e.code = 'MODULE_NOT_FOUND';
163
+ throw e;
164
+ }()));
165
+ const bindingPackageVersion = __webpack_require__(Object(function() {
166
+ var e = new Error("Cannot find module '@napi-rs/keyring-android-arm64/package.json'");
167
+ e.code = 'MODULE_NOT_FOUND';
168
+ throw e;
169
+ }()));
170
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
171
+ return binding;
172
+ } catch (e) {
173
+ loadErrors.push(e);
174
+ }
175
+ } else if ('arm' === process.arch) {
176
+ try {
177
+ return __webpack_require__(Object(function() {
178
+ var e = new Error("Cannot find module './keyring.android-arm-eabi.node'");
179
+ e.code = 'MODULE_NOT_FOUND';
180
+ throw e;
181
+ }()));
182
+ } catch (e) {
183
+ loadErrors.push(e);
184
+ }
185
+ try {
186
+ const binding = __webpack_require__(Object(function() {
187
+ var e = new Error("Cannot find module '@napi-rs/keyring-android-arm-eabi'");
188
+ e.code = 'MODULE_NOT_FOUND';
189
+ throw e;
190
+ }()));
191
+ const bindingPackageVersion = __webpack_require__(Object(function() {
192
+ var e = new Error("Cannot find module '@napi-rs/keyring-android-arm-eabi/package.json'");
193
+ e.code = 'MODULE_NOT_FOUND';
194
+ throw e;
195
+ }()));
196
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
197
+ return binding;
198
+ } catch (e) {
199
+ loadErrors.push(e);
200
+ }
201
+ } else loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
202
+ else if ('win32' === process.platform) if ('x64' === process.arch) {
203
+ try {
204
+ return __webpack_require__(Object(function() {
205
+ var e = new Error("Cannot find module './keyring.win32-x64-msvc.node'");
206
+ e.code = 'MODULE_NOT_FOUND';
207
+ throw e;
208
+ }()));
209
+ } catch (e) {
210
+ loadErrors.push(e);
211
+ }
212
+ try {
213
+ const binding = __webpack_require__(Object(function() {
214
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-x64-msvc'");
215
+ e.code = 'MODULE_NOT_FOUND';
216
+ throw e;
217
+ }()));
218
+ const bindingPackageVersion = __webpack_require__(Object(function() {
219
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-x64-msvc/package.json'");
220
+ e.code = 'MODULE_NOT_FOUND';
221
+ throw e;
222
+ }()));
223
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
224
+ return binding;
225
+ } catch (e) {
226
+ loadErrors.push(e);
227
+ }
228
+ } else if ('ia32' === process.arch) {
229
+ try {
230
+ return __webpack_require__(Object(function() {
231
+ var e = new Error("Cannot find module './keyring.win32-ia32-msvc.node'");
232
+ e.code = 'MODULE_NOT_FOUND';
233
+ throw e;
234
+ }()));
235
+ } catch (e) {
236
+ loadErrors.push(e);
237
+ }
238
+ try {
239
+ const binding = __webpack_require__(Object(function() {
240
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-ia32-msvc'");
241
+ e.code = 'MODULE_NOT_FOUND';
242
+ throw e;
243
+ }()));
244
+ const bindingPackageVersion = __webpack_require__(Object(function() {
245
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-ia32-msvc/package.json'");
246
+ e.code = 'MODULE_NOT_FOUND';
247
+ throw e;
248
+ }()));
249
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
250
+ return binding;
251
+ } catch (e) {
252
+ loadErrors.push(e);
253
+ }
254
+ } else if ('arm64' === process.arch) {
255
+ try {
256
+ return __webpack_require__(Object(function() {
257
+ var e = new Error("Cannot find module './keyring.win32-arm64-msvc.node'");
258
+ e.code = 'MODULE_NOT_FOUND';
259
+ throw e;
260
+ }()));
261
+ } catch (e) {
262
+ loadErrors.push(e);
263
+ }
264
+ try {
265
+ const binding = __webpack_require__(Object(function() {
266
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-arm64-msvc'");
267
+ e.code = 'MODULE_NOT_FOUND';
268
+ throw e;
269
+ }()));
270
+ const bindingPackageVersion = __webpack_require__(Object(function() {
271
+ var e = new Error("Cannot find module '@napi-rs/keyring-win32-arm64-msvc/package.json'");
272
+ e.code = 'MODULE_NOT_FOUND';
273
+ throw e;
274
+ }()));
275
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
276
+ return binding;
277
+ } catch (e) {
278
+ loadErrors.push(e);
279
+ }
280
+ } else loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
281
+ else if ('darwin' === process.platform) {
282
+ try {
283
+ return __webpack_require__(Object(function() {
284
+ var e = new Error("Cannot find module './keyring.darwin-universal.node'");
285
+ e.code = 'MODULE_NOT_FOUND';
286
+ throw e;
287
+ }()));
288
+ } catch (e) {
289
+ loadErrors.push(e);
290
+ }
291
+ try {
292
+ const binding = __webpack_require__(Object(function() {
293
+ var e = new Error("Cannot find module '@napi-rs/keyring-darwin-universal'");
294
+ e.code = 'MODULE_NOT_FOUND';
295
+ throw e;
296
+ }()));
297
+ const bindingPackageVersion = __webpack_require__(Object(function() {
298
+ var e = new Error("Cannot find module '@napi-rs/keyring-darwin-universal/package.json'");
299
+ e.code = 'MODULE_NOT_FOUND';
300
+ throw e;
301
+ }()));
302
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
303
+ return binding;
304
+ } catch (e) {
305
+ loadErrors.push(e);
306
+ }
307
+ if ('x64' === process.arch) {
308
+ try {
309
+ return __webpack_require__(Object(function() {
310
+ var e = new Error("Cannot find module './keyring.darwin-x64.node'");
311
+ e.code = 'MODULE_NOT_FOUND';
312
+ throw e;
313
+ }()));
314
+ } catch (e) {
315
+ loadErrors.push(e);
316
+ }
317
+ try {
318
+ const binding = __webpack_require__(Object(function() {
319
+ var e = new Error("Cannot find module '@napi-rs/keyring-darwin-x64'");
320
+ e.code = 'MODULE_NOT_FOUND';
321
+ throw e;
322
+ }()));
323
+ const bindingPackageVersion = __webpack_require__(Object(function() {
324
+ var e = new Error("Cannot find module '@napi-rs/keyring-darwin-x64/package.json'");
325
+ e.code = 'MODULE_NOT_FOUND';
326
+ throw e;
327
+ }()));
328
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
329
+ return binding;
330
+ } catch (e) {
331
+ loadErrors.push(e);
332
+ }
333
+ } else if ('arm64' === process.arch) {
334
+ try {
335
+ return __webpack_require__(Object(function() {
336
+ var e = new Error("Cannot find module './keyring.darwin-arm64.node'");
337
+ e.code = 'MODULE_NOT_FOUND';
338
+ throw e;
339
+ }()));
340
+ } catch (e) {
341
+ loadErrors.push(e);
342
+ }
343
+ try {
344
+ const binding = __webpack_require__("./node_modules/.pnpm/@napi-rs+keyring-darwin-arm64@1.2.0/node_modules/@napi-rs/keyring-darwin-arm64/keyring.darwin-arm64.node");
345
+ const bindingPackageVersion = __webpack_require__("./node_modules/.pnpm/@napi-rs+keyring-darwin-arm64@1.2.0/node_modules/@napi-rs/keyring-darwin-arm64/package.json").rE;
346
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
347
+ return binding;
348
+ } catch (e) {
349
+ loadErrors.push(e);
350
+ }
351
+ } else loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
352
+ } else if ('freebsd' === process.platform) if ('x64' === process.arch) {
353
+ try {
354
+ return __webpack_require__(Object(function() {
355
+ var e = new Error("Cannot find module './keyring.freebsd-x64.node'");
356
+ e.code = 'MODULE_NOT_FOUND';
357
+ throw e;
358
+ }()));
359
+ } catch (e) {
360
+ loadErrors.push(e);
361
+ }
362
+ try {
363
+ const binding = __webpack_require__(Object(function() {
364
+ var e = new Error("Cannot find module '@napi-rs/keyring-freebsd-x64'");
365
+ e.code = 'MODULE_NOT_FOUND';
366
+ throw e;
367
+ }()));
368
+ const bindingPackageVersion = __webpack_require__(Object(function() {
369
+ var e = new Error("Cannot find module '@napi-rs/keyring-freebsd-x64/package.json'");
370
+ e.code = 'MODULE_NOT_FOUND';
371
+ throw e;
372
+ }()));
373
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
374
+ return binding;
375
+ } catch (e) {
376
+ loadErrors.push(e);
377
+ }
378
+ } else if ('arm64' === process.arch) {
379
+ try {
380
+ return __webpack_require__(Object(function() {
381
+ var e = new Error("Cannot find module './keyring.freebsd-arm64.node'");
382
+ e.code = 'MODULE_NOT_FOUND';
383
+ throw e;
384
+ }()));
385
+ } catch (e) {
386
+ loadErrors.push(e);
387
+ }
388
+ try {
389
+ const binding = __webpack_require__(Object(function() {
390
+ var e = new Error("Cannot find module '@napi-rs/keyring-freebsd-arm64'");
391
+ e.code = 'MODULE_NOT_FOUND';
392
+ throw e;
393
+ }()));
394
+ const bindingPackageVersion = __webpack_require__(Object(function() {
395
+ var e = new Error("Cannot find module '@napi-rs/keyring-freebsd-arm64/package.json'");
396
+ e.code = 'MODULE_NOT_FOUND';
397
+ throw e;
398
+ }()));
399
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
400
+ return binding;
401
+ } catch (e) {
402
+ loadErrors.push(e);
403
+ }
404
+ } else loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
405
+ else if ('linux' === process.platform) if ('x64' === process.arch) if (isMusl()) {
406
+ try {
407
+ return __webpack_require__(Object(function() {
408
+ var e = new Error("Cannot find module './keyring.linux-x64-musl.node'");
409
+ e.code = 'MODULE_NOT_FOUND';
410
+ throw e;
411
+ }()));
412
+ } catch (e) {
413
+ loadErrors.push(e);
414
+ }
415
+ try {
416
+ const binding = __webpack_require__(Object(function() {
417
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-x64-musl'");
418
+ e.code = 'MODULE_NOT_FOUND';
419
+ throw e;
420
+ }()));
421
+ const bindingPackageVersion = __webpack_require__(Object(function() {
422
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-x64-musl/package.json'");
423
+ e.code = 'MODULE_NOT_FOUND';
424
+ throw e;
425
+ }()));
426
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
427
+ return binding;
428
+ } catch (e) {
429
+ loadErrors.push(e);
430
+ }
431
+ } else {
432
+ try {
433
+ return __webpack_require__(Object(function() {
434
+ var e = new Error("Cannot find module './keyring.linux-x64-gnu.node'");
435
+ e.code = 'MODULE_NOT_FOUND';
436
+ throw e;
437
+ }()));
438
+ } catch (e) {
439
+ loadErrors.push(e);
440
+ }
441
+ try {
442
+ const binding = __webpack_require__(Object(function() {
443
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-x64-gnu'");
444
+ e.code = 'MODULE_NOT_FOUND';
445
+ throw e;
446
+ }()));
447
+ const bindingPackageVersion = __webpack_require__(Object(function() {
448
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-x64-gnu/package.json'");
449
+ e.code = 'MODULE_NOT_FOUND';
450
+ throw e;
451
+ }()));
452
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
453
+ return binding;
454
+ } catch (e) {
455
+ loadErrors.push(e);
456
+ }
457
+ }
458
+ else if ('arm64' === process.arch) if (isMusl()) {
459
+ try {
460
+ return __webpack_require__(Object(function() {
461
+ var e = new Error("Cannot find module './keyring.linux-arm64-musl.node'");
462
+ e.code = 'MODULE_NOT_FOUND';
463
+ throw e;
464
+ }()));
465
+ } catch (e) {
466
+ loadErrors.push(e);
467
+ }
468
+ try {
469
+ const binding = __webpack_require__(Object(function() {
470
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm64-musl'");
471
+ e.code = 'MODULE_NOT_FOUND';
472
+ throw e;
473
+ }()));
474
+ const bindingPackageVersion = __webpack_require__(Object(function() {
475
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm64-musl/package.json'");
476
+ e.code = 'MODULE_NOT_FOUND';
477
+ throw e;
478
+ }()));
479
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
480
+ return binding;
481
+ } catch (e) {
482
+ loadErrors.push(e);
483
+ }
484
+ } else {
485
+ try {
486
+ return __webpack_require__(Object(function() {
487
+ var e = new Error("Cannot find module './keyring.linux-arm64-gnu.node'");
488
+ e.code = 'MODULE_NOT_FOUND';
489
+ throw e;
490
+ }()));
491
+ } catch (e) {
492
+ loadErrors.push(e);
493
+ }
494
+ try {
495
+ const binding = __webpack_require__(Object(function() {
496
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm64-gnu'");
497
+ e.code = 'MODULE_NOT_FOUND';
498
+ throw e;
499
+ }()));
500
+ const bindingPackageVersion = __webpack_require__(Object(function() {
501
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm64-gnu/package.json'");
502
+ e.code = 'MODULE_NOT_FOUND';
503
+ throw e;
504
+ }()));
505
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
506
+ return binding;
507
+ } catch (e) {
508
+ loadErrors.push(e);
509
+ }
510
+ }
511
+ else if ('arm' === process.arch) if (isMusl()) {
512
+ try {
513
+ return __webpack_require__(Object(function() {
514
+ var e = new Error("Cannot find module './keyring.linux-arm-musleabihf.node'");
515
+ e.code = 'MODULE_NOT_FOUND';
516
+ throw e;
517
+ }()));
518
+ } catch (e) {
519
+ loadErrors.push(e);
520
+ }
521
+ try {
522
+ const binding = __webpack_require__(Object(function() {
523
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm-musleabihf'");
524
+ e.code = 'MODULE_NOT_FOUND';
525
+ throw e;
526
+ }()));
527
+ const bindingPackageVersion = __webpack_require__(Object(function() {
528
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm-musleabihf/package.json'");
529
+ e.code = 'MODULE_NOT_FOUND';
530
+ throw e;
531
+ }()));
532
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
533
+ return binding;
534
+ } catch (e) {
535
+ loadErrors.push(e);
536
+ }
537
+ } else {
538
+ try {
539
+ return __webpack_require__(Object(function() {
540
+ var e = new Error("Cannot find module './keyring.linux-arm-gnueabihf.node'");
541
+ e.code = 'MODULE_NOT_FOUND';
542
+ throw e;
543
+ }()));
544
+ } catch (e) {
545
+ loadErrors.push(e);
546
+ }
547
+ try {
548
+ const binding = __webpack_require__(Object(function() {
549
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm-gnueabihf'");
550
+ e.code = 'MODULE_NOT_FOUND';
551
+ throw e;
552
+ }()));
553
+ const bindingPackageVersion = __webpack_require__(Object(function() {
554
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-arm-gnueabihf/package.json'");
555
+ e.code = 'MODULE_NOT_FOUND';
556
+ throw e;
557
+ }()));
558
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
559
+ return binding;
560
+ } catch (e) {
561
+ loadErrors.push(e);
562
+ }
563
+ }
564
+ else if ('riscv64' === process.arch) if (isMusl()) {
565
+ try {
566
+ return __webpack_require__(Object(function() {
567
+ var e = new Error("Cannot find module './keyring.linux-riscv64-musl.node'");
568
+ e.code = 'MODULE_NOT_FOUND';
569
+ throw e;
570
+ }()));
571
+ } catch (e) {
572
+ loadErrors.push(e);
573
+ }
574
+ try {
575
+ const binding = __webpack_require__(Object(function() {
576
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-riscv64-musl'");
577
+ e.code = 'MODULE_NOT_FOUND';
578
+ throw e;
579
+ }()));
580
+ const bindingPackageVersion = __webpack_require__(Object(function() {
581
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-riscv64-musl/package.json'");
582
+ e.code = 'MODULE_NOT_FOUND';
583
+ throw e;
584
+ }()));
585
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
586
+ return binding;
587
+ } catch (e) {
588
+ loadErrors.push(e);
589
+ }
590
+ } else {
591
+ try {
592
+ return __webpack_require__(Object(function() {
593
+ var e = new Error("Cannot find module './keyring.linux-riscv64-gnu.node'");
594
+ e.code = 'MODULE_NOT_FOUND';
595
+ throw e;
596
+ }()));
597
+ } catch (e) {
598
+ loadErrors.push(e);
599
+ }
600
+ try {
601
+ const binding = __webpack_require__(Object(function() {
602
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-riscv64-gnu'");
603
+ e.code = 'MODULE_NOT_FOUND';
604
+ throw e;
605
+ }()));
606
+ const bindingPackageVersion = __webpack_require__(Object(function() {
607
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-riscv64-gnu/package.json'");
608
+ e.code = 'MODULE_NOT_FOUND';
609
+ throw e;
610
+ }()));
611
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
612
+ return binding;
613
+ } catch (e) {
614
+ loadErrors.push(e);
615
+ }
616
+ }
617
+ else if ('ppc64' === process.arch) {
618
+ try {
619
+ return __webpack_require__(Object(function() {
620
+ var e = new Error("Cannot find module './keyring.linux-ppc64-gnu.node'");
621
+ e.code = 'MODULE_NOT_FOUND';
622
+ throw e;
623
+ }()));
624
+ } catch (e) {
625
+ loadErrors.push(e);
626
+ }
627
+ try {
628
+ const binding = __webpack_require__(Object(function() {
629
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-ppc64-gnu'");
630
+ e.code = 'MODULE_NOT_FOUND';
631
+ throw e;
632
+ }()));
633
+ const bindingPackageVersion = __webpack_require__(Object(function() {
634
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-ppc64-gnu/package.json'");
635
+ e.code = 'MODULE_NOT_FOUND';
636
+ throw e;
637
+ }()));
638
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
639
+ return binding;
640
+ } catch (e) {
641
+ loadErrors.push(e);
642
+ }
643
+ } else if ('s390x' === process.arch) {
644
+ try {
645
+ return __webpack_require__(Object(function() {
646
+ var e = new Error("Cannot find module './keyring.linux-s390x-gnu.node'");
647
+ e.code = 'MODULE_NOT_FOUND';
648
+ throw e;
649
+ }()));
650
+ } catch (e) {
651
+ loadErrors.push(e);
652
+ }
653
+ try {
654
+ const binding = __webpack_require__(Object(function() {
655
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-s390x-gnu'");
656
+ e.code = 'MODULE_NOT_FOUND';
657
+ throw e;
658
+ }()));
659
+ const bindingPackageVersion = __webpack_require__(Object(function() {
660
+ var e = new Error("Cannot find module '@napi-rs/keyring-linux-s390x-gnu/package.json'");
661
+ e.code = 'MODULE_NOT_FOUND';
662
+ throw e;
663
+ }()));
664
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
665
+ return binding;
666
+ } catch (e) {
667
+ loadErrors.push(e);
668
+ }
669
+ } else loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
670
+ else if ('openharmony' === process.platform) if ('arm64' === process.arch) {
671
+ try {
672
+ return __webpack_require__(Object(function() {
673
+ var e = new Error("Cannot find module './keyring.openharmony-arm64.node'");
674
+ e.code = 'MODULE_NOT_FOUND';
675
+ throw e;
676
+ }()));
677
+ } catch (e) {
678
+ loadErrors.push(e);
679
+ }
680
+ try {
681
+ const binding = __webpack_require__(Object(function() {
682
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-arm64'");
683
+ e.code = 'MODULE_NOT_FOUND';
684
+ throw e;
685
+ }()));
686
+ const bindingPackageVersion = __webpack_require__(Object(function() {
687
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-arm64/package.json'");
688
+ e.code = 'MODULE_NOT_FOUND';
689
+ throw e;
690
+ }()));
691
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
692
+ return binding;
693
+ } catch (e) {
694
+ loadErrors.push(e);
695
+ }
696
+ } else if ('x64' === process.arch) {
697
+ try {
698
+ return __webpack_require__(Object(function() {
699
+ var e = new Error("Cannot find module './keyring.openharmony-x64.node'");
700
+ e.code = 'MODULE_NOT_FOUND';
701
+ throw e;
702
+ }()));
703
+ } catch (e) {
704
+ loadErrors.push(e);
705
+ }
706
+ try {
707
+ const binding = __webpack_require__(Object(function() {
708
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-x64'");
709
+ e.code = 'MODULE_NOT_FOUND';
710
+ throw e;
711
+ }()));
712
+ const bindingPackageVersion = __webpack_require__(Object(function() {
713
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-x64/package.json'");
714
+ e.code = 'MODULE_NOT_FOUND';
715
+ throw e;
716
+ }()));
717
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
718
+ return binding;
719
+ } catch (e) {
720
+ loadErrors.push(e);
721
+ }
722
+ } else if ('arm' === process.arch) {
723
+ try {
724
+ return __webpack_require__(Object(function() {
725
+ var e = new Error("Cannot find module './keyring.openharmony-arm.node'");
726
+ e.code = 'MODULE_NOT_FOUND';
727
+ throw e;
728
+ }()));
729
+ } catch (e) {
730
+ loadErrors.push(e);
731
+ }
732
+ try {
733
+ const binding = __webpack_require__(Object(function() {
734
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-arm'");
735
+ e.code = 'MODULE_NOT_FOUND';
736
+ throw e;
737
+ }()));
738
+ const bindingPackageVersion = __webpack_require__(Object(function() {
739
+ var e = new Error("Cannot find module '@napi-rs/keyring-openharmony-arm/package.json'");
740
+ e.code = 'MODULE_NOT_FOUND';
741
+ throw e;
742
+ }()));
743
+ if ('1.2.0' !== bindingPackageVersion && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && '0' !== process.env.NAPI_RS_ENFORCE_VERSION_CHECK) throw new Error(`Native binding package version mismatch, expected 1.2.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
744
+ return binding;
745
+ } catch (e) {
746
+ loadErrors.push(e);
747
+ }
748
+ } else loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
749
+ else loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
750
+ }
751
+ nativeBinding = requireNative();
752
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
753
+ try {
754
+ nativeBinding = __webpack_require__(Object(function() {
755
+ var e = new Error("Cannot find module './keyring.wasi.cjs'");
756
+ e.code = 'MODULE_NOT_FOUND';
757
+ throw e;
758
+ }()));
759
+ } catch (err) {
760
+ if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
761
+ }
762
+ if (!nativeBinding) try {
763
+ nativeBinding = __webpack_require__(Object(function() {
764
+ var e = new Error("Cannot find module '@napi-rs/keyring-wasm32-wasi'");
765
+ e.code = 'MODULE_NOT_FOUND';
766
+ throw e;
767
+ }()));
768
+ } catch (err) {
769
+ if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
770
+ }
771
+ }
772
+ if (!nativeBinding) {
773
+ if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", {
774
+ cause: loadErrors
775
+ });
776
+ throw new Error("Failed to load native binding");
777
+ }
778
+ module.exports = nativeBinding;
779
+ module.exports.AsyncEntry = nativeBinding.AsyncEntry;
780
+ module.exports.Entry = nativeBinding.Entry;
781
+ module.exports.findCredentials = nativeBinding.findCredentials;
782
+ module.exports.findCredentialsAsync = nativeBinding.findCredentialsAsync;
783
+ },
784
+ "./node_modules/.pnpm/@napi-rs+keyring-darwin-arm64@1.2.0/node_modules/@napi-rs/keyring-darwin-arm64/keyring.darwin-arm64.node" (module, __unused_rspack_exports, __webpack_require__) {
785
+ module = __webpack_require__.nmd(module);
786
+ try {
787
+ const path = __webpack_require__("node:path");
788
+ process.dlopen(module, path.join(__dirname, "keyring.darwin-arm64.node"));
789
+ } catch (error) {
790
+ throw new Error('Failed to load Node.js addon: "keyring.darwin-arm64.node"', {
791
+ cause: error
792
+ });
793
+ }
794
+ },
97
795
  "./node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js" (__unused_rspack_module, exports1) {
98
796
  "use strict";
99
797
  Object.defineProperty(exports1, "__esModule", {
@@ -29804,6 +30502,10 @@ var __webpack_modules__ = {
29804
30502
  "use strict";
29805
30503
  module.exports = require("buffer");
29806
30504
  },
30505
+ child_process (module) {
30506
+ "use strict";
30507
+ module.exports = require("child_process");
30508
+ },
29807
30509
  crypto (module) {
29808
30510
  "use strict";
29809
30511
  module.exports = require("crypto");
@@ -29840,6 +30542,10 @@ var __webpack_modules__ = {
29840
30542
  "use strict";
29841
30543
  module.exports = require("node:fs");
29842
30544
  },
30545
+ "node:module" (module) {
30546
+ "use strict";
30547
+ module.exports = require("node:module");
30548
+ },
29843
30549
  "node:path" (module) {
29844
30550
  "use strict";
29845
30551
  module.exports = require("node:path");
@@ -32314,6 +33020,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
32314
33020
  colors.bgWhiteBright = format(107, 49);
32315
33021
  module.exports = colors;
32316
33022
  },
33023
+ "./node_modules/.pnpm/@napi-rs+keyring-darwin-arm64@1.2.0/node_modules/@napi-rs/keyring-darwin-arm64/package.json" (module) {
33024
+ "use strict";
33025
+ module.exports = {
33026
+ rE: "1.2.0"
33027
+ };
33028
+ },
32317
33029
  "./node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json" (module) {
32318
33030
  "use strict";
32319
33031
  module.exports = JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}');
@@ -34169,7 +34881,7 @@ var __webpack_exports__ = {};
34169
34881
  return `${lines}\u001b[?25l`;
34170
34882
  });
34171
34883
  var chardet_lib = __webpack_require__("./node_modules/.pnpm/chardet@2.1.1/node_modules/chardet/lib/index.js");
34172
- const external_child_process_namespaceObject = require("child_process");
34884
+ var external_child_process_ = __webpack_require__("child_process");
34173
34885
  var external_node_path_ = __webpack_require__("node:path");
34174
34886
  const external_node_crypto_namespaceObject = require("node:crypto");
34175
34887
  var iconv_lite_lib = __webpack_require__("./node_modules/.pnpm/iconv-lite@0.7.2/node_modules/iconv-lite/lib/index.js");
@@ -34324,7 +35036,7 @@ var __webpack_exports__ = {};
34324
35036
  }
34325
35037
  launchEditor() {
34326
35038
  try {
34327
- const editorProcess = (0, external_child_process_namespaceObject.spawnSync)(this.editor.bin, this.editor.args.concat([
35039
+ const editorProcess = (0, external_child_process_.spawnSync)(this.editor.bin, this.editor.args.concat([
34328
35040
  this.tempFile
34329
35041
  ]), {
34330
35042
  stdio: 'inherit'
@@ -34336,7 +35048,7 @@ var __webpack_exports__ = {};
34336
35048
  }
34337
35049
  launchEditorAsync(callback) {
34338
35050
  try {
34339
- const editorProcess = (0, external_child_process_namespaceObject.spawn)(this.editor.bin, this.editor.args.concat([
35051
+ const editorProcess = (0, external_child_process_.spawn)(this.editor.bin, this.editor.args.concat([
34340
35052
  this.tempFile
34341
35053
  ]), {
34342
35054
  stdio: 'inherit'
@@ -38258,7 +38970,7 @@ var __webpack_exports__ = {};
38258
38970
  rejection = reason || rejection;
38259
38971
  }
38260
38972
  });
38261
- const spawned = (0, external_child_process_namespaceObject.spawn)(command, args, spawnOptions);
38973
+ const spawned = (0, external_child_process_.spawn)(command, args, spawnOptions);
38262
38974
  spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut")));
38263
38975
  spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr")));
38264
38976
  spawned.on("error", onErrorReceived(stdErr, logger));
@@ -41550,6 +42262,57 @@ var __webpack_exports__ = {};
41550
42262
  issues: dataset.issues
41551
42263
  };
41552
42264
  }
42265
+ let Entry = null;
42266
+ let loadAttempted = false;
42267
+ function loadKeyring() {
42268
+ if (loadAttempted) return Entry;
42269
+ loadAttempted = true;
42270
+ try {
42271
+ const mod = __webpack_require__("./node_modules/.pnpm/@napi-rs+keyring@1.2.0/node_modules/@napi-rs/keyring/index.js");
42272
+ Entry = mod.Entry;
42273
+ } catch {}
42274
+ return Entry;
42275
+ }
42276
+ function getServiceName(url) {
42277
+ return `anvil-cli:${url}`;
42278
+ }
42279
+ function keychainGet(url, username) {
42280
+ if (isTestMode()) return null;
42281
+ const Ctor = loadKeyring();
42282
+ if (!Ctor) return null;
42283
+ try {
42284
+ const entry = new Ctor(getServiceName(url), username);
42285
+ const raw = entry.getPassword();
42286
+ const parsed = JSON.parse(raw);
42287
+ return {
42288
+ authToken: parsed.authToken ?? null,
42289
+ refreshToken: parsed.refreshToken ?? null
42290
+ };
42291
+ } catch {
42292
+ return null;
42293
+ }
42294
+ }
42295
+ function keychainSet(url, username, secrets) {
42296
+ if (isTestMode()) return false;
42297
+ const Ctor = loadKeyring();
42298
+ if (!Ctor) return false;
42299
+ try {
42300
+ const entry = new Ctor(getServiceName(url), username);
42301
+ entry.setPassword(JSON.stringify(secrets));
42302
+ return true;
42303
+ } catch {
42304
+ return false;
42305
+ }
42306
+ }
42307
+ function keychainDelete(url, username) {
42308
+ if (isTestMode()) return;
42309
+ const Ctor = loadKeyring();
42310
+ if (!Ctor) return;
42311
+ try {
42312
+ const entry = new Ctor(getServiceName(url), username);
42313
+ entry.deletePassword();
42314
+ } catch {}
42315
+ }
41553
42316
  const EMPTY_TOKENS = {
41554
42317
  authToken: null,
41555
42318
  refreshToken: null,
@@ -41583,17 +42346,30 @@ var __webpack_exports__ = {};
41583
42346
  const normalized = normalizeAnvilUrl(url);
41584
42347
  return store[normalized];
41585
42348
  }
42349
+ function token_store_getAccountTokens(url, username) {
42350
+ const urlTokens = getUrlTokens(url);
42351
+ if (!urlTokens || !urlTokens[username]) return {
42352
+ ...EMPTY_TOKENS
42353
+ };
42354
+ const configTokens = urlTokens[username];
42355
+ if (!configTokens.authToken && !configTokens.refreshToken) {
42356
+ const secrets = keychainGet(normalizeAnvilUrl(url), username);
42357
+ if (secrets) return {
42358
+ ...configTokens,
42359
+ ...secrets
42360
+ };
42361
+ }
42362
+ return configTokens;
42363
+ }
41586
42364
  function token_store_getTokensAutoSelect(url, username) {
41587
42365
  const normalized = normalizeAnvilUrl(url);
42366
+ if (username) return token_store_getAccountTokens(normalized, username);
41588
42367
  const urlTokens = getUrlTokens(normalized);
41589
42368
  if (!urlTokens) return {
41590
42369
  ...EMPTY_TOKENS
41591
42370
  };
41592
- if (username) return urlTokens[username] ?? {
41593
- ...EMPTY_TOKENS
41594
- };
41595
42371
  const accounts = Object.keys(urlTokens);
41596
- if (1 === accounts.length) return urlTokens[accounts[0]];
42372
+ if (1 === accounts.length) return token_store_getAccountTokens(normalized, accounts[0]);
41597
42373
  return {
41598
42374
  ...EMPTY_TOKENS
41599
42375
  };
@@ -41602,11 +42378,21 @@ var __webpack_exports__ = {};
41602
42378
  const normalized = normalizeAnvilUrl(url);
41603
42379
  const store = getTokenStore();
41604
42380
  if (!store[normalized]) store[normalized] = {};
41605
- store[normalized][username] = tokens;
42381
+ const keychainOk = keychainSet(normalized, username, {
42382
+ authToken: tokens.authToken,
42383
+ refreshToken: tokens.refreshToken
42384
+ });
42385
+ if (keychainOk) store[normalized][username] = {
42386
+ authToken: null,
42387
+ refreshToken: null,
42388
+ authTokenExpiresAt: tokens.authTokenExpiresAt
42389
+ };
42390
+ else store[normalized][username] = tokens;
41606
42391
  setTokenStore(store);
41607
42392
  }
41608
42393
  function deleteAccountTokens(url, username) {
41609
42394
  const normalized = normalizeAnvilUrl(url);
42395
+ keychainDelete(normalized, username);
41610
42396
  const store = getTokenStore();
41611
42397
  if (!store[normalized] || !store[normalized][username]) return false;
41612
42398
  delete store[normalized][username];
@@ -41618,24 +42404,38 @@ var __webpack_exports__ = {};
41618
42404
  const normalized = normalizeAnvilUrl(url);
41619
42405
  const store = getTokenStore();
41620
42406
  if (!store[normalized]) return false;
42407
+ for (const username of Object.keys(store[normalized]))keychainDelete(normalized, username);
41621
42408
  delete store[normalized];
41622
42409
  setTokenStore(store);
41623
42410
  return true;
41624
42411
  }
41625
42412
  function findAccountByRefreshToken(url, refreshToken) {
41626
- const urlTokens = getUrlTokens(url);
42413
+ const normalized = normalizeAnvilUrl(url);
42414
+ const urlTokens = getUrlTokens(normalized);
41627
42415
  if (!urlTokens) return;
41628
- for (const [username, tokens] of Object.entries(urlTokens))if (tokens.refreshToken === refreshToken) return username;
42416
+ for (const [username, tokens] of Object.entries(urlTokens)){
42417
+ if (tokens.refreshToken === refreshToken) return username;
42418
+ if (!tokens.refreshToken) {
42419
+ const secrets = keychainGet(normalized, username);
42420
+ if (secrets?.refreshToken === refreshToken) return username;
42421
+ }
42422
+ }
41629
42423
  }
41630
42424
  function getAccountsForUrl(url) {
41631
42425
  const normalized = normalizeAnvilUrl(url);
41632
42426
  const urlTokens = getUrlTokens(normalized);
41633
42427
  if (!urlTokens) return [];
41634
- return Object.entries(urlTokens).filter(([_, tokens])=>tokens.authToken || tokens.refreshToken).map(([username])=>username).sort();
42428
+ return Object.entries(urlTokens).filter(([username, tokens])=>{
42429
+ if (tokens.authToken || tokens.refreshToken) return true;
42430
+ return null !== keychainGet(normalized, username);
42431
+ }).map(([username])=>username).sort();
41635
42432
  }
41636
42433
  function getAvailableUrls() {
41637
42434
  const store = getTokenStore();
41638
- return Object.entries(store).filter(([_, urlTokens])=>Object.values(urlTokens).some((tokens)=>tokens.authToken || tokens.refreshToken)).map(([url])=>url).sort();
42435
+ return Object.entries(store).filter(([url, urlTokens])=>Object.entries(urlTokens).some(([username, tokens])=>{
42436
+ if (tokens.authToken || tokens.refreshToken) return true;
42437
+ return null !== keychainGet(url, username);
42438
+ })).map(([url])=>url).sort();
41639
42439
  }
41640
42440
  function token_store_hasTokens(url, username) {
41641
42441
  const normalized = normalizeAnvilUrl(url);
@@ -41643,11 +42443,18 @@ var __webpack_exports__ = {};
41643
42443
  if (!urlTokens) return false;
41644
42444
  if (username) {
41645
42445
  const tokens = urlTokens[username];
41646
- return !!(tokens && (tokens.authToken || tokens.refreshToken));
42446
+ if (!tokens) return false;
42447
+ if (tokens.authToken || tokens.refreshToken) return true;
42448
+ return null !== keychainGet(normalized, username);
41647
42449
  }
41648
- return Object.values(urlTokens).some((tokens)=>tokens.authToken || tokens.refreshToken);
42450
+ return Object.entries(urlTokens).some(([uname, tokens])=>{
42451
+ if (tokens.authToken || tokens.refreshToken) return true;
42452
+ return null !== keychainGet(normalized, uname);
42453
+ });
41649
42454
  }
41650
42455
  function clearAllTokens() {
42456
+ const store = getTokenStore();
42457
+ for (const [url, urlTokens] of Object.entries(store))for (const username of Object.keys(urlTokens))keychainDelete(url, username);
41651
42458
  setTokenStore({});
41652
42459
  }
41653
42460
  const configDefaults = {
@@ -46782,8 +47589,8 @@ var __webpack_exports__ = {};
46782
47589
  logger_logger.debug(`[WebSocket ${this.sessionId}]`, `Closed: code=${code}, reason=${reason.toString()}`);
46783
47590
  this.ws = null;
46784
47591
  if (1008 === code || reason.toString().includes("unauthenticated")) {
46785
- logger_logger.warn(chalk_source.yellow(" WebSocket authentication failed - real-time sync disabled"));
46786
- logger_logger.verbose(chalk_source.gray(" File watching will continue, but remote changes won't be detected until you save"));
47592
+ logger_logger.warn(chalk_source.yellow(" WebSocket authentication failed - changes from the Anvil Editor won't be detected"));
47593
+ logger_logger.verbose(chalk_source.gray(" Local changes will still sync to Anvil, but editor changes won't appear locally"));
46787
47594
  this.emit("auth-failed", void 0);
46788
47595
  return;
46789
47596
  }
@@ -46801,7 +47608,7 @@ var __webpack_exports__ = {};
46801
47608
  });
46802
47609
  });
46803
47610
  }, this.RECONNECT_DELAY);
46804
- } else logger_logger.warn(chalk_source.yellow(` WebSocket reconnection failed after ${this.MAX_RECONNECT_ATTEMPTS} attempts. Real-time sync disabled.`));
47611
+ } else logger_logger.warn(chalk_source.yellow(` WebSocket reconnection failed after ${this.MAX_RECONNECT_ATTEMPTS} attempts - changes from the Anvil Editor won't be detected`));
46805
47612
  });
46806
47613
  this.ws.on("error", (error)=>{
46807
47614
  logger_logger.debug(`[WebSocket ${this.sessionId}]`, `Error: ${error.message}`);
@@ -48626,8 +49433,8 @@ var __webpack_exports__ = {};
48626
49433
  try {
48627
49434
  await this.connectWebSocket();
48628
49435
  } catch (error) {
48629
- logger_logger.warn(chalk_source.yellow(" WebSocket connection unavailable - real-time sync disabled"));
48630
- logger_logger.verbose(chalk_source.gray(" (Server may need to support token-based WebSocket auth)"));
49436
+ logger_logger.warn(chalk_source.yellow(" WebSocket connection unavailable - changes from the Anvil Editor won't be detected"));
49437
+ logger_logger.verbose(chalk_source.gray(" Local changes will still sync to Anvil, but editor changes won't appear locally"));
48631
49438
  logger_logger.debug("WebSocket init error:", error.message);
48632
49439
  }
48633
49440
  }
@@ -50506,7 +51313,7 @@ var __webpack_exports__ = {};
50506
51313
  loginCommand.addHelpText("after", "\n" + chalk_source.bold("Examples:") + "\n anvil login Log in to default Anvil server\n anvil login anvil.works Log in to anvil.works\n anvil login localhost Log in to local Anvil server\n");
50507
51314
  }
50508
51315
  function registerLogoutCommand(program) {
50509
- const logoutCommand = program.command("logout [anvil-server-url]").description("Logout from Anvil (optionally specify URL to logout from specific installation)").option("-u, --url <ANVIL_URL>", "Specify Anvil server URL to logout from").option("-U, --user <USERNAME>", "Specify which user account to logout from").alias("lo").action(async (anvilUrl, options)=>{
51316
+ const logoutCommand = program.command("logout [anvil-server-url]").description("Log out from Anvil (optionally specify URL to logout from specific installation)").option("-u, --url <ANVIL_URL>", "Specify Anvil server URL to logout from").option("-U, --user <USERNAME>", "Specify which user account to logout from").alias("lo").action(async (anvilUrl, options)=>{
50510
51317
  try {
50511
51318
  const urlToLogout = options?.url || anvilUrl;
50512
51319
  const usernameToLogout = options?.user;
@@ -50693,14 +51500,6 @@ var __webpack_exports__ = {};
50693
51500
  logger_logger.error(`Unexpected error: ${reason}`);
50694
51501
  process.exit(1);
50695
51502
  });
50696
- function showBetaBanner() {
50697
- console.log();
50698
- console.log(chalk_source.yellow("┌────────────────────────────────────────────────────────┐"));
50699
- console.log(chalk_source.yellow("│") + chalk_source.bgYellow.black.bold(" BETA ") + chalk_source.yellow(" This tool is in beta. Please report issues at: │"));
50700
- console.log(chalk_source.yellow("│") + chalk_source.gray(" https://github.com/anvil-works/anvil-cli/issues") + chalk_source.yellow(" │"));
50701
- console.log(chalk_source.yellow("└────────────────────────────────────────────────────────┘"));
50702
- console.log();
50703
- }
50704
51503
  async function checkVersionAndWarn() {
50705
51504
  getLatestVersion().then((latestVersion)=>{
50706
51505
  if (latestVersion && semver_default().valid(VERSION) && semver_default().valid(latestVersion) && semver_default().lt(VERSION, latestVersion)) {
@@ -50748,13 +51547,12 @@ var __webpack_exports__ = {};
50748
51547
  }
50749
51548
  }
50750
51549
  const cli_program = new Command();
50751
- cli_program.name("anvil").description("CLI tool for developing Anvil apps locally").version(VERSION, "-v, --version", "output the version number").option("--json", "Output in JSON format (NDJSON) for scripting/LLM consumption").hook("preAction", async (thisCommand, actionCommand)=>{
51550
+ cli_program.name("anvil").description("CLI tool for developing Anvil apps locally").version(VERSION, "-v, --version", "Output the version number").option("--json", "Output in JSON format (NDJSON) for scripting/LLM consumption").helpOption('-h, --help', 'Display help for anvil command').hook("preAction", async (thisCommand, actionCommand)=>{
50752
51551
  const opts = thisCommand.opts();
50753
51552
  if (opts.json) setGlobalOutputConfig({
50754
51553
  jsonMode: true
50755
51554
  });
50756
51555
  if (!opts.json) {
50757
- showBetaBanner();
50758
51556
  const commandName = actionCommand?.name();
50759
51557
  if ("update" !== commandName) checkVersionAndWarn();
50760
51558
  }