@rise-maritime/keelson-js 0.5.3 → 0.6.0-alpha.202.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 (121) 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 +640 -0
  21. package/dist/interfaces/Route.js +4180 -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/ChecklistEvent.d.ts +152 -0
  66. package/dist/payloads/ChecklistEvent.js +524 -0
  67. package/dist/payloads/ChecklistEvidence.d.ts +79 -0
  68. package/dist/payloads/ChecklistEvidence.js +287 -0
  69. package/dist/payloads/ChecklistPresence.d.ts +68 -0
  70. package/dist/payloads/ChecklistPresence.js +286 -0
  71. package/dist/payloads/ChecklistProcedure.d.ts +81 -0
  72. package/dist/payloads/ChecklistProcedure.js +364 -0
  73. package/dist/payloads/ChecklistState.d.ts +178 -0
  74. package/dist/payloads/ChecklistState.js +838 -0
  75. package/dist/payloads/CommandAuthority.d.ts +82 -0
  76. package/dist/payloads/CommandAuthority.js +364 -0
  77. package/dist/payloads/Coordinate.d.ts +39 -0
  78. package/dist/payloads/Coordinate.js +85 -0
  79. package/dist/payloads/EntityHealth.d.ts +9 -0
  80. package/dist/payloads/EntityHealth.js +14 -0
  81. package/dist/payloads/Mission.d.ts +137 -0
  82. package/dist/payloads/Mission.js +826 -0
  83. package/dist/payloads/OperationalAuthority.d.ts +172 -5
  84. package/dist/payloads/OperationalAuthority.js +525 -6
  85. package/dist/payloads/Route.d.ts +662 -0
  86. package/dist/payloads/Route.js +4289 -0
  87. package/dist/payloads/RouteChangeEvent.d.ts +42 -0
  88. package/dist/payloads/RouteChangeEvent.js +223 -0
  89. package/dist/payloads/RouteEditAuthority.d.ts +87 -0
  90. package/dist/payloads/RouteEditAuthority.js +380 -0
  91. package/dist/payloads/RouteExecution.d.ts +64 -0
  92. package/dist/payloads/RouteExecution.js +310 -0
  93. package/dist/payloads/ScenarioStatus.d.ts +160 -0
  94. package/dist/payloads/ScenarioStatus.js +654 -0
  95. package/dist/payloads/Severity.d.ts +13 -6
  96. package/dist/payloads/Severity.js +30 -18
  97. package/dist/payloads/SimulationStatus.d.ts +3 -4
  98. package/dist/payloads/SimulationStatus.js +12 -18
  99. package/dist/payloads/TestObjectStatus.d.ts +154 -0
  100. package/dist/payloads/TestObjectStatus.js +580 -0
  101. package/dist/payloads/VesselType.d.ts +2 -1
  102. package/dist/payloads/VesselType.js +1 -1
  103. package/dist/payloads/Voyage.d.ts +154 -0
  104. package/dist/payloads/Voyage.js +866 -0
  105. package/dist/payloads/WarrantRecord.d.ts +168 -0
  106. package/dist/payloads/WarrantRecord.js +781 -0
  107. package/dist/payloads/foxglove/CompressedPointCloud.d.ts +37 -0
  108. package/dist/payloads/foxglove/CompressedPointCloud.js +185 -0
  109. package/dist/payloads/google/protobuf/any.d.ts +145 -0
  110. package/dist/payloads/google/protobuf/any.js +110 -0
  111. package/dist/payloads/google/protobuf/empty.d.ts +34 -0
  112. package/dist/payloads/google/protobuf/empty.js +50 -0
  113. package/dist/payloads/index.foxglove.d.ts +1 -0
  114. package/dist/payloads/index.foxglove.js +1 -0
  115. package/dist/payloads/index.google.protobuf.d.ts +2 -0
  116. package/dist/payloads/index.google.protobuf.js +2 -0
  117. package/dist/payloads/index.keelson.d.ts +17 -1
  118. package/dist/payloads/index.keelson.js +17 -1
  119. package/dist/qos.json +95 -0
  120. package/dist/subjects.json +38 -1
  121. package/package.json +2 -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
