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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +138 -6
  13. package/dist/interfaces/Route.js +306 -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 +139 -6
  38. package/dist/payloads/Route.js +315 -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,58 @@ 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 boundary is defined. UNSPECIFIED MUST be read as
104
+ * OFFSET: every leg published before this field existed is a constant-offset
105
+ * corridor, and reading it any other way would change routes nobody edited.
106
+ */
107
+ export declare enum XtdCorridorMode {
108
+ XTD_CORRIDOR_MODE_UNSPECIFIED = 0,
109
+ /** XTD_CORRIDOR_MODE_OFFSET - Parallel lines at xtd_port_m / xtd_starboard_m either side of track. */
110
+ XTD_CORRIDOR_MODE_OFFSET = 1,
111
+ /**
112
+ * XTD_CORRIDOR_MODE_POLYLINE - A boundary drawn by the planner (Leg.xtd_port_boundary /
113
+ * xtd_starboard_boundary), e.g. a corridor that narrows past a shoal.
114
+ * xtd_port_m / xtd_starboard_m still carry a nominal limit for a monitor
115
+ * that does not evaluate polylines. That fallback is NOT conservative when
116
+ * the drawn corridor is narrower than the nominal one, which is why such a
117
+ * monitor SHOULD report the leg as monitored at reduced fidelity.
118
+ */
119
+ XTD_CORRIDOR_MODE_POLYLINE = 2,
120
+ UNRECOGNIZED = -1
121
+ }
122
+ export declare function xtdCorridorModeFromJSON(object: any): XtdCorridorMode;
123
+ export declare function xtdCorridorModeToJSON(object: XtdCorridorMode): string;
124
+ /**
125
+ * Whether a route's waypoint list closes back on itself. RTZ 1.2 has no such
126
+ * concept, so producers either repeated the first waypoint (breaking id
127
+ * uniqueness) or left closing to consumer convention (silently wrong the first
128
+ * time a consumer chooses not to loop). This field makes the author say.
129
+ *
130
+ * An enum rather than a bool, like every other classification in this file:
131
+ * OPEN says closure was considered and declined, and there is room for a
132
+ * third topology (out-and-back). UNSPECIFIED MUST be read as OPEN; that is
133
+ * the fail-safe direction, since sailing a point-to-point route as a circuit
134
+ * takes the vessel over unplanned water. Terminal behaviour (stop, hold, go
135
+ * round again) is execution policy and belongs on keelson.Voyage, not here.
136
+ * See protocol-specification.md §6.2.1.
137
+ */
138
+ export declare enum RouteTopology {
139
+ ROUTE_TOPOLOGY_UNSPECIFIED = 0,
140
+ /**
141
+ * ROUTE_TOPOLOGY_OPEN - Runs from the first waypoint to the last and ends there. The last
142
+ * waypoint has no outgoing leg.
143
+ */
144
+ ROUTE_TOPOLOGY_OPEN = 1,
145
+ /**
146
+ * ROUTE_TOPOLOGY_CLOSED - A circuit: the last waypoint's outgoing leg terminates at the first
147
+ * waypoint, which is NOT repeated at the end of the list.
148
+ */
149
+ ROUTE_TOPOLOGY_CLOSED = 2,
150
+ UNRECOGNIZED = -1
151
+ }
152
+ export declare function routeTopologyFromJSON(object: any): RouteTopology;
153
+ export declare function routeTopologyToJSON(object: RouteTopology): string;
91
154
  /**
92
155
  * Lifecycle status for the route artifact (authoring + quality).
93
156
  * Execution-side state (vessel sailing, paused, completed) lives on
@@ -323,10 +386,18 @@ export interface Waypoints {
323
386
  defaults: DefaultWaypoint | undefined;
324
387
  /** Ordered list of waypoints, in route order. */
325
388
  waypoint: Waypoint[];
389
+ /**
390
+ * Whether the list above closes back on itself. Lives here because it is a
391
+ * statement about this list. Unset reads as ROUTE_TOPOLOGY_OPEN (§6.2.1).
392
+ */
393
+ topology: RouteTopology;
326
394
  extensions: Extensions | undefined;
327
395
  }
328
396
  /**
329
- * Default values for waypoint/leg fields. RTZ-aligned.
397
+ * Default values for waypoint/leg fields. RTZ-aligned — the field set matches
398
+ * RTZ's own defaultWaypoint element, which is a separate question from where
399
+ * leg data hangs: a merged default inherits the departure convention of the
400
+ * field it backs, same as an explicit value (§6.2.1).
330
401
  *
331
402
  * The scalars are `optional` for the same reason as their `Waypoint`
332
403
  * counterparts, one level up: without presence there is no way to say "this
@@ -364,8 +435,9 @@ export interface Waypoint {
364
435
  */
365
436
  position: Coordinate | undefined;
366
437
  /**
367
- * Planned speed over ground when leaving this waypoint. `optional` because
368
- * `Waypoints.defaults` backs this field: without presence, "no override,
438
+ * Planned speed over ground when LEAVING this waypoint, i.e. on `leg`
439
+ * below. RTZ indexes this on the arrival waypoint instead (§6.2.1).
440
+ * `optional` because `Waypoints.defaults` backs this field: without presence, "no override,
369
441
  * use the default" and "hold zero speed here" are the same bytes, and 0.0
370
442
  * is the more dangerous reading of the pair.
371
443
  */
