@rise-maritime/keelson-js 0.6.0-alpha.232.dev.1 → 0.6.0-alpha.255.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 (37) hide show
  1. package/dist/index.d.ts +8 -8
  2. package/dist/interfaces/Route.d.ts +24 -0
  3. package/dist/interfaces/Route.js +57 -2
  4. package/dist/interfaces/ScenarioControl.d.ts +3 -96
  5. package/dist/interfaces/ScenarioControl.js +37 -394
  6. package/dist/interfaces/VehicleSimulatorControl.d.ts +83 -0
  7. package/dist/interfaces/VehicleSimulatorControl.js +293 -1
  8. package/dist/interfaces/serviceRegistry.d.ts +8 -8
  9. package/dist/payloads/ChecklistEvent.d.ts +178 -0
  10. package/dist/payloads/ChecklistEvent.js +539 -0
  11. package/dist/payloads/ChecklistEvidence.d.ts +79 -0
  12. package/dist/payloads/ChecklistEvidence.js +287 -0
  13. package/dist/payloads/ChecklistPresence.d.ts +68 -0
  14. package/dist/payloads/ChecklistPresence.js +286 -0
  15. package/dist/payloads/ChecklistProcedure.d.ts +81 -0
  16. package/dist/payloads/ChecklistProcedure.js +364 -0
  17. package/dist/payloads/ChecklistState.d.ts +283 -0
  18. package/dist/payloads/ChecklistState.js +1100 -0
  19. package/dist/payloads/EnvelopeExceedance.d.ts +216 -0
  20. package/dist/payloads/EnvelopeExceedance.js +461 -0
  21. package/dist/payloads/Route.d.ts +24 -0
  22. package/dist/payloads/Route.js +57 -2
  23. package/dist/payloads/RouteExecution.d.ts +81 -1
  24. package/dist/payloads/RouteExecution.js +215 -1
  25. package/dist/payloads/ScenarioEvent.d.ts +90 -0
  26. package/dist/payloads/ScenarioEvent.js +294 -0
  27. package/dist/payloads/ScenarioTickAck.d.ts +95 -0
  28. package/dist/payloads/ScenarioTickAck.js +239 -0
  29. package/dist/payloads/index.foxglove.d.ts +1 -1
  30. package/dist/payloads/index.foxglove.js +1 -1
  31. package/dist/payloads/index.google.protobuf.d.ts +1 -1
  32. package/dist/payloads/index.google.protobuf.js +1 -1
  33. package/dist/payloads/index.keelson.d.ts +9 -1
  34. package/dist/payloads/index.keelson.js +9 -1
  35. package/dist/qos.json +13 -1
  36. package/dist/subjects.json +9 -1
  37. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ /**
3
+ * The definition of a checklist procedure: its items and their text.
4
+ *
5
+ * ChecklistEvent and ChecklistState carry only item *ids* and status, so without this message a
6
+ * consumer that has not been seeded out of band cannot render a checklist at all — it knows an item
7
+ * was completed but not what the item said. Published to a key backed by the router's
8
+ * storage_manager so a joining client can `get` the library rather than being shipped a copy.
9
+ *
10
+ * This is the shared definition only. Per-operator state (favourites, last used, local reminders)
11
+ * stays with the client.
12
+ */
13
+ export interface ChecklistProcedure {
14
+ $type: "keelson.ChecklistProcedure";
15
+ procedureId: string;
16
+ title: string;
17
+ description: string;
18
+ /** Free-form grouping used for filtering, e.g. navigation, handover, emergency, maintenance. */
19
+ category: string;
20
+ /**
21
+ * Version of this definition, e.g. "2.4.1". Advisory: the wire has no upgrade protocol, and a
22
+ * client applies whatever the storage last held.
23
+ */
24
+ version: string;
25
+ estimatedMinutes: number;
26
+ items: ChecklistProcedure_Item[];
27
+ updatedAt: Date | undefined;
28
+ updatedBy: string;
29
+ }
30
+ export interface ChecklistProcedure_Item {
31
+ $type: "keelson.ChecklistProcedure.Item";
32
+ itemId: string;
33
+ /**
34
+ * Position in the list as presented, 1-based. Explicit rather than implied by field order so a
35
+ * renumbering is a visible change to the definition.
36
+ */
37
+ number: number;
38
+ title: string;
39
+ description: string;
40
+ /** A procedure is not complete while a required item is outstanding. */
41
+ isRequired: boolean;
42
+ /**
43
+ * The task this item is a sub-task of; empty for a top-level task.
44
+ *
45
+ * A parent POINTER rather than a nested `repeated Item children`, deliberately: ChecklistState
46
+ * and ChecklistEvent both key progress by a flat item_id, and a pointer leaves both untouched.
47
+ * A consumer that does not understand nesting still renders every task and still records every
48
+ * completion — it loses the grouping, not the data.
49
+ *
50
+ * ONE LEVEL. An item that names a parent must not itself be named as a parent by another item.
51
+ * Deeper trees are not forbidden by the wire, but no producer should emit them until this
52
+ * comment says otherwise.
53
+ *
54
+ * A parent's own status is DERIVED from its children and is not carried anywhere: a parent has
55
+ * no ItemState of its own to complete, so the record cannot say a parent is done while one of
56
+ * its children is outstanding.
57
+ */
58
+ parentItemId: string;
59
+ }
60
+ export declare const ChecklistProcedure: MessageFns<ChecklistProcedure, "keelson.ChecklistProcedure">;
61
+ export declare const ChecklistProcedure_Item: MessageFns<ChecklistProcedure_Item, "keelson.ChecklistProcedure.Item">;
62
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
63
+ 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 {} ? {
64
+ [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
65
+ } : Partial<T>;
66
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
67
+ type Exact<P, I extends P> = P extends Builtin ? P : P & {
68
+ [K in keyof P]: Exact<P[K], I[K]>;
69
+ } & {
70
+ [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
71
+ };
72
+ interface MessageFns<T, V extends string> {
73
+ readonly $type: V;
74
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
75
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
76
+ fromJSON(object: any): T;
77
+ toJSON(message: T): unknown;
78
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
79
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
80
+ }
81
+ export {};
@@ -0,0 +1,364 @@
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: ChecklistProcedure.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ChecklistProcedure_Item = exports.ChecklistProcedure = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ const timestamp_1 = require("./google/protobuf/timestamp");
12
+ const typeRegistry_1 = require("./typeRegistry");
13
+ function createBaseChecklistProcedure() {
14
+ return {
15
+ $type: "keelson.ChecklistProcedure",
16
+ procedureId: "",
17
+ title: "",
18
+ description: "",
19
+ category: "",
20
+ version: "",
21
+ estimatedMinutes: 0,
22
+ items: [],
23
+ updatedAt: undefined,
24
+ updatedBy: "",
25
+ };
26
+ }
27
+ exports.ChecklistProcedure = {
28
+ $type: "keelson.ChecklistProcedure",
29
+ encode(message, writer = new wire_1.BinaryWriter()) {
30
+ if (message.procedureId !== "") {
31
+ writer.uint32(10).string(message.procedureId);
32
+ }
33
+ if (message.title !== "") {
34
+ writer.uint32(18).string(message.title);
35
+ }
36
+ if (message.description !== "") {
37
+ writer.uint32(26).string(message.description);
38
+ }
39
+ if (message.category !== "") {
40
+ writer.uint32(34).string(message.category);
41
+ }
42
+ if (message.version !== "") {
43
+ writer.uint32(42).string(message.version);
44
+ }
45
+ if (message.estimatedMinutes !== 0) {
46
+ writer.uint32(48).int32(message.estimatedMinutes);
47
+ }
48
+ for (const v of message.items) {
49
+ exports.ChecklistProcedure_Item.encode(v, writer.uint32(58).fork()).join();
50
+ }
51
+ if (message.updatedAt !== undefined) {
52
+ timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
53
+ }
54
+ if (message.updatedBy !== "") {
55
+ writer.uint32(74).string(message.updatedBy);
56
+ }
57
+ return writer;
58
+ },
59
+ decode(input, length) {
60
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
61
+ let end = length === undefined ? reader.len : reader.pos + length;
62
+ const message = createBaseChecklistProcedure();
63
+ while (reader.pos < end) {
64
+ const tag = reader.uint32();
65
+ switch (tag >>> 3) {
66
+ case 1: {
67
+ if (tag !== 10) {
68
+ break;
69
+ }
70
+ message.procedureId = reader.string();
71
+ continue;
72
+ }
73
+ case 2: {
74
+ if (tag !== 18) {
75
+ break;
76
+ }
77
+ message.title = reader.string();
78
+ continue;
79
+ }
80
+ case 3: {
81
+ if (tag !== 26) {
82
+ break;
83
+ }
84
+ message.description = reader.string();
85
+ continue;
86
+ }
87
+ case 4: {
88
+ if (tag !== 34) {
89
+ break;
90
+ }
91
+ message.category = reader.string();
92
+ continue;
93
+ }
94
+ case 5: {
95
+ if (tag !== 42) {
96
+ break;
97
+ }
98
+ message.version = reader.string();
99
+ continue;
100
+ }
101
+ case 6: {
102
+ if (tag !== 48) {
103
+ break;
104
+ }
105
+ message.estimatedMinutes = reader.int32();
106
+ continue;
107
+ }
108
+ case 7: {
109
+ if (tag !== 58) {
110
+ break;
111
+ }
112
+ message.items.push(exports.ChecklistProcedure_Item.decode(reader, reader.uint32()));
113
+ continue;
114
+ }
115
+ case 8: {
116
+ if (tag !== 66) {
117
+ break;
118
+ }
119
+ message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
120
+ continue;
121
+ }
122
+ case 9: {
123
+ if (tag !== 74) {
124
+ break;
125
+ }
126
+ message.updatedBy = reader.string();
127
+ continue;
128
+ }
129
+ }
130
+ if ((tag & 7) === 4 || tag === 0) {
131
+ break;
132
+ }
133
+ reader.skip(tag & 7);
134
+ }
135
+ return message;
136
+ },
137
+ fromJSON(object) {
138
+ return {
139
+ $type: exports.ChecklistProcedure.$type,
140
+ procedureId: isSet(object.procedureId) ? globalThis.String(object.procedureId) : "",
141
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
142
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
143
+ category: isSet(object.category) ? globalThis.String(object.category) : "",
144
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
145
+ estimatedMinutes: isSet(object.estimatedMinutes) ? globalThis.Number(object.estimatedMinutes) : 0,
146
+ items: globalThis.Array.isArray(object?.items)
147
+ ? object.items.map((e) => exports.ChecklistProcedure_Item.fromJSON(e))
148
+ : [],
149
+ updatedAt: isSet(object.updatedAt) ? fromJsonTimestamp(object.updatedAt) : undefined,
150
+ updatedBy: isSet(object.updatedBy) ? globalThis.String(object.updatedBy) : "",
151
+ };
152
+ },
153
+ toJSON(message) {
154
+ const obj = {};
155
+ if (message.procedureId !== "") {
156
+ obj.procedureId = message.procedureId;
157
+ }
158
+ if (message.title !== "") {
159
+ obj.title = message.title;
160
+ }
161
+ if (message.description !== "") {
162
+ obj.description = message.description;
163
+ }
164
+ if (message.category !== "") {
165
+ obj.category = message.category;
166
+ }
167
+ if (message.version !== "") {
168
+ obj.version = message.version;
169
+ }
170
+ if (message.estimatedMinutes !== 0) {
171
+ obj.estimatedMinutes = Math.round(message.estimatedMinutes);
172
+ }
173
+ if (message.items?.length) {
174
+ obj.items = message.items.map((e) => exports.ChecklistProcedure_Item.toJSON(e));
175
+ }
176
+ if (message.updatedAt !== undefined) {
177
+ obj.updatedAt = message.updatedAt.toISOString();
178
+ }
179
+ if (message.updatedBy !== "") {
180
+ obj.updatedBy = message.updatedBy;
181
+ }
182
+ return obj;
183
+ },
184
+ create(base) {
185
+ return exports.ChecklistProcedure.fromPartial(base ?? {});
186
+ },
187
+ fromPartial(object) {
188
+ const message = createBaseChecklistProcedure();
189
+ message.procedureId = object.procedureId ?? "";
190
+ message.title = object.title ?? "";
191
+ message.description = object.description ?? "";
192
+ message.category = object.category ?? "";
193
+ message.version = object.version ?? "";
194
+ message.estimatedMinutes = object.estimatedMinutes ?? 0;
195
+ message.items = object.items?.map((e) => exports.ChecklistProcedure_Item.fromPartial(e)) || [];
196
+ message.updatedAt = object.updatedAt ?? undefined;
197
+ message.updatedBy = object.updatedBy ?? "";
198
+ return message;
199
+ },
200
+ };
201
+ typeRegistry_1.messageTypeRegistry.set(exports.ChecklistProcedure.$type, exports.ChecklistProcedure);
202
+ function createBaseChecklistProcedure_Item() {
203
+ return {
204
+ $type: "keelson.ChecklistProcedure.Item",
205
+ itemId: "",
206
+ number: 0,
207
+ title: "",
208
+ description: "",
209
+ isRequired: false,
210
+ parentItemId: "",
211
+ };
212
+ }
213
+ exports.ChecklistProcedure_Item = {
214
+ $type: "keelson.ChecklistProcedure.Item",
215
+ encode(message, writer = new wire_1.BinaryWriter()) {
216
+ if (message.itemId !== "") {
217
+ writer.uint32(10).string(message.itemId);
218
+ }
219
+ if (message.number !== 0) {
220
+ writer.uint32(16).int32(message.number);
221
+ }
222
+ if (message.title !== "") {
223
+ writer.uint32(26).string(message.title);
224
+ }
225
+ if (message.description !== "") {
226
+ writer.uint32(34).string(message.description);
227
+ }
228
+ if (message.isRequired !== false) {
229
+ writer.uint32(40).bool(message.isRequired);
230
+ }
231
+ if (message.parentItemId !== "") {
232
+ writer.uint32(50).string(message.parentItemId);
233
+ }
234
+ return writer;
235
+ },
236
+ decode(input, length) {
237
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
238
+ let end = length === undefined ? reader.len : reader.pos + length;
239
+ const message = createBaseChecklistProcedure_Item();
240
+ while (reader.pos < end) {
241
+ const tag = reader.uint32();
242
+ switch (tag >>> 3) {
243
+ case 1: {
244
+ if (tag !== 10) {
245
+ break;
246
+ }
247
+ message.itemId = reader.string();
248
+ continue;
249
+ }
250
+ case 2: {
251
+ if (tag !== 16) {
252
+ break;
253
+ }
254
+ message.number = reader.int32();
255
+ continue;
256
+ }
257
+ case 3: {
258
+ if (tag !== 26) {
259
+ break;
260
+ }
261
+ message.title = reader.string();
262
+ continue;
263
+ }
264
+ case 4: {
265
+ if (tag !== 34) {
266
+ break;
267
+ }
268
+ message.description = reader.string();
269
+ continue;
270
+ }
271
+ case 5: {
272
+ if (tag !== 40) {
273
+ break;
274
+ }
275
+ message.isRequired = reader.bool();
276
+ continue;
277
+ }
278
+ case 6: {
279
+ if (tag !== 50) {
280
+ break;
281
+ }
282
+ message.parentItemId = reader.string();
283
+ continue;
284
+ }
285
+ }
286
+ if ((tag & 7) === 4 || tag === 0) {
287
+ break;
288
+ }
289
+ reader.skip(tag & 7);
290
+ }
291
+ return message;
292
+ },
293
+ fromJSON(object) {
294
+ return {
295
+ $type: exports.ChecklistProcedure_Item.$type,
296
+ itemId: isSet(object.itemId) ? globalThis.String(object.itemId) : "",
297
+ number: isSet(object.number) ? globalThis.Number(object.number) : 0,
298
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
299
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
300
+ isRequired: isSet(object.isRequired) ? globalThis.Boolean(object.isRequired) : false,
301
+ parentItemId: isSet(object.parentItemId) ? globalThis.String(object.parentItemId) : "",
302
+ };
303
+ },
304
+ toJSON(message) {
305
+ const obj = {};
306
+ if (message.itemId !== "") {
307
+ obj.itemId = message.itemId;
308
+ }
309
+ if (message.number !== 0) {
310
+ obj.number = Math.round(message.number);
311
+ }
312
+ if (message.title !== "") {
313
+ obj.title = message.title;
314
+ }
315
+ if (message.description !== "") {
316
+ obj.description = message.description;
317
+ }
318
+ if (message.isRequired !== false) {
319
+ obj.isRequired = message.isRequired;
320
+ }
321
+ if (message.parentItemId !== "") {
322
+ obj.parentItemId = message.parentItemId;
323
+ }
324
+ return obj;
325
+ },
326
+ create(base) {
327
+ return exports.ChecklistProcedure_Item.fromPartial(base ?? {});
328
+ },
329
+ fromPartial(object) {
330
+ const message = createBaseChecklistProcedure_Item();
331
+ message.itemId = object.itemId ?? "";
332
+ message.number = object.number ?? 0;
333
+ message.title = object.title ?? "";
334
+ message.description = object.description ?? "";
335
+ message.isRequired = object.isRequired ?? false;
336
+ message.parentItemId = object.parentItemId ?? "";
337
+ return message;
338
+ },
339
+ };
340
+ typeRegistry_1.messageTypeRegistry.set(exports.ChecklistProcedure_Item.$type, exports.ChecklistProcedure_Item);
341
+ function toTimestamp(date) {
342
+ const seconds = Math.trunc(date.getTime() / 1000);
343
+ const nanos = (date.getTime() % 1000) * 1000000;
344
+ return { $type: "google.protobuf.Timestamp", seconds, nanos };
345
+ }
346
+ function fromTimestamp(t) {
347
+ let millis = (t.seconds || 0) * 1000;
348
+ millis += (t.nanos || 0) / 1000000;
349
+ return new globalThis.Date(millis);
350
+ }
351
+ function fromJsonTimestamp(o) {
352
+ if (o instanceof globalThis.Date) {
353
+ return o;
354
+ }
355
+ else if (typeof o === "string") {
356
+ return new globalThis.Date(o);
357
+ }
358
+ else {
359
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
360
+ }
361
+ }
362
+ function isSet(value) {
363
+ return value !== null && value !== undefined;
364
+ }