@fleetless/sdk 5.1.0 → 5.2.0-next.1

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/index.js CHANGED
@@ -413,16 +413,16 @@ function createAssetsApi(http) {
413
413
  };
414
414
  }
415
415
 
416
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-restore.js
416
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-restore.js
417
417
  import { z as z6 } from "zod";
418
418
 
419
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-intents.js
419
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-intents.js
420
420
  import { z as z5 } from "zod";
421
421
 
422
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/app-users.js
422
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/app-users.js
423
423
  import { z as z4 } from "zod";
424
424
 
425
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/identity.js
425
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/identity.js
426
426
  import { z } from "zod";
427
427
  var password = z.string().min(12).max(256);
428
428
  var USER_DISPLAY_NAME_MAX = 120;
@@ -645,7 +645,95 @@ var recoveryCodesResponse = z.object({
645
645
  recovery_codes: recoveryCodesList.meta({ description: "The ten new recovery codes, lowercase, shown once. Every earlier code is void." })
646
646
  });
647
647
 
648
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/legal.js
648
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/app-mail-html.js
649
+ var DEFAULT_MAIL_HTML = {
650
+ "invite": `<!doctype html>
651
+ <html lang="en">
652
+ <head>
653
+ <meta charset="utf-8">
654
+ <meta name="viewport" content="width=device-width, initial-scale=1">
655
+ <meta name="x-apple-disable-message-reformatting">
656
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
657
+ <meta name="color-scheme" content="light only">
658
+ <meta name="supported-color-schemes" content="light only">
659
+ <title>You&#39;re invited to {{ app.name }}</title>
660
+ <style>@media only screen and (max-width:480px){.canvas-pad{padding:20px 12px 18px !important}.sheet-pad{padding:24px 20px !important}}</style>
661
+ </head>
662
+ <body style="margin:0;padding:0;background-color:#f4f6f5;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%"><div style="display:none;max-height:0;overflow:hidden;mso-hide:all;font-size:1px;line-height:1px;color:#f4f6f5;opacity:0">{{ org.name }} has invited you as {{ role.name }}.&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;</div>
663
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f4f6f5" style="width:100%;background-color:#f4f6f5;border-collapse:collapse"><tr><td align="center" class="canvas-pad" style="padding:24px 16px 22px">
664
+ <!--[if mso]><table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
665
+ <table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;margin:0 auto;border-collapse:separate"><tr><td class="sheet-pad" bgcolor="#ffffff" style="background-color:#ffffff;border:1px solid #dfe5e2;border-radius:16px;padding:32px 28px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td style="padding:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif">{% if app.logo_src and app.logo_shape == 'wide' %}<img src="{{ app.logo_src }}" width="168" height="32" alt="{{ app.name }}" style="display:block;border:0">{% elsif app.logo_src %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td width="32" style="width:32px"><img src="{{ app.logo_src }}" width="32" height="32" alt="" style="display:block;border:0"></td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% else %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td width="32" height="32" align="center" bgcolor="{{ app.accent }}" style="width:32px;height:32px;background-color:{{ app.accent }};border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:32px;font-weight:700;letter-spacing:0.02em;color:{{ app.on_accent }};text-align:center">{{ app.initials }}</td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% endif %}</td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><h1 style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:#101614;text-wrap:balance">You&#39;re invited to {{ app.name }}</h1></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Hello {{ user.display_name | default: user.email }},</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word"><b style="color:#101614;font-weight:600">{{ org.name }}</b> has invited you to {{ app.name }} as <b style="color:#101614;font-weight:600">{{ role.name }}</b>.</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate;table-layout:fixed"><tr><td align="center" bgcolor="{{ app.accent }}" style="background-color:{{ app.accent }};border-radius:10px"><a href="{{ link }}" style="display:block;padding:15px 18px;border-radius:10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:15px;font-weight:600;color:{{ app.on_accent }};text-decoration:none;text-align:center">Accept the invitation</a></td></tr><tr><td style="padding:8px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:18px;color:#5f6b66;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Or open this link: <span style="font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:12px">{{ link }}</span></td></tr></table></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you were not expecting this invitation, ignore this mail \u2014 no account is created until you accept.</p></td></tr></table></td></tr><tr><td style="padding:14px 8px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:11.5px;line-height:18px;color:#5f6b66">{% if app.operator_info_url and app.privacy_policy_url %}<p style="margin:0 0 3px"><span style="font-size:12px;font-weight:600;color:#33403b">{{ app.name }}</span> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.operator_info_url }}" style="color:#5f6b66;text-decoration:underline">Operator information</a> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.privacy_policy_url }}" style="color:#5f6b66;text-decoration:underline">Privacy policy</a></p>{% endif %}<p style="margin:0">Secured by Fleetless</p></td></tr></table>
666
+ <!--[if mso]></td></tr></table><![endif]-->
667
+ </td></tr></table>
668
+ </body>
669
+ </html>
670
+ `,
671
+ "verify": `<!doctype html>
672
+ <html lang="en">
673
+ <head>
674
+ <meta charset="utf-8">
675
+ <meta name="viewport" content="width=device-width, initial-scale=1">
676
+ <meta name="x-apple-disable-message-reformatting">
677
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
678
+ <meta name="color-scheme" content="light only">
679
+ <meta name="supported-color-schemes" content="light only">
680
+ <title>Confirm your email for {{ app.name }}</title>
681
+ <style>@media only screen and (max-width:480px){.canvas-pad{padding:20px 12px 18px !important}.sheet-pad{padding:24px 20px !important}}</style>
682
+ </head>
683
+ <body style="margin:0;padding:0;background-color:#f4f6f5;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%"><div style="display:none;max-height:0;overflow:hidden;mso-hide:all;font-size:1px;line-height:1px;color:#f4f6f5;opacity:0">Confirm this address so you can sign in.&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;</div>
684
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f4f6f5" style="width:100%;background-color:#f4f6f5;border-collapse:collapse"><tr><td align="center" class="canvas-pad" style="padding:24px 16px 22px">
685
+ <!--[if mso]><table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
686
+ <table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;margin:0 auto;border-collapse:separate"><tr><td class="sheet-pad" bgcolor="#ffffff" style="background-color:#ffffff;border:1px solid #dfe5e2;border-radius:16px;padding:32px 28px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td style="padding:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif">{% if app.logo_src and app.logo_shape == 'wide' %}<img src="{{ app.logo_src }}" width="168" height="32" alt="{{ app.name }}" style="display:block;border:0">{% elsif app.logo_src %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td width="32" style="width:32px"><img src="{{ app.logo_src }}" width="32" height="32" alt="" style="display:block;border:0"></td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% else %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td width="32" height="32" align="center" bgcolor="{{ app.accent }}" style="width:32px;height:32px;background-color:{{ app.accent }};border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:32px;font-weight:700;letter-spacing:0.02em;color:{{ app.on_accent }};text-align:center">{{ app.initials }}</td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% endif %}</td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><h1 style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:#101614;text-wrap:balance">Confirm your email for {{ app.name }}</h1></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Hello {{ user.email }},</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Confirm this address so you can sign in to {{ app.name }}.</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate;table-layout:fixed"><tr><td align="center" bgcolor="{{ app.accent }}" style="background-color:{{ app.accent }};border-radius:10px"><a href="{{ link }}" style="display:block;padding:15px 18px;border-radius:10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:15px;font-weight:600;color:{{ app.on_accent }};text-decoration:none;text-align:center">Confirm this address</a></td></tr><tr><td style="padding:8px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:18px;color:#5f6b66;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Or open this link: <span style="font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:12px">{{ link }}</span></td></tr></table></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you did not create this account, ignore this mail \u2014 the account stays unconfirmed and cannot be used.</p></td></tr></table></td></tr><tr><td style="padding:14px 8px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:11.5px;line-height:18px;color:#5f6b66">{% if app.operator_info_url and app.privacy_policy_url %}<p style="margin:0 0 3px"><span style="font-size:12px;font-weight:600;color:#33403b">{{ app.name }}</span> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.operator_info_url }}" style="color:#5f6b66;text-decoration:underline">Operator information</a> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.privacy_policy_url }}" style="color:#5f6b66;text-decoration:underline">Privacy policy</a></p>{% endif %}<p style="margin:0">Secured by Fleetless</p></td></tr></table>
687
+ <!--[if mso]></td></tr></table><![endif]-->
688
+ </td></tr></table>
689
+ </body>
690
+ </html>
691
+ `,
692
+ "reset": `<!doctype html>
693
+ <html lang="en">
694
+ <head>
695
+ <meta charset="utf-8">
696
+ <meta name="viewport" content="width=device-width, initial-scale=1">
697
+ <meta name="x-apple-disable-message-reformatting">
698
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
699
+ <meta name="color-scheme" content="light only">
700
+ <meta name="supported-color-schemes" content="light only">
701
+ <title>Reset your {{ app.name }} password</title>
702
+ <style>@media only screen and (max-width:480px){.canvas-pad{padding:20px 12px 18px !important}.sheet-pad{padding:24px 20px !important}}</style>
703
+ </head>
704
+ <body style="margin:0;padding:0;background-color:#f4f6f5;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%"><div style="display:none;max-height:0;overflow:hidden;mso-hide:all;font-size:1px;line-height:1px;color:#f4f6f5;opacity:0">Choose a new password, or ignore this mail.&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;</div>
705
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f4f6f5" style="width:100%;background-color:#f4f6f5;border-collapse:collapse"><tr><td align="center" class="canvas-pad" style="padding:24px 16px 22px">
706
+ <!--[if mso]><table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
707
+ <table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;margin:0 auto;border-collapse:separate"><tr><td class="sheet-pad" bgcolor="#ffffff" style="background-color:#ffffff;border:1px solid #dfe5e2;border-radius:16px;padding:32px 28px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td style="padding:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif">{% if app.logo_src and app.logo_shape == 'wide' %}<img src="{{ app.logo_src }}" width="168" height="32" alt="{{ app.name }}" style="display:block;border:0">{% elsif app.logo_src %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td width="32" style="width:32px"><img src="{{ app.logo_src }}" width="32" height="32" alt="" style="display:block;border:0"></td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% else %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td width="32" height="32" align="center" bgcolor="{{ app.accent }}" style="width:32px;height:32px;background-color:{{ app.accent }};border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:32px;font-weight:700;letter-spacing:0.02em;color:{{ app.on_accent }};text-align:center">{{ app.initials }}</td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% endif %}</td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><h1 style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:#101614;text-wrap:balance">Reset your {{ app.name }} password</h1></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Hello {{ user.email }},</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Someone asked to reset the password for this address at {{ app.name }}.</p></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate;table-layout:fixed"><tr><td align="center" bgcolor="{{ app.accent }}" style="background-color:{{ app.accent }};border-radius:10px"><a href="{{ link }}" style="display:block;padding:15px 18px;border-radius:10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:15px;font-weight:600;color:{{ app.on_accent }};text-decoration:none;text-align:center">Choose a new password</a></td></tr><tr><td style="padding:8px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:18px;color:#5f6b66;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">Or open this link: <span style="font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:12px">{{ link }}</span></td></tr></table></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If it was not you, ignore this mail \u2014 your current password keeps working and nothing changes.</p></td></tr></table></td></tr><tr><td style="padding:14px 8px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:11.5px;line-height:18px;color:#5f6b66">{% if app.operator_info_url and app.privacy_policy_url %}<p style="margin:0 0 3px"><span style="font-size:12px;font-weight:600;color:#33403b">{{ app.name }}</span> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.operator_info_url }}" style="color:#5f6b66;text-decoration:underline">Operator information</a> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.privacy_policy_url }}" style="color:#5f6b66;text-decoration:underline">Privacy policy</a></p>{% endif %}<p style="margin:0">Secured by Fleetless</p></td></tr></table>
708
+ <!--[if mso]></td></tr></table><![endif]-->
709
+ </td></tr></table>
710
+ </body>
711
+ </html>
712
+ `,
713
+ "login_code": `<!doctype html>
714
+ <html lang="en">
715
+ <head>
716
+ <meta charset="utf-8">
717
+ <meta name="viewport" content="width=device-width, initial-scale=1">
718
+ <meta name="x-apple-disable-message-reformatting">
719
+ <meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
720
+ <meta name="color-scheme" content="light only">
721
+ <meta name="supported-color-schemes" content="light only">
722
+ <title>Your {{ app.name }} sign-in code</title>
723
+ <style>@media only screen and (max-width:480px){.canvas-pad{padding:20px 12px 18px !important}.sheet-pad{padding:24px 20px !important}}</style>
724
+ </head>
725
+ <body style="margin:0;padding:0;background-color:#f4f6f5;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%"><div style="display:none;max-height:0;overflow:hidden;mso-hide:all;font-size:1px;line-height:1px;color:#f4f6f5;opacity:0">It works once, for {{ expires_in_minutes }} minutes.&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;&zwnj;&nbsp;</div>
726
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f4f6f5" style="width:100%;background-color:#f4f6f5;border-collapse:collapse"><tr><td align="center" class="canvas-pad" style="padding:24px 16px 22px">
727
+ <!--[if mso]><table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
728
+ <table role="presentation" width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="width:100%;max-width:600px;margin:0 auto;border-collapse:separate"><tr><td class="sheet-pad" bgcolor="#ffffff" style="background-color:#ffffff;border:1px solid #dfe5e2;border-radius:16px;padding:32px 28px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td style="padding:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif">{% if app.logo_src and app.logo_shape == 'wide' %}<img src="{{ app.logo_src }}" width="168" height="32" alt="{{ app.name }}" style="display:block;border:0">{% elsif app.logo_src %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse"><tr><td width="32" style="width:32px"><img src="{{ app.logo_src }}" width="32" height="32" alt="" style="display:block;border:0"></td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% else %}<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td width="32" height="32" align="center" bgcolor="{{ app.accent }}" style="width:32px;height:32px;background-color:{{ app.accent }};border-radius:8px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:12.5px;line-height:32px;font-weight:700;letter-spacing:0.02em;color:{{ app.on_accent }};text-align:center">{{ app.initials }}</td><td style="padding:0 0 0 10px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;font-weight:600;color:#101614">{{ app.name }}</td></tr></table>{% endif %}</td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><h1 style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:#101614;text-wrap:balance">Your sign-in code</h1></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:separate"><tr><td align="center" bgcolor="#eef2f0" style="background-color:#eef2f0;border-radius:10px;padding:18px 16px;font-family:ui-monospace,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;font-size:30px;line-height:30px;font-weight:500;letter-spacing:0.16em;color:#101614;text-align:center;font-variant-numeric:tabular-nums;-webkit-user-select:all;user-select:all">{{ code }}</td></tr></table></td></tr><tr><td style="padding:16px 0 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif"><p style="margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:15px;line-height:24px;color:#33403b;overflow-wrap:anywhere;word-wrap:break-word;word-break:break-word">It works once, for {{ expires_in_minutes }} minutes. If you did not ask for it, ignore this mail.</p></td></tr></table></td></tr><tr><td style="padding:14px 8px 0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;font-size:11.5px;line-height:18px;color:#5f6b66">{% if app.operator_info_url and app.privacy_policy_url %}<p style="margin:0 0 3px"><span style="font-size:12px;font-weight:600;color:#33403b">{{ app.name }}</span> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.operator_info_url }}" style="color:#5f6b66;text-decoration:underline">Operator information</a> <span style="color:#a2aaa6;padding:0 2px">\xB7</span> <a href="{{ app.privacy_policy_url }}" style="color:#5f6b66;text-decoration:underline">Privacy policy</a></p>{% endif %}<p style="margin:0">Secured by Fleetless</p></td></tr></table>
729
+ <!--[if mso]></td></tr></table><![endif]-->
730
+ </td></tr></table>
731
+ </body>
732
+ </html>
733
+ `
734
+ };
735
+
736
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/legal.js
649
737
  import { z as z2 } from "zod";
