@fleetless/sdk 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -24,7 +24,9 @@ __export(index_exports, {
24
24
  CANCEL_RETURN_CODES: () => CANCEL_RETURN_CODES,
25
25
  FleetlessError: () => FleetlessError,
26
26
  InMemoryTokenStore: () => InMemoryTokenStore,
27
+ LIVE_START_REFUSALS: () => LIVE_START_REFUSALS,
27
28
  SDK_ERROR_CODES: () => SDK_ERROR_CODES,
29
+ cameraOfflineDetails: () => cameraOfflineDetails,
28
30
  cancelRejectedDetails: () => cancelRejectedDetails,
29
31
  createClient: () => createClient,
30
32
  parameterInvalidDetails: () => parameterInvalidDetails,
@@ -449,16 +451,16 @@ function createAssetsApi(http) {
449
451
  };
450
452
  }
451
453
 
452
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-restore.js
454
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-restore.js
453
455
  var import_zod6 = require("zod");
454
456
 
455
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-intents.js
457
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-intents.js
456
458
  var import_zod5 = require("zod");
457
459
 
458
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/app-users.js
460
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-users.js
459
461
  var import_zod4 = require("zod");
460
462
 
461
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/identity.js
463
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/identity.js
462
464
  var import_zod = require("zod");
463
465
  var password = import_zod.z.string().min(12).max(256);
464
466
  var USER_DISPLAY_NAME_MAX = 120;
@@ -681,7 +683,7 @@ var recoveryCodesResponse = import_zod.z.object({
681
683
  recovery_codes: recoveryCodesList.meta({ description: "The ten new recovery codes, lowercase, shown once. Every earlier code is void." })
682
684
  });
683
685
 
684
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/app-mail-html.js
686
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-mail-html.js
685
687
  var DEFAULT_MAIL_HTML = {
686
688
  "invite": `<!doctype html>
687
689
  <html lang="en">
@@ -769,7 +771,7 @@ var DEFAULT_MAIL_HTML = {
769
771
  `
770
772
  };
771
773
 
772
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/legal.js
774
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal.js
773
775
  var import_zod2 = require("zod");
774
776
  var httpsLegalUrl = import_zod2.z.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) => {
775
777
  try {
@@ -789,7 +791,7 @@ var legalTextReferences = import_zod2.z.object({
789
791
  dpa: legalDocumentReference.nullable()
790
792
  }).strict();
791
793
 
792
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/rights.js
794
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/rights.js
793
795
  var import_zod3 = require("zod");
794
796
  var ROLE_KEY_PATTERN = /^(?!defaults$)[a-z][a-z0-9_]{0,62}$/;
795
797
  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.";
@@ -827,7 +829,7 @@ var ENTRY_KIND_OF = {
827
829
  };
828
830
  var SECTIONS = Object.keys(ENTRY_KIND_OF);
829
831
 
830
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/app-users.js
832
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/app-users.js
831
833
  var APP_USER_DISPLAY_NAME_MAX = 120;
832
834
  var providerSlug = import_zod4.z.string().max(40).regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, "must be lowercase and hyphen-separated, starting with a letter");
833
835
  var appUserStatus = import_zod4.z.enum(["pending_verification", "active", "blocked"]);
@@ -1215,7 +1217,7 @@ var mailOutcome = import_zod4.z.object({
1215
1217
  })
1216
1218
  });
1217
1219
 
1218
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-intents.js
1220
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-intents.js
1219
1221
  var hash = import_zod5.z.string().regex(/^[0-9a-f]{64}$/);
1220
1222
  var uuid = import_zod5.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
1221
1223
  var opaqueId = import_zod5.z.string().min(1);
@@ -1313,7 +1315,7 @@ var journalIntentV2 = import_zod5.z.discriminatedUnion("kind", [
1313
1315
  ...branches.slice(1).map((branch) => branch.extend(envelope))
1314
1316
  ]);
1315
1317
 
1316
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-restore.js
1318
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-restore.js
1317
1319
  var hash2 = import_zod6.z.string().regex(/^[0-9a-f]{64}$/);
1318
1320
  var uuid2 = import_zod6.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
1319
1321
  var opaqueId2 = import_zod6.z.string().min(1);
@@ -1733,7 +1735,7 @@ var journalReplayReceiptBody = import_zod6.z.strictObject(receiptFields).superRe
1733
1735
  }).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.");
1734
1736
  var journalReplayReceipt = journalReplayReceiptBody.safeExtend({ receipt_hash: hash2, signature: signature2 });
1735
1737
 
1736
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-manifests.js
1738
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-manifests.js
1737
1739
  var import_zod7 = require("zod");
1738
1740
  var uuid3 = import_zod7.z.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}$/);
1739
1741
  var hash3 = import_zod7.z.string().regex(/^[0-9a-f]{64}$/);
@@ -2089,7 +2091,7 @@ var journalManifestBinding = import_zod7.z.strictObject({
2089
2091
  problem("Unexpected batch", ["manifest", "batches"]);
2090
2092
  }).describe("JSON Schema consumers must also verify exact intent/scope/batch binding, sorted physical membership, original bytes and protected readbacks.");
2091
2093
 
2092
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-seals.js
2094
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-seals.js
2093
2095
  var import_zod8 = require("zod");
2094
2096
  var hash4 = import_zod8.z.string().regex(/^[0-9a-f]{64}$/);
2095
2097
  var uuid4 = import_zod8.z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/);
@@ -2171,7 +2173,7 @@ var journalFinalSealBody = import_zod8.z.strictObject({
2171
2173
  }, { 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.");
2172
2174
  var journalFinalSeal = journalFinalSealBody.safeExtend({ seal_hash: hash4, signature: signature3 });
2173
2175
 
2174
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/journal-controls.js
2176
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/journal-controls.js
2175
2177
  var import_zod9 = require("zod");
2176
2178
  var hash5 = import_zod9.z.string().regex(/^[0-9a-f]{64}$/);
2177
2179
  var zeroHash = import_zod9.z.literal("0".repeat(64));
@@ -2274,23 +2276,23 @@ var journalRegistryActivationReceipt = import_zod9.z.union([
2274
2276
  laterActivationBody.extend({ receipt_hash: hash5, signature: signature4 })
2275
2277
  ]);
2276
2278
 
2277
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2279
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2278
2280
  var import_zod13 = require("zod");
2279
2281
 
2280
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/plans.js
2282
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/plans.js
2281
2283
  var import_zod12 = require("zod");
2282
2284
 
2283
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
2285
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/purchase-operation-key.js
2284
2286
  var import_zod10 = require("zod");
2285
2287
  var purchaseOperationKey = import_zod10.z.uuid().meta({ description: "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input." });
2286
2288
 
2287
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/confirmation-proof.js
2289
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/confirmation-proof.js
2288
2290
  var import_zod11 = require("zod");
2289
2291
  var confirmationProof = import_zod11.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
2290
2292
  description: "Opaque 32-byte Cloud proof, unpadded base64url. Syntax alone is not evidence."
2291
2293
  });
2292
2294
 
2293
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/plans.js
2295
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/plans.js
2294
2296
  var planId = import_zod12.z.enum(["basic", "plus", "pro", "enterprise"]);
2295
2297
  var PLAN_ORDER = ["basic", "plus", "pro", "enterprise"];
2296
2298
  var planLimitKey = import_zod12.z.enum([
@@ -2599,7 +2601,7 @@ var adminPlanChangeRequest = import_zod12.z.object({
2599
2601
  })
2600
2602
  }).strict();
2601
2603
 
2602
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2604
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-offers.js
2603
2605
  var utc = import_zod13.z.iso.datetime().regex(/Z$/);
2604
2606
  var text = import_zod13.z.string().min(1).regex(/\S/);
2605
2607
  var cents2 = import_zod13.z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
@@ -2735,7 +2737,7 @@ var legalOfferConflictDetails = import_zod13.z.strictObject({
2735
2737
  rule: import_zod13.z.enum(["withdrawn", "stale", "expired", "reused", "boundary_changed", "deadline_unavailable"])
2736
2738
  });
2737
2739
 
2738
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/common.js
2740
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/common.js
2739
2741
  var import_zod14 = require("zod");
2740
2742
  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.";
2741
2743
  var slug = import_zod14.z.string().min(2).max(63).regex(/^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/, SLUG_RULE);
@@ -2766,7 +2768,7 @@ var applyError = import_zod14.z.object({
2766
2768
  details: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.unknown()).optional()
2767
2769
  });
2768
2770
 
2769
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/mcp.js
2771
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/mcp.js
2770
2772
  var import_zod15 = require("zod");
2771
2773
  function mcpAppEndpointPath(appIdentifier2) {
2772
2774
  return `/mcp/${appIdentifier2}`;
@@ -2811,13 +2813,13 @@ var mcpRobotDatasheet = import_zod15.z.object({
2811
2813
  });
2812
2814
  var MCP_ASSET_LINK_TTL_MS = 15 * 60 * 1e3;
2813
2815
 
2814
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/protocol.js
2816
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/protocol.js
2815
2817
  var import_zod22 = require("zod");
2816
2818
 
2817
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/assets.js
2819
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/assets.js
2818
2820
  var import_zod17 = require("zod");
2819
2821
 
2820
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/file-too-large-details.js
2822
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/file-too-large-details.js
2821
2823
  var import_zod16 = require("zod");
2822
2824
  var fileTooLargeDetails = import_zod16.z.object({
2823
2825
  max_bytes: import_zod16.z.number().int().positive().meta({
@@ -2828,7 +2830,7 @@ var fileTooLargeDetails = import_zod16.z.object({
2828
2830
  })
2829
2831
  });
2830
2832
 
2831
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/assets.js
2833
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/assets.js
2832
2834
  var assetKind = import_zod17.z.enum(["urdf", "mesh", "texture"]);
2833
2835
  var asset = import_zod17.z.object({
2834
2836
  id: import_zod17.z.uuid().meta({ description: "The asset's id in the store." }),
@@ -3168,10 +3170,10 @@ var assetSyncBusyDetails = import_zod17.z.object({
3168
3170
  started_at_ms: import_zod17.z.number().int().nonnegative()
3169
3171
  });
3170
3172
 
3171
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/config.js
3173
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config.js
3172
3174
  var import_zod19 = require("zod");
3173
3175
 
3174
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/alerts.js
3176
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/alerts.js
3175
3177
  var import_zod18 = require("zod");
3176
3178
  var alertRowCondition = import_zod18.z.discriminatedUnion("kind", [
3177
3179
  import_zod18.z.strictObject({
@@ -3241,7 +3243,7 @@ var putDatapointDisplayRequest = import_zod18.z.object({
3241
3243
  y_max: import_zod18.z.number().finite().nullable()
3242
3244
  }).strict();
3243
3245
 
3244
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/config.js
3246
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config.js
3245
3247
  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:`.";
3246
3248
  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:`.";
3247
3249
  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.";
@@ -3547,14 +3549,14 @@ var datapointNumeric = strictObject({
3547
3549
  });
3548
3550
  var datapointRetention = strictObject({
3549
3551
  enabled: import_zod19.z.boolean().meta({
3550
- description: "Whether values are written to the time series and become queryable. Off by default: without it the value is live only, and nobody who was not watching will ever see it."
3552
+ description: "Whether values are written to the time series and become queryable. Off by default: without it the value is live only, and nobody who was not watching will ever see it. It also switches the robot's buffer: with it off, the robot holds nothing for this datapoint, and switching it off drops what the robot held."
3551
3553
  }).optional(),
3552
3554
  interval_seconds: import_zod19.z.number().int().min(1).max(3600).meta({
3553
3555
  description: "How often a value is written to history, in seconds; absent means `300`. **Not** how often it is sent \u2014 that is `rate_throttle_hz`. Stored points are billed, so this is the direct lever on what a robot costs, and a bumper that is true for 200 ms does not appear unless a write falls inside it.",
3554
3556
  examples: [300, 60]
3555
3557
  }).optional(),
3556
3558
  max_buffer_values: import_zod19.z.number().int().min(1).max(1e5).meta({
3557
- description: "How many values the robot holds while the bridge is disconnected, to be pushed once it reconnects. The catch-up runs behind live telemetry and job results at a limited rate, so closing a gap never delays the present; without it the series simply has a gap, which is an honest answer.",
3559
+ description: "How many values the robot holds while the bridge is disconnected, to be pushed once it reconnects. The catch-up runs behind live telemetry and job results at a limited rate, so closing a gap never delays the present; without it the series simply has a gap, which is an honest answer. It needs `enabled`, and it also holds the values low-bandwidth mode's rate cap holds back.",
3558
3560
  examples: [5e3]
3559
3561
  }).optional()
3560
3562
  });
@@ -4464,7 +4466,7 @@ var configState = import_zod19.z.object({
4464
4466
  applied_errors: import_zod19.z.array(applyError).nullable()
4465
4467
  });
4466
4468
 
4467
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/introspection.js
4469
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/introspection.js
4468
4470
  var import_zod20 = require("zod");
4469
4471
  var rosGraphEntry = import_zod20.z.object({
4470
4472
  name: rosName,
@@ -4474,7 +4476,22 @@ var rosGraph = import_zod20.z.object({
4474
4476
  topics: import_zod20.z.array(rosGraphEntry),
4475
4477
  services: import_zod20.z.array(rosGraphEntry),
4476
4478
  actions: import_zod20.z.array(rosGraphEntry),
4477
- captured_at_ms: import_zod20.z.number().int().nonnegative()
4479
+ captured_at_ms: import_zod20.z.number().int().nonnegative(),
4480
+ /**
4481
+ * How many entries of each list the bridge left out because the graph did
4482
+ * not fit `BRIDGE_FRAME_MAX_BYTES` (fleetless/fleetless#1222); absent when
4483
+ * the graph is complete. The bridge keeps first every name the applied
4484
+ * configuration references, then fills up in name order, so a validation
4485
+ * against the published config stays exact; a name that is missing may
4486
+ * still exist on the robot.
4487
+ */
4488
+ omitted: import_zod20.z.object({
4489
+ topics: import_zod20.z.number().int().nonnegative(),
4490
+ services: import_zod20.z.number().int().nonnegative(),
4491
+ actions: import_zod20.z.number().int().nonnegative()
4492
+ }).optional().meta({
4493
+ description: "How many entries of each list the bridge left out because the graph did not fit `BRIDGE_FRAME_MAX_BYTES`; absent when the graph is complete."
4494
+ })
4478
4495
  });
4479
4496
  var typeField = import_zod20.z.lazy(() => import_zod20.z.object({
4480
4497
  name: import_zod20.z.string().min(1).max(128),
@@ -4503,11 +4520,25 @@ var typeDefinition = import_zod20.z.discriminatedUnion("kind", [
4503
4520
  })
4504
4521
  ]);
4505
4522
 
4506
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/jobs.js
4523
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/jobs.js
4507
4524
  var import_zod21 = require("zod");
4508
4525
  var jobState = import_zod21.z.enum(["running", "unknown", "succeeded", "failed", "cancelled", "lost"]);
4509
4526
  var reportedJobState = jobState.exclude(["unknown"]);
4510
4527
  var jobOrigin = import_zod21.z.enum(["fleetless", "external"]);
4528
+ var resultOmitted = import_zod21.z.object({
4529
+ reason: import_zod21.z.enum(["too_large"]).meta({
4530
+ description: "Why the result was left out. `too_large`: its frame would have exceeded the robot's frame limit."
4531
+ }),
4532
+ bytes: import_zod21.z.number().int().positive().meta({
4533
+ description: "The size of the result alone, serialised as JSON, in bytes."
4534
+ }),
4535
+ limit_bytes: import_zod21.z.number().int().positive().meta({
4536
+ description: "The frame limit the robot applied, in bytes (`BRIDGE_FRAME_MAX_BYTES`, 1.5 MiB)."
4537
+ })
4538
+ }).meta({
4539
+ description: "The robot had a result and did not send it because it was too large; `result` is `null`. The state is unchanged, and the result cannot be fetched later."
4540
+ });
4541
+ var RESULT_OMITTED_DESCRIPTION = "Present when the robot had a result and did not send it because it was too large; `result` is `null` then. The state is unchanged: a goal that succeeded is still `succeeded`. Absent otherwise.";
4511
4542
  var job = import_zod21.z.object({
4512
4543
  id: import_zod21.z.uuid().meta({
4513
4544
  description: "The job's id, minted by the cloud when the invocation is accepted. Informative \u2014 state is observed by slug; a cancel names this id to stop one specific job rather than whatever is running."
@@ -4548,8 +4579,9 @@ var job = import_zod21.z.object({
4548
4579
  description: "A monotonic counter ascending in mint order, and the named tiebreaker for any listing that claims one \u2014 `started_at` alone is not a total order. Scoped per cloud process and per run: job state lives in memory, so this restarts with the registry it orders."
4549
4580
  }),
4550
4581
  result: import_zod21.z.unknown().nullable().meta({
4551
- description: "What the call returned once it succeeded, shaped by the ROS action or service itself. `null` until then, and for a job that did not succeed."
4582
+ description: "What the call returned, shaped by the ROS action or service itself: on `succeeded`, and on `failed` or `cancelled` when the action sent a result. `null` while running, when nothing was returned, and when it was too large to send (`result_omitted`)."
4552
4583
  }),
4584
+ result_omitted: resultOmitted.optional().meta({ description: RESULT_OMITTED_DESCRIPTION }),
4553
4585
  /**
4554
4586
  * Present on `failed`; a human message, plus a code where one exists.
4555
4587
  *
@@ -4586,6 +4618,8 @@ var jobEvent = import_zod21.z.object({
4586
4618
  feedback: import_zod21.z.unknown().nullable(),
4587
4619
  /** 0..1 when the action reports progress; null when it does not. */
4588
4620
  progress: import_zod21.z.number().min(0).max(1).nullable(),
4621
+ /** The job's own `result_omitted`, repeated so a consumer of the event alone sees it — see `resultOmitted`. */
4622
+ result_omitted: resultOmitted.optional().meta({ description: RESULT_OMITTED_DESCRIPTION }),
4589
4623
  timestamp_ms: import_zod21.z.number().int().nonnegative()
4590
4624
  });
4591
4625
  var busyDetails = import_zod21.z.object({
@@ -4659,8 +4693,9 @@ var jobRun = import_zod21.z.object({
4659
4693
  description: 'How long the run took, in milliseconds. `null` while it is still `running` or `unknown`, never `0` standing in for "nothing so far".'
4660
4694
  }),
4661
4695
  result: import_zod21.z.unknown().nullable().meta({
4662
- description: "What the action or service returned once it succeeded, shaped by ROS itself. `null` otherwise."
4696
+ description: "What the call returned, shaped by the ROS action or service itself: on `succeeded`, and on `failed` or `cancelled` when the action sent a result. `null` while running, when nothing was returned, and when it was too large to send (`result_omitted`)."
4663
4697
  }),
4698
+ result_omitted: resultOmitted.optional().meta({ description: RESULT_OMITTED_DESCRIPTION }),
4664
4699
  error: import_zod21.z.object({
4665
4700
  code: import_zod21.z.string().min(1).meta({
4666
4701
  description: "A machine-readable code for the failure, such as `job_queue_full`, where one exists for it."
@@ -4740,7 +4775,7 @@ var jobRunSummary = import_zod21.z.object({
4740
4775
  since_ms: import_zod21.z.number().int().nonnegative()
4741
4776
  });
4742
4777
 
4743
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/protocol.js
4778
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/protocol.js
4744
4779
  var DAY_MS = 24 * 60 * 60 * 1e3;
4745
4780
  var MAX_PATIENCE_MS = 12e4;
4746
4781
  var MIN_PATIENCE_MS = 1e3;
@@ -4802,6 +4837,17 @@ var datapointFrame = import_zod22.z.object({
4802
4837
  timestamp_ms: import_zod22.z.number().int().nonnegative(),
4803
4838
  backfill: import_zod22.z.boolean().optional().meta({ description: "true when the sample was captured while the bridge was disconnected and is being replayed after the reconnect. The cloud keeps such a sample out of its lag measure; absent means live." })
4804
4839
  });
4840
+ var bridgeDatapointDropped = import_zod22.z.object({
4841
+ type: import_zod22.z.literal("datapoint_dropped"),
4842
+ slug,
4843
+ reason: import_zod22.z.enum(["too_large"]),
4844
+ /** The size of the frame that was not sent, in bytes. */
4845
+ bytes: import_zod22.z.number().int().positive(),
4846
+ /** `BRIDGE_FRAME_MAX_BYTES` as the bridge applied it. */
4847
+ limit_bytes: import_zod22.z.number().int().positive(),
4848
+ /** Bridge capture time of the dropped sample, like `datapointFrame.timestamp_ms`. */
4849
+ timestamp_ms: import_zod22.z.number().int().nonnegative()
4850
+ });
4805
4851
  var cloudPing = import_zod22.z.object({
4806
4852
  type: import_zod22.z.literal("ping"),
4807
4853
  ts_ms: import_zod22.z.number().int().nonnegative(),
@@ -4818,6 +4864,14 @@ var bridgeLinkMode = import_zod22.z.object({
4818
4864
  reason: import_zod22.z.enum(["lag", "dwell", "forced", "recovered"]).meta({ description: "`lag`: the cloud-measured lag crossed the threshold; `dwell`: the bridge-measured queue dwell did; `forced`: `mode: on` or `off`; `recovered`: both measures stayed at or below the exit threshold." }),
4819
4865
  at_ms: import_zod22.z.number().int().nonnegative().meta({ description: "Bridge time of the transition, epoch milliseconds." })
4820
4866
  });
4867
+ var failsafeWatchdogReason = import_zod22.z.enum(["self_test", "late_fire", "not_alive", "crashed"]);
4868
+ var bridgeFailsafeWatchdog = import_zod22.z.object({
4869
+ type: import_zod22.z.literal("failsafe_watchdog"),
4870
+ state: import_zod22.z.enum(["ok", "failed"]).meta({ description: "`ok`: the watchdog passed its self-test and holds its bound, and the bridge takes publishes; `failed`: it does not, and the bridge refuses every publish until it recovers." }),
4871
+ reason: failsafeWatchdogReason.nullable().meta({ description: "Why the state is `failed`; `null` with `ok`. `self_test`: the failsafe process did not start, did not answer its self-test, or its start-up self-test ran past the 10 ms bound (only then with `lateness_ms`); `late_fire`: a failsafe went out more than 10 ms after its deadline (with `lateness_ms`); `not_alive`: a second without a word from the failsafe process; `crashed`: the process ended, or it reported two errors within 60 s." }),
4872
+ lateness_ms: import_zod22.z.number().nonnegative().nullable().meta({ description: "The lateness that decided the state, in milliseconds after the deadline: with `ok` the self-test's it passed; with `failed` the self-test's that ran late, or the late failsafe's. `null` for `not_alive`, `crashed`, and a `self_test` whose process did not start or did not answer." }),
4873
+ at_ms: import_zod22.z.number().int().nonnegative().meta({ description: "Bridge time of the state change, epoch milliseconds." })
4874
+ });
4821
4875
  var cloudConfig = import_zod22.z.object({
4822
4876
  type: import_zod22.z.literal("config"),
4823
4877
  version: import_zod22.z.number().int().nonnegative(),
@@ -4921,6 +4975,8 @@ var bridgeJobUpdate = import_zod22.z.object({
4921
4975
  feedback: import_zod22.z.unknown().nullable(),
4922
4976
  progress: import_zod22.z.number().min(0).max(1).nullable(),
4923
4977
  result: import_zod22.z.unknown().nullable(),
4978
+ /** The robot had a result and did not send it because it was too large; `result` is `null`. See `resultOmitted`. */
4979
+ result_omitted: resultOmitted.optional(),
4924
4980
  /** Same shape as `job.error`, `details` included — see `jobs.ts`. */
4925
4981
  error: import_zod22.z.object({ code: import_zod22.z.string().min(1), message: import_zod22.z.string().min(1), details: import_zod22.z.unknown().optional() }).nullable(),
4926
4982
  timestamp_ms: import_zod22.z.number().int().nonnegative()
@@ -4942,6 +4998,8 @@ var bridgeJobStatusEntry = import_zod22.z.object({
4942
4998
  feedback: import_zod22.z.unknown().nullable(),
4943
4999
  progress: import_zod22.z.number().min(0).max(1).nullable(),
4944
5000
  result: import_zod22.z.unknown().nullable(),
5001
+ /** The robot had a result and did not send it because it was too large; `result` is `null`. See `resultOmitted`. */
5002
+ result_omitted: resultOmitted.optional(),
4945
5003
  /** Same shape as `job.error`, `details` included — see `jobs.ts`. */
4946
5004
  error: import_zod22.z.object({ code: import_zod22.z.string().min(1), message: import_zod22.z.string().min(1), details: import_zod22.z.unknown().optional() }).nullable()
4947
5005
  });
@@ -4975,7 +5033,10 @@ var bridgeState = import_zod22.z.object({
4975
5033
  online: import_zod22.z.boolean(),
4976
5034
  latency_ms: import_zod22.z.number().nonnegative().nullable(),
4977
5035
  low_bandwidth: import_zod22.z.boolean().meta({ description: "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported." }),
4978
- health_reason: import_zod22.z.enum(["job_query_unanswered"]).nullable().optional().meta({ description: "Cloud-observed connection health: `job_query_unanswered` after a bridge ignores held-job queries; `null` on an ordinary connect or disconnect. Optional for older observations." })
5036
+ health_reason: import_zod22.z.enum(["job_query_unanswered"]).nullable().optional().meta({ description: "Cloud-observed connection health: `job_query_unanswered` after a bridge ignores held-job queries; `null` on an ordinary connect or disconnect. Optional for older observations." }),
5037
+ failsafe: import_zod22.z.enum(["ok", "failed"]).nullable().optional().meta({ description: "The bridge's failsafe watchdog: `failed` while the bridge takes no publishes because it cannot promise a failsafe on time; `null` until the bridge states it. Bridge-reported. Optional for older observations." }),
5038
+ failsafe_reason: failsafeWatchdogReason.nullable().optional().meta({ description: "Why `failsafe` is `failed`, as the bridge stated it: `self_test`, `late_fire`, `not_alive` or `crashed`; `null` otherwise. Bridge-reported. Optional for older observations." }),
5039
+ failsafe_lateness_ms: import_zod22.z.number().nonnegative().nullable().optional().meta({ description: "The lateness that made `failsafe` `failed`, in milliseconds after the deadline, where the bridge knows it (`late_fire`, and a `self_test` that ran late); `null` otherwise. Bridge-reported. Optional for older observations." })
4979
5040
  });
4980
5041
  var snapshotHeader = import_zod22.z.object({
4981
5042
  type: import_zod22.z.literal("snapshot"),
@@ -5139,11 +5200,11 @@ var bridgeCameraState = import_zod22.z.object({
5139
5200
  request_id: import_zod22.z.string().min(1).max(64).nullable()
5140
5201
  });
5141
5202
 
5142
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/config-issues.js
5203
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/config-issues.js
5143
5204
  var EXPOSURE_SECTIONS = ["datapoints", "actions", "services", "publishers", "cameras"];
5144
5205
  var EXPOSURE_SECTION_NAMES = new Set(EXPOSURE_SECTIONS);
5145
5206
 
5146
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/org-roles.js
5207
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/org-roles.js
5147
5208
  var import_zod23 = require("zod");
5148
5209
  var roleName = import_zod23.z.string().trim().min(1).max(ROLE_NAME_MAX);
5149
5210
  var referencePlace = import_zod23.z.object({
@@ -5282,7 +5343,7 @@ var putRoleDefaultsRequest = import_zod23.z.object({
5282
5343
  })
5283
5344
  }).strict();
5284
5345
 
5285
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/rest.js
5346
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/rest.js
5286
5347
  var import_zod24 = require("zod");
5287
5348
  var robot2 = import_zod24.z.object({
5288
5349
  id: import_zod24.z.uuid().meta({
@@ -5420,7 +5481,16 @@ var configVersionResponse = import_zod24.z.object({
5420
5481
  var introspectionResponse = import_zod24.z.object({
5421
5482
  graph: rosGraph,
5422
5483
  fetched_at: import_zod24.z.iso.datetime(),
5423
- stale: import_zod24.z.boolean()
5484
+ stale: import_zod24.z.boolean(),
5485
+ bridge_version: import_zod24.z.string().nullable().optional().meta({
5486
+ description: "The bridge version the graph was read under. `null` for a snapshot older than this field. Absent when the server predates this field."
5487
+ }),
5488
+ types_fetched_at: import_zod24.z.iso.datetime().nullable().optional().meta({
5489
+ description: "When the types of this snapshot were read and replaced the stored definitions. `null` while they have not been, or when reading them failed: the stored definitions are then the older ones. Absent when the server predates this field."
5490
+ }),
5491
+ unresolved_types: import_zod24.z.array(import_zod24.z.string()).optional().meta({
5492
+ description: "The type names the robot could not resolve when the types of this snapshot were read, sorted; empty when every one resolved, or when they have not been read. Absent when the server predates this field."
5493
+ })
5424
5494
  });
5425
5495
  var typesResponse = import_zod24.z.object({
5426
5496
  types: import_zod24.z.array(typeDefinition)
@@ -5518,6 +5588,15 @@ var invokeResponse = import_zod24.z.object({
5518
5588
  var serviceCallResponse = import_zod24.z.object({
5519
5589
  result: import_zod24.z.unknown().meta({
5520
5590
  description: "What the service returned, shaped by the ROS service. A service call is awaited to completion, so there is no job to observe afterwards and no id to hold on to."
5591
+ }),
5592
+ /**
5593
+ * The service answered, and its response did not fit the robot's frame
5594
+ * limit (fleetless/fleetless#1222): `result` is `null` and this says why.
5595
+ * Without it, an omitted response would read as a service that returned
5596
+ * nothing.
5597
+ */
5598
+ result_omitted: resultOmitted.optional().meta({
5599
+ description: "Present when the service answered and the robot did not send the response because it was too large; `result` is `null` then. Absent otherwise."
5521
5600
  })
5522
5601
  });
5523
5602
  var invokeOrServiceResponse = import_zod24.z.union([invokeResponse, serviceCallResponse]);
@@ -5880,6 +5959,7 @@ var robotDeleteQuery = import_zod24.z.object({
5880
5959
  description: "Pass `true` to delete a robot that has a live session open; without it that is `409 robot_in_use`. **`true` and nothing else** \u2014 any other value is `400 validation_error`, reported against the field `force` with rule `invalid_value`, so a caller is never left believing they forced a deletion they did not. The deletion is a full cascade, which is why saying it is the whole decision."
5881
5960
  })
5882
5961
  }).meta({ description: "The one optional parameter of `DELETE /api/robots/:id`, and it is the difference between a refusal and a cascade. It accepts the exact string `true`, or its own absence, and refuses everything else." });
5962
+ var RESOURCE_HEALTH_KINDS = ["camera", "datapoint"];
5883
5963
  var RESOURCE_HEALTH_STATES = [
5884
5964
  "ok",
5885
5965
  /** The host did not answer. Not the same as refusing the password. */
@@ -5911,6 +5991,19 @@ var RESOURCE_HEALTH_STATES = [
5911
5991
  "stopped_by_config_change",
5912
5992
  /** Publishing failed after the session was already granted. */
5913
5993
  "publish_failed",
5994
+ /**
5995
+ * The robot dropped the last value because its frame exceeded
5996
+ * `BRIDGE_FRAME_MAX_BYTES` (a datapoint only, fleetless/fleetless#1222).
5997
+ * `reason` names the size and the limit, built from numbers only.
5998
+ */
5999
+ "too_large",
6000
+ /**
6001
+ * A camera's live video is paused because the bridge is in low-bandwidth
6002
+ * mode: a new stream is refused and a running one may have been ended
6003
+ * (fleetless/fleetless#1126). Not an error; snapshots go on. `reason` is
6004
+ * the cloud's fixed sentence.
6005
+ */
6006
+ "low_bandwidth",
5914
6007
  /**
5915
6008
  * Something is wrong and this platform cannot say what.
5916
6009
  *
@@ -5925,8 +6018,8 @@ var RESOURCE_HEALTH_STATES = [
5925
6018
  ];
5926
6019
  var resourceHealthState = import_zod24.z.object({
5927
6020
  robot_id: import_zod24.z.uuid(),
5928
- kind: import_zod24.z.enum(["camera"]),
5929
- /** The camera slug, or the credential name. */
6021
+ kind: import_zod24.z.enum(RESOURCE_HEALTH_KINDS),
6022
+ /** The camera or datapoint slug. */
5930
6023
  ref: import_zod24.z.string().min(1).max(64),
5931
6024
  /**
5932
6025
  * **Which of two questions this entry answers.**
@@ -6090,20 +6183,30 @@ var slugUsageResponse = import_zod24.z.object({
6090
6183
  alert_count: import_zod24.z.number().int().nonnegative()
6091
6184
  });
6092
6185
 
6093
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/realtime.js
6094
- var import_zod30 = require("zod");
6186
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/realtime.js
6187
+ var import_zod31 = require("zod");
6095
6188
 
6096
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/client-auth.js
6189
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/live-start-refusal.js
6190
+ var import_zod25 = require("zod");
6191
+ var LIVE_START_REFUSALS = ["low_bandwidth", "source_auth", "source_unreachable", "not_startable", "unknown"];
6192
+ var liveStartRefusal = import_zod25.z.enum(LIVE_START_REFUSALS).meta({
6193
+ description: "Why the robot refused to start live video: `low_bandwidth` (the link is weak; snapshots go on), `source_auth` (the source refused the credentials), `source_unreachable` (the source could not be reached), `not_startable` (the bridge could not start it; its log says why), `unknown` (a reason this cloud does not know yet)."
6194
+ });
6195
+ var cameraOfflineDetails = import_zod25.z.object({
6196
+ refusal: liveStartRefusal
6197
+ });
6198
+
6199
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-auth.js
6200
+ var import_zod29 = require("zod");
6201
+
6202
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/apps.js
6097
6203
  var import_zod28 = require("zod");
6098
6204
 
6099
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/apps.js
6205
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6100
6206
  var import_zod27 = require("zod");
6101
6207
 
6102
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6208
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections.js
6103
6209
  var import_zod26 = require("zod");
6104
-
6105
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections.js
6106
- var import_zod25 = require("zod");
6107
6210
  var COLLECTIONS_FORMAT_VERSION = 1;
6108
6211
  var COLLECTION_LIMITS = {
6109
6212
  /** Collections in one document. */
@@ -6160,13 +6263,13 @@ var COLLECTION_LIMITS = {
6160
6263
  importErrorText: 200
6161
6264
  };
6162
6265
  var KEY_RULE = /^[a-z][a-z0-9_]{0,62}$/;
6163
- var collectionKey = import_zod25.z.string().regex(KEY_RULE, {
6266
+ var collectionKey = import_zod26.z.string().regex(KEY_RULE, {
6164
6267
  message: "A key starts with a lowercase letter and continues with lowercase letters, digits or underscores, up to 63 characters in all."
6165
6268
  }).meta({ description: "A collection key or a field key: `^[a-z][a-z0-9_]{0,62}$`. Keys appear in URLs, filters and record bodies; `label` is the text people read." });
6166
- var collectionBinding = import_zod25.z.enum(["global", "per_robot", "one_per_robot"]).meta({
6269
+ var collectionBinding = import_zod26.z.enum(["global", "per_robot", "one_per_robot"]).meta({
6167
6270
  description: "`global`: records belong to the app and no robot. `per_robot`: every record belongs to one robot (system field `robot_id`, fixed when the record is created). `one_per_robot`: every robot of the app has exactly one record, which Fleetless creates itself."
6168
6271
  });
6169
- var collectionFieldType = import_zod25.z.enum([
6272
+ var collectionFieldType = import_zod26.z.enum([
6170
6273
  "text",
6171
6274
  "long_text",
6172
6275
  "number",
@@ -6177,70 +6280,70 @@ var collectionFieldType = import_zod25.z.enum([
6177
6280
  "json",
6178
6281
  "reference"
6179
6282
  ]);
6180
- var label = import_zod25.z.string().max(120).meta({ description: "A short name for people to read. It may change at any time; the key is what code uses." });
6181
- var description = import_zod25.z.string().max(1e3).meta({ description: "Free text that explains the field to the people who fill it in." });
6283
+ var label = import_zod26.z.string().max(120).meta({ description: "A short name for people to read. It may change at any time; the key is what code uses." });
6284
+ var description = import_zod26.z.string().max(1e3).meta({ description: "Free text that explains the field to the people who fill it in." });
6182
6285
  var common2 = {
6183
6286
  label: label.optional(),
6184
6287
  description: description.optional(),
6185
- required: import_zod25.z.boolean().meta({ description: "A new record must set this field, and an update may not clear it." }).optional(),
6186
- unique: import_zod25.z.union([import_zod25.z.boolean(), import_zod25.z.literal("collection")]).meta({
6288
+ required: import_zod26.z.boolean().meta({ description: "A new record must set this field, and an update may not clear it." }).optional(),
6289
+ unique: import_zod26.z.union([import_zod26.z.boolean(), import_zod26.z.literal("collection")]).meta({
6187
6290
  description: "`true`: no two records hold the same value, within the collection (`global`) or within one robot (`per_robot`, `one_per_robot`). `collection`: on a robot-bound collection, across all robots. Empty values never collide. Not allowed on `boolean` and `json` fields."
6188
6291
  }).optional(),
6189
- default: import_zod25.z.unknown().meta({ description: "The value a record gets when it does not set this field. It must itself be a valid value of the field." }).optional()
6292
+ default: import_zod26.z.unknown().meta({ description: "The value a record gets when it does not set this field. It must itself be a valid value of the field." }).optional()
6190
6293
  };
6191
- var textField = import_zod25.z.object({
6192
- type: import_zod25.z.literal("text"),
6294
+ var textField = import_zod26.z.object({
6295
+ type: import_zod26.z.literal("text"),
6193
6296
  ...common2,
6194
- max_length: import_zod25.z.number().int().min(1).max(COLLECTION_LIMITS.textMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.textDefault}, at most ${COLLECTION_LIMITS.textMax}.` }).optional(),
6195
- pattern: import_zod25.z.string().max(COLLECTION_LIMITS.patternMax).meta({
6297
+ max_length: import_zod26.z.number().int().min(1).max(COLLECTION_LIMITS.textMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.textDefault}, at most ${COLLECTION_LIMITS.textMax}.` }).optional(),
6298
+ pattern: import_zod26.z.string().max(COLLECTION_LIMITS.patternMax).meta({
6196
6299
  description: `A regular expression in the RE2 subset, checked in unicode mode: lookahead, lookbehind and backreferences are not supported. At most ${COLLECTION_LIMITS.patternMax.toLocaleString("en-US")} characters, and the cloud may also refuse a pattern as too complex (its compiled size is bounded; counted repeats such as \`{n}\` multiply it), which a document reports as an invalid pattern. The value must match somewhere in it; anchor it with \`^\` and \`$\` to match the whole value.`
6197
6300
  }).optional(),
6198
- searchable: import_zod25.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
6301
+ searchable: import_zod26.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
6199
6302
  }).strict();
6200
- var longTextField = import_zod25.z.object({
6201
- type: import_zod25.z.literal("long_text"),
6303
+ var longTextField = import_zod26.z.object({
6304
+ type: import_zod26.z.literal("long_text"),
6202
6305
  ...common2,
6203
- max_length: import_zod25.z.number().int().min(1).max(COLLECTION_LIMITS.longTextMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.longTextDefault}, at most ${COLLECTION_LIMITS.longTextMax}.` }).optional(),
6204
- searchable: import_zod25.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
6306
+ max_length: import_zod26.z.number().int().min(1).max(COLLECTION_LIMITS.longTextMax).meta({ description: `Longest value in characters. Default ${COLLECTION_LIMITS.longTextDefault}, at most ${COLLECTION_LIMITS.longTextMax}.` }).optional(),
6307
+ searchable: import_zod26.z.boolean().meta({ description: "Include this field in the `search` of record lists." }).optional()
6205
6308
  }).strict();
6206
- var numberField = import_zod25.z.object({
6207
- type: import_zod25.z.literal("number"),
6309
+ var numberField = import_zod26.z.object({
6310
+ type: import_zod26.z.literal("number"),
6208
6311
  ...common2,
6209
- integer: import_zod25.z.boolean().meta({ description: "Accept whole numbers only." }).optional(),
6210
- min: import_zod25.z.number().meta({ description: "Smallest accepted value." }).optional(),
6211
- max: import_zod25.z.number().meta({ description: "Largest accepted value." }).optional(),
6212
- unit: import_zod25.z.string().meta({ description: "A unit to show next to the value, such as `m` or `rad/s`. Display only; nothing converts values." }).optional()
6312
+ integer: import_zod26.z.boolean().meta({ description: "Accept whole numbers only." }).optional(),
6313
+ min: import_zod26.z.number().meta({ description: "Smallest accepted value." }).optional(),
6314
+ max: import_zod26.z.number().meta({ description: "Largest accepted value." }).optional(),
6315
+ unit: import_zod26.z.string().meta({ description: "A unit to show next to the value, such as `m` or `rad/s`. Display only; nothing converts values." }).optional()
6213
6316
  }).strict();
6214
- var booleanField = import_zod25.z.object({ type: import_zod25.z.literal("boolean"), ...common2 }).strict();
6215
- var selectOption = import_zod25.z.object({
6216
- value: import_zod25.z.string().min(1).max(200).meta({ description: "What is stored in records and used in filters." }),
6217
- label: import_zod25.z.string().meta({ description: "What people see instead of the value." }).optional()
6317
+ var booleanField = import_zod26.z.object({ type: import_zod26.z.literal("boolean"), ...common2 }).strict();
6318
+ var selectOption = import_zod26.z.object({
6319
+ value: import_zod26.z.string().min(1).max(200).meta({ description: "What is stored in records and used in filters." }),
6320
+ label: import_zod26.z.string().meta({ description: "What people see instead of the value." }).optional()
6218
6321
  }).strict();
6219
- var selectField = import_zod25.z.object({
6220
- type: import_zod25.z.literal("select"),
6322
+ var selectField = import_zod26.z.object({
6323
+ type: import_zod26.z.literal("select"),
6221
6324
  ...common2,
6222
- options: import_zod25.z.array(selectOption).min(1).max(COLLECTION_LIMITS.selectOptions).meta({ description: `The accepted values, 1 to ${COLLECTION_LIMITS.selectOptions}. Two options may not share a value.` }),
6223
- multiple: import_zod25.z.boolean().meta({ description: "Hold a list of distinct options instead of one." }).optional(),
6224
- searchable: import_zod25.z.boolean().meta({ description: "Include the values and labels of the chosen options in the `search` of record lists." }).optional()
6325
+ options: import_zod26.z.array(selectOption).min(1).max(COLLECTION_LIMITS.selectOptions).meta({ description: `The accepted values, 1 to ${COLLECTION_LIMITS.selectOptions}. Two options may not share a value.` }),
6326
+ multiple: import_zod26.z.boolean().meta({ description: "Hold a list of distinct options instead of one." }).optional(),
6327
+ searchable: import_zod26.z.boolean().meta({ description: "Include the values and labels of the chosen options in the `search` of record lists." }).optional()
6225
6328
  }).strict();
6226
- var dateField = import_zod25.z.object({ type: import_zod25.z.literal("date"), ...common2 }).strict();
6227
- var datetimeField = import_zod25.z.object({ type: import_zod25.z.literal("datetime"), ...common2 }).strict();
6228
- var jsonField = import_zod25.z.object({
6229
- type: import_zod25.z.literal("json"),
6329
+ var dateField = import_zod26.z.object({ type: import_zod26.z.literal("date"), ...common2 }).strict();
6330
+ var datetimeField = import_zod26.z.object({ type: import_zod26.z.literal("datetime"), ...common2 }).strict();
6331
+ var jsonField = import_zod26.z.object({
6332
+ type: import_zod26.z.literal("json"),
6230
6333
  ...common2,
6231
- schema: import_zod25.z.union([import_zod25.z.string(), import_zod25.z.record(import_zod25.z.string(), import_zod25.z.unknown())]).meta({
6334
+ schema: import_zod26.z.union([import_zod26.z.string(), import_zod26.z.record(import_zod26.z.string(), import_zod26.z.unknown())]).meta({
6232
6335
  description: "What the value must look like: the name of a built-in template (`pose2d`, `point2d`, `polygon2d`, `range1d`) or an inline JSON Schema (draft 2020-12). Without it any JSON value is accepted."
6233
6336
  }).optional()
6234
6337
  }).strict();
6235
- var referenceField = import_zod25.z.object({
6236
- type: import_zod25.z.literal("reference"),
6338
+ var referenceField = import_zod26.z.object({
6339
+ type: import_zod26.z.literal("reference"),
6237
6340
  ...common2,
6238
6341
  to: collectionKey.meta({ description: "The key of the collection whose records this field points at. It must be a collection of the same document." }),
6239
- on_delete: import_zod25.z.enum(["prevent", "clear"]).meta({
6342
+ on_delete: import_zod26.z.enum(["prevent", "clear"]).meta({
6240
6343
  description: "`prevent` (the default): a record that other records point at cannot be deleted. `clear`: deleting it clears the reference in the records that pointed at it."
6241
6344
  }).optional()
6242
6345
  }).strict();
6243
- var collectionField = import_zod25.z.discriminatedUnion("type", [
6346
+ var collectionField = import_zod26.z.discriminatedUnion("type", [
6244
6347
  textField,
6245
6348
  longTextField,
6246
6349
  numberField,
@@ -6251,71 +6354,71 @@ var collectionField = import_zod25.z.discriminatedUnion("type", [
6251
6354
  jsonField,
6252
6355
  referenceField
6253
6356
  ]);
6254
- var collectionAccessValue = import_zod25.z.union([import_zod25.z.string().min(1).max(63), import_zod25.z.array(import_zod25.z.string().min(1).max(63))]).meta({ description: "The key of an organization role, or a list of keys. A key that names no role grants nothing." });
6255
- var allOwn = import_zod25.z.object({
6357
+ var collectionAccessValue = import_zod26.z.union([import_zod26.z.string().min(1).max(63), import_zod26.z.array(import_zod26.z.string().min(1).max(63))]).meta({ description: "The key of an organization role, or a list of keys. A key that names no role grants nothing." });
6358
+ var allOwn = import_zod26.z.object({
6256
6359
  all: collectionAccessValue.meta({ description: "Roles that may do this to every record." }).optional(),
6257
6360
  own: collectionAccessValue.meta({ description: "Roles that may do this only to records they created themselves." }).optional()
6258
6361
  }).strict();
6259
- var collectionAccess = import_zod25.z.object({
6362
+ var collectionAccess = import_zod26.z.object({
6260
6363
  read: collectionAccessValue.meta({ description: "Roles that may read records." }).optional(),
6261
6364
  create: collectionAccessValue.meta({ description: "Roles that may create records. Has no effect on `one_per_robot` collections, whose records Fleetless creates." }).optional(),
6262
- update: import_zod25.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may change records: a role key, a list, or `{ all, own }` to tell every record from the ones a role created itself." }).optional(),
6263
- delete: import_zod25.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may delete records: a role key, a list, or `{ all, own }`. Has no effect on `one_per_robot` collections, whose records are never deleted through the API." }).optional()
6365
+ update: import_zod26.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may change records: a role key, a list, or `{ all, own }` to tell every record from the ones a role created itself." }).optional(),
6366
+ delete: import_zod26.z.union([collectionAccessValue, allOwn]).meta({ description: "Roles that may delete records: a role key, a list, or `{ all, own }`. Has no effect on `one_per_robot` collections, whose records are never deleted through the API." }).optional()
6264
6367
  }).strict().meta({ description: "Which roles may read, create, update and delete the records of this collection. A missing key grants that action to nobody; developers and server keys can always do everything." });
6265
- var collectionDefinition = import_zod25.z.object({
6266
- label: import_zod25.z.string().meta({ description: "A name for people to read. It may change at any time; the key is what code uses." }).optional(),
6267
- description: import_zod25.z.string().meta({ description: "Free text that explains the collection to people." }).optional(),
6368
+ var collectionDefinition = import_zod26.z.object({
6369
+ label: import_zod26.z.string().meta({ description: "A name for people to read. It may change at any time; the key is what code uses." }).optional(),
6370
+ description: import_zod26.z.string().meta({ description: "Free text that explains the collection to people." }).optional(),
6268
6371
  binding: collectionBinding,
6269
- display: import_zod25.z.string().meta({
6372
+ display: import_zod26.z.string().meta({
6270
6373
  description: "A template that names a record in lists, references and titles, for example `{{name}} ({{location.name}})`. A placeholder is a field of this collection, a system field (`id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `revision`, and `robot_id` on robot-bound collections), `robot.name` on robot-bound collections, or `<reference field>.<field of the target>`."
6271
6374
  }).optional(),
6272
6375
  access: collectionAccess.optional(),
6273
- fields: import_zod25.z.record(collectionKey, collectionField).meta({ description: `The fields of a record, at most ${COLLECTION_LIMITS.fields}. Their order is the order of the record form.` })
6376
+ fields: import_zod26.z.record(collectionKey, collectionField).meta({ description: `The fields of a record, at most ${COLLECTION_LIMITS.fields}. Their order is the order of the record form.` })
6274
6377
  }).strict();
6275
- var collectionsMap = import_zod25.z.record(collectionKey, collectionDefinition);
6276
- var collectionsDocument = import_zod25.z.object({
6277
- format: import_zod25.z.literal(COLLECTIONS_FORMAT_VERSION).meta({ description: `The document format version. Always ${COLLECTIONS_FORMAT_VERSION}.` }),
6378
+ var collectionsMap = import_zod26.z.record(collectionKey, collectionDefinition);
6379
+ var collectionsDocument = import_zod26.z.object({
6380
+ format: import_zod26.z.literal(COLLECTIONS_FORMAT_VERSION).meta({ description: `The document format version. Always ${COLLECTIONS_FORMAT_VERSION}.` }),
6278
6381
  // A codec on the property and not a preprocess on the document: the published JSON Schema then says `object | null` and still lists
6279
6382
  // `collections` as required, and the parsed value (and the output schema) is the plain map.
6280
- collections: import_zod25.z.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.` })
6383
+ collections: import_zod26.z.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.` })
6281
6384
  }).strict().meta({ description: "The data model of an app: its collections, their fields, and who may use them." });
6282
6385
 
6283
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6284
- var records = import_zod26.z.union([import_zod26.z.literal("all"), import_zod26.z.literal("own"), import_zod26.z.literal(false)]);
6285
- var roleCollectionRights = import_zod26.z.object({
6386
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-rights.js
6387
+ var records = import_zod27.z.union([import_zod27.z.literal("all"), import_zod27.z.literal("own"), import_zod27.z.literal(false)]);
6388
+ var roleCollectionRights = import_zod27.z.object({
6286
6389
  collection: collectionKey.meta({ description: "The collection's key." }),
6287
- label: import_zod26.z.string().meta({ description: "The collection's label for people to read; its key when the schema gives none." }),
6390
+ label: import_zod27.z.string().meta({ description: "The collection's label for people to read; its key when the schema gives none." }),
6288
6391
  binding: collectionBinding,
6289
- read: import_zod26.z.boolean().meta({ description: "Whether the role may read the records." }),
6290
- create: import_zod26.z.boolean().meta({ description: "Whether the role may create records." }),
6392
+ read: import_zod27.z.boolean().meta({ description: "Whether the role may read the records." }),
6393
+ create: import_zod27.z.boolean().meta({ description: "Whether the role may create records." }),
6291
6394
  update: records.meta({
6292
6395
  description: "`all`: the role may change every record. `own`: only records its user created. `false`: none."
6293
6396
  }),
6294
6397
  delete: records.meta({
6295
6398
  description: "`all`: the role may delete every record. `own`: only records its user created. `false`: none."
6296
6399
  }),
6297
- robot_filter: import_zod26.z.boolean().meta({
6400
+ robot_filter: import_zod27.z.boolean().meta({
6298
6401
  description: "`true` on a collection that belongs to robots (`per_robot`, `one_per_robot`): the role sees and writes only the records of robots a session of the role reaches, whatever the rights above say. `false` on a `global` collection."
6299
6402
  })
6300
6403
  }).meta({ description: "What one role may do with the records of one collection." });
6301
6404
 
6302
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/apps.js
6405
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/apps.js
6303
6406
  var appIdentifier = slug;
6304
- var app2 = import_zod27.z.object({
6305
- id: import_zod27.z.uuid().meta({
6407
+ var app2 = import_zod28.z.object({
6408
+ id: import_zod28.z.uuid().meta({
6306
6409
  description: "The app in the API, assigned by the cloud and stable for the life of the app. Everything app-scoped takes this as its `:id`."
6307
6410
  }),
6308
- org_id: import_zod27.z.uuid().meta({
6411
+ org_id: import_zod28.z.uuid().meta({
6309
6412
  description: "The organisation that owns this app. Every developer route is already scoped to the caller's org, so this confirms what a client is looking at rather than being a filter it applies."
6310
6413
  }),
6311
- name: import_zod27.z.string().min(1).max(120).meta({
6414
+ name: import_zod28.z.string().min(1).max(120).meta({
6312
6415
  description: "The display name, shown in the console and available to the developer's own pages through the `app.name` mail-template variable. Free text, changed through `PATCH /api/apps/:id`."
6313
6416
  }),
6314
6417
  identifier: appIdentifier.meta({
6315
6418
  description: "The stable handle a client sends at login, lowercase and underscore-separated. **Globally unique, not per organisation** \u2014 `clientLoginRequest` carries no org context, so a collision is refused with `identifier_taken`."
6316
6419
  }),
6317
6420
  /** Robots are referenced individually; tags never grant rights. */
6318
- robot_ids: import_zod27.z.array(import_zod27.z.uuid()).meta({
6421
+ robot_ids: import_zod28.z.array(import_zod28.z.uuid()).meta({
6319
6422
  description: "The robots this app may reach, each referenced individually. Tags never grant rights, and a robot absent from this list is invisible to the app. What a user of the app may use on an attached robot follows that robot's `fleetless.yaml` and the organization's defaults, less what the app locks."
6320
6423
  }),
6321
6424
  /**
@@ -6337,83 +6440,83 @@ var app2 = import_zod27.z.object({
6337
6440
  default_role: roleKey.nullable().meta({
6338
6441
  description: "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means this app has not chosen a default, the normal state of an app until someone picks one, and then a create or invite that names no role is refused. An invitation resolves the role when issued, so changing this never re-aims an outstanding one. The key is shown as stored and may name no role, which grants nothing; `GET /api/apps/:id/access` warns about it. It is set by `PUT /api/apps/:id/access`, not by `PATCH /api/apps/:id`."
6339
6442
  }),
6340
- created_at: import_zod27.z.iso.datetime().meta({
6443
+ created_at: import_zod28.z.iso.datetime().meta({
6341
6444
  description: "When the app was created, as an ISO 8601 timestamp. `GET /api/apps` orders by this field."
6342
6445
  })
6343
6446
  });
6344
- var appListResponse = import_zod27.z.object({
6345
- apps: import_zod27.z.array(app2).meta({
6447
+ var appListResponse = import_zod28.z.object({
6448
+ apps: import_zod28.z.array(app2).meta({
6346
6449
  description: "Every app of the caller's organisation, oldest first by `created_at`. The org scope is the whole filter \u2014 there is no id to narrow by and nothing to refuse."
6347
6450
  })
6348
6451
  });
6349
- var appDeletionSummary = import_zod27.z.object({
6350
- user_count: import_zod27.z.number().int().nonnegative().meta({
6452
+ var appDeletionSummary = import_zod28.z.object({
6453
+ user_count: import_zod28.z.number().int().nonnegative().meta({
6351
6454
  description: "App users deleted with the app. They are the developer's own customers, not Fleetless users, and exist in no other app."
6352
6455
  }),
6353
- server_key_count: import_zod27.z.number().int().nonnegative().meta({
6456
+ server_key_count: import_zod28.z.number().int().nonnegative().meta({
6354
6457
  description: "Server keys deleted with the app. A client still holding one is refused at its next request."
6355
6458
  }),
6356
- invitation_count: import_zod27.z.number().int().nonnegative().meta({
6459
+ invitation_count: import_zod28.z.number().int().nonnegative().meta({
6357
6460
  description: "Outstanding invitations \u2014 unspent and unexpired \u2014 that will never be accepted."
6358
6461
  }),
6359
- oidc_provider_count: import_zod27.z.number().int().nonnegative().meta({
6462
+ oidc_provider_count: import_zod28.z.number().int().nonnegative().meta({
6360
6463
  description: "Identity providers configured for this app. The providers themselves are somebody else's; only this app's configuration of them goes."
6361
6464
  }),
6362
- mail_template_count: import_zod27.z.number().int().nonnegative().meta({
6465
+ mail_template_count: import_zod28.z.number().int().nonnegative().meta({
6363
6466
  description: "Custom mail templates, of at most three. A kind using the Fleetless default text is not counted \u2014 there is no row to lose."
6364
6467
  }),
6365
- collection_count: import_zod27.z.number().int().nonnegative().meta({
6468
+ collection_count: import_zod28.z.number().int().nonnegative().meta({
6366
6469
  description: "Collections of the app's latest published schema. They go with the app, together with their records and history."
6367
6470
  }),
6368
- record_count: import_zod27.z.number().int().nonnegative().meta({
6471
+ record_count: import_zod28.z.number().int().nonnegative().meta({
6369
6472
  description: "Records of the app's collections, deleted with the app."
6370
6473
  })
6371
6474
  });
6372
- var createAppRequest = import_zod27.z.object({
6373
- name: import_zod27.z.string().min(1).max(120),
6475
+ var createAppRequest = import_zod28.z.object({
6476
+ name: import_zod28.z.string().min(1).max(120),
6374
6477
  identifier: appIdentifier,
6375
- robot_ids: import_zod27.z.array(import_zod27.z.uuid()).optional()
6478
+ robot_ids: import_zod28.z.array(import_zod28.z.uuid()).optional()
6376
6479
  }).strict();
6377
- var updateAppRequest = import_zod27.z.object({
6378
- name: import_zod27.z.string().min(1).max(120).optional(),
6379
- robot_ids: import_zod27.z.array(import_zod27.z.uuid()).optional()
6480
+ var updateAppRequest = import_zod28.z.object({
6481
+ name: import_zod28.z.string().min(1).max(120).optional(),
6482
+ robot_ids: import_zod28.z.array(import_zod28.z.uuid()).optional()
6380
6483
  }).strict();
6381
- var serverKeyToken = import_zod27.z.string().regex(/^flk_[0-9a-f]{32}$/);
6382
- var serverKey = import_zod27.z.object({
6383
- id: import_zod27.z.uuid().meta({
6484
+ var serverKeyToken = import_zod28.z.string().regex(/^flk_[0-9a-f]{32}$/);
6485
+ var serverKey = import_zod28.z.object({
6486
+ id: import_zod28.z.uuid().meta({
6384
6487
  description: "The key row, and what the rotate and delete routes address. It is not the key: this shape never carries the secret."
6385
6488
  }),
6386
- app_id: import_zod27.z.uuid().meta({
6489
+ app_id: import_zod28.z.uuid().meta({
6387
6490
  description: "The app whose full rights this key carries. A key is never shared between apps."
6388
6491
  }),
6389
- name: import_zod27.z.string().min(1).max(120).meta({
6492
+ name: import_zod28.z.string().min(1).max(120).meta({
6390
6493
  description: "A label the developer chose, so a key can be recognised before it is rotated or deleted."
6391
6494
  }),
6392
- created_at: import_zod27.z.iso.datetime().meta({
6495
+ created_at: import_zod28.z.iso.datetime().meta({
6393
6496
  description: "When the key was minted, as an ISO 8601 timestamp. `GET /api/apps/:id/server-keys` orders by this field."
6394
6497
  }),
6395
6498
  /** Null until first use — the cheapest way to spot a key nobody needs. */
6396
- last_used_at: import_zod27.z.iso.datetime().nullable().meta({
6499
+ last_used_at: import_zod28.z.iso.datetime().nullable().meta({
6397
6500
  description: "When this key last authenticated a request, or `null` if it never has \u2014 the cheapest way to spot a key nobody needs."
6398
6501
  })
6399
6502
  });
6400
- var serverKeyListResponse = import_zod27.z.object({
6401
- server_keys: import_zod27.z.array(serverKey).meta({
6503
+ var serverKeyListResponse = import_zod28.z.object({
6504
+ server_keys: import_zod28.z.array(serverKey).meta({
6402
6505
  description: "The app's server keys as metadata, oldest first by `created_at`. The raw secret is not here and never will be: it exists once, in the response that created or rotated the key."
6403
6506
  })
6404
6507
  });
6405
- var createServerKeyResponse = import_zod27.z.object({
6508
+ var createServerKeyResponse = import_zod28.z.object({
6406
6509
  server_key: serverKey,
6407
6510
  key: serverKeyToken
6408
6511
  });
6409
6512
  var MAX_LOCK_SLUGS = 2e3;
6410
6513
  var MAX_APP_LOCKS = 1e3;
6411
6514
  var namedOnce = (items) => new Set(items).size === items.length;
6412
- var appLock = import_zod27.z.object({
6413
- robot_id: import_zod27.z.uuid().meta({
6515
+ var appLock = import_zod28.z.object({
6516
+ robot_id: import_zod28.z.uuid().meta({
6414
6517
  description: "The robot whose capabilities are locked for this app."
6415
6518
  }),
6416
- slugs: import_zod27.z.array(slug).min(1).max(MAX_LOCK_SLUGS).refine(namedOnce, { message: "Name each slug once." }).meta({
6519
+ slugs: import_zod28.z.array(slug).min(1).max(MAX_LOCK_SLUGS).refine(namedOnce, { message: "Name each slug once." }).meta({
6417
6520
  uniqueItems: true,
6418
6521
  description: `The slugs of that robot's exposures to lock, at least one and each named once, at most ${MAX_LOCK_SLUGS}. A slug the robot has no exposure for is accepted and warns, and locks nothing.`
6419
6522
  })
@@ -6422,245 +6525,245 @@ var appAccessFields = {
6422
6525
  default_role: roleKey.nullable().meta({
6423
6526
  description: "The role, by key, that an app user gets when created, invited or self-registered without an explicit one. `null` means the app has none, and a create or invite that names no role is refused. A key that names no role is accepted and warns; it grants nothing."
6424
6527
  }),
6425
- locked_kinds: import_zod27.z.array(accessKind).max(ACCESS_KINDS.length).refine(namedOnce, { message: "Name each kind once." }).meta({
6528
+ locked_kinds: import_zod28.z.array(accessKind).max(ACCESS_KINDS.length).refine(namedOnce, { message: "Name each kind once." }).meta({
6426
6529
  uniqueItems: true,
6427
6530
  description: "Kinds of access locked for every user and server key of the app, on every robot it reaches: `read`, `invoke`, `publish`, `assets` or `job_history`, each at most once. The only way to lock `assets` or `job_history`, which belong to the robot as a whole."
6428
6531
  }),
6429
- locked: import_zod27.z.array(appLock).max(MAX_APP_LOCKS).refine((locks) => namedOnce(locks.map((lock) => lock.robot_id)), { message: "Give each robot one entry; list all of its slugs in it." }).meta({
6532
+ locked: import_zod28.z.array(appLock).max(MAX_APP_LOCKS).refine((locks) => namedOnce(locks.map((lock) => lock.robot_id)), { message: "Give each robot one entry; list all of its slugs in it." }).meta({
6430
6533
  description: `Single exposures locked on single robots, one entry per robot and at most ${MAX_APP_LOCKS}. A lock never grants anything: it only takes away what a role would give.`
6431
6534
  })
6432
6535
  };
6433
- var appAccessRevision = import_zod27.z.string().regex(/^[0-9a-f]{64}$/).meta({
6536
+ var appAccessRevision = import_zod28.z.string().regex(/^[0-9a-f]{64}$/).meta({
6434
6537
  description: "A fingerprint of the stored access, 64 lower-case hexadecimal characters. It changes whenever the stored access changes, by whichever route (a write here, a slug rename that adds the new name to a lock, a robot detached from the app). Treat it as opaque: send back the one you read."
6435
6538
  });
6436
- var appAccess = import_zod27.z.object({
6539
+ var appAccess = import_zod28.z.object({
6437
6540
  ...appAccessFields,
6438
6541
  revision: appAccessRevision.optional().meta({
6439
6542
  description: "The `revision` of the access this body was composed from, as `GET` or `PUT /api/apps/:id/access` answered it. When it is sent and the stored access has changed since, the write is refused with `409 target_state_conflict` naming `revision` (rule `stale`) and nothing is written; read the access again and compose the body anew. Left out, the body replaces whatever is stored: the last writer wins."
6440
6543
  })
6441
6544
  }).strict();
6442
- var accessWarning = import_zod27.z.object({
6443
- code: import_zod27.z.enum(["unknown_default_role", "unknown_lock_slug", "lock_robot_not_attached"]).meta({
6545
+ var accessWarning = import_zod28.z.object({
6546
+ code: import_zod28.z.enum(["unknown_default_role", "unknown_lock_slug", "lock_robot_not_attached"]).meta({
6444
6547
  description: "`unknown_default_role`: the default role names no role of the organization. `unknown_lock_slug`: a lock names a slug the robot has no published exposure for. `lock_robot_not_attached`: a lock names a robot that is not attached to the app."
6445
6548
  }),
6446
- message: import_zod27.z.string().min(1).meta({
6549
+ message: import_zod28.z.string().min(1).meta({
6447
6550
  description: "A sentence a person can read, naming the key, robot or slug."
6448
6551
  }),
6449
- robot_id: import_zod27.z.uuid().nullable().meta({
6552
+ robot_id: import_zod28.z.uuid().nullable().meta({
6450
6553
  description: "The robot a lock warning is about; `null` for `unknown_default_role`."
6451
6554
  }),
6452
- slug: import_zod27.z.string().nullable().meta({
6555
+ slug: import_zod28.z.string().nullable().meta({
6453
6556
  description: "The slug an `unknown_lock_slug` warning is about; `null` for the other warnings."
6454
6557
  })
6455
6558
  });
6456
- var appAccessResponse = import_zod27.z.object({
6559
+ var appAccessResponse = import_zod28.z.object({
6457
6560
  ...appAccessFields,
6458
6561
  revision: appAccessRevision.meta({
6459
6562
  description: "The revision of the access as it stands. Send it back as `revision` of the next `PUT` to have that write refused when the access has changed in between."
6460
6563
  }),
6461
- warnings: import_zod27.z.array(accessWarning).meta({
6564
+ warnings: import_zod28.z.array(accessWarning).meta({
6462
6565
  description: "What the access names that does not exist as written. Empty when nothing is out of step."
6463
6566
  })
6464
6567
  });
6465
- var effectiveRightsQuery = import_zod27.z.object({
6568
+ var effectiveRightsQuery = import_zod28.z.object({
6466
6569
  role: roleKey.optional().meta({
6467
6570
  description: "A role key to look at the app as. A key that names no role is not an error: the answer says `role_known: false` and grants nothing."
6468
6571
  }),
6469
- user: import_zod27.z.uuid().optional().meta({
6572
+ user: import_zod28.z.uuid().optional().meta({
6470
6573
  description: "An app user of this app, to look at the app as that user's role. A user of another app answers `404`."
6471
6574
  })
6472
6575
  }).strict().refine((query) => query.role === void 0 !== (query.user === void 0), {
6473
6576
  message: "Name exactly one of role and user."
6474
6577
  });
6475
- var effectiveCapability = import_zod27.z.object({
6578
+ var effectiveCapability = import_zod28.z.object({
6476
6579
  name: slug.meta({
6477
6580
  description: "The exposure's slug, or `assets` or `job_history` for the capabilities that belong to the robot as a whole."
6478
6581
  }),
6479
6582
  kind: accessKind.meta({
6480
6583
  description: "The kind of access the capability needs."
6481
6584
  }),
6482
- granted: import_zod27.z.boolean().meta({
6585
+ granted: import_zod28.z.boolean().meta({
6483
6586
  description: "Whether the role may use it: its requirement is met and the app has not locked it."
6484
6587
  }),
6485
- requirement: import_zod27.z.array(import_zod27.z.string()).meta({
6588
+ requirement: import_zod28.z.array(import_zod28.z.string()).meta({
6486
6589
  description: "The role keys that qualify, from the entry, the rule or the default that decided. Holding one of them, or inheriting from one, is enough. Empty when nobody qualifies."
6487
6590
  }),
6488
- source: import_zod27.z.enum(["entry", "rule", "robot", "org_default"]).meta({
6591
+ source: import_zod28.z.enum(["entry", "rule", "robot", "org_default"]).meta({
6489
6592
  description: "Where the requirement came from: `entry` is the entry's own `role`, `rule` the first matching rule of `access.rules`, `robot` the robot's `access.assets` or `access.job_history`, and `org_default` the organization's default for the kind."
6490
6593
  }),
6491
- rule_index: import_zod27.z.number().int().nonnegative().nullable().meta({
6594
+ rule_index: import_zod28.z.number().int().nonnegative().nullable().meta({
6492
6595
  description: "For `rule`, the position of the deciding rule in `access.rules`, counted from zero; `null` otherwise."
6493
6596
  }),
6494
- rule_match: import_zod27.z.string().nullable().meta({
6597
+ rule_match: import_zod28.z.string().nullable().meta({
6495
6598
  description: "For `rule`, that rule's `match` glob; `null` otherwise."
6496
6599
  }),
6497
- satisfied_by: import_zod27.z.string().nullable().meta({
6600
+ satisfied_by: import_zod28.z.string().nullable().meta({
6498
6601
  description: "The key from `requirement` that the role holds through inheritance. `null` when the role is named in the requirement itself, and when it does not meet the requirement at all. Independent of locks."
6499
6602
  }),
6500
- locked: import_zod27.z.boolean().meta({
6603
+ locked: import_zod28.z.boolean().meta({
6501
6604
  description: "Whether the app locks this capability, as a kind or as a single lock. A lock wins over the requirement."
6502
6605
  }),
6503
- unknown_roles: import_zod27.z.array(import_zod27.z.string()).meta({
6606
+ unknown_roles: import_zod28.z.array(import_zod28.z.string()).meta({
6504
6607
  description: "Keys in the requirement that name no role of the organization. They grant nothing."
6505
6608
  })
6506
6609
  });
6507
- var effectiveRobotRights = import_zod27.z.object({
6508
- robot_id: import_zod27.z.uuid().meta({ description: "The robot, one that is attached to the app." }),
6509
- robot_name: import_zod27.z.string().min(1).max(200).meta({ description: "The robot's name." }),
6510
- published_version: import_zod27.z.number().int().positive().nullable().meta({
6610
+ var effectiveRobotRights = import_zod28.z.object({
6611
+ robot_id: import_zod28.z.uuid().meta({ description: "The robot, one that is attached to the app." }),
6612
+ robot_name: import_zod28.z.string().min(1).max(200).meta({ description: "The robot's name." }),
6613
+ published_version: import_zod28.z.number().int().positive().nullable().meta({
6511
6614
  description: "The version of the robot's published `fleetless.yaml` that the answer was computed from; `null` when nothing is published."
6512
6615
  }),
6513
- reachable: import_zod27.z.boolean().meta({
6616
+ reachable: import_zod28.z.boolean().meta({
6514
6617
  description: "Whether a session of this role reaches the robot at all: at least one slug or one capability is granted once the locks are applied. When `false`, `robots.describe` answers `not_found` for the robot and `robots.list` leaves it out; `capabilities` says why, and `datasheet` is the empty one."
6515
6618
  }),
6516
- capabilities: import_zod27.z.array(effectiveCapability).meta({
6619
+ capabilities: import_zod28.z.array(effectiveCapability).meta({
6517
6620
  description: "Every capability of the published configuration, and `assets` and `job_history`, each granted or not."
6518
6621
  }),
6519
6622
  datasheet: mcpRobotDatasheet.meta({
6520
6623
  description: "The datasheet an MCP session of this role would get for the robot."
6521
6624
  })
6522
6625
  });
6523
- var effectiveRightsResponse = import_zod27.z.object({
6524
- role: import_zod27.z.string().nullable().meta({
6626
+ var effectiveRightsResponse = import_zod28.z.object({
6627
+ role: import_zod28.z.string().nullable().meta({
6525
6628
  description: "The role key the answer is for: the one asked about, or the app user's own. `null` when the app user holds none."
6526
6629
  }),
6527
- role_known: import_zod27.z.boolean().meta({
6630
+ role_known: import_zod28.z.boolean().meta({
6528
6631
  description: "Whether the key names a role of the organization. `false` means every capability below is not granted."
6529
6632
  }),
6530
- user_id: import_zod27.z.uuid().nullable().meta({
6633
+ user_id: import_zod28.z.uuid().nullable().meta({
6531
6634
  description: "The app user asked about; `null` when a role was asked about. A user who is not `active` reaches nothing, whatever role they hold: every capability below is not granted."
6532
6635
  }),
6533
- robots: import_zod27.z.array(effectiveRobotRights).meta({
6636
+ robots: import_zod28.z.array(effectiveRobotRights).meta({
6534
6637
  description: "The robots attached to the app, each with what the role may use."
6535
6638
  }),
6536
- collections: import_zod27.z.array(roleCollectionRights).meta({
6639
+ collections: import_zod28.z.array(roleCollectionRights).meta({
6537
6640
  description: "What the role may do with the records of each collection of the app's latest published schema, in the schema's order. Empty when the app has no published schema. A role that is no role, and a user who is not `active`, are granted nothing in any row."
6538
6641
  })
6539
6642
  });
6540
6643
 
6541
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/client-auth.js
6542
- var clientLoginRequest = import_zod28.z.object({
6644
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-auth.js
6645
+ var clientLoginRequest = import_zod29.z.object({
6543
6646
  app_identifier: appIdentifier.meta({
6544
6647
  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."
6545
6648
  }),
6546
- email: import_zod28.z.email().meta({
6649
+ email: import_zod29.z.email().meta({
6547
6650
  description: "The app user's address. Addresses are unique **per app**, not across Fleetless: the same address may be an unrelated account in another app of the same organisation, so this pair is what identifies a person here."
6548
6651
  }),
6549
- password: import_zod28.z.string().min(1).meta({
6652
+ password: import_zod29.z.string().min(1).meta({
6550
6653
  description: "The app user's password. A wrong pair is refused without saying which half was wrong \u2014 and a `blocked` or not-yet-verified account is refused identically, so a failed login is not an account-enumeration oracle in any of its three forms."
6551
6654
  })
6552
6655
  });
6553
- var clientRefreshRequest = import_zod28.z.object({
6554
- refresh_token: import_zod28.z.string().min(1).meta({
6656
+ var clientRefreshRequest = import_zod29.z.object({
6657
+ refresh_token: import_zod29.z.string().min(1).meta({
6555
6658
  description: "The refresh token from the last login or refresh. Refresh tokens rotate on every use, so the value sent here is spent \u2014 keep the one that comes back, and presenting a spent one is treated as theft and ends the whole family."
6556
6659
  })
6557
6660
  });
6558
- var clientLogoutRequest = import_zod28.z.object({
6559
- refresh_token: import_zod28.z.string().min(1).meta({
6661
+ var clientLogoutRequest = import_zod29.z.object({
6662
+ refresh_token: import_zod29.z.string().min(1).meta({
6560
6663
  description: "Any refresh token of the session to end. The whole token family is revoked server-side, so a token stolen before this call stops working too \u2014 clearing a client-side store is a gesture, not a revocation. The answer is `204`: a token the server does not recognise gets it too, since that is the end state being asked for."
6561
6664
  })
6562
6665
  });
6563
- var clientLoginCodeRequest = import_zod28.z.object({
6666
+ var clientLoginCodeRequest = import_zod29.z.object({
6564
6667
  app_identifier: appIdentifier.meta({ description: "The app to sign in to. An identifier no app carries is `404 not_found`; the address is never the subject of a refusal." }),
6565
- email: import_zod28.z.email().meta({
6668
+ email: import_zod29.z.email().meta({
6566
6669
  description: "The address to mail the code to, trimmed and compared case-insensitively. `202` whether or not it names an account of this app."
6567
6670
  })
6568
6671
  }).strict();
6569
- var clientLoginCodeVerifyRequest = import_zod28.z.object({
6672
+ var clientLoginCodeVerifyRequest = import_zod29.z.object({
6570
6673
  app_identifier: appIdentifier.meta({ description: "The app the code was requested for." }),
6571
- email: import_zod28.z.email().meta({ description: "The address the code was mailed to, as typed when it was requested; trimmed and compared case-insensitively." }),
6674
+ email: import_zod29.z.email().meta({ description: "The address the code was mailed to, as typed when it was requested; trimmed and compared case-insensitively." }),
6572
6675
  code: loginCode.meta({ description: "The six digits from the mail, exactly \u2014 leading zeros included, no spaces." })
6573
6676
  }).strict();
6574
- var twoFactorChallenge = import_zod28.z.object({
6575
- status: import_zod28.z.enum(["two_factor_required", "two_factor_setup_required"]).meta({
6677
+ var twoFactorChallenge = import_zod29.z.object({
6678
+ status: import_zod29.z.enum(["two_factor_required", "two_factor_setup_required"]).meta({
6576
6679
  description: "`two_factor_required`: ask for the authenticator code. `two_factor_setup_required`: the app requires two-factor and the person has none yet, so set one up before any session exists."
6577
6680
  }),
6578
- challenge: import_zod28.z.string().min(1).meta({
6681
+ challenge: import_zod29.z.string().min(1).meta({
6579
6682
  description: "The handle the next step spends. Valid five minutes; afterwards it answers `410 token_spent` and the sign-in starts over."
6580
6683
  })
6581
6684
  });
6582
- var clientSignInResult = import_zod28.z.union([sessionTokens, twoFactorChallenge]);
6583
- var clientTwoFactorVerifyRequest = import_zod28.z.object({
6584
- challenge: import_zod28.z.string().min(1).meta({ description: "The challenge the sign-in step answered." }),
6685
+ var clientSignInResult = import_zod29.z.union([sessionTokens, twoFactorChallenge]);
6686
+ var clientTwoFactorVerifyRequest = import_zod29.z.object({
6687
+ challenge: import_zod29.z.string().min(1).meta({ description: "The challenge the sign-in step answered." }),
6585
6688
  code: totpCode.optional().meta({ description: "The six-digit code the authenticator shows now. A code already accepted once is refused, so a replay of a seen code does not sign anybody in." }),
6586
6689
  recovery_code: recoveryCode.optional().meta({ description: "One of the ten recovery codes, `xxxxx-xxxxx`, in either case. Spent by its use." })
6587
6690
  }).strict().refine((b) => b.code === void 0 !== (b.recovery_code === void 0), { message: "Send exactly one of code and recovery_code." });
6588
- var clientTwoFactorSetupRequest = import_zod28.z.object({
6589
- challenge: import_zod28.z.string().min(1).optional().meta({
6691
+ var clientTwoFactorSetupRequest = import_zod29.z.object({
6692
+ challenge: import_zod29.z.string().min(1).optional().meta({
6590
6693
  description: "The `two_factor_setup_required` challenge, during sign-in. Absent when the call carries the app user's bearer instead."
6591
6694
  })
6592
6695
  }).strict();
6593
- var clientTwoFactorSetupConfirmRequest = import_zod28.z.object({
6594
- challenge: import_zod28.z.string().min(1).optional().meta({ description: "The same challenge as at `setup`, during sign-in; absent with a bearer." }),
6696
+ var clientTwoFactorSetupConfirmRequest = import_zod29.z.object({
6697
+ challenge: import_zod29.z.string().min(1).optional().meta({ description: "The same challenge as at `setup`, during sign-in; absent with a bearer." }),
6595
6698
  code: totpCode.meta({ description: "A code the new authenticator shows now. It proves the secret was copied correctly before anything depends on it." })
6596
6699
  }).strict();
6597
- var clientTwoFactorSetupConfirmResponse = import_zod28.z.object({
6700
+ var clientTwoFactorSetupConfirmResponse = import_zod29.z.object({
6598
6701
  recovery_codes: recoveryCodesList.meta({
6599
6702
  description: "The ten single-use recovery codes, lowercase, shown once. Any earlier set is void."
6600
6703
  }),
6601
6704
  session: sessionTokens.meta({ description: "The session the sign-in was waiting for, or a fresh one for the account settings." })
6602
6705
  });
6603
- var clientTwoFactorDisableRequest = import_zod28.z.object({
6706
+ var clientTwoFactorDisableRequest = import_zod29.z.object({
6604
6707
  code: totpCode.meta({ description: "A code the authenticator shows now." })
6605
6708
  }).strict();
6606
- var clientRegisterRequest = import_zod28.z.object({
6709
+ var clientRegisterRequest = import_zod29.z.object({
6607
6710
  app_identifier: appIdentifier.meta({
6608
6711
  description: "The app to register with. An identifier no app carries is `404 not_found` \u2014 an identifier is public, so naming it is no disclosure, and collapsing it into `registration_closed` sent a developer who mistyped their own identifier hunting a configuration bug that was not there. The **address** is never the subject of a refusal."
6609
6712
  }),
6610
- email: import_zod28.z.email().meta({
6713
+ email: import_zod29.z.email().meta({
6611
6714
  description: "The address to register. Unique per app, case-insensitively. An address this app already knows still answers `202`, without a mail \u2014 the answer may not say whether an account exists."
6612
6715
  }),
6613
6716
  password: password.optional().meta({
6614
6717
  description: "The password for the new account, at least 12 characters. **Required while the app's password method is on, refused while it is off** \u2014 both as `400 validation_error` naming `password`. An email-code-only app registers people without one."
6615
6718
  }),
6616
- display_name: import_zod28.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
6719
+ display_name: import_zod29.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
6617
6720
  description: "An optional human name for the account. The developer's own UI decides whether to ask for it."
6618
6721
  })
6619
6722
  }).strict();
6620
- var clientVerifyEmailRequest = import_zod28.z.object({
6621
- token: import_zod28.z.string().min(1).meta({
6723
+ var clientVerifyEmailRequest = import_zod29.z.object({
6724
+ token: import_zod29.z.string().min(1).meta({
6622
6725
  description: "The opaque token from the verification link, valid 24 hours. Unknown, expired and already-spent all answer `410 token_spent` \u2014 telling them apart would say whether a token ever existed."
6623
6726
  })
6624
6727
  }).strict();
6625
- var clientResendVerificationRequest = import_zod28.z.object({
6728
+ var clientResendVerificationRequest = import_zod29.z.object({
6626
6729
  app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
6627
- email: import_zod28.z.email().meta({
6730
+ email: import_zod29.z.email().meta({
6628
6731
  description: "The address to re-send to. The answer is `202` whether or not it names an account, and whether or not that account is already verified."
6629
6732
  })
6630
6733
  }).strict();
6631
- var clientPasswordResetRequest = import_zod28.z.object({
6734
+ var clientPasswordResetRequest = import_zod29.z.object({
6632
6735
  app_identifier: appIdentifier.meta({ description: "The app the address belongs to." }),
6633
- email: import_zod28.z.email().meta({
6736
+ email: import_zod29.z.email().meta({
6634
6737
  description: "The address to mail a reset link to. The answer is `202` for a known address and an unknown one alike, in status, body and timing. An app identifier no app carries is `404 not_found`; the address is never the subject of a refusal."
6635
6738
  })
6636
6739
  }).strict();
6637
- var clientPasswordResetConfirmRequest = import_zod28.z.object({
6638
- token: import_zod28.z.string().min(1).meta({
6740
+ var clientPasswordResetConfirmRequest = import_zod29.z.object({
6741
+ token: import_zod29.z.string().min(1).meta({
6639
6742
  description: "The opaque token from the reset link, valid one hour. Single-use; unknown, expired and spent all answer `410 token_spent`."
6640
6743
  }),
6641
6744
  new_password: password.meta({
6642
6745
  description: "The replacement password. Accepting it revokes every refresh family the account holds \u2014 the answer carries a fresh pair, so the person is signed in on the device that completed the reset and nowhere else."
6643
6746
  })
6644
6747
  }).strict();
6645
- var clientAcceptInvitationRequest = import_zod28.z.object({
6646
- token: import_zod28.z.string().min(1).meta({
6748
+ var clientAcceptInvitationRequest = import_zod29.z.object({
6749
+ token: import_zod29.z.string().min(1).meta({
6647
6750
  description: "The opaque token from the invitation link, valid seven days. Unknown, expired, revoked and already-accepted all answer `410 token_spent`."
6648
6751
  }),
6649
6752
  password: password.optional().meta({
6650
6753
  description: "The password the new account will use, at least 12 characters. **Required while the app's password method is on, refused while it is off** \u2014 both as `400 validation_error` naming `password`. An email-code-only app accepts invitations without one."
6651
6754
  }),
6652
- display_name: import_zod28.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
6755
+ display_name: import_zod29.z.string().min(1).max(APP_USER_DISPLAY_NAME_MAX).nullable().optional().meta({
6653
6756
  description: "An optional name, overriding whatever the invitation pre-filled."
6654
6757
  })
6655
6758
  }).strict();
6656
6759
  var CLIENT_OIDC_CALLBACK_PATH = "/api/client/oidc/callback";
6657
- var clientProviderListQuery = import_zod28.z.object({
6760
+ var clientProviderListQuery = import_zod29.z.object({
6658
6761
  app_identifier: appIdentifier.meta({ description: "The app whose enabled providers to list." })
6659
6762
  }).meta({ description: "The one parameter of the public provider listing." });
6660
- var clientProviderListResponse = import_zod28.z.object({
6661
- providers: import_zod28.z.array(import_zod28.z.object({
6763
+ var clientProviderListResponse = import_zod29.z.object({
6764
+ providers: import_zod29.z.array(import_zod29.z.object({
6662
6765
  slug: providerSlug.meta({ description: "The handle to put in the start URL: `GET /api/client/oidc/<slug>/start`." }),
6663
- name: import_zod28.z.string().meta({ description: "What to write on the button, as the developer configured it." })
6766
+ name: import_zod29.z.string().meta({ description: "What to write on the button, as the developer configured it." })
6664
6767
  })).meta({
6665
6768
  description: "The app's **enabled** providers, slug and display name only. An app with none answers an empty array, which is the state of an app that offers password or code sign-in alone."
6666
6769
  }),
@@ -6671,41 +6774,41 @@ var clientProviderListResponse = import_zod28.z.object({
6671
6774
  description: "The app's off, optional or required two-factor policy; not the caller's enrollment state."
6672
6775
  })
6673
6776
  });
6674
- var clientOidcStartQuery = import_zod28.z.object({
6777
+ var clientOidcStartQuery = import_zod29.z.object({
6675
6778
  app_identifier: appIdentifier.meta({ description: "The app being signed in to." }),
6676
- redirect_uri: import_zod28.z.url().max(2e3).meta({
6779
+ redirect_uri: import_zod29.z.url().max(2e3).meta({
6677
6780
  description: "Where to send the browser when the flow finishes, with `code` and `state` or with `error` and `state`. **Its origin must be one of the app's `allowed_origins`**; a failure here is refused flat, with no redirect, because until the target is confirmed there is nowhere trusted to bounce a browser to."
6678
6781
  }),
6679
- state: import_zod28.z.string().min(8).max(512).meta({
6782
+ state: import_zod29.z.string().min(8).max(512).meta({
6680
6783
  description: "Returned unchanged on the callback, and on the error redirect too, so the app can bind either answer to the request it started. At least eight characters: this is what ties the callback to the browser that began the flow, and a guessable value defends nothing."
6681
6784
  }),
6682
- code_challenge: import_zod28.z.string().regex(/^[A-Za-z0-9_-]{43,128}$/).meta({
6785
+ code_challenge: import_zod29.z.string().regex(/^[A-Za-z0-9_-]{43,128}$/).meta({
6683
6786
  description: "The app's own PKCE challenge (RFC 7636, S256 base64url). The verifier is presented at `oidc/exchange`, so the one-time code is worth nothing to whoever intercepts the redirect. `plain` is not accepted: a challenge equal to its verifier defends against nothing."
6684
6787
  })
6685
6788
  });
6686
- var clientOidcCallbackQuery = import_zod28.z.object({
6687
- state: import_zod28.z.string().min(1).meta({
6789
+ var clientOidcCallbackQuery = import_zod29.z.object({
6790
+ state: import_zod29.z.string().min(1).meta({
6688
6791
  description: "The opaque state Fleetless sent to the provider, which resolves the pending interaction \u2014 and with it the app's `redirect_uri`. Not the app's own `state` from `start`: that one is stored on the interaction and put back on the redirect to the app. A callback whose state resolves to nothing has no confirmed target to answer, and is the one case Fleetless renders a page for."
6689
6792
  }),
6690
- code: import_zod28.z.string().min(1).optional().meta({
6793
+ code: import_zod29.z.string().min(1).optional().meta({
6691
6794
  description: "The provider's authorization code, present when the sign-in succeeded. Exchanged server-side by the cloud, so it never reaches the app \u2014 the app gets its own one-time code, bound to the PKCE challenge it sent at `start`."
6692
6795
  }),
6693
- error: import_zod28.z.string().min(1).optional().meta({
6796
+ error: import_zod29.z.string().min(1).optional().meta({
6694
6797
  description: "The provider's own refusal, present instead of `code` when the person declined or the provider would not issue one. It is carried back to the app as a `clientOidcErrorCode`, not passed through: the provider's vocabulary is its own, and an app branching on it would be branching on a string nobody here controls."
6695
6798
  }),
6696
- error_description: import_zod28.z.string().optional().meta({
6799
+ error_description: import_zod29.z.string().optional().meta({
6697
6800
  description: "The provider's human-readable note about `error`, when it sends one. Logged, never rendered to an app user and never put on the redirect \u2014 it is text from a system Fleetless does not run."
6698
6801
  })
6699
6802
  });
6700
- var clientOidcExchangeRequest = import_zod28.z.object({
6701
- code: import_zod28.z.string().min(1).meta({
6803
+ var clientOidcExchangeRequest = import_zod29.z.object({
6804
+ code: import_zod29.z.string().min(1).meta({
6702
6805
  description: "The one-time code from the callback redirect. Valid 60 seconds, single-use, and bound to the PKCE challenge the start step carried."
6703
6806
  }),
6704
- code_verifier: import_zod28.z.string().regex(/^[A-Za-z0-9_.~-]{43,128}$/).meta({
6807
+ code_verifier: import_zod29.z.string().regex(/^[A-Za-z0-9_.~-]{43,128}$/).meta({
6705
6808
  description: "The verifier for the challenge sent at `start`. RFC 7636 \xA74.1's alphabet and length."
6706
6809
  })
6707
6810
  }).strict();
6708
- var clientOidcErrorCode = import_zod28.z.enum([
6811
+ var clientOidcErrorCode = import_zod29.z.enum([
6709
6812
  "no_access",
6710
6813
  "email_taken",
6711
6814
  "email_unverified",
@@ -6720,255 +6823,255 @@ var clientOidcErrorCode = import_zod28.z.enum([
6720
6823
  "quota_exceeded",
6721
6824
  "plan_limit"
6722
6825
  ]);
6723
- var clientMcpInteraction = import_zod28.z.object({
6724
- id: import_zod28.z.string().meta({ description: "The interaction, as it arrived in the app's `mcp_login_url`. Not a credential: it names a pending request the server already holds, and approving it needs the app user's own access token." }),
6725
- app_id: import_zod28.z.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." }),
6726
- client_name: import_zod28.z.string().nullable().meta({ description: "What the MCP client calls itself, or `null` if it named nothing. **Unverified** \u2014 see `client_name_verified`." }),
6727
- client_name_verified: import_zod28.z.literal(false).meta({
6826
+ var clientMcpInteraction = import_zod29.z.object({
6827
+ id: import_zod29.z.string().meta({ description: "The interaction, as it arrived in the app's `mcp_login_url`. Not a credential: it names a pending request the server already holds, and approving it needs the app user's own access token." }),
6828
+ app_id: import_zod29.z.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." }),
6829
+ client_name: import_zod29.z.string().nullable().meta({ description: "What the MCP client calls itself, or `null` if it named nothing. **Unverified** \u2014 see `client_name_verified`." }),
6830
+ client_name_verified: import_zod29.z.literal(false).meta({
6728
6831
  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."
6729
6832
  }),
6730
- client_id_host: import_zod28.z.string().nullable().meta({
6833
+ client_id_host: import_zod29.z.string().nullable().meta({
6731
6834
  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."
6732
6835
  }),
6733
- redirect_uri_host: import_zod28.z.string().meta({
6836
+ redirect_uri_host: import_zod29.z.string().meta({
6734
6837
  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."
6735
6838
  }),
6736
- redirect_uri_loopback: import_zod28.z.boolean().meta({
6839
+ redirect_uri_loopback: import_zod29.z.boolean().meta({
6737
6840
  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."'
6738
6841
  }),
6739
- scopes: import_zod28.z.array(import_zod28.z.string()).meta({ description: "The scopes the client asked for, to show the person before they approve." }),
6740
- already_granted: import_zod28.z.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." }),
6741
- expires_at: import_zod28.z.iso.datetime().meta({ description: "When the interaction stops being approvable. Ten minutes from the authorize step; afterwards both approve and deny answer `interaction_expired`." })
6842
+ scopes: import_zod29.z.array(import_zod29.z.string()).meta({ description: "The scopes the client asked for, to show the person before they approve." }),
6843
+ already_granted: import_zod29.z.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." }),
6844
+ expires_at: import_zod29.z.iso.datetime().meta({ description: "When the interaction stops being approvable. Ten minutes from the authorize step; afterwards both approve and deny answer `interaction_expired`." })
6742
6845
  });
6743
- var clientMcpInteractionDecisionResponse = import_zod28.z.object({
6744
- redirect_to: import_zod28.z.url().meta({
6846
+ var clientMcpInteractionDecisionResponse = import_zod29.z.object({
6847
+ redirect_to: import_zod29.z.url().meta({
6745
6848
  description: "Send the browser here. It is the MCP client's own callback, carrying either the authorization code or `error=access_denied` \u2014 a denial redirects as well, so the client learns the outcome from the place it is waiting."
6746
6849
  })
6747
6850
  });
6748
- var mcpConsentGrant = import_zod28.z.object({
6749
- client_id: import_zod28.z.string().meta({
6851
+ var mcpConsentGrant = import_zod29.z.object({
6852
+ client_id: import_zod29.z.string().meta({
6750
6853
  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."
6751
6854
  }),
6752
- client_id_host: import_zod28.z.string().nullable().meta({
6855
+ client_id_host: import_zod29.z.string().nullable().meta({
6753
6856
  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."
6754
6857
  }),
6755
- client_name: import_zod28.z.string().nullable().meta({
6858
+ client_name: import_zod29.z.string().nullable().meta({
6756
6859
  description: "What the client calls itself, or `null` once its registration or cached metadata document is gone. **Unverified** \u2014 see `client_name_verified`."
6757
6860
  }),
6758
- client_name_verified: import_zod28.z.literal(false).meta({
6861
+ client_name_verified: import_zod29.z.literal(false).meta({
6759
6862
  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."
6760
6863
  }),
6761
- granted_at: import_zod28.z.iso.datetime().meta({
6864
+ granted_at: import_zod29.z.iso.datetime().meta({
6762
6865
  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."
6763
6866
  })
6764
6867
  });
6765
- var mcpConsentGrantListResponse = import_zod28.z.object({
6766
- grants: import_zod28.z.array(mcpConsentGrant).meta({
6868
+ var mcpConsentGrantListResponse = import_zod29.z.object({
6869
+ grants: import_zod29.z.array(mcpConsentGrant).meta({
6767
6870
  description: "Every standing consent this app user holds, newest first. Withdrawn ones are absent rather than listed as withdrawn; an app user who has connected no MCP client answers an empty array."
6768
6871
  })
6769
6872
  });
6770
- var clientIdentity = import_zod28.z.object({
6771
- kind: import_zod28.z.enum(["developer", "app_user", "server_key"]).meta({
6873
+ var clientIdentity = import_zod29.z.object({
6874
+ kind: import_zod29.z.enum(["developer", "app_user", "server_key"]).meta({
6772
6875
  description: "Which of the three kinds of caller this is: a `developer` working through the console, an `app_user` holding a token from a client login, or a `server_key` used by server-side code. Stated outright, not inferred from which id is set."
6773
6876
  }),
6774
- developer_id: import_zod28.z.uuid().nullable().meta({
6877
+ developer_id: import_zod29.z.uuid().nullable().meta({
6775
6878
  description: "The Fleetless user behind this session, or `null` when `kind` is not `developer`."
6776
6879
  }),
6777
- app_user_id: import_zod28.z.uuid().nullable().meta({
6880
+ app_user_id: import_zod29.z.uuid().nullable().meta({
6778
6881
  description: "The app user behind this session, or `null` when `kind` is not `app_user`. An app user belongs to exactly one app and is unrelated to any Fleetless user with the same address."
6779
6882
  }),
6780
- server_key_id: import_zod28.z.uuid().nullable().meta({
6883
+ server_key_id: import_zod29.z.uuid().nullable().meta({
6781
6884
  description: "The server key this session was authenticated with, or `null` when `kind` is not `server_key`."
6782
6885
  }),
6783
- app_id: import_zod28.z.uuid().nullable().meta({
6886
+ app_id: import_zod29.z.uuid().nullable().meta({
6784
6887
  description: "The app this session belongs to, and `null` for a developer \u2014 a developer is organisation-scoped and owns the configuration of every robot in the organisation rather than reaching one through an app."
6785
6888
  }),
6786
- role: import_zod28.z.object({
6889
+ role: import_zod29.z.object({
6787
6890
  key: roleKey.meta({
6788
6891
  description: "The role's key, the same string `fleetless.yaml` and the organization's role list write."
6789
6892
  }),
6790
- name: import_zod28.z.string().meta({
6893
+ name: import_zod29.z.string().meta({
6791
6894
  description: "The role's display name, for showing the caller what they hold. Changing it changes nothing about rights."
6792
6895
  })
6793
6896
  }).nullable().meta({
6794
6897
  description: "The organization role that decides what this caller may reach: its key and display name. `null` when there is no role to name: for a developer and for a server key, which are not filtered by a role, and for an app user whose key names no role (the role was deleted), who then reaches nothing."
6795
6898
  }),
6796
- email: import_zod28.z.email().nullable().meta({
6899
+ email: import_zod29.z.email().nullable().meta({
6797
6900
  description: "The address of the Fleetless user or app user behind this session, and `null` for a server key, which is not a person."
6798
6901
  }),
6799
- two_factor_enabled: import_zod28.z.boolean().nullable().meta({
6902
+ two_factor_enabled: import_zod29.z.boolean().nullable().meta({
6800
6903
  description: "Whether the app user has a confirmed authenticator, so the app's account settings can offer to turn it on or off. `null` unless `kind` is `app_user`."
6801
6904
  })
6802
6905
  });
6803
6906
 
6804
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-records.js
6805
- var import_zod29 = require("zod");
6806
- var timestamp = import_zod29.z.iso.datetime();
6807
- var count3 = import_zod29.z.number().int().min(0);
6808
- var schemaVersion = import_zod29.z.number().int().min(1);
6809
- var collectionActor = import_zod29.z.object({
6810
- kind: import_zod29.z.enum(["developer", "app_user", "server_key", "fleetless"]).meta({
6907
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-records.js
6908
+ var import_zod30 = require("zod");
6909
+ var timestamp = import_zod30.z.iso.datetime();
6910
+ var count3 = import_zod30.z.number().int().min(0);
6911
+ var schemaVersion = import_zod30.z.number().int().min(1);
6912
+ var collectionActor = import_zod30.z.object({
6913
+ kind: import_zod30.z.enum(["developer", "app_user", "server_key", "fleetless"]).meta({
6811
6914
  description: "What made the change: a developer, a user of the app, a server key of the app, or the platform itself."
6812
6915
  }),
6813
- id: import_zod29.z.uuid().meta({ description: "The id of the developer, app user or server key. The nil id for the platform." }),
6814
- label: import_zod29.z.string().min(1).max(200).meta({
6916
+ id: import_zod30.z.uuid().meta({ description: "The id of the developer, app user or server key. The nil id for the platform." }),
6917
+ label: import_zod30.z.string().min(1).max(200).meta({
6815
6918
  description: "A name to show: the person's display name, the name of a server key, `Fleetless`, `Deleted user` when the user no longer exists, or `Deleted key` when the key does. A person without a display name reads as their email address to a developer or a server key and to themselves, and to an app user reading someone else as `Team member` (a developer) or `User` (an app user): an app user never learns another person's address."
6816
6919
  })
6817
6920
  }).meta({ description: "Who or what made a change to a record." });
6818
- var collectionRecord = import_zod29.z.object({
6819
- id: import_zod29.z.uuid(),
6820
- robot_id: import_zod29.z.uuid().nullable().meta({
6921
+ var collectionRecord = import_zod30.z.object({
6922
+ id: import_zod30.z.uuid(),
6923
+ robot_id: import_zod30.z.uuid().nullable().meta({
6821
6924
  description: "The robot a record of a `per_robot` or `one_per_robot` collection belongs to; null in a `global` collection."
6822
6925
  }),
6823
6926
  created_at: timestamp,
6824
6927
  created_by: collectionActor,
6825
6928
  updated_at: timestamp,
6826
6929
  updated_by: collectionActor,
6827
- revision: import_zod29.z.number().int().min(1).meta({ description: "Starts at 1 and grows by one with every change. Send it as `expected_revision` to refuse a write that would overwrite a newer one." }),
6828
- display: import_zod29.z.string().meta({ description: "The collection's display template filled in for this record." }),
6829
- missing_required: import_zod29.z.array(import_zod29.z.string()).meta({
6930
+ revision: import_zod30.z.number().int().min(1).meta({ description: "Starts at 1 and grows by one with every change. Send it as `expected_revision` to refuse a write that would overwrite a newer one." }),
6931
+ display: import_zod30.z.string().meta({ description: "The collection's display template filled in for this record." }),
6932
+ missing_required: import_zod30.z.array(import_zod30.z.string()).meta({
6830
6933
  description: "Required fields that are empty because the schema changed after the record was written. The record can still be updated in its other fields. Absent when nothing is missing."
6831
6934
  }).optional(),
6832
- values: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.unknown()).meta({
6935
+ values: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
6833
6936
  description: "The record's fields by key. A field without a value is absent. With `expand`, a reference field holds the referenced record in this same shape instead of its id, when the caller may read that collection."
6834
6937
  }),
6835
6938
  deleted_at: timestamp.meta({ description: "When the record was deleted. Present only in the list of deleted records (`deleted=true`); absent on a live record." }).optional(),
6836
6939
  deleted_by: collectionActor.meta({ description: "Who deleted the record. Present only in the list of deleted records (`deleted=true`); absent on a live record." }).optional()
6837
6940
  }).meta({ description: "A record of a collection: its system fields and its values." });
6838
- var collectionFilter = import_zod29.z.record(import_zod29.z.string(), import_zod29.z.unknown()).meta({
6941
+ var collectionFilter = import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
6839
6942
  description: 'A filter is a JSON object. A condition names a field and one operator: `{ "location.name": { "eq": "XTD1" } }`. The operators are `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `contains` (case-insensitive text search), `in` (a list of at most 100 values) and `empty` (`true` or `false`). Conditions are combined with `{ "and": [ ... ] }` and `{ "or": [ ... ] }`, nested at most 3 levels deep, 50 conditions in all. A field is a field key, `reference.field` to go one hop through a reference field, or one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`.'
6840
6943
  });
6841
- var pageLimit = import_zod29.z.union([import_zod29.z.string().regex(/^\d{1,4}$/), import_zod29.z.number().int()]).transform((v) => Number(v)).pipe(import_zod29.z.number().int().positive().max(COLLECTION_LIMITS.pageMax));
6842
- var wireBoolean = import_zod29.z.enum(["true", "false"]);
6843
- var expandParam = import_zod29.z.string().min(1).meta({
6944
+ var pageLimit = import_zod30.z.union([import_zod30.z.string().regex(/^\d{1,4}$/), import_zod30.z.number().int()]).transform((v) => Number(v)).pipe(import_zod30.z.number().int().positive().max(COLLECTION_LIMITS.pageMax));
6945
+ var wireBoolean = import_zod30.z.enum(["true", "false"]);
6946
+ var expandParam = import_zod30.z.string().min(1).meta({
6844
6947
  description: "Reference fields to embed as records, separated by commas. Only one hop is followed. The embedded records are not counted in the size of a page."
6845
6948
  });
6846
- var collectionRecordListQuery = import_zod29.z.object({
6847
- filter: import_zod29.z.string().min(1).meta({
6949
+ var collectionRecordListQuery = import_zod30.z.object({
6950
+ filter: import_zod30.z.string().min(1).meta({
6848
6951
  description: 'A filter as JSON text, for example `{"location.name":{"eq":"XTD1"}}`. A condition names a field of the collection, one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`, or a field of a referenced record written `reference.field`. `created_by` is compared with the id of the developer, user or key that created the record.'
6849
6952
  }).optional(),
6850
- search: import_zod29.z.string().meta({
6953
+ search: import_zod30.z.string().meta({
6851
6954
  description: "Words that must all occur, in any letter case, in at least one searchable field of the record. At most 10 words, separated by whitespace."
6852
6955
  }).optional(),
6853
- sort: import_zod29.z.string().min(1).meta({
6956
+ sort: import_zod30.z.string().min(1).meta({
6854
6957
  description: "Up to 3 fields separated by commas; a leading `-` sorts descending, for example `-position_m,name`. A field is named as in `filter`: a field of the collection, one of the system fields `id`, `robot_id`, `created_at`, `updated_at` and `created_by`, or `reference.field`. Ties are broken by `id`."
6855
6958
  }).optional(),
6856
6959
  expand: expandParam.optional(),
6857
6960
  limit: pageLimit.meta({
6858
6961
  description: `The most records to return, 1 to ${COLLECTION_LIMITS.pageMax}. Default ${COLLECTION_LIMITS.pageDefault}. A page can hold fewer: see \`next_cursor\`.`
6859
6962
  }).optional(),
6860
- cursor: import_zod29.z.string().min(1).meta({ description: "The `next_cursor` of the previous page." }).optional(),
6963
+ cursor: import_zod30.z.string().min(1).meta({ description: "The `next_cursor` of the previous page." }).optional(),
6861
6964
  count: wireBoolean.meta({ description: "`true` adds `total`, the number of records that match." }).optional(),
6862
6965
  deleted: wireBoolean.meta({ description: "`true` lists deleted records instead, newest deletion first. Needs the right to create records." }).optional(),
6863
- robot: import_zod29.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional()
6966
+ robot: import_zod30.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional()
6864
6967
  }).strict();
6865
- var collectionRecordGetQuery = import_zod29.z.object({ expand: expandParam.optional() }).strict();
6866
- var collectionRecordListResponse = import_zod29.z.object({
6867
- records: import_zod29.z.array(collectionRecord).meta({
6968
+ var collectionRecordGetQuery = import_zod30.z.object({ expand: expandParam.optional() }).strict();
6969
+ var collectionRecordListResponse = import_zod30.z.object({
6970
+ records: import_zod30.z.array(collectionRecord).meta({
6868
6971
  description: "The records of the page. A page is cut short at 4 MiB of stored record values (for the list of deleted records, of the revisions that deleted them), so it can hold fewer than `limit` records while more follow. It always holds at least one record when there is one, and a list of ordinary size is never cut."
6869
6972
  }),
6870
- next_cursor: import_zod29.z.string().nullable().meta({
6973
+ next_cursor: import_zod30.z.string().nullable().meta({
6871
6974
  description: "Send it as `cursor` to read the next page; it continues after the last record this page holds. Null when this is the last page, which a short page does not say on its own: only `null` says the list is at its end."
6872
6975
  }),
6873
6976
  total: count3.meta({ description: "The number of records that match, sent only when `count=true` was asked for. A page cut short does not change it." }).optional()
6874
6977
  }).meta({ description: "One page of records." });
6875
- var collectionRecordWrite = import_zod29.z.object({
6876
- values: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.unknown()).meta({
6978
+ var collectionRecordWrite = import_zod30.z.object({
6979
+ values: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).meta({
6877
6980
  description: `The fields to set by key. A \`null\` clears a field. On an update, fields that are left out keep their value. A record may hold ${COLLECTION_LIMITS.recordBytes.toLocaleString("en-US")} bytes of values as JSON; more is \`400 validation_error\`, field \`values\`, rule \`record_too_large\`, and so is a request body of more than 2 MiB.`
6878
6981
  }),
6879
- robot_id: import_zod29.z.uuid().meta({ description: "The robot of a new record in a collection that belongs to robots. Fixed once the record exists." }).optional(),
6880
- expected_revision: import_zod29.z.number().int().min(1).meta({ description: "The revision you last read. The write is refused with `record_changed` if the record has moved on." }).optional()
6982
+ robot_id: import_zod30.z.uuid().meta({ description: "The robot of a new record in a collection that belongs to robots. Fixed once the record exists." }).optional(),
6983
+ expected_revision: import_zod30.z.number().int().min(1).meta({ description: "The revision you last read. The write is refused with `record_changed` if the record has moved on." }).optional()
6881
6984
  }).strict().meta({ description: "The body of a record create or update." });
6882
- var collectionRevision = import_zod29.z.object({
6883
- seq: import_zod29.z.number().int().positive().meta({ description: "The position of this revision in the history. Use it to page (`before_seq`) and to restore (`seq`)." }),
6884
- op: import_zod29.z.enum(["create", "update", "delete", "restore"]),
6985
+ var collectionRevision = import_zod30.z.object({
6986
+ seq: import_zod30.z.number().int().positive().meta({ description: "The position of this revision in the history. Use it to page (`before_seq`) and to restore (`seq`)." }),
6987
+ op: import_zod30.z.enum(["create", "update", "delete", "restore"]),
6885
6988
  at: timestamp,
6886
6989
  actor: collectionActor,
6887
- reason: import_zod29.z.string().nullable().meta({ description: "Why a change was made when it was not an ordinary write: `schema v5`, `import`, `restore v4`. Null otherwise." }),
6888
- revision: import_zod29.z.number().int().min(1).meta({ description: "The record's revision number after this change." }),
6889
- changes: import_zod29.z.record(import_zod29.z.string(), import_zod29.z.object({ old: import_zod29.z.unknown(), new: import_zod29.z.unknown() })).meta({
6990
+ reason: import_zod30.z.string().nullable().meta({ description: "Why a change was made when it was not an ordinary write: `schema v5`, `import`, `restore v4`. Null otherwise." }),
6991
+ revision: import_zod30.z.number().int().min(1).meta({ description: "The record's revision number after this change." }),
6992
+ changes: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.object({ old: import_zod30.z.unknown(), new: import_zod30.z.unknown() })).meta({
6890
6993
  description: "The fields this change touched by key, each with its value before and after. `null` means no value."
6891
6994
  }),
6892
6995
  record: collectionRecord.nullable().meta({ description: "The whole record, on a `delete` revision. Null on every other operation." })
6893
6996
  }).meta({ description: "One change in the history of a record." });
6894
- var collectionRecordHistoryQuery = import_zod29.z.object({
6997
+ var collectionRecordHistoryQuery = import_zod30.z.object({
6895
6998
  limit: pageLimit.meta({ description: `The most revisions to return, 1 to ${COLLECTION_LIMITS.pageMax}. A page can hold fewer: see \`next_before_seq\`.` }).optional(),
6896
6999
  before_seq: wireSeqCursor.meta({ description: "Only revisions older than this `seq`: the next page, since the history is read newest first." }).optional()
6897
7000
  }).strict();
6898
- var collectionRecordHistoryResponse = import_zod29.z.object({
6899
- revisions: import_zod29.z.array(collectionRevision).meta({
7001
+ var collectionRecordHistoryResponse = import_zod30.z.object({
7002
+ revisions: import_zod30.z.array(collectionRevision).meta({
6900
7003
  description: "The revisions of the page, newest first. A page is cut short at 4 MiB of stored revisions, since the changes of a revision keep the old and the new value and a `delete` the whole record. It always holds at least one revision, and a history of ordinary size is never cut."
6901
7004
  }),
6902
- next_before_seq: import_zod29.z.number().int().positive().nullable().meta({
7005
+ next_before_seq: import_zod30.z.number().int().positive().nullable().meta({
6903
7006
  description: "Send it as `before_seq` to read older revisions; it names the last revision this page holds, also when the page was cut short. Null when there are none."
6904
7007
  }),
6905
- purged: import_zod29.z.object({
7008
+ purged: import_zod30.z.object({
6906
7009
  before: timestamp.meta({ description: "Revisions older than this were removed." }),
6907
7010
  by: collectionActor,
6908
7011
  at: timestamp.meta({ description: "When they were removed." })
6909
7012
  }).nullable().meta({ description: "Set when an organization owner removed the older part of this history: the history then starts with that note." })
6910
7013
  }).meta({ description: "A page of a record's history, newest first." });
6911
- var collectionRecordRestoreRequest = import_zod29.z.object({
6912
- seq: import_zod29.z.number().int().positive().meta({ description: "Put the record back to its state after this revision. Leave it out to restore a deleted record." }).optional()
7014
+ var collectionRecordRestoreRequest = import_zod30.z.object({
7015
+ seq: import_zod30.z.number().int().positive().meta({ description: "Put the record back to its state after this revision. Leave it out to restore a deleted record." }).optional()
6913
7016
  }).strict().meta({ description: "The body of a record restore." });
6914
- var collectionSummary = import_zod29.z.object({
7017
+ var collectionSummary = import_zod30.z.object({
6915
7018
  key: collectionKey,
6916
- label: import_zod29.z.string(),
7019
+ label: import_zod30.z.string(),
6917
7020
  binding: collectionBinding,
6918
7021
  records: count3.meta({ description: "Records the collection holds now." }),
6919
7022
  fields: count3,
6920
- read_roles: import_zod29.z.array(import_zod29.z.string()).meta({ description: "The roles that may read the records." }),
6921
- warnings: import_zod29.z.array(import_zod29.z.enum(["no_role_access", "history_growing", "unknown_role"])).meta({
7023
+ read_roles: import_zod30.z.array(import_zod30.z.string()).meta({ description: "The roles that may read the records." }),
7024
+ warnings: import_zod30.z.array(import_zod30.z.enum(["no_role_access", "history_growing", "unknown_role"])).meta({
6922
7025
  description: "`no_role_access`: no role may read these records. `unknown_role`: `access` names a role the organization does not have. `history_growing`: the history is far larger than the records, which often means a client writing in a loop."
6923
7026
  }),
6924
7027
  revisions: count3.meta({ description: "Entries in the history of all the collection's records." }),
6925
7028
  history_bytes: count3.meta({ description: "The size of that history in bytes." }),
6926
7029
  updated_at: timestamp.nullable().meta({ description: "When a record of the collection last changed. Null if it never held one." })
6927
7030
  }).meta({ description: "A collection as the developer's overview shows it." });
6928
- var collectionListResponse = import_zod29.z.object({
7031
+ var collectionListResponse = import_zod30.z.object({
6929
7032
  version: schemaVersion.nullable().meta({ description: "The published schema version. Null before anything was published." }),
6930
- collections: import_zod29.z.array(collectionSummary)
7033
+ collections: import_zod30.z.array(collectionSummary)
6931
7034
  }).meta({ description: "The collections of an app." });
6932
- var collectionCan = import_zod29.z.object({
6933
- read: import_zod29.z.boolean(),
6934
- create: import_zod29.z.boolean(),
6935
- update: import_zod29.z.union([import_zod29.z.enum(["all", "own"]), import_zod29.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." }),
6936
- delete: import_zod29.z.union([import_zod29.z.enum(["all", "own"]), import_zod29.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." })
7035
+ var collectionCan = import_zod30.z.object({
7036
+ read: import_zod30.z.boolean(),
7037
+ create: import_zod30.z.boolean(),
7038
+ update: import_zod30.z.union([import_zod30.z.enum(["all", "own"]), import_zod30.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." }),
7039
+ delete: import_zod30.z.union([import_zod30.z.enum(["all", "own"]), import_zod30.z.literal(false)]).meta({ description: "`all`: any record. `own`: only records the caller created. `false`: none." })
6937
7040
  }).meta({ description: "What the caller may do with the records of this collection." });
6938
- var collectionDefinitionsResponse = import_zod29.z.object({
7041
+ var collectionDefinitionsResponse = import_zod30.z.object({
6939
7042
  version: schemaVersion.nullable().meta({ description: "The published schema version. Null before anything was published." }),
6940
- collections: import_zod29.z.array(import_zod29.z.object({
7043
+ collections: import_zod30.z.array(import_zod30.z.object({
6941
7044
  key: collectionKey,
6942
- label: import_zod29.z.string(),
6943
- description: import_zod29.z.string(),
7045
+ label: import_zod30.z.string(),
7046
+ description: import_zod30.z.string(),
6944
7047
  binding: collectionBinding,
6945
- display: import_zod29.z.string().meta({ description: "The template that names a record of this collection." }),
6946
- fields: import_zod29.z.record(collectionKey, collectionField),
7048
+ display: import_zod30.z.string().meta({ description: "The template that names a record of this collection." }),
7049
+ fields: import_zod30.z.record(collectionKey, collectionField),
6947
7050
  can: collectionCan
6948
7051
  }))
6949
7052
  }).meta({ description: "The collections the caller may read, with their field definitions and the caller's rights." });
6950
7053
 
6951
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/realtime.js
6952
- var clientAuth = import_zod30.z.object({
6953
- type: import_zod30.z.literal("auth"),
6954
- token: import_zod30.z.string().min(1)
7054
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/realtime.js
7055
+ var clientAuth = import_zod31.z.object({
7056
+ type: import_zod31.z.literal("auth"),
7057
+ token: import_zod31.z.string().min(1)
6955
7058
  });
6956
- var authOk = import_zod30.z.object({
6957
- type: import_zod30.z.literal("auth_ok"),
7059
+ var authOk = import_zod31.z.object({
7060
+ type: import_zod31.z.literal("auth_ok"),
6958
7061
  identity: clientIdentity
6959
7062
  });
6960
- var authError = import_zod30.z.object({
6961
- type: import_zod30.z.literal("auth_error"),
6962
- code: import_zod30.z.string().min(1),
6963
- message: import_zod30.z.string().min(1)
7063
+ var authError = import_zod31.z.object({
7064
+ type: import_zod31.z.literal("auth_error"),
7065
+ code: import_zod31.z.string().min(1),
7066
+ message: import_zod31.z.string().min(1)
6964
7067
  });
6965
- var clientInvoke = import_zod30.z.object({
6966
- type: import_zod30.z.literal("invoke"),
6967
- request_id: import_zod30.z.string().min(1).max(64),
6968
- robot_id: import_zod30.z.uuid(),
7068
+ var clientInvoke = import_zod31.z.object({
7069
+ type: import_zod31.z.literal("invoke"),
7070
+ request_id: import_zod31.z.string().min(1).max(64),
7071
+ robot_id: import_zod31.z.uuid(),
6969
7072
  slug,
6970
7073
  /** Parameters by field path, validated against the configuration's rules. */
6971
- params: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()),
7074
+ params: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown()),
6972
7075
  /**
6973
7076
  * How long this one call is worth waiting for — the same field, meaning and
6974
7077
  * cap as `invokeRequest.patience_ms`; absent means `DEFAULT_PATIENCE_MS`.
@@ -6978,12 +7081,12 @@ var clientInvoke = import_zod30.z.object({
6978
7081
  * unreachable to every caller that invokes over the realtime channel, while
6979
7082
  * still appearing in the documentation.
6980
7083
  */
6981
- patience_ms: import_zod30.z.number().int().min(MIN_PATIENCE_MS).max(MAX_PATIENCE_MS).optional()
7084
+ patience_ms: import_zod31.z.number().int().min(MIN_PATIENCE_MS).max(MAX_PATIENCE_MS).optional()
6982
7085
  });
6983
- var clientCancel = import_zod30.z.object({
6984
- type: import_zod30.z.literal("cancel"),
6985
- request_id: import_zod30.z.string().min(1).max(64),
6986
- robot_id: import_zod30.z.uuid(),
7086
+ var clientCancel = import_zod31.z.object({
7087
+ type: import_zod31.z.literal("cancel"),
7088
+ request_id: import_zod31.z.string().min(1).max(64),
7089
+ robot_id: import_zod31.z.uuid(),
6987
7090
  /** Which slug — required, and the coarse address of a cancel. */
6988
7091
  slug,
6989
7092
  /**
@@ -7001,19 +7104,19 @@ var clientCancel = import_zod30.z.object({
7001
7104
  * back to the slug. Falling back would be the platform deciding that the
7002
7105
  * caller did not really mean the id they typed.
7003
7106
  */
7004
- job_id: import_zod30.z.uuid().nullable()
7107
+ job_id: import_zod31.z.uuid().nullable()
7005
7108
  });
7006
- var clientPublish = import_zod30.z.object({
7007
- type: import_zod30.z.literal("publish"),
7008
- request_id: import_zod30.z.string().min(1).max(64),
7009
- robot_id: import_zod30.z.uuid(),
7109
+ var clientPublish = import_zod31.z.object({
7110
+ type: import_zod31.z.literal("publish"),
7111
+ request_id: import_zod31.z.string().min(1).max(64),
7112
+ robot_id: import_zod31.z.uuid(),
7010
7113
  slug,
7011
- message: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown())
7114
+ message: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown())
7012
7115
  });
7013
- var commandResult = import_zod30.z.object({
7014
- type: import_zod30.z.literal("command_result"),
7015
- request_id: import_zod30.z.string().min(1).max(64),
7016
- ok: import_zod30.z.boolean(),
7116
+ var commandResult = import_zod31.z.object({
7117
+ type: import_zod31.z.literal("command_result"),
7118
+ request_id: import_zod31.z.string().min(1).max(64),
7119
+ ok: import_zod31.z.boolean(),
7017
7120
  /**
7018
7121
  * The job this reply is *about* — which is not always the caller's own.
7019
7122
  *
@@ -7037,9 +7140,9 @@ var commandResult = import_zod30.z.object({
7037
7140
  * later. Returning the kind lets a client refuse its own mistake at once,
7038
7141
  * instead of reporting it as the machine's.
7039
7142
  */
7040
- kind: import_zod30.z.enum(["datapoint", "action", "service", "publisher", "camera"]).nullable(),
7041
- code: import_zod30.z.string().nullable(),
7042
- message: import_zod30.z.string().nullable(),
7143
+ kind: import_zod31.z.enum(["datapoint", "action", "service", "publisher", "camera"]).nullable(),
7144
+ code: import_zod31.z.string().nullable(),
7145
+ message: import_zod31.z.string().nullable(),
7043
7146
  /**
7044
7147
  * The same payload the REST envelope carries in `apiError.details` — for
7045
7148
  * `parameter_invalid`, a `parameterInvalidDetails`.
@@ -7050,16 +7153,16 @@ var commandResult = import_zod30.z.object({
7050
7153
  * socket. A client cannot bind an error to the input that caused it from a
7051
7154
  * code alone, which is the entire point of the flat parameter shape.
7052
7155
  */
7053
- details: import_zod30.z.unknown().optional()
7156
+ details: import_zod31.z.unknown().optional()
7054
7157
  });
7055
- var errorFrame = import_zod30.z.object({
7056
- type: import_zod30.z.literal("error"),
7057
- code: import_zod30.z.string().min(1),
7058
- message: import_zod30.z.string().min(1)
7158
+ var errorFrame = import_zod31.z.object({
7159
+ type: import_zod31.z.literal("error"),
7160
+ code: import_zod31.z.string().min(1),
7161
+ message: import_zod31.z.string().min(1)
7059
7162
  });
7060
- var clientSubscribe = import_zod30.z.object({
7061
- type: import_zod30.z.literal("subscribe"),
7062
- robot_id: import_zod30.z.uuid(),
7163
+ var clientSubscribe = import_zod31.z.object({
7164
+ type: import_zod31.z.literal("subscribe"),
7165
+ robot_id: import_zod31.z.uuid(),
7063
7166
  slug,
7064
7167
  /**
7065
7168
  * What the subscriber expects, and how it wants it.
@@ -7079,35 +7182,45 @@ var clientSubscribe = import_zod30.z.object({
7079
7182
  * request was the same mistake as the silent wrong-verb subscribe this
7080
7183
  * field was added to fix.
7081
7184
  */
7082
- kind: import_zod30.z.enum(["datapoint", "action", "service", "publisher", "camera"]).optional(),
7083
- options: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.unknown()).optional()
7185
+ kind: import_zod31.z.enum(["datapoint", "action", "service", "publisher", "camera"]).optional(),
7186
+ options: import_zod31.z.record(import_zod31.z.string(), import_zod31.z.unknown()).optional()
7084
7187
  });
7085
- var clientUnsubscribe = import_zod30.z.object({
7086
- type: import_zod30.z.literal("unsubscribe"),
7087
- robot_id: import_zod30.z.uuid(),
7188
+ var clientUnsubscribe = import_zod31.z.object({
7189
+ type: import_zod31.z.literal("unsubscribe"),
7190
+ robot_id: import_zod31.z.uuid(),
7088
7191
  slug
7089
7192
  });
7090
- var subscribeError = import_zod30.z.object({
7091
- type: import_zod30.z.literal("subscribe_error"),
7092
- robot_id: import_zod30.z.string(),
7093
- slug: import_zod30.z.string(),
7094
- code: import_zod30.z.string().min(1),
7095
- message: import_zod30.z.string().min(1)
7193
+ var subscribeError = import_zod31.z.object({
7194
+ type: import_zod31.z.literal("subscribe_error"),
7195
+ robot_id: import_zod31.z.string(),
7196
+ slug: import_zod31.z.string(),
7197
+ code: import_zod31.z.string().min(1),
7198
+ message: import_zod31.z.string().min(1)
7096
7199
  });
7097
- var datapointEvent = import_zod30.z.object({
7098
- type: import_zod30.z.literal("datapoint"),
7099
- robot_id: import_zod30.z.uuid(),
7200
+ var datapointEvent = import_zod31.z.object({
7201
+ type: import_zod31.z.literal("datapoint"),
7202
+ robot_id: import_zod31.z.uuid(),
7100
7203
  slug,
7101
- value: import_zod30.z.unknown(),
7102
- timestamp_ms: import_zod30.z.number().int().nonnegative()
7204
+ value: import_zod31.z.unknown(),
7205
+ timestamp_ms: import_zod31.z.number().int().nonnegative()
7103
7206
  });
7104
- var liveSessionEndReason = import_zod30.z.enum([
7207
+ var liveSessionEndReason = import_zod31.z.enum([
7105
7208
  /** Another holder of this camera released it — another tab, or another client. */
7106
7209
  "released_by_peer",
7107
7210
  /** The robot's configuration was published and this camera changed with it. */
7108
7211
  "config_changed",
7109
- /** The robot said it could not publish. `detail` carries its own words. */
7212
+ /**
7213
+ * The robot said publishing died after it had started. `detail` is `null`:
7214
+ * the robot's own words never travel here (see `detail`).
7215
+ */
7110
7216
  "publish_failed",
7217
+ /**
7218
+ * The robot refused to start this camera's live video: the first start,
7219
+ * or the restart after a bridge reconnect (fleetless/fleetless#1126).
7220
+ * Distinct from `publish_failed`, which means a running stream stopped. `detail` is the
7221
+ * cloud's fixed sentence for the refusal and `refusal` names its class.
7222
+ */
7223
+ "start_refused",
7111
7224
  /** The bridge stopped answering. */
7112
7225
  "robot_offline",
7113
7226
  /** The grant this session was minted under was withdrawn. */
@@ -7130,12 +7243,12 @@ var liveSessionEndReason = import_zod30.z.enum([
7130
7243
  */
7131
7244
  "unknown"
7132
7245
  ]);
7133
- var liveSessionEvent = import_zod30.z.object({
7134
- type: import_zod30.z.literal("live_session"),
7135
- robot_id: import_zod30.z.uuid(),
7246
+ var liveSessionEvent = import_zod31.z.object({
7247
+ type: import_zod31.z.literal("live_session"),
7248
+ robot_id: import_zod31.z.uuid(),
7136
7249
  slug,
7137
- session_id: import_zod30.z.uuid(),
7138
- state: import_zod30.z.literal("ended"),
7250
+ session_id: import_zod31.z.uuid(),
7251
+ state: import_zod31.z.literal("ended"),
7139
7252
  reason: liveSessionEndReason,
7140
7253
  /**
7141
7254
  * **Classified text the cloud produced, never text the robot sent.**
@@ -7150,47 +7263,53 @@ var liveSessionEvent = import_zod30.z.object({
7150
7263
  * code with fixed text, the way camera health already does it — not as
7151
7264
  * forwarded foreign text on a channel a client reads.
7152
7265
  */
7153
- detail: import_zod30.z.string().max(200).nullable(),
7266
+ detail: import_zod31.z.string().max(200).nullable(),
7267
+ /**
7268
+ * Why the robot refused the start, as a class: set with `reason:
7269
+ * 'start_refused'` (fleetless/fleetless#1126), absent or `null` for every
7270
+ * other reason. `detail` carries the matching sentence.
7271
+ */
7272
+ refusal: liveStartRefusal.nullable().optional(),
7154
7273
  /** When it ended — not when this frame was sent. Same reasoning as `changed_at_ms`. */
7155
- ended_at_ms: import_zod30.z.number().int().nonnegative()
7156
- });
7157
- var resourceHealthCleared = import_zod30.z.object({
7158
- type: import_zod30.z.literal("resource_health_cleared"),
7159
- robot_id: import_zod30.z.uuid(),
7160
- kind: import_zod30.z.enum(["camera"]),
7161
- ref: import_zod30.z.string().min(1).max(64),
7162
- facet: import_zod30.z.enum(["source", "publish"]),
7163
- cleared_at_ms: import_zod30.z.number().int().nonnegative()
7164
- });
7165
- var resourceHealthEvent = import_zod30.z.object({
7166
- type: import_zod30.z.literal("resource_health"),
7167
- robot_id: import_zod30.z.uuid(),
7168
- kind: import_zod30.z.enum(["camera"]),
7169
- ref: import_zod30.z.string().min(1).max(64),
7274
+ ended_at_ms: import_zod31.z.number().int().nonnegative()
7275
+ });
7276
+ var resourceHealthCleared = import_zod31.z.object({
7277
+ type: import_zod31.z.literal("resource_health_cleared"),
7278
+ robot_id: import_zod31.z.uuid(),
7279
+ kind: import_zod31.z.enum(RESOURCE_HEALTH_KINDS),
7280
+ ref: import_zod31.z.string().min(1).max(64),
7281
+ facet: import_zod31.z.enum(["source", "publish"]),
7282
+ cleared_at_ms: import_zod31.z.number().int().nonnegative()
7283
+ });
7284
+ var resourceHealthEvent = import_zod31.z.object({
7285
+ type: import_zod31.z.literal("resource_health"),
7286
+ robot_id: import_zod31.z.uuid(),
7287
+ kind: import_zod31.z.enum(RESOURCE_HEALTH_KINDS),
7288
+ ref: import_zod31.z.string().min(1).max(64),
7170
7289
  /** Which of the two questions this entry answers — see `resourceHealthState.facet`. */
7171
- facet: import_zod30.z.enum(["source", "publish"]),
7172
- state: import_zod30.z.enum(RESOURCE_HEALTH_STATES),
7173
- reason: import_zod30.z.string().max(200).nullable(),
7174
- changed_at_ms: import_zod30.z.number().int().nonnegative()
7290
+ facet: import_zod31.z.enum(["source", "publish"]),
7291
+ state: import_zod31.z.enum(RESOURCE_HEALTH_STATES),
7292
+ reason: import_zod31.z.string().max(200).nullable(),
7293
+ changed_at_ms: import_zod31.z.number().int().nonnegative()
7175
7294
  });
7176
7295
  var ORG_EVENT_BUFFER_SIZE = 200;
7177
- var orgEventKind = import_zod30.z.enum(["datapoint", "health", "job", "bridge", "audit", "alert"]);
7178
- var orgEventSeverity = import_zod30.z.enum(["info", "warning", "error"]);
7179
- var orgEvent = import_zod30.z.object({
7180
- type: import_zod30.z.literal("org_event"),
7296
+ var orgEventKind = import_zod31.z.enum(["datapoint", "health", "job", "bridge", "audit", "alert"]);
7297
+ var orgEventSeverity = import_zod31.z.enum(["info", "warning", "error"]);
7298
+ var orgEvent = import_zod31.z.object({
7299
+ type: import_zod31.z.literal("org_event"),
7181
7300
  /**
7182
7301
  * **Per org, per process.** Like `job.seq` and unlike `job_runs.seq`, which
7183
7302
  * is a postgres `bigserial` and durable. All three say which they are,
7184
7303
  * because anyone who confuses them will confuse them in both directions.
7185
7304
  */
7186
- seq: import_zod30.z.number().int().positive(),
7187
- at: import_zod30.z.iso.datetime(),
7305
+ seq: import_zod31.z.number().int().positive(),
7306
+ at: import_zod31.z.iso.datetime(),
7188
7307
  kind: orgEventKind,
7189
7308
  severity: orgEventSeverity,
7190
7309
  /** `null` for an org-level event — an invitation, a quota change — which belongs to no robot. */
7191
- robot_id: import_zod30.z.uuid().nullable(),
7310
+ robot_id: import_zod31.z.uuid().nullable(),
7192
7311
  /** What the line is about: a slug, a camera, an actor's email. */
7193
- subject: import_zod30.z.string().min(1).max(200),
7312
+ subject: import_zod31.z.string().min(1).max(200),
7194
7313
  /**
7195
7314
  * Kind-specific, and **capped at `ORG_EVENT_DETAIL_MAX_BYTES`** — above it
7196
7315
  * the producer substitutes `{ omitted: 'too_large', bytes }`. Truncated,
@@ -7199,13 +7318,13 @@ var orgEvent = import_zod30.z.object({
7199
7318
  * Never a pre-formatted line: the reader decides language, number format
7200
7319
  * and truncation, so changing how a line reads is not a cloud deploy.
7201
7320
  */
7202
- detail: import_zod30.z.unknown().nullable()
7321
+ detail: import_zod31.z.unknown().nullable()
7203
7322
  }).strict();
7204
- var orgEventSubscribe = import_zod30.z.object({ type: import_zod30.z.literal("org_event_subscribe") }).strict();
7205
- var orgEventUnsubscribe = import_zod30.z.object({ type: import_zod30.z.literal("org_event_unsubscribe") }).strict();
7206
- var orgEventReplay = import_zod30.z.object({
7207
- type: import_zod30.z.literal("org_event_replay"),
7208
- events: import_zod30.z.array(orgEvent).max(ORG_EVENT_BUFFER_SIZE),
7323
+ var orgEventSubscribe = import_zod31.z.object({ type: import_zod31.z.literal("org_event_subscribe") }).strict();
7324
+ var orgEventUnsubscribe = import_zod31.z.object({ type: import_zod31.z.literal("org_event_unsubscribe") }).strict();
7325
+ var orgEventReplay = import_zod31.z.object({
7326
+ type: import_zod31.z.literal("org_event_replay"),
7327
+ events: import_zod31.z.array(orgEvent).max(ORG_EVENT_BUFFER_SIZE),
7209
7328
  /**
7210
7329
  * **`false` means three different things, on purpose**: the buffer was
7211
7330
  * already full, the cloud restarted, or this org's buffer had expired. All
@@ -7213,10 +7332,10 @@ var orgEventReplay = import_zod30.z.object({
7213
7332
  * line* — and a field separating them would claim a distinction nobody
7214
7333
  * would act on differently.
7215
7334
  */
7216
- complete: import_zod30.z.boolean()
7335
+ complete: import_zod31.z.boolean()
7217
7336
  }).strict();
7218
- var orgEventDropped = import_zod30.z.object({
7219
- type: import_zod30.z.literal("org_event_dropped"),
7337
+ var orgEventDropped = import_zod31.z.object({
7338
+ type: import_zod31.z.literal("org_event_dropped"),
7220
7339
  /**
7221
7340
  * **An epoch instant in milliseconds (`Date.now()`), not a duration.**
7222
7341
  * The moment this socket last reported a drop — or the moment it
@@ -7227,75 +7346,75 @@ var orgEventDropped = import_zod30.z.object({
7227
7346
  * it as "milliseconds ago" renders a drop that happened seconds ago as
7228
7347
  * having happened in 1970.
7229
7348
  */
7230
- since_ms: import_zod30.z.number().int().nonnegative(),
7349
+ since_ms: import_zod31.z.number().int().nonnegative(),
7231
7350
  /** Always at least one — a frame reporting nothing lost is noise on a channel built to be quiet. */
7232
- dropped: import_zod30.z.number().int().positive()
7351
+ dropped: import_zod31.z.number().int().positive()
7233
7352
  }).strict();
7234
- var collectionRequestId = import_zod30.z.string().min(1).max(64).meta({
7353
+ var collectionRequestId = import_zod31.z.string().min(1).max(64).meta({
7235
7354
  description: "Chosen by the client, unique among the collection subscriptions open on this socket: a `request_id` that is already in use is refused with `validation_error`. Every frame about the subscription carries it."
7236
7355
  });
7237
- var collectionSubscribe = import_zod30.z.object({
7238
- type: import_zod30.z.literal("collection_subscribe"),
7356
+ var collectionSubscribe = import_zod31.z.object({
7357
+ type: import_zod31.z.literal("collection_subscribe"),
7239
7358
  request_id: collectionRequestId,
7240
- app_id: import_zod30.z.uuid().meta({
7359
+ app_id: import_zod31.z.uuid().meta({
7241
7360
  description: "The app whose collection to follow. Required on the connection of a developer, whose token belongs to the organization and so to no app: without it the subscribe is refused with `validation_error`. On the connection of an app user or a server key it can be left out, because the token names the app; if it is sent, it must be that app, otherwise `validation_error`. An app that does not exist or belongs to another organization is answered `collection_not_found`."
7242
7361
  }).optional(),
7243
7362
  collection: collectionKey.meta({ description: "The key of the collection." }),
7244
- robot_id: import_zod30.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional(),
7363
+ robot_id: import_zod31.z.uuid().meta({ description: "Only the records of this robot, in a collection that belongs to robots." }).optional(),
7245
7364
  filter: collectionFilter.meta({
7246
7365
  description: "Only records matching this filter are delivered, with the grammar of the `filter` of the record list but as an object, not JSON text. The whole frame is at most 16,384 bytes; a larger frame closes the socket with code 1009 (message too big) instead of being answered, so a filter with many long values may not fit."
7247
7366
  }).optional()
7248
7367
  }).strict().meta({
7249
7368
  description: "Subscribes to the changes of the records of one collection. The cloud answers an accepted subscription with `collection_subscribed` and a refused one with `collection_subscribe_error`."
7250
7369
  });
7251
- var collectionSubscribed = import_zod30.z.object({
7252
- type: import_zod30.z.literal("collection_subscribed"),
7370
+ var collectionSubscribed = import_zod31.z.object({
7371
+ type: import_zod31.z.literal("collection_subscribed"),
7253
7372
  request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription that is now registered." })
7254
7373
  }).strict().meta({ description: "A collection subscription is registered: every change it covers is delivered from now on." });
7255
- var collectionUnsubscribe = import_zod30.z.object({
7256
- type: import_zod30.z.literal("collection_unsubscribe"),
7374
+ var collectionUnsubscribe = import_zod31.z.object({
7375
+ type: import_zod31.z.literal("collection_unsubscribe"),
7257
7376
  request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription to end." })
7258
7377
  }).strict().meta({ description: "Ends a collection subscription." });
7259
- var collectionEvent = import_zod30.z.object({
7260
- type: import_zod30.z.literal("collection_event"),
7378
+ var collectionEvent = import_zod31.z.object({
7379
+ type: import_zod31.z.literal("collection_event"),
7261
7380
  request_id: collectionRequestId.meta({ description: "The `request_id` of the subscription the event belongs to." }),
7262
- event: import_zod30.z.enum(["created", "updated", "deleted", "removed", "entered"]).meta({
7381
+ event: import_zod31.z.enum(["created", "updated", "deleted", "removed", "entered"]).meta({
7263
7382
  description: "`created`, `updated` and `deleted`: the record was written. `removed`: the record left the view of this subscription without being deleted, because its values no longer match the filter, the role lost the right to read it or its robot was detached. `entered`: the record came into view the same way."
7264
7383
  }),
7265
- id: import_zod30.z.uuid().meta({ description: "The id of the record." }),
7384
+ id: import_zod31.z.uuid().meta({ description: "The id of the record." }),
7266
7385
  record: collectionRecord.meta({
7267
7386
  description: "The record: as it is now for `created`, `updated`, `entered` and `removed`, and as it was for `deleted`. Absent only on a `removed` event for a record the subscriber may no longer read, so that its values are not told: that is the case when the robot of the record was detached, or when the role lost the right to read the collection."
7268
7387
  }).optional()
7269
7388
  }).strict().meta({ description: "A record came into view, changed or went away." });
7270
- var collectionSubscribeError = import_zod30.z.object({
7271
- type: import_zod30.z.literal("collection_subscribe_error"),
7272
- request_id: import_zod30.z.string().meta({ description: "The `request_id` of the subscription, as the client sent it." }),
7273
- code: import_zod30.z.string().min(1).meta({ description: "A stable error code, as in REST; `unauthorized` is also possible here, for a subscribe sent before `auth`." }),
7274
- message: import_zod30.z.string().min(1)
7389
+ var collectionSubscribeError = import_zod31.z.object({
7390
+ type: import_zod31.z.literal("collection_subscribe_error"),
7391
+ request_id: import_zod31.z.string().meta({ description: "The `request_id` of the subscription, as the client sent it." }),
7392
+ code: import_zod31.z.string().min(1).meta({ description: "A stable error code, as in REST; `unauthorized` is also possible here, for a subscribe sent before `auth`." }),
7393
+ message: import_zod31.z.string().min(1)
7275
7394
  }).strict().meta({ description: "A collection subscription was refused or has ended." });
7276
- var collectionsSchemaPublished = import_zod30.z.object({
7277
- type: import_zod30.z.literal("collections_schema_published"),
7278
- version: import_zod30.z.number().int().min(1).meta({ description: "The version that is in force now." })
7395
+ var collectionsSchemaPublished = import_zod31.z.object({
7396
+ type: import_zod31.z.literal("collections_schema_published"),
7397
+ version: import_zod31.z.number().int().min(1).meta({ description: "The version that is in force now." })
7279
7398
  }).strict().meta({ description: "A new schema version is in force for the app." });
7280
7399
 
7281
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/feedback.js
7282
- var import_zod31 = require("zod");
7400
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/feedback.js
7401
+ var import_zod32 = require("zod");
7283
7402
  var FEEDBACK_KINDS = ["idea", "problem", "question", "other"];
7284
- var feedbackKind = import_zod31.z.enum(FEEDBACK_KINDS);
7403
+ var feedbackKind = import_zod32.z.enum(FEEDBACK_KINDS);
7285
7404
  var FEEDBACK_MESSAGE_MAX = 5e3;
7286
- var feedbackRequest = import_zod31.z.object({
7405
+ var feedbackRequest = import_zod32.z.object({
7287
7406
  kind: feedbackKind.meta({
7288
7407
  description: "What the message is: an `idea`, a `problem`, a `question` or `other`. It only sorts the inbox; it changes nothing about how the message is handled."
7289
7408
  }),
7290
- message: import_zod31.z.string().trim().min(1).max(FEEDBACK_MESSAGE_MAX).meta({
7409
+ message: import_zod32.z.string().trim().min(1).max(FEEDBACK_MESSAGE_MAX).meta({
7291
7410
  description: "What the developer wrote, trimmed. At most 5000 characters; a message that is only whitespace is refused."
7292
7411
  }),
7293
- page: import_zod31.z.string().startsWith("/").max(512).meta({
7412
+ page: import_zod32.z.string().startsWith("/").max(512).meta({
7294
7413
  description: "The console path the message was sent from, e.g. `/robots/:id/jobs` with its real id. A path, never a full URL, so no host and no query string reach the inbox by accident."
7295
7414
  })
7296
7415
  }).strict();
7297
- var feedbackResponse = import_zod31.z.object({
7298
- id: import_zod31.z.uuid().meta({
7416
+ var feedbackResponse = import_zod32.z.object({
7417
+ id: import_zod32.z.uuid().meta({
7299
7418
  description: "The stored message. It exists whatever `mail` says."
7300
7419
  }),
7301
7420
  mail: mailStatus.meta({
@@ -7303,91 +7422,91 @@ var feedbackResponse = import_zod31.z.object({
7303
7422
  })
7304
7423
  }).strict();
7305
7424
 
7306
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/support.js
7307
- var import_zod32 = require("zod");
7308
- var supportSessionInfo = import_zod32.z.object({
7309
- session_id: import_zod32.z.uuid().meta({
7425
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/support.js
7426
+ var import_zod33 = require("zod");
7427
+ var supportSessionInfo = import_zod33.z.object({
7428
+ session_id: import_zod33.z.uuid().meta({
7310
7429
  description: "The support session this token or response describes. Stable for the life of the session."
7311
7430
  }),
7312
- mode: import_zod32.z.enum(["read", "edit"]).meta({
7431
+ mode: import_zod33.z.enum(["read", "edit"]).meta({
7313
7432
  description: "The session's current mode. Every support session starts `read`; an operator-admin switches one session into `edit`, never the other way, and the switch is a one-way door for the life of the session."
7314
7433
  }),
7315
- operator_name: import_zod32.z.string().min(1).max(200).meta({
7434
+ operator_name: import_zod33.z.string().min(1).max(200).meta({
7316
7435
  description: "The name of the operator-admin holding this session, for the console banner the operator-admin sees. Only the operator-admin's own console receives it; the customer's audit names every edit as Fleetless-Support, never this name."
7317
7436
  }),
7318
- expires_at: import_zod32.z.iso.datetime().meta({
7437
+ expires_at: import_zod33.z.iso.datetime().meta({
7319
7438
  description: "When the session stops being usable regardless of activity, as an ISO 8601 timestamp. A support session has a hard ceiling; nothing extends it past this instant."
7320
7439
  })
7321
7440
  }).strict();
7322
- var supportTokenRequest = import_zod32.z.object({
7323
- grant: import_zod32.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
7441
+ var supportTokenRequest = import_zod33.z.object({
7442
+ grant: import_zod33.z.string().regex(/^[A-Za-z0-9_-]{43}$/).meta({
7324
7443
  description: "The one-time grant minted when the support session was started: 32 random bytes, base64url, no padding. Consumed atomically by this exchange \u2014 presenting it again answers the same refusal a forged one would."
7325
7444
  }),
7326
- code_verifier: import_zod32.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
7445
+ code_verifier: import_zod33.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
7327
7446
  description: "The PKCE verifier whose `S256` hash was sent as the grant's challenge when the session was started. Between 43 and 128 unreserved characters, RFC 7636 \xA74.1's charset \u2014 the same shape `oauthCodeTokenRequest.code_verifier` checks, compared rather than parsed."
7328
7447
  })
7329
7448
  }).strict();
7330
- var supportTokenResponse = import_zod32.z.object({
7331
- access_token: import_zod32.z.string().min(1).meta({
7449
+ var supportTokenResponse = import_zod33.z.object({
7450
+ access_token: import_zod33.z.string().min(1).meta({
7332
7451
  description: "The token to send as `Authorization: Bearer <token>`. Short-lived: read `expires_in`, never assume a lifetime."
7333
7452
  }),
7334
- token_type: import_zod32.z.literal("Bearer").meta({
7453
+ token_type: import_zod33.z.literal("Bearer").meta({
7335
7454
  description: "`Bearer`, the same spelling every other session token on this wire uses."
7336
7455
  }),
7337
- expires_in: import_zod32.z.number().int().min(1).max(3600).meta({
7456
+ expires_in: import_zod33.z.number().int().min(1).max(3600).meta({
7338
7457
  description: "How long the access token stays valid, in seconds from now \u2014 at most 3600 (sixty minutes), the hard ceiling of any support session. Not a timestamp, and not milliseconds."
7339
7458
  }),
7340
- org_id: import_zod32.z.uuid().meta({
7459
+ org_id: import_zod33.z.uuid().meta({
7341
7460
  description: "The organisation this session was scoped to when the grant was minted."
7342
7461
  }),
7343
7462
  support: supportSessionInfo.meta({
7344
7463
  description: "The session as it stands at the moment of exchange: freshly started, in `read` mode."
7345
7464
  })
7346
7465
  }).strict();
7347
- var supportRenewFailRequest = import_zod32.z.object({
7348
- flow_id: import_zod32.z.uuid().meta({ description: "The pending Cloud renewal flow created with the original support bearer." }),
7349
- code_verifier: import_zod32.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
7466
+ var supportRenewFailRequest = import_zod33.z.object({
7467
+ flow_id: import_zod33.z.uuid().meta({ description: "The pending Cloud renewal flow created with the original support bearer." }),
7468
+ code_verifier: import_zod33.z.string().regex(/^[A-Za-z0-9._~-]{43,128}$/).meta({
7350
7469
  description: "The server-held RFC 7636 verifier matching the flow's S256 challenge; never sent to the browser."
7351
7470
  }),
7352
- reason: import_zod32.z.literal("authority_failed").meta({ description: "A fixed category; browser and IdP error text is not forwarded." })
7471
+ reason: import_zod33.z.literal("authority_failed").meta({ description: "A fixed category; browser and IdP error text is not forwarded." })
7353
7472
  }).strict();
7354
- var supportRenewFailRefusal = import_zod32.z.union([
7355
- import_zod32.z.object({ code: import_zod32.z.literal("validation_error"), message: import_zod32.z.string().min(1), details: import_zod32.z.object({ rule: import_zod32.z.literal("invalid_flow") }).strict() }).strict(),
7356
- import_zod32.z.object({ code: import_zod32.z.literal("unauthorized"), message: import_zod32.z.string().min(1), details: import_zod32.z.object({ rule: import_zod32.z.literal("invalid_authority") }).strict() }).strict(),
7357
- import_zod32.z.object({ code: import_zod32.z.literal("not_found"), message: import_zod32.z.string().min(1), details: import_zod32.z.object({ rule: import_zod32.z.enum(["invalid_flow", "identity_mismatch"]) }).strict() }).strict(),
7358
- import_zod32.z.object({ code: import_zod32.z.literal("target_state_conflict"), message: import_zod32.z.string().min(1), details: import_zod32.z.object({ rule: import_zod32.z.enum(["expired", "replayed", "session_inactive", "stale_generation"]) }).strict() }).strict()
7473
+ var supportRenewFailRefusal = import_zod33.z.union([
7474
+ import_zod33.z.object({ code: import_zod33.z.literal("validation_error"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.literal("invalid_flow") }).strict() }).strict(),
7475
+ import_zod33.z.object({ code: import_zod33.z.literal("unauthorized"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.literal("invalid_authority") }).strict() }).strict(),
7476
+ import_zod33.z.object({ code: import_zod33.z.literal("not_found"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.enum(["invalid_flow", "identity_mismatch"]) }).strict() }).strict(),
7477
+ import_zod33.z.object({ code: import_zod33.z.literal("target_state_conflict"), message: import_zod33.z.string().min(1), details: import_zod33.z.object({ rule: import_zod33.z.enum(["expired", "replayed", "session_inactive", "stale_generation"]) }).strict() }).strict()
7359
7478
  ]);
7360
7479
  var authMeSupportResponse = authMeResponse.extend({ support: supportSessionInfo.optional() });
7361
7480
 
7362
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/client-robots.js
7363
- var import_zod33 = require("zod");
7364
- var clientRobotListItem = import_zod33.z.object({
7481
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/client-robots.js
7482
+ var import_zod34 = require("zod");
7483
+ var clientRobotListItem = import_zod34.z.object({
7365
7484
  ...robot2.shape,
7366
7485
  bridge_state: bridgeState.meta({
7367
7486
  description: "The built-in `bridge_state` datapoint as the cloud observes it right now: whether the bridge is connected, and its latency when it is."
7368
7487
  }),
7369
- published_version: import_zod33.z.number().int().positive().nullable().meta({
7488
+ published_version: import_zod34.z.number().int().positive().nullable().meta({
7370
7489
  description: 'The published configuration version, or `null` when nothing has been published yet. A robot with nothing published is still listed \u2014 "not configured yet" is a real state, and the caller is entitled to it \u2014 and its datasheet answers an empty exposure list.'
7371
7490
  })
7372
7491
  });
7373
- var clientRobotListResponse = import_zod33.z.object({
7374
- robots: import_zod33.z.array(clientRobotListItem).meta({
7492
+ var clientRobotListResponse = import_zod34.z.object({
7493
+ robots: import_zod34.z.array(clientRobotListItem).meta({
7375
7494
  description: "Every robot the caller reaches, in name order with the id as the tiebreak. An app user reaches the robots their app attaches on which their role grants at least one slug or capability; a server key reaches every robot its app attaches; a developer reaches every robot of the organisation."
7376
7495
  })
7377
7496
  });
7378
7497
 
7379
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/legal-acceptances.js
7380
- var import_zod34 = require("zod");
7381
- var legalAcceptanceCursor = import_zod34.z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
7382
- var legalAcceptanceListQuery = import_zod34.z.object({
7383
- limit: import_zod34.z.union([import_zod34.z.string().regex(/^(?:0{0,2}[1-9]|0?[1-9][0-9]|100)$/), import_zod34.z.number().int().min(1).max(100)]).transform(Number).pipe(import_zod34.z.number().int().min(1).max(100)).optional(),
7498
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/legal-acceptances.js
7499
+ var import_zod35 = require("zod");
7500
+ var legalAcceptanceCursor = import_zod35.z.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
7501
+ var legalAcceptanceListQuery = import_zod35.z.object({
7502
+ limit: import_zod35.z.union([import_zod35.z.string().regex(/^(?:0{0,2}[1-9]|0?[1-9][0-9]|100)$/), import_zod35.z.number().int().min(1).max(100)]).transform(Number).pipe(import_zod35.z.number().int().min(1).max(100)).optional(),
7384
7503
  cursor: legalAcceptanceCursor.optional()
7385
7504
  }).strict();
7386
- var legalAcceptanceVersionRow = import_zod34.z.object({
7387
- id: import_zod34.z.uuid(),
7388
- context: import_zod34.z.enum(["registration", "invitation", "order", "existing_org", "amendment", "price_offer"]),
7389
- accepted_at: import_zod34.z.iso.datetime({ precision: 6 }),
7390
- text_id: import_zod34.z.string().min(1).max(80).regex(/\S/),
7505
+ var legalAcceptanceVersionRow = import_zod35.z.object({
7506
+ id: import_zod35.z.uuid(),
7507
+ context: import_zod35.z.enum(["registration", "invitation", "order", "existing_org", "amendment", "price_offer"]),
7508
+ accepted_at: import_zod35.z.iso.datetime({ precision: 6 }),
7509
+ text_id: import_zod35.z.string().min(1).max(80).regex(/\S/),
7391
7510
  terms: legalDocumentReference,
7392
7511
  dpa: legalDocumentReference.nullable()
7393
7512
  }).strict().superRefine((value, ctx) => {
@@ -7398,22 +7517,22 @@ var legalAcceptanceVersionRow = import_zod34.z.object({
7398
7517
  if: { properties: { context: { enum: ["amendment", "price_offer"] } }, required: ["context"] },
7399
7518
  then: { properties: { dpa: { type: "null" } }, required: ["dpa"] }
7400
7519
  }] });
7401
- var legalAcceptanceListResponse = import_zod34.z.object({
7402
- acceptances: import_zod34.z.array(legalAcceptanceVersionRow),
7520
+ var legalAcceptanceListResponse = import_zod35.z.object({
7521
+ acceptances: import_zod35.z.array(legalAcceptanceVersionRow),
7403
7522
  next_cursor: legalAcceptanceCursor.nullable()
7404
7523
  }).strict();
7405
7524
 
7406
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/audit.js
7407
- var import_zod35 = require("zod");
7408
- var auditActor = import_zod35.z.object({
7409
- kind: import_zod35.z.enum(["developer", "end_user", "app_user", "server_key", "bridge", "fleetless"]),
7410
- id: import_zod35.z.uuid(),
7411
- label: import_zod35.z.string().min(1).max(200)
7412
- });
7413
- var auditEvent = import_zod35.z.object({
7414
- id: import_zod35.z.uuid(),
7415
- org_id: import_zod35.z.uuid(),
7416
- at: import_zod35.z.iso.datetime(),
7525
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/audit.js
7526
+ var import_zod36 = require("zod");
7527
+ var auditActor = import_zod36.z.object({
7528
+ kind: import_zod36.z.enum(["developer", "end_user", "app_user", "server_key", "bridge", "fleetless"]),
7529
+ id: import_zod36.z.uuid(),
7530
+ label: import_zod36.z.string().min(1).max(200)
7531
+ });
7532
+ var auditEvent = import_zod36.z.object({
7533
+ id: import_zod36.z.uuid(),
7534
+ org_id: import_zod36.z.uuid(),
7535
+ at: import_zod36.z.iso.datetime(),
7417
7536
  /**
7418
7537
  * A monotonic counter, ascending in write order, unique across the log.
7419
7538
  *
@@ -7432,18 +7551,18 @@ var auditEvent = import_zod35.z.object({
7432
7551
  * Required, not optional: an event without a sequence cannot be ordered
7433
7552
  * against one that has it, and a log with two orderings has none.
7434
7553
  */
7435
- seq: import_zod35.z.number().int().positive(),
7554
+ seq: import_zod36.z.number().int().positive(),
7436
7555
  actor: auditActor,
7437
7556
  /** Stable dotted name, e.g. `app_user.login`, `config.published`. */
7438
- action: import_zod35.z.string().min(1).max(80),
7557
+ action: import_zod36.z.string().min(1).max(80),
7439
7558
  /**
7440
7559
  * What the action was about, if anything — a robot, an app, a user. Free
7441
7560
  * of ids the console cannot resolve: carry the label with it.
7442
7561
  */
7443
- target: import_zod35.z.object({
7444
- kind: import_zod35.z.string().min(1).max(40),
7445
- id: import_zod35.z.string().min(1),
7446
- label: import_zod35.z.string().min(1).max(200)
7562
+ target: import_zod36.z.object({
7563
+ kind: import_zod36.z.string().min(1).max(40),
7564
+ id: import_zod36.z.string().min(1),
7565
+ label: import_zod36.z.string().min(1).max(200)
7447
7566
  }).nullable(),
7448
7567
  /**
7449
7568
  * Action-specific extras.
@@ -7457,10 +7576,10 @@ var auditEvent = import_zod35.z.object({
7457
7576
  * So: never credentials, never tokens. That is a rule, not a guarantee the
7458
7577
  * schema enforces.
7459
7578
  */
7460
- details: import_zod35.z.record(import_zod35.z.string(), import_zod35.z.unknown()).nullable()
7579
+ details: import_zod36.z.record(import_zod36.z.string(), import_zod36.z.unknown()).nullable()
7461
7580
  });
7462
7581
  var auditTimestampMs = wireTimestampMs;
7463
- var auditQuery = import_zod35.z.object({
7582
+ var auditQuery = import_zod36.z.object({
7464
7583
  /** Only events with a smaller `seq` — the next, older page. */
7465
7584
  before_seq: wireSeqCursor.optional(),
7466
7585
  /**
@@ -7469,9 +7588,9 @@ var auditQuery = import_zod35.z.object({
7469
7588
  * coercion's result in either `io` direction, so the artifact would describe
7470
7589
  * a shape a query string can never carry.
7471
7590
  */
7472
- limit: import_zod35.z.union([import_zod35.z.string().regex(/^\d{1,4}$/), import_zod35.z.number().int()]).transform((v) => Number(v)).pipe(import_zod35.z.number().int().positive().max(500)).optional(),
7591
+ limit: import_zod36.z.union([import_zod36.z.string().regex(/^\d{1,4}$/), import_zod36.z.number().int()]).transform((v) => Number(v)).pipe(import_zod36.z.number().int().positive().max(500)).optional(),
7473
7592
  /** Exact action name, e.g. `config.published`. No prefix matching: a filter that matches more than it says is not one. */
7474
- action: import_zod35.z.string().min(1).max(80).optional(),
7593
+ action: import_zod36.z.string().min(1).max(80).optional(),
7475
7594
  /**
7476
7595
  * Everything under a dotted prefix, e.g. `server_key.` for all three
7477
7596
  * server-key actions.
@@ -7488,7 +7607,7 @@ var auditQuery = import_zod35.z.object({
7488
7607
  * happily. The cloud is the only enforcement point — the same residual
7489
7608
  * `orgLatencyQuery` and `orgUsageQuery` already name.
7490
7609
  */
7491
- action_prefix: import_zod35.z.string().min(1).max(80).optional(),
7610
+ action_prefix: import_zod36.z.string().min(1).max(80).optional(),
7492
7611
  /**
7493
7612
  * Only events by this actor.
7494
7613
  *
@@ -7500,9 +7619,9 @@ var auditQuery = import_zod35.z.object({
7500
7619
  * Not an injection question — the query is parameterised either way. It is a
7501
7620
  * **500 where a 400 belongs**, and a 500 is the answer that explains nothing.
7502
7621
  */
7503
- actor_id: import_zod35.z.uuid().optional(),
7622
+ actor_id: import_zod36.z.uuid().optional(),
7504
7623
  /** Only events about this kind of target, e.g. `robot`. */
7505
- target_kind: import_zod35.z.string().min(1).max(40).optional(),
7624
+ target_kind: import_zod36.z.string().min(1).max(40).optional(),
7506
7625
  /**
7507
7626
  * Only events about this target — and, for a robot, also the events that
7508
7627
  * name it in `details.robot_id`, so a robot's log includes what was
@@ -7512,7 +7631,7 @@ var auditQuery = import_zod35.z.object({
7512
7631
  * string in this contract and text in the cloud's table, so a uuid rule
7513
7632
  * here would refuse ids the log can hold, and no value can fail a cast.
7514
7633
  */
7515
- target_id: import_zod35.z.string().min(1).max(200).optional().meta({
7634
+ target_id: import_zod36.z.string().min(1).max(200).optional().meta({
7516
7635
  description: "Events whose target is this id; for a robot also the events that name it in `details.robot_id` (`action.invoked`, `service.called`, \u2026), so a robot's events include what was started on it."
7517
7636
  }),
7518
7637
  /**
@@ -7530,8 +7649,8 @@ var auditQuery = import_zod35.z.object({
7530
7649
  message: "action and action_prefix cannot be combined",
7531
7650
  path: ["action_prefix"]
7532
7651
  });
7533
- var auditListResponse = import_zod35.z.object({
7534
- events: import_zod35.z.array(auditEvent),
7652
+ var auditListResponse = import_zod36.z.object({
7653
+ events: import_zod36.z.array(auditEvent),
7535
7654
  /**
7536
7655
  * The `seq` a caller sends as `before_seq` to keep reading — or `null` when
7537
7656
  * there is nothing further.
@@ -7542,41 +7661,41 @@ var auditListResponse = import_zod35.z.object({
7542
7661
  * not mean *no more* here. The same distinction `historySamples` was given
7543
7662
  * `truncated` for.
7544
7663
  */
7545
- next_cursor: import_zod35.z.number().int().positive().nullable()
7664
+ next_cursor: import_zod36.z.number().int().positive().nullable()
7546
7665
  });
7547
7666
 
7548
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/errors.js
7549
- var import_zod36 = require("zod");
7550
- var apiError = import_zod36.z.object({
7551
- code: import_zod36.z.string().min(1),
7552
- message: import_zod36.z.string().min(1),
7553
- details: import_zod36.z.unknown().optional()
7667
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/errors.js
7668
+ var import_zod37 = require("zod");
7669
+ var apiError = import_zod37.z.object({
7670
+ code: import_zod37.z.string().min(1),
7671
+ message: import_zod37.z.string().min(1),
7672
+ details: import_zod37.z.unknown().optional()
7554
7673
  });
7555
- var parameterViolation = import_zod36.z.object({
7556
- field: import_zod36.z.string().min(1),
7674
+ var parameterViolation = import_zod37.z.object({
7675
+ field: import_zod37.z.string().min(1),
7557
7676
  /** Which rule failed — `min`, `max`, `enum`, `pattern`, `required`, `undeclared`. */
7558
- rule: import_zod36.z.string().min(1),
7559
- message: import_zod36.z.string().min(1)
7677
+ rule: import_zod37.z.string().min(1),
7678
+ message: import_zod37.z.string().min(1)
7560
7679
  });
7561
- var parameterInvalidDetails = import_zod36.z.object({
7562
- violations: import_zod36.z.array(parameterViolation).min(1)
7680
+ var parameterInvalidDetails = import_zod37.z.object({
7681
+ violations: import_zod37.z.array(parameterViolation).min(1)
7563
7682
  });
7564
- var cancelRejectedDetails = import_zod36.z.object({
7565
- goals: import_zod36.z.array(bridgeCancelResultEntry).min(1)
7683
+ var cancelRejectedDetails = import_zod37.z.object({
7684
+ goals: import_zod37.z.array(bridgeCancelResultEntry).min(1)
7566
7685
  });
7567
- var invalidCodeDetails = import_zod36.z.object({
7568
- attempts_left: import_zod36.z.number().int().min(0).meta({
7686
+ var invalidCodeDetails = import_zod37.z.object({
7687
+ attempts_left: import_zod37.z.number().int().min(0).meta({
7569
7688
  description: "How many more wrong codes this code or challenge takes before it is spent. `0` means the next attempt answers `410 token_spent`."
7570
7689
  })
7571
7690
  });
7572
- var planLimitDetails = import_zod36.z.object({
7691
+ var planLimitDetails = import_zod37.z.object({
7573
7692
  limit: planLimitKey.exclude(["history_days", "audit_days"]).meta({ description: "The limit the action would exceed." }),
7574
- used: import_zod36.z.number().int().nonnegative().meta({ description: "How much of the limit the org uses now." }),
7575
- max: import_zod36.z.number().int().nonnegative().meta({
7693
+ used: import_zod37.z.number().int().nonnegative().meta({ description: "How much of the limit the org uses now." }),
7694
+ max: import_zod37.z.number().int().nonnegative().meta({
7576
7695
  description: "The limit. For `asset_bytes_per_robot`, the org's whole pool: robots \xD7 the plan's bytes per robot."
7577
7696
  }),
7578
7697
  plan: planId.meta({ description: "The plan whose limit refused: the target plan while a move to a lower plan is pending." }),
7579
- lifted_by: import_zod36.z.object({
7698
+ lifted_by: import_zod37.z.object({
7580
7699
  plan: planId.nullable().meta({ description: "The cheapest higher plan that raises this limit, or `null` when none does." }),
7581
7700
  addon: addonKey.nullable().meta({
7582
7701
  description: "The add-on that raises this limit, when the org's plan can buy add-ons; otherwise `null`."
@@ -7592,59 +7711,59 @@ var assetPlanLimitDetails = planLimitDetails.extend({
7592
7711
  description: "Bytes the org's assets occupy, across every robot, before this upload."
7593
7712
  })
7594
7713
  });
7595
- var planRequiredDetails = import_zod36.z.object({
7714
+ var planRequiredDetails = import_zod37.z.object({
7596
7715
  feature: planFeature.meta({ description: "The feature the action needs." }),
7597
7716
  plan: planId.meta({ description: "The org's current plan." }),
7598
7717
  required_plan: planId.meta({ description: "The cheapest plan that has the feature." })
7599
7718
  });
7600
- var orgLockedDetails = import_zod36.z.object({
7601
- reason: import_zod36.z.enum(["payment", "migration"]).meta({
7719
+ var orgLockedDetails = import_zod37.z.object({
7720
+ reason: import_zod37.z.enum(["payment", "migration"]).meta({
7602
7721
  description: "`payment`: a payment is missing. `migration`: the org did not choose what stays when the beta ended."
7603
7722
  })
7604
7723
  });
7605
- var paymentProviderUnavailableDetails = import_zod36.z.object({
7606
- provider: import_zod36.z.literal("mollie").meta({ description: "The payment provider. Always `mollie` today." }),
7607
- status: import_zod36.z.number().int().nullable().meta({ description: "Mollie's own HTTP status, or `null` when the request timed out instead of answering." })
7724
+ var paymentProviderUnavailableDetails = import_zod37.z.object({
7725
+ provider: import_zod37.z.literal("mollie").meta({ description: "The payment provider. Always `mollie` today." }),
7726
+ status: import_zod37.z.number().int().nullable().meta({ description: "Mollie's own HTTP status, or `null` when the request timed out instead of answering." })
7608
7727
  });
7609
- var billingDocumentsUnavailableDetails = import_zod36.z.object({
7610
- reason: import_zod36.z.enum(["provider_unavailable", "rate_limited", "list_limit_exceeded", "list_changed", "unsupported_document", "profile_mismatch"]).meta({
7728
+ var billingDocumentsUnavailableDetails = import_zod37.z.object({
7729
+ reason: import_zod37.z.enum(["provider_unavailable", "rate_limited", "list_limit_exceeded", "list_changed", "unsupported_document", "profile_mismatch"]).meta({
7611
7730
  description: "Why Cloud refused rather than answering with a partial or unchecked document: `provider_unavailable` (Lexware did not answer or answered with an error), `rate_limited` (Lexware throttled the request; nothing was read), `list_limit_exceeded` (Lexware reports more than 10,000 documents for the org), `list_changed` (the document list changed while it was being paged, so no consistent list exists), `unsupported_document` (the detail or the file only: Lexware answered with an e-invoice profile or a file this cloud cannot present as the document), `profile_mismatch` (the Lexware account this cloud is configured with failed its account check, so every Lexware read stays closed)."
7612
7731
  })
7613
7732
  }).strict();
7614
- var confirmationRequiredDetails = import_zod36.z.object({
7615
- preview: import_zod36.z.unknown().meta({
7733
+ var confirmationRequiredDetails = import_zod37.z.object({
7734
+ preview: import_zod37.z.unknown().meta({
7616
7735
  description: "The current preview of the operation, with its `token`: a `collectionsSchemaPreview` for a publish, a `collectionsRestorePreview` for a restore, a `collectionsPurgePreview` for a purge and a `collectionImportPreview` for an import. Confirm it by sending that `token` as `confirm`. A publish that names a `source_sha256` which is not the saved draft's, because the draft was saved again since it was previewed, is refused the same way with a preview whose `token` can be `null` (no effects, nothing to confirm): read this preview, then publish again with its `source_sha256`, and with its `token` as `confirm` when it has one."
7617
7736
  })
7618
7737
  }).strict();
7619
- var recordReferencedDetails = import_zod36.z.object({
7620
- references: import_zod36.z.array(import_zod36.z.object({
7621
- collection: import_zod36.z.string().min(1).meta({ description: "The key of a collection that has records pointing at this one." }),
7622
- count: import_zod36.z.number().int().min(1).meta({ description: "How many records of that collection point at it." })
7738
+ var recordReferencedDetails = import_zod37.z.object({
7739
+ references: import_zod37.z.array(import_zod37.z.object({
7740
+ collection: import_zod37.z.string().min(1).meta({ description: "The key of a collection that has records pointing at this one." }),
7741
+ count: import_zod37.z.number().int().min(1).meta({ description: "How many records of that collection point at it." })
7623
7742
  }).strict()).meta({
7624
7743
  description: "The collections whose records reference the record, each with how many. Only collections the caller may read are named, so the list is empty when the records that point here are all in collections the caller cannot read; the refusal still stands."
7625
7744
  })
7626
7745
  }).strict();
7627
- var recordChangedDetails = import_zod36.z.object({
7628
- revision: import_zod36.z.number().int().min(1).meta({ description: "The current revision of the record, which is not the `expected_revision` that was sent." })
7746
+ var recordChangedDetails = import_zod37.z.object({
7747
+ revision: import_zod37.z.number().int().min(1).meta({ description: "The current revision of the record, which is not the `expected_revision` that was sent." })
7629
7748
  }).strict();
7630
- var referenceInvalidDetails = import_zod36.z.object({
7631
- field: import_zod36.z.string().min(1).meta({ description: "The key of the reference field." }),
7632
- reason: import_zod36.z.enum(["missing", "other_robot", "not_readable"]).meta({
7749
+ var referenceInvalidDetails = import_zod37.z.object({
7750
+ field: import_zod37.z.string().min(1).meta({ description: "The key of the reference field." }),
7751
+ reason: import_zod37.z.enum(["missing", "other_robot", "not_readable"]).meta({
7633
7752
  description: "`missing`: no record of the target collection has that id. `other_robot`: the target belongs to another robot than the record that points at it. `not_readable`: the caller may not read the target collection."
7634
7753
  })
7635
7754
  }).strict();
7636
- var requiredMissingDetails = import_zod36.z.object({
7637
- fields: import_zod36.z.array(import_zod36.z.string().min(1)).min(1).meta({ description: "The keys of the required fields that have no value." })
7755
+ var requiredMissingDetails = import_zod37.z.object({
7756
+ fields: import_zod37.z.array(import_zod37.z.string().min(1)).min(1).meta({ description: "The keys of the required fields that have no value." })
7638
7757
  }).strict();
7639
- var roleCycleDetails = import_zod36.z.object({
7640
- cycle: import_zod36.z.array(import_zod36.z.string()).min(2).meta({
7758
+ var roleCycleDetails = import_zod37.z.object({
7759
+ cycle: import_zod37.z.array(import_zod37.z.string()).min(2).meta({
7641
7760
  description: 'The keys along the loop, in order, ending with the key the loop started from: `["a", "b", "a"]`.'
7642
7761
  })
7643
7762
  });
7644
7763
 
7645
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/oauth.js
7646
- var import_zod37 = require("zod");
7647
- var oauthErrorCode = import_zod37.z.enum([
7764
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/oauth.js
7765
+ var import_zod38 = require("zod");
7766
+ var oauthErrorCode = import_zod38.z.enum([
7648
7767
  "invalid_request",
7649
7768
  "invalid_client",
7650
7769
  "invalid_grant",
@@ -7657,11 +7776,11 @@ var oauthErrorCode = import_zod37.z.enum([
7657
7776
  /** RFC 8707: the `resource` named is not one this server issues tokens for. */
7658
7777
  "invalid_target"
7659
7778
  ]);
7660
- var oauthError = import_zod37.z.object({
7779
+ var oauthError = import_zod38.z.object({
7661
7780
  error: oauthErrorCode,
7662
- error_description: import_zod37.z.string().min(1).max(500).optional(),
7781
+ error_description: import_zod38.z.string().min(1).max(500).optional(),
7663
7782
  /** Echoed back per RFC 6749 §4.1.2.1 so a client can match the response. */
7664
- state: import_zod37.z.string().min(1).max(500).optional(),
7783
+ state: import_zod38.z.string().min(1).max(500).optional(),
7665
7784
  /**
7666
7785
  * **A Fleetless reason carried inside a standard envelope, and it exists
7667
7786
  * because the alternative lost a distinction.**
@@ -7679,9 +7798,9 @@ var oauthError = import_zod37.z.object({
7679
7798
  * our own tooling switches on. RFC 6749 §5.2 permits additional members, and
7680
7799
  * a client that ignores this one still behaves correctly.
7681
7800
  */
7682
- fleetless_code: import_zod37.z.string().min(1).max(60).optional()
7801
+ fleetless_code: import_zod38.z.string().min(1).max(60).optional()
7683
7802
  });
7684
- var redirectUri = import_zod37.z.string().min(1).max(2e3).refine((v) => {
7803
+ var redirectUri = import_zod38.z.string().min(1).max(2e3).refine((v) => {
7685
7804
  let url;
7686
7805
  try {
7687
7806
  url = new URL(v);
@@ -7696,183 +7815,183 @@ var redirectUri = import_zod37.z.string().min(1).max(2e3).refine((v) => {
7696
7815
  return ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
7697
7816
  return false;
7698
7817
  }, { message: "redirect_uri must be an https URL, or http on an explicit loopback address, and carry no fragment" });
7699
- var codeChallengeMethod = import_zod37.z.enum(["S256"]);
7818
+ var codeChallengeMethod = import_zod38.z.enum(["S256"]);
7700
7819
  var MCP_DCR_MAX_REDIRECT_URIS = 5;
7701
- var dynamicClientRegistrationRequest = import_zod37.z.object({
7702
- redirect_uris: import_zod37.z.array(redirectUri).min(1).max(MCP_DCR_MAX_REDIRECT_URIS).meta({
7820
+ var dynamicClientRegistrationRequest = import_zod38.z.object({
7821
+ redirect_uris: import_zod38.z.array(redirectUri).min(1).max(MCP_DCR_MAX_REDIRECT_URIS).meta({
7703
7822
  description: `Where the authorization code may be returned, and the one field a registration cannot omit. Each must be an \`https\` URL, or \`http\` on an explicit loopback address for a native app that cannot hold a certificate, and none may carry a fragment. Between \`1\` and \`${MCP_DCR_MAX_REDIRECT_URIS}\` of them; duplicates are collapsed rather than counted twice. Matched **exactly** at the authorize step against what was registered here.`
7704
7823
  }),
7705
- client_name: import_zod37.z.string().min(1).max(200).optional().meta({
7824
+ client_name: import_zod38.z.string().min(1).max(200).optional().meta({
7706
7825
  description: 'The name the client calls itself. Optional: RFC 7591 makes every metadata field optional, so a registration without one is recorded under a default name. It is **not** vouched for by Fleetless and must never be rendered as if it were: a self-registered client chooses this string, and one has called itself *"Fleetless Official Helper"*.'
7707
7826
  }),
7708
- token_endpoint_auth_method: import_zod37.z.enum(["none"]).optional().meta({
7827
+ token_endpoint_auth_method: import_zod38.z.enum(["none"]).optional().meta({
7709
7828
  description: "`none`, RFC 7591's value for a public client, and the only value either server registers. Any other value is **refused rather than silently downgraded**: a client that believes it holds a secret and does not has a wrong mental model of its own security. There is no client secret to hold \u2014 mandatory PKCE (`S256`) is the defence."
7710
7829
  }),
7711
- grant_types: import_zod37.z.array(import_zod37.z.enum(["authorization_code", "refresh_token"])).optional().meta({
7830
+ grant_types: import_zod38.z.array(import_zod38.z.enum(["authorization_code", "refresh_token"])).optional().meta({
7712
7831
  description: "Accepted for conformance with RFC 7591 and then **ignored**: both MCP authorization servers grant `authorization_code` and `refresh_token` to every registration, and the answer states what was granted (\xA73.2.1) rather than what was asked."
7713
7832
  }),
7714
- response_types: import_zod37.z.array(import_zod37.z.enum(["code"])).optional().meta({
7833
+ response_types: import_zod38.z.array(import_zod38.z.enum(["code"])).optional().meta({
7715
7834
  description: "Accepted for conformance and then **ignored**; the response names `code`, which is the only response type OAuth 2.1 leaves, the implicit grant having been removed."
7716
7835
  }),
7717
- scope: import_zod37.z.string().max(500).optional().meta({
7836
+ scope: import_zod38.z.string().max(500).optional().meta({
7718
7837
  description: "Accepted for conformance and then **ignored**. This authorization server issues no scopes at all, which is why the registration answer carries no `scope` field to echo one back in."
7719
7838
  })
7720
7839
  }).meta({
7721
7840
  description: "What an MCP client sends to register itself, per RFC 7591. Unknown metadata is ignored rather than refused (\xA73.1), and the answer states what was actually granted rather than what was asked for (\xA73.2.1)."
7722
7841
  });
7723
- var dynamicClientRegistrationResponse = import_zod37.z.object({
7724
- client_id: import_zod37.z.string().min(1).max(200).meta({
7842
+ var dynamicClientRegistrationResponse = import_zod38.z.object({
7843
+ client_id: import_zod38.z.string().min(1).max(200).meta({
7725
7844
  description: "The identifier this client sends at the authorize and token endpoints. Opaque, and not the app identifier."
7726
7845
  }),
7727
- client_name: import_zod37.z.string().min(1).max(200).meta({
7846
+ client_name: import_zod38.z.string().min(1).max(200).meta({
7728
7847
  description: "The name the client registered under, echoed back. Chosen by the client and not vouched for by Fleetless."
7729
7848
  }),
7730
- redirect_uris: import_zod37.z.array(redirectUri).meta({
7849
+ redirect_uris: import_zod38.z.array(redirectUri).meta({
7731
7850
  description: "The redirect URIs this registration was accepted for. A code is returned to one of these and nowhere else."
7732
7851
  }),
7733
- grant_types: import_zod37.z.array(import_zod37.z.string()).meta({
7852
+ grant_types: import_zod38.z.array(import_zod38.z.string()).meta({
7734
7853
  description: 'The grants this client may use. Always exactly `["authorization_code", "refresh_token"]` \u2014 an exchange mints a refresh token and the token endpoint rotates it.'
7735
7854
  }),
7736
- response_types: import_zod37.z.array(import_zod37.z.string()).meta({
7855
+ response_types: import_zod38.z.array(import_zod38.z.string()).meta({
7737
7856
  description: "The response types this client may ask for: `code`."
7738
7857
  }),
7739
- token_endpoint_auth_method: import_zod37.z.literal("none").meta({
7858
+ token_endpoint_auth_method: import_zod38.z.literal("none").meta({
7740
7859
  description: "`none` \u2014 this server registers public clients only, and PKCE rather than a secret is what protects the exchange."
7741
7860
  }),
7742
- client_id_issued_at: import_zod37.z.number().int().nonnegative().meta({
7861
+ client_id_issued_at: import_zod38.z.number().int().nonnegative().meta({
7743
7862
  description: "When the registration was created, in seconds since the epoch, per RFC 7591."
7744
7863
  }),
7745
- client_secret_expires_at: import_zod37.z.literal(0).meta({
7864
+ client_secret_expires_at: import_zod38.z.literal(0).meta({
7746
7865
  description: "Always `0`, which is RFC 7591's way of saying the client secret never expires \u2014 there is none. The **registration** itself does expire: a self-registered client that never completes a flow is an unauthenticated write somebody left behind."
7747
7866
  })
7748
7867
  });
7749
- var oauthCodeTokenRequest = import_zod37.z.object({
7750
- grant_type: import_zod37.z.literal("authorization_code").meta({
7868
+ var oauthCodeTokenRequest = import_zod38.z.object({
7869
+ grant_type: import_zod38.z.literal("authorization_code").meta({
7751
7870
  description: "`authorization_code`: this request exchanges the code from the authorize redirect for an access token and a refresh token."
7752
7871
  }),
7753
- code: import_zod37.z.string().min(1).max(500).meta({
7872
+ code: import_zod38.z.string().min(1).max(500).meta({
7754
7873
  description: "The authorization code from the redirect. It may be exchanged once; a second presentation is `invalid_grant`, the same answer a fabricated code gets."
7755
7874
  }),
7756
7875
  redirect_uri: redirectUri.meta({
7757
7876
  description: "The same redirect URI the authorize request used. It is compared, not merely recorded."
7758
7877
  }),
7759
- client_id: import_zod37.z.string().min(1).max(200).meta({
7878
+ client_id: import_zod38.z.string().min(1).max(200).meta({
7760
7879
  description: "The client making the exchange, as registered."
7761
7880
  }),
7762
- code_verifier: import_zod37.z.string().regex(/^[A-Za-z0-9\-._~]{43,128}$/, "code_verifier must be 43-128 unreserved characters (RFC 7636 \xA74.1)").meta({
7881
+ code_verifier: import_zod38.z.string().regex(/^[A-Za-z0-9\-._~]{43,128}$/, "code_verifier must be 43-128 unreserved characters (RFC 7636 \xA74.1)").meta({
7763
7882
  description: "The PKCE verifier whose `S256` hash was sent as the challenge at the authorize step. Between `43` and `128` unreserved characters, per RFC 7636 \xA74.1 \u2014 it is compared rather than parsed, so a length nobody checks is a length an attacker chooses. PKCE is mandatory for every client under OAuth 2.1."
7764
7883
  }),
7765
- resource: import_zod37.z.url().optional().meta({
7884
+ resource: import_zod38.z.url().optional().meta({
7766
7885
  description: "The resource the token is requested for, per RFC 8707. It must match the audience the code was authorized for, or the answer is `invalid_target`; omitted, the code's own audience stands. It becomes the token's `aud`, and a resource refuses a token whose audience names something else \u2014 which is what keeps a token minted for one app out of another app's endpoint."
7767
7886
  })
7768
7887
  }).meta({
7769
7888
  description: "RFC 6749 \xA74.1.3's authorization-code exchange with PKCE, as either MCP authorization server reads it. Sent as `application/x-www-form-urlencoded`, per \xA74.1.3, though the server accepts a JSON body too."
7770
7889
  });
7771
- var oauthRefreshTokenRequest = import_zod37.z.object({
7772
- grant_type: import_zod37.z.literal("refresh_token").meta({
7890
+ var oauthRefreshTokenRequest = import_zod38.z.object({
7891
+ grant_type: import_zod38.z.literal("refresh_token").meta({
7773
7892
  description: "`refresh_token`: this request rotates a refresh token into a new access token and a new refresh token. The presented token is consumed; presenting it again revokes the whole session."
7774
7893
  }),
7775
- refresh_token: import_zod37.z.string().min(1).max(500).meta({
7894
+ refresh_token: import_zod38.z.string().min(1).max(500).meta({
7776
7895
  description: "The refresh token from the last token response. Bound to the client that received it and to one identity space: presented by another client, or at the other MCP server, it is `invalid_grant` and stays unconsumed."
7777
7896
  }),
7778
- client_id: import_zod37.z.string().min(1).max(200).meta({
7897
+ client_id: import_zod38.z.string().min(1).max(200).meta({
7779
7898
  description: "The client the refresh token was issued to, as registered. A refresh token is not transferable between clients."
7780
7899
  }),
7781
- resource: import_zod37.z.url().optional().meta({
7900
+ resource: import_zod38.z.url().optional().meta({
7782
7901
  description: "The resource the new token is for, per RFC 8707. Optional; when named it must be the audience the session was issued for, or the answer is `invalid_target` and the refresh token is left untouched. The successor carries the same audience either way."
7783
7902
  })
7784
7903
  }).meta({
7785
7904
  description: "RFC 6749 \xA76's refresh, as either MCP authorization server reads it. Every use rotates: the answer carries a new refresh token and the presented one is dead."
7786
7905
  });
7787
- var oauthTokenRequest = import_zod37.z.discriminatedUnion("grant_type", [oauthCodeTokenRequest, oauthRefreshTokenRequest]).meta({
7906
+ var oauthTokenRequest = import_zod38.z.discriminatedUnion("grant_type", [oauthCodeTokenRequest, oauthRefreshTokenRequest]).meta({
7788
7907
  description: "What an MCP token endpoint accepts: the authorization-code exchange, or a refresh. Any other `grant_type` is `unsupported_grant_type`, refused before a lookup happens."
7789
7908
  });
7790
- var oauthTokenResponse = import_zod37.z.object({
7791
- access_token: import_zod37.z.string().min(1).meta({
7909
+ var oauthTokenResponse = import_zod38.z.object({
7910
+ access_token: import_zod38.z.string().min(1).meta({
7792
7911
  description: "The bearer token. It is the same token the client login mints \u2014 only the envelope differs, because an RFC-compliant client parses this one and knows nothing about Fleetless."
7793
7912
  }),
7794
- token_type: import_zod37.z.literal("Bearer").meta({
7913
+ token_type: import_zod38.z.literal("Bearer").meta({
7795
7914
  description: "`Bearer`. RFC 6749 \xA75.1 makes the value case-insensitive for a client reading it; this is the spelling this server emits."
7796
7915
  }),
7797
- expires_in: import_zod37.z.number().int().positive().meta({
7916
+ expires_in: import_zod38.z.number().int().positive().meta({
7798
7917
  description: "How long the access token is valid, in **seconds**, per RFC 6749 \xA75.1. Not a timestamp, and not milliseconds."
7799
7918
  }),
7800
- refresh_token: import_zod37.z.string().min(1).optional().meta({
7919
+ refresh_token: import_zod38.z.string().min(1).optional().meta({
7801
7920
  description: "The refresh token. Both MCP token endpoints issue one on every exchange and every refresh; it rotates on every use, lives ninety days from its last use, and dies with the account's sessions \u2014 a block, a password change, a withdrawn consent. The console's own OAuth portal issues none."
7802
7921
  }),
7803
- scope: import_zod37.z.string().max(500).optional().meta({
7922
+ scope: import_zod38.z.string().max(500).optional().meta({
7804
7923
  description: "The scopes the issued token actually carries, space-separated."
7805
7924
  })
7806
7925
  });
7807
- var authorizationServerMetadata = import_zod37.z.object({
7808
- issuer: import_zod37.z.url().meta({
7926
+ var authorizationServerMetadata = import_zod38.z.object({
7927
+ issuer: import_zod38.z.url().meta({
7809
7928
  description: "The issuer identifier of this authorization server, per RFC 8414 \xA72. It is what a client checks a token's `iss` against."
7810
7929
  }),
7811
- authorization_endpoint: import_zod37.z.url().meta({
7930
+ authorization_endpoint: import_zod38.z.url().meta({
7812
7931
  description: "Where a client sends the user to authorize."
7813
7932
  }),
7814
- token_endpoint: import_zod37.z.url().meta({
7933
+ token_endpoint: import_zod38.z.url().meta({
7815
7934
  description: "The URL where a client exchanges an authorization code, or a refresh token, for tokens."
7816
7935
  }),
7817
- registration_endpoint: import_zod37.z.url().optional().meta({
7936
+ registration_endpoint: import_zod38.z.url().optional().meta({
7818
7937
  description: "The URL where a client may register itself, per RFC 7591. Absent when the app does not accept dynamic clients."
7819
7938
  }),
7820
- client_id_metadata_document_supported: import_zod37.z.boolean().optional().meta({
7939
+ client_id_metadata_document_supported: import_zod38.z.boolean().optional().meta({
7821
7940
  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."
7822
7941
  }),
7823
- response_types_supported: import_zod37.z.array(import_zod37.z.literal("code")).meta({
7942
+ response_types_supported: import_zod38.z.array(import_zod38.z.literal("code")).meta({
7824
7943
  description: "The response types this server offers: `code` only, the implicit grant being gone with OAuth 2.1."
7825
7944
  }),
7826
- grant_types_supported: import_zod37.z.array(import_zod37.z.enum(["authorization_code", "refresh_token"])).meta({
7945
+ grant_types_supported: import_zod38.z.array(import_zod38.z.enum(["authorization_code", "refresh_token"])).meta({
7827
7946
  description: "The grants this server offers: `authorization_code` and `refresh_token`. OAuth 2.1 removes the implicit and password grants, so neither appears here."
7828
7947
  }),
7829
- code_challenge_methods_supported: import_zod37.z.array(codeChallengeMethod).meta({
7948
+ code_challenge_methods_supported: import_zod38.z.array(codeChallengeMethod).meta({
7830
7949
  description: "The PKCE challenge methods accepted: `S256` only. `plain` is not offered \u2014 a challenge equal to its verifier defends against nothing, and offering it would make a downgrade negotiable."
7831
7950
  }),
7832
- token_endpoint_auth_methods_supported: import_zod37.z.array(import_zod37.z.literal("none")).meta({
7951
+ token_endpoint_auth_methods_supported: import_zod38.z.array(import_zod38.z.literal("none")).meta({
7833
7952
  description: "How a client authenticates at the token endpoint: `none`, the public-client method, with PKCE protecting the exchange."
7834
7953
  }),
7835
- scopes_supported: import_zod37.z.array(import_zod37.z.string()).optional().meta({
7954
+ scopes_supported: import_zod38.z.array(import_zod38.z.string()).optional().meta({
7836
7955
  description: "The scopes this server knows about, where it publishes a list."
7837
7956
  })
7838
7957
  });
7839
- var protectedResourceMetadata = import_zod37.z.object({
7840
- resource: import_zod37.z.url().meta({
7958
+ var protectedResourceMetadata = import_zod38.z.object({
7959
+ resource: import_zod38.z.url().meta({
7841
7960
  description: "The resource identifier this document describes, per RFC 9728. A token whose audience names something else is rejected here rather than merely noted."
7842
7961
  }),
7843
- authorization_servers: import_zod37.z.array(import_zod37.z.url()).min(1).meta({
7962
+ authorization_servers: import_zod38.z.array(import_zod38.z.url()).min(1).meta({
7844
7963
  description: "The authorization servers that may issue tokens for this resource. There is always at least one."
7845
7964
  }),
7846
- bearer_methods_supported: import_zod37.z.array(import_zod37.z.literal("header")).meta({
7965
+ bearer_methods_supported: import_zod38.z.array(import_zod38.z.literal("header")).meta({
7847
7966
  description: "How a token may be presented: in the `Authorization` header only, never in a query parameter or a form field."
7848
7967
  }),
7849
- scopes_supported: import_zod37.z.array(import_zod37.z.string()).optional().meta({
7968
+ scopes_supported: import_zod38.z.array(import_zod38.z.string()).optional().meta({
7850
7969
  description: "The scopes this resource understands, where it publishes a list."
7851
7970
  })
7852
7971
  });
7853
- var oauthRedirectResponse = import_zod37.z.object({
7854
- redirect_to: import_zod37.z.string().min(1).max(2e3)
7972
+ var oauthRedirectResponse = import_zod38.z.object({
7973
+ redirect_to: import_zod38.z.string().min(1).max(2e3)
7855
7974
  });
7856
- var oauthAuthorizeQuery = import_zod37.z.object({
7857
- response_type: import_zod37.z.literal("code").meta({
7975
+ var oauthAuthorizeQuery = import_zod38.z.object({
7976
+ response_type: import_zod38.z.literal("code").meta({
7858
7977
  description: "Always `code`. RFC 6749 \xA74.1.2.1 names `unsupported_response_type` for any other value, but `oauthErrorCode` has no such member \u2014 this server issues no other grant from this endpoint \u2014 so an unsupported value comes back on the callback as `invalid_request`."
7859
7978
  }),
7860
- client_id: import_zod37.z.string().min(1).meta({
7979
+ client_id: import_zod38.z.string().min(1).meta({
7861
7980
  description: "The OAuth client, self-registered or the one well-known central client \u2014 **not** the app identifier. Unknown, expired-dynamic and mismatched clients all collapse into the same `400 invalid_client`, answered without a redirect."
7862
7981
  }),
7863
- redirect_uri: import_zod37.z.string().min(1).meta({
7982
+ redirect_uri: import_zod38.z.string().min(1).meta({
7864
7983
  description: "One of the client's registered redirect URIs, compared **exactly** \u2014 string equality against the registered list, never a prefix or a host match. Both the shape (`redirectUri`) and the registration are checked, and a failure of either is a `400 invalid_request` with no redirect."
7865
7984
  }),
7866
- code_challenge: import_zod37.z.string().min(1).meta({
7985
+ code_challenge: import_zod38.z.string().min(1).meta({
7867
7986
  description: "The PKCE challenge; the verifier is presented at the token endpoint. Only non-emptiness is checked here \u2014 length and alphabet are not \u2014 since the verifier is what has to match."
7868
7987
  }),
7869
- code_challenge_method: import_zod37.z.literal("S256").meta({
7988
+ code_challenge_method: import_zod38.z.literal("S256").meta({
7870
7989
  description: "Only `S256`. `plain` is refused: a challenge equal to its verifier defends against nothing."
7871
7990
  }),
7872
- state: import_zod37.z.string().optional().meta({
7991
+ state: import_zod38.z.string().optional().meta({
7873
7992
  description: "Returned unchanged on the callback, and on the error redirect too, so a client can bind either answer to its own request."
7874
7993
  }),
7875
- resource: import_zod37.z.string().optional().meta({
7994
+ resource: import_zod38.z.string().optional().meta({
7876
7995
  description: "RFC 8707 resource indicator: the API origin or the MCP endpoint the token is for. Checked against the resources this server issues tokens for **on behalf of this client's app**; a mismatch is `invalid_target` on the callback."
7877
7996
  })
7878
7997
  // **No `scope`, because this authorization server issues none.** The field
@@ -7885,15 +8004,15 @@ var oauthAuthorizeQuery = import_zod37.z.object({
7885
8004
  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."
7886
8005
  });
7887
8006
 
7888
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-schema.js
8007
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-schema.js
8008
+ var import_zod41 = require("zod");
8009
+
8010
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-issues.js
7889
8011
  var import_zod40 = require("zod");
7890
8012
 
7891
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-issues.js
8013
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-templates.js
7892
8014
  var import_zod39 = require("zod");
7893
-
7894
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-templates.js
7895
- var import_zod38 = require("zod");
7896
- var collectionJsonTemplateName = import_zod38.z.enum(["pose2d", "point2d", "polygon2d", "range1d"]).meta({ description: "The name of a built-in JSON template: `pose2d`, `point2d`, `polygon2d` or `range1d`." });
8015
+ var collectionJsonTemplateName = import_zod39.z.enum(["pose2d", "point2d", "polygon2d", "range1d"]).meta({ description: "The name of a built-in JSON template: `pose2d`, `point2d`, `polygon2d` or `range1d`." });
7897
8016
  function deepFreeze(value) {
7898
8017
  if (value !== null && typeof value === "object") {
7899
8018
  for (const inner of Object.values(value))
@@ -7949,29 +8068,29 @@ var COLLECTION_JSON_TEMPLATES = deepFreeze({
7949
8068
  }
7950
8069
  });
7951
8070
 
7952
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-values.js
8071
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-values.js
7953
8072
  var TOO_DEEP_JSON = `The value nests arrays and objects more than ${COLLECTION_LIMITS.jsonDepth} levels deep.`;
7954
8073
 
7955
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-issues.js
7956
- var collectionsIssue = import_zod39.z.object({
7957
- path: import_zod39.z.string().min(1).meta({ description: "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`." }),
7958
- code: import_zod39.z.string().meta({ description: "A stable name for the kind of finding, for code to branch on." }),
7959
- message: import_zod39.z.string().meta({ description: "What is wrong, in a sentence for a person." }),
7960
- severity: import_zod39.z.enum(["error", "warning", "info"]).meta({
8074
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-issues.js
8075
+ var collectionsIssue = import_zod40.z.object({
8076
+ path: import_zod40.z.string().min(1).meta({ description: "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`." }),
8077
+ code: import_zod40.z.string().meta({ description: "A stable name for the kind of finding, for code to branch on." }),
8078
+ message: import_zod40.z.string().meta({ description: "What is wrong, in a sentence for a person." }),
8079
+ severity: import_zod40.z.enum(["error", "warning", "info"]).meta({
7961
8080
  description: "An error makes the document invalid and it cannot be saved or published. A warning and information leave it valid."
7962
8081
  })
7963
8082
  }).meta({ description: "One finding about a collections document." });
7964
8083
 
7965
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-schema.js
7966
- var timestamp2 = import_zod40.z.iso.datetime();
7967
- var count4 = import_zod40.z.number().int().min(0);
7968
- var schemaVersion2 = import_zod40.z.number().int().min(1);
8084
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-schema.js
8085
+ var timestamp2 = import_zod41.z.iso.datetime();
8086
+ var count4 = import_zod41.z.number().int().min(0);
8087
+ var schemaVersion2 = import_zod41.z.number().int().min(1);
7969
8088
  var UNIQUE_DISCARDED_LISTED = 1e3;
7970
- var token = import_zod40.z.string().min(1);
8089
+ var token = import_zod41.z.string().min(1);
7971
8090
  var confirm = token.meta({
7972
8091
  description: "The `token` of the preview of exactly this request. Needed when the preview lists effects; a missing or outdated token is answered with `confirmation_required` and the current preview."
7973
8092
  });
7974
- var sha256 = import_zod40.z.string().regex(/^[0-9a-f]{64}$/);
8093
+ var sha256 = import_zod41.z.string().regex(/^[0-9a-f]{64}$/);
7975
8094
  var purgeConfirm = token.meta({
7976
8095
  description: "The `token` of the preview of exactly this purge. A purge is always confirmed: without a token, or with one that no longer holds, the answer is `confirmation_required` with the current preview."
7977
8096
  });
@@ -7993,16 +8112,16 @@ function utf8Length(text3) {
7993
8112
  }
7994
8113
  var collection = collectionKey.meta({ description: "The key of the collection." });
7995
8114
  var field = collectionKey.meta({ description: "The key of the field." });
7996
- var collectionsEffect = import_zod40.z.discriminatedUnion("kind", [
7997
- import_zod40.z.object({
7998
- kind: import_zod40.z.literal("collection_removed"),
8115
+ var collectionsEffect = import_zod41.z.discriminatedUnion("kind", [
8116
+ import_zod41.z.object({
8117
+ kind: import_zod41.z.literal("collection_removed"),
7999
8118
  collection,
8000
8119
  records: count4.meta({ description: "Records deleted with the collection." })
8001
8120
  }).strict().meta({
8002
8121
  description: "The collection is gone from the document, so its records are deleted. Their history is deleted 90 days after the publish or restore that removed the collection, also when it held no records any more by then; until then a restore of an earlier version with its data can bring the records back."
8003
8122
  }),
8004
- import_zod40.z.object({
8005
- kind: import_zod40.z.literal("collection_recreated"),
8123
+ import_zod41.z.object({
8124
+ kind: import_zod41.z.literal("collection_recreated"),
8006
8125
  collection,
8007
8126
  records: count4.meta({ description: "Records deleted by the re-creation." }),
8008
8127
  from: collectionBinding,
@@ -8010,101 +8129,101 @@ var collectionsEffect = import_zod40.z.discriminatedUnion("kind", [
8010
8129
  }).strict().meta({
8011
8130
  description: "The binding of the collection changed, which deletes its records and starts the collection again. The history of the deleted records is kept 90 days after the publish or restore, as for a removed collection."
8012
8131
  }),
8013
- import_zod40.z.object({
8014
- kind: import_zod40.z.literal("records_created"),
8132
+ import_zod41.z.object({
8133
+ kind: import_zod41.z.literal("records_created"),
8015
8134
  collection,
8016
8135
  count: count4.meta({ description: "Records created, one for each robot attached to the app." })
8017
8136
  }).strict().meta({ description: "A collection with one record per robot got the records of the robots that have none." }),
8018
- import_zod40.z.object({
8019
- kind: import_zod40.z.literal("field_removed"),
8137
+ import_zod41.z.object({
8138
+ kind: import_zod41.z.literal("field_removed"),
8020
8139
  collection,
8021
8140
  field,
8022
8141
  values: count4.meta({ description: "Values removed from records." })
8023
8142
  }).strict().meta({ description: "The field is gone from the document, so its values are removed from the records." }),
8024
- import_zod40.z.object({
8025
- kind: import_zod40.z.literal("defaults_filled"),
8143
+ import_zod41.z.object({
8144
+ kind: import_zod41.z.literal("defaults_filled"),
8026
8145
  collection,
8027
8146
  field,
8028
8147
  records: count4.meta({ description: "Records that receive the default." })
8029
8148
  }).strict().meta({ description: "Records without a value get the default of a new or newly required field." }),
8030
- import_zod40.z.object({
8031
- kind: import_zod40.z.literal("values_converted"),
8149
+ import_zod41.z.object({
8150
+ kind: import_zod41.z.literal("values_converted"),
8032
8151
  collection,
8033
8152
  field,
8034
8153
  converted: count4.meta({ description: "Values that became a value of the new type." }),
8035
8154
  discarded: count4.meta({ description: "Values that could not be converted and were removed." })
8036
8155
  }).strict().meta({ description: "The type of the field changed: values are converted where the conversion rules allow it and removed where they do not." }),
8037
- import_zod40.z.object({
8038
- kind: import_zod40.z.literal("values_discarded"),
8156
+ import_zod41.z.object({
8157
+ kind: import_zod41.z.literal("values_discarded"),
8039
8158
  collection,
8040
8159
  field,
8041
- reason: import_zod40.z.enum(["reference_target_changed", "option_removed", "constraint"]).meta({
8160
+ reason: import_zod41.z.enum(["reference_target_changed", "option_removed", "constraint"]).meta({
8042
8161
  description: "`reference_target_changed`: the field points at another collection now. `option_removed`: a select option is gone. `constraint`: a limit such as `max_length`, `pattern`, `min`, `max`, `integer` or the JSON schema now excludes the value."
8043
8162
  }),
8044
8163
  values: count4.meta({ description: "Values removed from records." })
8045
8164
  }).strict().meta({ description: "Values that the changed field no longer accepts are removed." }),
8046
- import_zod40.z.object({
8047
- kind: import_zod40.z.literal("unique_discarded"),
8165
+ import_zod41.z.object({
8166
+ kind: import_zod41.z.literal("unique_discarded"),
8048
8167
  collection,
8049
8168
  field,
8050
8169
  total: count4.meta({ description: "The exact number of values removed." }),
8051
- records: import_zod40.z.array(import_zod40.z.object({
8052
- id: import_zod40.z.uuid(),
8053
- display: import_zod40.z.string().meta({ description: "The record's display text." }),
8054
- value: import_zod40.z.unknown().meta({ description: "The value the record loses." })
8170
+ records: import_zod41.z.array(import_zod41.z.object({
8171
+ id: import_zod41.z.uuid(),
8172
+ display: import_zod41.z.string().meta({ description: "The record's display text." }),
8173
+ value: import_zod41.z.unknown().meta({ description: "The value the record loses." })
8055
8174
  }).strict()).max(UNIQUE_DISCARDED_LISTED).meta({ description: `The records that lose their value, at most ${UNIQUE_DISCARDED_LISTED}; \`total\` is the exact number.` })
8056
8175
  }).strict().meta({
8057
8176
  description: "The field became unique, or unique across a wider scope, and records share a value: the record created first keeps it and the others lose it."
8058
8177
  }),
8059
- import_zod40.z.object({
8060
- kind: import_zod40.z.literal("required_left_empty"),
8178
+ import_zod41.z.object({
8179
+ kind: import_zod41.z.literal("required_left_empty"),
8061
8180
  collection,
8062
8181
  field,
8063
8182
  records: count4.meta({ description: "Records left without a value." })
8064
8183
  }).strict().meta({ description: "The field is required now and these records have no value and no default to fill in; they stay updatable in their other fields." }),
8065
- import_zod40.z.object({
8066
- kind: import_zod40.z.literal("references_cleared"),
8184
+ import_zod41.z.object({
8185
+ kind: import_zod41.z.literal("references_cleared"),
8067
8186
  collection,
8068
8187
  field,
8069
8188
  values: count4.meta({ description: "References removed." })
8070
8189
  }).strict().meta({ description: "References that pointed at records deleted by this change are cleared." })
8071
8190
  ]).meta({ description: "One effect of a publish or restore on existing data. Effects that would change nothing are not listed." });
8072
- var collectionsAccessChange = import_zod40.z.object({
8191
+ var collectionsAccessChange = import_zod41.z.object({
8073
8192
  collection,
8074
- action: import_zod40.z.enum(["read", "create", "update", "delete"]),
8075
- from: import_zod40.z.unknown().meta({ description: "The access before, as written in the document. `null` means nobody." }),
8076
- to: import_zod40.z.unknown().meta({ description: "The access after, as written in the document. `null` means nobody." })
8193
+ action: import_zod41.z.enum(["read", "create", "update", "delete"]),
8194
+ from: import_zod41.z.unknown().meta({ description: "The access before, as written in the document. `null` means nobody." }),
8195
+ to: import_zod41.z.unknown().meta({ description: "The access after, as written in the document. `null` means nobody." })
8077
8196
  }).meta({ description: "A change of the roles that may do one thing with the records of a collection. Information only; it does not need confirming." });
8078
- var collectionsSchemaPreview = import_zod40.z.object({
8197
+ var collectionsSchemaPreview = import_zod41.z.object({
8079
8198
  from_version: schemaVersion2.nullable().meta({ description: "The version that is published now. Null before the first publish." }),
8080
8199
  to_version: schemaVersion2.meta({ description: "The number the new version would get." }),
8081
- valid: import_zod40.z.boolean().meta({ description: "False when the draft has errors; it cannot be published and no effects are computed." }),
8082
- issues: import_zod40.z.array(collectionsIssue).meta({ description: "Everything found in the draft: errors that block publishing, warnings and information." }),
8083
- effects: import_zod40.z.array(collectionsEffect).meta({ description: "What would happen to existing data, computed against the data as it is now." }),
8084
- access_changes: import_zod40.z.array(collectionsAccessChange),
8200
+ valid: import_zod41.z.boolean().meta({ description: "False when the draft has errors; it cannot be published and no effects are computed." }),
8201
+ issues: import_zod41.z.array(collectionsIssue).meta({ description: "Everything found in the draft: errors that block publishing, warnings and information." }),
8202
+ effects: import_zod41.z.array(collectionsEffect).meta({ description: "What would happen to existing data, computed against the data as it is now." }),
8203
+ access_changes: import_zod41.z.array(collectionsAccessChange),
8085
8204
  source_sha256: sha256.meta({
8086
8205
  description: "The SHA-256 of the draft text this preview is for (UTF-8, lowercase hex). Send it as `source_sha256` when publishing to publish exactly this draft, also when there are no effects and so no token."
8087
8206
  }),
8088
- token: import_zod40.z.string().nullable().meta({
8207
+ token: import_zod41.z.string().nullable().meta({
8089
8208
  description: "Stands for exactly this list of effects, on exactly this draft text and the version in force now: send it as `confirm` when publishing. If the draft was saved again, or the data or the version changed, the token no longer holds. Null when there are no effects, since publishing then needs no confirmation."
8090
8209
  })
8091
8210
  }).meta({ description: "The preview of publishing the draft: its problems, its effects on existing data and the token that confirms them." });
8092
- var collectionsDraftResponse = import_zod40.z.object({
8093
- source: import_zod40.z.string().meta({ description: "The document as text. The saved draft; without one, the published version's text; before the first publish, empty." }),
8211
+ var collectionsDraftResponse = import_zod41.z.object({
8212
+ source: import_zod41.z.string().meta({ description: "The document as text. The saved draft; without one, the published version's text; before the first publish, empty." }),
8094
8213
  doc: collectionsDocument.nullable().meta({ description: "The document the source parses to. Null when the source is empty." }),
8095
8214
  updated_at: timestamp2.nullable().meta({ description: "When the draft was saved. Null when no draft is saved." }),
8096
8215
  updated_by: collectionActor.nullable().meta({ description: "Who saved the draft. Null when no draft is saved." }),
8097
- issues: import_zod40.z.array(collectionsIssue).meta({ description: "Warnings and information about the document. A draft is saved only when it has no errors." })
8216
+ issues: import_zod41.z.array(collectionsIssue).meta({ description: "Warnings and information about the document. A draft is saved only when it has no errors." })
8098
8217
  }).meta({ description: "The draft of the schema document, or the current version when there is no draft." });
8099
- var putCollectionsDraftRequest = import_zod40.z.object({
8218
+ var putCollectionsDraftRequest = import_zod41.z.object({
8100
8219
  // A character is at least one byte, so the cheap bound on characters holds for every source and rules out the long ones before they are measured.
8101
- source: import_zod40.z.string().max(COLLECTION_LIMITS.schemaSourceBytes).refine((text3) => utf8Length(text3) <= COLLECTION_LIMITS.schemaSourceBytes, {
8220
+ source: import_zod41.z.string().max(COLLECTION_LIMITS.schemaSourceBytes).refine((text3) => utf8Length(text3) <= COLLECTION_LIMITS.schemaSourceBytes, {
8102
8221
  message: `The source is longer than ${COLLECTION_LIMITS.schemaSourceBytes.toLocaleString("en-US")} bytes of UTF-8.`
8103
8222
  }).meta({
8104
8223
  description: `The whole document as YAML or JSON text, at most ${COLLECTION_LIMITS.schemaSourceBytes.toLocaleString("en-US")} bytes of UTF-8, which is fewer characters when some are not plain ASCII. It replaces the draft and is refused with the problems found if it is not valid.`
8105
8224
  })
8106
8225
  }).strict().meta({ description: "Replaces the draft with a whole document." });
8107
- var collectionsPublishRequest = import_zod40.z.object({
8226
+ var collectionsPublishRequest = import_zod41.z.object({
8108
8227
  confirm: confirm.optional(),
8109
8228
  source_sha256: sha256.meta({
8110
8229
  description: "The `source_sha256` of the preview that was looked at. When it is sent and the saved draft is another text, because somebody saved it again since, nothing is published and the answer is `409 confirmation_required` with the current preview. Leave it out to publish whichever draft is saved; a token (`confirm`) already binds the draft it was made for."
@@ -8112,27 +8231,27 @@ var collectionsPublishRequest = import_zod40.z.object({
8112
8231
  }).strict().meta({
8113
8232
  description: "Publishes the draft. The body may be empty when the preview lists no effects; otherwise it carries the preview's token as `confirm`. Send `source_sha256` as well to be sure that the draft published is the one that was looked at."
8114
8233
  });
8115
- var collectionsPublishResponse = import_zod40.z.object({
8234
+ var collectionsPublishResponse = import_zod41.z.object({
8116
8235
  version: schemaVersion2,
8117
8236
  published_at: timestamp2,
8118
- effects: import_zod40.z.array(collectionsEffect).meta({ description: "What the publish did to existing data." }),
8119
- issues: import_zod40.z.array(collectionsIssue).meta({ description: "Warnings and information about the published document." })
8237
+ effects: import_zod41.z.array(collectionsEffect).meta({ description: "What the publish did to existing data." }),
8238
+ issues: import_zod41.z.array(collectionsIssue).meta({ description: "Warnings and information about the published document." })
8120
8239
  }).meta({ description: "The version that was published and the effects it had." });
8121
- var collectionsVersionSummary = import_zod40.z.object({
8240
+ var collectionsVersionSummary = import_zod41.z.object({
8122
8241
  version: schemaVersion2,
8123
8242
  published_at: timestamp2,
8124
8243
  published_by: collectionActor,
8125
- effect_counts: import_zod40.z.record(import_zod40.z.string(), count4).meta({
8244
+ effect_counts: import_zod41.z.record(import_zod41.z.string(), count4).meta({
8126
8245
  description: "For each kind of effect the publish had, how many records or values it touched, by effect `kind`. Empty when it had none."
8127
8246
  }),
8128
8247
  restored_from: schemaVersion2.nullable().meta({ description: "The version this one restored. Null for an ordinary publish." }),
8129
- restore_with_data: import_zod40.z.boolean().meta({
8248
+ restore_with_data: import_zod41.z.boolean().meta({
8130
8249
  description: `Whether restoring this version can also put records back: its restore point is at most ${COLLECTION_LIMITS.restoreDays} days old, has not been purged, and it is not the current version.`
8131
8250
  }),
8132
- with_data: import_zod40.z.boolean().meta({
8251
+ with_data: import_zod41.z.boolean().meta({
8133
8252
  description: "Whether this version came from a restore that also put records back. `false` for an ordinary publish and for a restore of the document alone."
8134
8253
  }),
8135
- reverted_totals: import_zod40.z.object({
8254
+ reverted_totals: import_zod41.z.object({
8136
8255
  changes: count4.meta({ description: "Changes made since the restore point that were reverted." }),
8137
8256
  records_back: count4.meta({ description: "Deleted records that came back." }),
8138
8257
  records_deleted: count4.meta({ description: "Records created since the restore point that were deleted." }),
@@ -8141,110 +8260,110 @@ var collectionsVersionSummary = import_zod40.z.object({
8141
8260
  description: "What putting the records back did, in all the collections together, so that the history of versions can say what came back. Null unless `with_data`."
8142
8261
  })
8143
8262
  }).meta({ description: "A published version of the schema document." });
8144
- var collectionsVersionsResponse = import_zod40.z.object({
8263
+ var collectionsVersionsResponse = import_zod41.z.object({
8145
8264
  current: schemaVersion2.nullable().meta({ description: "The version in force. Null before the first publish." }),
8146
- versions: import_zod40.z.array(collectionsVersionSummary).meta({ description: "Newest first." })
8265
+ versions: import_zod41.z.array(collectionsVersionSummary).meta({ description: "Newest first." })
8147
8266
  }).meta({ description: "The published versions of the schema document." });
8148
8267
  var collectionsVersionResponse = collectionsVersionSummary.extend({
8149
- source: import_zod40.z.string().meta({ description: "The document as it was published, as text." }),
8268
+ source: import_zod41.z.string().meta({ description: "The document as it was published, as text." }),
8150
8269
  doc: collectionsDocument
8151
8270
  }).meta({ description: "One published version with its document." });
8152
- var collectionsRestorePreview = import_zod40.z.object({
8271
+ var collectionsRestorePreview = import_zod41.z.object({
8153
8272
  version: schemaVersion2.meta({ description: "The version that would be restored." }),
8154
- with_data: import_zod40.z.boolean().meta({ description: "Whether this preview is for a restore that also puts records back." }),
8155
- data_possible: import_zod40.z.boolean().meta({ description: "Whether records can be put back at all." }),
8156
- data_reason: import_zod40.z.enum(["ok", "expired", "purged", "current_version"]).meta({
8273
+ with_data: import_zod41.z.boolean().meta({ description: "Whether this preview is for a restore that also puts records back." }),
8274
+ data_possible: import_zod41.z.boolean().meta({ description: "Whether records can be put back at all." }),
8275
+ data_reason: import_zod41.z.enum(["ok", "expired", "purged", "current_version"]).meta({
8157
8276
  description: `\`ok\`: records can be put back. \`expired\`: the restore point is more than ${COLLECTION_LIMITS.restoreDays} days old. \`purged\`: an owner removed the history it needs. \`current_version\`: this version is already in force.`
8158
8277
  }),
8159
- touched: import_zod40.z.array(collection).meta({ description: "The collections that differ between the current version and this one; only these can get records back." }),
8160
- selected: import_zod40.z.array(collection).meta({ description: "The touched collections whose records would be put back. The caller may deselect some." }),
8161
- reverted: import_zod40.z.array(import_zod40.z.object({
8278
+ touched: import_zod41.z.array(collection).meta({ description: "The collections that differ between the current version and this one; only these can get records back." }),
8279
+ selected: import_zod41.z.array(collection).meta({ description: "The touched collections whose records would be put back. The caller may deselect some." }),
8280
+ reverted: import_zod41.z.array(import_zod41.z.object({
8162
8281
  collection,
8163
8282
  changes: count4.meta({ description: "Changes made since the restore point that would be reverted." }),
8164
8283
  records_back: count4.meta({ description: "Deleted records that would come back." }),
8165
8284
  records_deleted: count4.meta({ description: "Records created since the restore point that would be deleted." })
8166
8285
  }).strict()).meta({ description: "What putting the records back would do, per selected collection." }),
8167
8286
  robots_gone: count4.meta({ description: "Records of robots that were deleted since cannot come back; this is how many." }),
8168
- effects: import_zod40.z.array(collectionsEffect).meta({ description: "The ordinary effects of publishing this version's document." }),
8169
- access_changes: import_zod40.z.array(collectionsAccessChange),
8170
- issues: import_zod40.z.array(collectionsIssue),
8171
- token: import_zod40.z.string().nullable().meta({
8287
+ effects: import_zod41.z.array(collectionsEffect).meta({ description: "The ordinary effects of publishing this version's document." }),
8288
+ access_changes: import_zod41.z.array(collectionsAccessChange),
8289
+ issues: import_zod41.z.array(collectionsIssue),
8290
+ token: import_zod41.z.string().nullable().meta({
8172
8291
  description: "Stands for exactly what this restore would do: send it as `confirm`. Null when the restore changes no data and needs no confirmation."
8173
8292
  })
8174
8293
  }).meta({ description: "The preview of restoring a version, with the token that confirms it." });
8175
- var collectionsRestorePreviewQuery = import_zod40.z.object({
8176
- data: import_zod40.z.enum(["true", "false"]).meta({ description: "`true` also puts records back to their state at the version's restore point. Default `false`." }).optional(),
8177
- collections: import_zod40.z.string().min(1).meta({ description: "The touched collections to put records back in, separated by commas. Default: all of them." }).optional()
8294
+ var collectionsRestorePreviewQuery = import_zod41.z.object({
8295
+ data: import_zod41.z.enum(["true", "false"]).meta({ description: "`true` also puts records back to their state at the version's restore point. Default `false`." }).optional(),
8296
+ collections: import_zod41.z.string().min(1).meta({ description: "The touched collections to put records back in, separated by commas. Default: all of them." }).optional()
8178
8297
  }).strict();
8179
- var collectionsRestoreRequest = import_zod40.z.object({
8180
- data: import_zod40.z.boolean().meta({ description: "Also put records back to their state at the restore point, in the touched collections. Default `false`." }).optional(),
8181
- collections: import_zod40.z.array(collectionKey).max(COLLECTION_LIMITS.collections).meta({ description: "Limits putting records back to these touched collections. Default: all of them." }).optional(),
8298
+ var collectionsRestoreRequest = import_zod41.z.object({
8299
+ data: import_zod41.z.boolean().meta({ description: "Also put records back to their state at the restore point, in the touched collections. Default `false`." }).optional(),
8300
+ collections: import_zod41.z.array(collectionKey).max(COLLECTION_LIMITS.collections).meta({ description: "Limits putting records back to these touched collections. Default: all of them." }).optional(),
8182
8301
  confirm: confirm.optional()
8183
8302
  }).strict().meta({ description: "Restores a version. Send the `data` and `collections` of the preview together with its token as `confirm`." });
8184
- var collectionsRestoreResponse = collectionsPublishResponse.extend({ with_data: import_zod40.z.boolean().meta({ description: "Whether records were put back as well." }) }).meta({ description: "The version that the restore published and what it did." });
8185
- var collectionsPurgeRequest = import_zod40.z.object({
8303
+ var collectionsRestoreResponse = collectionsPublishResponse.extend({ with_data: import_zod41.z.boolean().meta({ description: "Whether records were put back as well." }) }).meta({ description: "The version that the restore published and what it did." });
8304
+ var collectionsPurgeRequest = import_zod41.z.object({
8186
8305
  before: timestamp2.meta({
8187
8306
  description: "Revisions older than this UTC time are removed. The current values of records stay. It must lie in the past (`400 validation_error`, field `before`, rule `not_in_past`), and a date older than every revision is refused as well (rule `nothing_to_purge`)."
8188
8307
  }),
8189
8308
  collection: collectionKey.meta({ description: "Purge only this collection. Default: the whole app." }).optional(),
8190
8309
  confirm: purgeConfirm.optional()
8191
8310
  }).strict().meta({ description: "Removes the history older than a date. The preview answers with a token; send it as `confirm` to purge." });
8192
- var collectionsPurgePreview = import_zod40.z.object({
8311
+ var collectionsPurgePreview = import_zod41.z.object({
8193
8312
  before: timestamp2,
8194
8313
  collection: collectionKey.nullable().meta({ description: "The collection the purge is limited to. Null for the whole app." }),
8195
8314
  revisions: count4.meta({ description: "Revisions that would be removed." }),
8196
8315
  bytes: count4.meta({ description: "Their size in bytes." }),
8197
- restore_points_lost: import_zod40.z.array(schemaVersion2).meta({
8316
+ restore_points_lost: import_zod41.z.array(schemaVersion2).meta({
8198
8317
  description: "Versions whose records could be put back today and could not once the history is gone, judged the way `restore_with_data` of the version list is. For the purge of one collection only the versions whose restore touches that collection are named."
8199
8318
  }),
8200
8319
  token: token.meta({ description: "Stands for exactly this purge: send it as `confirm` to carry it out." })
8201
8320
  }).meta({ description: "What a purge would remove, with the token that confirms it." });
8202
- var collectionsPurgeResponse = import_zod40.z.object({
8321
+ var collectionsPurgeResponse = import_zod41.z.object({
8203
8322
  revisions: count4.meta({ description: "Revisions removed." }),
8204
8323
  bytes: count4.meta({ description: "Their size in bytes." }),
8205
8324
  purged_at: timestamp2
8206
8325
  }).meta({ description: "What a purge removed." });
8207
8326
 
8208
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/collections-transfer.js
8209
- var import_zod41 = require("zod");
8327
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/collections-transfer.js
8328
+ var import_zod42 = require("zod");
8210
8329
  var IMPORT_ERRORS_LISTED = 1e3;
8211
- var count5 = import_zod41.z.number().int().min(0);
8212
- var confirm2 = import_zod41.z.string().min(1).meta({
8330
+ var count5 = import_zod42.z.number().int().min(0);
8331
+ var confirm2 = import_zod42.z.string().min(1).meta({
8213
8332
  description: "The `token` of the preview of exactly this import. Without it the import route answers the preview and imports nothing. A token that is not the one of the current preview, because the data moved on or it belongs to another import, is answered `409 confirmation_required` with the current preview in `details.preview`. A file with errors is never imported: its preview comes back with `token: null`, whatever `confirm` says."
8214
8333
  });
8215
- var mappingTarget = collectionKey.or(import_zod41.z.literal("")).meta({
8334
+ var mappingTarget = collectionKey.or(import_zod42.z.literal("")).meta({
8216
8335
  description: "The key of the field the column is imported into, the literal `robot`, or an empty string to leave the column out."
8217
8336
  });
8218
- var importScope = import_zod41.z.object({
8337
+ var importScope = import_zod42.z.object({
8219
8338
  filter: collectionFilter.meta({ description: "Only records matching this filter can be deleted. The same filter object that record lists take as JSON text." }).optional(),
8220
- robot_id: import_zod41.z.uuid().meta({ description: "Only records of this robot can be deleted." }).optional()
8339
+ robot_id: import_zod42.z.uuid().meta({ description: "Only records of this robot can be deleted." }).optional()
8221
8340
  }).strict().refine((scope) => !(scope.filter !== void 0 && scope.robot_id !== void 0), {
8222
8341
  message: "A scope is a filter or a robot, not both",
8223
8342
  path: ["robot_id"]
8224
8343
  }).meta({
8225
8344
  description: "Limits which records `mirror` may delete: those matching a filter, or those of one robot. Name exactly one of them: an empty `scope` is `400 validation_error` (rule `empty`), and so is a `scope` on an import that is not a `mirror` (rule `needs_mirror`). Without a scope the whole collection is mirrored, every robot's records included. `robot_id` of the request does not narrow a mirror; use `scope.robot_id`."
8226
8345
  });
8227
- var collectionImportRequest = import_zod41.z.object({
8228
- format: import_zod41.z.enum(["csv", "json"]).meta({
8346
+ var collectionImportRequest = import_zod42.z.object({
8347
+ format: import_zod42.z.enum(["csv", "json"]).meta({
8229
8348
  description: "`csv`: UTF-8 text with a header row, as in RFC 4180; a `json` field is written as JSON text in its cell. `json`: an array of objects, one per record."
8230
8349
  }),
8231
- content: import_zod41.z.string().max(COLLECTION_LIMITS.importBytes).meta({
8350
+ content: import_zod42.z.string().max(COLLECTION_LIMITS.importBytes).meta({
8232
8351
  description: `The file as text, at most ${COLLECTION_LIMITS.importBytes.toLocaleString("en-US")} characters and as many bytes of UTF-8, and ${COLLECTION_LIMITS.importRows.toLocaleString("en-US")} rows (\`400 validation_error\`, rule \`too_large\` or \`too_many_rows\`; the latter is raised as soon as the 50,001st row is read, so it does not say how many there are). A byte order mark at the start of a JSON file is ignored.`
8233
8352
  }),
8234
- mapping: import_zod41.z.record(import_zod41.z.string(), mappingTarget).meta({
8353
+ mapping: import_zod42.z.record(import_zod42.z.string(), mappingTarget).meta({
8235
8354
  description: "Where each column of the file goes, by the column name in the header (for JSON, the property name). A column that is not listed is imported into the field with the same key. A column named after a system field (`id`, `created_at`, `created_by`, `updated_at`, `updated_by`, `revision`, `robot_id`) is left out unless it is mapped."
8236
8355
  }).optional(),
8237
- references: import_zod41.z.record(collectionKey, collectionKey).meta({
8356
+ references: import_zod42.z.record(collectionKey, collectionKey).meta({
8238
8357
  description: "For each reference field, by its key: the unique field of the target collection that the values in its column identify, for example `name`. A reference field that is not listed takes record ids."
8239
8358
  }).optional(),
8240
8359
  key: collectionKey.meta({
8241
8360
  description: "A unique field that matches rows to existing records: a row whose value is found updates that record, the rest create records. Without a key every row creates a record. A collection with one record per robot is only updated, matched by robot, takes no key and no mirror, and two rows for one robot are an error."
8242
8361
  }).optional(),
8243
- mode: import_zod41.z.enum(["upsert", "mirror"]).meta({
8362
+ mode: import_zod42.z.enum(["upsert", "mirror"]).meta({
8244
8363
  description: "`upsert` (the default) creates and updates records. `mirror` also deletes the records of `scope` that are not in the file, and needs `key`. A mirror deletes at most 50,000 records, a file without rows is refused, and a deletion that a `prevent` reference blocks fails the whole import. A collection with one record per robot takes neither a `key` nor a `mirror` (`400 validation_error`, rule `one_per_robot_is_automatic`)."
8245
8364
  }).optional(),
8246
8365
  scope: importScope.optional(),
8247
- robot_id: import_zod41.z.uuid().meta({
8366
+ robot_id: import_zod42.z.uuid().meta({
8248
8367
  description: "The robot every row belongs to, in a collection that belongs to robots, when the file has no `robot` column; sent together with a `robot` column it is refused (rule `robot_column_present`). It says which robot the rows are for and does not narrow a `mirror`: that is `scope.robot_id`."
8249
8368
  }).optional(),
8250
8369
  confirm: confirm2.optional()
@@ -8252,77 +8371,77 @@ var collectionImportRequest = import_zod41.z.object({
8252
8371
  message: 'Mode "mirror" needs a key: records are matched to the file by it',
8253
8372
  path: ["key"]
8254
8373
  }).meta({ description: "Imports a file of records into a collection, all or nothing." });
8255
- var importError = import_zod41.z.object({
8374
+ var importError = import_zod42.z.object({
8256
8375
  row: count5.meta({
8257
8376
  description: "The row the problem is in, counted from 1 over the records of the file, so the header of a CSV is not counted. 0 marks a problem with the file as a whole, and a deletion of a `mirror` that a `prevent` reference blocks (the column is then the key column and the value the key of the record)."
8258
8377
  }),
8259
- column: import_zod41.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The column as named in the file. Empty when the problem is not about one column. Cut to 200 characters, an ellipsis included." }),
8260
- value: import_zod41.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The value as found in the file, cut to 200 characters with an ellipsis (`\u2026`) at the end when it was longer." }),
8261
- reason: import_zod41.z.string().min(1).meta({ description: "What is wrong with it, in words." })
8378
+ column: import_zod42.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The column as named in the file. Empty when the problem is not about one column. Cut to 200 characters, an ellipsis included." }),
8379
+ value: import_zod42.z.string().max(COLLECTION_LIMITS.importErrorText).meta({ description: "The value as found in the file, cut to 200 characters with an ellipsis (`\u2026`) at the end when it was longer." }),
8380
+ reason: import_zod42.z.string().min(1).meta({ description: "What is wrong with it, in words." })
8262
8381
  }).meta({ description: "A row, column and value that stop the import, with the reason." });
8263
- var collectionImportPreview = import_zod41.z.object({
8264
- counts: import_zod41.z.object({
8382
+ var collectionImportPreview = import_zod42.z.object({
8383
+ counts: import_zod42.z.object({
8265
8384
  unchanged: count5.meta({ description: "Rows that match a record that already has these values." }),
8266
8385
  new: count5.meta({ description: "Records that would be created." }),
8267
8386
  updated: count5.meta({ description: "Records that would change." }),
8268
8387
  deleted: count5.meta({ description: "Records that `mirror` would delete." }),
8269
8388
  errors: count5.meta({ description: "Problems found in the file. The same number as `errors_total`." })
8270
8389
  }).meta({ description: "What the import would do, counted." }),
8271
- errors: import_zod41.z.array(importError).max(IMPORT_ERRORS_LISTED).meta({
8390
+ errors: import_zod42.z.array(importError).max(IMPORT_ERRORS_LISTED).meta({
8272
8391
  description: `The problems found, in file order, at most ${IMPORT_ERRORS_LISTED.toLocaleString("en-US")}; \`errors_total\` is the exact number.`
8273
8392
  }),
8274
8393
  errors_total: count5.meta({ description: "The exact number of problems found." }),
8275
- mirror_scope: import_zod41.z.enum(["collection", "filter", "robot"]).nullable().meta({
8394
+ mirror_scope: import_zod42.z.enum(["collection", "filter", "robot"]).nullable().meta({
8276
8395
  description: "Where `mirror` would delete records: `collection` is every record of the collection, which the preview should say prominently; `filter` and `robot` are the scope that was sent. Null when the mode is not `mirror`."
8277
8396
  }),
8278
- warnings: import_zod41.z.array(import_zod41.z.enum(["plan_limit"])).meta({
8397
+ warnings: import_zod42.z.array(import_zod42.z.enum(["plan_limit"])).meta({
8279
8398
  description: "`plan_limit`: importing the file would take the organization over a limit of its plan, so the import itself would be refused."
8280
8399
  }),
8281
- token: import_zod41.z.string().min(1).nullable().meta({
8400
+ token: import_zod42.z.string().min(1).nullable().meta({
8282
8401
  description: "Stands for exactly this import: send it as `confirm` to carry it out. Null while the file has errors. It is not single-use; see the note on the import routes."
8283
8402
  })
8284
8403
  }).meta({ description: "The preview of an import: what it would do, the problems that stop it and the token that confirms it." });
8285
- var collectionImportResult = import_zod41.z.object({
8404
+ var collectionImportResult = import_zod42.z.object({
8286
8405
  created: count5.meta({ description: "Records created." }),
8287
8406
  updated: count5.meta({ description: "Records changed." }),
8288
8407
  deleted: count5.meta({ description: "Records deleted by `mirror`." }),
8289
8408
  unchanged: count5.meta({ description: "Rows that matched a record that already had these values." })
8290
8409
  }).meta({ description: "What an import did." });
8291
- var collectionExportQuery = import_zod41.z.object({
8292
- format: import_zod41.z.enum(["csv", "json"]).meta({ description: "`csv`: UTF-8 text with a header row. `json`: an array of objects." }),
8410
+ var collectionExportQuery = import_zod42.z.object({
8411
+ format: import_zod42.z.enum(["csv", "json"]).meta({ description: "`csv`: UTF-8 text with a header row. `json`: an array of objects." }),
8293
8412
  // The same four parameters, in the same words, as the record list they narrow down.
8294
8413
  ...collectionRecordListQuery.pick({ filter: true, search: true, sort: true, robot: true }).shape,
8295
- fields: import_zod41.z.string().min(1).meta({ description: "The fields to export by key, separated by commas, in the order given. Default: all fields, in the order of the schema." }).optional(),
8296
- references: import_zod41.z.string().min(1).meta({
8414
+ fields: import_zod42.z.string().min(1).meta({ description: "The fields to export by key, separated by commas, in the order given. Default: all fields, in the order of the schema." }).optional(),
8415
+ references: import_zod42.z.string().min(1).meta({
8297
8416
  description: "How reference fields are written: `id` (the default) or the key of a unique field of the target collection, such as `name`, so that the file can be imported again. A reference field in the file whose target collection has no such unique field is `400 validation_error` (field `references`, rule `not_unique`); with no reference field among the columns the value is ignored."
8298
8417
  }).optional(),
8299
- system: import_zod41.z.enum(["true", "false"]).meta({
8418
+ system: import_zod42.z.enum(["true", "false"]).meta({
8300
8419
  description: "`true` adds the system fields after the fields: `robot_id` in a collection that belongs to robots, then `id`, `created_at`, `created_by`, `updated_at`, `updated_by` and `revision`. `created_by` and `updated_by` are the actors' labels. Default `false`."
8301
8420
  }).optional()
8302
8421
  }).strict();
8303
8422
 
8304
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/controller-register.js
8305
- var import_zod42 = require("zod");
8306
- var text2 = (max) => import_zod42.z.string().regex(/^\P{Cc}*$/u).trim().min(1).max(max);
8307
- var email = import_zod42.z.string().regex(/^\P{Cc}*$/u).trim().email().max(320);
8308
- var controllerRegisterAddress = import_zod42.z.object({
8423
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/controller-register.js
8424
+ var import_zod43 = require("zod");
8425
+ var text2 = (max) => import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().min(1).max(max);
8426
+ var email = import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().email().max(320);
8427
+ var controllerRegisterAddress = import_zod43.z.object({
8309
8428
  line1: text2(200),
8310
8429
  line2: text2(200).nullable().default(null),
8311
8430
  postalCode: text2(32),
8312
8431
  city: text2(120),
8313
- country: import_zod42.z.string().regex(/^\P{Cc}*$/u).trim().regex(/^[A-Z]{2}$/)
8432
+ country: import_zod43.z.string().regex(/^\P{Cc}*$/u).trim().regex(/^[A-Z]{2}$/)
8314
8433
  }).strict();
8315
- var controllerRegisterPrivacyContact = import_zod42.z.object({
8434
+ var controllerRegisterPrivacyContact = import_zod43.z.object({
8316
8435
  name: text2(200),
8317
8436
  email,
8318
- role: import_zod42.z.enum(["general", "appointed_dpo"])
8437
+ role: import_zod43.z.enum(["general", "appointed_dpo"])
8319
8438
  }).strict();
8320
- var controllerRegisterRepresentative = import_zod42.z.object({
8439
+ var controllerRegisterRepresentative = import_zod43.z.object({
8321
8440
  name: text2(200),
8322
8441
  email,
8323
8442
  address: text2(500)
8324
8443
  }).strict();
8325
- var controllerRegisterWrite = import_zod42.z.object({
8444
+ var controllerRegisterWrite = import_zod43.z.object({
8326
8445
  legalName: text2(200),
8327
8446
  address: controllerRegisterAddress,
8328
8447
  privacyContact: controllerRegisterPrivacyContact.nullable(),
@@ -8332,19 +8451,19 @@ var controllerRegisterWrite = import_zod42.z.object({
8332
8451
  var controllerRegisterOrgRecord = controllerRegisterWrite.extend({
8333
8452
  legalName: text2(200).nullable(),
8334
8453
  address: controllerRegisterAddress.nullable(),
8335
- updatedAt: import_zod42.z.iso.datetime(),
8336
- updatedByKind: import_zod42.z.enum(["owner", "operator"]),
8337
- updatedById: import_zod42.z.uuid()
8454
+ updatedAt: import_zod43.z.iso.datetime(),
8455
+ updatedByKind: import_zod43.z.enum(["owner", "operator"]),
8456
+ updatedById: import_zod43.z.uuid()
8338
8457
  }).strict();
8339
- var controllerRegisterOrgResponse = import_zod42.z.object({
8340
- orgId: import_zod42.z.uuid(),
8458
+ var controllerRegisterOrgResponse = import_zod43.z.object({
8459
+ orgId: import_zod43.z.uuid(),
8341
8460
  details: controllerRegisterOrgRecord.nullable()
8342
8461
  }).strict();
8343
8462
 
8344
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/billing.js
8345
- var import_zod43 = require("zod");
8463
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/billing.js
8464
+ var import_zod44 = require("zod");
8346
8465
 
8347
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/iana-time-zones.js
8466
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/iana-time-zones.js
8348
8467
  var ianaTimeZones = [
8349
8468
  "UTC",
8350
8469
  "Etc/UTC",
@@ -8769,8 +8888,8 @@ var ianaTimeZones = [
8769
8888
  "Pacific/Wallis"
8770
8889
  ];
8771
8890
 
8772
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/billing.js
8773
- var countryCode = import_zod43.z.string().regex(/^[A-Z]{2}$/);
8891
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/billing.js
8892
+ var countryCode = import_zod44.z.string().regex(/^[A-Z]{2}$/);
8774
8893
  var EU_COUNTRIES = [
8775
8894
  "AT",
8776
8895
  "BE",
@@ -8804,52 +8923,52 @@ var SELLER_COUNTRY = "DE";
8804
8923
  function isEuCountry(country) {
8805
8924
  return EU_COUNTRIES.includes(country);
8806
8925
  }
8807
- var payerKind = import_zod43.z.enum(["company", "person"]);
8808
- var billingCycle = import_zod43.z.enum(["monthly", "yearly"]);
8809
- var vatTreatment = import_zod43.z.enum(["de_standard", "reverse_charge", "outside_eu"]);
8810
- var payerRefusalRule = import_zod43.z.enum(["company_required", "vat_id_required", "vat_id_invalid"]);
8811
- var viesPendingReason = import_zod43.z.enum(["vies_unavailable", "vies_unverified", "vies_identifier_missing"]);
8812
- var viesOutage = import_zod43.z.object({
8813
- scope: import_zod43.z.enum(["member_state", "vies"]).meta({
8926
+ var payerKind = import_zod44.z.enum(["company", "person"]);
8927
+ var billingCycle = import_zod44.z.enum(["monthly", "yearly"]);
8928
+ var vatTreatment = import_zod44.z.enum(["de_standard", "reverse_charge", "outside_eu"]);
8929
+ var payerRefusalRule = import_zod44.z.enum(["company_required", "vat_id_required", "vat_id_invalid"]);
8930
+ var viesPendingReason = import_zod44.z.enum(["vies_unavailable", "vies_unverified", "vies_identifier_missing"]);
8931
+ var viesOutage = import_zod44.z.object({
8932
+ scope: import_zod44.z.enum(["member_state", "vies"]).meta({
8814
8933
  description: "`member_state`: the VAT register of `country` does not answer VIES. `vies`: VIES itself does not answer."
8815
8934
  }),
8816
8935
  country: countryCode.meta({ description: "The billing address's country whose VAT ID was asked for. Greece is `GR`, never VIES's `EL`." })
8817
8936
  }).strict();
8818
8937
  function viesPending(shape) {
8819
- return import_zod43.z.discriminatedUnion("reason", [
8820
- import_zod43.z.object({ ...shape, reason: import_zod43.z.literal("vies_unavailable"), vies_outage: viesOutage }).strict(),
8821
- import_zod43.z.object({ ...shape, reason: viesPendingReason.exclude(["vies_unavailable"]) }).strict()
8938
+ return import_zod44.z.discriminatedUnion("reason", [
8939
+ import_zod44.z.object({ ...shape, reason: import_zod44.z.literal("vies_unavailable"), vies_outage: viesOutage }).strict(),
8940
+ import_zod44.z.object({ ...shape, reason: viesPendingReason.exclude(["vies_unavailable"]) }).strict()
8822
8941
  ]);
8823
8942
  }
8824
- var vatDecision = import_zod43.z.discriminatedUnion("state", [
8825
- import_zod43.z.object({ state: import_zod43.z.literal("eligible"), treatment: vatTreatment, rate_percent: import_zod43.z.number().int().min(0).max(100) }).strict(),
8826
- viesPending({ state: import_zod43.z.literal("pending") }),
8827
- import_zod43.z.object({ state: import_zod43.z.literal("refused"), rule: payerRefusalRule }).strict()
8943
+ var vatDecision = import_zod44.z.discriminatedUnion("state", [
8944
+ import_zod44.z.object({ state: import_zod44.z.literal("eligible"), treatment: vatTreatment, rate_percent: import_zod44.z.number().int().min(0).max(100) }).strict(),
8945
+ viesPending({ state: import_zod44.z.literal("pending") }),
8946
+ import_zod44.z.object({ state: import_zod44.z.literal("refused"), rule: payerRefusalRule }).strict()
8828
8947
  ]);
8829
- var billingAddress = import_zod43.z.object({
8830
- line1: import_zod43.z.string().trim().min(1).max(200).meta({ description: "Street and number, or the first address line." }),
8831
- line2: import_zod43.z.string().trim().max(200).nullable().meta({ description: "A second address line, or `null` when there is none." }),
8832
- postal_code: import_zod43.z.string().trim().min(1).max(20).meta({ description: "Postal or ZIP code." }),
8833
- city: import_zod43.z.string().trim().min(1).max(100).meta({ description: "City or town." }),
8948
+ var billingAddress = import_zod44.z.object({
8949
+ line1: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Street and number, or the first address line." }),
8950
+ line2: import_zod44.z.string().trim().max(200).nullable().meta({ description: "A second address line, or `null` when there is none." }),
8951
+ postal_code: import_zod44.z.string().trim().min(1).max(20).meta({ description: "Postal or ZIP code." }),
8952
+ city: import_zod44.z.string().trim().min(1).max(100).meta({ description: "City or town." }),
8834
8953
  country: countryCode.meta({ description: "The billing country, used for purchase eligibility and VAT." }),
8835
- state: import_zod43.z.string().trim().min(1).max(100).optional().meta({ description: "State or region. A new US purchase requires a two-letter state code; historical addresses may omit it." })
8954
+ state: import_zod44.z.string().trim().min(1).max(100).optional().meta({ description: "State or region. A new US purchase requires a two-letter state code; historical addresses may omit it." })
8836
8955
  }).strict();
8837
- var billingDetails = import_zod43.z.discriminatedUnion("kind", [
8838
- import_zod43.z.object({
8839
- kind: import_zod43.z.literal("company").meta({ description: "Billed as a company." }),
8840
- company_name: import_zod43.z.string().trim().min(1).max(200).meta({ description: "The company's legal name, printed on the invoice." }),
8841
- vat_id: import_zod43.z.string().trim().max(20).nullable().meta({
8956
+ var billingDetails = import_zod44.z.discriminatedUnion("kind", [
8957
+ import_zod44.z.object({
8958
+ kind: import_zod44.z.literal("company").meta({ description: "Billed as a company." }),
8959
+ company_name: import_zod44.z.string().trim().min(1).max(200).meta({ description: "The company's legal name, printed on the invoice." }),
8960
+ vat_id: import_zod44.z.string().trim().max(20).nullable().meta({
8842
8961
  description: "The company's VAT ID, or `null` for none. Required for a new purchase in another EU country; direct VIES must confirm it with an identifier."
8843
8962
  }),
8844
- tax_id: import_zod43.z.string().trim().max(100).nullable().optional().meta({ description: "Free-text Tax ID. Required for a new non-EU purchase; historical records may omit it." }),
8963
+ tax_id: import_zod44.z.string().trim().max(100).nullable().optional().meta({ description: "Free-text Tax ID. Required for a new non-EU purchase; historical records may omit it." }),
8845
8964
  address: billingAddress.meta({ description: "The billing address." }),
8846
- invoice_email: import_zod43.z.email().meta({ description: "Where invoices and billing mail are sent." })
8965
+ invoice_email: import_zod44.z.email().meta({ description: "Where invoices and billing mail are sent." })
8847
8966
  }).strict().meta({ description: "A company: name and an optional VAT ID, never 'full name'." }),
8848
- import_zod43.z.object({
8849
- kind: import_zod43.z.literal("person").meta({ description: "Billed as a person." }),
8850
- full_name: import_zod43.z.string().trim().min(1).max(200).meta({ description: "The person's full name, printed on the invoice." }),
8967
+ import_zod44.z.object({
8968
+ kind: import_zod44.z.literal("person").meta({ description: "Billed as a person." }),
8969
+ full_name: import_zod44.z.string().trim().min(1).max(200).meta({ description: "The person's full name, printed on the invoice." }),
8851
8970
  address: billingAddress.meta({ description: "The billing address." }),
8852
- invoice_email: import_zod43.z.email().meta({ description: "Where invoices and billing mail are sent." })
8971
+ invoice_email: import_zod44.z.email().meta({ description: "Where invoices and billing mail are sent." })
8853
8972
  }).strict().meta({ description: "A person: a full name, never a VAT ID \u2014 only a company can be VAT-registered." })
8854
8973
  ]);
8855
8974
  var purchaseBillingDetails = billingDetails.options[0].superRefine((payer, ctx) => {
@@ -8864,55 +8983,55 @@ var purchaseBillingDetails = billingDetails.options[0].superRefine((payer, ctx)
8864
8983
  ctx.addIssue({ code: "custom", path: ["address", "state"], message: "us_state_required" });
8865
8984
  }
8866
8985
  }).meta({ description: "New company purchase. Other EU countries require VAT ID; non-EU requires Tax ID; US requires two-letter state. Cloud additionally checks the versioned public-email policy and current VIES evidence." });
8867
- var purchaseOperation = import_zod43.z.enum(["checkout", "paid_change", "invoice_payment", "payment_method_invoice", "mandate_setup"]);
8986
+ var purchaseOperation = import_zod44.z.enum(["checkout", "paid_change", "invoice_payment", "payment_method_invoice", "mandate_setup"]);
8868
8987
  var chargeOperation = purchaseOperation.exclude(["mandate_setup"]);
8869
- var checkoutRequest = import_zod43.z.object({
8988
+ var checkoutRequest = import_zod44.z.object({
8870
8989
  operation_key: purchaseOperationKey,
8871
- plan: import_zod43.z.enum(["plus", "pro"]).meta({ description: "The paid plan to buy; Basic requires no checkout." }),
8990
+ plan: import_zod44.z.enum(["plus", "pro"]).meta({ description: "The paid plan to buy; Basic requires no checkout." }),
8872
8991
  cycle: billingCycle.meta({ description: "Monthly, or yearly at 15 percent off." }),
8873
8992
  addons: orgAddons.partial().strict().optional().meta({ description: "Add-on units to buy; Pro only. Cloud refuses add-ons on Plus." }),
8874
8993
  billing: purchaseBillingDetails.meta({ description: "The company buying the plan. Country requirements, current VIES and the email policy must pass before charging." }),
8875
- accept_terms: import_zod43.z.literal(true).optional().meta({ description: "Deprecated draft input. It is not evidence of a displayed C.4 declaration and never confirms an order." })
8994
+ accept_terms: import_zod44.z.literal(true).optional().meta({ description: "Deprecated draft input. It is not evidence of a displayed C.4 declaration and never confirms an order." })
8876
8995
  }).strict();
8877
- var purchaseCents = import_zod43.z.number().int().nonnegative();
8878
- var purchaseQuote = import_zod43.z.object({
8879
- currency: import_zod43.z.literal("eur").meta({ description: "Every new quote is in EUR." }),
8996
+ var purchaseCents = import_zod44.z.number().int().nonnegative();
8997
+ var purchaseQuote = import_zod44.z.object({
8998
+ currency: import_zod44.z.literal("eur").meta({ description: "Every new quote is in EUR." }),
8880
8999
  net_cents: purchaseCents.meta({ description: "Current charge excluding VAT, in cents." }),
8881
9000
  vat_cents: purchaseCents.meta({ description: "VAT on the current charge, in cents." }),
8882
9001
  gross_cents: purchaseCents.meta({ description: "Total to confirm, including VAT, in cents." }),
8883
- rate_percent: import_zod43.z.number().int().min(0).max(100).meta({ description: "VAT rate in whole percent." })
9002
+ rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "VAT rate in whole percent." })
8884
9003
  }).strict();
8885
9004
  var quoteIdentity = {
8886
- quote_revision: import_zod43.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of the displayed quote; echo it when confirming." }),
8887
- buyer_fingerprint: import_zod43.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of buyer details and email policy; never full VIES evidence." })
9005
+ quote_revision: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of the displayed quote; echo it when confirming." }),
9006
+ buyer_fingerprint: import_zod44.z.string().trim().min(1).max(200).meta({ description: "Opaque revision of buyer details and email policy; never full VIES evidence." })
8888
9007
  };
8889
- var billingDecisionDisplayRequest = import_zod43.z.object({
9008
+ var billingDecisionDisplayRequest = import_zod44.z.object({
8890
9009
  operation_key: purchaseOperationKey,
8891
- operation: import_zod43.z.enum(["checkout", "paid_change"])
9010
+ operation: import_zod44.z.enum(["checkout", "paid_change"])
8892
9011
  }).strict();
8893
9012
  var selectionBase = {
8894
- plan: import_zod43.z.enum(["basic", "plus", "pro"]),
9013
+ plan: import_zod44.z.enum(["basic", "plus", "pro"]),
8895
9014
  cycle: billingCycle,
8896
9015
  addons: orgAddons
8897
9016
  };
8898
- var purchaseSelection = import_zod43.z.object(selectionBase).strict();
8899
- var planChangeSelection = import_zod43.z.object({ ...selectionBase, keep: planChangeKeep.nullable() }).strict();
8900
- var addonLine = import_zod43.z.object({ addon: addonKey, quantity: import_zod43.z.number().int().positive(), net_cents: purchaseCents }).strict();
9017
+ var purchaseSelection = import_zod44.z.object(selectionBase).strict();
9018
+ var planChangeSelection = import_zod44.z.object({ ...selectionBase, keep: planChangeKeep.nullable() }).strict();
9019
+ var addonLine = import_zod44.z.object({ addon: addonKey, quantity: import_zod44.z.number().int().positive(), net_cents: purchaseCents }).strict();
8901
9020
  var treatmentRules = [
8902
9021
  { if: { properties: { vat_treatment: { const: "de_standard" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 19 } } } } } },
8903
9022
  { if: { properties: { vat_treatment: { const: "reverse_charge" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 0 }, vat_cents: { const: 0 } } }, period_vat_cents: { const: 0 }, vat_treatment_line: { const: "Reverse charge \u2014 VAT payable by the recipient" } } } },
8904
9023
  { if: { properties: { vat_treatment: { const: "outside_eu" } }, required: ["vat_treatment"] }, then: { properties: { quote: { properties: { rate_percent: { const: 0 }, vat_cents: { const: 0 } } }, period_vat_cents: { const: 0 }, vat_treatment_line: { const: "Not taxable in Germany" } } } }
8905
9024
  ];
8906
- var billingDecisionAmounts = import_zod43.z.object({
8907
- currency: import_zod43.z.literal("eur"),
9025
+ var billingDecisionAmounts = import_zod44.z.object({
9026
+ currency: import_zod44.z.literal("eur"),
8908
9027
  quote: purchaseQuote,
8909
9028
  plan_net_cents: purchaseCents,
8910
- addon_lines: import_zod43.z.array(addonLine),
9029
+ addon_lines: import_zod44.z.array(addonLine),
8911
9030
  period_net_cents: purchaseCents,
8912
9031
  period_vat_cents: purchaseCents,
8913
9032
  period_gross_cents: purchaseCents,
8914
9033
  vat_treatment: vatTreatment,
8915
- vat_treatment_line: import_zod43.z.string().min(1),
9034
+ vat_treatment_line: import_zod44.z.string().min(1),
8916
9035
  due_today_gross_cents: purchaseCents,
8917
9036
  prorated_net_cents: purchaseCents.nullable(),
8918
9037
  renewal_net_cents: purchaseCents
@@ -8933,8 +9052,8 @@ var billingDecisionAmounts = import_zod43.z.object({
8933
9052
  invalid("vat_treatment", "Zero-rated treatment, rate, VAT and line must agree.");
8934
9053
  }
8935
9054
  }).meta({ allOf: treatmentRules });
8936
- var utcInstant = import_zod43.z.iso.datetime().regex(/Z$/);
8937
- var ianaTimeZone = import_zod43.z.enum(ianaTimeZones);
9055
+ var utcInstant = import_zod44.z.iso.datetime().regex(/Z$/);
9056
+ var ianaTimeZone = import_zod44.z.enum(ianaTimeZones);
8938
9057
  function localDate(instant, timeZone) {
8939
9058
  try {
8940
9059
  const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(instant));
@@ -8944,16 +9063,16 @@ function localDate(instant, timeZone) {
8944
9063
  return null;
8945
9064
  }
8946
9065
  }
8947
- var existingBillingPeriod = import_zod43.z.object({
8948
- anchor: import_zod43.z.literal("existing_period"),
9066
+ var existingBillingPeriod = import_zod44.z.object({
9067
+ anchor: import_zod44.z.literal("existing_period"),
8949
9068
  display_time_zone: ianaTimeZone,
8950
- starts_on: import_zod43.z.iso.date(),
9069
+ starts_on: import_zod44.z.iso.date(),
8951
9070
  starts_at: utcInstant.nullable(),
8952
9071
  current_period_ends_at: utcInstant,
8953
9072
  renews_at: utcInstant,
8954
- effective: import_zod43.z.discriminatedUnion("mode", [
8955
- import_zod43.z.object({ mode: import_zod43.z.literal("on_confirmation"), quoted_as_of_at: utcInstant, local_date: import_zod43.z.iso.date() }).strict(),
8956
- import_zod43.z.object({ mode: import_zod43.z.literal("scheduled"), at: utcInstant, at_period_end: import_zod43.z.boolean() }).strict()
9073
+ effective: import_zod44.z.discriminatedUnion("mode", [
9074
+ import_zod44.z.object({ mode: import_zod44.z.literal("on_confirmation"), quoted_as_of_at: utcInstant, local_date: import_zod44.z.iso.date() }).strict(),
9075
+ import_zod44.z.object({ mode: import_zod44.z.literal("scheduled"), at: utcInstant, at_period_end: import_zod44.z.boolean() }).strict()
8957
9076
  ])
8958
9077
  }).strict().superRefine((period, ctx) => {
8959
9078
  if (period.starts_at && localDate(period.starts_at, period.display_time_zone) !== period.starts_on)
@@ -8963,21 +9082,21 @@ var existingBillingPeriod = import_zod43.z.object({
8963
9082
  if (period.effective.mode === "on_confirmation" && localDate(period.effective.quoted_as_of_at, period.display_time_zone) !== period.effective.local_date)
8964
9083
  ctx.addIssue({ code: "custom", path: ["effective", "local_date"], message: "Quoted local date must match the display zone." });
8965
9084
  });
8966
- var firstPaymentPeriod = import_zod43.z.discriminatedUnion("cycle", [
8967
- import_zod43.z.strictObject({
8968
- anchor: import_zod43.z.literal("on_first_successful_payment"),
8969
- cycle: import_zod43.z.literal("monthly"),
8970
- start_statement: import_zod43.z.literal("Starts when your first payment succeeds"),
8971
- period_statement: import_zod43.z.literal("First billing period: one full month from successful payment; renews at the end of that period")
9085
+ var firstPaymentPeriod = import_zod44.z.discriminatedUnion("cycle", [
9086
+ import_zod44.z.strictObject({
9087
+ anchor: import_zod44.z.literal("on_first_successful_payment"),
9088
+ cycle: import_zod44.z.literal("monthly"),
9089
+ start_statement: import_zod44.z.literal("Starts when your first payment succeeds"),
9090
+ period_statement: import_zod44.z.literal("First billing period: one full month from successful payment; renews at the end of that period")
8972
9091
  }),
8973
- import_zod43.z.strictObject({
8974
- anchor: import_zod43.z.literal("on_first_successful_payment"),
8975
- cycle: import_zod43.z.literal("yearly"),
8976
- start_statement: import_zod43.z.literal("Starts when your first payment succeeds"),
8977
- period_statement: import_zod43.z.literal("First billing period: one full year from successful payment; renews at the end of that period")
9092
+ import_zod44.z.strictObject({
9093
+ anchor: import_zod44.z.literal("on_first_successful_payment"),
9094
+ cycle: import_zod44.z.literal("yearly"),
9095
+ start_statement: import_zod44.z.literal("Starts when your first payment succeeds"),
9096
+ period_statement: import_zod44.z.literal("First billing period: one full year from successful payment; renews at the end of that period")
8978
9097
  })
8979
9098
  ]);
8980
- var billingDecisionPeriod = import_zod43.z.union([existingBillingPeriod, firstPaymentPeriod]);
9099
+ var billingDecisionPeriod = import_zod44.z.union([existingBillingPeriod, firstPaymentPeriod]);
8981
9100
  function formatEur(cents3) {
8982
9101
  if (!Number.isSafeInteger(cents3))
8983
9102
  throw new Error(`formatEur: ${cents3} is not a whole number of cents`);
@@ -9069,10 +9188,10 @@ var labelRules = {
9069
9188
  "C4-1168-cancel": { const: "Cancel at period end" },
9070
9189
  "C4-1168-keep-basic": { const: "Delete the rest and stay on Basic" }
9071
9190
  };
9072
- var declaration = import_zod43.z.object({
9073
- text_id: import_zod43.z.enum(C4_TEXT_IDS).meta({ description: "The approved sentence this display shows, one per action." }),
9074
- text: import_zod43.z.string().min(1).regex(/^By selecting “/).meta({ description: "The consent sentence shown directly above the button, naming the button." }),
9075
- action_label: import_zod43.z.string().min(1).meta({ description: "The label of the one button that confirms this decision." }),
9191
+ var declaration = import_zod44.z.object({
9192
+ text_id: import_zod44.z.enum(C4_TEXT_IDS).meta({ description: "The approved sentence this display shows, one per action." }),
9193
+ text: import_zod44.z.string().min(1).regex(/^By selecting “/).meta({ description: "The consent sentence shown directly above the button, naming the button." }),
9194
+ action_label: import_zod44.z.string().min(1).meta({ description: "The label of the one button that confirms this decision." }),
9076
9195
  ...legalLinks
9077
9196
  }).strict().superRefine(separateLegalLinks).meta({
9078
9197
  allOf: C4_TEXT_IDS.map((textId) => ({
@@ -9080,32 +9199,32 @@ var declaration = import_zod43.z.object({
9080
9199
  then: { properties: { action_label: labelRules[textId] } }
9081
9200
  }))
9082
9201
  });
9083
- var legacyDeclaration = import_zod43.z.object({
9084
- text_id: import_zod43.z.literal(LEGACY_C4_TEXT_ID),
9085
- text: import_zod43.z.string().min(1),
9202
+ var legacyDeclaration = import_zod44.z.object({
9203
+ text_id: import_zod44.z.literal(LEGACY_C4_TEXT_ID),
9204
+ text: import_zod44.z.string().min(1),
9086
9205
  ...legalLinks
9087
9206
  }).strict().superRefine(separateLegalLinks);
9088
- var snapshotBase = import_zod43.z.object({
9089
- snapshot_id: import_zod43.z.uuid(),
9090
- decision_id: import_zod43.z.uuid(),
9207
+ var snapshotBase = import_zod44.z.object({
9208
+ snapshot_id: import_zod44.z.uuid(),
9209
+ decision_id: import_zod44.z.uuid(),
9091
9210
  operation_key: purchaseOperationKey,
9092
- owner_id: import_zod43.z.uuid(),
9093
- organization_id: import_zod43.z.uuid(),
9094
- organization_name: import_zod43.z.string().min(1),
9211
+ owner_id: import_zod44.z.uuid(),
9212
+ organization_id: import_zod44.z.uuid(),
9213
+ organization_name: import_zod44.z.string().min(1),
9095
9214
  ...quoteIdentity,
9096
9215
  amounts: billingDecisionAmounts,
9097
9216
  period: billingDecisionPeriod,
9098
- future_price_replacement: import_zod43.z.strictObject({ agreement_id: import_zod43.z.uuid(), text: import_zod43.z.string().min(1).regex(/\S/) }).nullable(),
9217
+ future_price_replacement: import_zod44.z.strictObject({ agreement_id: import_zod44.z.uuid(), text: import_zod44.z.string().min(1).regex(/\S/) }).nullable(),
9099
9218
  declaration,
9100
9219
  expires_at: utcInstant
9101
9220
  }).strict();
9102
9221
  var snapshotVariants = [
9103
- snapshotBase.extend({ decision_kind: import_zod43.z.literal("checkout"), selection: purchaseSelection }).strict(),
9104
- snapshotBase.extend({ decision_kind: import_zod43.z.literal("paid_change"), selection: purchaseSelection, period: existingBillingPeriod }).strict(),
9105
- snapshotBase.extend({ decision_kind: import_zod43.z.literal("plan_change"), selection: planChangeSelection, period: existingBillingPeriod }).strict()
9222
+ snapshotBase.extend({ decision_kind: import_zod44.z.literal("checkout"), selection: purchaseSelection }).strict(),
9223
+ snapshotBase.extend({ decision_kind: import_zod44.z.literal("paid_change"), selection: purchaseSelection, period: existingBillingPeriod }).strict(),
9224
+ snapshotBase.extend({ decision_kind: import_zod44.z.literal("plan_change"), selection: planChangeSelection, period: existingBillingPeriod }).strict()
9106
9225
  ];
9107
- var storedDeclaration = import_zod43.z.union([declaration, legacyDeclaration]);
9108
- var storedSnapshotVariants = import_zod43.z.discriminatedUnion("decision_kind", [
9226
+ var storedDeclaration = import_zod44.z.union([declaration, legacyDeclaration]);
9227
+ var storedSnapshotVariants = import_zod44.z.discriminatedUnion("decision_kind", [
9109
9228
  snapshotVariants[0].extend({ declaration: storedDeclaration }).strict(),
9110
9229
  snapshotVariants[1].extend({ declaration: storedDeclaration }).strict(),
9111
9230
  snapshotVariants[2].extend({ declaration: storedDeclaration }).strict()
@@ -9157,9 +9276,9 @@ var snapshotRules = { allOf: ["monthly", "yearly"].map((cycle) => ({
9157
9276
  if: { properties: { period: { properties: { anchor: { const: "on_first_successful_payment" }, cycle: { const: cycle } }, required: ["anchor", "cycle"] } }, required: ["period"] },
9158
9277
  then: { properties: { selection: { properties: { cycle: { const: cycle } }, required: ["cycle"] } }, required: ["selection"] }
9159
9278
  })) };
9160
- var billingDecisionSnapshot = import_zod43.z.discriminatedUnion("decision_kind", snapshotVariants).superRefine(refineSnapshot).meta(snapshotRules);
9279
+ var billingDecisionSnapshot = import_zod44.z.discriminatedUnion("decision_kind", snapshotVariants).superRefine(refineSnapshot).meta(snapshotRules);
9161
9280
  var storedBillingDecisionSnapshot = storedSnapshotVariants.superRefine(refineSnapshot).meta(snapshotRules);
9162
- var billingDecisionDisplayResponse = import_zod43.z.object({
9281
+ var billingDecisionDisplayResponse = import_zod44.z.object({
9163
9282
  confirmation_proof: confirmationProof,
9164
9283
  expires_at: utcInstant,
9165
9284
  snapshot: billingDecisionSnapshot
@@ -9167,8 +9286,8 @@ var billingDecisionDisplayResponse = import_zod43.z.object({
9167
9286
  if (value.expires_at !== value.snapshot.expires_at)
9168
9287
  ctx.addIssue({ code: "custom", path: ["expires_at"], message: "Display and snapshot expiry must match." });
9169
9288
  });
9170
- var planChangePrepareResponse = import_zod43.z.object({
9171
- change_id: import_zod43.z.uuid(),
9289
+ var planChangePrepareResponse = import_zod44.z.object({
9290
+ change_id: import_zod44.z.uuid(),
9172
9291
  display: billingDecisionDisplayResponse
9173
9292
  }).strict().superRefine((value, ctx) => {
9174
9293
  if (value.display.snapshot.decision_kind !== "plan_change")
@@ -9177,20 +9296,20 @@ var planChangePrepareResponse = import_zod43.z.object({
9177
9296
  ctx.addIssue({ code: "custom", path: ["display", "snapshot", "decision_id"], message: "Display must refer to the prepared change." });
9178
9297
  }).meta({ allOf: [{ properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "plan_change" } } } } } } }] });
9179
9298
  var intentIdentity = {
9180
- intent_id: import_zod43.z.uuid().meta({ description: "Opaque persisted purchase intent identity." }),
9299
+ intent_id: import_zod44.z.uuid().meta({ description: "Opaque persisted purchase intent identity." }),
9181
9300
  operation_key: purchaseOperationKey,
9182
9301
  operation: chargeOperation,
9183
- invoice_id: import_zod43.z.uuid().optional().meta({
9302
+ invoice_id: import_zod44.z.uuid().optional().meta({
9184
9303
  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."
9185
9304
  })
9186
9305
  };
9187
- var purchaseHoldReason = import_zod43.z.enum([
9306
+ var purchaseHoldReason = import_zod44.z.enum([
9188
9307
  "legacy_usd_invoice",
9189
9308
  "legacy_payer_unresolved",
9190
9309
  "mandate_policy_unresolved",
9191
9310
  "issuer_cutover_in_progress"
9192
9311
  ]);
9193
- var purchaseRefusalRule = import_zod43.z.enum(["company_required", "vat_id_required", "vat_id_invalid", "tax_id_required", "us_state_required", "public_email_domain", "invoice_not_open"]);
9312
+ var purchaseRefusalRule = import_zod44.z.enum(["company_required", "vat_id_required", "vat_id_invalid", "tax_id_required", "us_state_required", "public_email_domain", "invoice_not_open"]);
9194
9313
  var intentRules = [
9195
9314
  { if: { properties: { operation: { enum: ["invoice_payment", "payment_method_invoice"] } }, required: ["operation"] }, then: { required: ["invoice_id"] } },
9196
9315
  { if: { properties: { operation: { const: "mandate_setup" } }, required: ["operation"] }, then: { properties: { state: { enum: ["held", "payment_started"] } } } },
@@ -9215,49 +9334,49 @@ function validateIntent(intent, ctx) {
9215
9334
  ctx.addIssue({ code: "custom", path: ["payment"], message: "Owner checkout, invoice payment and mandate setup require a hosted payment." });
9216
9335
  }
9217
9336
  }
9218
- var awaitingVies = { ...intentIdentity, state: import_zod43.z.literal("awaiting_vies"), next_attempt_at: import_zod43.z.iso.datetime() };
9337
+ var awaitingVies = { ...intentIdentity, state: import_zod44.z.literal("awaiting_vies"), next_attempt_at: import_zod44.z.iso.datetime() };
9219
9338
  var draftVariants = [
9220
9339
  viesPending(awaitingVies),
9221
- import_zod43.z.object({ ...intentIdentity, ...quoteIdentity, state: import_zod43.z.literal("eligible"), quote: purchaseQuote }).strict(),
9222
- import_zod43.z.object({
9340
+ import_zod44.z.object({ ...intentIdentity, ...quoteIdentity, state: import_zod44.z.literal("eligible"), quote: purchaseQuote }).strict(),
9341
+ import_zod44.z.object({
9223
9342
  ...intentIdentity,
9224
9343
  operation: purchaseOperation,
9225
- state: import_zod43.z.literal("held"),
9344
+ state: import_zod44.z.literal("held"),
9226
9345
  reason: purchaseHoldReason,
9227
- original_amount: import_zod43.z.object({ currency: planCurrency, gross_cents: purchaseCents }).strict().optional().meta({ description: "Recorded balance of a held invoice; not a new quote or authorization." })
9346
+ original_amount: import_zod44.z.object({ currency: planCurrency, gross_cents: purchaseCents }).strict().optional().meta({ description: "Recorded balance of a held invoice; not a new quote or authorization." })
9228
9347
  }).strict(),
9229
- import_zod43.z.object({ ...intentIdentity, state: import_zod43.z.literal("invalid_vat_id"), field: import_zod43.z.literal("billing.vat_id"), rule: import_zod43.z.literal("vat_id_invalid") }).strict(),
9230
- import_zod43.z.object({ ...intentIdentity, state: import_zod43.z.literal("refused"), field: import_zod43.z.string().min(1), rule: purchaseRefusalRule }).strict()
9348
+ import_zod44.z.object({ ...intentIdentity, state: import_zod44.z.literal("invalid_vat_id"), field: import_zod44.z.literal("billing.vat_id"), rule: import_zod44.z.literal("vat_id_invalid") }).strict(),
9349
+ import_zod44.z.object({ ...intentIdentity, state: import_zod44.z.literal("refused"), field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict()
9231
9350
  ];
9232
- var purchaseIntentDraft = import_zod43.z.discriminatedUnion("state", draftVariants).superRefine(validateIntent).meta({ allOf: intentRules });
9233
- var paymentStartedVariant = import_zod43.z.object({
9351
+ var purchaseIntentDraft = import_zod44.z.discriminatedUnion("state", draftVariants).superRefine(validateIntent).meta({ allOf: intentRules });
9352
+ var paymentStartedVariant = import_zod44.z.object({
9234
9353
  ...intentIdentity,
9235
9354
  operation: purchaseOperation,
9236
- state: import_zod43.z.literal("payment_started"),
9237
- payment_id: import_zod43.z.uuid(),
9238
- payment: import_zod43.z.discriminatedUnion("kind", [
9239
- import_zod43.z.object({ kind: import_zod43.z.literal("hosted"), checkout_id: import_zod43.z.uuid(), checkout_url: import_zod43.z.url() }).strict(),
9240
- import_zod43.z.object({ kind: import_zod43.z.literal("mandate") }).strict()
9355
+ state: import_zod44.z.literal("payment_started"),
9356
+ payment_id: import_zod44.z.uuid(),
9357
+ payment: import_zod44.z.discriminatedUnion("kind", [
9358
+ import_zod44.z.object({ kind: import_zod44.z.literal("hosted"), checkout_id: import_zod44.z.uuid(), checkout_url: import_zod44.z.url() }).strict(),
9359
+ import_zod44.z.object({ kind: import_zod44.z.literal("mandate") }).strict()
9241
9360
  ])
9242
9361
  }).strict();
9243
9362
  var purchaseIntentPaymentStarted = paymentStartedVariant.superRefine(validateIntent).meta({ allOf: intentRules });
9244
- var purchaseIntentAcceptedWithoutPayment = import_zod43.z.object({
9245
- intent_id: import_zod43.z.uuid(),
9363
+ var purchaseIntentAcceptedWithoutPayment = import_zod44.z.object({
9364
+ intent_id: import_zod44.z.uuid(),
9246
9365
  operation_key: purchaseOperationKey,
9247
- operation: import_zod43.z.literal("paid_change"),
9248
- state: import_zod43.z.literal("accepted_no_payment"),
9366
+ operation: import_zod44.z.literal("paid_change"),
9367
+ state: import_zod44.z.literal("accepted_no_payment"),
9249
9368
  ...quoteIdentity,
9250
- quote: purchaseQuote.extend({ net_cents: import_zod43.z.literal(0), vat_cents: import_zod43.z.literal(0), gross_cents: import_zod43.z.literal(0) }).strict(),
9369
+ quote: purchaseQuote.extend({ net_cents: import_zod44.z.literal(0), vat_cents: import_zod44.z.literal(0), gross_cents: import_zod44.z.literal(0) }).strict(),
9251
9370
  accepted_at: utcInstant
9252
9371
  }).strict();
9253
- var purchaseIntent = import_zod43.z.discriminatedUnion("state", [
9372
+ var purchaseIntent = import_zod44.z.discriminatedUnion("state", [
9254
9373
  ...draftVariants,
9255
9374
  paymentStartedVariant,
9256
9375
  purchaseIntentAcceptedWithoutPayment
9257
9376
  ]).superRefine(validateIntent).meta({ allOf: intentRules });
9258
9377
  var nonChangeOperation = purchaseOperation.exclude(["paid_change"]);
9259
9378
  var nonChangeChargeOperation = chargeOperation.exclude(["paid_change"]);
9260
- var nonChangeDraft = import_zod43.z.discriminatedUnion("state", [
9379
+ var nonChangeDraft = import_zod44.z.discriminatedUnion("state", [
9261
9380
  viesPending({ ...awaitingVies, operation: nonChangeChargeOperation }),
9262
9381
  draftVariants[1].safeExtend({ operation: nonChangeChargeOperation }),
9263
9382
  draftVariants[2].safeExtend({ operation: nonChangeOperation }),
@@ -9265,37 +9384,37 @@ var nonChangeDraft = import_zod43.z.discriminatedUnion("state", [
9265
9384
  draftVariants[4].safeExtend({ operation: nonChangeChargeOperation })
9266
9385
  ]).superRefine(validateIntent).meta({ allOf: intentRules });
9267
9386
  var nonChangePaymentStarted = paymentStartedVariant.safeExtend({ operation: nonChangeOperation }).superRefine(validateIntent).meta({ allOf: intentRules });
9268
- var paidChangeOperation = import_zod43.z.literal("paid_change");
9269
- var paidChangeDraft = import_zod43.z.discriminatedUnion("state", [
9387
+ var paidChangeOperation = import_zod44.z.literal("paid_change");
9388
+ var paidChangeDraft = import_zod44.z.discriminatedUnion("state", [
9270
9389
  draftVariants[1].safeExtend({ operation: paidChangeOperation }),
9271
9390
  draftVariants[2].safeExtend({ operation: paidChangeOperation }),
9272
9391
  draftVariants[3].safeExtend({ operation: paidChangeOperation }),
9273
9392
  draftVariants[4].safeExtend({ operation: paidChangeOperation })
9274
9393
  ]).superRefine(validateIntent).meta({ allOf: intentRules });
9275
- var checkoutResponse = import_zod43.z.union([nonChangeDraft, nonChangePaymentStarted]);
9394
+ var checkoutResponse = import_zod44.z.union([nonChangeDraft, nonChangePaymentStarted]);
9276
9395
  var checkoutIntentIdentity = {
9277
- intent_id: import_zod43.z.uuid().meta({ description: "The persisted checkout intent; confirm it with `POST /api/billing/intents/:id/confirm`." }),
9396
+ intent_id: import_zod44.z.uuid().meta({ description: "The persisted checkout intent; confirm it with `POST /api/billing/intents/:id/confirm`." }),
9278
9397
  operation_key: purchaseOperationKey,
9279
- operation: import_zod43.z.literal("checkout")
9398
+ operation: import_zod44.z.literal("checkout")
9280
9399
  };
9281
- var vatIdField = import_zod43.z.literal("billing.vat_id");
9282
- var checkoutStartResponse = import_zod43.z.discriminatedUnion("state", [
9283
- import_zod43.z.object({
9400
+ var vatIdField = import_zod44.z.literal("billing.vat_id");
9401
+ var checkoutStartResponse = import_zod44.z.discriminatedUnion("state", [
9402
+ import_zod44.z.object({
9284
9403
  ...checkoutIntentIdentity,
9285
- state: import_zod43.z.literal("eligible"),
9404
+ state: import_zod44.z.literal("eligible"),
9286
9405
  ...quoteIdentity,
9287
9406
  quote: purchaseQuote,
9288
9407
  display: billingDecisionDisplayResponse
9289
9408
  }).strict().meta({ description: "Eligible: the price is frozen and the display shown; one click on its button confirms." }),
9290
- viesPending({ state: import_zod43.z.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." }),
9291
- import_zod43.z.object({ state: import_zod43.z.literal("invalid_vat_id"), field: vatIdField, rule: import_zod43.z.literal("vat_id_invalid") }).strict().meta({ description: "VIES says the VAT ID is invalid. Nothing is stored." }),
9292
- import_zod43.z.object({ state: import_zod43.z.literal("refused"), field: import_zod43.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field the purchase cannot accept. Nothing is stored." }),
9293
- import_zod43.z.object({ ...checkoutIntentIdentity, state: import_zod43.z.literal("held"), reason: import_zod43.z.literal("issuer_cutover_in_progress") }).strict().meta({ description: "An issuer cutover is running; try again in a few minutes." }),
9294
- import_zod43.z.object({
9409
+ viesPending({ state: import_zod44.z.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." }),
9410
+ import_zod44.z.object({ state: import_zod44.z.literal("invalid_vat_id"), field: vatIdField, rule: import_zod44.z.literal("vat_id_invalid") }).strict().meta({ description: "VIES says the VAT ID is invalid. Nothing is stored." }),
9411
+ import_zod44.z.object({ state: import_zod44.z.literal("refused"), field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field the purchase cannot accept. Nothing is stored." }),
9412
+ import_zod44.z.object({ ...checkoutIntentIdentity, state: import_zod44.z.literal("held"), reason: import_zod44.z.literal("issuer_cutover_in_progress") }).strict().meta({ description: "An issuer cutover is running; try again in a few minutes." }),
9413
+ import_zod44.z.object({
9295
9414
  ...checkoutIntentIdentity,
9296
- state: import_zod43.z.literal("payment_started"),
9297
- payment_id: import_zod43.z.uuid(),
9298
- payment: import_zod43.z.object({ kind: import_zod43.z.literal("hosted"), checkout_id: import_zod43.z.uuid(), checkout_url: import_zod43.z.url() }).strict()
9415
+ state: import_zod44.z.literal("payment_started"),
9416
+ payment_id: import_zod44.z.uuid(),
9417
+ payment: import_zod44.z.object({ kind: import_zod44.z.literal("hosted"), checkout_id: import_zod44.z.uuid(), checkout_url: import_zod44.z.url() }).strict()
9299
9418
  }).strict().meta({ description: "The key was already confirmed: the hosted payment it started." })
9300
9419
  ]).superRefine((value, ctx) => {
9301
9420
  if (value.state !== "eligible")
@@ -9319,29 +9438,29 @@ var checkoutStartResponse = import_zod43.z.discriminatedUnion("state", [
9319
9438
  if: { properties: { state: { const: "eligible" } }, required: ["state"] },
9320
9439
  then: { properties: { display: { properties: { snapshot: { properties: { decision_kind: { const: "checkout" } } } } } } }
9321
9440
  }] });
9322
- var checkoutDraft = import_zod43.z.object({
9323
- plan: import_zod43.z.enum(["plus", "pro"]).meta({ description: "The plan last chosen on the checkout page." }),
9441
+ var checkoutDraft = import_zod44.z.object({
9442
+ plan: import_zod44.z.enum(["plus", "pro"]).meta({ description: "The plan last chosen on the checkout page." }),
9324
9443
  cycle: billingCycle.meta({ description: "The cycle last chosen." }),
9325
9444
  billing: purchaseBillingDetails.meta({ description: "The company details last sent to the checkout start." }),
9326
- updated_at: import_zod43.z.iso.datetime().meta({ description: "When the draft was last saved." })
9445
+ updated_at: import_zod44.z.iso.datetime().meta({ description: "When the draft was last saved." })
9327
9446
  }).strict();
9328
- var checkoutDraftResponse = import_zod43.z.object({
9447
+ var checkoutDraftResponse = import_zod44.z.object({
9329
9448
  draft: checkoutDraft.nullable().meta({ description: "The saved checkout draft, or `null`. Deleted once the checkout is paid." }),
9330
9449
  prefill: billingDetails.nullable().meta({ description: "The org's earlier billing details when there is no draft, else `null`." })
9331
9450
  }).strict().superRefine((value, ctx) => {
9332
9451
  if (value.draft !== null && value.prefill !== null)
9333
9452
  ctx.addIssue({ code: "custom", path: ["prefill"], message: "A draft answers alone; prefill is null beside it." });
9334
9453
  }).meta({ not: { properties: { draft: { type: "object" }, prefill: { type: "object" } }, required: ["draft", "prefill"] } });
9335
- var checkoutOpenDetails = import_zod43.z.object({
9336
- field: import_zod43.z.literal("billing"),
9337
- rule: import_zod43.z.literal("checkout_open"),
9338
- expires_at: import_zod43.z.iso.datetime().nullable().meta({ description: "When the open payment expires at the provider, or `null` when unknown." }),
9339
- checkout_url: import_zod43.z.url().nullable().meta({ description: "Where the open payment continues, or `null` when the provider no longer offers it." })
9454
+ var checkoutOpenDetails = import_zod44.z.object({
9455
+ field: import_zod44.z.literal("billing"),
9456
+ rule: import_zod44.z.literal("checkout_open"),
9457
+ expires_at: import_zod44.z.iso.datetime().nullable().meta({ description: "When the open payment expires at the provider, or `null` when unknown." }),
9458
+ checkout_url: import_zod44.z.url().nullable().meta({ description: "Where the open payment continues, or `null` when the provider no longer offers it." })
9340
9459
  }).strict();
9341
- var viesUnavailableDetails = viesPending({ field: vatIdField, rule: import_zod43.z.literal("vies_unavailable") });
9342
- var purchaseIntentLookupQuery = import_zod43.z.object({
9460
+ var viesUnavailableDetails = viesPending({ field: vatIdField, rule: import_zod44.z.literal("vies_unavailable") });
9461
+ var purchaseIntentLookupQuery = import_zod44.z.object({
9343
9462
  operation_key: purchaseOperationKey.optional().meta({ description: "The client operation key; supply this or intent_id, never both." }),
9344
- intent_id: import_zod43.z.uuid().optional().meta({ description: "The persisted intent ID; supply this or operation_key, never both." }),
9463
+ intent_id: import_zod44.z.uuid().optional().meta({ description: "The persisted intent ID; supply this or operation_key, never both." }),
9345
9464
  operation: purchaseOperation.meta({ description: "Expected operation; a mismatch returns 404 without disclosure." })
9346
9465
  }).strict().refine((q) => q.operation_key !== void 0 !== (q.intent_id !== void 0), {
9347
9466
  message: "Supply exactly one of operation_key or intent_id."
@@ -9354,163 +9473,160 @@ var purchaseIntentLookupQuery = import_zod43.z.object({
9354
9473
  });
9355
9474
  var provedConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity, confirmation_proof: confirmationProof };
9356
9475
  var invoiceConfirmation = { operation_key: purchaseOperationKey, ...quoteIdentity };
9357
- var purchaseIntentConfirmRequest = import_zod43.z.discriminatedUnion("operation", [
9358
- import_zod43.z.object({ ...provedConfirmation, operation: import_zod43.z.literal("checkout") }).strict(),
9359
- import_zod43.z.object({ ...provedConfirmation, operation: import_zod43.z.literal("paid_change") }).strict(),
9360
- import_zod43.z.object({ ...invoiceConfirmation, operation: import_zod43.z.literal("invoice_payment") }).strict(),
9361
- import_zod43.z.object({ ...invoiceConfirmation, operation: import_zod43.z.literal("payment_method_invoice") }).strict()
9476
+ var purchaseIntentConfirmRequest = import_zod44.z.discriminatedUnion("operation", [
9477
+ import_zod44.z.object({ ...provedConfirmation, operation: import_zod44.z.literal("checkout") }).strict(),
9478
+ import_zod44.z.object({ ...provedConfirmation, operation: import_zod44.z.literal("paid_change") }).strict(),
9479
+ import_zod44.z.object({ ...invoiceConfirmation, operation: import_zod44.z.literal("invoice_payment") }).strict(),
9480
+ import_zod44.z.object({ ...invoiceConfirmation, operation: import_zod44.z.literal("payment_method_invoice") }).strict()
9362
9481
  ]);
9363
- var purchaseConflictDetails = import_zod43.z.discriminatedUnion("rule", [
9364
- import_zod43.z.object({ field: import_zod43.z.literal("operation_key"), rule: import_zod43.z.literal("operation_key_reused") }).strict(),
9365
- import_zod43.z.object({ field: import_zod43.z.literal("confirmation_proof"), rule: import_zod43.z.literal("display_stale") }).strict().meta({ description: "The display was spent, expired or no longer matches: fetch a fresh one and press again." }),
9366
- import_zod43.z.object({ field: import_zod43.z.literal("intent"), rule: import_zod43.z.enum(["stale_quote", "buyer_changed", "not_eligible", "invoice_not_open"]), current_intent: purchaseIntent }).strict()
9482
+ var purchaseConflictDetails = import_zod44.z.discriminatedUnion("rule", [
9483
+ import_zod44.z.object({ field: import_zod44.z.literal("operation_key"), rule: import_zod44.z.literal("operation_key_reused") }).strict(),
9484
+ import_zod44.z.object({ field: import_zod44.z.literal("confirmation_proof"), rule: import_zod44.z.literal("display_stale") }).strict().meta({ description: "The display was spent, expired or no longer matches: fetch a fresh one and press again." }),
9485
+ import_zod44.z.object({ field: import_zod44.z.literal("intent"), rule: import_zod44.z.enum(["stale_quote", "buyer_changed", "not_eligible", "invoice_not_open"]), current_intent: purchaseIntent }).strict()
9367
9486
  ]);
9368
- var invoicePayRequest = import_zod43.z.object({ operation_key: purchaseOperationKey }).strict();
9369
- var checkoutStatus = import_zod43.z.object({
9370
- checkout_id: import_zod43.z.uuid().meta({ description: "The checkout this status is for." }),
9371
- status: import_zod43.z.enum(["pending", "paid", "failed", "canceled", "expired"]).meta({
9487
+ var invoicePayRequest = import_zod44.z.object({ operation_key: purchaseOperationKey }).strict();
9488
+ var checkoutStatus = import_zod44.z.object({
9489
+ checkout_id: import_zod44.z.uuid().meta({ description: "The checkout this status is for." }),
9490
+ status: import_zod44.z.enum(["pending", "paid", "failed", "canceled", "expired"]).meta({
9372
9491
  description: "Mollie's payment status, as `reconcilePayment` last read it."
9373
9492
  }),
9374
- purpose: import_zod43.z.enum(["upgrade", "payment_method", "invoice"]).meta({
9493
+ purpose: import_zod44.z.enum(["upgrade", "payment_method", "invoice"]).meta({
9375
9494
  description: "What this checkout paid for: a plan upgrade, a payment-method change, or an open invoice."
9376
9495
  }),
9377
9496
  plan: planId.meta({ description: "The org's plan after applying \u2014 unchanged unless `purpose` is `upgrade` and `status` is `paid`." })
9378
9497
  });
9379
- var vatIdStatus = import_zod43.z.enum(["valid", "unverified", "invalid", "unavailable"]);
9380
- var vatIdCheckRequest = import_zod43.z.object({
9498
+ var vatIdStatus = import_zod44.z.enum(["valid", "unverified", "invalid", "unavailable"]);
9499
+ var vatIdCheckRequest = import_zod44.z.object({
9381
9500
  country: countryCode.meta({ description: "The VAT ID's country." }),
9382
- vat_id: import_zod43.z.string().trim().min(1).max(20).meta({ description: "The VAT ID as typed; normalized before the VIES lookup (`normalizeVatId`)." })
9501
+ vat_id: import_zod44.z.string().trim().min(1).max(20).meta({ description: "The VAT ID as typed; normalized before the VIES lookup (`normalizeVatId`)." })
9383
9502
  }).strict();
9384
- var vatCheckIdentity = { vat_id: import_zod43.z.string(), name: import_zod43.z.string().nullable() };
9385
- var vatIdCheckResponse = import_zod43.z.discriminatedUnion("state", [
9386
- import_zod43.z.object({ ...vatCheckIdentity, state: import_zod43.z.literal("eligible"), status: import_zod43.z.literal("valid") }).strict(),
9387
- import_zod43.z.object({ ...vatCheckIdentity, state: import_zod43.z.literal("refused"), status: import_zod43.z.literal("invalid"), rule: import_zod43.z.literal("vat_id_invalid") }).strict(),
9388
- viesPending({ ...vatCheckIdentity, state: import_zod43.z.literal("pending"), status: import_zod43.z.enum(["valid", "unverified", "unavailable"]) })
9503
+ var vatCheckIdentity = { vat_id: import_zod44.z.string(), name: import_zod44.z.string().nullable() };
9504
+ var vatIdCheckResponse = import_zod44.z.discriminatedUnion("state", [
9505
+ import_zod44.z.object({ ...vatCheckIdentity, state: import_zod44.z.literal("eligible"), status: import_zod44.z.literal("valid") }).strict(),
9506
+ import_zod44.z.object({ ...vatCheckIdentity, state: import_zod44.z.literal("refused"), status: import_zod44.z.literal("invalid"), rule: import_zod44.z.literal("vat_id_invalid") }).strict(),
9507
+ viesPending({ ...vatCheckIdentity, state: import_zod44.z.literal("pending"), status: import_zod44.z.enum(["valid", "unverified", "unavailable"]) })
9389
9508
  ]);
9390
- var billingChangeRequest = import_zod43.z.object({
9509
+ var billingChangeRequest = import_zod44.z.object({
9391
9510
  operation_key: purchaseOperationKey,
9392
- plan: import_zod43.z.enum(["plus", "pro"]).optional().meta({ description: "The target plan. Omitted leaves the plan as it is." }),
9511
+ plan: import_zod44.z.enum(["plus", "pro"]).optional().meta({ description: "The target plan. Omitted leaves the plan as it is." }),
9393
9512
  cycle: billingCycle.optional().meta({ description: "The target cycle. Omitted leaves the cycle as it is." }),
9394
9513
  addons: orgAddons.partial().strict().optional().meta({
9395
9514
  description: "Absolute add-on counts to end up with, not a delta. Omitted leaves add-ons as they are."
9396
9515
  })
9397
9516
  }).strict().refine((r) => r.plan !== void 0 || r.cycle !== void 0 || r.addons !== void 0, { message: "Name a plan, a cycle or add-ons." });
9398
- var billingCancelRequest = import_zod43.z.object({
9399
- reason: import_zod43.z.string().trim().max(500).optional().meta({ description: "An optional free-text reason. Shown to nobody but Fleetless." })
9517
+ var billingCancelRequest = import_zod44.z.object({
9518
+ reason: import_zod44.z.string().trim().max(500).optional().meta({ description: "An optional free-text reason. Shown to nobody but Fleetless." })
9400
9519
  }).strict();
9401
- var billingDetailsUpdate = import_zod43.z.object({
9402
- company_name: import_zod43.z.string().trim().min(1).max(200).optional(),
9520
+ var billingDetailsUpdate = import_zod44.z.object({
9521
+ company_name: import_zod44.z.string().trim().min(1).max(200).optional(),
9403
9522
  address: billingAddress.optional(),
9404
- tax_id: import_zod43.z.string().trim().max(100).nullable().optional(),
9405
- invoice_email: import_zod43.z.email().optional().meta({ description: "Replaces the invoice email. Omitted leaves it as it is." }),
9406
- vat_id: import_zod43.z.string().trim().max(20).nullable().optional().meta({
9523
+ tax_id: import_zod44.z.string().trim().max(100).nullable().optional(),
9524
+ invoice_email: import_zod44.z.email().optional().meta({ description: "Replaces the invoice email. Omitted leaves it as it is." }),
9525
+ vat_id: import_zod44.z.string().trim().max(20).nullable().optional().meta({
9407
9526
  description: "Replaces the VAT ID; `null` clears it. Omitted leaves it as it is. A new ID is re-checked through VIES."
9408
9527
  })
9409
9528
  }).strict();
9410
- var billingDetailsConflictDetails = import_zod43.z.union([
9411
- import_zod43.z.object({ field: import_zod43.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field a purchase would refuse. Nothing is saved." }),
9529
+ var billingDetailsConflictDetails = import_zod44.z.union([
9530
+ import_zod44.z.object({ field: import_zod44.z.string().min(1), rule: purchaseRefusalRule }).strict().meta({ description: "A field a purchase would refuse. Nothing is saved." }),
9412
9531
  viesUnavailableDetails,
9413
- import_zod43.z.object({ field: import_zod43.z.literal("billing"), rule: import_zod43.z.literal("buyer_changed") }).strict().meta({ description: "The billing details changed meanwhile. Nothing is saved." })
9532
+ import_zod44.z.object({ field: import_zod44.z.literal("billing"), rule: import_zod44.z.literal("buyer_changed") }).strict().meta({ description: "The billing details changed meanwhile. Nothing is saved." })
9414
9533
  ]);
9415
- var paymentMethodKind = import_zod43.z.enum(["card", "paypal", "applepay"]);
9416
- var paymentMethodChangeRequest = import_zod43.z.object({
9417
- operation_key: purchaseOperationKey,
9418
- method: paymentMethodKind.meta({
9419
- description: "The new mandate's method. Offer what `billingView.payment_method_options` lists: `applepay` may be refused with `400 validation_error` `{ field: 'method', rule: 'applepay_needs_open_invoice' }` unless an invoice is open."
9420
- })
9534
+ var paymentMethodKind = import_zod44.z.enum(["card", "paypal", "applepay"]);
9535
+ var paymentMethodChangeRequest = import_zod44.z.object({
9536
+ operation_key: purchaseOperationKey
9421
9537
  }).strict();
9422
- var billingAccountStatus = import_zod43.z.enum(["pending", "active", "past_due", "canceled"]);
9423
- var paymentMethod = import_zod43.z.discriminatedUnion("kind", [
9424
- import_zod43.z.object({
9425
- kind: import_zod43.z.literal("card").meta({ description: "A card mandate." }),
9426
- brand: import_zod43.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Visa'." }),
9427
- last4: import_zod43.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card." }),
9428
- expires: import_zod43.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
9429
- }),
9430
- import_zod43.z.object({
9431
- kind: import_zod43.z.literal("applepay").meta({ description: "A card mandate from an Apple Pay first payment \u2014 Mollie stores it as `creditcard`; Fleetless labels it Apple Pay." }),
9432
- brand: import_zod43.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Mastercard'." }),
9433
- last4: import_zod43.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card behind Apple Pay." }),
9434
- expires: import_zod43.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
9435
- }),
9436
- import_zod43.z.object({
9437
- kind: import_zod43.z.literal("paypal").meta({ description: "A PayPal mandate." }),
9438
- account: import_zod43.z.string().meta({ description: "The PayPal account Mollie's mandate names." })
9538
+ var billingAccountStatus = import_zod44.z.enum(["pending", "active", "past_due", "canceled"]);
9539
+ var paymentMethod = import_zod44.z.discriminatedUnion("kind", [
9540
+ import_zod44.z.object({
9541
+ kind: import_zod44.z.literal("card").meta({ description: "A card mandate." }),
9542
+ brand: import_zod44.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Visa'." }),
9543
+ last4: import_zod44.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card." }),
9544
+ expires: import_zod44.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
9545
+ }),
9546
+ import_zod44.z.object({
9547
+ kind: import_zod44.z.literal("applepay").meta({ description: "A card mandate from an Apple Pay first payment \u2014 Mollie stores it as `creditcard`; Fleetless labels it Apple Pay." }),
9548
+ brand: import_zod44.z.string().meta({ description: "The card network, as Mollie's mandate reports it, e.g. 'Mastercard'." }),
9549
+ last4: import_zod44.z.string().regex(/^\d{4}$/).meta({ description: "The last four digits of the card behind Apple Pay." }),
9550
+ expires: import_zod44.z.string().regex(/^\d{2}\/\d{2}$/).meta({ description: "Expiry as Mollie's mandate shows it, 'MM/YY'." })
9551
+ }),
9552
+ import_zod44.z.object({
9553
+ kind: import_zod44.z.literal("paypal").meta({ description: "A PayPal mandate." }),
9554
+ account: import_zod44.z.string().meta({ description: "The PayPal account Mollie's mandate names." })
9439
9555
  })
9440
9556
  ]);
9441
- var invoiceStatus = import_zod43.z.enum(["open", "paid", "uncollectible", "cancelled"]);
9442
- var billingInvoice = import_zod43.z.object({
9443
- id: import_zod43.z.uuid().meta({ description: "The invoice's id." }),
9444
- number: import_zod43.z.string().regex(/^FL-\d{4}-\d{4,}$/).meta({
9557
+ var invoiceStatus = import_zod44.z.enum(["open", "paid", "uncollectible", "cancelled"]);
9558
+ var billingInvoice = import_zod44.z.object({
9559
+ id: import_zod44.z.uuid().meta({ description: "The invoice's id." }),
9560
+ number: import_zod44.z.string().regex(/^FL-\d{4}-\d{4,}$/).meta({
9445
9561
  description: "The invoice number: `FL-<year>-<seq>`, `seq` zero-padded to four digits, gapless per calendar year in `Europe/Berlin`."
9446
9562
  }),
9447
- issued_at: import_zod43.z.iso.datetime().meta({ description: "When the invoice was issued." }),
9563
+ issued_at: import_zod44.z.iso.datetime().meta({ description: "When the invoice was issued." }),
9448
9564
  status: invoiceStatus.meta({ description: "This invoice's own status." }),
9449
- cancellation_document_url: import_zod43.z.string().nullable().meta({
9565
+ cancellation_document_url: import_zod44.z.string().nullable().meta({
9450
9566
  description: "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
9451
9567
  }),
9452
9568
  currency: planCurrency.meta({ description: "The org's billing currency." }),
9453
- net_cents: import_zod43.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
9454
- vat_rate_percent: import_zod43.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
9455
- vat_cents: import_zod43.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
9456
- gross_cents: import_zod43.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." })
9569
+ net_cents: import_zod44.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
9570
+ vat_rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
9571
+ vat_cents: import_zod44.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
9572
+ gross_cents: import_zod44.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." })
9457
9573
  });
9458
- var billingInvoicePdfQuery = import_zod43.z.object({
9459
- kind: import_zod43.z.enum(["invoice", "cancellation"]).optional().meta({ description: "Omitted or `invoice` selects the original invoice PDF. `cancellation` is accepted but returns `404 not_found`: Cloud has no cancellation PDFs." })
9574
+ var billingInvoicePdfQuery = import_zod44.z.object({
9575
+ kind: import_zod44.z.enum(["invoice", "cancellation"]).optional().meta({ description: "Omitted or `invoice` selects the original invoice PDF. `cancellation` is accepted but returns `404 not_found`: Cloud has no cancellation PDFs." })
9460
9576
  }).strict();
9461
- var billingAccount = import_zod43.z.object({
9577
+ var billingAccount = import_zod44.z.object({
9462
9578
  payer: billingDetails.meta({ description: "Who is paying, and the invoice address and email." }),
9463
9579
  vat_id_status: vatIdStatus.nullable().meta({ description: "The payer's VAT ID check, or `null` when no VAT ID was given." }),
9464
- vat: import_zod43.z.object({
9580
+ vat: import_zod44.z.object({
9465
9581
  treatment: vatTreatment.meta({ description: "How the account is taxed." }),
9466
- rate_percent: import_zod43.z.number().int().meta({ description: "The VAT rate, in whole percent." })
9582
+ rate_percent: import_zod44.z.number().int().meta({ description: "The VAT rate, in whole percent." })
9467
9583
  }).nullable().meta({ description: "Recorded VAT treatment; null while the current buyer has no eligible decision. Never infer zero rating from a pending account." }),
9468
9584
  currency: planCurrency.meta({ description: "The org's billing currency, fixed at the first payment." }),
9469
9585
  cycle: billingCycle.meta({ description: "The current billing cycle." }),
9470
9586
  status: billingAccountStatus.meta({ description: "The account's own status." }),
9471
- period_starts_at: import_zod43.z.iso.datetime().nullable().meta({ description: "The current period's start. `null` before the first payment." }),
9472
- period_ends_at: import_zod43.z.iso.datetime().nullable().meta({ description: "The current period's end. `null` before the first payment." }),
9473
- next_charge: import_zod43.z.object({
9474
- at: import_zod43.z.iso.datetime().meta({ description: "When the next charge is due." }),
9475
- net_cents: import_zod43.z.number().int().meta({ description: "The next charge, excluding VAT, in integer cents." }),
9476
- vat_cents: import_zod43.z.number().int().meta({ description: "VAT on the next charge, in integer cents." }),
9477
- gross_cents: import_zod43.z.number().int().meta({ description: "The next charge including VAT, in integer cents." })
9587
+ period_starts_at: import_zod44.z.iso.datetime().nullable().meta({ description: "The current period's start. `null` before the first payment." }),
9588
+ period_ends_at: import_zod44.z.iso.datetime().nullable().meta({ description: "The current period's end. `null` before the first payment." }),
9589
+ next_charge: import_zod44.z.object({
9590
+ at: import_zod44.z.iso.datetime().meta({ description: "When the next charge is due." }),
9591
+ net_cents: import_zod44.z.number().int().meta({ description: "The next charge, excluding VAT, in integer cents." }),
9592
+ vat_cents: import_zod44.z.number().int().meta({ description: "VAT on the next charge, in integer cents." }),
9593
+ gross_cents: import_zod44.z.number().int().meta({ description: "The next charge including VAT, in integer cents." })
9478
9594
  }).nullable().meta({ description: "`null` while a cancel is pending or nothing else renews." }),
9479
- current_price: import_zod43.z.object({
9480
- net_cents: import_zod43.z.number().int().meta({
9595
+ current_price: import_zod44.z.object({
9596
+ net_cents: import_zod44.z.number().int().meta({
9481
9597
  description: "One period of the current plan, cycle and add-ons at the agreed price, excluding VAT, in integer cents."
9482
9598
  })
9483
9599
  }).nullable().meta({
9484
9600
  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."
9485
9601
  }),
9486
- scheduled: import_zod43.z.object({
9602
+ scheduled: import_zod44.z.object({
9487
9603
  cycle: billingCycle.nullable().meta({ description: "A cycle change queued for the period's end, or `null`." }),
9488
9604
  addons: orgAddons.nullable().meta({ description: "Add-on counts queued for the period's end, or `null`." })
9489
9605
  }).meta({ description: "What takes effect at the period's end." }),
9490
- dunning: import_zod43.z.object({
9491
- invoice_id: import_zod43.z.uuid().meta({
9606
+ dunning: import_zod44.z.object({
9607
+ invoice_id: import_zod44.z.uuid().meta({
9492
9608
  description: "What dunning is chasing: a historical open `FL-\u2026` invoice, or a due charge. Before the issuer cutover a due charge appears here only while the payer's VAT ID is unsettled; it has no number yet, is not in `invoices`, and `POST /api/billing/invoices/:id/pay` takes either. After the cutover this is always a due charge (in `charges`): pay it with `POST /api/billing/charges/:id/pay`."
9493
9609
  }),
9494
- gross_cents: import_zod43.z.number().int().meta({
9610
+ gross_cents: import_zod44.z.number().int().meta({
9495
9611
  description: "The amount owed, in integer cents \u2014 after a partial chargeback only the charged-back part."
9496
9612
  }),
9497
- due_at: import_zod43.z.iso.datetime().meta({ description: "The charge's due date; retries and the lock count from here." }),
9498
- next_retry_at: import_zod43.z.iso.datetime().nullable().meta({
9613
+ due_at: import_zod44.z.iso.datetime().meta({ description: "The charge's due date; retries and the lock count from here." }),
9614
+ next_retry_at: import_zod44.z.iso.datetime().nullable().meta({
9499
9615
  description: "The next automatic retry, or `null` once retries are exhausted. Always `null` after a chargeback: a charged-back payment is never charged again automatically."
9500
9616
  }),
9501
- lock_at: import_zod43.z.iso.datetime().meta({ description: "When the org is locked if still unpaid (`BILLING_LOCK_DAY`)." }),
9502
- failure: import_zod43.z.string().nullable().meta({
9617
+ lock_at: import_zod44.z.iso.datetime().meta({ description: "When the org is locked if still unpaid (`BILLING_LOCK_DAY`)." }),
9618
+ failure: import_zod44.z.string().nullable().meta({
9503
9619
  description: "Mollie's own reason, e.g. 'card_expired'; 'vat_id_invalid' while a renewal is held because VIES does not confirm the VAT ID; 'charged_back' after a chargeback or a lost PayPal dispute."
9504
9620
  })
9505
9621
  }).nullable().meta({ description: "`null` while nothing is overdue. During a VAT-ID hold the charge is due but not yet invoiced." })
9506
9622
  });
9507
- var billingIssuer = import_zod43.z.enum(["cloud", "lexware"]);
9508
- var billingChargeInvoice = import_zod43.z.discriminatedUnion("state", [
9509
- import_zod43.z.object({ state: import_zod43.z.literal("not_issued").meta({ description: "Not collected (due, a failed retry, or uncollectible): no invoice exists." }) }).strict(),
9510
- import_zod43.z.object({ state: import_zod43.z.literal("pending").meta({ description: "Collected; the Lexware invoice is not yet confirmed." }) }).strict(),
9511
- import_zod43.z.object({
9512
- state: import_zod43.z.literal("issued").meta({ description: "Lexware has confirmed the invoice." }),
9513
- document_id: import_zod43.z.uuid().meta({ description: "The Lexware document's id \u2014 read it with `GET /api/billing/documents/:id`." })
9623
+ var billingIssuer = import_zod44.z.enum(["cloud", "lexware"]);
9624
+ var billingChargeInvoice = import_zod44.z.discriminatedUnion("state", [
9625
+ import_zod44.z.object({ state: import_zod44.z.literal("not_issued").meta({ description: "Not collected (due, a failed retry, or uncollectible): no invoice exists." }) }).strict(),
9626
+ import_zod44.z.object({ state: import_zod44.z.literal("pending").meta({ description: "Collected; the Lexware invoice is not yet confirmed." }) }).strict(),
9627
+ import_zod44.z.object({
9628
+ state: import_zod44.z.literal("issued").meta({ description: "Lexware has confirmed the invoice." }),
9629
+ document_id: import_zod44.z.uuid().meta({ description: "The Lexware document's id \u2014 read it with `GET /api/billing/documents/:id`." })
9514
9630
  }).strict()
9515
9631
  ]);
9516
9632
  var chargeInvoiceRules = [
@@ -9523,55 +9639,54 @@ function refuseChargeInvoiceMismatch(charge, ctx) {
9523
9639
  ctx.addIssue({ code: "custom", path: ["invoice"], message: "A paid charge has an invoice (pending or issued); every other status has none yet." });
9524
9640
  }
9525
9641
  }
9526
- var billingCharge = import_zod43.z.object({
9527
- id: import_zod43.z.uuid().meta({ description: "The due charge's id \u2014 never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`." }),
9528
- kind: import_zod43.z.enum(["first", "renewal", "change"]).meta({ description: "What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change." }),
9529
- status: import_zod43.z.enum(["due", "paid", "uncollectible", "cancelled"]).meta({
9642
+ var billingCharge = import_zod44.z.object({
9643
+ id: import_zod44.z.uuid().meta({ description: "The due charge's id \u2014 never a Cloud invoice number. Pay it with `POST /api/billing/charges/:id/pay`." }),
9644
+ kind: import_zod44.z.enum(["first", "renewal", "change"]).meta({ description: "What caused the charge: the first charge after checkout, a scheduled renewal, or a mid-period plan change." }),
9645
+ status: import_zod44.z.enum(["due", "paid", "uncollectible", "cancelled"]).meta({
9530
9646
  description: "The charge's own status. A charged back or manually refunded charge stays `paid` \u2014 refunds and chargebacks are handled in Mollie or Lexware by hand; this status and the invoice it names are unchanged, and the resulting Lexware credit note appears under `GET /api/billing/documents` instead."
9531
9647
  }),
9532
- currency: import_zod43.z.literal("eur").meta({ description: "Every charge billed through Lexware is EUR." }),
9533
- net_cents: import_zod43.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
9534
- vat_rate_percent: import_zod43.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
9535
- vat_cents: import_zod43.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
9536
- gross_cents: import_zod43.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." }),
9537
- period_start: import_zod43.z.iso.datetime().meta({ description: "The covered period's start." }),
9538
- period_end: import_zod43.z.iso.datetime().meta({ description: "The covered period's end." }),
9539
- due_at: import_zod43.z.iso.datetime().meta({ description: "When this charge is due." }),
9540
- paid_at: import_zod43.z.iso.datetime().nullable().meta({ description: "When this charge was paid, or `null` while unpaid." }),
9648
+ currency: import_zod44.z.literal("eur").meta({ description: "Every charge billed through Lexware is EUR." }),
9649
+ net_cents: import_zod44.z.number().int().nonnegative().meta({ description: "The charge, excluding VAT, in integer cents." }),
9650
+ vat_rate_percent: import_zod44.z.number().int().min(0).max(100).meta({ description: "The VAT rate applied, in whole percent." }),
9651
+ vat_cents: import_zod44.z.number().int().nonnegative().meta({ description: "VAT, in integer cents (`vatCents`)." }),
9652
+ gross_cents: import_zod44.z.number().int().nonnegative().meta({ description: "Net plus VAT, in integer cents." }),
9653
+ period_start: import_zod44.z.iso.datetime().meta({ description: "The covered period's start." }),
9654
+ period_end: import_zod44.z.iso.datetime().meta({ description: "The covered period's end." }),
9655
+ due_at: import_zod44.z.iso.datetime().meta({ description: "When this charge is due." }),
9656
+ paid_at: import_zod44.z.iso.datetime().nullable().meta({ description: "When this charge was paid, or `null` while unpaid." }),
9541
9657
  invoice: billingChargeInvoice.meta({ description: "Whether a Lexware invoice exists for this charge yet, and which document it names once it does." })
9542
9658
  }).strict().superRefine(refuseChargeInvoiceMismatch).meta({ allOf: chargeInvoiceRules });
9543
9659
  var chargePayRequest = invoicePayRequest;
9544
- var billingView = import_zod43.z.object({
9545
- available: import_zod43.z.boolean().meta({ description: "Whether this cloud takes payments at all \u2014 `false` when no Mollie key is configured." }),
9660
+ var billingView = import_zod44.z.object({
9661
+ available: import_zod44.z.boolean().meta({ description: "Whether this cloud takes payments at all \u2014 `false` when no Mollie key is configured." }),
9546
9662
  account: billingAccount.nullable().meta({ description: "`null` before the org has ever checked out." }),
9547
9663
  payment_method: paymentMethod.nullable().meta({ description: "The payment method on file, or `null`." }),
9548
- payment_method_options: import_zod43.z.array(import_zod43.z.object({
9549
- method: paymentMethodKind.meta({ description: "A method `POST /api/billing/payment-method` accepts now." }),
9550
- pays_invoice: import_zod43.z.boolean().meta({ description: "Whether changing to it also pays the open invoice \u2014 `true` only for `applepay` when a zero-amount Apple Pay payment is not available." })
9664
+ payment_method_options: import_zod44.z.array(import_zod44.z.object({
9665
+ method: paymentMethodKind.meta({ description: "A method Mollie's page offers for a change started now." })
9551
9666
  })).meta({
9552
- description: "What a payment-method change may offer right now, so a client offers exactly what the cloud accepts. `applepay` is absent when it needs an open invoice and none is open; `[]` when the org has no billing account."
9667
+ description: "The methods a payment-method change offers on Mollie's page right now, where the payer chooses one: card and PayPal, and Apple Pay where this cloud takes a zero-amount Apple Pay payment. `[]` when no change is possible: the org has no active or past-due billing account."
9553
9668
  }),
9554
9669
  issuer: billingIssuer.meta({ description: "Which system issues this org's charges: `cloud` before the issuer cutover, or `lexware` after it." }),
9555
- invoices: import_zod43.z.array(billingInvoice).meta({ description: "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24." }),
9556
- charges: import_zod43.z.array(billingCharge).meta({
9670
+ invoices: import_zod44.z.array(billingInvoice).meta({ description: "Cloud-issued invoices from before the issuer cutover; read-only, never grows after it. Newest first, at most 24." }),
9671
+ charges: import_zod44.z.array(billingCharge).meta({
9557
9672
  description: "Newest first, at most 24. Lists only due charges with issuer `lexware` \u2014 never a pre-cutover charge, a legacy payment (legacy_issued/legacy_held/legacy_person/legacy_usd) or a late USD collection: none of those carry a Lexware intent, and they stay in `invoices` or nowhere. `[]` while `issuer` is `cloud`."
9558
9673
  })
9559
9674
  });
9560
- var billingDocumentKind = import_zod43.z.enum(["invoice", "credit_note", "down_payment_invoice", "bookkeeping_invoice", "bookkeeping_credit_note"]);
9561
- var billingDocumentStatus = import_zod43.z.enum(["open", "overdue", "paid", "paidoff", "voided", "transferred", "sepadebit"]);
9562
- var billingDocumentProfile = import_zod43.z.enum(["NONE", "EN16931", "XRechnung"]);
9563
- var billingDocumentFormat = import_zod43.z.enum(["pdf", "xml"]);
9564
- var billingDocumentBase = import_zod43.z.object({
9565
- id: import_zod43.z.uuid().meta({ description: "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one." }),
9675
+ var billingDocumentKind = import_zod44.z.enum(["invoice", "credit_note", "down_payment_invoice", "bookkeeping_invoice", "bookkeeping_credit_note"]);
9676
+ var billingDocumentStatus = import_zod44.z.enum(["open", "overdue", "paid", "paidoff", "voided", "transferred", "sepadebit"]);
9677
+ var billingDocumentProfile = import_zod44.z.enum(["NONE", "EN16931", "XRechnung"]);
9678
+ var billingDocumentFormat = import_zod44.z.enum(["pdf", "xml"]);
9679
+ var billingDocumentBase = import_zod44.z.object({
9680
+ id: import_zod44.z.uuid().meta({ description: "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one." }),
9566
9681
  kind: billingDocumentKind.meta({ description: "The document's kind." }),
9567
9682
  status: billingDocumentStatus.meta({ description: "The document's own status." }),
9568
- number: import_zod43.z.string().nullable().meta({ description: "The Lexware voucher number, for display only \u2014 never a key to read by. `null` for a voucher Lexware has not numbered." }),
9569
- document_date: import_zod43.z.iso.datetime({ offset: true }).meta({ description: "The date printed on the document." }),
9570
- currency: import_zod43.z.literal("EUR").meta({ description: "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher." }),
9571
- gross_cents: import_zod43.z.number().int().meta({
9683
+ number: import_zod44.z.string().nullable().meta({ description: "The Lexware voucher number, for display only \u2014 never a key to read by. `null` for a voucher Lexware has not numbered." }),
9684
+ document_date: import_zod44.z.iso.datetime({ offset: true }).meta({ description: "The date printed on the document." }),
9685
+ currency: import_zod44.z.literal("EUR").meta({ description: "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher." }),
9686
+ gross_cents: import_zod44.z.number().int().meta({
9572
9687
  description: "The gross amount, in integer cents, signed by `kind` and never by the sign Lexware itself reports: `credit_note` and `bookkeeping_credit_note` are zero or negative, every other kind is zero or positive."
9573
9688
  }),
9574
- file: import_zod43.z.enum(["available", "unavailable"]).meta({ description: "Whether Lexware holds a file for this document at all." })
9689
+ file: import_zod44.z.enum(["available", "unavailable"]).meta({ description: "Whether Lexware holds a file for this document at all." })
9575
9690
  });
9576
9691
  function refuseWrongGrossSign(doc, ctx) {
9577
9692
  const isCredit = doc.kind === "credit_note" || doc.kind === "bookkeeping_credit_note";
@@ -9583,18 +9698,18 @@ function refuseWrongGrossSign(doc, ctx) {
9583
9698
  }
9584
9699
  }
9585
9700
  var billingDocument = billingDocumentBase.strict().superRefine(refuseWrongGrossSign);
9586
- var billingDocumentList = import_zod43.z.object({
9587
- available: import_zod43.z.boolean().meta({ description: "Whether this cloud can list Lexware documents at all for this org \u2014 `false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact." }),
9588
- complete: import_zod43.z.boolean().meta({ description: "`false` when a document of an unsupported type or status was skipped rather than listed, counted in `unsupported_count`." }),
9589
- unsupported_count: import_zod43.z.number().int().nonnegative().meta({ description: "How many documents of an unsupported type or status were skipped; `complete` is `false` whenever this is above zero." }),
9590
- documents: import_zod43.z.array(billingDocument).meta({ description: "Every supported document this org has, complete or not \u2014 never a truncated page." })
9701
+ var billingDocumentList = import_zod44.z.object({
9702
+ available: import_zod44.z.boolean().meta({ description: "Whether this cloud can list Lexware documents at all for this org \u2014 `false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact." }),
9703
+ complete: import_zod44.z.boolean().meta({ description: "`false` when a document of an unsupported type or status was skipped rather than listed, counted in `unsupported_count`." }),
9704
+ unsupported_count: import_zod44.z.number().int().nonnegative().meta({ description: "How many documents of an unsupported type or status were skipped; `complete` is `false` whenever this is above zero." }),
9705
+ documents: import_zod44.z.array(billingDocument).meta({ description: "Every supported document this org has, complete or not \u2014 never a truncated page." })
9591
9706
  }).strict().superRefine((list, ctx) => {
9592
9707
  if (!list.available && (list.documents.length > 0 || !list.complete || list.unsupported_count > 0)) {
9593
9708
  ctx.addIssue({ code: "custom", path: ["available"], message: "available: false carries no documents, is complete and has no unsupported document." });
9594
9709
  }
9595
9710
  });
9596
- var billingDocumentFileRole = import_zod43.z.enum(["e_invoice", "preview", "document"]);
9597
- var billingDocumentFormatEntry = import_zod43.z.object({ format: billingDocumentFormat, role: billingDocumentFileRole }).strict();
9711
+ var billingDocumentFileRole = import_zod44.z.enum(["e_invoice", "preview", "document"]);
9712
+ var billingDocumentFormatEntry = import_zod44.z.object({ format: billingDocumentFormat, role: billingDocumentFileRole }).strict();
9598
9713
  function sameFormats(a, b) {
9599
9714
  return a.length === b.length && a.every((entry2, i) => entry2.format === b[i].format && entry2.role === b[i].role);
9600
9715
  }
@@ -9606,14 +9721,14 @@ function refuseWrongFormats(doc, ctx) {
9606
9721
  }
9607
9722
  var billingDocumentDetail = billingDocumentBase.extend({
9608
9723
  electronic_document_profile: billingDocumentProfile.nullable().meta({ description: "The e-invoice profile, or `null` for a bookkeeping voucher \u2014 it has none." }),
9609
- formats: import_zod43.z.array(billingDocumentFormatEntry).meta({
9724
+ formats: import_zod44.z.array(billingDocumentFormatEntry).meta({
9610
9725
  description: '`NONE`: `[{ format: "pdf", role: "document" }]`. `EN16931`: `[{ format: "pdf", role: "e_invoice" }]`. `XRechnung`: `[{ format: "xml", role: "e_invoice" }, { format: "pdf", role: "preview" }]`. `null` profile: `[{ format: "pdf", role: "document" }]` when `file` is `available`, otherwise `[]`.'
9611
9726
  })
9612
9727
  }).strict().superRefine((doc, ctx) => {
9613
9728
  refuseWrongGrossSign(doc, ctx);
9614
9729
  refuseWrongFormats(doc, ctx);
9615
9730
  });
9616
- var billingDocumentFileQuery = import_zod43.z.object({
9731
+ var billingDocumentFileQuery = import_zod44.z.object({
9617
9732
  format: billingDocumentFormat.default("pdf").meta({ description: "The file format to read. `xml` answers `404` unless the document is `XRechnung`." })
9618
9733
  }).strict();
9619
9734
  var acceptedBillingFields = {
@@ -9622,30 +9737,30 @@ var acceptedBillingFields = {
9622
9737
  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`)."
9623
9738
  })
9624
9739
  };
9625
- var acceptedPaidChange = import_zod43.z.object({
9740
+ var acceptedPaidChange = import_zod44.z.object({
9626
9741
  ...acceptedBillingFields,
9627
- intent: paymentStartedVariant.safeExtend({ operation: import_zod43.z.literal("paid_change") })
9742
+ intent: paymentStartedVariant.safeExtend({ operation: import_zod44.z.literal("paid_change") })
9628
9743
  }).strict();
9629
- var acceptedNoPaymentChange = import_zod43.z.object({
9744
+ var acceptedNoPaymentChange = import_zod44.z.object({
9630
9745
  billing: billingView,
9631
- charged: import_zod43.z.null().meta({
9746
+ charged: import_zod44.z.null().meta({
9632
9747
  description: "Always `null`: nothing was charged now (a scheduled change or an increase that cost nothing)."
9633
9748
  }),
9634
9749
  intent: purchaseIntentAcceptedWithoutPayment
9635
9750
  }).strict();
9636
- var billingChangeResponse = import_zod43.z.union([
9637
- import_zod43.z.object({ intent: paidChangeDraft }).strict(),
9751
+ var billingChangeResponse = import_zod44.z.union([
9752
+ import_zod44.z.object({ intent: paidChangeDraft }).strict(),
9638
9753
  acceptedPaidChange,
9639
9754
  acceptedNoPaymentChange
9640
9755
  ]);
9641
- var purchaseIntentResponse = import_zod43.z.union([
9756
+ var purchaseIntentResponse = import_zod44.z.union([
9642
9757
  purchaseIntentDraft,
9643
9758
  nonChangePaymentStarted,
9644
9759
  acceptedPaidChange,
9645
9760
  acceptedNoPaymentChange
9646
9761
  ]);
9647
9762
 
9648
- // node_modules/.pnpm/@fleetless+contracts@18.1.0/node_modules/@fleetless/contracts/dist/routes.js
9763
+ // node_modules/.pnpm/@fleetless+contracts@19.3.0/node_modules/@fleetless/contracts/dist/routes.js
9649
9764
  var MCP_APP = MCP_APP_PATHS(":appIdentifier");
9650
9765
  var APP_IDENTIFIER = {
9651
9766
  name: "appIdentifier",
@@ -13182,7 +13297,7 @@ var ROUTES = [
13182
13297
  response: liveSessionResponse,
13183
13298
  errors: [...CLIENT_GUARD, "invalid_uuid", "not_found", "robot_offline", "camera_offline", "live_unavailable"],
13184
13299
  transport: "http",
13185
- notes: "Refcounted: the first viewer starts the robot publishing and the last release stops it. No token is ever minted for an ungranted or offline camera \u2014 both refusals return before the hold is taken. `409 camera_offline` means the **robot itself** reported the failure; `502 live_unavailable` means this cloud could not start the stream. The difference matters, and it is why a failure the robot named is never dressed up as one this side invented."
13300
+ notes: "Refcounted: the first viewer starts the robot publishing and the last release stops it. No token is ever minted for an ungranted or offline camera \u2014 both refusals return before the hold is taken. `409 camera_offline` means the **robot itself** reported the failure; `502 live_unavailable` means this cloud could not start the stream. The difference matters, and it is why a failure the robot named is never dressed up as one this side invented. The `409` carries `details.refusal` (`cameraOfflineDetails`) and the cloud's fixed sentence for it as `message`, never the robot's own words. A start the robot refuses after the `201` ends the session with a `live_session` frame, reason `start_refused`, the same sentence as `detail` and the class as `refusal`; the next viewer of an emptied room gets a fresh try."
13186
13301
  },
13187
13302
  {
13188
13303
  method: "DELETE",
@@ -13841,7 +13956,7 @@ var ROUTES = [
13841
13956
  response: checkoutResponse,
13842
13957
  errors: ["target_state_conflict", ...DEVELOPER_GUARD, "tier_required", "support_forbidden", "validation_error", "not_found", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13843
13958
  transport: "http",
13844
- 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."
13959
+ notes: "The body is `{ operation_key }` only: a body that still sends `method` is 400 validation_error. A change is a 0.00 `first` payment on the provider's hosted page, which offers every method `payment_method_options` lists (card, PayPal and, where a zero-amount Apple Pay payment is taken, Apple Pay); the payer chooses there, and the method paid with becomes the mandate. Offer the change only while `payment_method_options` is not empty. 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`). Keep one operation_key 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. A key first used for another operation, or before this route took no 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. 404 not_found when no billing account is active or past due. Owner only: a support session is answered 403 support_forbidden."
13845
13960
  },
13846
13961
  {
13847
13962
  method: "POST",
@@ -13975,7 +14090,7 @@ var ROUTES = [
13975
14090
  response: checkoutResponse,
13976
14091
  errors: ["validation_error", ...DEVELOPER_GUARD, "tier_required", "not_found", "target_state_conflict", "rate_limited", ...BILLING_OFF, ...MOLLIE],
13977
14092
  transport: "http",
13978
- notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning. After the issuer cutover, :id names a historical open FL-\u2026 invoice only; a due charge after the cutover answers 404 not_found here \u2014 pay it with POST /api/billing/charges/:id/pay instead."
14093
+ notes: "The required operation_key binds the org, invoice and request; reuse with changed input is 409 target_state_conflict (purchaseConflictDetails). :id may be an issued invoice or a due charge with no number. Recheck current buyer eligibility, VIES, invoice status, owed amount and original currency before every new provider call. Invalid VAT is state invalid_vat_id with rule vat_id_invalid, without a payment. Pending/eligible/held has no redirect; after VIES recovers, the owner must confirm the current quote. An issued USD invoice remains held/legacy_usd_invoice: never convert it or call the provider anew until the integration decision resolves the conflict. Already-created payments retain recorded currency/amount and are looked up/reconciled, never replaced. Under the org lock, confirmation checks the current owed amount and returns the same payment identity on retries. invoice_not_open is a typed conflict; 404 not_found for unknown/foreign invoice. Pending itself never pays an invoice, lifts a lock or resets dunning. An invoice charged back is never retried automatically. After the issuer cutover, :id names a historical open FL-\u2026 invoice only; a due charge after the cutover answers 404 not_found here \u2014 pay it with POST /api/billing/charges/:id/pay instead."
13979
14094
  },
13980
14095
  {
13981
14096
  method: "POST",
@@ -15130,7 +15245,7 @@ function headerNumber(headers, name) {
15130
15245
  const value = Number(raw);
15131
15246
  return Number.isFinite(value) ? value : null;
15132
15247
  }
15133
- function createCamerasApi(http) {
15248
+ function createCamerasApi(http, endings) {
15134
15249
  return {
15135
15250
  async list(robotId) {
15136
15251
  const response = await http.request(`/api/robots/${pathSegment(robotId)}/cameras`, {});
@@ -15168,6 +15283,7 @@ function createCamerasApi(http) {
15168
15283
  }
15169
15284
  },
15170
15285
  async live(robotId, slug2) {
15286
+ if (endings) await endings.ready();
15171
15287
  const response = await http.request(`/api/robots/${pathSegment(robotId)}/cameras/${pathSegment(slug2)}/live`, {
15172
15288
  method: "POST"
15173
15289
  });
@@ -15185,11 +15301,113 @@ function createCamerasApi(http) {
15185
15301
  room: response.room,
15186
15302
  token: response.token,
15187
15303
  expires_at: response.expires_at,
15188
- release
15304
+ release,
15305
+ onEnded: (handler) => endings ? endings.onEnded(response.session_id, handler) : () => {
15306
+ }
15307
+ };
15308
+ }
15309
+ };
15310
+ }
15311
+
15312
+ // src/live-sessions.ts
15313
+ var LIVE_CHANNEL_READY_TIMEOUT_MS = 5e3;
15314
+ var ENDINGS_KEPT = 64;
15315
+ function createLiveSessionEndings(channel, options = {}) {
15316
+ const readyTimeoutMs = options.readyTimeoutMs ?? LIVE_CHANNEL_READY_TIMEOUT_MS;
15317
+ const ended = /* @__PURE__ */ new Map();
15318
+ const handlers = /* @__PURE__ */ new Map();
15319
+ let listening = false;
15320
+ function listen() {
15321
+ if (listening) return;
15322
+ listening = true;
15323
+ channel.on("live_session", (frame) => {
15324
+ const parsed = parseEnding(frame);
15325
+ if (!parsed) return;
15326
+ ended.set(parsed.sessionId, parsed.ended);
15327
+ if (ended.size > ENDINGS_KEPT) ended.delete(ended.keys().next().value);
15328
+ const waiting = handlers.get(parsed.sessionId);
15329
+ if (!waiting) return;
15330
+ handlers.delete(parsed.sessionId);
15331
+ for (const handler of waiting) deliver(handler, parsed.ended);
15332
+ });
15333
+ }
15334
+ return {
15335
+ ready() {
15336
+ listen();
15337
+ if (channel.isReady) return Promise.resolve();
15338
+ return new Promise((resolve) => {
15339
+ let settled = false;
15340
+ const unlistenReady = channel.onReady(() => settle());
15341
+ const unlistenFailed = channel.onAuthFailed(() => settle());
15342
+ const timer = setTimeout(() => settle(), readyTimeoutMs);
15343
+ function settle() {
15344
+ if (settled) return;
15345
+ settled = true;
15346
+ clearTimeout(timer);
15347
+ unlistenReady();
15348
+ unlistenFailed();
15349
+ resolve();
15350
+ }
15351
+ channel.connect();
15352
+ });
15353
+ },
15354
+ onEnded(sessionId, handler) {
15355
+ listen();
15356
+ let active = true;
15357
+ const known = ended.get(sessionId);
15358
+ if (known) {
15359
+ queueMicrotask(() => {
15360
+ if (!active) return;
15361
+ active = false;
15362
+ deliver(handler, known);
15363
+ });
15364
+ return () => {
15365
+ active = false;
15366
+ };
15367
+ }
15368
+ const once = (ending) => {
15369
+ if (!active) return;
15370
+ active = false;
15371
+ handler(ending);
15372
+ };
15373
+ let set = handlers.get(sessionId);
15374
+ if (!set) {
15375
+ set = /* @__PURE__ */ new Set();
15376
+ handlers.set(sessionId, set);
15377
+ }
15378
+ set.add(once);
15379
+ return () => {
15380
+ active = false;
15381
+ const current = handlers.get(sessionId);
15382
+ current?.delete(once);
15383
+ if (current?.size === 0) handlers.delete(sessionId);
15189
15384
  };
15190
15385
  }
15191
15386
  };
15192
15387
  }
15388
+ function deliver(handler, ended) {
15389
+ try {
15390
+ handler(ended);
15391
+ } catch (error) {
15392
+ queueMicrotask(() => {
15393
+ throw error;
15394
+ });
15395
+ }
15396
+ }
15397
+ function parseEnding(frame) {
15398
+ const { session_id: sessionId, state, reason, detail, refusal } = frame;
15399
+ if (typeof sessionId !== "string" || state !== "ended" || typeof reason !== "string") return null;
15400
+ if (detail !== null && typeof detail !== "string") return null;
15401
+ if (refusal !== void 0 && refusal !== null && typeof refusal !== "string") return null;
15402
+ return {
15403
+ sessionId,
15404
+ ended: {
15405
+ reason,
15406
+ detail,
15407
+ refusal: typeof refusal === "string" ? refusal : null
15408
+ }
15409
+ };
15410
+ }
15193
15411
 
15194
15412
  // src/filter-json.ts
15195
15413
  function filterJson(filter) {
@@ -16095,7 +16313,7 @@ function createClient(options) {
16095
16313
  const actions = createActionsApi(commandTransport, jobSubscriptions);
16096
16314
  const services = createServicesApi(commandTransport, jobSubscriptions);
16097
16315
  const publishers = createPublishersApi(commandTransport);
16098
- const cameras = createCamerasApi(http);
16316
+ const cameras = createCamerasApi(http, createLiveSessionEndings(channel));
16099
16317
  const jobs = createJobsApi(http);
16100
16318
  const assets = createAssetsApi(http);
16101
16319
  const robots = createRobotsApi(http);
@@ -16138,7 +16356,9 @@ function deriveRealtimeUrl(apiUrl) {
16138
16356
  CANCEL_RETURN_CODES,
16139
16357
  FleetlessError,
16140
16358
  InMemoryTokenStore,
16359
+ LIVE_START_REFUSALS,
16141
16360
  SDK_ERROR_CODES,
16361
+ cameraOfflineDetails,
16142
16362
  cancelRejectedDetails,
16143
16363
  createClient,
16144
16364
  parameterInvalidDetails,