@ue-shed/protocol 0.1.0-rc.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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/contracts/asset-audits/v1/texture-preview.schema.json +74 -0
  4. package/contracts/authoring/README.md +25 -0
  5. package/contracts/authoring/v1/apply-request.schema.json +568 -0
  6. package/contracts/authoring/v1/apply-result.schema.json +1165 -0
  7. package/contracts/authoring/v1/save-request.schema.json +53 -0
  8. package/contracts/authoring/v1/save-result.schema.json +77 -0
  9. package/contracts/authoring/v1/table-list.schema.json +48 -0
  10. package/contracts/authoring/v1/table-snapshot.schema.json +497 -0
  11. package/contracts/authoring/v2/table-snapshot.schema.json +950 -0
  12. package/contracts/cameras/review/v1/README.md +39 -0
  13. package/contracts/cameras/review/v1/capture-request.schema.json +92 -0
  14. package/contracts/cameras/review/v1/capture-response.schema.json +158 -0
  15. package/contracts/cameras/review/v1/fixtures/capture-failure.json +13 -0
  16. package/contracts/cameras/review/v1/fixtures/capture-legacy.json +17 -0
  17. package/contracts/cameras/review/v1/fixtures/capture-projected.json +33 -0
  18. package/contracts/cameras/review/v1/fixtures/capture-request-valid.json +21 -0
  19. package/contracts/cameras/review/v1/fixtures/capture-unprojectable.json +22 -0
  20. package/contracts/cameras/review/v1/fixtures/invalid-capture-request-bad-fov.json +21 -0
  21. package/contracts/cameras/review/v1/fixtures/invalid-capture-response-projected-without-margins.json +27 -0
  22. package/contracts/cameras/review/v1/fixtures/invalid-selection-unknown-code.json +11 -0
  23. package/contracts/cameras/review/v1/fixtures/selection-selected.json +15 -0
  24. package/contracts/cameras/review/v1/fixtures/selection-subject-not-found.json +11 -0
  25. package/contracts/cameras/review/v1/selection-response.schema.json +103 -0
  26. package/contracts/cameras/v1/README.md +33 -0
  27. package/contracts/editor-session/v1/README.md +11 -0
  28. package/contracts/editor-session/v1/command-response.schema.json +44 -0
  29. package/contracts/editor-session/v1/fixtures/command-accepted.json +6 -0
  30. package/contracts/editor-session/v1/fixtures/command-already-satisfied.json +6 -0
  31. package/contracts/editor-session/v1/fixtures/command-rejected.json +9 -0
  32. package/contracts/editor-session/v1/fixtures/state-paused.json +4 -0
  33. package/contracts/editor-session/v1/fixtures/state-running.json +4 -0
  34. package/contracts/editor-session/v1/fixtures/state-starting.json +4 -0
  35. package/contracts/editor-session/v1/fixtures/state-stopped.json +4 -0
  36. package/contracts/editor-session/v1/fixtures/state-stopping.json +4 -0
  37. package/contracts/editor-session/v1/state-response.schema.json +64 -0
  38. package/contracts/observatory/v1/README.md +78 -0
  39. package/contracts/observatory/v1/fixtures/bad-magic-then-valid.bin +0 -0
  40. package/contracts/observatory/v1/fixtures/fragmented-concat.bin +0 -0
  41. package/contracts/observatory/v1/fixtures/heartbeat.bin +0 -0
  42. package/contracts/observatory/v1/fixtures/mismatched-payload-length.bin +0 -0
  43. package/contracts/observatory/v1/fixtures/oversized-record-count.bin +0 -0
  44. package/contracts/observatory/v1/fixtures/reset.bin +0 -0
  45. package/contracts/observatory/v1/fixtures/truncated.bin +0 -0
  46. package/contracts/observatory/v1/fixtures/two-records.bin +0 -0
  47. package/contracts/observatory/v1/fixtures/unsupported-version.bin +0 -0
  48. package/dist/authoring-review.d.ts +679 -0
  49. package/dist/authoring-review.d.ts.map +1 -0
  50. package/dist/authoring-review.js +90 -0
  51. package/dist/authoring-review.js.map +1 -0
  52. package/dist/authoring.d.ts +889 -0
  53. package/dist/authoring.d.ts.map +1 -0
  54. package/dist/authoring.js +350 -0
  55. package/dist/authoring.js.map +1 -0
  56. package/dist/cameras.d.ts +184 -0
  57. package/dist/cameras.d.ts.map +1 -0
  58. package/dist/cameras.js +72 -0
  59. package/dist/cameras.js.map +1 -0
  60. package/dist/companion.d.ts +33 -0
  61. package/dist/companion.d.ts.map +1 -0
  62. package/dist/companion.js +18 -0
  63. package/dist/companion.js.map +1 -0
  64. package/dist/editor-play-session.d.ts +278 -0
  65. package/dist/editor-play-session.d.ts.map +1 -0
  66. package/dist/editor-play-session.js +56 -0
  67. package/dist/editor-play-session.js.map +1 -0
  68. package/dist/index.d.ts +146 -0
  69. package/dist/index.d.ts.map +1 -0
  70. package/dist/index.js +106 -0
  71. package/dist/index.js.map +1 -0
  72. package/package.json +45 -0
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ue-shed.dev/contracts/editor-session/v1/command-response.schema.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "contract": {
7
+ "type": "object",
8
+ "properties": {
9
+ "name": { "const": "unreal-editor-play-session" },
10
+ "version": {
11
+ "type": "object",
12
+ "properties": { "major": { "const": 1 }, "minor": { "const": 0 } },
13
+ "required": ["major", "minor"],
14
+ "additionalProperties": false
15
+ }
16
+ },
17
+ "required": ["name", "version"],
18
+ "additionalProperties": false
19
+ },
20
+ "command": { "enum": ["start_play", "start_simulate", "stop", "pause", "resume"] },
21
+ "outcome": { "enum": ["accepted", "already_satisfied", "rejected"] },
22
+ "state": { "$ref": "state-response.schema.json#/$defs/state" },
23
+ "code": { "enum": ["invalid_state", "unavailable", "unsupported"] },
24
+ "message": { "type": "string" },
25
+ "recovery": { "type": "string" }
26
+ },
27
+ "required": ["contract", "command", "outcome", "state"],
28
+ "allOf": [
29
+ {
30
+ "if": { "properties": { "outcome": { "const": "rejected" } } },
31
+ "then": { "required": ["code", "message", "recovery"] },
32
+ "else": {
33
+ "not": {
34
+ "anyOf": [
35
+ { "required": ["code"] },
36
+ { "required": ["message"] },
37
+ { "required": ["recovery"] }
38
+ ]
39
+ }
40
+ }
41
+ }
42
+ ],
43
+ "additionalProperties": false
44
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "command": "pause",
4
+ "outcome": "accepted",
5
+ "state": { "status": "paused", "mode": "play", "sessionId": "fixture-session" }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "command": "pause",
4
+ "outcome": "already_satisfied",
5
+ "state": { "status": "paused", "mode": "play", "sessionId": "fixture-session" }
6
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "command": "pause",
4
+ "outcome": "rejected",
5
+ "code": "invalid_state",
6
+ "message": "No play session is active.",
7
+ "recovery": "Start a play session, then retry pause.",
8
+ "state": { "status": "stopped" }
9
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "state": { "status": "paused", "mode": "play", "sessionId": "fixture-session" }
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "state": { "status": "running", "mode": "play", "sessionId": "fixture-session" }
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "state": { "status": "starting", "mode": "play", "sessionId": "fixture-session" }
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "state": { "status": "stopped" }
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "contract": { "name": "unreal-editor-play-session", "version": { "major": 1, "minor": 0 } },
3
+ "state": { "status": "stopping", "mode": "play", "sessionId": "fixture-session" }
4
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ue-shed.dev/contracts/editor-session/v1/state-response.schema.json",
4
+ "$ref": "#/$defs/response",
5
+ "$defs": {
6
+ "contract": {
7
+ "type": "object",
8
+ "properties": {
9
+ "name": { "const": "unreal-editor-play-session" },
10
+ "version": {
11
+ "type": "object",
12
+ "properties": { "major": { "const": 1 }, "minor": { "const": 0 } },
13
+ "required": ["major", "minor"],
14
+ "additionalProperties": false
15
+ }
16
+ },
17
+ "required": ["name", "version"],
18
+ "additionalProperties": false
19
+ },
20
+ "active": {
21
+ "type": "object",
22
+ "properties": {
23
+ "mode": { "enum": ["play", "simulate"] },
24
+ "sessionId": { "type": "string", "minLength": 1 }
25
+ },
26
+ "required": ["mode", "sessionId"]
27
+ },
28
+ "state": {
29
+ "oneOf": [
30
+ {
31
+ "type": "object",
32
+ "properties": { "status": { "const": "stopped" } },
33
+ "required": ["status"],
34
+ "additionalProperties": false
35
+ },
36
+ {
37
+ "allOf": [
38
+ { "$ref": "#/$defs/active" },
39
+ {
40
+ "type": "object",
41
+ "properties": {
42
+ "status": {
43
+ "enum": ["starting", "running", "paused", "stopping"]
44
+ }
45
+ },
46
+ "required": ["status"],
47
+ "additionalProperties": true
48
+ }
49
+ ],
50
+ "unevaluatedProperties": false
51
+ }
52
+ ]
53
+ },
54
+ "response": {
55
+ "type": "object",
56
+ "properties": {
57
+ "contract": { "$ref": "#/$defs/contract" },
58
+ "state": { "$ref": "#/$defs/state" }
59
+ },
60
+ "required": ["contract", "state"],
61
+ "additionalProperties": false
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,78 @@
1
+ # Observatory actor-transform stream contract v1
2
+
3
+ The live path is a byte stream of fixed-size 96-byte little-endian headers followed immediately by
4
+ zero or more 48-byte transform records. Receivers must resynchronize on the ASCII magic `USOT`,
5
+ reject unsupported versions and lengths, and cap allocations before reading payloads. A reconnect
6
+ or catalog invalidation starts a new session/revision; records that do not match the retained
7
+ catalog must not be applied.
8
+
9
+ Header:
10
+
11
+ | Offset | Type | Field |
12
+ | -----: | ------- | --------------------------------------------------------- |
13
+ | 0 | char[4] | `USOT` magic |
14
+ | 4 | u16 | version, `1` |
15
+ | 6 | u16 | header length, `96` |
16
+ | 8 | u16 | record length, `48` |
17
+ | 10 | u16 | flags; bit 0 is reset/catalog-invalidated |
18
+ | 12 | u32 | record count, at most 16,384 |
19
+ | 16 | u32 | payload length, exactly `recordCount * 48` |
20
+ | 20 | u32 | reserved, zero |
21
+ | 24 | u64 | session-local packet sequence |
22
+ | 32 | f64 | Unreal world seconds at sampling |
23
+ | 40 | f64 | producer monotonic milliseconds at sampling |
24
+ | 48 | u8[16] | observation session ID |
25
+ | 64 | u64 | catalog revision |
26
+ | 72 | u32 | actors sampled |
27
+ | 76 | u32 | actors changed in this packet |
28
+ | 80 | u32 | cumulative producer replacements |
29
+ | 84 | u32 | sampling duration in microseconds, saturated at `u32` max |
30
+ | 88 | u64 | reserved, zero |
31
+
32
+ Record:
33
+
34
+ | Offset | Type | Field |
35
+ | -----: | ---- | ----------------------------------------- |
36
+ | 0 | u32 | stream-local actor index from the catalog |
37
+ | 4 | u32 | flags; reserved and zero in v1 |
38
+ | 8 | f64 | world X |
39
+ | 16 | f64 | world Y |
40
+ | 24 | f64 | world Z |
41
+ | 32 | f32 | roll degrees |
42
+ | 36 | f32 | pitch degrees |
43
+ | 40 | f32 | yaw degrees |
44
+ | 44 | u32 | reserved, zero |
45
+
46
+ ## Limits
47
+
48
+ - Record count ≤ 16,384
49
+ - Header length = 96 bytes
50
+ - Record length = 48 bytes
51
+ - Payload length = `recordCount * 48` ≤ 786,432 bytes
52
+ - Host incremental decoders must bound undecoded buffered bytes (TypeScript decoder default:
53
+ one max packet plus 64 KiB slack). Excess input is discarded and counted as malformed before the
54
+ decoder resumes seeking magic.
55
+
56
+ ## Semantics
57
+
58
+ - Little-endian only.
59
+ - An empty non-reset packet (`recordCount = 0`, flag bit 0 clear) is a heartbeat/health sample.
60
+ - A reset packet (flag bit 0 set) invalidates its catalog revision. Hosts retain the last visible
61
+ sample as stale, reacquire a complete catalog over Remote Control, then resume. Never apply a
62
+ record whose session ID, revision, or actor index does not match the retained catalog.
63
+ - Sequence is session-local and monotonic for applied packets. Gaps are expected under
64
+ latest-state-wins delivery and must be observable; they are not a decode error.
65
+ - A producer that replaces an unsent sparse packet must carry its changed indices forward until a
66
+ packet containing them has been delivered to the transport. Replacing one independent delta with
67
+ another would lose state and does not satisfy latest-state-wins semantics.
68
+ - Stream-local actor indices are compact aliases for one catalog revision only. They are never
69
+ durable actor identity and must not be persisted into Review Sets.
70
+ - This binary stream is a local data plane. It never carries durable Map Review evidence. Remote
71
+ Control remains the low-rate control plane for catalog negotiation, focus, and status.
72
+
73
+ ## Fixtures
74
+
75
+ Binary fixtures under `fixtures/` cover valid two-record packets, fragmented concatenation,
76
+ heartbeat, reset, bad-magic resynchronization, unsupported version, oversized record count/payload,
77
+ mismatched payload length, and truncated input. Prefer regenerating them with the TypeScript
78
+ encoder in `@ue-shed/observatory` rather than editing offsets by hand.