@@ -389,12 +461,23 @@ export interface Waypoint {
389
461
  lock: boolean;
390
462
  /** Operational context for this waypoint (open sea, port approach, lock, ...). */
391
463
  operationalContext: OperationalContext;
392
- /** Outgoing leg from this waypoint to the next. The last waypoint has none. */
464
+ /**
465
+ * Outgoing leg from this waypoint to the next: `waypoint[i].leg` is the edge
466
+ * to `waypoint[i+1]`. In an OPEN route the last waypoint has none and a
467
+ * consumer MUST ignore one if present. In a CLOSED route the last waypoint's
468
+ * leg runs to `waypoint[0]`; that is how a circuit closes, never by
469
+ * repeating the first waypoint. RTZ hangs the leg on the ARRIVAL waypoint,
470
+ * so a converter shifts by one (§6.2.1).
471
+ */
393
472
  leg: Leg | undefined;
394
473
  /** Free-form notes attached to this waypoint. */
395
474
  note: string;
396
475
  extensions: Extensions | undefined;
397
476
  }
477
+ /**
478
+ * Every field here describes the edge LEAVING the waypoint that carries it
479
+ * (see Waypoint.leg and §6.2.1 for the RTZ shift).
480
+ */
398
481
  export interface Leg {
399
482
  /**
400
483
  * Cross-track distance (XTD) limits and monitoring thresholds, in metres.
@@ -405,6 +488,19 @@ export interface Leg {
405
488
  xtdStarboardM?: number | undefined;
406
489
  xtdMonitoringPortM?: number | undefined;
407
490
  xtdMonitoringStarboardM?: number | undefined;
491
+ /**
492
+ * How this leg's XTD corridor boundary is shaped. See XtdCorridorMode and
493
+ * protocol-specification.md §6.2.2.
494
+ */
495
+ xtdCorridorMode: XtdCorridorMode;
496
+ /**
497
+ * POLYLINE only: the drawn corridor boundary on each side, vertices in
498
+ * along-track order, covering this leg and the turn at the waypoint it
499
+ * arrives at. A consumer MUST ignore both lists unless the mode is POLYLINE,
500
+ * so a stale shape left behind by a switch back to OFFSET is never sailed.
501
+ */
502
+ xtdPortBoundary: XtdBoundaryPoint[];
503
+ xtdStarboardBoundary: XtdBoundaryPoint[];
408
504
  /**
409
505
  * Safety contour (depth in metres below chart datum) below which the route
410
506
  * is considered unsafe.
@@ -453,6 +549,36 @@ export interface Leg {
453
549
  colregTrafficIntensity: ColregTrafficIntensity;
454
550
  extensions: Extensions | undefined;
455
551
  }
552
+ /**
553
+ * One vertex of a drawn XTD corridor boundary (Leg.xtd_port_boundary /
554
+ * Leg.xtd_starboard_boundary).
555
+ */
556
+ export interface XtdBoundaryPoint {
557
+ /**
558
+ * WGS-84 vertex. Authoritative: this is the boundary a monitor checks
559
+ * against, whatever the anchor below says.
560
+ */
561
+ position: Coordinate | undefined;
562
+ /**
563
+ * Editor anchor — where along the leg's straight the vertex was placed,
564
+ * 0 at the leg's start and 1 at its end, and how far off track. Lets an
565
+ * editor keep the vertex attached to the leg when a waypoint moves, instead
566
+ * of leaving it stranded at its old position. `optional` because a vertex
567
+ * placed freely (at a leg end or inside a turn) has no such anchor, and 0
568
+ * is a real fraction.
569
+ */
570
+ alongTrackFraction?: number | undefined;
571
+ /**
572
+ * Perpendicular distance from track for that anchor, metres, always
573
+ * positive: the side is given by which boundary list holds the vertex.
574
+ */
575
+ offsetM?: number | undefined;
576
+ /**
577
+ * True when the vertex lies on the turn at the leg's end rather than on the
578
+ * straight.
579
+ */
580
+ inTurn: boolean;
581
+ }
456
582
  export interface Schedules {
457
583
  /** Multiple schedules can coexist (e.g. "manual", "weather-optimized"). */
458
584
  schedule: Schedule[];
@@ -489,7 +615,12 @@ export interface ScheduleElement {
489
615
  etdWindowEnd: Date | undefined;
490
616
  /** Planned duration of stay at this waypoint (port, anchorage, ...). */
491
617
  stay: Duration | undefined;
492
- /** -- Environmental forecast for this leg ------------------------------------ */
618
+ /**
619
+ * -- Environmental forecast for this leg ------------------------------------
620
+ * The OUTGOING leg — the one leaving `waypoint_id`, matching `Waypoint.leg`
621
+ * and `planned_sog_knots`. The last waypoint of an OPEN route has no
622
+ * outgoing leg and so no forecast to carry (§6.2.1).
623
+ */
493
624
  windSpeedMps: number;
494
625
  windDirectionDeg: number;
495
626
  currentSpeedMps: number;
@@ -632,6 +763,7 @@ export declare const Waypoints: MessageFns<Waypoints>;
632
763
  export declare const DefaultWaypoint: MessageFns<DefaultWaypoint>;
633
764
  export declare const Waypoint: MessageFns<Waypoint>;
634
765
  export declare const Leg: MessageFns<Leg>;
766
+ export declare const XtdBoundaryPoint: MessageFns<XtdBoundaryPoint>;
635
767
  export declare const Schedules: MessageFns<Schedules>;
636
768
  export declare const Schedule: MessageFns<Schedule>;
637
769
  export declare const ScheduleElement: MessageFns<ScheduleElement>;