@fleetless/contracts 10.0.0 → 11.0.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.
@@ -5848,6 +5848,44 @@
5848
5848
  "transport": "http",
5849
5849
  "notes": "The body is optional: a bodyless `POST` was every caller's shape before `job_id` existed, and absent or `job_id: null` both mean \"cancel whatever is running\". A named `job_id` that is **not** what is running cancels nothing and answers `404` — the caller named an id and thereby ruled the other one out. An `external` job is cancelled the same way, through its goal id. Cancelling an `unknown` job also cancels every external goal on its action, since one of them may be that job. A service is `422 not_cancellable`: a service call has no goal to cancel. Nothing running is a `200` with `job: null`. The answer waits for the bridge's `cancel_result`: a `200` means the action server accepted the cancel request, not that the goal has ended — the job's end arrives as its own update. Any goal answered `ERROR_REJECTED` makes it `409 cancel_rejected`, with every goal and its `return_code` in `details.goals`; no answer within `JOB_HEARTBEAT_TIMEOUT_MS` is `504 bridge_timeout`; a cancel the bridge could not send at all is `502` carrying the bridge's own code (`unknown_slug`, `action_server_lost`, `internal_error`)."
5850
5850
  },
5851
+ {
5852
+ "method": "POST",
5853
+ "path": "/api/robots/:id/jobs/:slug/recover",
5854
+ "section": "commands",
5855
+ "summary": "Releases one held job after an Owner verifies the robot is stopped.",
5856
+ "audience": "developer",
5857
+ "auth": "developer",
5858
+ "rateLimited": false,
5859
+ "ownerTier": true,
5860
+ "status": 200,
5861
+ "params": [
5862
+ {
5863
+ "name": "id",
5864
+ "description": "The robot uuid in the authenticated Owner's organization."
5865
+ },
5866
+ {
5867
+ "name": "slug",
5868
+ "description": "The action slug holding the exact job named in the body."
5869
+ }
5870
+ ],
5871
+ "query": null,
5872
+ "request": "recover-held-job-request",
5873
+ "response": "recover-held-job-response",
5874
+ "errors": [
5875
+ "unauthorized",
5876
+ "token_expired",
5877
+ "token_revoked",
5878
+ "tier_required",
5879
+ "support_forbidden",
5880
+ "invalid_uuid",
5881
+ "not_found",
5882
+ "validation_error",
5883
+ "job_state_conflict",
5884
+ "internal_error"
5885
+ ],
5886
+ "transport": "http",
5887
+ "notes": "Use only after physically stopping or isolating the robot and checking that it cannot move. Read the held job id, then submit that exact id with a reason and `verified_stopped: true`. The assertion is a human safety check, not a sensor reading. The cloud records the Owner and reason in the audit trail and returns the job settled to `lost`. App users, server keys, other developers and support sessions cannot use this route. A connected bridge or a changed job returns `409 job_state_conflict`; a normal cancel is not recovery and never releases an uncertain job."
5888
+ },
5851
5889
  {
5852
5890
  "method": "POST",
5853
5891
  "path": "/api/robots/:id/publishers/:slug",
@@ -6739,7 +6777,7 @@
6739
6777
  "payment_provider_unavailable"
6740
6778
  ],
6741
6779
  "transport": "http",
6742
- "notes": "Basic stays free for every payer. This start creates only a nonbinding draft; accept_terms is deprecated and cannot confirm an order. Current company, buyer, VIES and EUR quote checks still apply. Persist operation_key before POST; same key/input recovers the intent, changed input conflicts. An eligible Owner obtains a no-store C.4 display, then explicitly confirms with its proof. No payment or acceptance occurs at start. Hosted payment later offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. An active/past_due account uses billing/change."
6780
+ "notes": "Basic stays free for every payer. This start creates only a nonbinding draft; accept_terms is deprecated and cannot confirm an order. Current company, buyer, VIES and EUR quote checks still apply. Persist operation_key before POST; the same key and input return 200 with the existing intent (and its hosted checkout when payment_started), without another Mollie payment; changed input conflicts. A different operation_key while a first payment is open returns 409 target_state_conflict with rule checkout_open and details expires_at: null. An eligible Owner obtains a no-store C.4 display, then explicitly confirms with its proof. No payment or acceptance occurs at start. Hosted payment later offers card, PayPal or Apple Pay; its return is <console>/settings/billing?checkout=<checkout_id>. An active/past_due account uses billing/change."
6743
6781
  },
