@rise-maritime/keelson-js 0.6.0-alpha.255.dev.1 → 0.6.0-alpha.275.dev.2

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.
Files changed (48) hide show
  1. package/dist/index.d.ts +83 -8
  2. package/dist/index.js +23 -1
  3. package/dist/index.test.js +31 -0
  4. package/dist/interfaces/AlarmAck.d.ts +2 -2
  5. package/dist/interfaces/AlarmAck.js +2 -2
  6. package/dist/interfaces/ContainerControl.d.ts +239 -0
  7. package/dist/interfaces/ContainerControl.js +1053 -0
  8. package/dist/interfaces/ContainerHost.d.ts +403 -0
  9. package/dist/interfaces/ContainerHost.js +1230 -0
  10. package/dist/interfaces/ErrorResponse.d.ts +7 -2
  11. package/dist/interfaces/ErrorResponse.js +12 -2
  12. package/dist/interfaces/Route.d.ts +141 -6
  13. package/dist/interfaces/Route.js +309 -4
  14. package/dist/interfaces/RoutePlanner.d.ts +19 -1
  15. package/dist/interfaces/RoutePlanner.js +23 -1
  16. package/dist/interfaces/ScenarioControl.d.ts +132 -3
  17. package/dist/interfaces/ScenarioControl.js +439 -37
  18. package/dist/interfaces/VehicleNavigation.d.ts +55 -0
  19. package/dist/interfaces/VehicleNavigation.js +233 -1
  20. package/dist/interfaces/VehicleSimulatorControl.d.ts +0 -83
  21. package/dist/interfaces/VehicleSimulatorControl.js +1 -293
  22. package/dist/interfaces/serviceRegistry.d.ts +84 -8
  23. package/dist/interfaces/serviceRegistry.js +4 -0
  24. package/dist/interfaces.json +2 -0
  25. package/dist/payloads/AdviceDisposition.d.ts +55 -0
  26. package/dist/payloads/AdviceDisposition.js +242 -0
  27. package/dist/payloads/ChecklistHandover.d.ts +522 -0
  28. package/dist/payloads/ChecklistHandover.js +1735 -0
  29. package/dist/payloads/ContainerHost.d.ts +407 -0
  30. package/dist/payloads/ContainerHost.js +1245 -0
  31. package/dist/payloads/Encounter.d.ts +104 -0
  32. package/dist/payloads/Encounter.js +573 -0
  33. package/dist/payloads/NavigationAdvice.d.ts +94 -0
  34. package/dist/payloads/NavigationAdvice.js +596 -0
  35. package/dist/payloads/NavigationState.d.ts +90 -0
  36. package/dist/payloads/NavigationState.js +377 -0
  37. package/dist/payloads/Route.d.ts +142 -6
  38. package/dist/payloads/Route.js +318 -4
  39. package/dist/payloads/RouteExecution.d.ts +7 -0
  40. package/dist/payloads/ScenarioEvent.d.ts +14 -0
  41. package/dist/payloads/ScenarioEvent.js +16 -0
  42. package/dist/payloads/index.d.ts +1 -1
  43. package/dist/payloads/index.js +2 -2
  44. package/dist/payloads/index.keelson.d.ts +10 -4
  45. package/dist/payloads/index.keelson.js +10 -4
  46. package/dist/qos.json +6 -0
  47. package/dist/subjects.json +20 -1
  48. package/package.json +1 -1
@@ -19,14 +19,19 @@ export declare enum ErrorResponse_Code {
19
19
  OUT_OF_RANGE = 3,
20
20
  /** INVALID_STATE - wrong state for the operation (e.g. pause when STOPPED) */
21
21
  INVALID_STATE = 4,
22
- /** PERMISSION_DENIED - path escapes base directory, lock-down rules */
22
+ /** PERMISSION_DENIED - refused under current conditions: authorisation, */
23
23
  PERMISSION_DENIED = 5,
24
- /** IO_FAILURE - read/write fault on disk, network, etc. */
24
+ /**
25
+ * IO_FAILURE - lock-down rules, policy. The answer MAY change;
26
+ * the ErrorResponse twin of COMMAND_RESULT_DENIED.
27
+ */
25
28
  IO_FAILURE = 6,
26
29
  /** UNAVAILABLE - backend / dependency not ready */
27
30
  UNAVAILABLE = 7,
28
31
  /** INTERNAL - unhandled exception */
29
32
  INTERNAL = 8,
33
+ /** UNSUPPORTED - structurally not implemented by this source; the */
34
+ UNSUPPORTED = 9,
30
35
  UNRECOGNIZED = -1
31
36
  }