650
738
  var httpsLegalUrl = z2.url().max(2048).regex(/^https:\/\/(?=[A-Za-z0-9.-]{1,253}(?::[0-9]{1,5})?(?:[/?#]|$))[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*(?::(?:[0-5]?[0-9]{1,4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(?:[/?#]|$)/).refine((value) => {
651
739
  try {
@@ -665,7 +753,7 @@ var legalTextReferences = z2.object({
665
753
  dpa: legalDocumentReference.nullable()
666
754
  }).strict();
667
755
 
668
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/rights.js
756
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/rights.js
669
757
  import { z as z3 } from "zod";
670
758
  var ROLE_KEY_PATTERN = /^(?!defaults$)[a-z][a-z0-9_]{0,62}$/;
671
759
  var ROLE_KEY_RULE = "A role key is lower-case: it starts with a letter and continues with letters, digits and underscores, up to 63 characters in all \u2014 `operate`, `night_shift`. A capital, a dash, a dot, a space or a leading digit is refused, and `defaults` is reserved.";
@@ -703,7 +791,7 @@ var ENTRY_KIND_OF = {
703
791
  };
704
792
  var SECTIONS = Object.keys(ENTRY_KIND_OF);
705
793
 
706
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/app-users.js
794
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/app-users.js
707
795
  var APP_USER_DISPLAY_NAME_MAX = 120;
708
796
  var providerSlug = z4.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "must be lowercase and hyphen-separated, starting with a letter");
709
797
  var appUserStatus = z4.enum(["pending_verification", "active", "blocked"]);
@@ -1023,7 +1111,7 @@ Accept the invitation:
1023
1111
  The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you were not expecting this invitation, ignore this mail \u2014 no account is created until you accept.
1024
1112
  ${APP_LEGAL_MAIL_FOOTER}
1025
1113
  `,
1026
- html: null
1114
+ html: DEFAULT_MAIL_HTML.invite
1027
1115
  },
1028
1116
  verify: {
1029
1117
  subject: "Confirm your email for {{ app.name }}",
@@ -1035,7 +1123,7 @@ Confirm this address so you can sign in to {{ app.name }}:
1035
1123
  The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If you did not create this account, ignore this mail \u2014 the account stays unconfirmed and cannot be used.
1036
1124
  ${APP_LEGAL_MAIL_FOOTER}
1037
1125
  `,
1038
- html: null
1126
+ html: DEFAULT_MAIL_HTML.verify
1039
1127
  },
1040
1128
  reset: {
1041
1129
  subject: "Reset your {{ app.name }} password",
@@ -1049,7 +1137,7 @@ Choose a new password:
1049
1137
  The link works for the next {% if expires_in_hours >= 48 %}{{ expires_in_hours | divided_by: 24 }} days{% elsif expires_in_hours == 1 %}1 hour{% else %}{{ expires_in_hours }} hours{% endif %}. If it was not you, ignore this mail \u2014 your current password keeps working and nothing changes.
1050
1138
  ${APP_LEGAL_MAIL_FOOTER}
1051
1139
  `,
1052
- html: null
1140
+ html: DEFAULT_MAIL_HTML.reset
1053
1141
  },
1054
1142
  login_code: {
1055
1143
  subject: "Your {{ app.name }} sign-in code",
@@ -1058,7 +1146,7 @@ ${APP_LEGAL_MAIL_FOOTER}
1058
1146
  It works once, for {{ expires_in_minutes }} minutes. If you did not ask for it, ignore this mail.
1059
1147
 
1060
1148
  ${APP_LEGAL_MAIL_FOOTER}`,
1061
- html: null
1149
+ html: DEFAULT_MAIL_HTML.login_code
1062
1150
  }
1063
1151
  };
1064
1152
  var appMailTemplate = z4.object({
@@ -1091,7 +1179,7 @@ var mailOutcome = z4.object({
1091
1179
  })
1092
1180
  });
1093
1181
 
1094
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-intents.js
1182
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-intents.js
1095
1183
  var hash = z5.string().regex(/^[0-9a-f]{64}$/);
1096
1184
  var uuid = z5.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
1097
1185
  var opaqueId = z5.string().min(1);
@@ -1163,6 +1251,10 @@ var branches = [
1163
1251
  captured("ops_event.retention", z5.strictObject({ ...org2, ...batch })),
1164
1252
  captured("ops_global_event.retention", z5.strictObject(batch)),
1165
1253
  captured("operator_audit.retention", z5.strictObject(batch)),
1254
+ // The waiting list has no organization: entries are deleted when their own period ends
1255
+ // (a sweep), or when the person withdraws (one entry, named by its id, never its address).
1256
+ captured("waitlist.retention", z5.strictObject(batch)),
1257
+ captured("waitlist.withdrawal", z5.strictObject({ entry_id: uuid })),
1166
1258
  plain("org_note_text.remove", z5.strictObject({ ...org2, old_note_generation: uuid })),
1167
1259
  plain("org_note_text.replace", z5.strictObject({ ...org2, old_note_generation: uuid })),
1168
1260
  captured("oidc_interaction.expire", z5.strictObject({ ...org2, ...batch })),
@@ -1185,7 +1277,7 @@ var journalIntentV2 = z5.discriminatedUnion("kind", [
1185
1277
  ...branches.slice(1).map((branch) => branch.extend(envelope))
1186
1278
  ]);
1187
1279
 
1188
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-restore.js
1280
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-restore.js
1189
1281
  var hash2 = z6.string().regex(/^[0-9a-f]{64}$/);
1190
1282
  var uuid2 = z6.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
1191
1283
  var opaqueId2 = z6.string().min(1);
@@ -1605,7 +1697,7 @@ var journalReplayReceiptBody = z6.strictObject(receiptFields).superRefine((value
1605
1697
  }).describe("JSON Schema consumers must also verify counts, exact erase-proof set, reference bindings, kind/registry surface applicability and pass outcomes, signatures and protected-version readbacks.");
1606
1698
  var journalReplayReceipt = journalReplayReceiptBody.safeExtend({ receipt_hash: hash2, signature: signature2 });
1607
1699
 
1608
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-manifests.js
1700
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-manifests.js
1609
1701
  import { z as z7 } from "zod";
1610
1702
  var uuid3 = z7.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
1611
1703
  var hash3 = z7.string().regex(/^[0-9a-f]{64}$/);
@@ -1626,6 +1718,7 @@ var journalManifestScope = z7.union([
1626
1718
  z7.strictObject({ kind: z7.literal("console_oauth") }),
1627
1719
  z7.strictObject({ kind: z7.literal("global_ops_event") }),
1628
1720
  z7.strictObject({ kind: z7.literal("operator_audit") }),
1721
+ z7.strictObject({ kind: z7.literal("waitlist") }),
1629
1722
  z7.strictObject({ kind: z7.literal("subject"), subject_kind: z7.enum(["developer", "app_user"]), subject_id: uuid3 })
1630
1723
  ]);
1631
1724
  var uuidRowTable = z7.enum([
@@ -1635,8 +1728,13 @@ var uuidRowTable = z7.enum([
1635
1728
  "oidc_interactions",
1636
1729
  "organization_exports",
1637
1730
  "ops_notification_jobs",
1638
- "console_oauth_codes"
1731
+ "console_oauth_codes",
1732
+ "waitlist",
1733
+ "waitlist_invitations",
1734
+ "waitlist_invitation_proofs",
1735
+ "waitlist_consents"
1639
1736
  ]);
1737
+ var waitlistMailAction = z7.enum(["waitlist_invite", "waitlist_reinvite", "waitlist_decline", "waitlist_confirm"]);
1640
1738
  var member = { membership_kind: membership };
1641
1739
  var retentionRangeTable = z7.enum(["datapoint_series_samples", "bridge_latency_buckets"]);
1642
1740
  var journalManifestRow = z7.union([
@@ -1666,6 +1764,20 @@ var journalManifestRow = z7.union([
1666
1764
  z7.strictObject({ ...member, type: z7.literal("global_ops_event"), event_id: uuid3 }),
1667
1765
  z7.strictObject({ ...member, type: z7.literal("org_operator_audit"), org_id: uuid3, audit_id: uuid3 }),
1668
1766
  z7.strictObject({ ...member, type: z7.literal("global_operator_audit"), audit_id: uuid3 }),
1767
+ z7.strictObject({
1768
+ ...member,
1769
+ type: z7.literal("waitlist_mail_effect"),
1770
+ effect_id: uuid3,
1771
+ source_action: waitlistMailAction.meta({ description: "The source action the operator_effect_outbox row had when it was frozen. Replay deletes the row only while it still has it and has no delivery left: an invitation effect carries the deliveries of many entries, and deleting it would cascade to them." })
1772
+ }),
1773
+ z7.strictObject({
1774
+ ...member,
1775
+ type: z7.literal("waitlist_mail_delivery"),
1776
+ delivery_id: uuid3,
1777
+ effect_id: uuid3,
1778
+ entry_id: uuid3.meta({ description: "The waiting-list entry the delivery was addressed for (its target); the entry itself may already be gone." }),
1779
+ source_action: waitlistMailAction.meta({ description: "The source action of the delivery's effect when it was frozen; replay deletes the delivery only if its effect still has it." })
1780
+ }),
1669
1781
  z7.strictObject({
1670
1782
  type: z7.literal("retention_range"),
1671
1783
  membership_kind: z7.literal("affected"),
@@ -1720,7 +1832,8 @@ var sweepKinds = [
1720
1832
  "mcp_client.expire",
1721
1833
  "mcp_central_client.expire",
1722
1834
  "console_interaction.expire",
1723
- "console_code.expire"
1835
+ "console_code.expire",
1836
+ "waitlist.retention"
1724
1837
  ];
1725
1838
  var explicitKinds = ["history.slug_delete", "robot_assets.clear"];
1726
1839
  var journalManifestBatch = z7.union([
@@ -1765,6 +1878,10 @@ function rowKey(row) {
1765
1878
  case "org_operator_audit":
1766
1879
  case "global_operator_audit":
1767
1880
  return JSON.stringify(["operator_audit", row.audit_id]);
1881
+ case "waitlist_mail_effect":
1882
+ return JSON.stringify(["operator_effect_outbox", row.effect_id]);
1883
+ case "waitlist_mail_delivery":
1884
+ return JSON.stringify(["operator_effect_mail_deliveries", row.delivery_id]);
1768
1885
  case "retention_range":
1769
1886
  return JSON.stringify([row.table, "range", row.robot_id, row.series_id ?? null, row.from]);
1770
1887
  }
@@ -1802,6 +1919,8 @@ var journalManifestIntentProjection = z7.union(backedBranches.map((branch) => z7
1802
1919
  kind: branch.shape.kind,
1803
1920
  ids: branch.shape.ids
1804
1921
  })));
1922
+ var waitlistTables = /* @__PURE__ */ new Set(["waitlist", "waitlist_invitations", "waitlist_invitation_proofs", "waitlist_consents"]);
1923
+ var isWaitlistMember = (row) => row.type === "uuid_row" && waitlistTables.has(row.table) || row.type === "waitlist_mail_effect" || row.type === "waitlist_mail_delivery";
1805
1924
  var nonOrganizationScope = {
1806
1925
  "mcp_central_client.revoke": "central_mcp",
1807
1926
  "mcp_central_interaction.expire": "central_mcp",
@@ -1810,6 +1929,8 @@ var nonOrganizationScope = {
1810
1929
  "console_code.expire": "console_oauth",
1811
1930
  "ops_global_event.retention": "global_ops_event",
1812
1931
  "operator_audit.retention": "operator_audit",
1932
+ "waitlist.retention": "waitlist",
1933
+ "waitlist.withdrawal": "waitlist",
1813
1934
  "auth_factor.remove": "subject"
1814
1935
  };
1815
1936
  var rangeTableOfKind = {
@@ -1876,11 +1997,38 @@ var journalManifestBinding = z7.strictObject({
1876
1997
  central_mcp: (row) => row.type.startsWith("central_mcp_"),
1877
1998
  console_oauth: (row) => row.type === "console_interaction" || row.type === "uuid_row" && row.table === "console_oauth_codes",
1878
1999
  global_ops_event: (row) => row.type === "global_ops_event" || row.type === "uuid_row" && row.table === "ops_notification_jobs",
1879
- operator_audit: (row) => row.type === "global_operator_audit" || row.type === "org_operator_audit"
2000
+ operator_audit: (row) => row.type === "global_operator_audit" || row.type === "org_operator_audit",
2001
+ waitlist: isWaitlistMember
1880
2002
  };
1881
2003
  const allows = allowedRows[manifest2.scope.kind];
1882
2004
  if (allows && !manifest2.rows.every(allows))
1883
2005
  problem("Row outside closed source scope", ["manifest", "rows"]);
2006
+ if (manifest2.scope.kind !== "waitlist" && manifest2.rows.some(isWaitlistMember))
2007
+ problem("Waiting-list row outside the waitlist scope", ["manifest", "rows"]);
2008
+ if (manifest2.scope.kind === "waitlist") {
2009
+ if (manifest2.entries.length !== 0)
2010
+ problem("A waitlist manifest has no object entries", ["manifest", "entries"]);
2011
+ const effects = new Map(manifest2.rows.flatMap((row) => row.type === "waitlist_mail_effect" ? [[row.effect_id, row.source_action]] : []));
2012
+ const deliveries = manifest2.rows.filter((row) => row.type === "waitlist_mail_delivery");
2013
+ if (deliveries.some((row) => effects.has(row.effect_id) && effects.get(row.effect_id) !== row.source_action)) {
2014
+ problem("A delivery and its effect disagree on the source action", ["manifest", "rows"]);
2015
+ }
2016
+ if (intent.kind === "waitlist.withdrawal") {
2017
+ const entries = manifest2.rows.filter((row) => row.type === "uuid_row" && row.table === "waitlist");
2018
+ const only = entries[0];
2019
+ if (entries.length !== 1 || only?.type !== "uuid_row" || only.id !== ids.entry_id || only.membership_kind !== "affected") {
2020
+ problem("A withdrawal names exactly its own entry", ["manifest", "rows"]);
2021
+ }
2022
+ if (deliveries.some((row) => row.entry_id !== ids.entry_id)) {
2023
+ problem("A withdrawal deletes only its own entry's deliveries", ["manifest", "rows"]);
2024
+ }
2025
+ for (const [effectId, sourceAction] of effects) {
2026
+ if (!deliveries.some((row) => row.effect_id === effectId && row.source_action === sourceAction)) {
2027
+ problem("A withdrawal deletes only the effects of its own deliveries", ["manifest", "rows"]);
2028
+ }
2029
+ }
2030
+ }
2031
+ }
1884
2032
  const ranges = manifest2.rows.filter((row) => row.type === "retention_range");
1885
2033
  if (ranges.length > 0)
1886
2034
  for (const message of new Set(retentionRangeProblems(intent.kind, ids, ranges)))
@@ -1905,7 +2053,7 @@ var journalManifestBinding = z7.strictObject({
1905
2053
  problem("Unexpected batch", ["manifest", "batches"]);
1906
2054
  }).describe("JSON Schema consumers must also verify exact intent/scope/batch binding, sorted physical membership, original bytes and protected readbacks.");
1907
2055
 
1908
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-seals.js
2056
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-seals.js
1909
2057
  import { z as z8 } from "zod";
1910
2058
  var hash4 = z8.string().regex(/^[0-9a-f]{64}$/);
1911
2059
  var uuid4 = z8.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
@@ -1987,7 +2135,7 @@ var journalFinalSealBody = z8.strictObject({
1987
2135
  }, { path: ["cutoff_utc"], message: "Must equal max(ceil_to_second(T + E_max + W_max), previous C + 1 second)" }).describe("JSON Schema consumers must also verify C = max(ceil_to_second(T + E_max + W_max), previous C + 1 second), original signatures and complete drain/admission evidence.");
1988
2136
  var journalFinalSeal = journalFinalSealBody.safeExtend({ seal_hash: hash4, signature: signature3 });
1989
2137
 
1990
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/journal-controls.js
2138
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/journal-controls.js
1991
2139
  import { z as z9 } from "zod";
1992
2140
  var hash5 = z9.string().regex(/^[0-9a-f]{64}$/);
1993
2141
  var zeroHash = z9.literal("0".repeat(64));
@@ -2090,24 +2238,25 @@ var journalRegistryActivationReceipt = z9.union([
2090
2238
  laterActivationBody.extend({ receipt_hash: hash5, signature: signature4 })
2091
2239
  ]);
2092
2240
 
2093
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2241
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/legal-offers.js
2094
2242
  import { z as z13 } from "zod";
2095
2243
 
2096
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/plans.js
2244
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/plans.js
2097
2245
  import { z as z12 } from "zod";
2098
2246
 
2099
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
2247
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
2100
2248
  import { z as z10 } from "zod";
2101
2249
  var purchaseOperationKey = z10.uuid().meta({ description: "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input." });
2102
2250
 
2103
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/confirmation-proof.js
2251
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/confirmation-proof.js
2104
2252
  import { z as z11 } from "zod";
2105
2253
  var confirmationProof = z11.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
2106
2254
  description: "Opaque 32-byte Cloud proof, unpadded base64url. Syntax alone is not evidence."
2107
2255
  });
2108
2256
 
2109
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/plans.js
2257
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/plans.js
2110
2258
  var planId = z12.enum(["basic", "plus", "pro", "enterprise"]);
2259
+ var PLAN_ORDER = ["basic", "plus", "pro", "enterprise"];
2111
2260
  var planLimitKey = z12.enum([
2112
2261
  "seats",
2113
2262
  "robots",
@@ -2201,11 +2350,11 @@ var PLANS = {
2201
2350
  },
2202
2351
  features: {
2203
2352
  app_mcp: false,
2204
- two_factor: false,
2353
+ two_factor: true,
2205
2354
  require_two_factor: false,
2206
2355
  app_oidc: false,
2207
2356
  hosted_logo: false,
2208
- audit_export: false,
2357
+ audit_export: true,
2209
2358
  addons: false
2210
2359
  },
2211
2360
  prices: pricesFromEurMonth(0),
@@ -2215,12 +2364,12 @@ var PLANS = {
2215
2364
  id: "plus",
2216
2365
  name: "Plus",
2217
2366
  limits: {
2218
- seats: 3,
2367
+ seats: 5,
2219
2368
  robots: 3,
2220
2369
  apps: 3,
2221
- app_users: 25,
2370
+ app_users: 100,
2222
2371
  live_video_ms_per_month: 36e7,
2223
- asset_bytes_per_robot: 2e9,
2372
+ asset_bytes_per_robot: 1e9,
2224
2373
  history_days: 30,
2225
2374
  audit_days: 30,
2226
2375
  collection_records: 25e4,
@@ -2232,22 +2381,22 @@ var PLANS = {
2232
2381
  require_two_factor: false,
2233
2382
  app_oidc: true,
2234
2383
  hosted_logo: true,
2235
- audit_export: false,
2384
+ audit_export: true,
2236
2385
  addons: false
2237
2386
  },
2238
- prices: pricesFromEurMonth(2900),
2387
+ prices: pricesFromEurMonth(3e3),
2239
2388
  support: "email"
2240
2389
  },
2241
2390
  pro: {
2242
2391
  id: "pro",
2243
2392
  name: "Pro",
2244
2393
  limits: {
2245
- seats: 5,
2246
- robots: 5,
2247
- apps: 5,
2248
- app_users: 50,
2249
- live_video_ms_per_month: 9e8,
2250
- asset_bytes_per_robot: 3e9,
2394
+ seats: 15,
2395
+ robots: 10,
2396
+ apps: 10,
2397
+ app_users: 500,
2398
+ live_video_ms_per_month: 18e8,
2399
+ asset_bytes_per_robot: 1e9,
2251
2400
  history_days: 90,
2252
2401
  audit_days: 90,
2253
2402
  collection_records: 1e6,
@@ -2262,7 +2411,7 @@ var PLANS = {
2262
2411
  audit_export: true,
2263
2412
  addons: true
2264
2413
  },
2265
- prices: pricesFromEurMonth(14900),
2414
+ prices: pricesFromEurMonth(15e3),
2266
2415
  support: "priority"
2267
2416
  },
2268
2417
  enterprise: {
@@ -2373,7 +2522,10 @@ var orgPlan = z12.object({
2373
2522
  needs_choice: z12.boolean().meta({
2374
2523
  description: "Whether the org uses more than Basic allows, so an owner has to choose what stays before `at`."
2375
2524
  })
2376
- }).nullable().meta({ description: "Set only while the org is still on the beta; `null` for every other org." })
2525
+ }).nullable().meta({ description: "Set only while the org is still on the beta; `null` for every other org." }),
2526
+ paid_plans: z12.enum(["open", "closed"]).meta({
2527
+ description: "Whether this org may buy a paid plan. `open` when this cloud sells paid plans to every org, or Fleetless has unlocked this one; `closed` otherwise, and then starting, displaying or confirming a purchase or a paid change, and a plan change to anything but Basic, answer `403 plan_purchase_closed`. The plans and their prices stay readable either way."
2528
+ })
2377
2529
  });
2378
2530
  var planChangePrepareRequest = z12.object({
2379
2531
  operation_key: purchaseOperationKey,
@@ -2411,7 +2563,7 @@ var adminPlanChangeRequest = z12.object({
2411
2563
  })
2412
2564
  }).strict();
2413
2565
 
2414
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2566
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/legal-offers.js
2415
2567
  var utc = z13.iso.datetime().regex(/Z$/);
2416
2568
  var text = z13.string().min(1).regex(/\S/);
2417
2569
  var cents2 = z13.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
@@ -2547,7 +2699,7 @@ var legalOfferConflictDetails = z13.strictObject({
2547
2699
  rule: z13.enum(["withdrawn", "stale", "expired", "reused", "boundary_changed", "deadline_unavailable"])
2548
2700
  });
2549
2701
 
2550
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/common.js
2702
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/common.js
2551
2703
  import { z as z14 } from "zod";
2552
2704
  var SLUG_RULE = "A name is lower-case: it starts with a letter, continues with letters and digits, and joins further words with a single underscore \u2014 `battery_voltage`. Capitals, dashes, dots, spaces, a leading digit and a doubled or trailing underscore are all refused.";
2553
2705
  var slug = z14.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
@@ -2578,7 +2730,7 @@ var applyError = z14.object({
2578
2730
  details: z14.record(z14.string(), z14.unknown()).optional()
2579
2731
  });
2580
2732
 
2581
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/mcp.js
2733
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/mcp.js
2582
2734
  import { z as z15 } from "zod";
2583
2735
  function mcpAppEndpointPath(appIdentifier2) {
2584
2736
  return `/mcp/${appIdentifier2}`;
@@ -2623,13 +2775,13 @@ var mcpRobotDatasheet = z15.object({
2623
2775
  });
2624
2776
  var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
2625
2777
 
2626
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/protocol.js
2778
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/protocol.js
2627
2779
  import { z as z22 } from "zod";
2628
2780
 
2629
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/assets.js
2781
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/assets.js
2630
2782
  import { z as z17 } from "zod";
2631
2783
 
2632
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/file-too-large-details.js
2784
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/file-too-large-details.js
2633
2785
  import { z as z16 } from "zod";
2634
2786
  var fileTooLargeDetails = z16.object({
2635
2787
  max_bytes: z16.number().int().positive().meta({
@@ -2640,7 +2792,7 @@ var fileTooLargeDetails = z16.object({
2640
2792
  })
2641
2793
  });
2642
2794
 
2643
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/assets.js
2795
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/assets.js
2644
2796
  var assetKind = z17.enum(["urdf", "mesh", "texture"]);
2645
2797
  var asset = z17.object({
2646
2798
  id: z17.uuid().meta({ description: "The asset's id in the store." }),
@@ -2980,10 +3132,10 @@ var assetSyncBusyDetails = z17.object({
2980
3132
  started_at_ms: z17.number().int().nonnegative()
2981
3133
  });
2982
3134
 
2983
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/config.js
3135
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/config.js
2984
3136
  import { z as z19 } from "zod";
2985
3137
 
2986
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/alerts.js
3138
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/alerts.js
2987
3139
  import { z as z18 } from "zod";
2988
3140
  var alertRowCondition = z18.discriminatedUnion("kind", [
2989
3141
  z18.strictObject({
@@ -3053,7 +3205,7 @@ var putDatapointDisplayRequest = z18.object({
3053
3205
  y_max: z18.number().finite().nullable()
3054
3206
  }).strict();
3055
3207
 
3056
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/config.js
3208
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/config.js
3057
3209
  var RTSP_URL_RULE = "The URL has to begin with `rtsp://` or `rtsps://` \u2014 `rtsp://cam-1.plant.local/stream1`. No other scheme is accepted: the bridge opens this with a library that would equally honour `file:`.";
3058
3210
  var MJPEG_URL_RULE = "The URL has to begin with `http://` or `https://` \u2014 `http://cam-1.plant.local/video.mjpg`. No other scheme is accepted: the bridge opens this with a library that would equally serve `file:`.";
3059
3211
  var DEVICE_PATH_RULE = "A capture device is a path under `/dev/`, and the character straight after it is a letter or a digit \u2014 `/dev/video0`, or a stable `/dev/v4l/by-id/...` symlink. Nothing outside `/dev/` is accepted: the string reaches OpenCV, which would as happily open an ordinary file.";
@@ -3853,7 +4005,7 @@ var cameraSource = z19.discriminatedUnion("kind", [
3853
4005
  examples: ["/camera/image_raw"]
3854
4006
  }),
3855
4007
  type: rosTypeName.meta({
3856
- description: "The message type of `topic`: `sensor_msgs/msg/Image` for raw frames, `sensor_msgs/msg/CompressedImage` for a camera that already encodes. Declared here rather than introspected, so a camera can be configured for a robot that has never connected.",
4008
+ description: "The message type of `topic`: `sensor_msgs/msg/Image` for raw frames, `sensor_msgs/msg/CompressedImage` for a camera that already encodes, `foxglove_msgs/msg/CompressedVideo` for a topic that carries H.264. H.264 is passed through to live viewers without the bridge decoding or encoding it: always for `CompressedVideo`, and for a `CompressedImage` whose `format` contains `h264`, in any case. A `CompressedImage` that carries JPEG stays a picture source. A camera that is passed through follows what `passthrough` says on an RTSP source: `width` and `height` must equal the stream's size, B-frames are refused, a new viewer waits for the next keyframe, and low-bandwidth mode ends its stream. The bridge does not depend on `foxglove_msgs`; a robot without the package reports `unknown type` for that one camera. Declared here rather than introspected, so a camera can be configured for a robot that has never connected.",
3857
4009
  patternErrorMessage: ROS_TYPE_NAME_RULE,
3858
4010
  examples: ["sensor_msgs/msg/Image"]
3859
4011
  })
@@ -3865,11 +4017,12 @@ var cameraSource = z19.discriminatedUnion("kind", [
3865
4017
  /**
3866
4018
  * `type` is a **choice**, not a literal, and that is a correction: it was
3867
4019
  * written out on the rule that a field the format fixes is written out,
3868
- * and `type` is not such a field. Its own description names two values
4020
+ * and `type` is not such a field. Its own description names three values
3869
4021
  * and says which applies when — `Image` for raw frames,
3870
- * `CompressedImage` for a camera that encodes itself. A snippet that
3871
- * picks one picks wrong for half the cameras, and picks it invisibly:
3872
- * `rosTypeName` accepts either, publish accepts either, no diagnostic
4022
+ * `CompressedImage` for a camera that encodes itself, `CompressedVideo`
4023
+ * for a topic that carries H.264. A snippet that
4024
+ * picks one picks wrong for most cameras, and picks it invisibly:
4025
+ * `rosTypeName` accepts any of them, publish accepts any, no diagnostic
3873
4026
  * fires anywhere, and the bridge then subscribes with the wrong type and
3874
4027
  * delivers no frames. A snippet supplying a wrong answer where it could
3875
4028
  * have supplied a question is a defect arriving through a hint the
@@ -3880,22 +4033,22 @@ var cameraSource = z19.discriminatedUnion("kind", [
3880
4033
  * Choice syntax is the one construct here that three layers must each
3881
4034
  * pass through unharmed: yaml-language-server's `stringifyObject` emits
3882
4035
  * the body verbatim, and monaco-editor's `SnippetParser` parses
3883
- * `${2|a,b|}` into a placeholder carrying both options whose
4036
+ * `${2|a,b,c|}` into a placeholder carrying every option whose
3884
4037
  * `toString()` — the text on the buffer before anyone chooses — is the
3885
4038
  * first one. So a developer who tabs past this gets a document
3886
4039
  * byte-identical to the literal it replaced, and one who opens the
3887
- * picker gets `CompressedImage`; both parse.
4040
+ * picker gets `CompressedImage` or `CompressedVideo`; all three parse.
3888
4041
  */
3889
4042
  body: {
3890
4043
  kind: "ros",
3891
4044
  topic: "${1:/camera/image_raw}",
3892
- type: "${2|sensor_msgs/msg/Image,sensor_msgs/msg/CompressedImage|}"
4045
+ type: "${2|sensor_msgs/msg/Image,sensor_msgs/msg/CompressedImage,foxglove_msgs/msg/CompressedVideo|}"
3893
4046
  }
3894
4047
  }]
3895
4048
  }),
3896
4049
  strictObject({
3897
4050
  kind: z19.literal("rtsp").meta({
3898
- description: "Selects the RTSP source: this camera then carries `url`, and optionally `transport` and `credentials`."
4051
+ description: "Selects the RTSP source: this camera then carries `url`, and optionally `transport`, `passthrough` and `credentials`."
3899
4052
  }),
3900
4053
  /**
3901
4054
  * Scheme-constrained deliberately. The bridge opens these with libraries
@@ -3918,6 +4071,19 @@ var cameraSource = z19.discriminatedUnion("kind", [
3918
4071
  udp: "The frames travel in their own UDP stream: lower latency on a quiet network, and silent frame loss on any other."
3919
4072
  })
3920
4073
  }),
4074
+ /**
4075
+ * Opt-in, and absent rather than defaulted: an RTSP camera that exists
4076
+ * today is decoded and encoded again after an upgrade exactly as before,
4077
+ * and a parse writes no `false` into a document nobody put one in. The
4078
+ * bridge reads absent as off (fleetless/fleetless#1117).
4079
+ *
4080
+ * RTSP is the one source that carries this switch. A ROS topic is passed
4081
+ * through by what it carries, see `type` on the `ros` member; MJPEG and
4082
+ * V4L2 are never passed through.
4083
+ */
4084
+ passthrough: z19.boolean().optional().meta({
4085
+ description: "Passes the camera's own H.264 through to live viewers: the bridge forwards the access units it receives and neither decodes nor encodes the live video. A snapshot is decoded from the newest keyframe, so it is at most one keyframe interval old. Omitted means `false`: the stream is decoded and encoded again, and `fps` and `bitrate_kbps` are enforced. With `true`, `width` and `height` must equal the stream's own size, or the camera reports an error naming both and publishes nothing. `fps` and `bitrate_kbps` are not enforced then: the bridge cannot drop or shrink frames it does not encode, so both are set at the camera. The stream must be H.264 without B-frames; anything else is refused with a camera error. A new viewer waits for the camera's next keyframe, so set its keyframe interval to one to two seconds. Low-bandwidth mode ends such a stream, under `camera: reduce` as under `stop`: there is no bitrate to lower."
4086
+ }),
3921
4087
  credentials: cameraCredentials.optional()
3922
4088
  }).meta({
3923
4089
  description: "Frames come from an RTSP stream the robot itself can reach \u2014 a network camera on its own LAN. The bridge opens the connection; the cloud never does, and never needs a route to the camera.",
@@ -4024,19 +4190,19 @@ var cameraConfig = strictObject({
4024
4190
  description: "Where this camera's frames come from. `kind` picks one of four sources and fixes which other fields the source may carry, so an impossible camera is unrepresentable rather than merely invalid \u2014 there is no way to write an RTSP camera with a ROS topic."
4025
4191
  }),
4026
4192
  width: z19.number().int().positive().max(7680).meta({
4027
- description: "The width the bridge scales frames to before sending, in pixels \u2014 what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed.",
4193
+ description: "The width the bridge scales frames to before sending, in pixels \u2014 what the bridge produces, not what the sensor captures; a snapshot can arrive narrower, since the bridge reduces both dimensions together to fit its JPEG byte ceiling. It stands in the configuration and never in a viewer's request, so no client can make the robot encode a larger frame than the developer allowed. A passthrough camera is the exception for live video: the bridge does not scale what it does not encode, so `width` and `height` must equal the stream's own size. With any `live.encoder` but `software` the width must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
4028
4194
  examples: [1280]
4029
4195
  }),
4030
4196
  height: z19.number().int().positive().max(4320).meta({
4031
- description: "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this \u2014 its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded.",
4197
+ description: "The height the bridge scales every frame to, in pixels; with `width` it is the size the live stream carries. A snapshot can arrive **smaller** than this \u2014 its JPEG has a byte ceiling, and the bridge gives up quality first and then resolution to fit, reporting the size it actually encoded. The live video of a passthrough camera is not scaled: `height` and `width` must equal the stream's own size. With any `live.encoder` but `software` the height must be even: the bridge then sends H.264, which takes no odd size, and a document with an odd one is refused.",
4032
4198
  examples: [720]
4033
4199
  }),
4034
4200
  fps: z19.number().int().positive().max(60).meta({
4035
- description: "How many frames a second the bridge forwards, at most. It is a ceiling, not a clock: a camera that delivers ten frames a second stays at ten. Both modes read the same throttled pipeline, so this also bounds how fresh a snapshot can be.",
4201
+ description: "How many frames a second the bridge forwards, at most. It is a ceiling, not a clock: a camera that delivers ten frames a second stays at ten. Both modes read the same throttled pipeline, so this also bounds how fresh a snapshot can be. A passthrough camera is the exception: the bridge forwards its H.264 at the rate the source sends it, and `fps` only bounds how often a snapshot is taken.",
4036
4202
  examples: [15]
4037
4203
  }),
4038
4204
  bitrate_kbps: z19.number().int().positive().max(5e4).meta({
4039
- description: "The ceiling for the **live** encoding, in kilobits per second \u2014 this is what bounds a watched camera against the robot's uplink. Snapshots are not covered by it: they are JPEGs under their own byte ceiling. Raising `width`, `height` or `fps` against a fixed bitrate buys blur, not detail.",
4205
+ description: "The ceiling for the **live** encoding, in kilobits per second \u2014 this is what bounds a watched camera against the robot's uplink. Snapshots are not covered by it: they are JPEGs under their own byte ceiling. Raising `width`, `height` or `fps` against a fixed bitrate buys blur, not detail. A passthrough camera is not encoded by the bridge, so nothing enforces this number there: the bitrate is set at the source, and this value is only what the track declares to the media server.",
4040
4206
  examples: [2e3]
4041
4207
  }),
4042
4208
  snapshot_interval_seconds: snapshotIntervalSeconds.meta({
@@ -4071,15 +4237,65 @@ var lowBandwidthSection = strictObject({
4071
4237
  camera: lowBandwidthCamera.optional().meta({
4072
4238
  description: "What happens to a running stream in the mode. New streams are refused either way.",
4073
4239
  enumDescriptions: describeValues(lowBandwidthCamera.options, {
4074
- reduce: "A running stream is re-encoded at `camera_bitrate_kbps` and keeps running. A viewer sees a worse picture rather than none.",
4240
+ reduce: "A running stream is re-encoded at `camera_bitrate_kbps` and keeps running. A viewer sees a worse picture rather than none. A passthrough camera is the exception: the bridge does not encode it, so its stream ends as under `stop`.",
4075
4241
  stop: "A running stream ends and the viewer is told why. The uplink is then free for datapoints, which is the right trade where video is the nice-to-have."
4076
4242
  })
4077
4243
  }),
4078
- camera_bitrate_kbps: z19.number().int().min(50).max(2e4).optional().meta({ description: "Bitrate applied to running streams under `reduce`." })
4244
+ camera_bitrate_kbps: z19.number().int().min(50).max(2e4).optional().meta({ description: "Bitrate applied to running streams under `reduce`. A passthrough stream is not encoded by the bridge, so there is no bitrate to reduce and the stream ends." })
4079
4245
  }).superRefine((s, ctx) => {
4080
4246
  if (s.enter_lag_ms !== void 0 && s.exit_lag_ms !== void 0 && s.exit_lag_ms > s.enter_lag_ms)
4081
4247
  ctx.addIssue({ code: "custom", path: ["exit_lag_ms"], message: "low_bandwidth.exit_lag_ms must be at or below enter_lag_ms" });
4082
4248
  });
4249
+ var LIVE_DEFAULTS = {
4250
+ max_packet_bytes: 1200,
4251
+ encoder: "software"
4252
+ };
4253
+ var LIVE_ENCODERS = ["software", "auto", "nvenc", "vaapi", "v4l2"];
4254
+ var liveEncoder = z19.enum(LIVE_ENCODERS);
4255
+ var LIVE_BOUNDS = {
4256
+ max_packet_bytes: { min: 576, max: 1350 },
4257
+ encoder: { values: LIVE_ENCODERS }
4258
+ };
4259
+ var liveSection = strictObject({
4260
+ max_packet_bytes: z19.number().int().min(LIVE_BOUNDS.max_packet_bytes.min).max(LIVE_BOUNDS.max_packet_bytes.max).optional().meta({
4261
+ description: `The largest RTP packet the bridge sends, in bytes: fixed header, header extensions and payload, before SRTP adds its tag, retransmissions included. It is not an MTU: the MTU belongs to the path to each viewer, which the robot does not know. On the wire a packet is up to about 80 bytes longer. Lower it when a viewer's path carries less, such as a tunnel inside a tunnel. The ceiling sits just under what the bridge's SRTP library protects (1356 bytes); past that, live video stops. Overrides the bridge's ROS parameter \`live.max_packet_bytes\`; without either, the bridge sends ${LIVE_DEFAULTS.max_packet_bytes}. A change holds from the next frame, for running streams too.`,
4262
+ examples: [LIVE_DEFAULTS.max_packet_bytes]
4263
+ }),
4264
+ encoder: liveEncoder.optional().meta({
4265
+ description: `What encodes live video on the robot. \`software\` is the bridge's own encoder on the CPU. Every other value sends H.264 from a hardware encoder, reached through GStreamer, which the robot has to have installed. H.264 takes no odd size, so with any value but \`software\` every camera's \`width\` and \`height\` must be even, passthrough cameras included, and a document with an odd one is refused. An encoder that does not start, or stops delivering, is replaced by software H.264 for the rest of that session, with one warning in the bridge's log; one that did not start is not tried again until this setting changes or the bridge restarts. The fallback catches an encoder that fails, not one that draws a wrong picture, so look at the stream once after choosing one. The hardware encoders are written from the documentation of their GStreamer elements and tested through a software stand-in; the reference page of this section says which have been proven on hardware. It is one setting for the robot, not one per camera: the chip is part of the computer. It does not apply to a camera whose source already delivers H.264 and is passed through: that video is forwarded, not encoded. Overrides the bridge's ROS parameter \`live.encoder\`; without either, the bridge uses \`${LIVE_DEFAULTS.encoder}\`. A change holds from the next live start; a running stream keeps its encoder.`,
4266
+ enumDescriptions: describeValues(liveEncoder.options, {
4267
+ software: "The bridge encodes on the CPU: VP8 or H.264, whichever the media server picks, as every robot did before the setting existed.",
4268
+ auto: "Tries `nvenc`, then `vaapi`, then `v4l2`, and uses the first that starts. With none of them, software H.264.",
4269
+ nvenc: "NVIDIA. On a Jetson the board's encoder (`nvv4l2h264enc`); a Jetson Orin Nano has none and ends on software. On a desktop card `nvh264enc`.",
4270
+ vaapi: "Intel and AMD graphics through VA-API: `vah264enc`, then `vah264lpenc`, then `vaapih264enc`, the first that starts. `vah264lpenc` is the low-power encoder, the only one some Intel chips encode H.264 with.",
4271
+ v4l2: "A V4L2 encoder (`v4l2h264enc`), as on a Raspberry Pi 4. A Raspberry Pi 5 has no hardware encoder and ends on software."
4272
+ })
4273
+ })
4274
+ });
4275
+ var H264_ONLY_ENCODERS = new Set(LIVE_ENCODERS.filter((encoder) => encoder !== "software"));
4276
+ var oddSizeMessage = (encoder, key, value) => `With live.encoder: ${encoder} the bridge sends H.264, which takes no odd ${key}: set an even ${key} instead of ${value}, or live.encoder: software.`;
4277
+ var isMapping = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4278
+ var samePath = (a, b) => a.length === b.length && a.every((segment, index) => segment === b[index]);
4279
+ function refuseOddSizes(doc, ctx) {
4280
+ if (!isMapping(doc) || !isMapping(doc.live) || !isMapping(doc.cameras))
4281
+ return;
4282
+ const encoder = doc.live.encoder;
4283
+ if (typeof encoder !== "string" || !H264_ONLY_ENCODERS.has(encoder))
4284
+ return;
4285
+ for (const [slug2, camera] of Object.entries(doc.cameras)) {
4286
+ if (!isMapping(camera))
4287
+ continue;
4288
+ for (const key of ["width", "height"]) {
4289
+ const value = camera[key];
4290
+ const path = ["cameras", slug2, key];
4291
+ if (typeof value !== "number" || !Number.isInteger(value) || value % 2 === 0)
4292
+ continue;
4293
+ if (ctx.issues.some((issue) => samePath(issue.path ?? [], path)))
4294
+ continue;
4295
+ ctx.addIssue({ code: "custom", path, message: oddSizeMessage(encoder, key, value) });
4296
+ }
4297
+ }
4298
+ }
4083
4299
  var FLEETLESS_FORMAT_VERSION = 1;
4084
4300
  var capped = (entry2, max, what) => slugKeyed(entry2).refine((m) => Object.keys(m).length <= max, { message: `at most ${max} ${what}` });
4085
4301
  var ROS_GLOB_RULE = "A match pattern is an absolute ROS graph name in which `*` stands for any characters inside one segment and `**` for any number of whole segments \u2014 `/arm/**`, `/diagnostics/*`, `/joint_*`. It begins with a slash. A relative pattern, a trailing slash, a dash, a dot, or `**` mixed into a longer segment is refused.";
@@ -4171,8 +4387,22 @@ var robotConfigDoc = strictObject({
4171
4387
  description: "Enters after ten seconds above two seconds of lag, caps every datapoint to 1 Hz and lets running streams continue at a reduced bitrate.",
4172
4388
  body: { enter_lag_ms: 2e3, datapoint_max_hz: 1, camera: "reduce" }
4173
4389
  }]
4390
+ }),
4391
+ live: liveSection.optional().meta({
4392
+ description: "How the bridge sends live video, for every camera of the robot. Each key overrides the bridge's ROS parameter of the same name; an absent key leaves the parameter alone.",
4393
+ /**
4394
+ * The default, spelled out. A developer who opens this section came to
4395
+ * lower the number, and the value to start from is the one in force. A
4396
+ * plain number and no tab stop, as in `low_bandwidth`: a placeholder is a
4397
+ * string, and the body has to be a document the format accepts.
4398
+ */
4399
+ defaultSnippets: [{
4400
+ label: "live video, packet size",
4401
+ description: `Caps every RTP packet the bridge sends. ${LIVE_DEFAULTS.max_packet_bytes} is the default; lower it for viewers behind a tunnel inside a tunnel.`,
4402
+ body: { max_packet_bytes: LIVE_DEFAULTS.max_packet_bytes }
4403
+ }]
4174
4404
  })
4175
- });
4405
+ }).superRefine(refuseOddSizes, { when: (payload) => isMapping(payload.value) });
4176
4406
  var validationIssue = z19.object({
4177
4407
  path: z19.string().min(1),
4178
4408
  slug: z19.string().nullable(),
@@ -4198,7 +4428,7 @@ var configState = z19.object({
4198
4428
  applied_errors: z19.array(applyError).nullable()
4199
4429
  });
4200
4430
 
4201
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/introspection.js
4431
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/introspection.js
4202
4432
  import { z as z20 } from "zod";
4203
4433
  var rosGraphEntry = z20.object({
4204
4434
  name: rosName,
@@ -4237,7 +4467,7 @@ var typeDefinition = z20.discriminatedUnion("kind", [
4237
4467
  })
4238
4468
  ]);
4239
4469
 
4240
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/jobs.js
4470
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/jobs.js
4241
4471
  import { z as z21 } from "zod";
4242
4472
  var jobState = z21.enum(["running", "unknown", "succeeded", "failed", "cancelled", "lost"]);
4243
4473
  var reportedJobState = jobState.exclude(["unknown"]);
@@ -4474,7 +4704,7 @@ var jobRunSummary = z21.object({
4474
4704
  since_ms: z21.number().int().nonnegative()
4475
4705
  });
4476
4706
 
4477
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/protocol.js
4707
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/protocol.js
4478
4708
  var DAY_MS = 24 * 60 * 60 * 1e3;
4479
4709
  var MAX_PATIENCE_MS = 12e4;
4480
4710
  var MIN_PATIENCE_MS = 1e3;
@@ -4873,11 +5103,11 @@ var bridgeCameraState = z22.object({
4873
5103
  request_id: z22.string().min(1).max(64).nullable()
4874
5104
  });
4875
5105
 
4876
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/config-issues.js
5106
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/config-issues.js
4877
5107
  var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
4878
5108
  var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
4879
5109
 
4880
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/org-roles.js
5110
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/org-roles.js
4881
5111
  import { z as z23 } from "zod";
4882
5112
  var roleName = z23.string().trim().min(1).max(ROLE_NAME_MAX);
4883
5113
  var referencePlace = z23.object({
@@ -5016,7 +5246,7 @@ var putRoleDefaultsRequest = z23.object({
5016
5246
  })
5017
5247
  }).strict();
5018
5248
 
5019
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/rest.js
5249
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/rest.js
5020
5250
  import { z as z24 } from "zod";
5021
5251
  var robot2 = z24.object({
5022
5252
  id: z24.uuid().meta({
@@ -5824,19 +6054,19 @@ var slugUsageResponse = z24.object({
5824
6054
  alert_count: z24.number().int().nonnegative()
5825
6055
  });
5826
6056
 
5827
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/realtime.js
6057
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/realtime.js
5828
6058
  import { z as z30 } from "zod";
5829
6059
 
5830
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
6060
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/client-auth.js
5831
6061
  import { z as z28 } from "zod";
5832
6062
 
5833
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/apps.js
6063
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/apps.js
5834
6064
  import { z as z27 } from "zod";
5835
6065
 
5836
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6066
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-rights.js
5837
6067
  import { z as z26 } from "zod";
5838
6068
 
5839
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections.js
6069
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections.js
5840
6070
  import { z as z25 } from "zod";
5841
6071
  var COLLECTIONS_FORMAT_VERSION = 1;
5842
6072
  var COLLECTION_LIMITS = {
@@ -6014,7 +6244,7 @@ var collectionsDocument = z25.object({
6014
6244
  collections: z25.codec(collectionsMap.nullable(), collectionsMap, { decode: (value) => value ?? {}, encode: (value) => value }).meta({ description: `The collections of the app by key, at most ${COLLECTION_LIMITS.collections}. Nothing under \`collections:\` (null) means none.` })
6015
6245
  }).strict().meta({ description: "The data model of an app: its collections, their fields, and who may use them." });
6016
6246
 
6017
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6247
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-rights.js
6018
6248
  var records = z26.union([z26.literal("all"), z26.literal("own"), z26.literal(false)]);
6019
6249
  var roleCollectionRights = z26.object({
6020
6250
  collection: collectionKey.meta({ description: "The collection's key." }),
@@ -6033,7 +6263,7 @@ var roleCollectionRights = z26.object({
6033
6263
  })
6034
6264
  }).meta({ description: "What one role may do with the records of one collection." });
6035
6265
 
6036
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/apps.js
6266
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/apps.js
6037
6267
  var appIdentifier = slug;
6038
6268
  var app2 = z27.object({
6039
6269
  id: z27.uuid().meta({
@@ -6272,7 +6502,7 @@ var effectiveRightsResponse = z27.object({
6272
6502
  })
6273
6503
  });
6274
6504
 
6275
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/client-auth.js
6505
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/client-auth.js
6276
6506
  var clientLoginRequest = z28.object({
6277
6507
  app_identifier: appIdentifier.meta({
6278
6508
  description: "The app being logged in to: its globally unique, lowercase, underscore-separated identifier, chosen by the developer at creation. There is no organisation context at login, so this is what decides which app the credentials are checked for."
@@ -6459,7 +6689,16 @@ var clientMcpInteraction = z28.object({
6459
6689
  app_id: z28.uuid().meta({ description: "The app this authorization is for. The approving token's `app_id` must match it \u2014 an interaction of one app cannot be approved with a session from another." }),
6460
6690
  client_name: z28.string().nullable().meta({ description: "What the MCP client calls itself, or `null` if it named nothing. **Unverified** \u2014 see `client_name_verified`." }),
6461
6691
  client_name_verified: z28.literal(false).meta({
6462
- description: "Always `false`. The client registered itself without authentication and named itself, so it must be rendered as a claim and never as an identity. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
6692
+ description: "Always `false`. The client named itself \u2014 in an unauthenticated dynamic registration or in its own Client ID Metadata Document \u2014 so the name must be rendered as a claim and never as an identity. Only `client_id_host` was checked, by fetching the document from it. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
6693
+ }),
6694
+ client_id_host: z28.string().nullable().meta({
6695
+ description: "The hostname of the client's `client_id` when that id is the HTTPS URL of a Client ID Metadata Document, which the authorization server fetched from this host; `null` for a client that registered itself by dynamic registration. Show it beside the name: it is the one part of the client's description somebody checked."
6696
+ }),
6697
+ redirect_uri_host: z28.string().meta({
6698
+ description: "The hostname of the redirect URI this authorization will answer to \u2014 where the authorization code is sent. Show it on the consent screen (MCP 2026-07-28 requires it). An IPv6 literal keeps its brackets."
6699
+ }),
6700
+ redirect_uri_loopback: z28.boolean().meta({
6701
+ description: '`true` when the redirect URI is `http` on a loopback address (`localhost`, `127.0.0.1`, `[::1]`): the answer goes to a program on the person\'s own computer, on any port it chose. Warn about it, for example: "This client receives the answer on this computer (127.0.0.1). Approve only if you started it here."'
6463
6702
  }),
6464
6703
  scopes: z28.array(z28.string()).meta({ description: "The scopes the client asked for, to show the person before they approve." }),
6465
6704
  already_granted: z28.boolean().meta({ description: "Whether this user has already approved this client. It is a record of what they answered last time, and **this route makes no second use of it**: an app that skips its own consent screen when this is `true` is the only thing deciding that, and approve succeeds identically for a user who holds no grant at all. The standing grant is read elsewhere, on every request to the app's MCP endpoint. Withdrawing it is `DELETE /api/client/mcp/grants/:clientId` for the person themselves and `DELETE /api/apps/:id/users/:userId/mcp-grants/:clientId` for the developer. A withdrawal makes this `false` again at the next authorization **and stops the client at its very next MCP call**, unexpired access token and all \u2014 up to fifteen minutes of it \u2014 because the endpoint keys that check on the `client_id` the token carries." }),
@@ -6472,13 +6711,16 @@ var clientMcpInteractionDecisionResponse = z28.object({
6472
6711
  });
6473
6712
  var mcpConsentGrant = z28.object({
6474
6713
  client_id: z28.string().meta({
6475
- description: "The MCP client this consent is for, as its dynamic registration was issued. It is the value the withdrawal routes take in their path, and it is the only stable handle on a client \u2014 the name beside it is not one."
6714
+ description: "The MCP client this consent is for: the id its dynamic registration was issued, or the HTTPS URL of its Client ID Metadata Document. It is the value the withdrawal routes take in their path, percent-encoded, and it is the only stable handle on a client \u2014 the name beside it is not one."
6715
+ }),
6716
+ client_id_host: z28.string().nullable().meta({
6717
+ description: "The hostname of `client_id` when it is a Client ID Metadata Document URL; `null` for a self-registered client. The grant is to whoever controls that domain."
6476
6718
  }),
6477
6719
  client_name: z28.string().nullable().meta({
6478
- description: "What the client calls itself, or `null` once its registration is gone. **Unverified** \u2014 see `client_name_verified`."
6720
+ description: "What the client calls itself, or `null` once its registration or cached metadata document is gone. **Unverified** \u2014 see `client_name_verified`."
6479
6721
  }),
6480
6722
  client_name_verified: z28.literal(false).meta({
6481
- description: "Always `false`. The client registered itself without authentication and named itself, so it must be rendered as a claim and never as an identity. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
6723
+ description: "Always `false`. The client named itself \u2014 in an unauthenticated dynamic registration or in its own Client ID Metadata Document \u2014 so the name must be rendered as a claim and never as an identity. Only `client_id_host` was checked, by fetching the document from it. There is no verified case, which is why this is a literal and not a boolean: a `true` branch would be dead code that looked like a safeguard."
6482
6724
  }),
6483
6725
  granted_at: z28.iso.datetime().meta({
6484
6726
  description: "When the consent was last given. A withdrawal followed by a fresh approval moves it, because the second approval is the agreement that stands \u2014 it is not a record of the first time anybody ever said yes."
@@ -6523,7 +6765,7 @@ var clientIdentity = z28.object({
6523
6765
  })
6524
6766
  });
6525
6767
 
6526
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-records.js
6768
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-records.js
6527
6769
  import { z as z29 } from "zod";
6528
6770
  var timestamp = z29.iso.datetime();
6529
6771
  var count3 = z29.number().int().min(0);
@@ -6670,7 +6912,7 @@ var collectionDefinitionsResponse = z29.object({
6670
6912
  }))
6671
6913
  }).meta({ description: "The collections the caller may read, with their field definitions and the caller's rights." });
6672
6914
 
6673
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/realtime.js
6915
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/realtime.js
6674
6916
  var clientAuth = z30.object({
6675
6917
  type: z30.literal("auth"),
6676
6918
  token: z30.string().min(1)
@@ -7000,7 +7242,7 @@ var collectionsSchemaPublished = z30.object({
7000
7242
  version: z30.number().int().min(1).meta({ description: "The version that is in force now." })
7001
7243
  }).strict().meta({ description: "A new schema version is in force for the app." });
7002
7244
 
7003
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/feedback.js
7245
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/feedback.js
7004
7246
  import { z as z31 } from "zod";
7005
7247
  var FEEDBACK_KINDS = ["idea", "problem", "question", "other"];
7006
7248
  var feedbackKind = z31.enum(FEEDBACK_KINDS);
@@ -7025,7 +7267,7 @@ var feedbackResponse = z31.object({
7025
7267
  })
7026
7268
  }).strict();
7027
7269
 
7028
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/support.js
7270
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/support.js
7029
7271
  import { z as z32 } from "zod";
7030
7272
  var supportSessionInfo = z32.object({
7031
7273
  session_id: z32.uuid().meta({
@@ -7081,7 +7323,7 @@ var supportRenewFailRefusal = z32.union([
7081
7323
  ]);
7082
7324
  var authMeSupportResponse = authMeResponse.extend({ support: supportSessionInfo.optional() });
7083
7325
 
7084
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/client-robots.js
7326
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/client-robots.js
7085
7327
  import { z as z33 } from "zod";
7086
7328
  var clientRobotListItem = z33.object({
7087
7329
  ...robot2.shape,
@@ -7098,7 +7340,7 @@ var clientRobotListResponse = z33.object({
7098
7340
  })
7099
7341
  });
7100
7342
 
7101
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/legal-acceptances.js
7343
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/legal-acceptances.js
7102
7344
  import { z as z34 } from "zod";
7103
7345
  var legalAcceptanceCursor = z34.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
7104
7346
  var legalAcceptanceListQuery = z34.object({
@@ -7125,7 +7367,7 @@ var legalAcceptanceListResponse = z34.object({
7125
7367
  next_cursor: legalAcceptanceCursor.nullable()
7126
7368
  }).strict();
7127
7369
 
7128
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/audit.js
7370
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/audit.js
7129
7371
  import { z as z35 } from "zod";
7130
7372
  var auditActor = z35.object({
7131
7373
  kind: z35.enum(["developer", "end_user", "app_user", "server_key", "bridge", "fleetless"]),
@@ -7267,7 +7509,7 @@ var auditListResponse = z35.object({
7267
7509
  next_cursor: z35.number().int().positive().nullable()
7268
7510
  });
7269
7511
 
7270
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/errors.js
7512
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/errors.js
7271
7513
  import { z as z36 } from "zod";
7272
7514
  var apiError = z36.object({
7273
7515
  code: z36.string().min(1),
@@ -7364,7 +7606,7 @@ var roleCycleDetails = z36.object({
7364
7606
  })
7365
7607
  });
7366
7608
 
7367
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/oauth.js
7609
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/oauth.js
7368
7610
  import { z as z37 } from "zod";
7369
7611
  var oauthErrorCode = z37.enum([
7370
7612
  "invalid_request",
@@ -7539,6 +7781,9 @@ var authorizationServerMetadata = z37.object({
7539
7781
  registration_endpoint: z37.url().optional().meta({
7540
7782
  description: "The URL where a client may register itself, per RFC 7591. Absent when the app does not accept dynamic clients."
7541
7783
  }),
7784
+ client_id_metadata_document_supported: z37.boolean().optional().meta({
7785
+ description: "`true` when a client may use the HTTPS URL of its Client ID Metadata Document as `client_id` (draft-ietf-oauth-client-id-metadata-document) instead of registering. Both MCP authorization servers answer `true` and keep `registration_endpoint` beside it."
7786
+ }),
7542
7787
  response_types_supported: z37.array(z37.literal("code")).meta({
7543
7788
  description: "The response types this server offers: `code` only, the implicit grant being gone with OAuth 2.1."
7544
7789
  }),
@@ -7604,13 +7849,13 @@ var oauthAuthorizeQuery = z37.object({
7604
7849
  description: "The authorization request an MCP client sends, per RFC 6749 \xA74.1.1 with mandatory PKCE. The handler reads it parameter by parameter rather than through one parse, because the answers differ: `client_id` and `redirect_uri` are refused flat, with no redirect, since until both are confirmed there is no trusted target to bounce a browser to, and everything after them is reported to the client's own callback as query parameters."
7605
7850
  });
7606
7851
 
7607
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-schema.js
7852
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-schema.js
7608
7853
  import { z as z40 } from "zod";
7609
7854
 
7610
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-issues.js
7855
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-issues.js
7611
7856
  import { z as z39 } from "zod";
7612
7857
 
7613
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-templates.js
7858
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-templates.js
7614
7859
  import { z as z38 } from "zod";
7615
7860
  var collectionJsonTemplateName = z38.enum(["pose2d", "point2d", "polygon2d", "range1d"]).meta({ description: "The name of a built-in JSON template: `pose2d`, `point2d`, `polygon2d` or `range1d`." });
7616
7861
  function deepFreeze(value) {
@@ -7668,10 +7913,10 @@ var COLLECTION_JSON_TEMPLATES = deepFreeze({
7668
7913
  }
7669
7914
  });
7670
7915
 
7671
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-values.js
7916
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-values.js
7672
7917
  var TOO_DEEP_JSON = `The value nests arrays and objects more than ${COLLECTION_LIMITS.jsonDepth} levels deep.`;
7673
7918
 
7674
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-issues.js
7919
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-issues.js
7675
7920
  var collectionsIssue = z39.object({
7676
7921
  path: z39.string().min(1).meta({ description: "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`." }),
7677
7922
  code: z39.string().meta({ description: "A stable name for the kind of finding, for code to branch on." }),
@@ -7681,7 +7926,7 @@ var collectionsIssue = z39.object({
7681
7926
  })
7682
7927
  }).meta({ description: "One finding about a collections document." });
7683
7928
 
7684
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-schema.js
7929
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-schema.js
7685
7930
  var timestamp2 = z40.iso.datetime();
7686
7931
  var count4 = z40.number().int().min(0);
7687
7932
  var schemaVersion2 = z40.number().int().min(1);
@@ -7924,7 +8169,7 @@ var collectionsPurgeResponse = z40.object({
7924
8169
  purged_at: timestamp2
7925
8170
  }).meta({ description: "What a purge removed." });
7926
8171
 
7927
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/collections-transfer.js
8172
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/collections-transfer.js
7928
8173
  import { z as z41 } from "zod";
7929
8174
  var IMPORT_ERRORS_LISTED = 1e3;
7930
8175
  var count5 = z41.number().int().min(0);
@@ -8020,7 +8265,7 @@ var collectionExportQuery = z41.object({
8020
8265
  }).optional()
8021
8266
  }).strict();
8022
8267
 
8023
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/controller-register.js
8268
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/controller-register.js
8024
8269
  import { z as z42 } from "zod";
8025
8270
  var text2 = (max) => z42.string().regex(/^\P{Cc}*$/u).trim().min(1).max(max);
8026
8271
  var email = z42.string().regex(/^\P{Cc}*$/u).trim().email().max(320);
@@ -8060,10 +8305,10 @@ var controllerRegisterOrgResponse = z42.object({
8060
8305
  details: controllerRegisterOrgRecord.nullable()
8061
8306
  }).strict();
8062
8307
 
8063
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/billing.js
8308
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/billing.js
8064
8309
  import { z as z43 } from "zod";
8065
8310
 
8066
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/iana-time-zones.js
8311
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/iana-time-zones.js
8067
8312
  var ianaTimeZones = [
8068
8313
  "UTC",
8069
8314
  "Etc/UTC",
@@ -8488,7 +8733,7 @@ var ianaTimeZones = [
8488
8733
  "Pacific/Wallis"
8489
8734
  ];
8490
8735
 
8491
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/billing.js
8736
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/billing.js
8492
8737
  var countryCode = z43.string().regex(/^[A-Z]{2}$/);
8493
8738
  var EU_COUNTRIES = [
8494
8739
  "AT",
@@ -8528,9 +8773,21 @@ var billingCycle = z43.enum(["monthly", "yearly"]);
8528
8773
  var vatTreatment = z43.enum(["de_standard", "reverse_charge", "outside_eu"]);
8529
8774
  var payerRefusalRule = z43.enum(["company_required", "vat_id_required", "vat_id_invalid"]);
8530
8775
  var viesPendingReason = z43.enum(["vies_unavailable", "vies_unverified", "vies_identifier_missing"]);
8776
+ var viesOutage = z43.object({
8777
+ scope: z43.enum(["member_state", "vies"]).meta({
8778
+ description: "`member_state`: the VAT register of `country` does not answer VIES. `vies`: VIES itself does not answer."
8779
+ }),
8780
+ country: countryCode.meta({ description: "The billing address's country whose VAT ID was asked for. Greece is `GR`, never VIES's `EL`." })
8781
+ }).strict();
8782
+ function viesPending(shape) {
8783
+ return z43.discriminatedUnion("reason", [
8784
+ z43.object({ ...shape, reason: z43.literal("vies_unavailable"), vies_outage: viesOutage }).strict(),
8785
+ z43.object({ ...shape, reason: viesPendingReason.exclude(["vies_unavailable"]) }).strict()
8786
+ ]);
8787
+ }
8531
8788
  var vatDecision = z43.discriminatedUnion("state", [
8532
8789
  z43.object({ state: z43.literal("eligible"), treatment: vatTreatment, rate_percent: z43.number().int().min(0).max(100) }).strict(),
8533
- z43.object({ state: z43.literal("pending"), reason: viesPendingReason }).strict(),
8790
+ viesPending({ state: z43.literal("pending") }),
8534
8791
  z43.object({ state: z43.literal("refused"), rule: payerRefusalRule }).strict()
8535
8792
  ]);
8536
8793
  var billingAddress = z43.object({
@@ -8685,15 +8942,113 @@ var firstPaymentPeriod = z43.discriminatedUnion("cycle", [
8685
8942
  })
8686
8943
  ]);
8687
8944
  var billingDecisionPeriod = z43.union([existingBillingPeriod, firstPaymentPeriod]);
8688
- var declaration = z43.object({
8689
- text_id: z43.literal("DR-1374-draft-3-C.4"),
8690
- text: z43.string().min(1),
8691
- terms: legalDocumentReference,
8692
- dpa: legalDocumentReference
8693
- }).strict().superRefine((value, ctx) => {
8945
+ function formatEur(cents3) {
8946
+ if (!Number.isSafeInteger(cents3))
8947
+ throw new Error(`formatEur: ${cents3} is not a whole number of cents`);
8948
+ const abs = Math.abs(cents3);
8949
+ const euros = String(Math.floor(abs / 100)).replace(/\B(?=(\d{3})+(?!\d))/g, ".");
8950
+ const rest = abs % 100;
8951
+ return `${cents3 < 0 ? "-" : ""}${euros}${rest === 0 ? "" : `,${String(rest).padStart(2, "0")}`} \u20AC`;
8952
+ }
8953
+ var C4_ACTIONS = ["checkout", "pay_and_switch", "switch", "schedule_switch", "schedule_downgrade", "cancel", "keep_basic"];
8954
+ var C4_TEXT_IDS = [
8955
+ "C4-1168-checkout",
8956
+ "C4-1168-pay-and-switch",
8957
+ "C4-1168-switch",
8958
+ "C4-1168-schedule-switch",
8959
+ "C4-1168-schedule-downgrade",
8960
+ "C4-1168-cancel",
8961
+ "C4-1168-keep-basic"
8962
+ ];
8963
+ var LEGACY_C4_TEXT_ID = "DR-1374-draft-3-C.4";
8964
+ var legacyC4Text = (org3) => `By selecting \u201COrder and pay\u201D, you agree to the Terms of Service and the Data Processing Agreement for ${org3}.`;
8965
+ function c4Declaration(action, v) {
8966
+ const plan = PLANS[v.plan].name;
8967
+ const due = formatEur(v.dueCents);
8968
+ const gross = formatEur(v.periodGrossCents);
8969
+ const period = v.cycle === "monthly" ? "month" : "year";
8970
+ const legal = "agree to the Terms of Service and the Data Processing Agreement";
8971
+ const [label2, rest] = (() => {
8972
+ switch (action) {
8973
+ case "checkout":
8974
+ return [`Pay ${due} with Mollie`, `you order ${plan} for ${v.org} as a business, ${legal}, and authorise Fleetless to charge ${gross} every ${period} until you cancel.`];
8975
+ case "pay_and_switch":
8976
+ return [`Pay ${due} and switch`, `you order ${plan} for ${v.org} as a business from today, ${legal}, and authorise Fleetless to charge ${due} now and ${gross} every ${period} after that until you cancel.`];
8977
+ case "switch":
8978
+ return [`Switch to ${plan}`, `you order ${plan} for ${v.org} as a business from today, ${legal}, and authorise Fleetless to charge ${gross} every ${period} from the next renewal until you cancel.`];
8979
+ case "schedule_switch":
8980
+ return ["Switch to monthly at period end", `you order ${plan} monthly for ${v.org} as a business from the end of the current period, ${legal}, and authorise Fleetless to charge ${gross} every month from then until you cancel.`];
8981
+ case "schedule_downgrade":
8982
+ return [`Schedule downgrade to ${plan}`, `you order ${plan} for ${v.org} as a business from the end of the current period, ${legal}, and authorise Fleetless to charge ${gross} every ${period} from then until you cancel.`];
8983
+ case "cancel":
8984
+ return ["Cancel at period end", `you cancel ${plan} for ${v.org} at the end of the current period; ${v.org} then stays on Basic under the Terms of Service and the Data Processing Agreement, and nothing more is charged.`];
8985
+ case "keep_basic":
8986
+ return ["Delete the rest and stay on Basic", `${v.org} stays on Basic under the Terms of Service and the Data Processing Agreement; what you did not keep is deleted, and nothing is charged.`];
8987
+ }
8988
+ })();
8989
+ return { text_id: C4_TEXT_IDS[C4_ACTIONS.indexOf(action)], text: `By selecting \u201C${label2}\u201D, ${rest}`, action_label: label2 };
8990
+ }
8991
+ function c4ActionOf(s, from) {
8992
+ if (s.decision_kind === "checkout")
8993
+ return "checkout";
8994
+ if (s.decision_kind === "plan_change") {
8995
+ if (s.selection.plan !== "basic")
8996
+ return "schedule_downgrade";
8997
+ if (from === void 0)
8998
+ throw new Error("c4ActionOf: a plan change to Basic needs the current plan to tell a cancellation from keeping Basic");
8999
+ const current2 = typeof from === "string" ? from : from.plan;
9000
+ return current2 === "plus" || current2 === "pro" ? "cancel" : "keep_basic";
9001
+ }
9002
+ if (s.amounts.due_today_gross_cents > 0)
9003
+ return "pay_and_switch";
9004
+ if (s.period.anchor !== "existing_period" || s.period.effective.mode === "on_confirmation")
9005
+ return "switch";
9006
+ if (s.selection.cycle === "yearly")
9007
+ return "schedule_downgrade";
9008
+ if (from === void 0)
9009
+ throw new Error("c4ActionOf: a scheduled monthly paid change needs the current plan to tell a downgrade from a cycle switch");
9010
+ const current = typeof from === "string" ? { plan: from } : from;
9011
+ if (PLAN_ORDER.indexOf(s.selection.plan) < PLAN_ORDER.indexOf(current.plan))
9012
+ return "schedule_downgrade";
9013
+ return current.cycle === "monthly" ? "schedule_downgrade" : "schedule_switch";
9014
+ }
9015
+ function c4ActionsOf(s) {
9016
+ if (s.decision_kind === "plan_change" && s.selection.plan === "basic")
9017
+ return ["cancel", "keep_basic"];
9018
+ if (s.decision_kind !== "paid_change" || s.amounts.due_today_gross_cents > 0 || s.period.anchor !== "existing_period" || s.period.effective.mode === "on_confirmation")
9019
+ return [c4ActionOf(s)];
9020
+ return s.selection.cycle === "monthly" ? ["schedule_switch", "schedule_downgrade"] : ["schedule_downgrade"];
9021
+ }
9022
+ var separateLegalLinks = (value, ctx) => {
8694
9023
  if (value.terms.url === value.dpa.url)
8695
9024
  ctx.addIssue({ code: "custom", path: ["dpa"], message: "Terms and DPA require separate version URLs." });
9025
+ };
9026
+ var legalLinks = { terms: legalDocumentReference, dpa: legalDocumentReference };
9027
+ var labelRules = {
9028
+ "C4-1168-checkout": { pattern: "^Pay \\S.* with Mollie$" },
9029
+ "C4-1168-pay-and-switch": { pattern: "^Pay \\S.* and switch$" },
9030
+ "C4-1168-switch": { pattern: "^Switch to \\S.*$" },
9031
+ "C4-1168-schedule-switch": { const: "Switch to monthly at period end" },
9032
+ "C4-1168-schedule-downgrade": { pattern: "^Schedule downgrade to \\S.*$" },
9033
+ "C4-1168-cancel": { const: "Cancel at period end" },
9034
+ "C4-1168-keep-basic": { const: "Delete the rest and stay on Basic" }
9035
+ };
9036
+ var declaration = z43.object({
9037
+ text_id: z43.enum(C4_TEXT_IDS).meta({ description: "The approved sentence this display shows, one per action." }),
9038
+ text: z43.string().min(1).regex(/^By selecting “/).meta({ description: "The consent sentence shown directly above the button, naming the button." }),
9039
+ action_label: z43.string().min(1).meta({ description: "The label of the one button that confirms this decision." }),
9040
+ ...legalLinks
9041
+ }).strict().superRefine(separateLegalLinks).meta({
9042
+ allOf: C4_TEXT_IDS.map((textId) => ({
9043
+ if: { properties: { text_id: { const: textId } }, required: ["text_id"] },
9044
+ then: { properties: { action_label: labelRules[textId] } }
9045
+ }))
8696
9046
  });
9047
+ var legacyDeclaration = z43.object({
9048
+ text_id: z43.literal(LEGACY_C4_TEXT_ID),
9049
+ text: z43.string().min(1),
9050
+ ...legalLinks
9051
+ }).strict().superRefine(separateLegalLinks);
8697
9052
  var snapshotBase = z43.object({
8698
9053
  snapshot_id: z43.uuid(),
8699
9054
  decision_id: z43.uuid(),
@@ -8708,17 +9063,48 @@ var snapshotBase = z43.object({
8708
9063
  declaration,
8709
9064
  expires_at: utcInstant
8710
9065
  }).strict();
8711
- var billingDecisionSnapshot = z43.discriminatedUnion("decision_kind", [
9066
+ var snapshotVariants = [
8712
9067
  snapshotBase.extend({ decision_kind: z43.literal("checkout"), selection: purchaseSelection }).strict(),
8713
9068
  snapshotBase.extend({ decision_kind: z43.literal("paid_change"), selection: purchaseSelection, period: existingBillingPeriod }).strict(),
8714
9069
  snapshotBase.extend({ decision_kind: z43.literal("plan_change"), selection: planChangeSelection, period: existingBillingPeriod }).strict()
8715
- ]).superRefine((value, ctx) => {
9070
+ ];
9071
+ var storedDeclaration = z43.union([declaration, legacyDeclaration]);
9072
+ var storedSnapshotVariants = z43.discriminatedUnion("decision_kind", [
9073
+ snapshotVariants[0].extend({ declaration: storedDeclaration }).strict(),
9074
+ snapshotVariants[1].extend({ declaration: storedDeclaration }).strict(),
9075
+ snapshotVariants[2].extend({ declaration: storedDeclaration }).strict()
9076
+ ]);
9077
+ function checkDeclaration(value, ctx) {
9078
+ const declared = value.declaration;
9079
+ if (declared.text_id === LEGACY_C4_TEXT_ID) {
9080
+ if (declared.text !== legacyC4Text(value.organization_name))
9081
+ ctx.addIssue({ code: "custom", path: ["declaration", "text"], message: "Declaration must match the approved C.4 sentence and organization." });
9082
+ return;
9083
+ }
9084
+ const action = C4_ACTIONS[C4_TEXT_IDS.indexOf(declared.text_id)];
9085
+ if (!c4ActionsOf(value).includes(action)) {
9086
+ ctx.addIssue({ code: "custom", path: ["declaration", "text_id"], message: "Declaration must be the sentence of the action this decision is." });
9087
+ return;
9088
+ }
9089
+ const plans = action === "cancel" ? ["plus", "pro"] : [value.selection.plan];
9090
+ const matches = plans.some((plan) => {
9091
+ const expected = c4Declaration(action, {
9092
+ org: value.organization_name,
9093
+ plan,
9094
+ cycle: value.selection.cycle,
9095
+ dueCents: value.amounts.due_today_gross_cents,
9096
+ periodGrossCents: value.amounts.period_gross_cents
9097
+ });
9098
+ return expected.text === declared.text && expected.action_label === declared.action_label;
9099
+ });
9100
+ if (!matches)
9101
+ ctx.addIssue({ code: "custom", path: ["declaration", "text"], message: "Declaration must match the approved sentence and button of its action, amounts, plan and organization." });
9102
+ }
9103
+ function refineSnapshot(value, ctx) {
8716
9104
  if (value.period.anchor === "on_first_successful_payment" && value.period.cycle !== value.selection.cycle) {
8717
9105
  ctx.addIssue({ code: "custom", path: ["period", "cycle"], message: "First-payment period must match the selected cycle." });
8718
9106
  }
8719
- const expected = `By selecting \u201COrder and pay\u201D, you agree to the Terms of Service and the Data Processing Agreement for ${value.organization_name}.`;
8720
- if (value.declaration.text !== expected)
8721
- ctx.addIssue({ code: "custom", path: ["declaration", "text"], message: "Declaration must match the approved C.4 sentence and organization." });
9107
+ checkDeclaration(value, ctx);
8722
9108
  if (value.amounts.vat_treatment === "de_standard") {
8723
9109
  const euro = (cents3) => new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR" }).format(cents3 / 100);
8724
9110
  const period = value.selection.cycle === "monthly" ? "month" : "year";
@@ -8730,10 +9116,13 @@ var billingDecisionSnapshot = z43.discriminatedUnion("decision_kind", [
8730
9116
  const expectedAddons = addonKey.options.filter((key) => value.selection.addons[key] > 0);
8731
9117
  if (lines.length !== expectedAddons.length || lines.some((line, i) => line.addon !== expectedAddons[i] || line.quantity !== value.selection.addons[line.addon]))
8732
9118
  ctx.addIssue({ code: "custom", path: ["amounts", "addon_lines"], message: "Add-on lines must match absolute selection in catalogue order." });
8733
- }).meta({ allOf: ["monthly", "yearly"].map((cycle) => ({
9119
+ }
9120
+ var snapshotRules = { allOf: ["monthly", "yearly"].map((cycle) => ({
8734
9121
  if: { properties: { period: { properties: { anchor: { const: "on_first_successful_payment" }, cycle: { const: cycle } }, required: ["anchor", "cycle"] } }, required: ["period"] },
8735
9122
  then: { properties: { selection: { properties: { cycle: { const: cycle } }, required: ["cycle"] } }, required: ["selection"] }
8736
- })) });
9123
+ })) };
9124
+ var billingDecisionSnapshot = z43.discriminatedUnion("decision_kind", snapshotVariants).superRefine(refineSnapshot).meta(snapshotRules);
9125
+ var storedBillingDecisionSnapshot = storedSnapshotVariants.superRefine(refineSnapshot).meta(snapshotRules);
8737
9126
  var billingDecisionDisplayResponse = z43.object({
8738
9127
  confirmation_proof: confirmationProof,
8739
9128
  expires_at: utcInstant,
@@ -8755,24 +9144,21 @@ var intentIdentity = {
8755
9144
  intent_id: z43.uuid().meta({ description: "Opaque persisted purchase intent identity." }),
8756
9145
  operation_key: purchaseOperationKey,
8757
9146
  operation: chargeOperation,
8758
- invoice_id: z43.uuid().optional().meta({ description: "The due charge or issued invoice, for invoice-paying operations." })
9147
+ invoice_id: z43.uuid().optional().meta({
9148
+ description: "For an invoice-paying operation, the due charge or issued invoice being paid. For a confirmed paid_change with payment_started, the charge or invoice created for that decision; when the charge was issued through Lexware (`charged` is `null`), it identifies the matching billing.charges[].id. Absent on a paid_change in any other state."
9149
+ })
8759
9150
  };
8760
9151
  var purchaseHoldReason = z43.enum([
8761
9152
  "legacy_usd_invoice",
8762
9153
  "legacy_payer_unresolved",
8763
9154
  "mandate_policy_unresolved",
8764
- // The Lexware issuer cutover (2026-10-19, fleetless/fleetless#327): holds
8765
- // during and after the move from Cloud-issued invoices to charges billed
8766
- // through Lexware.
8767
- "lexware_contact_pending",
8768
- "lexware_contact_changed",
8769
- "issuer_cutover_in_progress",
8770
- "lexware_issuance_paused"
9155
+ "issuer_cutover_in_progress"
8771
9156
  ]);
8772
9157
  var purchaseRefusalRule = z43.enum(["company_required", "vat_id_required", "vat_id_invalid", "tax_id_required", "us_state_required", "public_email_domain", "invoice_not_open"]);
8773
9158
  var intentRules = [
8774
9159
  { if: { properties: { operation: { enum: ["invoice_payment", "payment_method_invoice"] } }, required: ["operation"] }, then: { required: ["invoice_id"] } },
8775
- { if: { properties: { operation: { const: "mandate_setup" } }, required: ["operation"] }, then: { properties: { state: { const: "held" }, reason: { const: "mandate_policy_unresolved" } }, required: ["reason"] } },
9160
+ { if: { properties: { operation: { const: "mandate_setup" } }, required: ["operation"] }, then: { properties: { state: { enum: ["held", "payment_started"] } } } },
9161
+ { if: { properties: { operation: { const: "mandate_setup" }, state: { const: "held" } }, required: ["operation", "state"] }, then: { properties: { reason: { const: "mandate_policy_unresolved" } }, required: ["reason"] } },
8776
9162
  { if: { properties: { reason: { const: "mandate_policy_unresolved" } }, required: ["reason"] }, then: { properties: { operation: { const: "mandate_setup" } } } },
8777
9163
  { if: { properties: { payment: { properties: { kind: { const: "mandate" } }, required: ["kind"] } }, required: ["payment"] }, then: { properties: { operation: { const: "paid_change" } } } }
8778
9164
  ];
@@ -8780,15 +9166,22 @@ function validateIntent(intent, ctx) {
8780
9166
  if (["invoice_payment", "payment_method_invoice"].includes(intent.operation) && !intent.invoice_id) {
8781
9167
  ctx.addIssue({ code: "custom", path: ["invoice_id"], message: "An invoice-paying intent must name the invoice or due charge." });
8782
9168
  }
8783
- if (intent.operation === "mandate_setup" !== (intent.reason === "mandate_policy_unresolved")) {
8784
- ctx.addIssue({ code: "custom", path: ["reason"], message: "Mandate setup remains held until its integration policy is resolved." });
9169
+ if (intent.operation === "mandate_setup" && intent.state !== "held" && intent.state !== "payment_started") {
9170
+ ctx.addIssue({ code: "custom", path: ["state"], message: "A mandate setup is a started hosted payment, or a stored hold." });
9171
+ }
9172
+ if (intent.operation === "mandate_setup" && intent.state === "held" && intent.reason !== "mandate_policy_unresolved") {
9173
+ ctx.addIssue({ code: "custom", path: ["reason"], message: "A held mandate setup is the stored mandate_policy_unresolved hold." });
9174
+ }
9175
+ if (intent.reason === "mandate_policy_unresolved" && intent.operation !== "mandate_setup") {
9176
+ ctx.addIssue({ code: "custom", path: ["reason"], message: "Only a mandate setup was held as mandate_policy_unresolved." });
8785
9177
  }
8786
9178
  if (intent.payment?.kind === "mandate" && intent.operation !== "paid_change") {
8787
- ctx.addIssue({ code: "custom", path: ["payment"], message: "Owner checkout and invoice payment require a hosted payment." });
9179
+ ctx.addIssue({ code: "custom", path: ["payment"], message: "Owner checkout, invoice payment and mandate setup require a hosted payment." });
8788
9180
  }
8789
9181
  }
9182
+ var awaitingVies = { ...intentIdentity, state: z43.literal("awaiting_vies"), next_attempt_at: z43.iso.datetime() };
8790
9183
  var draftVariants = [
8791
- z43.object({ ...intentIdentity, state: z43.literal("awaiting_vies"), reason: viesPendingReason, next_attempt_at: z43.iso.datetime() }).strict(),
9184
+ viesPending(awaitingVies),
8792
9185
  z43.object({ ...intentIdentity, ...quoteIdentity, state: z43.literal("eligible"), quote: purchaseQuote }).strict(),
8793
9186
  z43.object({
8794
9187
  ...intentIdentity,
@@ -8803,6 +9196,7 @@ var draftVariants = [
8803
9196
  var purchaseIntentDraft = z43.discriminatedUnion("state", draftVariants).superRefine(validateIntent).meta({ allOf: intentRules });
8804
9197
  var paymentStartedVariant = z43.object({
8805
9198
  ...intentIdentity,
9199
+ operation: purchaseOperation,
8806
9200
  state: z43.literal("payment_started"),
8807
9201
  payment_id: z43.uuid(),
8808
9202
  payment: z43.discriminatedUnion("kind", [
@@ -8828,22 +9222,87 @@ var purchaseIntent = z43.discriminatedUnion("state", [
8828
9222
  var nonChangeOperation = purchaseOperation.exclude(["paid_change"]);
8829
9223
  var nonChangeChargeOperation = chargeOperation.exclude(["paid_change"]);
8830
9224
  var nonChangeDraft = z43.discriminatedUnion("state", [
8831
- draftVariants[0].safeExtend({ operation: nonChangeChargeOperation }),
9225
+ viesPending({ ...awaitingVies, operation: nonChangeChargeOperation }),
8832
9226
  draftVariants[1].safeExtend({ operation: nonChangeChargeOperation }),
8833
9227
  draftVariants[2].safeExtend({ operation: nonChangeOperation }),
8834
9228
  draftVariants[3].safeExtend({ operation: nonChangeChargeOperation }),
8835
9229
  draftVariants[4].safeExtend({ operation: nonChangeChargeOperation })
8836
9230
  ]).superRefine(validateIntent).meta({ allOf: intentRules });
8837
- var nonChangePaymentStarted = paymentStartedVariant.safeExtend({ operation: nonChangeChargeOperation }).superRefine(validateIntent).meta({ allOf: intentRules });
9231
+ var nonChangePaymentStarted = paymentStartedVariant.safeExtend({ operation: nonChangeOperation }).superRefine(validateIntent).meta({ allOf: intentRules });
8838
9232
  var paidChangeOperation = z43.literal("paid_change");
8839
9233
  var paidChangeDraft = z43.discriminatedUnion("state", [
8840
- draftVariants[0].safeExtend({ operation: paidChangeOperation }),
8841
9234
  draftVariants[1].safeExtend({ operation: paidChangeOperation }),
8842
9235
  draftVariants[2].safeExtend({ operation: paidChangeOperation }),
8843
9236
  draftVariants[3].safeExtend({ operation: paidChangeOperation }),
8844
9237
  draftVariants[4].safeExtend({ operation: paidChangeOperation })
8845
9238
  ]).superRefine(validateIntent).meta({ allOf: intentRules });
8846
9239
  var checkoutResponse = z43.union([nonChangeDraft, nonChangePaymentStarted]);
9240
+ var checkoutIntentIdentity = {
9241
+ intent_id: z43.uuid().meta({ description: "The persisted checkout intent; confirm it with `POST /api/billing/intents/:id/confirm`." }),
9242
+ operation_key: purchaseOperationKey,
9243
+ operation: z43.literal("checkout")
9244
+ };
9245
+ var vatIdField = z43.literal("billing.vat_id");
9246
+ var checkoutStartResponse = z43.discriminatedUnion("state", [
9247
+ z43.object({
9248
+ ...checkoutIntentIdentity,
9249
+ state: z43.literal("eligible"),
9250
+ ...quoteIdentity,
9251
+ quote: purchaseQuote,
9252
+ display: billingDecisionDisplayResponse
9253
+ }).strict().meta({ description: "Eligible: the price is frozen and the display shown; one click on its button confirms." }),
9254
+ viesPending({ state: z43.literal("vies_unavailable"), field: vatIdField }).meta({ description: "VIES did not confirm the VAT ID within its retries; with `vies_unavailable`, `vies_outage` says which side was down. Nothing is stored; check again." }),
9255
+ z43.object({ state: z43.literal("invalid_vat_id"), field: vatIdField, rule: z43.literal("vat_id_invalid") }).strict().meta({ description: "VIES says the VAT ID is invalid. Nothing is stored." }),
9256
+ z43.object({ state: z43.literal("refused"), field: z43.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field the purchase cannot accept. Nothing is stored." }),
9257
+ z43.object({ ...checkoutIntentIdentity, state: z43.literal("held"), reason: z43.literal("issuer_cutover_in_progress") }).strict().meta({ description: "An issuer cutover is running; try again in a few minutes." }),
9258
+ z43.object({
9259
+ ...checkoutIntentIdentity,
9260
+ state: z43.literal("payment_started"),
9261
+ payment_id: z43.uuid(),
9262
+ payment: z43.object({ kind: z43.literal("hosted"), checkout_id: z43.uuid(), checkout_url: z43.url() }).strict()
9263
+ }).strict().meta({ description: "The key was already confirmed: the hosted payment it started." })
9264
+ ]).superRefine((value, ctx) => {
9265
+ if (value.state !== "eligible")
9266
+ return;
9267
+ const snapshot2 = value.display.snapshot;
9268
+ const invalid = (path, message) => ctx.addIssue({ code: "custom", path, message });
9269
+ if (snapshot2.decision_kind !== "checkout")
9270
+ invalid(["display", "snapshot", "decision_kind"], "A checkout start displays a checkout decision.");
9271
+ if (snapshot2.decision_id !== value.intent_id)
9272
+ invalid(["display", "snapshot", "decision_id"], "The display must refer to this intent.");
9273
+ if (snapshot2.operation_key !== value.operation_key)
9274
+ invalid(["display", "snapshot", "operation_key"], "The display must carry this operation key.");
9275
+ if (snapshot2.quote_revision !== value.quote_revision || snapshot2.buyer_fingerprint !== value.buyer_fingerprint) {
9276
+ invalid(["display", "snapshot", "quote_revision"], "The display must show this quote revision and buyer.");
9277
+ }
9278
+ const quote = snapshot2.amounts.quote;
9279
+ if (Object.keys(value.quote).some((key) => quote[key] !== value.quote[key])) {
9280
+ invalid(["quote"], "The quote must be the one the display shows.");
9281
+ }
9282
+ }).meta({ allOf: [{
9283
+ if: { properties: { state: { const: "eligible" } }, required: ["state"] },
9284
+ then: { properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "checkout" } } } } } } }
9285
+ }] });
9286
+ var checkoutDraft = z43.object({
9287
+ plan: z43.enum(["plus", "pro"]).meta({ description: "The plan last chosen on the checkout page." }),
9288
+ cycle: billingCycle.meta({ description: "The cycle last chosen." }),
9289
+ billing: purchaseBillingDetails.meta({ description: "The company details last sent to the checkout start." }),
9290
+ updated_at: z43.iso.datetime().meta({ description: "When the draft was last saved." })
9291
+ }).strict();
9292
+ var checkoutDraftResponse = z43.object({
9293
+ draft: checkoutDraft.nullable().meta({ description: "The saved checkout draft, or `null`. Deleted once the checkout is paid." }),
9294
+ prefill: billingDetails.nullable().meta({ description: "The org's earlier billing details when there is no draft, else `null`." })
9295
+ }).strict().superRefine((value, ctx) => {
9296
+ if (value.draft !== null && value.prefill !== null)
9297
+ ctx.addIssue({ code: "custom", path: ["prefill"], message: "A draft answers alone; prefill is null beside it." });
9298
+ }).meta({ not: { properties: { draft: { type: "object" }, prefill: { type: "object" } }, required: ["draft", "prefill"] } });
9299
+ var checkoutOpenDetails = z43.object({
9300
+ field: z43.literal("billing"),
9301
+ rule: z43.literal("checkout_open"),
9302
+ expires_at: z43.iso.datetime().nullable().meta({ description: "When the open payment expires at the provider, or `null` when unknown." }),
9303
+ checkout_url: z43.url().nullable().meta({ description: "Where the open payment continues, or `null` when the provider no longer offers it." })
9304
+ }).strict();
9305
+ var viesUnavailableDetails = viesPending({ field: vatIdField, rule: z43.literal("vies_unavailable") });
8847
9306
  var purchaseIntentLookupQuery = z43.object({
8848
9307
  operation_key: purchaseOperationKey.optional().meta({ description: "The client operation key; supply this or intent_id, never both." }),
8849
9308
  intent_id: z43.uuid().optional().meta({ description: "The persisted intent ID; supply this or operation_key, never both." }),
@@ -8867,6 +9326,7 @@ var purchaseIntentConfirmRequest = z43.discriminatedUnion("operation", [
8867
9326
  ]);
8868
9327
  var purchaseConflictDetails = z43.discriminatedUnion("rule", [
8869
9328
  z43.object({ field: z43.literal("operation_key"), rule: z43.literal("operation_key_reused") }).strict(),
9329
+ z43.object({ field: z43.literal("confirmation_proof"), rule: z43.literal("display_stale") }).strict().meta({ description: "The display was spent, expired or no longer matches: fetch a fresh one and press again." }),
8870
9330
  z43.object({ field: z43.literal("intent"), rule: z43.enum(["stale_quote", "buyer_changed", "not_eligible", "invoice_not_open"]), current_intent: purchaseIntent }).strict()
8871
9331
  ]);
8872
9332
  var invoicePayRequest = z43.object({ operation_key: purchaseOperationKey }).strict();
@@ -8889,7 +9349,7 @@ var vatCheckIdentity = { vat_id: z43.string(), name: z43.string().nullable() };
8889
9349
  var vatIdCheckResponse = z43.discriminatedUnion("state", [
8890
9350
  z43.object({ ...vatCheckIdentity, state: z43.literal("eligible"), status: z43.literal("valid") }).strict(),
8891
9351
  z43.object({ ...vatCheckIdentity, state: z43.literal("refused"), status: z43.literal("invalid"), rule: z43.literal("vat_id_invalid") }).strict(),
8892
- z43.object({ ...vatCheckIdentity, state: z43.literal("pending"), status: z43.enum(["valid", "unverified", "unavailable"]), reason: viesPendingReason }).strict()
9352
+ viesPending({ ...vatCheckIdentity, state: z43.literal("pending"), status: z43.enum(["valid", "unverified", "unavailable"]) })
8893
9353
  ]);
8894
9354
  var billingChangeRequest = z43.object({
8895
9355
  operation_key: purchaseOperationKey,
@@ -8911,6 +9371,11 @@ var billingDetailsUpdate = z43.object({
8911
9371
  description: "Replaces the VAT ID; `null` clears it. Omitted leaves it as it is. A new ID is re-checked through VIES."
8912
9372
  })
8913
9373
  }).strict();
9374
+ var billingDetailsConflictDetails = z43.union([
9375
+ z43.object({ field: z43.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field a purchase would refuse. Nothing is saved." }),
9376
+ viesUnavailableDetails,
9377
+ z43.object({ field: z43.literal("billing"), rule: z43.literal("buyer_changed") }).strict().meta({ description: "The billing details changed meanwhile. Nothing is saved." })
9378
+ ]);
8914
9379
  var paymentMethodKind = z43.enum(["card", "paypal", "applepay"]);
8915
9380
  var paymentMethodChangeRequest = z43.object({
8916
9381
  operation_key: purchaseOperationKey,
@@ -8975,6 +9440,13 @@ var billingAccount = z43.object({
8975
9440
  vat_cents: z43.number().int().meta({ description: "VAT on the next charge, in integer cents." }),
8976
9441
  gross_cents: z43.number().int().meta({ description: "The next charge including VAT, in integer cents." })
8977
9442
  }).nullable().meta({ description: "`null` while a cancel is pending or nothing else renews." }),
9443
+ current_price: z43.object({
9444
+ net_cents: z43.number().int().meta({
9445
+ description: "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
9446
+ })
9447
+ }).nullable().meta({
9448
+ description: "What one period (`cycle`) of the current plan costs this organization: the price it agreed, which stays when the catalogue changes. Show this, not the catalogue price, as the price of a billed organization. `null` when no agreed price is recorded for the current plan, cycle and add-ons."
9449
+ }),
8978
9450
  scheduled: z43.object({
8979
9451
  cycle: billingCycle.nullable().meta({ description: "A cycle change queued for the period's end, or `null`." }),
8980
9452
  addons: orgAddons.nullable().meta({ description: "Add-on counts queued for the period's end, or `null`." })
@@ -9110,7 +9582,9 @@ var billingDocumentFileQuery = z43.object({
9110
9582
  }).strict();
9111
9583
  var acceptedBillingFields = {
9112
9584
  billing: billingView.meta({ description: "The billing view after the change." }),
9113
- charged: billingInvoice.nullable().meta({ description: "The invoice charged now, or `null` when the change was only scheduled for the period's end." })
9585
+ charged: billingInvoice.nullable().meta({
9586
+ description: "The Fleetless invoice charged now, or `null` when nothing was charged now (a change scheduled for the period end, or an increase that cost nothing) or the change was charged through Lexware (then the charge is in `billing.charges`)."
9587
+ })
9114
9588
  };
9115
9589
  var acceptedPaidChange = z43.object({
9116
9590
  ...acceptedBillingFields,
@@ -9118,7 +9592,9 @@ var acceptedPaidChange = z43.object({
9118
9592
  }).strict();
9119
9593
  var acceptedNoPaymentChange = z43.object({
9120
9594
  billing: billingView,
9121
- charged: z43.null(),
9595
+ charged: z43.null().meta({
9596
+ description: "Always `null`: nothing was charged now (a scheduled change or an increase that cost nothing)."
9597
+ }),
9122
9598
  intent: purchaseIntentAcceptedWithoutPayment
9123
9599
  }).strict();
9124
9600
  var billingChangeResponse = z43.union([
@@ -9133,7 +9609,7 @@ var purchaseIntentResponse = z43.union([
9133
9609
  acceptedNoPaymentChange
9134
9610
  ]);
9135
9611
 
9136
- // node_modules/.pnpm/@fleetless+contracts@15.0.0/node_modules/@fleetless/contracts/dist/routes.js
9612
+ // node_modules/.pnpm/@fleetless+contracts@18.1.0-next.2/node_modules/@fleetless/contracts/dist/routes.js
9137
9613
  var MCP_APP = MCP_APP_PATHS(":appIdentifier");
9138
9614
  var APP_IDENTIFIER = {
9139
9615
  name: "appIdentifier",
@@ -10284,7 +10760,7 @@ var ROUTES = [
10284
10760
  params: [
10285
10761
  { name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." },
10286
10762
  { name: "userId", description: "The app user's uuid, from `GET /api/apps/:id/users`; a user of another app answers `404`." },
10287
- { name: "clientId", description: "The MCP client, as `GET /api/apps/:id/users/:userId/mcp-grants` reports its `client_id`. Not a uuid \u2014 the identifier dynamic registration issued." }
10763
+ { name: "clientId", description: "The MCP client, as `GET /api/apps/:id/users/:userId/mcp-grants` reports its `client_id`. Not a uuid: the identifier dynamic registration issued, or the HTTPS URL of a Client ID Metadata Document, percent-encoded as one path segment (`encodeURIComponent`); the server decodes it once." }
10288
10764
  ],
10289
10765
  query: null,
10290
10766
  request: null,
@@ -10572,16 +11048,16 @@ var ROUTES = [
10572
11048
  summary: "Stores the logo the hosted pages show above the app's name.",
10573
11049
  audience: "developer",
10574
11050
  auth: "developer",
10575
- rateLimited: false,
11051
+ rateLimited: true,
10576
11052
  ownerTier: false,
10577
11053
  status: 200,
10578
11054
  params: [{ name: "id", description: "The app's uuid, as returned by `POST /api/apps` or listed by `GET /api/apps`." }],
10579
11055
  query: null,
10580
11056
  request: null,
10581
11057
  response: appAuthConfig,
10582
- errors: [...DEVELOPER_GUARD, "invalid_uuid", "validation_error", "not_found", "unsupported_media_type"],
11058
+ errors: [...DEVELOPER_GUARD, "invalid_uuid", "validation_error", "not_found", "unsupported_media_type", "rate_limited", "logo_draw_unavailable"],
10583
11059
  transport: "http",
10584
- notes: "The body is the **raw image**, not JSON, so it has no request schema: `Content-Type` is one of `HOSTED_LOGO_TYPES` (`image/png`, `image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (512 KB); a larger body, or one that is not the image its type names, is `400 validation_error`. A new logo replaces the stored one. The hosted pages load it from `hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs."
11060
+ notes: "The body is the **raw image**, not JSON, so it has no request schema: `Content-Type` is one of `HOSTED_LOGO_TYPES` (`image/png`, `image/svg+xml`) and anything else is `415 unsupported_media_type`. At most `HOSTED_LOGO_MAX_BYTES` (512 KB); a larger body, or one that is not the image its type names, is `400 validation_error`. A new logo replaces the stored one. The hosted pages load it from `hosted_logo_url` as an image only, and the cloud serves an SVG sandboxed, so a script inside one never runs. \n\n**Each upload is also drawn once**, into the small picture the app's mails show, and a logo that cannot be drawn is `400 validation_error`. Drawing costs the server, so uploads are limited per organization: five at once, then one a minute, answering `429 rate_limited` with `retry_after_ms`. When too many logos already wait to be drawn on the server, or the drawing itself fails, the answer is `503 logo_draw_unavailable`: nothing was stored, the logo in place stays, and retrying shortly may work."
10585
11061
  },
10586
11062
  {
10587
11063
  method: "DELETE",
@@ -10978,7 +11454,7 @@ var ROUTES = [
10978
11454
  response: authorizationServerMetadata,
10979
11455
  errors: [],
10980
11456
  transport: "http",
10981
- notes: "`registration_endpoint` being present is the whole point of the dynamic-registration work: a client that finds it registers itself and never asks a person for a `client_id`. `authorization_endpoint` is the only field that moves to the auth-portal origin when one is configured \u2014 `issuer`, `token_endpoint` and the resource identifier stay canonical, because a client checks a token's `iss` and `aud` against those strings and moving them would invalidate every token ever minted."
11457
+ notes: "`registration_endpoint` being present is the whole point of the dynamic-registration work: a client that finds it registers itself and never asks a person for a `client_id`. `client_id_metadata_document_supported: true` says the other way in: a client that publishes a Client ID Metadata Document uses its HTTPS URL as `client_id`, and the server fetches it at authorize. Both are offered; MCP 2026-07-28 prefers the document. `authorization_endpoint` is the only field that moves to the auth-portal origin when one is configured \u2014 `issuer`, `token_endpoint` and the resource identifier stay canonical, because a client checks a token's `iss` and `aud` against those strings and moving them would invalidate every token ever minted."
10982
11458
  },
10983
11459
  {
10984
11460
  method: "POST",
@@ -11014,7 +11490,7 @@ var ROUTES = [
11014
11490
  response: null,
11015
11491
  errors: [],
11016
11492
  transport: "http",
11017
- notes: "**The query schema is what this endpoint accepts, not what it parses**: the handler reads it parameter by parameter because the answers differ, and one parse would collapse them. Client and `redirect_uri` are validated first and a failure there never redirects, the same open-redirect discipline the app flow applies; those refusals are `oauthError`. Exact `redirect_uri` matching for both client kinds \u2014 the loopback-port wildcard of RFC 8252 \xA77.3 belongs to the one central client alone, whose URIs are configured ahead of time and cannot name an ephemeral port. A client that registered itself seconds ago can name the port it bound, and widening the wildcard there would only widen where a stolen `client_id` may send a browser. Nothing about the person is decided here \u2014 the next card asks for an email address, or a passkey, and the steps after it resolve the account; this route knows only the client."
11493
+ notes: "**The query schema is what this endpoint accepts, not what it parses**: the handler reads it parameter by parameter because the answers differ, and one parse would collapse them. Client and `redirect_uri` are validated first and a failure there never redirects, the same open-redirect discipline the app flow applies; those refusals are `oauthError`. \n\n**Three client kinds.** The one central client; a client that registered itself at `POST /mcp/oauth/register`; and a client whose `client_id` is the HTTPS URL of its Client ID Metadata Document (draft-ietf-oauth-client-id-metadata-document). The last is recognised by its `https://` prefix, which no issued id carries. Its URL must have a path other than `/`, no dot segment, query, fragment or userinfo, and at most 512 characters. On a cache miss the server fetches the document: `GET`, no redirects followed, 5 s, at most 5,120 bytes, `200` with a JSON content type, from a public address only, connecting to the exact address it checked. The document must name this URL as its `client_id`, list its `redirect_uris` and be a public client (`token_endpoint_auth_method` absent or `none`). A valid document is cached for its `Cache-Control: max-age`, clamped to 5 min \u2026 24 h (1 h without one); a failed fetch caches nothing and aborts with `invalid_client` and the cause. The fetches of one address share a bucket of 5 and one more a minute \u2014 a cache hit spends nothing \u2014 and a refused fetch is `invalid_client` too, answered in the handler rather than by a preHandler, which is why `rateLimited` is `false`. \n\n`redirect_uri` is matched exactly. The loopback-port wildcard of RFC 8252 \xA77.3 applies to the central client, whose URIs are configured ahead of time, and to a metadata-document client, whose static document cannot name the port a native client binds: a loopback `http` URI there may differ from a listed one in its port only. A client that registered itself seconds ago can name the port it bound, so it gets no wildcard. Nothing about the person is decided here \u2014 the next card asks for an email address, or a passkey, and the steps after it resolve the account; this route knows only the client."
11018
11494
  },
11019
11495
  {
11020
11496
  method: "GET",
@@ -11381,7 +11857,7 @@ var ROUTES = [
11381
11857
  response: authorizationServerMetadata,
11382
11858
  errors: ["not_found"],
11383
11859
  transport: "http",
11384
- notes: "RFC 8414, for the issuer `<PUBLIC_API_BASE_URL>/mcp/<identifier>` \u2014 the same path rule as the document above, and the same `404` for a switched-off app. `registration_endpoint` is present for the reason the central document states: a client that finds it registers itself and never asks a person for a `client_id`. \n\n**`issuer`, `token_endpoint` and the resource identifier are minted from the canonical public base, never from the friendly `mcp.fleetless.dev` alias or the request's `Host`**, because a client checks a minted token's `iss` and `aud` against these exact strings. \n\n**Unlike the central document, `authorization_endpoint` does not move to an auth-portal origin**: the authorization step renders no page itself. It redirects to the app's own `mcp_login_url`, or to the hosted MCP sign-in on the auth portal when the app has configured none."
11860
+ notes: "RFC 8414, for the issuer `<PUBLIC_API_BASE_URL>/mcp/<identifier>` \u2014 the same path rule as the document above, and the same `404` for a switched-off app. `registration_endpoint` is present for the reason the central document states: a client that finds it registers itself and never asks a person for a `client_id`, and `client_id_metadata_document_supported` is `true` as there. \n\n**`issuer`, `token_endpoint` and the resource identifier are minted from the canonical public base, never from the friendly `mcp.fleetless.dev` alias or the request's `Host`**, because a client checks a minted token's `iss` and `aud` against these exact strings. \n\n**Unlike the central document, `authorization_endpoint` does not move to an auth-portal origin**: the authorization step renders no page itself. It redirects to the app's own `mcp_login_url`, or to the hosted MCP sign-in on the auth portal when the app has configured none."
11385
11861
  },
11386
11862
  {
11387
11863
  method: "POST",
@@ -11417,7 +11893,7 @@ var ROUTES = [
11417
11893
  response: null,
11418
11894
  errors: ["not_found"],
11419
11895
  transport: "http",
11420
- notes: 'The same query as `GET /mcp/oauth/authorize`, read the same way \u2014 parameter by parameter, because the answers differ and one parse would collapse them. \n\n**This route renders no page.** It writes an interaction \u2014 ten minutes, as the OIDC ones live \u2014 and redirects to `appAuthConfig.mcp_login_url` with `{interaction}` filled in. The app then authenticates the person with its own UI, reads `GET /api/client/mcp/interactions/:id` to show the client\'s claimed name and the scopes it asked for, and calls approve or deny. **An app with no `mcp_login_url` is redirected to the hosted MCP sign-in** (`GET /app/:appIdentifier/mcp/:interaction`), which runs the same steps on the auth portal; nothing is refused for a missing URL. \n\nClient and `redirect_uri` are validated first and a failure there never redirects \u2014 the open-redirect discipline `GET /mcp/oauth/authorize` and `GET /api/client/oidc/:slug/start` both keep \u2014 and those refusals are RFC 6749\'s flat `oauthError`, which is why none of them appear above. `redirect_uri` is matched **exactly** against the registration, with no loopback-port wildcard: every client here registered itself minutes ago and can name the port it bound, so a wildcard would only widen where a stolen `client_id` may send a browser. \n\nThe code above is the `apiError` envelope because it is a refusal about the **app**, decided before an OAuth parameter is looked at. **`404 not_found` covers an identifier no app carries AND an app with MCP switched off** \u2014 the same single answer the two metadata documents, `register` and the transport give. An earlier draft answered `403 mcp_disabled` here, on the argument that a client which registered while the switch was on is owed the difference between "turned off" and "mistyped"; that argument does not survive the caller being anonymous. This route takes no credential, so the extra code was readable by anyone who could type an identifier, and it handed back precisely the existence distinction every neighbouring route collapses. `mcp_disabled` survives only where the caller has already proved they belong to the app \u2014 the two decision routes under `/api/client/mcp/interactions/:id`.'
11896
+ notes: 'The same query as `GET /mcp/oauth/authorize`, read the same way \u2014 parameter by parameter, because the answers differ and one parse would collapse them. \n\n**This route renders no page.** It writes an interaction \u2014 ten minutes, as the OIDC ones live \u2014 and redirects to `appAuthConfig.mcp_login_url` with `{interaction}` filled in. The app then authenticates the person with its own UI, reads `GET /api/client/mcp/interactions/:id` to show the client\'s claimed name, its domain and where the answer goes, and calls approve or deny. **An app with no `mcp_login_url` is redirected to the hosted MCP sign-in** (`GET /app/:appIdentifier/mcp/:interaction`), which runs the same steps on the auth portal; nothing is refused for a missing URL. \n\nClient and `redirect_uri` are validated first and a failure there never redirects \u2014 the open-redirect discipline `GET /mcp/oauth/authorize` and `GET /api/client/oidc/:slug/start` both keep \u2014 and those refusals are RFC 6749\'s flat `oauthError`, which is why none of them appear above. A client is one that registered itself at this app, or a Client ID Metadata Document client, fetched, cached and rate limited exactly as at `GET /mcp/oauth/authorize`; one document serves every app. `redirect_uri` is matched **exactly** against the registration or the document, with a loopback-port wildcard for a document\'s loopback URIs only: a self-registered client named the port it bound minutes ago, so a wildcard there would only widen where a stolen `client_id` may send a browser. \n\nThe code above is the `apiError` envelope because it is a refusal about the **app**, decided before an OAuth parameter is looked at. **`404 not_found` covers an identifier no app carries AND an app with MCP switched off** \u2014 the same single answer the two metadata documents, `register` and the transport give. An earlier draft answered `403 mcp_disabled` here, on the argument that a client which registered while the switch was on is owed the difference between "turned off" and "mistyped"; that argument does not survive the caller being anonymous. This route takes no credential, so the extra code was readable by anyone who could type an identifier, and it handed back precisely the existence distinction every neighbouring route collapses. `mcp_disabled` survives only where the caller has already proved they belong to the app \u2014 the two decision routes under `/api/client/mcp/interactions/:id`.'
11421
11897
  },
11422
11898
  {
11423
11899
  method: "POST",
@@ -11903,7 +12379,7 @@ var ROUTES = [
11903
12379
  rateLimited: false,
11904
12380
  ownerTier: false,
11905
12381
  status: 204,
11906
- params: [{ name: "clientId", description: "The MCP client, as `GET /api/client/mcp/grants` reports its `client_id`. Not a uuid \u2014 the identifier dynamic registration issued." }],
12382
+ params: [{ name: "clientId", description: "The MCP client, as `GET /api/client/mcp/grants` reports its `client_id`. Not a uuid: the identifier dynamic registration issued, or the HTTPS URL of a Client ID Metadata Document, percent-encoded as one path segment (`encodeURIComponent`); the server decodes it once." }],
11907
12383
  query: null,
11908
12384
  request: null,
11909
12385
  response: null,
@@ -13047,9 +13523,9 @@ var ROUTES = [
13047
13523
  query: null,
13048
13524
  request: planChangePrepareRequest,
13049
13525
  response: planChangePrepareResponse,
13050
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict"],
13526
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "plan_purchase_closed"],
13051
13527
  transport: "http",
13052
- notes: "Owner only. Persists a prepared change reference and a short-lived display, without mutating the plan, pending_change, or legal acceptance. A same-key, same-input retry while undecided returns the same change_id with a fresh display. A Basic cancellation reason belongs only in the final PUT."
13528
+ notes: "Owner only. Persists a prepared change reference and a short-lived display, without mutating the plan, pending_change, or legal acceptance. A same-key, same-input retry while undecided returns the same change_id with a fresh display. A Basic cancellation reason belongs only in the final PUT. A cancellation to Basic never waits for the VAT treatment; a lower paid plan names its gross, so while the account's VAT treatment is unresolved this route and the PUT answer 409 target_state_conflict with `{ field: billing.vat_id, rule: purchase_eligibility_pending }`."
13053
13529
  },
13054
13530
  {
13055
13531
  method: "PUT",
@@ -13065,7 +13541,7 @@ var ROUTES = [
13065
13541
  query: null,
13066
13542
  request: planChangeRequest,
13067
13543
  response: orgPlan,
13068
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict"],
13544
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "plan_purchase_closed"],
13069
13545
  transport: "http",
13070
13546
  notes: "Owner tier, and **downward only**: a prior prepare returns change_id and a displayed snapshot; this final PUT requires its confirmation_proof and the same operation_key, target_plan and keep. Only Basic permits cancellation_reason (at most 500 input characters). The reason is final idempotency metadata, not price or legal evidence. An exact replay returns the original result; a changed reason with the same key conflicts before effect. The decision and legal acceptance commit together. This route moves the org to a lower plan or cancels it outright to Basic. It never moves the org up \u2014 an upgrade or an add-on goes through the billing routes instead (`POST /api/billing/checkout`, `POST /api/billing/change`). `409 target_state_conflict` names `target_plan` with rule `not_lower` when the chosen plan is not below the org's current one; with rule `locked_basic_only` when the org is locked (`orgLock`) and the chosen plan is anything but Basic; and with rule `migration_basic_only` when the org is still on the beta, awaiting the switch to priced plans, and the chosen plan is anything but Basic \u2014 that choice is exactly what the org lands on at the switch. An owner is never named in `keep` and always stays, but still counts against the target plan's `seats`; `409 plan_limit` names `seats` when the owners alone already exceed it, and names whichever other limit `keep` still exceeds otherwise. `keep` is `null` when the org's current usage already fits the target plan outright and nothing is deleted; named, it lists exactly the robots, apps, app users and developers that stay. The choice is stored as `pending_change` and takes effect at `period_ends_at` \u2014 **everything of the chosen kind not named in `keep` is deleted at that instant, never before** \u2014 except a choice made while the org is locked, which takes effect at once, and a beta org's choice, which takes effect at the switch date instead. Anything created while the choice is pending is checked against the target plan too and, when it passes, is folded into `keep`, so exactly what the confirmation counted is what is actually deleted. Replacing a still-pending choice requires a new prepare and proof-bound final PUT."
13071
13547
  },
@@ -13149,13 +13625,13 @@ var ROUTES = [
13149
13625
  response: billingView,
13150
13626
  errors: [...DEVELOPER_GUARD, "tier_required"],
13151
13627
  transport: "http",
13152
- notes: "`available: false` when `MOLLIE_API_KEY` is not configured \u2014 this cloud takes no payments, and every billing route that charges or opens a Mollie checkout answers `503 billing_unavailable` instead of acting; plan-change prepare, resume, the details and the VAT-ID check need no Mollie and answer normally. `account` is `null` before the org has ever checked out; the plan and its limits still come from `GET /api/org/plan` (fleetless/fleetless issue 103) and are not repeated here."
13628
+ notes: "`available: false` when `MOLLIE_API_KEY` is not configured \u2014 this cloud takes no payments, and every billing route that charges or opens a Mollie checkout answers `503 billing_unavailable` instead of acting; plan-change prepare, resume, the details and the VAT-ID check need no Mollie and answer normally. `account` is `null` before the org has ever checked out; the plan and its limits still come from `GET /api/org/plan` (fleetless/fleetless issue 103) and are not repeated here. Where this cloud sells paid plans only to organizations Fleetless has unlocked, an org that is not unlocked reads `paid_plans: closed` there, and checkout, the decision display, the confirm of a checkout or paid change, `POST /api/billing/change`, and a plan-change prepare or final PUT whose target is not Basic answer `403 plan_purchase_closed`; this read, the checkout poll, cancel, resume, the details, the payment method, invoices and charges (their confirm included), the documents and a Basic target are never refused by it."
13153
13629
  },
13154
13630
  {
13155
13631
  method: "POST",
13156
13632
  path: "/api/billing/checkout",
13157
13633
  section: "billing",
13158
- summary: "Records a company purchase intent for the first paid plan.",
13634
+ summary: "Decides a company's first paid plan and returns its order summary to confirm.",
13159
13635
  audience: "developer",
13160
13636
  auth: "developer",
13161
13637
  rateLimited: true,
@@ -13164,10 +13640,28 @@ var ROUTES = [
13164
13640
  params: [],
13165
13641
  query: null,
13166
13642
  request: checkoutRequest,
13167
- response: checkoutResponse,
13168
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13643
+ response: checkoutStartResponse,
13644
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "rate_limited", "plan_purchase_closed", ...BILLING_OFF, ...MOLLIE],
13169
13645
  transport: "http",
13170
- notes: "Basic stays free for every payer. This start creates only a nonbinding draft; accept_terms is deprecated and cannot confirm an order. Current company, buyer, VIES and EUR quote checks still apply. Persist operation_key before POST; the same key and input return 200 with the existing intent (and its hosted checkout when payment_started), without another Mollie payment; changed input conflicts. A different operation_key while a first payment is open returns 409 target_state_conflict with rule checkout_open and details expires_at: null. An eligible Owner obtains a no-store C.4 display, then explicitly confirms with its proof. No payment or acceptance occurs at start. Hosted payment later offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. An active/past_due account uses billing/change."
13646
+ notes: "Basic stays free for every payer. The start decides in this request, VIES included: a busy VIES is retried for up to 15 seconds before the answer. The body is first saved as the org's checkout draft (`GET /api/billing/checkout-draft`), whatever the answer. `eligible` (201) records the pending billing account and a checkout intent, freezes the EUR quote and carries its C.4 display, Cache-Control: no-store: show `display.snapshot.declaration.text` directly above one button labelled `action_label`; that one click is `POST /api/billing/intents/:id/confirm` with the display's `confirmation_proof`. `vies_unavailable`, `invalid_vat_id` and `refused` answer 200 and nothing is stored but the draft: no intent, no account, no retry in the background; check again. `vies_unavailable` with `reason: vies_unavailable` carries `vies_outage`: `scope: member_state` when the VAT register of `country` does not answer VIES (a register VIES reports as down answers at once, not after the 15 seconds), `scope: vies` when VIES itself does not. `held` (`issuer_cutover_in_progress`) only while an issuer cutover runs, for minutes; try again. Lexware never holds a checkout: its contact and invoice follow the payment. Use a fresh operation_key per press; the same key and input answer 200 with the same intent (`payment_started` with its hosted checkout once confirmed), without another Mollie payment; changed input conflicts. While another first payment of the org is open, 409 target_state_conflict with `checkoutOpenDetails` (rule `checkout_open`): continue it at `checkout_url`. No payment or acceptance occurs at start, and the deprecated `accept_terms` confirms nothing. Hosted payment offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. Rate limited on billing.checkout_start. An active/past_due account uses billing/change."
13647
+ },
13648
+ {
13649
+ method: "GET",
13650
+ path: "/api/billing/checkout-draft",
13651
+ section: "billing",
13652
+ summary: "Reads the checkout draft, or the org's earlier billing details, to fill the checkout page.",
13653
+ audience: "developer",
13654
+ auth: "developer",
13655
+ rateLimited: false,
13656
+ ownerTier: true,
13657
+ status: 200,
13658
+ params: [],
13659
+ query: null,
13660
+ request: null,
13661
+ response: checkoutDraftResponse,
13662
+ errors: [...DEVELOPER_GUARD, "tier_required"],
13663
+ transport: "http",
13664
+ notes: "`draft` is what the last `POST /api/billing/checkout` received, saved whatever it decided, and deleted once the checkout is paid. Without one, `prefill` carries the org's earlier billing details; both are `null` for a first purchase, never both set. A reload, a new tab or a return from Mollie fills the form from here. Reading changes nothing."
13171
13665
  },
13172
13666
  {
13173
13667
  method: "GET",
@@ -13183,9 +13677,9 @@ var ROUTES = [
13183
13677
  query: purchaseIntentLookupQuery,
13184
13678
  request: null,
13185
13679
  response: purchaseIntentResponse,
13186
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
13680
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict", ...MOLLIE],
13187
13681
  transport: "http",
13188
- notes: "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click."
13682
+ notes: "Supply exactly one of operation_key or intent_id and the expected operation. Scope lookup to the authenticated owner and org; unknown, foreign-org or mismatched-operation intents return 404 without disclosure. Repeating a lookup after restart or lost response returns the same intent/payment identity and, for a paid change, its billing result. A proof is never returned here; a still-eligible decision needs a fresh C.4 display and explicit Owner click. A started hosted payment is read at the provider first: 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when it is no longer open there (paid, canceled, expired or failed), and 502 payment_provider_unavailable when the provider does not answer. A `mandate_setup` whose payment the provider never answered also answers that 502: send its `POST /api/billing/payment-method` again with the same key. An `awaiting_vies` intent with `reason: vies_unavailable` carries `vies_outage` as the hourly retry last found it: `scope: member_state` for the VAT register of `country`, `scope: vies` for VIES itself."
13189
13683
  },
13190
13684
  {
13191
13685
  method: "POST",
@@ -13201,9 +13695,9 @@ var ROUTES = [
13201
13695
  query: null,
13202
13696
  request: billingDecisionDisplayRequest,
13203
13697
  response: billingDecisionDisplayResponse,
13204
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict"],
13698
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict", "plan_purchase_closed"],
13205
13699
  transport: "http",
13206
- notes: "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
13700
+ notes: "Owner only, Cache-Control: no-store. Cloud persists the snapshot and proof hash for an eligible current checkout or paid-change intent of this Owner and org. A checkout start already returns its display; this route issues one for a paid change, and a fresh one for an intent that is still eligible. `snapshot.declaration` carries the approved sentence of the decision's action (`text_id`, `text`) and the label of its one button (`action_label`): `Pay 34,51 \u20AC with Mollie`, `Pay 95 \u20AC and switch`, `Switch to Pro`, `Switch to monthly at period end`, `Schedule downgrade to Plus`, `Cancel at period end` or `Delete the rest and stay on Basic`. Render both as sent. Pending, held, refused or accepted intents cannot mint a new proof. The proof never appears in lookup, billing views or logs."
13207
13701
  },
13208
13702
  {
13209
13703
  method: "POST",
@@ -13219,9 +13713,9 @@ var ROUTES = [
13219
13713
  query: null,
13220
13714
  request: purchaseIntentConfirmRequest,
13221
13715
  response: purchaseIntentResponse,
13222
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict", "plan_limit", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13716
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict", "plan_limit", "rate_limited", "plan_purchase_closed", ...BILLING_OFF, ...MOLLIE],
13223
13717
  transport: "http",
13224
- notes: "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock; stale or spent proof conflicts without effect. One decision and one legal acceptance commit together. An exact same-key replay returns the original result without another payment or acceptance. A paid change can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; it does not start another charge. Foreign ownership answers 404 without disclosure; pending or held cannot charge."
13718
+ notes: "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock. A spent, expired or stale proof answers 409 target_state_conflict with `{ field: confirmation_proof, rule: display_stale }` and changes nothing: fetch a fresh display (for a checkout, a new start with a new key) and press again; never resend the click. One decision, one legal acceptance and, for a charge, the hosted payment commit in this one request. An exact same-key replay returns the original result without another payment or acceptance. For a checkout, after 502 payment_provider_unavailable the same key and proof may be sent again within 50 minutes: the payment is created with the same idempotency key, so at most one exists. A paid change after a 502 answers charge_in_progress until the earlier charge is settled (within about an hour), then the same key and proof charge once more. While another first payment of the org is open, a checkout answers 409 target_state_conflict with `checkoutOpenDetails` (rule `checkout_open`): continue it at `checkout_url`. A paid change can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; it does not start another charge. After the Lexware issuer cutover, a paid change that charges something while the billing details lack a company name or a full address answers 409 target_state_conflict with `{ field: billing, rule: purchase_eligibility_pending }` before the proof is consumed: nothing is charged until they are complete. Foreign ownership answers 404 without disclosure; held cannot charge."
13225
13719
  },
13226
13720
  {
13227
13721
  method: "GET",
@@ -13233,7 +13727,7 @@ var ROUTES = [
13233
13727
  rateLimited: false,
13234
13728
  ownerTier: true,
13235
13729
  status: 200,
13236
- params: [{ name: "id", description: "The checkout id from `checkoutResponse.checkout_id`, carried on the return URL." }],
13730
+ params: [{ name: "id", description: "The checkout id from a started payment's `payment.checkout_id`, carried on the return URL." }],
13237
13731
  query: null,
13238
13732
  request: null,
13239
13733
  response: checkoutStatus,
@@ -13257,13 +13751,13 @@ var ROUTES = [
13257
13751
  response: vatIdCheckResponse,
13258
13752
  errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "rate_limited"],
13259
13753
  transport: "http",
13260
- notes: "Reports status and optional display name only; full evidence stays in protected Finance storage. valid with a missing identifier remains pending/vies_identifier_missing. unverified or unavailable remains pending without zero rating or payment. A form check never authorizes a later charge; Cloud binds current evidence to the buyer and quote at confirmation. Rate limited on billing.vat_check."
13754
+ notes: "Reports status and optional display name only; full evidence stays in protected Finance storage. valid with a missing identifier remains pending/vies_identifier_missing. unverified or unavailable remains pending without zero rating or payment. pending/vies_unavailable carries `vies_outage`: `scope: member_state` when the VAT register of `country` does not answer VIES, which answers at once when VIES reports the register as down, and `scope: vies` when VIES itself does not answer within the 15 seconds. A form check never authorizes a later charge; Cloud binds current evidence to the buyer and quote at confirmation. Rate limited on billing.vat_check."
13261
13755
  },
13262
13756
  {
13263
13757
  method: "PATCH",
13264
13758
  path: "/api/billing/details",
13265
13759
  section: "billing",
13266
- summary: "Edits company billing details for revalidation before the next charge.",
13760
+ summary: "Edits the company's billing details; details a purchase would refuse are not saved.",
13267
13761
  audience: "developer",
13268
13762
  auth: "developer",
13269
13763
  rateLimited: false,
@@ -13273,9 +13767,9 @@ var ROUTES = [
13273
13767
  query: null,
13274
13768
  request: billingDetailsUpdate,
13275
13769
  response: billingView,
13276
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found"],
13770
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "target_state_conflict"],
13277
13771
  transport: "http",
13278
- notes: "404 not_found when no billing account exists. Edits may change company name, full address/state, Tax ID, VAT ID and invoice email. Validate the merged buyer before a later charge; edits invalidate old evidence and quote revisions. Revalidate the email policy and country requirements. An edit does not create a payment, activate a plan, pay an invoice, clear dunning or lift a lock."
13772
+ notes: "404 not_found when no billing account exists. Send only the fields that change: company name, full address with state, Tax ID, VAT ID, invoice email. The merged company is decided as a checkout decides its buyer, and saved only when a purchase would accept it. Every refusal is 409 target_state_conflict with `billingDetailsConflictDetails` and saves nothing: `{ field, rule }` for a field a purchase refuses (`rule` a `purchaseRefusalRule`; `field` one of `billing.kind`, `billing.vat_id`, `billing.tax_id`, `billing.address.state`, `billing.invoice_email`), `vat_id_invalid` at `billing.vat_id` when VIES does not know the VAT ID; `viesUnavailableDetails` (`field: billing.vat_id`, `rule: vies_unavailable`) when VIES did not answer within its 15 seconds: send the same edit again (with `reason: vies_unavailable` it carries `vies_outage`: `scope: member_state` for the VAT register of `country`, `scope: vies` for VIES itself); `{ field: billing, rule: buyer_changed }` when the details changed while the edit was decided: read `GET /api/billing` and send it again. VIES is asked when the country or the VAT ID changes, in another EU country; any other edit keeps a valid recorded VIES answer and needs none. While the VAT ID on file has no valid VIES answer (`account.vat` is null), every edit asks VIES about it again, also with the VAT ID unchanged: a valid answer is recorded and lifts the hold, any other answer saves the edit and leaves the hold as it is. A saved edit re-prices open due charges, updates the invoicing contact and invalidates quotes made for the old details. An issued invoice keeps the details it was issued with. An edit creates no payment, activates no plan, pays no invoice, clears no dunning and lifts no lock. A person account from before company-only purchases is saved without these checks; it cannot buy."
13279
13773
  },
13280
13774
  {
13281
13775
  method: "POST",
@@ -13291,15 +13785,15 @@ var ROUTES = [
13291
13785
  query: null,
13292
13786
  request: billingChangeRequest,
13293
13787
  response: billingChangeResponse,
13294
- errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", ...BILLING_OFF, ...MOLLIE],
13788
+ errors: [...DEVELOPER_GUARD, "tier_required", "validation_error", "plan_limit", "target_state_conflict", "plan_purchase_closed", ...BILLING_OFF, ...MOLLIE],
13295
13789
  transport: "http",
13296
- notes: "The request names an absolute plan/cycle/add-on target and a stable operation_key. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. An eligible Owner obtains a C.4 display and explicitly confirms with its proof. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain. A later paid-change confirmation can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; no second charge starts."
13790
+ notes: "The request names an absolute plan/cycle/add-on target and a fresh operation_key per selection. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. The change is decided in the request and never waits: no `awaiting_vies`, and Lexware never holds it; `held` (`issuer_cutover_in_progress`) only while an issuer cutover runs. VIES runs only when the billing details changed since the last decision or the recorded VAT treatment is blocked, and a change that charges nothing never calls it. When VIES does not answer: 409 target_state_conflict with `viesUnavailableDetails` (`field: billing.vat_id`, `rule: vies_unavailable`), nothing stored; with `reason: vies_unavailable` it carries `vies_outage` (`scope: member_state` for the VAT register of `country`, `scope: vies` for VIES itself). A change charging nothing while the recorded VAT treatment is unresolved: 409 target_state_conflict with `{ field: billing.vat_id, rule: purchase_eligibility_pending }`. An eligible Owner obtains a C.4 display (`POST /api/billing/intents/:id/display`) and confirms with one click on its `action_label`. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain. A later paid-change confirmation can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; no second charge starts."
13297
13791
  },
13298
13792
  {
13299
13793
  method: "POST",
13300
13794
  path: "/api/billing/payment-method",
13301
13795
  section: "billing",
13302
- summary: "Records an invoice-paying method intent or a held mandate setup.",
13796
+ summary: "Starts a payment-method change: a hosted payment of 0.00 for a new mandate.",
13303
13797
  audience: "developer",
13304
13798
  auth: "developer",
13305
13799
  rateLimited: true,
@@ -13309,9 +13803,9 @@ var ROUTES = [
13309
13803
  query: null,
13310
13804
  request: paymentMethodChangeRequest,
13311
13805
  response: checkoutResponse,
13312
- errors: ["target_state_conflict", ...DEVELOPER_GUARD, "tier_required", "validation_error", "not_found", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13806
+ errors: ["target_state_conflict", ...DEVELOPER_GUARD, "tier_required", "support_forbidden", "validation_error", "not_found", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13313
13807
  transport: "http",
13314
- notes: "Use a stable operation_key and owner intent lookup after reload/timeout. Offer payment_method_options. Apple Pay with zero-amount changes disabled pays an open invoice through operation payment_method_invoice; without one, 400 validation_error has field method and rule applepay_needs_open_invoice. Apply the same buyer/VIES gate, current-amount reconfirmation and USD legacy hold as invoices/:id/pay. Pending, eligible and held contain no checkout URL; redirect only on payment_started.payment.kind hosted. A 0.00 mandate-only setup uses operation mandate_setup and held/mandate_policy_unresolved until the integration decision settles eligibility and currency. It pays no invoice and clears no dunning or lock. An invoice charged back is never retried automatically. 404 not_found when no account exists. Same key with changed input is a typed operation_key_reused conflict."
13808
+ notes: "Offer `payment_method_options`. A change is a 0.00 `first` payment on the provider's hosted page, restricted to the chosen method: the answer is operation `mandate_setup` in `payment_started` with `payment.kind` hosted at once; redirect to its `checkout_url`. Nothing is quoted, so there is no `eligible` step, no confirmation and no VIES. It pays no invoice and clears no dunning or lock: open invoices stay open. When the provider reports it paid, the new mandate is the account's and every other valid mandate of the customer is revoked; canceled, expired or failed, nothing changes. `GET /api/billing/checkout/:id` with the `checkout_id` reads the outcome (`purpose: payment_method`). Use one operation_key per method until its payment is finished. The same key again answers 200 with the same `payment_started` while the payment is open. 502 payment_provider_unavailable when the provider did not answer: the same key again resumes, and sends the same payment again under the same idempotency key. 409 target_state_conflict with `{ field: billing, rule: checkout_not_open }` when the key's payment is finished or can no longer be sent: start again with a new key. Same key with another method is a typed operation_key_reused conflict. A change stored while changes were on hold reads `held` with `mandate_policy_unresolved`; start again with a new key. Apple Pay with zero-amount changes disabled pays an open invoice through operation payment_method_invoice, with the buyer/VIES gate, current-amount reconfirmation and USD legacy hold of invoices/:id/pay; without an open invoice, 400 validation_error has field method and rule applepay_needs_open_invoice. An invoice charged back is never retried automatically. 404 not_found when no billing account is active or past due. Owner only: a support session is answered 403 support_forbidden."
13315
13809
  },
13316
13810
  {
13317
13811
  method: "POST",