@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.
Files changed (74) hide show
  1. package/LICENSE +46 -0
  2. package/dist/entity-prop-envelope.d.ts +36 -0
  3. package/dist/entity-prop-envelope.js +50 -0
  4. package/dist/gen/v1/auth.d.ts +46 -0
  5. package/dist/gen/v1/auth.js +278 -0
  6. package/dist/gen/v1/billing.d.ts +71 -0
  7. package/dist/gen/v1/billing.js +521 -0
  8. package/dist/gen/v1/common.d.ts +65 -0
  9. package/dist/gen/v1/common.js +387 -0
  10. package/dist/gen/v1/llm.d.ts +317 -0
  11. package/dist/gen/v1/llm.js +3557 -0
  12. package/dist/gen/v1/mcp.d.ts +373 -0
  13. package/dist/gen/v1/mcp.js +3190 -0
  14. package/dist/gen/v1/moderation.d.ts +51 -0
  15. package/dist/gen/v1/moderation.js +368 -0
  16. package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
  17. package/dist/gen/v1/neutral_scenario_source.js +569 -0
  18. package/dist/gen/v1/relation_kind.d.ts +105 -0
  19. package/dist/gen/v1/relation_kind.js +562 -0
  20. package/dist/gen/v1/rest/admin.d.ts +432 -0
  21. package/dist/gen/v1/rest/admin.js +4957 -0
  22. package/dist/gen/v1/rest/asset.d.ts +205 -0
  23. package/dist/gen/v1/rest/asset.js +2200 -0
  24. package/dist/gen/v1/rest/auth.d.ts +275 -0
  25. package/dist/gen/v1/rest/auth.js +2896 -0
  26. package/dist/gen/v1/rest/billing.d.ts +101 -0
  27. package/dist/gen/v1/rest/billing.js +866 -0
  28. package/dist/gen/v1/rest/common.d.ts +179 -0
  29. package/dist/gen/v1/rest/common.js +1358 -0
  30. package/dist/gen/v1/rest/creator.d.ts +354 -0
  31. package/dist/gen/v1/rest/creator.js +4169 -0
  32. package/dist/gen/v1/rest/messaging.d.ts +190 -0
  33. package/dist/gen/v1/rest/messaging.js +2017 -0
  34. package/dist/gen/v1/rest/moderation.d.ts +61 -0
  35. package/dist/gen/v1/rest/moderation.js +569 -0
  36. package/dist/gen/v1/rest/pet.d.ts +98 -0
  37. package/dist/gen/v1/rest/pet.js +698 -0
  38. package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
  39. package/dist/gen/v1/rest/project_transfer.js +5266 -0
  40. package/dist/gen/v1/rest/scenario.d.ts +756 -0
  41. package/dist/gen/v1/rest/scenario.js +8768 -0
  42. package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
  43. package/dist/gen/v1/rest/stock_bounty.js +1547 -0
  44. package/dist/gen/v1/rest/stocks.d.ts +465 -0
  45. package/dist/gen/v1/rest/stocks.js +5200 -0
  46. package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
  47. package/dist/gen/v1/rest/support_ticket.js +511 -0
  48. package/dist/gen/v1/rest/users.d.ts +292 -0
  49. package/dist/gen/v1/rest/users.js +2879 -0
  50. package/dist/gen/v1/rest/violations.d.ts +52 -0
  51. package/dist/gen/v1/rest/violations.js +338 -0
  52. package/dist/gen/v1/sav.d.ts +987 -0
  53. package/dist/gen/v1/sav.js +12327 -0
  54. package/dist/gen/v1/save.d.ts +68 -0
  55. package/dist/gen/v1/save.js +595 -0
  56. package/dist/gen/v1/scenario_part_source.d.ts +94 -0
  57. package/dist/gen/v1/scenario_part_source.js +913 -0
  58. package/dist/gen/v1/session.d.ts +49 -0
  59. package/dist/gen/v1/session.js +311 -0
  60. package/dist/gen/v1/view_state.d.ts +267 -0
  61. package/dist/gen/v1/view_state.js +3239 -0
  62. package/dist/gen/v1/world.d.ts +82 -0
  63. package/dist/gen/v1/world.js +707 -0
  64. package/dist/gen/v1/world_memory.d.ts +545 -0
  65. package/dist/gen/v1/world_memory.js +5816 -0
  66. package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
  67. package/dist/gen/v1/world_memory_privacy.js +994 -0
  68. package/dist/gen/v1/ws_frame.d.ts +1626 -0
  69. package/dist/gen/v1/ws_frame.js +18253 -0
  70. package/dist/index.d.ts +2 -0
  71. package/dist/index.js +5 -0
  72. package/dist/ladybug-extraction.d.ts +36 -0
  73. package/dist/ladybug-extraction.js +1 -0
  74. package/package.json +65 -0