32
37
  export declare function errorResponse_CodeFromJSON(object: any): ErrorResponse_Code;
@@ -25,14 +25,19 @@ var ErrorResponse_Code;
25
25
  ErrorResponse_Code[ErrorResponse_Code["OUT_OF_RANGE"] = 3] = "OUT_OF_RANGE";
26
26
  /** INVALID_STATE - wrong state for the operation (e.g. pause when STOPPED) */
27
27
  ErrorResponse_Code[ErrorResponse_Code["INVALID_STATE"] = 4] = "INVALID_STATE";
28
- /** PERMISSION_DENIED - path escapes base directory, lock-down rules */
28
+ /** PERMISSION_DENIED - refused under current conditions: authorisation, */
29
29
  ErrorResponse_Code[ErrorResponse_Code["PERMISSION_DENIED"] = 5] = "PERMISSION_DENIED";
30
- /** IO_FAILURE - read/write fault on disk, network, etc. */
30
+ /**
31
+ * IO_FAILURE - lock-down rules, policy. The answer MAY change;
32
+ * the ErrorResponse twin of COMMAND_RESULT_DENIED.
33
+ */
31
34
  ErrorResponse_Code[ErrorResponse_Code["IO_FAILURE"] = 6] = "IO_FAILURE";
32
35
  /** UNAVAILABLE - backend / dependency not ready */
33
36
  ErrorResponse_Code[ErrorResponse_Code["UNAVAILABLE"] = 7] = "UNAVAILABLE";
34
37
  /** INTERNAL - unhandled exception */
35
38
  ErrorResponse_Code[ErrorResponse_Code["INTERNAL"] = 8] = "INTERNAL";
39
+ /** UNSUPPORTED - structurally not implemented by this source; the */
40
+ ErrorResponse_Code[ErrorResponse_Code["UNSUPPORTED"] = 9] = "UNSUPPORTED";
36
41
  ErrorResponse_Code[ErrorResponse_Code["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
37
42
  })(ErrorResponse_Code || (exports.ErrorResponse_Code = ErrorResponse_Code = {}));
