@rise-maritime/keelson-js 0.6.0-alpha.225.dev.1 → 0.6.0-alpha.232.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.
- package/dist/index.d.ts +8 -0
- package/dist/interfaces/Route.d.ts +13 -0
- package/dist/interfaces/Route.js +32 -0
- package/dist/interfaces/ScenarioControl.d.ts +96 -3
- package/dist/interfaces/ScenarioControl.js +394 -37
- package/dist/interfaces/serviceRegistry.d.ts +8 -0
- package/dist/payloads/Route.d.ts +13 -0
- package/dist/payloads/Route.js +32 -0
- package/dist/payloads/index.keelson.d.ts +0 -2
- package/dist/payloads/index.keelson.js +0 -2
- package/dist/qos.json +3 -8
- package/dist/subjects.json +4 -2
- package/package.json +1 -1
- package/dist/payloads/ScenarioEvent.d.ts +0 -90
- package/dist/payloads/ScenarioEvent.js +0 -294
- package/dist/payloads/ScenarioTickAck.d.ts +0 -81
- package/dist/payloads/ScenarioTickAck.js +0 -225
|
@@ -40,9 +40,7 @@ __exportStar(require("./Route"), exports);
|
|
|
40
40
|
__exportStar(require("./RouteChangeEvent"), exports);
|
|
41
41
|
__exportStar(require("./RouteEditAuthority"), exports);
|
|
42
42
|
__exportStar(require("./RouteExecution"), exports);
|
|
43
|
-
__exportStar(require("./ScenarioEvent"), exports);
|
|
44
43
|
__exportStar(require("./ScenarioStatus"), exports);
|
|
45
|
-
__exportStar(require("./ScenarioTickAck"), exports);
|
|
46
44
|
__exportStar(require("./SensorStatus"), exports);
|
|
47
45
|
__exportStar(require("./SimulationStatus"), exports);
|
|
48
46
|
__exportStar(require("./TargetType"), exports);
|
package/dist/qos.json
CHANGED
|
@@ -24,12 +24,6 @@
|
|
|
24
24
|
"reliability": "RELIABLE",
|
|
25
25
|
"express": false
|
|
26
26
|
},
|
|
27
|
-
"guaranteed": {
|
|
28
|
-
"priority": "DATA_HIGH",
|
|
29
|
-
"congestion_control": "BLOCK",
|
|
30
|
-
"reliability": "RELIABLE",
|
|
31
|
-
"express": false
|
|
32
|
-
},
|
|
33
27
|
"background": {
|
|
34
28
|
"priority": "DATA_LOW",
|
|
35
29
|
"congestion_control": "DROP",
|
|
@@ -52,8 +46,6 @@
|
|
|
52
46
|
"dpad_y_pct": "realtime",
|
|
53
47
|
"wheel_position_pct": "realtime",
|
|
54
48
|
"lever_position_pct": "realtime",
|
|
55
|
-
"scenario_tick_ack": "guaranteed",
|
|
56
|
-
"scenario_event": "guaranteed",
|
|
57
49
|
"image_raw": "transient",
|
|
58
50
|
"image_compressed": "transient",
|
|
59
51
|
"video_compressed": "transient",
|
|
@@ -80,6 +72,9 @@
|
|
|
80
72
|
"target_bcr_m": "elevated",
|
|
81
73
|
"target_bct_s": "elevated",
|
|
82
74
|
"weather_alert": "elevated",
|
|
75
|
+
"depth_below_transducer_m": "elevated",
|
|
76
|
+
"depth_below_keel_m": "elevated",
|
|
77
|
+
"depth_below_surface_m": "elevated",
|
|
83
78
|
"route_status": "elevated",
|
|
84
79
|
"route_execution": "elevated",
|
|
85
80
|
"route_edit_authority": "elevated",
|
package/dist/subjects.json
CHANGED
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
"sensor_status": "keelson.SensorStatus",
|
|
11
11
|
"network_status": "keelson.NetworkStatus",
|
|
12
12
|
"scenario_status": "keelson.ScenarioStatus",
|
|
13
|
-
"scenario_event": "keelson.ScenarioEvent",
|
|
14
|
-
"scenario_tick_ack": "keelson.ScenarioTickAck",
|
|
15
13
|
"simulation_status": "keelson.SimulationStatus",
|
|
16
14
|
"roc_status": "keelson.ROCStatus",
|
|
17
15
|
"operational_authority": "keelson.OperationalAuthority",
|
|
@@ -108,9 +106,13 @@
|
|
|
108
106
|
"air_relative_humidity_pct": "keelson.TimestampedFloat",
|
|
109
107
|
"air_pressure_pa": "keelson.TimestampedFloat",
|
|
110
108
|
"dew_point_celsius": "keelson.TimestampedFloat",
|
|
109
|
+
"illuminance_lux": "keelson.TimestampedFloat",
|
|
111
110
|
"water_temperature_celsius": "keelson.TimestampedFloat",
|
|
112
111
|
"water_salinity_ppt": "keelson.TimestampedFloat",
|
|
113
112
|
"water_speed_of_sound_mps": "keelson.TimestampedFloat",
|
|
113
|
+
"depth_below_transducer_m": "keelson.TimestampedFloat",
|
|
114
|
+
"depth_below_keel_m": "keelson.TimestampedFloat",
|
|
115
|
+
"depth_below_surface_m": "keelson.TimestampedFloat",
|
|
114
116
|
"true_wind_direction_deg": "keelson.TimestampedFloat",
|
|
115
117
|
"true_wind_angle_deg": "keelson.TimestampedFloat",
|
|
116
118
|
"true_wind_speed_mps": "keelson.TimestampedFloat",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rise-maritime/keelson-js",
|
|
3
3
|
"//version": "NOT the published version. The release workflow overwrites it from the release tag (npm version --no-git-tag-version), so tag and artifact cannot disagree. Only matters for local installs; do not hand-bump before tagging — that manual step is what broke release 0.5.4.",
|
|
4
|
-
"version": "0.6.0-alpha.
|
|
4
|
+
"version": "0.6.0-alpha.232.dev.1",
|
|
5
5
|
"description": "Keelson JavaScript SDK with Node-RED nodes",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
/**
|
|
3
|
-
* Something the exercise script did, at the moment it did it.
|
|
4
|
-
*
|
|
5
|
-
* A recording shows a vessel slowing down; it does not show whether that was
|
|
6
|
-
* the autonomy under test deciding to slow down or the scenario commanding it.
|
|
7
|
-
* Nothing else on the bus can settle that afterwards, which is why this is
|
|
8
|
-
* evidence rather than convenience: without it, an evaluator reading a
|
|
9
|
-
* recording cannot separate the system's behaviour from the exercise's
|
|
10
|
-
* intervention.
|
|
11
|
-
*
|
|
12
|
-
* Distinct from the interfaces that *cause* these things. A simulator's RPC
|
|
13
|
-
* surface (simulation_control/v1, scenario_control/v1) is how an operator acts
|
|
14
|
-
* on a run; this subject is the record that an action occurred, published by
|
|
15
|
-
* the authority that applied it, whether the cause was an operator, a scripted
|
|
16
|
-
* event or a fault schedule.
|
|
17
|
-
*
|
|
18
|
-
* Relationship to ScenarioStatus: that answers "what is the world doing now?"
|
|
19
|
-
* on a continuous cadence. This answers "what was done to it, and when?", once
|
|
20
|
-
* per occurrence.
|
|
21
|
-
*/
|
|
22
|
-
export interface ScenarioEvent {
|
|
23
|
-
$type: "keelson.ScenarioEvent";
|
|
24
|
-
/**
|
|
25
|
-
* Source timestamp: wall-clock time at which the event was applied.
|
|
26
|
-
* simulated time lives in tick below, and in a stepped or fast-time run the
|
|
27
|
-
* two diverge by design.
|
|
28
|
-
*/
|
|
29
|
-
timestamp: Date | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Which run this happened in, and at which tick of it. A recording that
|
|
32
|
-
* spans a restore contains events from more than one run_id (see
|
|
33
|
-
* ScenarioStatus.parent_run_id), and an event attributed to the wrong run is
|
|
34
|
-
* worse than a missing one.
|
|
35
|
-
*/
|
|
36
|
-
runId: string;
|
|
37
|
-
tick: number;
|
|
38
|
-
/**
|
|
39
|
-
* What was done. A free string rather than an enum, deliberately: the
|
|
40
|
-
* vocabulary belongs to the scenario format, not to keelson, and a fixed
|
|
41
|
-
* list here would decide what a simulator is allowed to script. Consumers
|
|
42
|
-
* that care match on values they know and record the rest verbatim.
|
|
43
|
-
*/
|
|
44
|
-
action: string;
|
|
45
|
-
/**
|
|
46
|
-
* What it was done to, empty for a world-level event. Names an entity in the
|
|
47
|
-
* key space, so a consumer can join this against that entity's subjects.
|
|
48
|
-
*/
|
|
49
|
-
entityId: string;
|
|
50
|
-
/**
|
|
51
|
-
* Arguments to the action — a new speed, a fault's target, a mark's label.
|
|
52
|
-
* Untyped because the actions are: constraining these would constrain the
|
|
53
|
-
* action vocabulary above by the back door.
|
|
54
|
-
*/
|
|
55
|
-
parameters: {
|
|
56
|
-
[key: string]: string;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Human-readable note for a timeline. Never parsed: anything a consumer must
|
|
60
|
-
* act on belongs in action or parameters.
|
|
61
|
-
*/
|
|
62
|
-
note: string;
|
|
63
|
-
}
|
|
64
|
-
export interface ScenarioEvent_ParametersEntry {
|
|
65
|
-
$type: "keelson.ScenarioEvent.ParametersEntry";
|
|
66
|
-
key: string;
|
|
67
|
-
value: string;
|
|
68
|
-
}
|
|
69
|
-
export declare const ScenarioEvent: MessageFns<ScenarioEvent, "keelson.ScenarioEvent">;
|
|
70
|
-
export declare const ScenarioEvent_ParametersEntry: MessageFns<ScenarioEvent_ParametersEntry, "keelson.ScenarioEvent.ParametersEntry">;
|
|
71
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
72
|
-
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 {} ? {
|
|
73
|
-
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
74
|
-
} : Partial<T>;
|
|
75
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
76
|
-
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
77
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
78
|
-
} & {
|
|
79
|
-
[K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
|
|
80
|
-
};
|
|
81
|
-
interface MessageFns<T, V extends string> {
|
|
82
|
-
readonly $type: V;
|
|
83
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
84
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
85
|
-
fromJSON(object: any): T;
|
|
86
|
-
toJSON(message: T): unknown;
|
|
87
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
88
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
89
|
-
}
|
|
90
|
-
export {};
|
|
@@ -1,294 +0,0 @@
|
|
|
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: ScenarioEvent.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ScenarioEvent_ParametersEntry = exports.ScenarioEvent = 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 createBaseScenarioEvent() {
|
|
14
|
-
return {
|
|
15
|
-
$type: "keelson.ScenarioEvent",
|
|
16
|
-
timestamp: undefined,
|
|
17
|
-
runId: "",
|
|
18
|
-
tick: 0,
|
|
19
|
-
action: "",
|
|
20
|
-
entityId: "",
|
|
21
|
-
parameters: {},
|
|
22
|
-
note: "",
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
exports.ScenarioEvent = {
|
|
26
|
-
$type: "keelson.ScenarioEvent",
|
|
27
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
28
|
-
if (message.timestamp !== undefined) {
|
|
29
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
|
|
30
|
-
}
|
|
31
|
-
if (message.runId !== "") {
|
|
32
|
-
writer.uint32(18).string(message.runId);
|
|
33
|
-
}
|
|
34
|
-
if (message.tick !== 0) {
|
|
35
|
-
writer.uint32(24).uint64(message.tick);
|
|
36
|
-
}
|
|
37
|
-
if (message.action !== "") {
|
|
38
|
-
writer.uint32(34).string(message.action);
|
|
39
|
-
}
|
|
40
|
-
if (message.entityId !== "") {
|
|
41
|
-
writer.uint32(42).string(message.entityId);
|
|
42
|
-
}
|
|
43
|
-
Object.entries(message.parameters).forEach(([key, value]) => {
|
|
44
|
-
exports.ScenarioEvent_ParametersEntry.encode({ $type: "keelson.ScenarioEvent.ParametersEntry", key: key, value }, writer.uint32(50).fork()).join();
|
|
45
|
-
});
|
|
46
|
-
if (message.note !== "") {
|
|
47
|
-
writer.uint32(58).string(message.note);
|
|
48
|
-
}
|
|
49
|
-
return writer;
|
|
50
|
-
},
|
|
51
|
-
decode(input, length) {
|
|
52
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
53
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
54
|
-
const message = createBaseScenarioEvent();
|
|
55
|
-
while (reader.pos < end) {
|
|
56
|
-
const tag = reader.uint32();
|
|
57
|
-
switch (tag >>> 3) {
|
|
58
|
-
case 1: {
|
|
59
|
-
if (tag !== 10) {
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
case 2: {
|
|
66
|
-
if (tag !== 18) {
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
message.runId = reader.string();
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
case 3: {
|
|
73
|
-
if (tag !== 24) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
message.tick = longToNumber(reader.uint64());
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
case 4: {
|
|
80
|
-
if (tag !== 34) {
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
message.action = reader.string();
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
case 5: {
|
|
87
|
-
if (tag !== 42) {
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
message.entityId = reader.string();
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
case 6: {
|
|
94
|
-
if (tag !== 50) {
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
const entry6 = exports.ScenarioEvent_ParametersEntry.decode(reader, reader.uint32());
|
|
98
|
-
if (entry6.value !== undefined) {
|
|
99
|
-
message.parameters[entry6.key] = entry6.value;
|
|
100
|
-
}
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
case 7: {
|
|
104
|
-
if (tag !== 58) {
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
message.note = reader.string();
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
reader.skip(tag & 7);
|
|
115
|
-
}
|
|
116
|
-
return message;
|
|
117
|
-
},
|
|
118
|
-
fromJSON(object) {
|
|
119
|
-
return {
|
|
120
|
-
$type: exports.ScenarioEvent.$type,
|
|
121
|
-
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
|
122
|
-
runId: isSet(object.runId) ? globalThis.String(object.runId) : "",
|
|
123
|
-
tick: isSet(object.tick) ? globalThis.Number(object.tick) : 0,
|
|
124
|
-
action: isSet(object.action) ? globalThis.String(object.action) : "",
|
|
125
|
-
entityId: isSet(object.entityId) ? globalThis.String(object.entityId) : "",
|
|
126
|
-
parameters: isObject(object.parameters)
|
|
127
|
-
? Object.entries(object.parameters).reduce((acc, [key, value]) => {
|
|
128
|
-
acc[key] = String(value);
|
|
129
|
-
return acc;
|
|
130
|
-
}, {})
|
|
131
|
-
: {},
|
|
132
|
-
note: isSet(object.note) ? globalThis.String(object.note) : "",
|
|
133
|
-
};
|
|
134
|
-
},
|
|
135
|
-
toJSON(message) {
|
|
136
|
-
const obj = {};
|
|
137
|
-
if (message.timestamp !== undefined) {
|
|
138
|
-
obj.timestamp = message.timestamp.toISOString();
|
|
139
|
-
}
|
|
140
|
-
if (message.runId !== "") {
|
|
141
|
-
obj.runId = message.runId;
|
|
142
|
-
}
|
|
143
|
-
if (message.tick !== 0) {
|
|
144
|
-
obj.tick = Math.round(message.tick);
|
|
145
|
-
}
|
|
146
|
-
if (message.action !== "") {
|
|
147
|
-
obj.action = message.action;
|
|
148
|
-
}
|
|
149
|
-
if (message.entityId !== "") {
|
|
150
|
-
obj.entityId = message.entityId;
|
|
151
|
-
}
|
|
152
|
-
if (message.parameters) {
|
|
153
|
-
const entries = Object.entries(message.parameters);
|
|
154
|
-
if (entries.length > 0) {
|
|
155
|
-
obj.parameters = {};
|
|
156
|
-
entries.forEach(([k, v]) => {
|
|
157
|
-
obj.parameters[k] = v;
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (message.note !== "") {
|
|
162
|
-
obj.note = message.note;
|
|
163
|
-
}
|
|
164
|
-
return obj;
|
|
165
|
-
},
|
|
166
|
-
create(base) {
|
|
167
|
-
return exports.ScenarioEvent.fromPartial(base ?? {});
|
|
168
|
-
},
|
|
169
|
-
fromPartial(object) {
|
|
170
|
-
const message = createBaseScenarioEvent();
|
|
171
|
-
message.timestamp = object.timestamp ?? undefined;
|
|
172
|
-
message.runId = object.runId ?? "";
|
|
173
|
-
message.tick = object.tick ?? 0;
|
|
174
|
-
message.action = object.action ?? "";
|
|
175
|
-
message.entityId = object.entityId ?? "";
|
|
176
|
-
message.parameters = Object.entries(object.parameters ?? {}).reduce((acc, [key, value]) => {
|
|
177
|
-
if (value !== undefined) {
|
|
178
|
-
acc[key] = globalThis.String(value);
|
|
179
|
-
}
|
|
180
|
-
return acc;
|
|
181
|
-
}, {});
|
|
182
|
-
message.note = object.note ?? "";
|
|
183
|
-
return message;
|
|
184
|
-
},
|
|
185
|
-
};
|
|
186
|
-
typeRegistry_1.messageTypeRegistry.set(exports.ScenarioEvent.$type, exports.ScenarioEvent);
|
|
187
|
-
function createBaseScenarioEvent_ParametersEntry() {
|
|
188
|
-
return { $type: "keelson.ScenarioEvent.ParametersEntry", key: "", value: "" };
|
|
189
|
-
}
|
|
190
|
-
exports.ScenarioEvent_ParametersEntry = {
|
|
191
|
-
$type: "keelson.ScenarioEvent.ParametersEntry",
|
|
192
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
193
|
-
if (message.key !== "") {
|
|
194
|
-
writer.uint32(10).string(message.key);
|
|
195
|
-
}
|
|
196
|
-
if (message.value !== "") {
|
|
197
|
-
writer.uint32(18).string(message.value);
|
|
198
|
-
}
|
|
199
|
-
return writer;
|
|
200
|
-
},
|
|
201
|
-
decode(input, length) {
|
|
202
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
203
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
204
|
-
const message = createBaseScenarioEvent_ParametersEntry();
|
|
205
|
-
while (reader.pos < end) {
|
|
206
|
-
const tag = reader.uint32();
|
|
207
|
-
switch (tag >>> 3) {
|
|
208
|
-
case 1: {
|
|
209
|
-
if (tag !== 10) {
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
message.key = reader.string();
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
case 2: {
|
|
216
|
-
if (tag !== 18) {
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
message.value = reader.string();
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
reader.skip(tag & 7);
|
|
227
|
-
}
|
|
228
|
-
return message;
|
|
229
|
-
},
|
|
230
|
-
fromJSON(object) {
|
|
231
|
-
return {
|
|
232
|
-
$type: exports.ScenarioEvent_ParametersEntry.$type,
|
|
233
|
-
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
234
|
-
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
235
|
-
};
|
|
236
|
-
},
|
|
237
|
-
toJSON(message) {
|
|
238
|
-
const obj = {};
|
|
239
|
-
if (message.key !== "") {
|
|
240
|
-
obj.key = message.key;
|
|
241
|
-
}
|
|
242
|
-
if (message.value !== "") {
|
|
243
|
-
obj.value = message.value;
|
|
244
|
-
}
|
|
245
|
-
return obj;
|
|
246
|
-
},
|
|
247
|
-
create(base) {
|
|
248
|
-
return exports.ScenarioEvent_ParametersEntry.fromPartial(base ?? {});
|
|
249
|
-
},
|
|
250
|
-
fromPartial(object) {
|
|
251
|
-
const message = createBaseScenarioEvent_ParametersEntry();
|
|
252
|
-
message.key = object.key ?? "";
|
|
253
|
-
message.value = object.value ?? "";
|
|
254
|
-
return message;
|
|
255
|
-
},
|
|
256
|
-
};
|
|
257
|
-
typeRegistry_1.messageTypeRegistry.set(exports.ScenarioEvent_ParametersEntry.$type, exports.ScenarioEvent_ParametersEntry);
|
|
258
|
-
function toTimestamp(date) {
|
|
259
|
-
const seconds = Math.trunc(date.getTime() / 1000);
|
|
260
|
-
const nanos = (date.getTime() % 1000) * 1000000;
|
|
261
|
-
return { $type: "google.protobuf.Timestamp", seconds, nanos };
|
|
262
|
-
}
|
|
263
|
-
function fromTimestamp(t) {
|
|
264
|
-
let millis = (t.seconds || 0) * 1000;
|
|
265
|
-
millis += (t.nanos || 0) / 1000000;
|
|
266
|
-
return new globalThis.Date(millis);
|
|
267
|
-
}
|
|
268
|
-
function fromJsonTimestamp(o) {
|
|
269
|
-
if (o instanceof globalThis.Date) {
|
|
270
|
-
return o;
|
|
271
|
-
}
|
|
272
|
-
else if (typeof o === "string") {
|
|
273
|
-
return new globalThis.Date(o);
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function longToNumber(int64) {
|
|
280
|
-
const num = globalThis.Number(int64.toString());
|
|
281
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
282
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
283
|
-
}
|
|
284
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
285
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
286
|
-
}
|
|
287
|
-
return num;
|
|
288
|
-
}
|
|
289
|
-
function isObject(value) {
|
|
290
|
-
return typeof value === "object" && value !== null;
|
|
291
|
-
}
|
|
292
|
-
function isSet(value) {
|
|
293
|
-
return value !== null && value !== undefined;
|
|
294
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
/**
|
|
3
|
-
* A participant telling the clock authority it has finished a tick.
|
|
4
|
-
*
|
|
5
|
-
* The other half of the barrier ScenarioStatus already describes. A
|
|
6
|
-
* ScenarioParticipant declares a Role and reports an acknowledged_tick, but
|
|
7
|
-
* that message is published *by the authority*, about the participant — there
|
|
8
|
-
* has been no way for the participant itself to say the thing the authority is
|
|
9
|
-
* reporting. Implementations have used a raw JSON subject for it.
|
|
10
|
-
*
|
|
11
|
-
* Publish one per tick, on the participant's own key. The entity and source
|
|
12
|
-
* are already in the key expression, so they are not repeated here: two places
|
|
13
|
-
* to say who acknowledged is two places for them to disagree.
|
|
14
|
-
*/
|
|
15
|
-
export interface ScenarioTickAck {
|
|
16
|
-
$type: "keelson.ScenarioTickAck";
|
|
17
|
-
/** Source timestamp: when the acknowledgement was produced. */
|
|
18
|
-
timestamp: Date | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* The run and tick being acknowledged. run_id is not redundant: after a
|
|
21
|
-
* restore, a participant that is still running carries the old run's ticks
|
|
22
|
-
* in flight, and an ack matched on tick alone would satisfy the new run's
|
|
23
|
-
* barrier with the previous run's work.
|
|
24
|
-
*/
|
|
25
|
-
runId: string;
|
|
26
|
-
tick: number;
|
|
27
|
-
disposition: ScenarioTickAck_Disposition;
|
|
28
|
-
/**
|
|
29
|
-
* Why, when disposition is SKIPPED or FAILED. Free text for an operator or
|
|
30
|
-
* a post-run report; empty otherwise.
|
|
31
|
-
*/
|
|
32
|
-
detail: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* What the participant did with this tick. A BLOCKING participant is
|
|
36
|
-
* expected to COMPLETE every one; a DECIMATING participant is explicitly
|
|
37
|
-
* permitted to skip work to keep up, and this is where it says so — a skip
|
|
38
|
-
* that looks identical to a completion on the wire makes the distinction
|
|
39
|
-
* ScenarioParticipant.Role draws unobservable.
|
|
40
|
-
*/
|
|
41
|
-
export declare enum ScenarioTickAck_Disposition {
|
|
42
|
-
DISPOSITION_UNKNOWN = 0,
|
|
43
|
-
/** COMPLETED - The work for this tick is done. */
|
|
44
|
-
COMPLETED = 1,
|
|
45
|
-
/**
|
|
46
|
-
* SKIPPED - Deliberately did less than a full tick's work, and stayed causal.
|
|
47
|
-
* Not an error: the participant is keeping up as designed.
|
|
48
|
-
*/
|
|
49
|
-
SKIPPED = 2,
|
|
50
|
-
/**
|
|
51
|
-
* FAILED - Could not do the work. The authority decides what that means for the
|
|
52
|
-
* run — a failed tick from a BLOCKING participant is a failed run, from a
|
|
53
|
-
* DECIMATING one it is a degraded one — but it must be able to tell this
|
|
54
|
-
* apart from silence, which is indistinguishable from a dead process.
|
|
55
|
-
*/
|
|
56
|
-
FAILED = 3,
|
|
57
|
-
UNRECOGNIZED = -1
|
|
58
|
-
}
|
|
59
|
-
export declare function scenarioTickAck_DispositionFromJSON(object: any): ScenarioTickAck_Disposition;
|
|
60
|
-
export declare function scenarioTickAck_DispositionToJSON(object: ScenarioTickAck_Disposition): string;
|
|
61
|
-
export declare const ScenarioTickAck: MessageFns<ScenarioTickAck, "keelson.ScenarioTickAck">;
|
|
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 {};
|