@@ -0,0 +1,569 @@
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/neutral_scenario_source.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ function createBaseNeutralScenarioSource() {
9
+ return { source_schema_version: 0, scenario_id: "", manifest: undefined, sections: [], _unknownFields: {} };
10
+ }
11
+ export const NeutralScenarioSource = {
12
+ encode(message, writer = new BinaryWriter()) {
13
+ if (message.source_schema_version !== 0) {
14
+ writer.uint32(8).uint32(message.source_schema_version);
15
+ }
16
+ if (message.scenario_id !== "") {
17
+ writer.uint32(18).string(message.scenario_id);
18
+ }
19
+ if (message.manifest !== undefined) {
20
+ ScenarioSourceManifest.encode(message.manifest, writer.uint32(26).fork()).join();
21
+ }
22
+ for (const v of message.sections) {
23
+ ScenarioSourceSection.encode(v, writer.uint32(34).fork()).join();
24
+ }
25
+ if (message._unknownFields !== undefined) {
26
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
27
+ const tag = parseInt(key, 10);
28
+ for (const value of values) {
29
+ writer.uint32(tag).raw(value);
30
+ }
31
+ }
32
+ }
33
+ return writer;
34
+ },
35
+ decode(input, length) {
36
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
37
+ const end = length === undefined ? reader.len : reader.pos + length;
38
+ const message = createBaseNeutralScenarioSource();
39
+ while (reader.pos < end) {
40
+ const tag = reader.uint32();
41
+ switch (tag >>> 3) {
42
+ case 1: {
43
+ if (tag !== 8) {
44
+ break;
45
+ }
46
+ message.source_schema_version = reader.uint32();
47
+ continue;
48
+ }
49
+ case 2: {
50
+ if (tag !== 18) {
51
+ break;
52
+ }
53
+ message.scenario_id = reader.string();
54
+ continue;
55
+ }
56
+ case 3: {
57
+ if (tag !== 26) {
58
+ break;
59
+ }
60
+ message.manifest = ScenarioSourceManifest.decode(reader, reader.uint32());
61
+ continue;
62
+ }
63
+ case 4: {
64
+ if (tag !== 34) {
65
+ break;
66
+ }
67
+ message.sections.push(ScenarioSourceSection.decode(reader, reader.uint32()));
68
+ continue;
69
+ }
70
+ }
71
+ if ((tag & 7) === 4 || tag === 0) {
72
+ break;
73
+ }
74
+ const buf = reader.skip(tag & 7);
75
+ const list = message._unknownFields[tag];
76
+ if (list === undefined) {
77
+ message._unknownFields[tag] = [buf];
78
+ }
79
+ else {
80
+ list.push(buf);
81
+ }
82
+ }
83
+ return message;
84
+ },
85
+ fromJSON(object) {
86
+ return {
87
+ source_schema_version: isSet(object.sourceSchemaVersion)
88
+ ? globalThis.Number(object.sourceSchemaVersion)
89
+ : isSet(object.source_schema_version)
90
+ ? globalThis.Number(object.source_schema_version)
91
+ : 0,
92
+ scenario_id: isSet(object.scenarioId)
93
+ ? globalThis.String(object.scenarioId)
94
+ : isSet(object.scenario_id)
95
+ ? globalThis.String(object.scenario_id)
96
+ : "",
97
+ manifest: isSet(object.manifest) ? ScenarioSourceManifest.fromJSON(object.manifest) : undefined,
98
+ sections: globalThis.Array.isArray(object?.sections)
99
+ ? object.sections.map((e) => ScenarioSourceSection.fromJSON(e))
100
+ : [],
101
+ };
102
+ },
103
+ toJSON(message) {
104
+ const obj = {};
105
+ if (message.source_schema_version !== 0) {
106
+ obj.sourceSchemaVersion = Math.round(message.source_schema_version);
107
+ }
108
+ if (message.scenario_id !== "") {
109
+ obj.scenarioId = message.scenario_id;
110
+ }
111
+ if (message.manifest !== undefined) {
112
+ obj.manifest = ScenarioSourceManifest.toJSON(message.manifest);
113
+ }
114
+ if (message.sections?.length) {
115
+ obj.sections = message.sections.map((e) => ScenarioSourceSection.toJSON(e));
116
+ }
117
+ return obj;
118
+ },
119
+ create(base) {
120
+ return NeutralScenarioSource.fromPartial(base ?? {});
121
+ },
122
+ fromPartial(object) {
123
+ const message = createBaseNeutralScenarioSource();
124
+ message.source_schema_version = object.source_schema_version ?? 0;
125
+ message.scenario_id = object.scenario_id ?? "";
126
+ message.manifest = (object.manifest !== undefined && object.manifest !== null)
127
+ ? ScenarioSourceManifest.fromPartial(object.manifest)
128
+ : undefined;
129
+ message.sections = object.sections?.map((e) => ScenarioSourceSection.fromPartial(e)) || [];
130
+ return message;
131
+ },
132
+ };
133
+ function createBaseScenarioSourceSection() {
134
+ return { section_key: "", media_type: "", canonical_encoding: "", payload: new Uint8Array(0), _unknownFields: {} };
135
+ }
136
+ export const ScenarioSourceSection = {
137
+ encode(message, writer = new BinaryWriter()) {
138
+ if (message.section_key !== "") {
139
+ writer.uint32(10).string(message.section_key);
140
+ }
141
+ if (message.media_type !== "") {
142
+ writer.uint32(18).string(message.media_type);
143
+ }
144
+ if (message.canonical_encoding !== "") {
145
+ writer.uint32(26).string(message.canonical_encoding);
146
+ }
147
+ if (message.payload.length !== 0) {
148
+ writer.uint32(34).bytes(message.payload);
149
+ }
150
+ if (message._unknownFields !== undefined) {
151
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
152
+ const tag = parseInt(key, 10);
153
+ for (const value of values) {
154
+ writer.uint32(tag).raw(value);
155
+ }
156
+ }
157
+ }
158
+ return writer;
159
+ },
160
+ decode(input, length) {
161
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
162
+ const end = length === undefined ? reader.len : reader.pos + length;
163
+ const message = createBaseScenarioSourceSection();
164
+ while (reader.pos < end) {
165
+ const tag = reader.uint32();
166
+ switch (tag >>> 3) {
167
+ case 1: {
168
+ if (tag !== 10) {
169
+ break;
170
+ }
171
+ message.section_key = reader.string();
172
+ continue;
173
+ }
174
+ case 2: {
175
+ if (tag !== 18) {
176
+ break;
177
+ }
178
+ message.media_type = reader.string();
179
+ continue;
180
+ }
181
+ case 3: {
182
+ if (tag !== 26) {
183
+ break;
184
+ }
185
+ message.canonical_encoding = reader.string();
186
+ continue;
187
+ }
188
+ case 4: {
189
+ if (tag !== 34) {
190
+ break;
191
+ }
192
+ message.payload = reader.bytes();
193
+ continue;
194
+ }
195
+ }
196
+ if ((tag & 7) === 4 || tag === 0) {
197
+ break;
198
+ }
199
+ const buf = reader.skip(tag & 7);
200
+ const list = message._unknownFields[tag];
201
+ if (list === undefined) {
202
+ message._unknownFields[tag] = [buf];
203
+ }
204
+ else {
205
+ list.push(buf);
206
+ }
207
+ }
208
+ return message;
209
+ },
210
+ fromJSON(object) {
211
+ return {
212
+ section_key: isSet(object.sectionKey)
213
+ ? globalThis.String(object.sectionKey)
214
+ : isSet(object.section_key)
215
+ ? globalThis.String(object.section_key)
216
+ : "",
217
+ media_type: isSet(object.mediaType)
218
+ ? globalThis.String(object.mediaType)
219
+ : isSet(object.media_type)
220
+ ? globalThis.String(object.media_type)
221
+ : "",
222
+ canonical_encoding: isSet(object.canonicalEncoding)
223
+ ? globalThis.String(object.canonicalEncoding)
224
+ : isSet(object.canonical_encoding)
225
+ ? globalThis.String(object.canonical_encoding)
226
+ : "",
227
+ payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0),
228
+ };
229
+ },
230
+ toJSON(message) {
231
+ const obj = {};
232
+ if (message.section_key !== "") {
233
+ obj.sectionKey = message.section_key;
234
+ }
235
+ if (message.media_type !== "") {
236
+ obj.mediaType = message.media_type;
237
+ }
238
+ if (message.canonical_encoding !== "") {
239
+ obj.canonicalEncoding = message.canonical_encoding;
240
+ }
241
+ if (message.payload.length !== 0) {
242
+ obj.payload = base64FromBytes(message.payload);
243
+ }
244
+ return obj;
245
+ },
246
+ create(base) {
247
+ return ScenarioSourceSection.fromPartial(base ?? {});
248
+ },
249
+ fromPartial(object) {
250
+ const message = createBaseScenarioSourceSection();
251
+ message.section_key = object.section_key ?? "";
252
+ message.media_type = object.media_type ?? "";
253
+ message.canonical_encoding = object.canonical_encoding ?? "";
254
+ message.payload = object.payload ?? new Uint8Array(0);
255
+ return message;
256
+ },
257
+ };
258
+ function createBaseScenarioSourceSectionIdentity() {
259
+ return {
260
+ section_key: "",
261
+ media_type: "",
262
+ canonical_encoding: "",
263
+ byte_length: "0",
264
+ sha256: new Uint8Array(0),
265
+ _unknownFields: {},
266
+ };
267
+ }
268
+ export const ScenarioSourceSectionIdentity = {
269
+ encode(message, writer = new BinaryWriter()) {
270
+ if (message.section_key !== "") {
271
+ writer.uint32(10).string(message.section_key);
272
+ }
273
+ if (message.media_type !== "") {
274
+ writer.uint32(18).string(message.media_type);
275
+ }
276
+ if (message.canonical_encoding !== "") {
277
+ writer.uint32(26).string(message.canonical_encoding);
278
+ }
279
+ if (message.byte_length !== "0") {
280
+ writer.uint32(32).uint64(message.byte_length);
281
+ }
282
+ if (message.sha256.length !== 0) {
283
+ writer.uint32(42).bytes(message.sha256);
284
+ }
285
+ if (message._unknownFields !== undefined) {
286
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
287
+ const tag = parseInt(key, 10);
288
+ for (const value of values) {
289
+ writer.uint32(tag).raw(value);
290
+ }
291
+ }
292
+ }
293
+ return writer;
294
+ },
295
+ decode(input, length) {
296
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
297
+ const end = length === undefined ? reader.len : reader.pos + length;
298
+ const message = createBaseScenarioSourceSectionIdentity();
299
+ while (reader.pos < end) {
300
+ const tag = reader.uint32();
301
+ switch (tag >>> 3) {
302
+ case 1: {
303
+ if (tag !== 10) {
304
+ break;
305
+ }
306
+ message.section_key = reader.string();
307
+ continue;
308
+ }
309
+ case 2: {
310
+ if (tag !== 18) {
311
+ break;
312
+ }
313
+ message.media_type = reader.string();
314
+ continue;
315
+ }
316
+ case 3: {
317
+ if (tag !== 26) {
318
+ break;
319
+ }
320
+ message.canonical_encoding = reader.string();
321
+ continue;
322
+ }
323
+ case 4: {
324
+ if (tag !== 32) {
325
+ break;
326
+ }
327
+ message.byte_length = reader.uint64().toString();
328
+ continue;
329
+ }
330
+ case 5: {
331
+ if (tag !== 42) {
332
+ break;
333
+ }
334
+ message.sha256 = reader.bytes();
335
+ continue;
336
+ }
337
+ }
338
+ if ((tag & 7) === 4 || tag === 0) {
339
+ break;
340
+ }
341
+ const buf = reader.skip(tag & 7);
342
+ const list = message._unknownFields[tag];
343
+ if (list === undefined) {
344
+ message._unknownFields[tag] = [buf];
345
+ }
346
+ else {
347
+ list.push(buf);
348
+ }
349
+ }
350
+ return message;
351
+ },
352
+ fromJSON(object) {
353
+ return {
354
+ section_key: isSet(object.sectionKey)
355
+ ? globalThis.String(object.sectionKey)
356
+ : isSet(object.section_key)
357
+ ? globalThis.String(object.section_key)
358
+ : "",
359
+ media_type: isSet(object.mediaType)
360
+ ? globalThis.String(object.mediaType)
361
+ : isSet(object.media_type)
362
+ ? globalThis.String(object.media_type)
363
+ : "",
364
+ canonical_encoding: isSet(object.canonicalEncoding)
365
+ ? globalThis.String(object.canonicalEncoding)
366
+ : isSet(object.canonical_encoding)
367
+ ? globalThis.String(object.canonical_encoding)
368
+ : "",
369
+ byte_length: isSet(object.byteLength)
370
+ ? globalThis.String(object.byteLength)
371
+ : isSet(object.byte_length)
372
+ ? globalThis.String(object.byte_length)
373
+ : "0",
374
+ sha256: isSet(object.sha256) ? bytesFromBase64(object.sha256) : new Uint8Array(0),
375
+ };
376
+ },
377
+ toJSON(message) {
378
+ const obj = {};
379
+ if (message.section_key !== "") {
380
+ obj.sectionKey = message.section_key;
381
+ }
382
+ if (message.media_type !== "") {
383
+ obj.mediaType = message.media_type;
384
+ }
385
+ if (message.canonical_encoding !== "") {
386
+ obj.canonicalEncoding = message.canonical_encoding;
387
+ }
388
+ if (message.byte_length !== "0") {
389
+ obj.byteLength = message.byte_length;
390
+ }
391
+ if (message.sha256.length !== 0) {
392
+ obj.sha256 = base64FromBytes(message.sha256);
393
+ }
394
+ return obj;
395
+ },
396
+ create(base) {
397
+ return ScenarioSourceSectionIdentity.fromPartial(base ?? {});
398
+ },
399
+ fromPartial(object) {
400
+ const message = createBaseScenarioSourceSectionIdentity();
401
+ message.section_key = object.section_key ?? "";
402
+ message.media_type = object.media_type ?? "";
403
+ message.canonical_encoding = object.canonical_encoding ?? "";
404
+ message.byte_length = object.byte_length ?? "0";
405
+ message.sha256 = object.sha256 ?? new Uint8Array(0);
406
+ return message;
407
+ },
408
+ };
409
+ function createBaseScenarioSourceManifest() {
410
+ return {
411
+ manifest_schema_version: 0,
412
+ scenario_id: "",
413
+ sections: [],
414
+ manifest_sha256: new Uint8Array(0),
415
+ _unknownFields: {},
416
+ };
417
+ }
418
+ export const ScenarioSourceManifest = {
419
+ encode(message, writer = new BinaryWriter()) {
420
+ if (message.manifest_schema_version !== 0) {
421
+ writer.uint32(8).uint32(message.manifest_schema_version);
422
+ }
423
+ if (message.scenario_id !== "") {
424
+ writer.uint32(18).string(message.scenario_id);
425
+ }
426
+ for (const v of message.sections) {
427
+ ScenarioSourceSectionIdentity.encode(v, writer.uint32(26).fork()).join();
428
+ }
429
+ if (message.manifest_sha256.length !== 0) {
430
+ writer.uint32(34).bytes(message.manifest_sha256);
431
+ }
432
+ if (message._unknownFields !== undefined) {
433
+ for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
434
+ const tag = parseInt(key, 10);
435
+ for (const value of values) {
436
+ writer.uint32(tag).raw(value);
437
+ }
438
+ }
439
+ }
440
+ return writer;
441
+ },
442
+ decode(input, length) {
443
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
444
+ const end = length === undefined ? reader.len : reader.pos + length;
445
+ const message = createBaseScenarioSourceManifest();
446
+ while (reader.pos < end) {
447
+ const tag = reader.uint32();
448
+ switch (tag >>> 3) {
449
+ case 1: {
450
+ if (tag !== 8) {
451
+ break;
452
+ }
453
+ message.manifest_schema_version = reader.uint32();
454
+ continue;
455
+ }
456
+ case 2: {
457
+ if (tag !== 18) {
458
+ break;
459
+ }
460
+ message.scenario_id = reader.string();
461
+ continue;
462
+ }
463
+ case 3: {
464
+ if (tag !== 26) {
465
+ break;
466
+ }
467
+ message.sections.push(ScenarioSourceSectionIdentity.decode(reader, reader.uint32()));
468
+ continue;
469
+ }
470
+ case 4: {
471
+ if (tag !== 34) {
472
+ break;
473
+ }
474
+ message.manifest_sha256 = reader.bytes();
475
+ continue;
476
+ }
477
+ }
478
+ if ((tag & 7) === 4 || tag === 0) {
479
+ break;
480
+ }
481
+ const buf = reader.skip(tag & 7);
482
+ const list = message._unknownFields[tag];
483
+ if (list === undefined) {
484
+ message._unknownFields[tag] = [buf];
485
+ }
486
+ else {
487
+ list.push(buf);
488
+ }
489
+ }
490
+ return message;
491
+ },
492
+ fromJSON(object) {
493
+ return {
494
+ manifest_schema_version: isSet(object.manifestSchemaVersion)
495
+ ? globalThis.Number(object.manifestSchemaVersion)
496
+ : isSet(object.manifest_schema_version)
497
+ ? globalThis.Number(object.manifest_schema_version)
498
+ : 0,
499
+ scenario_id: isSet(object.scenarioId)
500
+ ? globalThis.String(object.scenarioId)
501
+ : isSet(object.scenario_id)
502
+ ? globalThis.String(object.scenario_id)
503
+ : "",
504
+ sections: globalThis.Array.isArray(object?.sections)
505
+ ? object.sections.map((e) => ScenarioSourceSectionIdentity.fromJSON(e))
506
+ : [],
507
+ manifest_sha256: isSet(object.manifestSha256)
508
+ ? bytesFromBase64(object.manifestSha256)
509
+ : isSet(object.manifest_sha256)
510
+ ? bytesFromBase64(object.manifest_sha256)
511
+ : new Uint8Array(0),
512
+ };
513
+ },
514
+ toJSON(message) {
515
+ const obj = {};
516
+ if (message.manifest_schema_version !== 0) {
517
+ obj.manifestSchemaVersion = Math.round(message.manifest_schema_version);
518
+ }
519
+ if (message.scenario_id !== "") {
520
+ obj.scenarioId = message.scenario_id;
521
+ }
522
+ if (message.sections?.length) {
523
+ obj.sections = message.sections.map((e) => ScenarioSourceSectionIdentity.toJSON(e));
524
+ }
525
+ if (message.manifest_sha256.length !== 0) {
526
+ obj.manifestSha256 = base64FromBytes(message.manifest_sha256);
527
+ }
528
+ return obj;
529
+ },
530
+ create(base) {
531
+ return ScenarioSourceManifest.fromPartial(base ?? {});
532
+ },
533
+ fromPartial(object) {
534
+ const message = createBaseScenarioSourceManifest();
535
+ message.manifest_schema_version = object.manifest_schema_version ?? 0;
536
+ message.scenario_id = object.scenario_id ?? "";
537
+ message.sections = object.sections?.map((e) => ScenarioSourceSectionIdentity.fromPartial(e)) || [];
538
+ message.manifest_sha256 = object.manifest_sha256 ?? new Uint8Array(0);
539
+ return message;
540
+ },
541
+ };
542
+ function bytesFromBase64(b64) {
543
+ if (globalThis.Buffer) {
544
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
545
+ }
546
+ else {
547
+ const bin = globalThis.atob(b64);
548
+ const arr = new Uint8Array(bin.length);
549
+ for (let i = 0; i < bin.length; ++i) {
550
+ arr[i] = bin.charCodeAt(i);
551
+ }
552
+ return arr;
553
+ }
554
+ }
555
+ function base64FromBytes(arr) {
556
+ if (globalThis.Buffer) {
557
+ return globalThis.Buffer.from(arr).toString("base64");
558
+ }
559
+ else {
560
+ const bin = [];
561
+ arr.forEach((byte) => {
562
+ bin.push(globalThis.String.fromCharCode(byte));
563
+ });
564
+ return globalThis.btoa(bin.join(""));
565
+ }
566
+ }
567
+ function isSet(value) {
568
+ return value !== null && value !== undefined;
569
+ }
@@ -0,0 +1,105 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare enum RelationKind {
3
+ RELATION_KIND_UNSPECIFIED = 0,
4
+ /** RELATION_KIND_FAMILY_OF - 亲属 (kinship) */
5
+ RELATION_KIND_FAMILY_OF = 1,
6
+ RELATION_KIND_PARENT_OF = 2,
7
+ RELATION_KIND_CHILD_OF = 3,
8
+ RELATION_KIND_SIBLING_OF = 4,
9
+ RELATION_KIND_SPOUSE_OF = 5,
10
+ RELATION_KIND_RELATIVE_OF = 6,
11
+ /** RELATION_KIND_KNOWS - 社交 (social) */
12
+ RELATION_KIND_KNOWS = 20,
13
+ RELATION_KIND_FRIEND_OF = 21,
14
+ RELATION_KIND_HOSTILE_TO = 22,
15
+ RELATION_KIND_ROMANTIC_WITH = 23,
16
+ RELATION_KIND_RIVAL_OF = 24,
17
+ /** RELATION_KIND_TEACHER_OF - 师徒 (mentorship) */
18
+ RELATION_KIND_TEACHER_OF = 30,
19
+ RELATION_KIND_STUDENT_OF = 31,
20
+ RELATION_KIND_TEACHES = 32,
21
+ /** RELATION_KIND_EMPLOYER_OF - 职场 (workplace) */
22
+ RELATION_KIND_EMPLOYER_OF = 40,
23
+ RELATION_KIND_EMPLOYEE_OF = 41,
24
+ RELATION_KIND_COLLEAGUE_OF = 42,
25
+ /** RELATION_KIND_LOCATED_IN - 空间与持有 (spatial) */
26
+ RELATION_KIND_LOCATED_IN = 50,
27
+ RELATION_KIND_OWNS = 51,
28
+ /** RELATION_KIND_MEMBER_OF - 组织与隶属 (organization) */
29
+ RELATION_KIND_MEMBER_OF = 60,
30
+ RELATION_KIND_LEADER_OF = 61,
31
+ RELATION_KIND_SUBORDINATE_OF = 62,
32
+ RELATION_KIND_AFFILIATED_WITH = 63,
33
+ RELATION_KIND_ALLIED_WITH = 64,
34
+ /** RELATION_KIND_CREATED - 创造 (creation) */
35
+ RELATION_KIND_CREATED = 70,
36
+ /** RELATION_KIND_RELATED_TO - 兜底 (fallback) 上表未覆盖的自由语义用 related_to 承接 */
37
+ RELATION_KIND_RELATED_TO = 90,
38
+ UNRECOGNIZED = -1
39
+ }
40
+ export declare function relationKindFromJSON(object: any): RelationKind;
41
+ export declare function relationKindToJSON(object: RelationKind): string;
42
+ /** 关系类型分类 供 UI 分组 */
43
+ export declare enum RelationKindCategory {
44
+ RELATION_KIND_CATEGORY_UNSPECIFIED = 0,
45
+ RELATION_KIND_CATEGORY_KINSHIP = 1,
46
+ RELATION_KIND_CATEGORY_SOCIAL = 2,
47
+ RELATION_KIND_CATEGORY_MENTORSHIP = 3,
48
+ RELATION_KIND_CATEGORY_WORKPLACE = 4,
49
+ RELATION_KIND_CATEGORY_SPATIAL = 5,
50
+ RELATION_KIND_CATEGORY_ORGANIZATION = 6,
51
+ RELATION_KIND_CATEGORY_CREATION = 7,
52
+ RELATION_KIND_CATEGORY_FALLBACK = 8,
53
+ UNRECOGNIZED = -1
54
+ }
55
+ export declare function relationKindCategoryFromJSON(object: any): RelationKindCategory;
56
+ export declare function relationKindCategoryToJSON(object: RelationKindCategory): string;
57
+ /**
58
+ * 亲属称谓层次化 subtype 属性槽 供 UI 展示 "伯父/叔父" 等中文细分
59
+ * value 用 default_value + allowed_values 声明枚举 前端展示层拼接称谓 后端不做 subtype 校验
60
+ */
61
+ export interface SubtypeProp {
62
+ name: string;
63
+ default_value: string;
64
+ allowed_values: string[];
65
+ _unknownFields?: {
66
+ [key: number]: Uint8Array[];
67
+ } | undefined;
68
+ }
69
+ /**
70
+ * 关系类型元数据 前后端共享 i18n 键 分类 subtype_props
71
+ * 前端 UI (RelationKindCard) 附加装饰层 (icon labelKey descKey) 与本 metadata 通过 kind 稳定 id 关联
72
+ */
73
+ export interface RelationKindMetadata {
74
+ kind: RelationKind;
75
+ snake_case_id: string;
76
+ category: RelationKindCategory;
77
+ label_i18n_key: string;
78
+ desc_i18n_key: string;
79
+ subtype_props: SubtypeProp[];
80
+ deprecated: boolean;
81
+ _unknownFields?: {
82
+ [key: number]: Uint8Array[];
83
+ } | undefined;
84
+ }
85
+ export declare const SubtypeProp: MessageFns<SubtypeProp>;
86
+ export declare const RelationKindMetadata: MessageFns<RelationKindMetadata>;
87
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
88
+ 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 {} ? {
89
+ [K in keyof T]?: DeepPartial<T[K]>;
90
+ } : Partial<T>;
91
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
92
+ type Exact<P, I extends P> = P extends Builtin ? P : P & {
93
+ [K in keyof P]: Exact<P[K], I[K]>;
94
+ } & {
95
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
96
+ };
97
+ interface MessageFns<T> {
98
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
99
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
100
+ fromJSON(object: any): T;
101
+ toJSON(message: T): unknown;
102
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
103
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
104
+ }
105
+ export {};