38
43
  function errorResponse_CodeFromJSON(object) {
@@ -64,6 +69,9 @@ function errorResponse_CodeFromJSON(object) {
64
69
  case 8:
65
70
  case "INTERNAL":
66
71
  return ErrorResponse_Code.INTERNAL;
72
+ case 9:
73
+ case "UNSUPPORTED":
74
+ return ErrorResponse_Code.UNSUPPORTED;
67
75
  case -1:
68
76
  case "UNRECOGNIZED":
69
77
  default:
@@ -91,6 +99,8 @@ function errorResponse_CodeToJSON(object) {
91
99
  return "UNAVAILABLE";
92
100
  case ErrorResponse_Code.INTERNAL:
93
101
  return "INTERNAL";
102
+ case ErrorResponse_Code.UNSUPPORTED:
103
+ return "UNSUPPORTED";
94
104
  case ErrorResponse_Code.UNRECOGNIZED:
95
105
  default:
96
106
  return "UNRECOGNIZED";
@@ -57,13 +57,24 @@ export declare enum HazardZoneType {
57
57
  }
58
58
  export declare function hazardZoneTypeFromJSON(object: any): HazardZoneType;
59
59
  export declare function hazardZoneTypeToJSON(object: HazardZoneType): string;
60
- /** COLREG encounter situation for an annotated leg. */
60
+ /**
61
+ * COLREG encounter situation, from own ship's side. One vocabulary for the plan and the live
62
+ * picture: a Route leg is annotated with 1-4 only; Encounter.situation may also carry 5-6, which
63
+ * describe a live target and never a planned leg.
64
+ */
61
65
  export declare enum ColregSituation {
62
66
  COLREG_SITUATION_UNSPECIFIED = 0,
67
+ /** COLREG_SITUATION_OVERTAKING - own ship is overtaking */
63
68
  COLREG_SITUATION_OVERTAKING = 1,
69
+ /** COLREG_SITUATION_CROSSING_STBD - target crossing from own starboard */
64
70
  COLREG_SITUATION_CROSSING_STBD = 2,
71
+ /** COLREG_SITUATION_CROSSING_PORT - target crossing from own port */
65
72
  COLREG_SITUATION_CROSSING_PORT = 3,
66
73
  COLREG_SITUATION_HEAD_ON = 4,
74
+ /** COLREG_SITUATION_OVERTAKEN - target is overtaking own ship (Encounter only) */
75
+ COLREG_SITUATION_OVERTAKEN = 5,
76
+ /** COLREG_SITUATION_NONE - target not under way, or restricted visibility (Encounter only) */
77
+ COLREG_SITUATION_NONE = 6,
67
78
  UNRECOGNIZED = -1
68
79
  }
69
80
  export declare function colregSituationFromJSON(object: any): ColregSituation;
@@ -88,6 +99,61 @@ export declare enum GeometryType {
88
99
  }
89
100
  export declare function geometryTypeFromJSON(object: any): GeometryType;
90
101
  export declare function geometryTypeToJSON(object: GeometryType): string;
102
+ /**
103
+ * How a leg's XTD corridor is shaped. UNSPECIFIED MUST be read as FIXED:
104
+ * every leg published before this field existed is a fixed-width corridor, and
105
+ * reading it any other way would change routes nobody edited.
106
+ */
107
+ export declare enum XtdCorridorMode {
108
+ XTD_CORRIDOR_MODE_UNSPECIFIED = 0,
109
+ /**
110
+ * XTD_CORRIDOR_MODE_FIXED - Fixed width: parallel lines at xtd_port_m / xtd_starboard_m either side of
111
+ * track.
112
+ */
113
+ XTD_CORRIDOR_MODE_FIXED = 1,
114
+ /**
115
+ * XTD_CORRIDOR_MODE_VARIABLE - Variable width: a boundary drawn by the planner (Leg.xtd_port_boundary /
116
+ * xtd_starboard_boundary), e.g. a corridor that narrows past a shoal.
117
+ * xtd_port_m / xtd_starboard_m still carry a nominal limit for a monitor
118
+ * that does not evaluate the boundary. That fallback is NOT conservative when
119
+ * the drawn corridor is narrower than the nominal one, which is why such a
120
+ * monitor SHOULD report the leg as monitored at reduced fidelity.
121
+ */
122
+ XTD_CORRIDOR_MODE_VARIABLE = 2,
123
+ UNRECOGNIZED = -1
124
+ }
125
+ export declare function xtdCorridorModeFromJSON(object: any): XtdCorridorMode;
126
+ export declare function xtdCorridorModeToJSON(object: XtdCorridorMode): string;
127
+ /**
128
+ * Whether a route's waypoint list closes back on itself. RTZ 1.2 has no such
129
+ * concept, so producers either repeated the first waypoint (breaking id
130
+ * uniqueness) or left closing to consumer convention (silently wrong the first
131
+ * time a consumer chooses not to loop). This field makes the author say.
132
+ *
133
+ * An enum rather than a bool, like every other classification in this file:
134
+ * OPEN says closure was considered and declined, and there is room for a
135
+ * third topology (out-and-back). UNSPECIFIED MUST be read as OPEN; that is
136
+ * the fail-safe direction, since sailing a point-to-point route as a circuit
137
+ * takes the vessel over unplanned water. Terminal behaviour (stop, hold, go
138
+ * round again) is execution policy and belongs on keelson.Voyage, not here.
139
+ * See protocol-specification.md §6.2.1.
140
+ */
141
+ export declare enum RouteTopology {
142
+ ROUTE_TOPOLOGY_UNSPECIFIED = 0,
143
+ /**
144
+ * ROUTE_TOPOLOGY_OPEN - Runs from the first waypoint to the last and ends there. The last
145
+ * waypoint has no outgoing leg.
146
+ */
147
+ ROUTE_TOPOLOGY_OPEN = 1,
148
+ /**
149
+ * ROUTE_TOPOLOGY_CLOSED - A circuit: the last waypoint's outgoing leg terminates at the first
150
+ * waypoint, which is NOT repeated at the end of the list.
151
+ */
152
+ ROUTE_TOPOLOGY_CLOSED = 2,
153
+ UNRECOGNIZED = -1
154
+ }
155
+ export declare function routeTopologyFromJSON(object: any): RouteTopology;
156
+ export declare function routeTopologyToJSON(object: RouteTopology): string;
91
157
  /**
92
158
  * Lifecycle status for the route artifact (authoring + quality).
93
159
  * Execution-side state (vessel sailing, paused, completed) lives on
@@ -323,10 +389,18 @@ export interface Waypoints {
323
389
  defaults: DefaultWaypoint | undefined;
324
390
  /** Ordered list of waypoints, in route order. */
325
391
  waypoint: Waypoint[];
392
+ /**
393
+ * Whether the list above closes back on itself. Lives here because it is a
394
+ * statement about this list. Unset reads as ROUTE_TOPOLOGY_OPEN (§6.2.1).
395
+ */
396
+ topology: RouteTopology;
326
397
  extensions: Extensions | undefined;
327
398
  }
328
399
  /**
329
- * Default values for waypoint/leg fields. RTZ-aligned.
400
+ * Default values for waypoint/leg fields. RTZ-aligned — the field set matches
401
+ * RTZ's own defaultWaypoint element, which is a separate question from where
402
+ * leg data hangs: a merged default inherits the departure convention of the
403
+ * field it backs, same as an explicit value (§6.2.1).
330
404
  *
331
405
  * The scalars are `optional` for the same reason as their `Waypoint`
332
406
  * counterparts, one level up: without presence there is no way to say "this
@@ -364,8 +438,9 @@ export interface Waypoint {
364
438
  */
365
439
  position: Coordinate | undefined;
366
440
  /**
367
- * Planned speed over ground when leaving this waypoint. `optional` because
368
- * `Waypoints.defaults` backs this field: without presence, "no override,
441
+ * Planned speed over ground when LEAVING this waypoint, i.e. on `leg`
442
+ * below. RTZ indexes this on the arrival waypoint instead (§6.2.1).
443
+ * `optional` because `Waypoints.defaults` backs this field: without presence, "no override,
369
444
  * use the default" and "hold zero speed here" are the same bytes, and 0.0
370
445
  * is the more dangerous reading of the pair.
371
446
  */
@@ -389,12 +464,23 @@ export interface Waypoint {
389
464
  lock: boolean;
390
465
  /** Operational context for this waypoint (open sea, port approach, lock, ...). */
391
466
  operationalContext: OperationalContext;
392
- /** Outgoing leg from this waypoint to the next. The last waypoint has none. */
467
+ /**
468
+ * Outgoing leg from this waypoint to the next: `waypoint[i].leg` is the edge
469
+ * to `waypoint[i+1]`. In an OPEN route the last waypoint has none and a
470
+ * consumer MUST ignore one if present. In a CLOSED route the last waypoint's
471
+ * leg runs to `waypoint[0]`; that is how a circuit closes, never by
472
+ * repeating the first waypoint. RTZ hangs the leg on the ARRIVAL waypoint,
473
+ * so a converter shifts by one (§6.2.1).
474
+ */
393
475
  leg: Leg | undefined;
394
476
  /** Free-form notes attached to this waypoint. */
395
477
  note: string;
396
478
  extensions: Extensions | undefined;
397
479
  }
480
+ /**
481
+ * Every field here describes the edge LEAVING the waypoint that carries it
482
+ * (see Waypoint.leg and §6.2.1 for the RTZ shift).
483
+ */
398
484
  export interface Leg {
399
485
  /**
400
486
  * Cross-track distance (XTD) limits and monitoring thresholds, in metres.
@@ -405,6 +491,19 @@ export interface Leg {
405
491
  xtdStarboardM?: number | undefined;
406
492
  xtdMonitoringPortM?: number | undefined;
407
493
  xtdMonitoringStarboardM?: number | undefined;
494
+ /**
495
+ * Whether this leg's XTD corridor is fixed or variable width. See XtdCorridorMode and
496
+ * protocol-specification.md §6.2.2.
497
+ */
498
+ xtdCorridorMode: XtdCorridorMode;
499
+ /**
500
+ * VARIABLE only: the drawn corridor boundary on each side, vertices in
501
+ * along-track order, covering this leg and the turn at the waypoint it
502
+ * arrives at. A consumer MUST ignore both lists unless the mode is VARIABLE,
503
+ * so a stale shape left behind by a switch back to FIXED is never sailed.
504
+ */
505
+ xtdPortBoundary: XtdBoundaryPoint[];
506
+ xtdStarboardBoundary: XtdBoundaryPoint[];
408
507
  /**
409
508
  * Safety contour (depth in metres below chart datum) below which the route
410
509
  * is considered unsafe.
@@ -453,6 +552,36 @@ export interface Leg {
453
552
  colregTrafficIntensity: ColregTrafficIntensity;
454
553
  extensions: Extensions | undefined;
455
554
  }
555
+ /**
556
+ * One vertex of a variable-width XTD corridor boundary (Leg.xtd_port_boundary /
557
+ * Leg.xtd_starboard_boundary).
558
+ */
559
+ export interface XtdBoundaryPoint {
560
+ /**
561
+ * WGS-84 vertex. Authoritative: this is the boundary a monitor checks
562
+ * against, whatever the anchor below says.
563
+ */
564
+ position: Coordinate | undefined;
565
+ /**
566
+ * Editor anchor — where along the leg's straight the vertex was placed,
567
+ * 0 at the leg's start and 1 at its end, and how far off track. Lets an
568
+ * editor keep the vertex attached to the leg when a waypoint moves, instead
569
+ * of leaving it stranded at its old position. `optional` because a vertex
570
+ * placed freely (at a leg end or inside a turn) has no such anchor, and 0
571
+ * is a real fraction.
572
+ */
573
+ alongTrackFraction?: number | undefined;
574
+ /**
575
+ * Perpendicular distance from track for that anchor, metres, always
576
+ * positive: the side is given by which boundary list holds the vertex.
577
+ */
578
+ offsetM?: number | undefined;
579
+ /**
580
+ * True when the vertex lies on the turn at the leg's end rather than on the
581
+ * straight.
582
+ */
583
+ inTurn: boolean;
584
+ }
456
585
  export interface Schedules {
457
586
  /** Multiple schedules can coexist (e.g. "manual", "weather-optimized"). */
458
587
  schedule: Schedule[];
@@ -489,7 +618,12 @@ export interface ScheduleElement {
489
618
  etdWindowEnd: Date | undefined;
490
619
  /** Planned duration of stay at this waypoint (port, anchorage, ...). */
491
620
  stay: Duration | undefined;
492
- /** -- Environmental forecast for this leg ------------------------------------ */
621
+ /**
622
+ * -- Environmental forecast for this leg ------------------------------------
623
+ * The OUTGOING leg — the one leaving `waypoint_id`, matching `Waypoint.leg`
624
+ * and `planned_sog_knots`. The last waypoint of an OPEN route has no
625
+ * outgoing leg and so no forecast to carry (§6.2.1).
626
+ */
493
627
  windSpeedMps: number;
494
628
  windDirectionDeg: number;
495
629
  currentSpeedMps: number;
@@ -632,6 +766,7 @@ export declare const Waypoints: MessageFns<Waypoints>;
632
766
  export declare const DefaultWaypoint: MessageFns<DefaultWaypoint>;
633
767
  export declare const Waypoint: MessageFns<Waypoint>;
634
768
  export declare const Leg: MessageFns<Leg>;
769
+ export declare const XtdBoundaryPoint: MessageFns<XtdBoundaryPoint>;
635
770
  export declare const Schedules: MessageFns<Schedules>;
636
771
  export declare const Schedule: MessageFns<Schedule>;
637
772
  export declare const ScheduleElement: MessageFns<ScheduleElement>;