6744
6782
  {
6745
6783
  "method": "GET",
@@ -6830,7 +6868,7 @@
6830
6868
  "payment_provider_unavailable"
6831
6869
  ],
6832
6870
  "transport": "http",
6833
- "notes": "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock; stale or spent proof conflicts without effect. One decision and one legal acceptance commit together. An exact same-key replay returns the original result without another payment or acceptance. Foreign ownership answers 404 without disclosure; pending or held cannot charge."
6871
+ "notes": "Checkout and paid-change decisions require confirmation_proof along with the operation key, quote revision and buyer fingerprint shown in the persisted C.4 display. Cloud rechecks buyer, quote, selection, legal references, period and current state under the org lock; stale or spent proof conflicts without effect. One decision and one legal acceptance commit together. An exact same-key replay returns the original result without another payment or acceptance. A paid change can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; it does not start another charge. Foreign ownership answers 404 without disclosure; pending or held cannot charge."
6834
6872
  },
6835
6873
  {
6836
6874
  "method": "GET",
@@ -6937,7 +6975,7 @@
6937
6975
  "payment_provider_unavailable"
6938
6976
  ],
6939
6977
  "transport": "http",
6940
- "notes": "The request names an absolute plan/cycle/add-on target and a stable operation_key. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. An eligible Owner obtains a C.4 display and explicitly confirms with its proof. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain."
6978
+ "notes": "The request names an absolute plan/cycle/add-on target and a stable operation_key. Start is nonbinding for every change, including zero-charge, scheduled and formerly immediate decreases: it neither changes the plan nor writes legal acceptance. An eligible Owner obtains a C.4 display and explicitly confirms with its proof. Confirmation may return accepted_no_payment with charged: null and no provider payment or redirect, or payment_started for a charged change. Exact-key lookup recovers the accepted result. Existing no_account, past_due, no_valid_mandate and plan_limit conflicts remain. A later paid-change confirmation can return 409 target_state_conflict with field billing and rule charge_in_progress while an earlier charge is unresolved; no second charge starts."
6941
6979
  },
6942
6980
  {
6943
6981
  "method": "POST",
@@ -7021,7 +7059,7 @@
7021
7059
  "method": "GET",
7022
7060
  "path": "/api/billing/invoices/:id/pdf",
7023
7061
  "section": "billing",
7024
- "summary": "Downloads one invoice's rendered PDF.",
7062
+ "summary": "Downloads an invoice's original or cancellation PDF.",
7025
7063
  "audience": "developer",
7026
7064
  "auth": "developer",
7027
7065
  "rateLimited": false,
@@ -7033,7 +7071,7 @@
7033
7071
  "description": "The invoice id, from `billingInvoice.id` in `GET /api/billing`'s `invoices`."
7034
7072
  }
7035
7073
  ],
7036
- "query": null,
7074
+ "query": "billing-invoice-pdf-query",
7037
7075
  "request": null,
7038
7076
  "response": null,
7039
7077
  "contentType": "application/pdf",
@@ -7042,10 +7080,11 @@
7042
7080
  "token_expired",
7043
7081
  "token_revoked",
7044
7082
  "tier_required",
7083
+ "validation_error",
7045
7084
  "not_found"
7046
7085
  ],
7047
7086
  "transport": "http",
7048
- "notes": "Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
7087
+ "notes": "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns the stored cancellation PDF for this same invoice id; no read renders a new PDF. `404 not_found` for an unknown id, one from another org, or a missing cancellation number or PDF. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
7049
7088
  },