+ }
@@ -0,0 +1,178 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import { ChecklistItemEvidence } from "./ChecklistEvidence";
3
+ import { ChecklistProcedure_Item } from "./ChecklistProcedure";
4
+ /**
5
+ * Snapshot of one RUN of a checklist procedure, used to bootstrap late-joining operators.
6
+ * Published periodically and on state change for synchronization between ROC sites.
7
+ *
8
+ * The unit here is a run, not a procedure. A procedure is a template that may be executed many
9
+ * times; each execution is a run with its own id, its own progress and its own place in history.
10
+ * The key's last token is the `run_id`, which is globally unique — so it stays a single token and
11
+ * the storage's `.../checklist_state/*` expression keeps covering it, and two runs of the same
12
+ * procedure no longer overwrite each other.
13
+ */
14
+ export interface ChecklistState {
15
+ $type: "keelson.ChecklistState";
16
+ timestamp: Date | undefined;
17
+ procedureId: string;
18
+ publishedByOperator: string;
19
+ publishedByRocSite: string;
20
+ /**
21
+ * Number of events this snapshot has incorporated. Used as a version guard: a snapshot
22
+ * carrying fewer events than a receiver has already applied is stale and must be ignored.
23
+ *
24
+ * THE GUARD IS SINGLE-WRITER ONLY. It is a scalar, so it orders two snapshots from the same
25
+ * publisher and nothing else: two sites that each applied a DIFFERENT twelve events both hold
26
+ * 12, and each rejects the other as stale rather than merging. A receiver must therefore treat
27
+ * this as a staleness hint, never as arbitration — the convergence it does not provide comes
28
+ * from the field-level merge rules in protocol-specification.md §7.2, which hold regardless of
29
+ * arrival order. See RISE-Maritime/keelson#204 for the key-layout fix that would let this
30
+ * become load-bearing again by giving every writer a key of its own.
31
+ */
32
+ eventCount: number;
33
+ items: ChecklistState_ItemState[];
34
+ /** Globally unique, and the last token of this snapshot's key. */
35
+ runId: string;
36
+ status: ChecklistState_RunStatus;
37
+ startedAt: Date | undefined;
38
+ completedAt: Date | undefined;
39
+ /**
40
+ * When a planned run is due. Optional — a run may be queued for this watch with no due time,
41
+ * which is the common case; only a run with a deadline carries one.
42
+ */
43
+ scheduledFor: Date | undefined;
44
+ /**
45
+ * The procedure as it was when this run was created. Carried on every snapshot because a
46
+ * receiver may hold a run whose definition has not arrived off the bus yet, and a run with no
47
+ * title renders as a bare id in the tab strip and on the board.
48
+ */
49
+ procedureTitle: string;
50
+ procedureVersion: string;
51
+ /**
52
+ * The item text this run was actually worked against, written ONLY on the terminal publish.
53
+ *
54
+ * Without it a historical run renders against whatever the template says TODAY: edit a
55
+ * procedure after a run completes and the archive silently shows the new wording beside the old
56
+ * completion timestamps — a plausible-looking record of something that did not happen. Live
57
+ * snapshots omit it because the storage keeps only the last value per key, so paying for it on
58
+ * every tick of an hour-long run buys nothing.
59
+ *
60
+ * Once a receiver has seen a snapshot carrying this, it must re-emit it on any subsequent
61
+ * publish of the same run, or a peer republishing the key strips the archive.
62
+ */
63
+ itemsSnapshot: ChecklistProcedure_Item[];
64
+ /**
65
+ * Why a run was abandoned, as typed by the operator who stopped it.
66
+ *
67
+ * Abandoning is the one checklist act that DEMANDS a reason — completing early deliberately does
68
+ * not, because closing out early is a legitimate act while stopping without finishing is not
69
+ * self-explanatory. Without this field that reason lives only in the ChecklistEvent that
70
+ * announced it, and `checklist_event` has no router storage, so a station bootstrapping from a
71
+ * snapshot sees RUN_STATUS_ABANDONED with no reason and no way to ever recover one.
72
+ *
73
+ * Empty for every non-abandoned run, and empty is also legitimate for an abandoned one published
74
+ * by a client that did not collect a reason — a consumer must not read "" as "no reason given"
75
+ * versus "reason lost".
76
+ */
77
+ abandonReason: string;
78
+ }
79
+ export declare enum ChecklistState_RunStatus {
80
+ RUN_STATUS_UNKNOWN = 0,
81
+ /**
82
+ * RUN_STATUS_PLANNED - Queued by an operator but not begun. Carries no item progress by definition, which is why
83
+ * a publisher must not treat "no items" as "nothing to say".
84
+ */
85
+ RUN_STATUS_PLANNED = 1,
86
+ RUN_STATUS_ACTIVE = 2,
87
+ /** RUN_STATUS_COMPLETED - Terminal. Signed off with every required item done. */
88
+ RUN_STATUS_COMPLETED = 3,
89
+ /** RUN_STATUS_ABANDONED - Terminal. Stopped without completing; the reason travels in the ChecklistEvent's `detail`. */
90
+ RUN_STATUS_ABANDONED = 4,
91
+ UNRECOGNIZED = -1
92
+ }
93
+ export declare function checklistState_RunStatusFromJSON(object: any): ChecklistState_RunStatus;
94
+ export declare function checklistState_RunStatusToJSON(object: ChecklistState_RunStatus): string;
95
+ export interface ChecklistState_ItemNote {
96
+ $type: "keelson.ChecklistState.ItemNote";
97
+ noteId: string;
98
+ text: string;
99
+ createdAt: Date | undefined;
100
+ author: string;
101
+ authorRocSite: string;
102
+ }
103
+ export interface ChecklistState_ItemState {
104
+ $type: "keelson.ChecklistState.ItemState";
105
+ itemId: string;
106
+ status: ChecklistState_ItemState_ItemStatus;
107
+ startedAt: Date | undefined;
108
+ startedBy: string;
109
+ startedByRocSite: string;
110
+ completedAt: Date | undefined;
111
+ completedBy: string;
112
+ completedByRocSite: string;
113
+ notes: ChecklistState_ItemNote[];
114
+ flagged: boolean;
115
+ flagReason: string;
116
+ flaggedBy: string;
117
+ flaggedByRocSite: string;
118
+ /**
119
+ * Photos attached to this item — METADATA only; the bytes live on their own keys. See
120
+ * ChecklistEvidence.proto for why they are not inlined here.
121
+ *
122
+ * ADDITIVE, and a receiver must union it by evidence_id rather than replacing. A station that
123
+ * never saw the attaching event republishes this snapshot with an empty list, and a replacing
124
+ * merge would erase the evidence everywhere — the same hazard `items_snapshot` carries.
125
+ */
126
+ evidence: ChecklistItemEvidence[];
127
+ /**
128
+ * When the flag was RAISED — not when this snapshot was published.
129
+ *
130
+ * The four fields above say an item is flagged, why, and by whom, but never when. A receiver
131
+ * bootstrapping from a snapshot therefore cannot date the flag at all, and a history built from
132
+ * it has to render an undated row beside rows that carry real times. Stamping it from the
133
+ * snapshot's own timestamp would be worse than leaving it empty: it would assert a time that is
134
+ * simply wrong, and look authoritative doing it.
135
+ *
136
+ * Unset while `flagged` is false, and unset is also what an older publisher sends — so a
137
+ * consumer must treat absence as "not known", never as "just now".
138
+ */
139
+ flaggedAt: Date | undefined;
140
+ }
141
+ /**
142
+ * The only enum in this family whose zero value is not an UNKNOWN sentinel, and that is
143
+ * deliberate: an item has no unknown state. It has not been started, which is exactly what
144
+ * PENDING means, so unset and pending being indistinguishable is the truth rather than an
145
+ * ambiguity. Adding ITEM_STATUS_UNKNOWN = 0 would renumber every value and silently reinterpret
146
+ * every recording already on disk, to encode a state that cannot occur.
147
+ */
148
+ export declare enum ChecklistState_ItemState_ItemStatus {
149
+ ITEM_STATUS_PENDING = 0,
150
+ ITEM_STATUS_IN_PROGRESS = 1,
151
+ ITEM_STATUS_COMPLETED = 2,
152
+ UNRECOGNIZED = -1
153
+ }
154
+ export declare function checklistState_ItemState_ItemStatusFromJSON(object: any): ChecklistState_ItemState_ItemStatus;
155
+ export declare function checklistState_ItemState_ItemStatusToJSON(object: ChecklistState_ItemState_ItemStatus): string;
156
+ export declare const ChecklistState: MessageFns<ChecklistState, "keelson.ChecklistState">;
157
+ export declare const ChecklistState_ItemNote: MessageFns<ChecklistState_ItemNote, "keelson.ChecklistState.ItemNote">;
158
+ export declare const ChecklistState_ItemState: MessageFns<ChecklistState_ItemState, "keelson.ChecklistState.ItemState">;
159
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
160
+ 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 {} ? {
161
+ [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
162
+ } : Partial<T>;
163
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
164
+ type Exact<P, I extends P> = P extends Builtin ? P : P & {
165
+ [K in keyof P]: Exact<P[K], I[K]>;
166
+ } & {
167
+ [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
168
+ };
169
+ interface MessageFns<T, V extends string> {
170
+ readonly $type: V;
171
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
172
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
173
+ fromJSON(object: any): T;
174
+ toJSON(message: T): unknown;
175
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
176
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
177
+ }
178
+ export {};