@paybox-sh/sdk 2.2.0 → 2.3.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
@@ -13,7 +13,7 @@ import {
13
13
  pendingFundingToolResponse,
14
14
  refreshTokens,
15
15
  saveConfig
16
- } from "./chunk-DWDC6W5P.js";
16
+ } from "./chunk-YTHYNUMM.js";
17
17
 
18
18
  // src/cli.ts
19
19
  import { spawnSync } from "node:child_process";
@@ -344,284 +344,20 @@ var sha256 = /* @__PURE__ */ createHasher(() => new SHA256());
344
344
  var sha2562 = sha256;
345
345
 
346
346
  // node_modules/.pnpm/@paybox+mcp-app@file+..+mcp-app_@modelcontextprotocol+sdk@1.29.0_zod@4.4.3__bn.js@5.2.3_ac1e09a20c76a1143611be5dd3d4f9db/node_modules/@paybox/mcp-app/src/signing/agent-code.ts
347
- var ALPHABET = [
348
- "\u{1F436}",
349
- "\u{1F431}",
350
- "\u{1F42D}",
351
- "\u{1F430}",
352
- "\u{1F98A}",
353
- "\u{1F43B}",
354
- "\u{1F43C}",
355
- "\u{1F981}",
356
- "\u{1F42E}",
357
- "\u{1F437}",
358
- "\u{1F438}",
359
- "\u{1F435}",
360
- "\u{1F414}",
361
- "\u{1F427}",
362
- "\u{1F426}",
363
- "\u{1F424}",
364
- "\u{1F986}",
365
- "\u{1F985}",
366
- "\u{1F989}",
367
- "\u{1F987}",
368
- "\u{1F417}",
369
- "\u{1F434}",
370
- "\u{1F984}",
371
- "\u{1F41D}",
372
- "\u{1F41B}",
373
- "\u{1F98B}",
374
- "\u{1F40C}",
375
- "\u{1F41E}",
376
- "\u{1F41C}",
377
- "\u{1F422}",
378
- "\u{1F40D}",
379
- "\u{1F98E}",
380
- "\u{1F419}",
381
- "\u{1F990}",
382
- "\u{1F980}",
383
- "\u{1F421}",
384
- "\u{1F420}",
385
- "\u{1F42C}",
386
- "\u{1F433}",
387
- "\u{1F988}",
388
- "\u{1F406}",
389
- "\u{1F993}",
390
- "\u{1F98D}",
391
- "\u{1F418}",
392
- "\u{1F98F}",
393
- "\u{1F42A}",
394
- "\u{1F992}",
395
- "\u{1F411}",
396
- "\u{1F98C}",
397
- "\u{1F983}",
398
- "\u{1F99A}",
399
- "\u{1F335}",
400
- "\u{1F384}",
401
- "\u{1F333}",
402
- "\u{1F334}",
403
- "\u{1F331}",
404
- "\u{1F340}",
405
- "\u{1F38D}",
406
- "\u{1F341}",
407
- "\u{1F342}",
408
- "\u{1F343}",
409
- "\u{1F33B}",
410
- "\u{1F339}",
411
- "\u{1F337}",
412
- "\u{1F338}",
413
- "\u{1F33C}",
414
- "\u{1F33E}",
415
- "\u{1F490}",
416
- "\u{1F344}",
417
- "\u{1F330}",
418
- "\u{1F30D}",
419
- "\u{1F319}",
420
- "\u2B50",
421
- "\u{1F308}",
422
- "\u{1F525}",
423
- "\u{1F4A7}",
424
- "\u{1F30A}",
425
- "\u{1F32A}",
426
- "\u{1F329}",
427
- "\u{1F347}",
428
- "\u{1F349}",
429
- "\u{1F34A}",
430
- "\u{1F34B}",
431
- "\u{1F34C}",
432
- "\u{1F34D}",
433
- "\u{1F34E}",
434
- "\u{1F350}",
435
- "\u{1F351}",
436
- "\u{1F352}",
437
- "\u{1F353}",
438
- "\u{1F95D}",
439
- "\u{1F951}",
440
- "\u{1F346}",
441
- "\u{1F955}",
442
- "\u{1F33D}",
443
- "\u{1F966}",
444
- "\u{1F952}",
445
- "\u{1F95C}",
446
- "\u{1F35E}",
447
- "\u{1F950}",
448
- "\u{1F9C0}",
449
- "\u{1F373}",
450
- "\u{1F95E}",
451
- "\u{1F354}",
452
- "\u{1F35F}",
453
- "\u{1F355}",
454
- "\u{1F32D}",
455
- "\u{1F32E}",
456
- "\u{1F32F}",
457
- "\u{1F35C}",
458
- "\u{1F360}",
459
- "\u{1F364}",
460
- "\u{1F365}",
461
- "\u{1F366}",
462
- "\u{1F368}",
463
- "\u{1F369}",
464
- "\u{1F36A}",
465
- "\u{1F382}",
466
- "\u{1F370}",
467
- "\u{1F36B}",
468
- "\u{1F36C}",
469
- "\u{1F36D}",
470
- "\u{1F36E}",
471
- "\u{1F36F}",
472
- "\u{1F37C}",
473
- "\u{1F95B}",
474
- "\u2615",
475
- "\u{1F375}",
476
- "\u{1F376}",
477
- "\u{1F37E}",
478
- "\u{1F377}",
479
- "\u{1F378}",
480
- "\u{1F379}",
481
- "\u{1F37A}",
482
- "\u{1F943}",
483
- "\u26BD",
484
- "\u{1F3C0}",
485
- "\u{1F3C8}",
486
- "\u26BE",
487
- "\u{1F3BE}",
488
- "\u{1F3B1}",
489
- "\u{1F3D3}",
490
- "\u{1F3F8}",
491
- "\u{1F945}",
492
- "\u{1F3D2}",
493
- "\u{1F3F9}",
494
- "\u{1F3A3}",
495
- "\u{1F94A}",
496
- "\u{1F3BF}",
497
- "\u{1F6F7}",
498
- "\u{1F3AF}",
499
- "\u{1F3AE}",
500
- "\u{1F3B2}",
501
- "\u{1F3B8}",
502
- "\u{1F3BA}",
503
- "\u{1F941}",
504
- "\u{1F3B9}",
505
- "\u{1F3A4}",
506
- "\u{1F3A7}",
507
- "\u{1F4FB}",
508
- "\u{1F3AC}",
509
- "\u{1F3A8}",
510
- "\u{1F3AA}",
511
- "\u{1F680}",
512
- "\u{1F6F8}",
513
- "\u{1F681}",
514
- "\u{1F682}",
515
- "\u{1F684}",
516
- "\u{1F68C}",
517
- "\u{1F691}",
518
- "\u{1F693}",
519
- "\u{1F695}",
520
- "\u{1F697}",
521
- "\u{1F69A}",
522
- "\u{1F69C}",
523
- "\u{1F6B2}",
524
- "\u26F5",
525
- "\u{1F6F6}",
526
- "\u{1F6A4}",
527
- "\u{1F5FF}",
528
- "\u{1F5FD}",
529
- "\u{1F3A1}",
530
- "\u{1F3A2}",
531
- "\u{1F3A0}",
532
- "\u26F2",
533
- "\u{1F3F0}",
534
- "\u{1F3DF}",
535
- "\u{1F3AD}",
536
- "\u{1F381}",
537
- "\u{1F9ED}",
538
- "\u231A",
539
- "\u{1F4F1}",
540
- "\u{1F4BB}",
541
- "\u{1F4F7}",
542
- "\u{1F4FA}",
543
- "\u{1F4DE}",
544
- "\u{1F4E0}",
545
- "\u{1F50B}",
546
- "\u{1F50C}",
547
- "\u{1F4A1}",
548
- "\u{1F526}",
549
- "\u{1F56F}",
550
- "\u{1F5D1}",
551
- "\u{1F4B8}",
552
- "\u{1F4B0}",
553
- "\u{1F4B3}",
554
- "\u{1F48E}",
555
- "\u{1F527}",
556
- "\u{1F528}",
557
- "\u{1F529}",
558
- "\u{1F52B}",
559
- "\u{1F4A3}",
560
- "\u{1F52A}",
561
- "\u{1F52E}",
562
- "\u{1F4FF}",
563
- "\u{1F52C}",
564
- "\u{1F4D4}",
565
- "\u{1F4DA}",
566
- "\u{1F31E}",
567
- "\u26C4",
568
- "\u2614",
569
- "\u{1F30B}",
570
- "\u{1F94C}",
571
- "\u{1F3E0}",
572
- "\u{1F3E5}",
573
- "\u{1F3ED}",
574
- "\u{1F511}",
575
- "\u{1F512}",
576
- "\u23F0",
577
- "\u231B",
578
- "\u{1F4C5}",
579
- "\u{1F4CC}",
580
- "\u{1F4CE}",
581
- "\u{1F4CF}",
582
- "\u{1F388}",
583
- "\u{1F383}",
584
- "\u{1F451}",
585
- "\u{1F453}",
586
- "\u{1F3A9}",
587
- "\u{1F45F}",
588
- "\u{1F462}",
589
- "\u{1F45C}",
590
- "\u{1F392}",
591
- "\u{1F9F2}",
592
- "\u{1F9EA}",
593
- "\u{1F9EC}",
594
- "\u{1F9F8}",
595
- "\u{1F9E6}",
596
- "\u{1F9E2}",
597
- "\u{1F3C6}",
598
- "\u{1F6F4}",
599
- "\u{1FA90}",
600
- "\u{1F3B3}",
601
- "\u{1F6A6}",
602
- "\u{1F9EF}",
603
- "\u{1F9F9}"
604
- ];
605
347
  function toHex(bytes) {
606
348
  return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
607
349
  }
