@rise-maritime/keelson-js 0.5.3 → 0.6.0-alpha.221.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 (111) hide show
  1. package/dist/index.d.ts +524 -1
  2. package/dist/index.js +114 -5
  3. package/dist/index.test.js +57 -0
  4. package/dist/interfaces/AlarmAck.d.ts +62 -0
  5. package/dist/interfaces/AlarmAck.js +218 -0
  6. package/dist/interfaces/Configurable.d.ts +24 -18
  7. package/dist/interfaces/Configurable.js +24 -22
  8. package/dist/interfaces/Coordinate.d.ts +38 -0
  9. package/dist/interfaces/Coordinate.js +82 -0
  10. package/dist/interfaces/ErrorResponse.d.ts +1 -1
  11. package/dist/interfaces/ErrorResponse.js +1 -1
  12. package/dist/interfaces/MavlinkCommand.d.ts +24 -18
  13. package/dist/interfaces/MavlinkCommand.js +24 -22
  14. package/dist/interfaces/Mission.d.ts +128 -0
  15. package/dist/interfaces/Mission.js +800 -0
  16. package/dist/interfaces/NetworkPingPong.d.ts +16 -16
  17. package/dist/interfaces/NetworkPingPong.js +16 -16
  18. package/dist/interfaces/ReplayControl.d.ts +72 -30
  19. package/dist/interfaces/ReplayControl.js +72 -58
  20. package/dist/interfaces/Route.d.ts +627 -0
  21. package/dist/interfaces/Route.js +4148 -0
  22. package/dist/interfaces/RoutePlanner.d.ts +152 -0
  23. package/dist/interfaces/RoutePlanner.js +268 -0
  24. package/dist/interfaces/ScenarioCheckpoint.d.ts +154 -0
  25. package/dist/interfaces/ScenarioCheckpoint.js +694 -0
  26. package/dist/interfaces/ScenarioControl.d.ts +144 -0
  27. package/dist/interfaces/ScenarioControl.js +552 -0
  28. package/dist/interfaces/Severity.d.ts +22 -0
  29. package/dist/interfaces/Severity.js +72 -0
  30. package/dist/interfaces/SimulationControl.d.ts +69 -0
  31. package/dist/interfaces/SimulationControl.js +153 -0
  32. package/dist/interfaces/Subscriber.d.ts +24 -18
  33. package/dist/interfaces/Subscriber.js +24 -22
  34. package/dist/interfaces/VehicleCommon.d.ts +1 -32
  35. package/dist/interfaces/VehicleCommon.js +2 -74
  36. package/dist/interfaces/VehicleControl.d.ts +34 -28
  37. package/dist/interfaces/VehicleControl.js +34 -22
  38. package/dist/interfaces/VehicleGeofence.d.ts +26 -19
  39. package/dist/interfaces/VehicleGeofence.js +40 -37
  40. package/dist/interfaces/VehicleLifecycle.d.ts +32 -20
  41. package/dist/interfaces/VehicleLifecycle.js +32 -28
  42. package/dist/interfaces/VehicleMission.d.ts +42 -97
  43. package/dist/interfaces/VehicleMission.js +41 -696
  44. package/dist/interfaces/VehicleNavigation.d.ts +30 -24
  45. package/dist/interfaces/VehicleNavigation.js +30 -22
  46. package/dist/interfaces/VehicleParam.d.ts +48 -24
  47. package/dist/interfaces/VehicleParam.js +48 -40
  48. package/dist/interfaces/VehicleSimulatorControl.d.ts +57 -0
  49. package/dist/interfaces/VehicleSimulatorControl.js +155 -0
  50. package/dist/interfaces/WHEPProxy.d.ts +16 -16
  51. package/dist/interfaces/WHEPProxy.js +16 -16
  52. package/dist/interfaces/foxglove/GeoJSON.d.ts +27 -0
  53. package/dist/interfaces/foxglove/GeoJSON.js +65 -0
  54. package/dist/interfaces/foxglove/LocationFix.d.ts +49 -0
  55. package/dist/interfaces/foxglove/LocationFix.js +246 -0
  56. package/dist/interfaces/google/protobuf/any.d.ts +144 -0
  57. package/dist/interfaces/google/protobuf/any.js +107 -0
  58. package/dist/interfaces/google/protobuf/duration.d.ts +99 -0
  59. package/dist/interfaces/google/protobuf/duration.js +92 -0
  60. package/dist/interfaces/serviceRegistry.d.ts +520 -0
  61. package/dist/interfaces/serviceRegistry.js +40 -0
  62. package/dist/interfaces.json +19 -0
  63. package/dist/payloads/Alarm.d.ts +7 -12
  64. package/dist/payloads/Alarm.js +4 -54
  65. package/dist/payloads/CommandAuthority.d.ts +82 -0
  66. package/dist/payloads/CommandAuthority.js +364 -0
  67. package/dist/payloads/Coordinate.d.ts +39 -0
  68. package/dist/payloads/Coordinate.js +85 -0
  69. package/dist/payloads/EntityHealth.d.ts +9 -0
  70. package/dist/payloads/EntityHealth.js +14 -0
  71. package/dist/payloads/Mission.d.ts +137 -0
  72. package/dist/payloads/Mission.js +826 -0
  73. package/dist/payloads/OperationalAuthority.d.ts +172 -5
  74. package/dist/payloads/OperationalAuthority.js +525 -6
  75. package/dist/payloads/Route.d.ts +649 -0
  76. package/dist/payloads/Route.js +4257 -0
  77. package/dist/payloads/RouteChangeEvent.d.ts +42 -0
  78. package/dist/payloads/RouteChangeEvent.js +223 -0
  79. package/dist/payloads/RouteEditAuthority.d.ts +87 -0
  80. package/dist/payloads/RouteEditAuthority.js +380 -0
  81. package/dist/payloads/RouteExecution.d.ts +64 -0
  82. package/dist/payloads/RouteExecution.js +310 -0
  83. package/dist/payloads/ScenarioStatus.d.ts +160 -0
  84. package/dist/payloads/ScenarioStatus.js +654 -0
  85. package/dist/payloads/Severity.d.ts +13 -6
  86. package/dist/payloads/Severity.js +30 -18
  87. package/dist/payloads/SimulationStatus.d.ts +3 -4
  88. package/dist/payloads/SimulationStatus.js +12 -18
  89. package/dist/payloads/TestObjectStatus.d.ts +154 -0
  90. package/dist/payloads/TestObjectStatus.js +580 -0
  91. package/dist/payloads/VesselType.d.ts +2 -1
  92. package/dist/payloads/VesselType.js +1 -1
  93. package/dist/payloads/Voyage.d.ts +154 -0
  94. package/dist/payloads/Voyage.js +866 -0
  95. package/dist/payloads/WarrantRecord.d.ts +168 -0
  96. package/dist/payloads/WarrantRecord.js +781 -0
  97. package/dist/payloads/foxglove/CompressedPointCloud.d.ts +37 -0
  98. package/dist/payloads/foxglove/CompressedPointCloud.js +185 -0
  99. package/dist/payloads/google/protobuf/any.d.ts +145 -0
  100. package/dist/payloads/google/protobuf/any.js +110 -0
  101. package/dist/payloads/google/protobuf/empty.d.ts +34 -0
  102. package/dist/payloads/google/protobuf/empty.js +50 -0
  103. package/dist/payloads/index.foxglove.d.ts +1 -0
  104. package/dist/payloads/index.foxglove.js +1 -0
  105. package/dist/payloads/index.google.protobuf.d.ts +2 -0
  106. package/dist/payloads/index.google.protobuf.js +2 -0
  107. package/dist/payloads/index.keelson.d.ts +12 -1
  108. package/dist/payloads/index.keelson.js +12 -1
  109. package/dist/qos.json +89 -0
  110. package/dist/subjects.json +30 -1
  111. package/package.json +2 -1