7050
7089
  {
7051
7090
  "method": "GET",
@@ -1117,10 +1117,22 @@
1117
1117
  "enum": [
1118
1118
  "open",
1119
1119
  "paid",
1120
- "uncollectible"
1120
+ "uncollectible",
1121
+ "cancelled"
1121
1122
  ],
1122
1123
  "description": "This invoice's own status."
1123
1124
  },
1125
+ "cancellation_document_url": {
1126
+ "anyOf": [
1127
+ {
1128
+ "type": "string"
1129
+ },
1130
+ {
1131
+ "type": "null"
1132
+ }
1133
+ ],
1134
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1135
+ },
1124
1136
  "currency": {
1125
1137
  "type": "string",
1126
1138
  "enum": [
@@ -1159,6 +1171,7 @@
1159
1171
  "number",
1160
1172
  "issued_at",
1161
1173
  "status",
1174
+ "cancellation_document_url",
1162
1175
  "currency",
1163
1176
  "net_cents",
1164
1177
  "vat_rate_percent",
@@ -1428,10 +1441,22 @@
1428
1441
  "enum": [
1429
1442
  "open",
1430
1443
  "paid",
1431
- "uncollectible"
1444
+ "uncollectible",
1445
+ "cancelled"
1432
1446
  ],
1433
1447
  "description": "This invoice's own status."
1434
1448
  },
1449
+ "cancellation_document_url": {
1450
+ "anyOf": [
1451
+ {
1452
+ "type": "string"
1453
+ },
1454
+ {
1455
+ "type": "null"
1456
+ }
1457
+ ],
1458
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1459
+ },
1435
1460
  "currency": {
1436
1461
  "type": "string",
1437
1462
  "enum": [
@@ -1470,6 +1495,7 @@
1470
1495
  "number",
1471
1496
  "issued_at",
1472
1497
  "status",
1498
+ "cancellation_document_url",
1473
1499
  "currency",
1474
1500
  "net_cents",
1475
1501
  "vat_rate_percent",
@@ -2263,10 +2289,22 @@
2263
2289
  "enum": [
2264
2290
  "open",
2265
2291
  "paid",
2266
- "uncollectible"
2292
+ "uncollectible",
2293
+ "cancelled"
2267
2294
  ],
2268
2295
  "description": "This invoice's own status."
2269
2296
  },
2297
+ "cancellation_document_url": {
2298
+ "anyOf": [
2299
+ {
2300
+ "type": "string"
2301
+ },
2302
+ {
2303
+ "type": "null"
2304
+ }
2305
+ ],
2306
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
2307
+ },
2270
2308
  "currency": {
2271
2309
  "type": "string",
2272
2310
  "enum": [
@@ -2305,6 +2343,7 @@
2305
2343
  "number",
2306
2344
  "issued_at",
2307
2345
  "status",
2346
+ "cancellation_document_url",
2308
2347
  "currency",
2309
2348
  "net_cents",
2310
2349
  "vat_rate_percent",
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "kind": {
6
+ "description": "The original invoice or its stored cancellation PDF; omitted means `invoice`.",
7
+ "type": "string",
8
+ "enum": [
9
+ "invoice",
10
+ "cancellation"
11
+ ]
12
+ }
13
+ },
14
+ "additionalProperties": false
15
+ }
@@ -24,10 +24,22 @@
24
24
  "enum": [
25
25
  "open",
26
26
  "paid",
27
- "uncollectible"
27
+ "uncollectible",
28
+ "cancelled"
28
29
  ],
29
30
  "description": "This invoice's own status."
30
31
  },
32
+ "cancellation_document_url": {
33
+ "anyOf": [
34
+ {
35
+ "type": "string"
36
+ },
37
+ {
38
+ "type": "null"
39
+ }
40
+ ],
41
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
42
+ },
31
43
  "currency": {
32
44
  "type": "string",
33
45
  "enum": [
@@ -66,6 +78,7 @@
66
78
  "number",
67
79
  "issued_at",
68
80
  "status",
81
+ "cancellation_document_url",
69
82
  "currency",
70
83
  "net_cents",
71
84
  "vat_rate_percent",
@@ -681,10 +681,22 @@
681
681
  "enum": [
682
682
  "open",
683
683
  "paid",
684
- "uncollectible"
684
+ "uncollectible",
685
+ "cancelled"
685
686
  ],
686
687
  "description": "This invoice's own status."
687
688
  },
689
+ "cancellation_document_url": {
690
+ "anyOf": [
691
+ {
692
+ "type": "string"
693
+ },
694
+ {
695
+ "type": "null"
696
+ }
697
+ ],
698
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
699
+ },
688
700
  "currency": {
689
701
  "type": "string",
690
702
  "enum": [
@@ -723,6 +735,7 @@
723
735
  "number",
724
736
  "issued_at",
725
737
  "status",
738
+ "cancellation_document_url",
726
739
  "currency",
727
740
  "net_cents",
728
741
  "vat_rate_percent",
@@ -19,6 +19,20 @@
19
19
  "low_bandwidth": {
20
20
  "type": "boolean",
21
21
  "description": "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported."
22
+ },
23
+ "health_reason": {
24
+ "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.",
25
+ "anyOf": [
26
+ {
27
+ "type": "string",
28
+ "enum": [
29
+ "job_query_unanswered"
30
+ ]
31
+ },
32
+ {
33
+ "type": "null"
34
+ }
35
+ ]
22
36
  }
23
37
  },
24
38
  "required": [
@@ -40,6 +40,20 @@
40
40
  "low_bandwidth": {
41
41
  "type": "boolean",
42
42
  "description": "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported."
43
+ },
44
+ "health_reason": {
45
+ "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.",
46
+ "anyOf": [
47
+ {
48
+ "type": "string",
49
+ "enum": [
50
+ "job_query_unanswered"
51
+ ]
52
+ },
53
+ {
54
+ "type": "null"
55
+ }
56
+ ]
43
57
  }
44
58
  },
45
59
  "required": [
@@ -45,6 +45,20 @@
45
45
  "low_bandwidth": {
46
46
  "type": "boolean",
47
47
  "description": "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported."
48
+ },
49
+ "health_reason": {
50
+ "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.",
51
+ "anyOf": [
52
+ {
53
+ "type": "string",
54
+ "enum": [
55
+ "job_query_unanswered"
56
+ ]
57
+ },
58
+ {
59
+ "type": "null"
60
+ }
61
+ ]
48
62
  }
49
63
  },
50
64
  "required": [
@@ -1316,10 +1316,22 @@
1316
1316
  "enum": [
1317
1317
  "open",
1318
1318
  "paid",
1319
- "uncollectible"
1319
+ "uncollectible",
1320
+ "cancelled"
1320
1321
  ],
1321
1322
  "description": "This invoice's own status."
1322
1323
  },
1324
+ "cancellation_document_url": {
1325
+ "anyOf": [
1326
+ {
1327
+ "type": "string"
1328
+ },
1329
+ {
1330
+ "type": "null"
1331
+ }
1332
+ ],
1333
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1334
+ },
1323
1335
  "currency": {
1324
1336
  "type": "string",
1325
1337
  "enum": [
@@ -1358,6 +1370,7 @@
1358
1370
  "number",
1359
1371
  "issued_at",
1360
1372
  "status",
1373
+ "cancellation_document_url",
1361
1374
  "currency",
1362
1375
  "net_cents",
1363
1376
  "vat_rate_percent",
@@ -1627,10 +1640,22 @@
1627
1640
  "enum": [
1628
1641
  "open",
1629
1642
  "paid",
1630
- "uncollectible"
1643
+ "uncollectible",
1644
+ "cancelled"
1631
1645
  ],
1632
1646
  "description": "This invoice's own status."
1633
1647
  },
1648
+ "cancellation_document_url": {
1649
+ "anyOf": [
1650
+ {
1651
+ "type": "string"
1652
+ },
1653
+ {
1654
+ "type": "null"
1655
+ }
1656
+ ],
1657
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1658
+ },
1634
1659
  "currency": {
1635
1660
  "type": "string",
1636
1661
  "enum": [
@@ -1669,6 +1694,7 @@
1669
1694
  "number",
1670
1695
  "issued_at",
1671
1696
  "status",
1697
+ "cancellation_document_url",
1672
1698
  "currency",
1673
1699
  "net_cents",
1674
1700
  "vat_rate_percent",
@@ -2462,10 +2488,22 @@
2462
2488
  "enum": [
2463
2489
  "open",
2464
2490
  "paid",
2465
- "uncollectible"
2491
+ "uncollectible",
2492
+ "cancelled"
2466
2493
  ],
2467
2494
  "description": "This invoice's own status."
2468
2495
  },
2496
+ "cancellation_document_url": {
2497
+ "anyOf": [
2498
+ {
2499
+ "type": "string"
2500
+ },
2501
+ {
2502
+ "type": "null"
2503
+ }
2504
+ ],
2505
+ "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
2506
+ },
2469
2507
  "currency": {
2470
2508
  "type": "string",
2471
2509
  "enum": [
@@ -2504,6 +2542,7 @@
2504
2542
  "number",
2505
2543
  "issued_at",
2506
2544
  "status",
2545
+ "cancellation_document_url",
2507
2546
  "currency",
2508
2547
  "net_cents",
2509
2548
  "vat_rate_percent",
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "job_id": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
9
+ "description": "The exact held job id read from the robot job state; another job must never be released by a stale request."
10
+ },
11
+ "verified_stopped": {
12
+ "type": "boolean",
13
+ "const": true,
14
+ "description": "The Owner confirms a physical stop and safety check; this is not a cloud sensor reading."
15
+ },
16
+ "reason": {
17
+ "type": "string",
18
+ "minLength": 10,
19
+ "maxLength": 500,
20
+ "description": "The Owner's reason and safety-check record, 10–500 characters after trimming; retained in the audit trail."
21
+ }
22
+ },
23
+ "required": [
24
+ "job_id",
25
+ "verified_stopped",
26
+ "reason"
27
+ ],
28
+ "additionalProperties": false
29
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "job": {
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "type": "string",
10
+ "format": "uuid",
11
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
12
+ "description": "The job's id, minted by the cloud when the invocation is accepted. Informative — state is observed by slug; a cancel names this id to stop one specific job rather than whatever is running."
13
+ },
14
+ "robot_id": {
15
+ "type": "string",
16
+ "format": "uuid",
17
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
18
+ "description": "The robot this job is running on."
19
+ },
20
+ "slug": {
21
+ "type": "string",
22
+ "minLength": 2,
23
+ "maxLength": 63,
24
+ "pattern": "^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$",
25
+ "description": "The action or service this job is running, as the published configuration exposes it. One slug carries one job at a time, so every observer of that slug sees the same one."
26
+ },
27
+ "state": {
28
+ "type": "string",
29
+ "enum": [
30
+ "running",
31
+ "unknown",
32
+ "succeeded",
33
+ "failed",
34
+ "cancelled",
35
+ "lost"
36
+ ],
37
+ "description": "Where the job stands: `running`, `unknown`, `succeeded`, `failed`, `cancelled` or `lost`. `unknown` is not an outcome — the robot went offline or silent and the cloud does not know yet; the slug stays occupied and the bridge's next statement resolves it, `error` naming why the cloud lost sight of it. `lost` is final: the bridge stated it does not know the job and nothing else runs on its action, or the action server vanished mid-goal."
38
+ },
39
+ "origin": {
40
+ "type": "string",
41
+ "enum": [
42
+ "fleetless",
43
+ "external"
44
+ ],
45
+ "description": "Who started this job. `fleetless` for everything minted by the cloud; `external` for a goal the bridge found active on a published action without having sent it — no parameters, no starter, never written to `job_runs`."
46
+ },
47
+ "started_at": {
48
+ "type": "string",
49
+ "format": "date-time",
50
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
51
+ "description": "When the cloud minted this job, as an ISO 8601 timestamp. For a job adopted from a reconnecting bridge, this is **adoption time**, not the real start — the cloud never minted it."
52
+ },
53
+ "updated_at": {
54
+ "type": "string",
55
+ "format": "date-time",
56
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
57
+ "description": "When this job last changed, as an ISO 8601 timestamp."
58
+ },
59
+ "seq": {
60
+ "type": "integer",
61
+ "exclusiveMinimum": 0,
62
+ "maximum": 9007199254740991,
63
+ "description": "A monotonic counter ascending in mint order, and the named tiebreaker for any listing that claims one — `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."
64
+ },
65
+ "result": {
66
+ "anyOf": [
67
+ {},
68
+ {
69
+ "type": "null"
70
+ }
71
+ ],
72
+ "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."
73
+ },
74
+ "error": {
75
+ "anyOf": [
76
+ {
77
+ "type": "object",
78
+ "properties": {
79
+ "code": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "description": "A machine-readable code for the failure, such as `job_queue_full`, where one exists for it."
83
+ },
84
+ "message": {
85
+ "type": "string",
86
+ "minLength": 1,
87
+ "description": "A human-readable sentence saying what went wrong."
88
+ },
89
+ "details": {
90
+ "description": "The structured payload belonging to `code`, for the codes that document one — `job_queue_full` carries its `limit` and its `queued` count here. Absent for a failure with nothing structured to add, which is most of them."
91
+ }
92
+ },
93
+ "required": [
94
+ "code",
95
+ "message"
96
+ ],
97
+ "additionalProperties": false
98
+ },
99
+ {
100
+ "type": "null"
101
+ }
102
+ ],
103
+ "description": "Why the job failed, or why the cloud does not know how it stands: a human `message`, a `code` where one exists, and `details` for the codes that carry a documented payload. Set on `failed` and `lost`, and on `unknown` — where `code` is `bridge_disconnected` or `bridge_timeout`, the cloud's own reason for not knowing, cleared when the bridge reports the job running again."
104
+ }
105
+ },
106
+ "required": [
107
+ "id",
108
+ "robot_id",
109
+ "slug",
110
+ "state",
111
+ "origin",
112
+ "started_at",
113
+ "updated_at",
114
+ "seq",
115
+ "result",
116
+ "error"
117
+ ],
118
+ "additionalProperties": false
119
+ }
120
+ },
121
+ "required": [
122
+ "job"
123
+ ],
124
+ "additionalProperties": false
125
+ }
@@ -40,6 +40,20 @@
40
40
  "low_bandwidth": {
41
41
  "type": "boolean",
42
42
  "description": "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported."
43
+ },
44
+ "health_reason": {
45
+ "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.",
46
+ "anyOf": [
47
+ {
48
+ "type": "string",
49
+ "enum": [
50
+ "job_query_unanswered"
51
+ ]
52
+ },
53
+ {
54
+ "type": "null"
55
+ }
56
+ ]
43
57
  }
44
58
  },
45
59
  "required": [
@@ -40,6 +40,20 @@
40
40
  "low_bandwidth": {
41
41
  "type": "boolean",
42
42
  "description": "Whether the bridge is in its low-bandwidth mode: datapoints capped, cameras reduced or stopped. Bridge-reported."
43
+ },
44
+ "health_reason": {
45
+ "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.",
46
+ "anyOf": [
47
+ {
48
+ "type": "string",
49
+ "enum": [
50
+ "job_query_unanswered"
51
+ ]
52
+ },
53
+ {
54
+ "type": "null"
55
+ }
56
+ ]
43
57
  }
44
58
  },
45
59
  "required": [