608
- var CODE_LENGTH = 8;
609
- if (ALPHABET.length !== 256) {
610
- throw new Error(`agent-code alphabet must be exactly 256 entries, got ${ALPHABET.length}`);
611
- }
612
- function sha2563(bytes) {
613
- return sha2562(bytes);
614
- }
350
+ var CODE_MIN = 10;
351
+ var CODE_SPAN = 90;
615
352
  function codeFromDigest(digest) {
616
- const code = [];
617
- for (let i = 0; i < CODE_LENGTH; i += 1) code.push(ALPHABET[digest[i]]);
618
- return code;
353
+ const value = new DataView(digest.buffer, digest.byteOffset, 4).getUint32(0);
354
+ return String(CODE_MIN + value % CODE_SPAN);
619
355
  }
620
356
  async function deriveAgentCode(publicKey) {
621
357
  if (publicKey.length !== 32) {
622
358
  throw new Error(`public key must be 32 bytes, got ${publicKey.length}`);
623
359
  }
624
- return codeFromDigest(sha2563(publicKey));
360
+ return codeFromDigest(sha2562(publicKey));
625
361
  }
626
362
 
627
363
  // src/pairing.ts
@@ -681,7 +417,7 @@ async function pairSigningKey(opts) {
681
417
  if (status === "cancelled") throw new Error("that request was declined in PayBox");
682
418
  if (status === "expired") throw new Error("that request expired \u2014 run `paybox connect` again");
683
419
  }