@@ -0,0 +1,152 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { Coordinate } from "./Coordinate";
3
+ import { Extensions, Route, RouteInfo, RouteRef } from "./Route";
4
+ export declare const protobufPackage = "keelson.interfaces.route_planner";
5
+ /**
6
+ * What the planner should optimise for. A closed set, not the free-form
7
+ * string it replaced: a caller choosing a goal needs to know which goals
8
+ * exist, and an unrecognised label silently falling back to a default cost
9
+ * profile is the failure mode this prevents.
10
+ *
11
+ * Deployment-specific tunings (a particular trial's conservative profile, a
12
+ * pilot-matched profile) deliberately do NOT appear here — those are vendor
13
+ * configuration, and belong in `extensions` rather than in a vocabulary every
14
+ * consumer on the bus inherits.
15
+ */
16
+ export declare enum OptimizationGoal {
17
+ /** OPTIMIZATION_GOAL_UNSPECIFIED - planner picks its own default */
18
+ OPTIMIZATION_GOAL_UNSPECIFIED = 0,
19
+ OPTIMIZATION_GOAL_SHORTEST = 1,
20
+ OPTIMIZATION_GOAL_FASTEST = 2,
21
+ OPTIMIZATION_GOAL_SAFEST = 3,
22
+ OPTIMIZATION_GOAL_PREFER_FAIRWAYS = 4,
23
+ OPTIMIZATION_GOAL_AVOID_TRAFFIC = 5,
24
+ OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE = 6,
25
+ UNRECOGNIZED = -1
26
+ }
27
+ export declare function optimizationGoalFromJSON(object: any): OptimizationGoal;
28
+ export declare function optimizationGoalToJSON(object: OptimizationGoal): string;
29
+ /**
30
+ * Inputs to a planning run.
31
+ *
32
+ * This replaces an earlier shape in which the request was a `keelson.Route`
33
+ * "template" — start/end/via smuggled in as waypoints, vessel limits in
34
+ * `info`, and the planner's own inputs as stringly-typed `constraint.*` keys
35
+ * inside an `Extensions` entry. A request is not a route: it has no id, no
36
+ * edition, no status, and nothing to sign. Typing it means a caller can see
37
+ * what a planner actually accepts.
38
+ */
39
+ export interface PlanRouteRequest {
40
+ /**
41
+ * Ordered: first is the departure point, last is the destination, and any
42
+ * between them are via-points the route must pass through. At least two
43
+ * are required; a planner MUST reply `ErrorResponse(INVALID_ARGUMENT)`
44
+ * otherwise.
45
+ *
46
+ * `Coordinate`, not `Waypoint` — these are the positions the route must
47
+ * touch, not planned waypoints with turn radii and speeds. Those are the
48
+ * planner's output, not its input.
49
+ */
50
+ waypoints: Coordinate[];
51
+ /**
52
+ * Vessel dimensions, safety margins and limits the plan must respect —
53
+ * the same field set a produced `keelson.Route` carries, so a caller can
54
+ * round-trip the constraints of an existing route into a re-plan.
55
+ * `RouteInfo` carries no route identity (id, edition, status live on
56
+ * `Route`), which is exactly why it is the right request type: a request
57
+ * has nothing to identify.
58
+ */
59
+ constraints: RouteInfo | undefined;
60
+ goal: OptimizationGoal;
61
+ /**
62
+ * Upper bound on how many alternatives to reply with. 0 means the
63
+ * planner's own default. A planner MAY reply with fewer, and MUST NOT
64
+ * reply with more.
65
+ */
66
+ maxAlternatives: number;
67
+ /**
68
+ * Vendor-specific planning inputs — deployment tunings, experimental cost
69
+ * profiles. Anything that becomes generally useful should graduate to a
70
+ * typed field here rather than living in an `Any` forever.
71
+ */
72
+ extensions: Extensions | undefined;
73
+ }
74
+ export declare const PlanRouteRequest: MessageFns<PlanRouteRequest>;
75
+ export type RoutePlannerDefinition = typeof RoutePlannerDefinition;
76
+ export declare const RoutePlannerDefinition: {
77
+ readonly name: "RoutePlanner";
78
+ readonly fullName: "keelson.interfaces.route_planner.RoutePlanner";
79
+ readonly methods: {
80
+ /**
81
+ * Plan one or more routes between the requested points. Replies one
82
+ * `keelson.Route` per alternative — see note 1 in the file header about
83
+ * `consolidation=NONE`.
84
+ */
85
+ readonly plan_route: {
86
+ readonly name: "plan_route";
87
+ readonly requestType: MessageFns<PlanRouteRequest>;
88
+ readonly requestStream: false;
89
+ readonly responseType: import("./Route").MessageFns<Route>;
90
+ readonly responseStream: false;
91
+ readonly options: {};
92
+ };
93
+ /**
94
+ * Re-run navigability and validation against a (possibly hand-edited)
95
+ * route, replying it annotated with `challenges`, `issues` and `status`.
96
+ * Takes a whole `keelson.Route` because that is genuinely the input.
97
+ */
98
+ readonly validate_route: {
99
+ readonly name: "validate_route";
100
+ readonly requestType: import("./Route").MessageFns<Route>;
101
+ readonly requestStream: false;
102
+ readonly responseType: import("./Route").MessageFns<Route>;
103
+ readonly responseStream: false;
104
+ readonly options: {};
105
+ };
106
+ /**
107
+ * Fetch a stored route. `RouteRef` addresses a specific edition, so this
108
+ * resolves the same reference that appears inside other payloads — see
109
+ * §6.2. Replies `ErrorResponse(NOT_FOUND)` for an unknown id or a
110
+ * dangling edition.
111
+ */
112
+ readonly get_route: {
113
+ readonly name: "get_route";
114
+ readonly requestType: import("./Route").MessageFns<RouteRef>;
115
+ readonly requestStream: false;
116
+ readonly responseType: import("./Route").MessageFns<Route>;
117
+ readonly responseStream: false;
118
+ readonly options: {};
119
+ };
120
+ /**
121
+ * Select a route for execution: advances its status and bumps the edition.
122
+ * Mutating — see note 3 in the file header.
123
+ */
124
+ readonly select_route: {
125
+ readonly name: "select_route";
126
+ readonly requestType: import("./Route").MessageFns<RouteRef>;
127
+ readonly requestStream: false;
128
+ readonly responseType: import("./Route").MessageFns<Route>;
129
+ readonly responseStream: false;
130
+ readonly options: {};
131
+ };
132
+ };
133
+ };
134
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
135
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
136
+ [K in keyof T]?: DeepPartial<T[K]>;
137
+ } : Partial<T>;
138
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
139
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
140
+ [K in keyof P]: Exact<P[K], I[K]>;
141
+ } & {
142
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
143
+ };
144
+ export interface MessageFns<T> {
145
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
146
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
147
+ fromJSON(object: any): T;
148
+ toJSON(message: T): unknown;
149
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
150
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
151
+ }
152
+ export {};
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.6.1
5
+ // protoc v6.30.2
6
+ // source: RoutePlanner.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.RoutePlannerDefinition = exports.PlanRouteRequest = exports.optimizationGoalToJSON = exports.optimizationGoalFromJSON = exports.OptimizationGoal = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const Coordinate_1 = require("./Coordinate");
12
+ const Route_1 = require("./Route");
13
+ exports.protobufPackage = "keelson.interfaces.route_planner";
14
+ /**
15
+ * What the planner should optimise for. A closed set, not the free-form
16
+ * string it replaced: a caller choosing a goal needs to know which goals
17
+ * exist, and an unrecognised label silently falling back to a default cost
18
+ * profile is the failure mode this prevents.
19
+ *
20
+ * Deployment-specific tunings (a particular trial's conservative profile, a
21
+ * pilot-matched profile) deliberately do NOT appear here — those are vendor
22
+ * configuration, and belong in `extensions` rather than in a vocabulary every
23
+ * consumer on the bus inherits.
24
+ */
25
+ var OptimizationGoal;
26
+ (function (OptimizationGoal) {
27
+ /** OPTIMIZATION_GOAL_UNSPECIFIED - planner picks its own default */
28
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_UNSPECIFIED"] = 0] = "OPTIMIZATION_GOAL_UNSPECIFIED";
29
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_SHORTEST"] = 1] = "OPTIMIZATION_GOAL_SHORTEST";
30
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_FASTEST"] = 2] = "OPTIMIZATION_GOAL_FASTEST";
31
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_SAFEST"] = 3] = "OPTIMIZATION_GOAL_SAFEST";
32
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_PREFER_FAIRWAYS"] = 4] = "OPTIMIZATION_GOAL_PREFER_FAIRWAYS";
33
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_AVOID_TRAFFIC"] = 5] = "OPTIMIZATION_GOAL_AVOID_TRAFFIC";
34
+ OptimizationGoal[OptimizationGoal["OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE"] = 6] = "OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE";
35
+ OptimizationGoal[OptimizationGoal["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
36
+ })(OptimizationGoal || (exports.OptimizationGoal = OptimizationGoal = {}));
37
+ function optimizationGoalFromJSON(object) {
38
+ switch (object) {
39
+ case 0:
40
+ case "OPTIMIZATION_GOAL_UNSPECIFIED":
41
+ return OptimizationGoal.OPTIMIZATION_GOAL_UNSPECIFIED;
42
+ case 1:
43
+ case "OPTIMIZATION_GOAL_SHORTEST":
44
+ return OptimizationGoal.OPTIMIZATION_GOAL_SHORTEST;
45
+ case 2:
46
+ case "OPTIMIZATION_GOAL_FASTEST":
47
+ return OptimizationGoal.OPTIMIZATION_GOAL_FASTEST;
48
+ case 3:
49
+ case "OPTIMIZATION_GOAL_SAFEST":
50
+ return OptimizationGoal.OPTIMIZATION_GOAL_SAFEST;
51
+ case 4:
52
+ case "OPTIMIZATION_GOAL_PREFER_FAIRWAYS":
53
+ return OptimizationGoal.OPTIMIZATION_GOAL_PREFER_FAIRWAYS;
54
+ case 5:
55
+ case "OPTIMIZATION_GOAL_AVOID_TRAFFIC":
56
+ return OptimizationGoal.OPTIMIZATION_GOAL_AVOID_TRAFFIC;
57
+ case 6:
58
+ case "OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE":
59
+ return OptimizationGoal.OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE;
60
+ case -1:
61
+ case "UNRECOGNIZED":
62
+ default:
63
+ return OptimizationGoal.UNRECOGNIZED;
64
+ }
65
+ }
66
+ exports.optimizationGoalFromJSON = optimizationGoalFromJSON;
67
+ function optimizationGoalToJSON(object) {
68
+ switch (object) {
69
+ case OptimizationGoal.OPTIMIZATION_GOAL_UNSPECIFIED:
70
+ return "OPTIMIZATION_GOAL_UNSPECIFIED";
71
+ case OptimizationGoal.OPTIMIZATION_GOAL_SHORTEST:
72
+ return "OPTIMIZATION_GOAL_SHORTEST";
73
+ case OptimizationGoal.OPTIMIZATION_GOAL_FASTEST:
74
+ return "OPTIMIZATION_GOAL_FASTEST";
75
+ case OptimizationGoal.OPTIMIZATION_GOAL_SAFEST:
76
+ return "OPTIMIZATION_GOAL_SAFEST";
77
+ case OptimizationGoal.OPTIMIZATION_GOAL_PREFER_FAIRWAYS:
78
+ return "OPTIMIZATION_GOAL_PREFER_FAIRWAYS";
79
+ case OptimizationGoal.OPTIMIZATION_GOAL_AVOID_TRAFFIC:
80
+ return "OPTIMIZATION_GOAL_AVOID_TRAFFIC";
81
+ case OptimizationGoal.OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE:
82
+ return "OPTIMIZATION_GOAL_ARCHIPELAGO_CONSERVATIVE";
83
+ case OptimizationGoal.UNRECOGNIZED:
84
+ default:
85
+ return "UNRECOGNIZED";
86
+ }
87
+ }
88
+ exports.optimizationGoalToJSON = optimizationGoalToJSON;
89
+ function createBasePlanRouteRequest() {
90
+ return { waypoints: [], constraints: undefined, goal: 0, maxAlternatives: 0, extensions: undefined };
91
+ }
92
+ exports.PlanRouteRequest = {
93
+ encode(message, writer = new wire_1.BinaryWriter()) {
94
+ for (const v of message.waypoints) {
95
+ Coordinate_1.Coordinate.encode(v, writer.uint32(10).fork()).join();
96
+ }
97
+ if (message.constraints !== undefined) {
98
+ Route_1.RouteInfo.encode(message.constraints, writer.uint32(18).fork()).join();
99
+ }
100
+ if (message.goal !== 0) {
101
+ writer.uint32(24).int32(message.goal);
102
+ }
103
+ if (message.maxAlternatives !== 0) {
104
+ writer.uint32(32).uint32(message.maxAlternatives);
105
+ }
106
+ if (message.extensions !== undefined) {
107
+ Route_1.Extensions.encode(message.extensions, writer.uint32(794).fork()).join();
108
+ }
109
+ return writer;
110
+ },
111
+ decode(input, length) {
112
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
113
+ let end = length === undefined ? reader.len : reader.pos + length;
114
+ const message = createBasePlanRouteRequest();
115
+ while (reader.pos < end) {
116
+ const tag = reader.uint32();
117
+ switch (tag >>> 3) {
118
+ case 1: {
119
+ if (tag !== 10) {
120
+ break;
121
+ }
122
+ message.waypoints.push(Coordinate_1.Coordinate.decode(reader, reader.uint32()));
123
+ continue;
124
+ }
125
+ case 2: {
126
+ if (tag !== 18) {
127
+ break;
128
+ }
129
+ message.constraints = Route_1.RouteInfo.decode(reader, reader.uint32());
130
+ continue;
131
+ }
132
+ case 3: {
133
+ if (tag !== 24) {
134
+ break;
135
+ }
136
+ message.goal = reader.int32();
137
+ continue;
138
+ }
139
+ case 4: {
140
+ if (tag !== 32) {
141
+ break;
142
+ }
143
+ message.maxAlternatives = reader.uint32();
144
+ continue;
145
+ }
146
+ case 99: {
147
+ if (tag !== 794) {
148
+ break;
149
+ }
150
+ message.extensions = Route_1.Extensions.decode(reader, reader.uint32());
151
+ continue;
152
+ }
153
+ }
154
+ if ((tag & 7) === 4 || tag === 0) {
155
+ break;
156
+ }
157
+ reader.skip(tag & 7);
158
+ }
159
+ return message;
160
+ },
161
+ fromJSON(object) {
162
+ return {
163
+ waypoints: globalThis.Array.isArray(object?.waypoints)
164
+ ? object.waypoints.map((e) => Coordinate_1.Coordinate.fromJSON(e))
165
+ : [],
166
+ constraints: isSet(object.constraints) ? Route_1.RouteInfo.fromJSON(object.constraints) : undefined,
167
+ goal: isSet(object.goal) ? optimizationGoalFromJSON(object.goal) : 0,
168
+ maxAlternatives: isSet(object.maxAlternatives) ? globalThis.Number(object.maxAlternatives) : 0,
169
+ extensions: isSet(object.extensions) ? Route_1.Extensions.fromJSON(object.extensions) : undefined,
170
+ };
171
+ },
172
+ toJSON(message) {
173
+ const obj = {};
174
+ if (message.waypoints?.length) {
175
+ obj.waypoints = message.waypoints.map((e) => Coordinate_1.Coordinate.toJSON(e));
176
+ }
177
+ if (message.constraints !== undefined) {
178
+ obj.constraints = Route_1.RouteInfo.toJSON(message.constraints);
179
+ }
180
+ if (message.goal !== 0) {
181
+ obj.goal = optimizationGoalToJSON(message.goal);
182
+ }
183
+ if (message.maxAlternatives !== 0) {
184
+ obj.maxAlternatives = Math.round(message.maxAlternatives);
185
+ }
186
+ if (message.extensions !== undefined) {
187
+ obj.extensions = Route_1.Extensions.toJSON(message.extensions);
188
+ }
189
+ return obj;
190
+ },
191
+ create(base) {
192
+ return exports.PlanRouteRequest.fromPartial(base ?? {});
193
+ },
194
+ fromPartial(object) {
195
+ const message = createBasePlanRouteRequest();
196
+ message.waypoints = object.waypoints?.map((e) => Coordinate_1.Coordinate.fromPartial(e)) || [];
197
+ message.constraints = (object.constraints !== undefined && object.constraints !== null)
198
+ ? Route_1.RouteInfo.fromPartial(object.constraints)
199
+ : undefined;
200
+ message.goal = object.goal ?? 0;
201
+ message.maxAlternatives = object.maxAlternatives ?? 0;
202
+ message.extensions = (object.extensions !== undefined && object.extensions !== null)
203
+ ? Route_1.Extensions.fromPartial(object.extensions)
204
+ : undefined;
205
+ return message;
206
+ },
207
+ };
208
+ exports.RoutePlannerDefinition = {
209
+ name: "RoutePlanner",
210
+ fullName: "keelson.interfaces.route_planner.RoutePlanner",
211
+ methods: {
212
+ /**
213
+ * Plan one or more routes between the requested points. Replies one
214
+ * `keelson.Route` per alternative — see note 1 in the file header about
215
+ * `consolidation=NONE`.
216
+ */
217
+ plan_route: {
218
+ name: "plan_route",
219
+ requestType: exports.PlanRouteRequest,
220
+ requestStream: false,
221
+ responseType: Route_1.Route,
222
+ responseStream: false,
223
+ options: {},
224
+ },
225
+ /**
226
+ * Re-run navigability and validation against a (possibly hand-edited)
227
+ * route, replying it annotated with `challenges`, `issues` and `status`.
228
+ * Takes a whole `keelson.Route` because that is genuinely the input.
229
+ */
230
+ validate_route: {
231
+ name: "validate_route",
232
+ requestType: Route_1.Route,
233
+ requestStream: false,
234
+ responseType: Route_1.Route,
235
+ responseStream: false,
236
+ options: {},
237
+ },
238
+ /**
239
+ * Fetch a stored route. `RouteRef` addresses a specific edition, so this
240
+ * resolves the same reference that appears inside other payloads — see
241
+ * §6.2. Replies `ErrorResponse(NOT_FOUND)` for an unknown id or a
242
+ * dangling edition.
243
+ */
244
+ get_route: {
245
+ name: "get_route",
246
+ requestType: Route_1.RouteRef,
247
+ requestStream: false,
248
+ responseType: Route_1.Route,
249
+ responseStream: false,
250
+ options: {},
251
+ },
252
+ /**
253
+ * Select a route for execution: advances its status and bumps the edition.
254
+ * Mutating — see note 3 in the file header.
255
+ */
256
+ select_route: {
257
+ name: "select_route",
258
+ requestType: Route_1.RouteRef,
259
+ requestStream: false,
260
+ responseType: Route_1.Route,
261
+ responseStream: false,
262
+ options: {},
263
+ },
264
+ },
265
+ };
266
+ function isSet(value) {
267
+ return value !== null && value !== undefined;
268
+ }
@@ -0,0 +1,154 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "keelson.interfaces.scenario_checkpoint";
3
+ export interface SaveRequest {
4
+ /**
5
+ * Identifier for the checkpoint, as the responder understands it. An id
6
+ * within the responder's store, never a path: `save` writes to the
7
+ * responder's filesystem on behalf of anyone who can reach the bus, so an
8
+ * implementation is expected to validate this against an allowlist and
9
+ * refuse anything else with INVALID_ARGUMENT.
10
+ */
11
+ checkpointId: string;
12
+ /**
13
+ * Free text for whoever finds this checkpoint later: what it is a
14
+ * checkpoint OF. Carried back by list_checkpoints.
15
+ */
16
+ note: string;
17
+ /**
18
+ * Replace an existing checkpoint with this id. Without it, a taken id is
19
+ * refused — a checkpoint someone is relying on should not disappear
20
+ * because a second operator picked the same name.
21
+ */
22
+ overwrite: boolean;
23
+ }
24
+ export interface SaveResponse {
25
+ /**
26
+ * Echoed so a caller that let the responder normalise the id knows what to
27
+ * pass to restore.
28
+ */
29
+ checkpointId: string;
30
+ /**
31
+ * Where the clock was when the snapshot was taken. Returned rather than
32
+ * left to the status broadcast for the same reason StepResponse.tick is:
33
+ * the caller needs to know what it just captured without racing a 1 Hz
34
+ * status sample.
35
+ */
36
+ tick: number;
37
+ simulationTime: Date | undefined;
38
+ }
39
+ export interface RestoreRequest {
40
+ checkpointId: string;
41
+ }
42
+ export interface RestoreResponse {
43
+ /** Identity of the run that just began. New, never the saved one. */
44
+ runId: string;
45
+ /**
46
+ * What it branched from: the run the checkpoint was taken from, and the
47
+ * tick it was taken at. Also broadcast on keelson.ScenarioStatus, and
48
+ * returned here so a caller need not wait for the next status sample.
49
+ */
50
+ parentRunId: string;
51
+ parentTick: number;
52
+ simulationTime: Date | undefined;
53
+ }
54
+ export interface CheckpointInfo {
55
+ checkpointId: string;
56
+ /**
57
+ * Which scenario, and which exact content of it, this checkpoint belongs
58
+ * to. A checkpoint quoting a different scenario_hash than the loaded run
59
+ * is not restorable into it, however well the ids match.
60
+ */
61
+ scenarioId: string;
62
+ scenarioHash: string;
63
+ /** The run it was captured from, and where. */
64
+ runId: string;
65
+ tick: number;
66
+ /**
67
+ * Wall-clock time the checkpoint was written — when the operator took it,
68
+ * not a simulated time.
69
+ */
70
+ createdAt: Date | undefined;
71
+ note: string;
72
+ sizeBytes: number;
73
+ }
74
+ export interface ListCheckpointsRequest {
75
+ /**
76
+ * Optional; the responder decides what it means (an id prefix, a glob). No
77
+ * filter lists everything the responder is willing to list.
78
+ */
79
+ pattern: string;
80
+ }
81
+ export interface ListCheckpointsResponse {
82
+ /**
83
+ * Where the responder is listing from, for the same reason
84
+ * ListFilesResponse carries it: an operator choosing between two
85
+ * checkpoints called "before-crossing" needs to know they came from the
86
+ * same place.
87
+ */
88
+ baseDirectory: string;
89
+ /** Newest first. */
90
+ checkpoints: CheckpointInfo[];
91
+ /**
92
+ * True when the responder capped the listing. On the wire because a
93
+ * listing that quietly stopped short reads as "that is all of them", and
94
+ * an operator would go looking for a checkpoint that is in fact there.
95
+ */
96
+ truncated: boolean;
97
+ }
98
+ export declare const SaveRequest: MessageFns<SaveRequest>;
99
+ export declare const SaveResponse: MessageFns<SaveResponse>;
100
+ export declare const RestoreRequest: MessageFns<RestoreRequest>;
101
+ export declare const RestoreResponse: MessageFns<RestoreResponse>;
102
+ export declare const CheckpointInfo: MessageFns<CheckpointInfo>;
103
+ export declare const ListCheckpointsRequest: MessageFns<ListCheckpointsRequest>;
104
+ export declare const ListCheckpointsResponse: MessageFns<ListCheckpointsResponse>;
105
+ export type ScenarioCheckpointDefinition = typeof ScenarioCheckpointDefinition;
106
+ export declare const ScenarioCheckpointDefinition: {
107
+ readonly name: "ScenarioCheckpoint";
108
+ readonly fullName: "keelson.interfaces.scenario_checkpoint.ScenarioCheckpoint";
109
+ readonly methods: {
110
+ readonly save: {
111
+ readonly name: "save";
112
+ readonly requestType: MessageFns<SaveRequest>;
113
+ readonly requestStream: false;
114
+ readonly responseType: MessageFns<SaveResponse>;
115
+ readonly responseStream: false;
116
+ readonly options: {};
117
+ };
118
+ readonly restore: {
119
+ readonly name: "restore";
120
+ readonly requestType: MessageFns<RestoreRequest>;
121
+ readonly requestStream: false;
122
+ readonly responseType: MessageFns<RestoreResponse>;
123
+ readonly responseStream: false;
124
+ readonly options: {};
125
+ };
126
+ readonly list_checkpoints: {
127
+ readonly name: "list_checkpoints";
128
+ readonly requestType: MessageFns<ListCheckpointsRequest>;
129
+ readonly requestStream: false;
130
+ readonly responseType: MessageFns<ListCheckpointsResponse>;
131
+ readonly responseStream: false;
132
+ readonly options: {};
133
+ };
134
+ };
135
+ };
136
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
137
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
138
+ [K in keyof T]?: DeepPartial<T[K]>;
139
+ } : Partial<T>;
140
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
141
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
142
+ [K in keyof P]: Exact<P[K], I[K]>;
143
+ } & {
144
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
145
+ };
146
+ export interface MessageFns<T> {
147
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
148
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
149
+ fromJSON(object: any): T;
150
+ toJSON(message: T): unknown;
151
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
152
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
153
+ }
154
+ export {};