@world-engines/protocol-ts 0.1.0-alpha.0
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/LICENSE +46 -0
- package/dist/entity-prop-envelope.d.ts +36 -0
- package/dist/entity-prop-envelope.js +50 -0
- package/dist/gen/v1/auth.d.ts +46 -0
- package/dist/gen/v1/auth.js +278 -0
- package/dist/gen/v1/billing.d.ts +71 -0
- package/dist/gen/v1/billing.js +521 -0
- package/dist/gen/v1/common.d.ts +65 -0
- package/dist/gen/v1/common.js +387 -0
- package/dist/gen/v1/llm.d.ts +317 -0
- package/dist/gen/v1/llm.js +3557 -0
- package/dist/gen/v1/mcp.d.ts +373 -0
- package/dist/gen/v1/mcp.js +3190 -0
- package/dist/gen/v1/moderation.d.ts +51 -0
- package/dist/gen/v1/moderation.js +368 -0
- package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
- package/dist/gen/v1/neutral_scenario_source.js +569 -0
- package/dist/gen/v1/relation_kind.d.ts +105 -0
- package/dist/gen/v1/relation_kind.js +562 -0
- package/dist/gen/v1/rest/admin.d.ts +432 -0
- package/dist/gen/v1/rest/admin.js +4957 -0
- package/dist/gen/v1/rest/asset.d.ts +205 -0
- package/dist/gen/v1/rest/asset.js +2200 -0
- package/dist/gen/v1/rest/auth.d.ts +275 -0
- package/dist/gen/v1/rest/auth.js +2896 -0
- package/dist/gen/v1/rest/billing.d.ts +101 -0
- package/dist/gen/v1/rest/billing.js +866 -0
- package/dist/gen/v1/rest/common.d.ts +179 -0
- package/dist/gen/v1/rest/common.js +1358 -0
- package/dist/gen/v1/rest/creator.d.ts +354 -0
- package/dist/gen/v1/rest/creator.js +4169 -0
- package/dist/gen/v1/rest/messaging.d.ts +190 -0
- package/dist/gen/v1/rest/messaging.js +2017 -0
- package/dist/gen/v1/rest/moderation.d.ts +61 -0
- package/dist/gen/v1/rest/moderation.js +569 -0
- package/dist/gen/v1/rest/pet.d.ts +98 -0
- package/dist/gen/v1/rest/pet.js +698 -0
- package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
- package/dist/gen/v1/rest/project_transfer.js +5266 -0
- package/dist/gen/v1/rest/scenario.d.ts +756 -0
- package/dist/gen/v1/rest/scenario.js +8768 -0
- package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
- package/dist/gen/v1/rest/stock_bounty.js +1547 -0
- package/dist/gen/v1/rest/stocks.d.ts +465 -0
- package/dist/gen/v1/rest/stocks.js +5200 -0
- package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
- package/dist/gen/v1/rest/support_ticket.js +511 -0
- package/dist/gen/v1/rest/users.d.ts +292 -0
- package/dist/gen/v1/rest/users.js +2879 -0
- package/dist/gen/v1/rest/violations.d.ts +52 -0
- package/dist/gen/v1/rest/violations.js +338 -0
- package/dist/gen/v1/sav.d.ts +987 -0
- package/dist/gen/v1/sav.js +12327 -0
- package/dist/gen/v1/save.d.ts +68 -0
- package/dist/gen/v1/save.js +595 -0
- package/dist/gen/v1/scenario_part_source.d.ts +94 -0
- package/dist/gen/v1/scenario_part_source.js +913 -0
- package/dist/gen/v1/session.d.ts +49 -0
- package/dist/gen/v1/session.js +311 -0
- package/dist/gen/v1/view_state.d.ts +267 -0
- package/dist/gen/v1/view_state.js +3239 -0
- package/dist/gen/v1/world.d.ts +82 -0
- package/dist/gen/v1/world.js +707 -0
- package/dist/gen/v1/world_memory.d.ts +545 -0
- package/dist/gen/v1/world_memory.js +5816 -0
- package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
- package/dist/gen/v1/world_memory_privacy.js +994 -0
- package/dist/gen/v1/ws_frame.d.ts +1626 -0
- package/dist/gen/v1/ws_frame.js +18253 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/ladybug-extraction.d.ts +36 -0
- package/dist/ladybug-extraction.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export interface ScenarioSubmitForReview {
|
|
3
|
+
scenario_id: string;
|
|
4
|
+
author_user_id: string;
|
|
5
|
+
scenario_bin: Uint8Array;
|
|
6
|
+
manifest_json: Uint8Array;
|
|
7
|
+
_unknownFields?: {
|
|
8
|
+
[key: number]: Uint8Array[];
|
|
9
|
+
} | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface ScenarioReviewResult {
|
|
12
|
+
scenario_id: string;
|
|
13
|
+
verdict: ScenarioReviewResult_Verdict;
|
|
14
|
+
violations: string[];
|
|
15
|
+
reviewer_notes: string;
|
|
16
|
+
official_risk_tags: string[];
|
|
17
|
+
_unknownFields?: {
|
|
18
|
+
[key: number]: Uint8Array[];
|
|
19
|
+
} | undefined;
|
|
20
|
+
}
|
|
21
|
+
export declare enum ScenarioReviewResult_Verdict {
|
|
22
|
+
VERDICT_UNSPECIFIED = 0,
|
|
23
|
+
VERDICT_APPROVED = 1,
|
|
24
|
+
VERDICT_REJECTED = 2,
|
|
25
|
+
VERDICT_NEEDS_INFO = 3,
|
|
26
|
+
VERDICT_WARNING = 4,
|
|
27
|
+
UNRECOGNIZED = -1
|
|
28
|
+
}
|
|
29
|
+
export declare function scenarioReviewResult_VerdictFromJSON(object: any): ScenarioReviewResult_Verdict;
|
|
30
|
+
export declare function scenarioReviewResult_VerdictToJSON(object: ScenarioReviewResult_Verdict): string;
|
|
31
|
+
export declare const ScenarioSubmitForReview: MessageFns<ScenarioSubmitForReview>;
|
|
32
|
+
export declare const ScenarioReviewResult: MessageFns<ScenarioReviewResult>;
|
|
33
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
34
|
+
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 {} ? {
|
|
35
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
36
|
+
} : Partial<T>;
|
|
37
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
38
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
39
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
40
|
+
} & {
|
|
41
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
42
|
+
};
|
|
43
|
+
interface MessageFns<T> {
|
|
44
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
45
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
46
|
+
fromJSON(object: any): T;
|
|
47
|
+
toJSON(message: T): unknown;
|
|
48
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
49
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.0
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: v1/moderation.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export var ScenarioReviewResult_Verdict;
|
|
9
|
+
(function (ScenarioReviewResult_Verdict) {
|
|
10
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["VERDICT_UNSPECIFIED"] = 0] = "VERDICT_UNSPECIFIED";
|
|
11
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["VERDICT_APPROVED"] = 1] = "VERDICT_APPROVED";
|
|
12
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["VERDICT_REJECTED"] = 2] = "VERDICT_REJECTED";
|
|
13
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["VERDICT_NEEDS_INFO"] = 3] = "VERDICT_NEEDS_INFO";
|
|
14
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["VERDICT_WARNING"] = 4] = "VERDICT_WARNING";
|
|
15
|
+
ScenarioReviewResult_Verdict[ScenarioReviewResult_Verdict["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
16
|
+
})(ScenarioReviewResult_Verdict || (ScenarioReviewResult_Verdict = {}));
|
|
17
|
+
export function scenarioReviewResult_VerdictFromJSON(object) {
|
|
18
|
+
switch (object) {
|
|
19
|
+
case 0:
|
|
20
|
+
case "VERDICT_UNSPECIFIED":
|
|
21
|
+
return ScenarioReviewResult_Verdict.VERDICT_UNSPECIFIED;
|
|
22
|
+
case 1:
|
|
23
|
+
case "VERDICT_APPROVED":
|
|
24
|
+
return ScenarioReviewResult_Verdict.VERDICT_APPROVED;
|
|
25
|
+
case 2:
|
|
26
|
+
case "VERDICT_REJECTED":
|
|
27
|
+
return ScenarioReviewResult_Verdict.VERDICT_REJECTED;
|
|
28
|
+
case 3:
|
|
29
|
+
case "VERDICT_NEEDS_INFO":
|
|
30
|
+
return ScenarioReviewResult_Verdict.VERDICT_NEEDS_INFO;
|
|
31
|
+
case 4:
|
|
32
|
+
case "VERDICT_WARNING":
|
|
33
|
+
return ScenarioReviewResult_Verdict.VERDICT_WARNING;
|
|
34
|
+
case -1:
|
|
35
|
+
case "UNRECOGNIZED":
|
|
36
|
+
default:
|
|
37
|
+
return ScenarioReviewResult_Verdict.UNRECOGNIZED;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function scenarioReviewResult_VerdictToJSON(object) {
|
|
41
|
+
switch (object) {
|
|
42
|
+
case ScenarioReviewResult_Verdict.VERDICT_UNSPECIFIED:
|
|
43
|
+
return "VERDICT_UNSPECIFIED";
|
|
44
|
+
case ScenarioReviewResult_Verdict.VERDICT_APPROVED:
|
|
45
|
+
return "VERDICT_APPROVED";
|
|
46
|
+
case ScenarioReviewResult_Verdict.VERDICT_REJECTED:
|
|
47
|
+
return "VERDICT_REJECTED";
|
|
48
|
+
case ScenarioReviewResult_Verdict.VERDICT_NEEDS_INFO:
|
|
49
|
+
return "VERDICT_NEEDS_INFO";
|
|
50
|
+
case ScenarioReviewResult_Verdict.VERDICT_WARNING:
|
|
51
|
+
return "VERDICT_WARNING";
|
|
52
|
+
case ScenarioReviewResult_Verdict.UNRECOGNIZED:
|
|
53
|
+
default:
|
|
54
|
+
return "UNRECOGNIZED";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function createBaseScenarioSubmitForReview() {
|
|
58
|
+
return {
|
|
59
|
+
scenario_id: "",
|
|
60
|
+
author_user_id: "",
|
|
61
|
+
scenario_bin: new Uint8Array(0),
|
|
62
|
+
manifest_json: new Uint8Array(0),
|
|
63
|
+
_unknownFields: {},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export const ScenarioSubmitForReview = {
|
|
67
|
+
encode(message, writer = new BinaryWriter()) {
|
|
68
|
+
if (message.scenario_id !== "") {
|
|
69
|
+
writer.uint32(10).string(message.scenario_id);
|
|
70
|
+
}
|
|
71
|
+
if (message.author_user_id !== "") {
|
|
72
|
+
writer.uint32(18).string(message.author_user_id);
|
|
73
|
+
}
|
|
74
|
+
if (message.scenario_bin.length !== 0) {
|
|
75
|
+
writer.uint32(26).bytes(message.scenario_bin);
|
|
76
|
+
}
|
|
77
|
+
if (message.manifest_json.length !== 0) {
|
|
78
|
+
writer.uint32(34).bytes(message.manifest_json);
|
|
79
|
+
}
|
|
80
|
+
if (message._unknownFields !== undefined) {
|
|
81
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
82
|
+
const tag = parseInt(key, 10);
|
|
83
|
+
for (const value of values) {
|
|
84
|
+
writer.uint32(tag).raw(value);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return writer;
|
|
89
|
+
},
|
|
90
|
+
decode(input, length) {
|
|
91
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
92
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
93
|
+
const message = createBaseScenarioSubmitForReview();
|
|
94
|
+
while (reader.pos < end) {
|
|
95
|
+
const tag = reader.uint32();
|
|
96
|
+
switch (tag >>> 3) {
|
|
97
|
+
case 1: {
|
|
98
|
+
if (tag !== 10) {
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
message.scenario_id = reader.string();
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
case 2: {
|
|
105
|
+
if (tag !== 18) {
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
message.author_user_id = reader.string();
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
case 3: {
|
|
112
|
+
if (tag !== 26) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
message.scenario_bin = reader.bytes();
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
case 4: {
|
|
119
|
+
if (tag !== 34) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
message.manifest_json = reader.bytes();
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
const buf = reader.skip(tag & 7);
|
|
130
|
+
const list = message._unknownFields[tag];
|
|
131
|
+
if (list === undefined) {
|
|
132
|
+
message._unknownFields[tag] = [buf];
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
list.push(buf);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return message;
|
|
139
|
+
},
|
|
140
|
+
fromJSON(object) {
|
|
141
|
+
return {
|
|
142
|
+
scenario_id: isSet(object.scenarioId)
|
|
143
|
+
? globalThis.String(object.scenarioId)
|
|
144
|
+
: isSet(object.scenario_id)
|
|
145
|
+
? globalThis.String(object.scenario_id)
|
|
146
|
+
: "",
|
|
147
|
+
author_user_id: isSet(object.authorUserId)
|
|
148
|
+
? globalThis.String(object.authorUserId)
|
|
149
|
+
: isSet(object.author_user_id)
|
|
150
|
+
? globalThis.String(object.author_user_id)
|
|
151
|
+
: "",
|
|
152
|
+
scenario_bin: isSet(object.scenarioBin)
|
|
153
|
+
? bytesFromBase64(object.scenarioBin)
|
|
154
|
+
: isSet(object.scenario_bin)
|
|
155
|
+
? bytesFromBase64(object.scenario_bin)
|
|
156
|
+
: new Uint8Array(0),
|
|
157
|
+
manifest_json: isSet(object.manifestJson)
|
|
158
|
+
? bytesFromBase64(object.manifestJson)
|
|
159
|
+
: isSet(object.manifest_json)
|
|
160
|
+
? bytesFromBase64(object.manifest_json)
|
|
161
|
+
: new Uint8Array(0),
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
toJSON(message) {
|
|
165
|
+
const obj = {};
|
|
166
|
+
if (message.scenario_id !== "") {
|
|
167
|
+
obj.scenarioId = message.scenario_id;
|
|
168
|
+
}
|
|
169
|
+
if (message.author_user_id !== "") {
|
|
170
|
+
obj.authorUserId = message.author_user_id;
|
|
171
|
+
}
|
|
172
|
+
if (message.scenario_bin.length !== 0) {
|
|
173
|
+
obj.scenarioBin = base64FromBytes(message.scenario_bin);
|
|
174
|
+
}
|
|
175
|
+
if (message.manifest_json.length !== 0) {
|
|
176
|
+
obj.manifestJson = base64FromBytes(message.manifest_json);
|
|
177
|
+
}
|
|
178
|
+
return obj;
|
|
179
|
+
},
|
|
180
|
+
create(base) {
|
|
181
|
+
return ScenarioSubmitForReview.fromPartial(base ?? {});
|
|
182
|
+
},
|
|
183
|
+
fromPartial(object) {
|
|
184
|
+
const message = createBaseScenarioSubmitForReview();
|
|
185
|
+
message.scenario_id = object.scenario_id ?? "";
|
|
186
|
+
message.author_user_id = object.author_user_id ?? "";
|
|
187
|
+
message.scenario_bin = object.scenario_bin ?? new Uint8Array(0);
|
|
188
|
+
message.manifest_json = object.manifest_json ?? new Uint8Array(0);
|
|
189
|
+
return message;
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
function createBaseScenarioReviewResult() {
|
|
193
|
+
return {
|
|
194
|
+
scenario_id: "",
|
|
195
|
+
verdict: 0,
|
|
196
|
+
violations: [],
|
|
197
|
+
reviewer_notes: "",
|
|
198
|
+
official_risk_tags: [],
|
|
199
|
+
_unknownFields: {},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export const ScenarioReviewResult = {
|
|
203
|
+
encode(message, writer = new BinaryWriter()) {
|
|
204
|
+
if (message.scenario_id !== "") {
|
|
205
|
+
writer.uint32(10).string(message.scenario_id);
|
|
206
|
+
}
|
|
207
|
+
if (message.verdict !== 0) {
|
|
208
|
+
writer.uint32(16).int32(message.verdict);
|
|
209
|
+
}
|
|
210
|
+
for (const v of message.violations) {
|
|
211
|
+
writer.uint32(26).string(v);
|
|
212
|
+
}
|
|
213
|
+
if (message.reviewer_notes !== "") {
|
|
214
|
+
writer.uint32(34).string(message.reviewer_notes);
|
|
215
|
+
}
|
|
216
|
+
for (const v of message.official_risk_tags) {
|
|
217
|
+
writer.uint32(42).string(v);
|
|
218
|
+
}
|
|
219
|
+
if (message._unknownFields !== undefined) {
|
|
220
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
221
|
+
const tag = parseInt(key, 10);
|
|
222
|
+
for (const value of values) {
|
|
223
|
+
writer.uint32(tag).raw(value);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return writer;
|
|
228
|
+
},
|
|
229
|
+
decode(input, length) {
|
|
230
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
231
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
232
|
+
const message = createBaseScenarioReviewResult();
|
|
233
|
+
while (reader.pos < end) {
|
|
234
|
+
const tag = reader.uint32();
|
|
235
|
+
switch (tag >>> 3) {
|
|
236
|
+
case 1: {
|
|
237
|
+
if (tag !== 10) {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
message.scenario_id = reader.string();
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
case 2: {
|
|
244
|
+
if (tag !== 16) {
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
message.verdict = reader.int32();
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
case 3: {
|
|
251
|
+
if (tag !== 26) {
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
message.violations.push(reader.string());
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
case 4: {
|
|
258
|
+
if (tag !== 34) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
message.reviewer_notes = reader.string();
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
case 5: {
|
|
265
|
+
if (tag !== 42) {
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
message.official_risk_tags.push(reader.string());
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
const buf = reader.skip(tag & 7);
|
|
276
|
+
const list = message._unknownFields[tag];
|
|
277
|
+
if (list === undefined) {
|
|
278
|
+
message._unknownFields[tag] = [buf];
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
list.push(buf);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return message;
|
|
285
|
+
},
|
|
286
|
+
fromJSON(object) {
|
|
287
|
+
return {
|
|
288
|
+
scenario_id: isSet(object.scenarioId)
|
|
289
|
+
? globalThis.String(object.scenarioId)
|
|
290
|
+
: isSet(object.scenario_id)
|
|
291
|
+
? globalThis.String(object.scenario_id)
|
|
292
|
+
: "",
|
|
293
|
+
verdict: isSet(object.verdict) ? scenarioReviewResult_VerdictFromJSON(object.verdict) : 0,
|
|
294
|
+
violations: globalThis.Array.isArray(object?.violations)
|
|
295
|
+
? object.violations.map((e) => globalThis.String(e))
|
|
296
|
+
: [],
|
|
297
|
+
reviewer_notes: isSet(object.reviewerNotes)
|
|
298
|
+
? globalThis.String(object.reviewerNotes)
|
|
299
|
+
: isSet(object.reviewer_notes)
|
|
300
|
+
? globalThis.String(object.reviewer_notes)
|
|
301
|
+
: "",
|
|
302
|
+
official_risk_tags: globalThis.Array.isArray(object?.officialRiskTags)
|
|
303
|
+
? object.officialRiskTags.map((e) => globalThis.String(e))
|
|
304
|
+
: globalThis.Array.isArray(object?.official_risk_tags)
|
|
305
|
+
? object.official_risk_tags.map((e) => globalThis.String(e))
|
|
306
|
+
: [],
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
toJSON(message) {
|
|
310
|
+
const obj = {};
|
|
311
|
+
if (message.scenario_id !== "") {
|
|
312
|
+
obj.scenarioId = message.scenario_id;
|
|
313
|
+
}
|
|
314
|
+
if (message.verdict !== 0) {
|
|
315
|
+
obj.verdict = scenarioReviewResult_VerdictToJSON(message.verdict);
|
|
316
|
+
}
|
|
317
|
+
if (message.violations?.length) {
|
|
318
|
+
obj.violations = message.violations;
|
|
319
|
+
}
|
|
320
|
+
if (message.reviewer_notes !== "") {
|
|
321
|
+
obj.reviewerNotes = message.reviewer_notes;
|
|
322
|
+
}
|
|
323
|
+
if (message.official_risk_tags?.length) {
|
|
324
|
+
obj.officialRiskTags = message.official_risk_tags;
|
|
325
|
+
}
|
|
326
|
+
return obj;
|
|
327
|
+
},
|
|
328
|
+
create(base) {
|
|
329
|
+
return ScenarioReviewResult.fromPartial(base ?? {});
|
|
330
|
+
},
|
|
331
|
+
fromPartial(object) {
|
|
332
|
+
const message = createBaseScenarioReviewResult();
|
|
333
|
+
message.scenario_id = object.scenario_id ?? "";
|
|
334
|
+
message.verdict = object.verdict ?? 0;
|
|
335
|
+
message.violations = object.violations?.map((e) => e) || [];
|
|
336
|
+
message.reviewer_notes = object.reviewer_notes ?? "";
|
|
337
|
+
message.official_risk_tags = object.official_risk_tags?.map((e) => e) || [];
|
|
338
|
+
return message;
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
function bytesFromBase64(b64) {
|
|
342
|
+
if (globalThis.Buffer) {
|
|
343
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
const bin = globalThis.atob(b64);
|
|
347
|
+
const arr = new Uint8Array(bin.length);
|
|
348
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
349
|
+
arr[i] = bin.charCodeAt(i);
|
|
350
|
+
}
|
|
351
|
+
return arr;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function base64FromBytes(arr) {
|
|
355
|
+
if (globalThis.Buffer) {
|
|
356
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
const bin = [];
|
|
360
|
+
arr.forEach((byte) => {
|
|
361
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
362
|
+
});
|
|
363
|
+
return globalThis.btoa(bin.join(""));
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function isSet(value) {
|
|
367
|
+
return value !== null && value !== undefined;
|
|
368
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
/**
|
|
3
|
+
* NeutralScenarioSource is the author-owned, compiler- and runtime-neutral wire
|
|
4
|
+
* representation of a complete TMW3 scenario revision.
|
|
5
|
+
*
|
|
6
|
+
* Field numbers are append-only. Consumers must preserve unknown wire fields.
|
|
7
|
+
*/
|
|
8
|
+
export interface NeutralScenarioSource {
|
|
9
|
+
source_schema_version: number;
|
|
10
|
+
scenario_id: string;
|
|
11
|
+
manifest?: ScenarioSourceManifest | undefined;
|
|
12
|
+
sections: ScenarioSourceSection[];
|
|
13
|
+
_unknownFields?: {
|
|
14
|
+
[key: number]: Uint8Array[];
|
|
15
|
+
} | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ScenarioSourceSection keeps each physical authoring section opaque. Semantic
|
|
19
|
+
* validation belongs to the compiler stage for that section.
|
|
20
|
+
*/
|
|
21
|
+
export interface ScenarioSourceSection {
|
|
22
|
+
section_key: string;
|
|
23
|
+
media_type: string;
|
|
24
|
+
canonical_encoding: string;
|
|
25
|
+
payload: Uint8Array;
|
|
26
|
+
_unknownFields?: {
|
|
27
|
+
[key: number]: Uint8Array[];
|
|
28
|
+
} | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ScenarioSourceSectionIdentity binds one opaque section into the complete
|
|
32
|
+
* source manifest.
|
|
33
|
+
*/
|
|
34
|
+
export interface ScenarioSourceSectionIdentity {
|
|
35
|
+
section_key: string;
|
|
36
|
+
media_type: string;
|
|
37
|
+
canonical_encoding: string;
|
|
38
|
+
byte_length: string;
|
|
39
|
+
sha256: Uint8Array;
|
|
40
|
+
_unknownFields?: {
|
|
41
|
+
[key: number]: Uint8Array[];
|
|
42
|
+
} | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* ScenarioSourceManifest is the sole snapshot authority for all author input.
|
|
46
|
+
* manifest_sha256 is computed over the canonical manifest fields with
|
|
47
|
+
* manifest_sha256 itself empty.
|
|
48
|
+
*/
|
|
49
|
+
export interface ScenarioSourceManifest {
|
|
50
|
+
manifest_schema_version: number;
|
|
51
|
+
scenario_id: string;
|
|
52
|
+
sections: ScenarioSourceSectionIdentity[];
|
|
53
|
+
manifest_sha256: Uint8Array;
|
|
54
|
+
_unknownFields?: {
|
|
55
|
+
[key: number]: Uint8Array[];
|
|
56
|
+
} | undefined;
|
|
57
|
+
}
|
|
58
|
+
export declare const NeutralScenarioSource: MessageFns<NeutralScenarioSource>;
|
|
59
|
+
export declare const ScenarioSourceSection: MessageFns<ScenarioSourceSection>;
|
|
60
|
+
export declare const ScenarioSourceSectionIdentity: MessageFns<ScenarioSourceSectionIdentity>;
|
|
61
|
+
export declare const ScenarioSourceManifest: MessageFns<ScenarioSourceManifest>;
|
|
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 keyof T]?: 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>>]: never;
|
|
71
|
+
};
|
|
72
|
+
interface MessageFns<T> {
|
|
73
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
74
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
75
|
+
fromJSON(object: any): T;
|
|
76
|
+
toJSON(message: T): unknown;
|
|
77
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
78
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
79
|
+
}
|
|
80
|
+
export {};
|