684
- throw new Error("timed out waiting for you to pick the code in PayBox");
420
+ throw new Error("timed out waiting for you to pick the number in PayBox");
685
421
  }
686
422
 
687
423
  // src/cli.ts
@@ -807,7 +543,7 @@ program.command("login").description("Authenticate via OAuth device approval, or
807
543
  }
808
544
  })
809
545
  );
810
- program.command("connect").description("Connect a wallet signing key to this machine by picking a code in PayBox").option("--app-url <url>", "PayBox app origin (default: derived from --base-url)").option("--no-open", "print the pairing link without opening a browser").action(
546
+ program.command("connect").description("Connect a wallet signing key to this machine by picking a number in PayBox").option("--app-url <url>", "PayBox app origin (default: derived from --base-url)").option("--no-open", "print the pairing link without opening a browser").action(
811
547
  (opts) => run(async () => {
812
548
  const cfg = loadConfig();
813
549
  const baseUrl = resolveBaseUrl();
@@ -826,9 +562,9 @@ program.command("connect").description("Connect a wallet signing key to this mac
826
562
  bearer,
827
563
  onCode(code, url) {
828
564
  console.error(`
829
- ${code.join(" ")}
565
+ ${code}
830
566
  `);
831
- console.error(`Open this on any device and pick that code to connect this machine:
567
+ console.error(`Open this on any device and pick that number to connect this machine:
832
568
  ${url}
833
569
  `);
834
570
  if (opts.open) openBrowser(url);