reactor-effect-client 0.0.0-reserved.0 → 0.2.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 +201 -0
- package/NOTICE +29 -0
- package/README.md +124 -2
- package/dist/FetchHttp.d.ts +9 -0
- package/dist/FetchHttp.d.ts.map +1 -0
- package/dist/FetchHttp.js +63 -0
- package/dist/FetchHttp.js.map +1 -0
- package/dist/PeerFactory.d.ts +15 -0
- package/dist/PeerFactory.d.ts.map +1 -0
- package/dist/PeerFactory.js +4 -0
- package/dist/PeerFactory.js.map +1 -0
- package/dist/PeerTypes.d.ts +64 -0
- package/dist/PeerTypes.d.ts.map +1 -0
- package/dist/PeerTypes.js +2 -0
- package/dist/PeerTypes.js.map +1 -0
- package/dist/Sequence.d.ts +81 -0
- package/dist/Sequence.d.ts.map +1 -0
- package/dist/Sequence.js +215 -0
- package/dist/Sequence.js.map +1 -0
- package/dist/SessionTypes.d.ts +164 -0
- package/dist/SessionTypes.d.ts.map +1 -0
- package/dist/SessionTypes.js +2 -0
- package/dist/SessionTypes.js.map +1 -0
- package/dist/Submission.d.ts +42 -0
- package/dist/Submission.d.ts.map +1 -0
- package/dist/Submission.js +52 -0
- package/dist/Submission.js.map +1 -0
- package/dist/bytes.d.ts +6 -0
- package/dist/bytes.d.ts.map +1 -0
- package/dist/bytes.js +32 -0
- package/dist/bytes.js.map +1 -0
- package/dist/contract.d.ts +58 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +87 -0
- package/dist/contract.js.map +1 -0
- package/dist/coordinator/_internal/client.d.ts +127 -0
- package/dist/coordinator/_internal/client.d.ts.map +1 -0
- package/dist/coordinator/_internal/client.js +450 -0
- package/dist/coordinator/_internal/client.js.map +1 -0
- package/dist/coordinator/_internal/response.d.ts +15 -0
- package/dist/coordinator/_internal/response.d.ts.map +1 -0
- package/dist/coordinator/_internal/response.js +57 -0
- package/dist/coordinator/_internal/response.js.map +1 -0
- package/dist/coordinator/_internal/schemas.d.ts +51 -0
- package/dist/coordinator/_internal/schemas.d.ts.map +1 -0
- package/dist/coordinator/_internal/schemas.js +170 -0
- package/dist/coordinator/_internal/schemas.js.map +1 -0
- package/dist/coordinator/index.d.ts +28 -0
- package/dist/coordinator/index.d.ts.map +1 -0
- package/dist/coordinator/index.js +25 -0
- package/dist/coordinator/index.js.map +1 -0
- package/dist/correlation.d.ts +32 -0
- package/dist/correlation.d.ts.map +1 -0
- package/dist/correlation.js +113 -0
- package/dist/correlation.js.map +1 -0
- package/dist/errors.d.ts +88 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +93 -0
- package/dist/errors.js.map +1 -0
- package/dist/h3/_internal/client.d.ts +9 -0
- package/dist/h3/_internal/client.d.ts.map +1 -0
- package/dist/h3/_internal/client.js +510 -0
- package/dist/h3/_internal/client.js.map +1 -0
- package/dist/h3/_internal/contracts.d.ts +123 -0
- package/dist/h3/_internal/contracts.d.ts.map +1 -0
- package/dist/h3/_internal/contracts.js +113 -0
- package/dist/h3/_internal/contracts.js.map +1 -0
- package/dist/h3/_internal/deployment.d.ts +8 -0
- package/dist/h3/_internal/deployment.d.ts.map +1 -0
- package/dist/h3/_internal/deployment.js +132 -0
- package/dist/h3/_internal/deployment.js.map +1 -0
- package/dist/h3/_internal/evidence.d.ts +17 -0
- package/dist/h3/_internal/evidence.d.ts.map +1 -0
- package/dist/h3/_internal/evidence.js +48 -0
- package/dist/h3/_internal/evidence.js.map +1 -0
- package/dist/h3/_internal/references.d.ts +18 -0
- package/dist/h3/_internal/references.d.ts.map +1 -0
- package/dist/h3/_internal/references.js +186 -0
- package/dist/h3/_internal/references.js.map +1 -0
- package/dist/h3/_internal/request.d.ts +16 -0
- package/dist/h3/_internal/request.d.ts.map +1 -0
- package/dist/h3/_internal/request.js +79 -0
- package/dist/h3/_internal/request.js.map +1 -0
- package/dist/h3/_internal/state.d.ts +30 -0
- package/dist/h3/_internal/state.d.ts.map +1 -0
- package/dist/h3/_internal/state.js +243 -0
- package/dist/h3/_internal/state.js.map +1 -0
- package/dist/h3/index.d.ts +10 -0
- package/dist/h3/index.d.ts.map +1 -0
- package/dist/h3/index.js +7 -0
- package/dist/h3/index.js.map +1 -0
- package/dist/h3/messages.d.ts +310 -0
- package/dist/h3/messages.d.ts.map +1 -0
- package/dist/h3/messages.js +114 -0
- package/dist/h3/messages.js.map +1 -0
- package/dist/h3/profile.d.ts +109 -0
- package/dist/h3/profile.d.ts.map +1 -0
- package/dist/h3/profile.js +70 -0
- package/dist/h3/profile.js.map +1 -0
- package/dist/h3/types.d.ts +173 -0
- package/dist/h3/types.d.ts.map +1 -0
- package/dist/h3/types.js +2 -0
- package/dist/h3/types.js.map +1 -0
- package/dist/host.d.ts +25 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +20 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +123 -0
- package/dist/json.js.map +1 -0
- package/dist/media-stream.d.ts +10 -0
- package/dist/media-stream.d.ts.map +1 -0
- package/dist/media-stream.js +20 -0
- package/dist/media-stream.js.map +1 -0
- package/dist/observation.d.ts +26 -0
- package/dist/observation.d.ts.map +1 -0
- package/dist/observation.js +106 -0
- package/dist/observation.js.map +1 -0
- package/dist/orchestration/h3-source.d.ts +30 -0
- package/dist/orchestration/h3-source.d.ts.map +1 -0
- package/dist/orchestration/h3-source.js +303 -0
- package/dist/orchestration/h3-source.js.map +1 -0
- package/dist/orchestration/index.d.ts +12 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +9 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/media-buffer.d.ts +23 -0
- package/dist/orchestration/media-buffer.d.ts.map +1 -0
- package/dist/orchestration/media-buffer.js +73 -0
- package/dist/orchestration/media-buffer.js.map +1 -0
- package/dist/orchestration/queries.d.ts +10 -0
- package/dist/orchestration/queries.d.ts.map +1 -0
- package/dist/orchestration/queries.js +40 -0
- package/dist/orchestration/queries.js.map +1 -0
- package/dist/orchestration/references.d.ts +16 -0
- package/dist/orchestration/references.d.ts.map +1 -0
- package/dist/orchestration/references.js +76 -0
- package/dist/orchestration/references.js.map +1 -0
- package/dist/orchestration/renewal-state.d.ts +58 -0
- package/dist/orchestration/renewal-state.d.ts.map +1 -0
- package/dist/orchestration/renewal-state.js +60 -0
- package/dist/orchestration/renewal-state.js.map +1 -0
- package/dist/orchestration/renewal.d.ts +76 -0
- package/dist/orchestration/renewal.d.ts.map +1 -0
- package/dist/orchestration/renewal.js +633 -0
- package/dist/orchestration/renewal.js.map +1 -0
- package/dist/orchestration/request.d.ts +53 -0
- package/dist/orchestration/request.d.ts.map +1 -0
- package/dist/orchestration/request.js +122 -0
- package/dist/orchestration/request.js.map +1 -0
- package/dist/orchestration/routing.d.ts +21 -0
- package/dist/orchestration/routing.d.ts.map +1 -0
- package/dist/orchestration/routing.js +90 -0
- package/dist/orchestration/routing.js.map +1 -0
- package/dist/orchestration/source-slot.d.ts +99 -0
- package/dist/orchestration/source-slot.d.ts.map +1 -0
- package/dist/orchestration/source-slot.js +206 -0
- package/dist/orchestration/source-slot.js.map +1 -0
- package/dist/orchestration/types.d.ts +334 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +11 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/protobuf.d.ts +63 -0
- package/dist/protobuf.d.ts.map +1 -0
- package/dist/protobuf.js +252 -0
- package/dist/protobuf.js.map +1 -0
- package/dist/session/_internal/acquire.d.ts +23 -0
- package/dist/session/_internal/acquire.d.ts.map +1 -0
- package/dist/session/_internal/acquire.js +167 -0
- package/dist/session/_internal/acquire.js.map +1 -0
- package/dist/session/_internal/cleanup.d.ts +18 -0
- package/dist/session/_internal/cleanup.d.ts.map +1 -0
- package/dist/session/_internal/cleanup.js +94 -0
- package/dist/session/_internal/cleanup.js.map +1 -0
- package/dist/session/_internal/lifecycle.d.ts +62 -0
- package/dist/session/_internal/lifecycle.d.ts.map +1 -0
- package/dist/session/_internal/lifecycle.js +132 -0
- package/dist/session/_internal/lifecycle.js.map +1 -0
- package/dist/session/_internal/remote.d.ts +28 -0
- package/dist/session/_internal/remote.d.ts.map +1 -0
- package/dist/session/_internal/remote.js +61 -0
- package/dist/session/_internal/remote.js.map +1 -0
- package/dist/session/_internal/uploads.d.ts +4 -0
- package/dist/session/_internal/uploads.d.ts.map +1 -0
- package/dist/session/_internal/uploads.js +33 -0
- package/dist/session/_internal/uploads.js.map +1 -0
- package/dist/session/commands.d.ts +22 -0
- package/dist/session/commands.d.ts.map +1 -0
- package/dist/session/commands.js +13 -0
- package/dist/session/commands.js.map +1 -0
- package/dist/session/files.d.ts +15 -0
- package/dist/session/files.d.ts.map +1 -0
- package/dist/session/files.js +54 -0
- package/dist/session/files.js.map +1 -0
- package/dist/session/index.d.ts +76 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +16 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/media.d.ts +67 -0
- package/dist/session/media.d.ts.map +1 -0
- package/dist/session/media.js +2 -0
- package/dist/session/media.js.map +1 -0
- package/dist/session.d.ts +104 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +872 -0
- package/dist/session.js.map +1 -0
- package/dist/simulation/_internal/source.d.ts +12 -0
- package/dist/simulation/_internal/source.d.ts.map +1 -0
- package/dist/simulation/_internal/source.js +477 -0
- package/dist/simulation/_internal/source.js.map +1 -0
- package/dist/simulation/index.d.ts +14 -0
- package/dist/simulation/index.d.ts.map +1 -0
- package/dist/simulation/index.js +13 -0
- package/dist/simulation/index.js.map +1 -0
- package/dist/simulation/types.d.ts +29 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +2 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/stats.d.ts +33 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +134 -0
- package/dist/stats.js.map +1 -0
- package/dist/testing/Faults.d.ts +4 -0
- package/dist/testing/Faults.d.ts.map +1 -0
- package/dist/testing/Faults.js +7 -0
- package/dist/testing/Faults.js.map +1 -0
- package/dist/testing/Png.d.ts +3 -0
- package/dist/testing/Png.d.ts.map +1 -0
- package/dist/testing/Png.js +68 -0
- package/dist/testing/Png.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/wire.d.ts +7 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.generated.d.ts +305 -0
- package/dist/wire.generated.d.ts.map +1 -0
- package/dist/wire.generated.js +1257 -0
- package/dist/wire.generated.js.map +1 -0
- package/dist/wire.js +5 -0
- package/dist/wire.js.map +1 -0
- package/notices/effect-LICENSE +21 -0
- package/notices/google-protobuf-LICENSE +32 -0
- package/notices/owned-webrtc/Effect-MIT.txt +21 -0
- package/notices/owned-webrtc/IETF.txt +43 -0
- package/notices/owned-webrtc/LICENSE +21 -0
- package/notices/owned-webrtc/UPSTREAM.md +20 -0
- package/notices/owned-webrtc/VP8-ADAPTATION.md +32 -0
- package/notices/owned-webrtc/VP8-AUTHORS.txt +42 -0
- package/notices/owned-webrtc/VP8-LICENSE.txt +25 -0
- package/notices/owned-webrtc/VP8-PATENTS.txt +21 -0
- package/notices/owned-webrtc/Werift-MIT.txt +21 -0
- package/notices/owned-webrtc/libvpx-v1.12.0-LICENSE.txt +28 -0
- package/notices/owned-webrtc/libvpx-v1.12.0-PATENTS.txt +22 -0
- package/notices/owned-webrtc/rfc3711.txt +3139 -0
- package/notices/owned-webrtc/str0m-MIT.txt +7 -0
- package/notices/owned-webrtc-LICENSE +21 -0
- package/notices/reactor-runtime-LICENSE +201 -0
- package/notices/reactor-runtime-NOTICE +5 -0
- package/notices/reactor-sdk-LICENSE +201 -0
- package/package.json +62 -4
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import type { JsonObject } from "../json.js";
|
|
3
|
+
/** Required fields follow the H3 Reference Turbo Realtime 0.5.5 documentation. */
|
|
4
|
+
export declare const Clip: Schema.Struct<{
|
|
5
|
+
readonly clip_id: Schema.String;
|
|
6
|
+
readonly prompt: Schema.String;
|
|
7
|
+
readonly metadata: Schema.String;
|
|
8
|
+
readonly frames: Schema.Number;
|
|
9
|
+
readonly seconds: Schema.Number;
|
|
10
|
+
readonly seed: Schema.Number;
|
|
11
|
+
readonly ready: Schema.Boolean;
|
|
12
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
13
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
14
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
15
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
16
|
+
}>;
|
|
17
|
+
export type Clip = typeof Clip.Type;
|
|
18
|
+
export declare const Queue: Schema.Struct<{
|
|
19
|
+
readonly generation: Schema.$Array<Schema.Struct<{
|
|
20
|
+
readonly clip_id: Schema.String;
|
|
21
|
+
readonly prompt: Schema.String;
|
|
22
|
+
readonly metadata: Schema.String;
|
|
23
|
+
readonly frames: Schema.Number;
|
|
24
|
+
readonly seconds: Schema.Number;
|
|
25
|
+
readonly seed: Schema.Number;
|
|
26
|
+
readonly ready: Schema.Boolean;
|
|
27
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
28
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
29
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
30
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
31
|
+
}>>;
|
|
32
|
+
readonly playout: Schema.$Array<Schema.Struct<{
|
|
33
|
+
readonly clip_id: Schema.String;
|
|
34
|
+
readonly prompt: Schema.String;
|
|
35
|
+
readonly metadata: Schema.String;
|
|
36
|
+
readonly frames: Schema.Number;
|
|
37
|
+
readonly seconds: Schema.Number;
|
|
38
|
+
readonly seed: Schema.Number;
|
|
39
|
+
readonly ready: Schema.Boolean;
|
|
40
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
41
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
42
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
43
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly history: Schema.$Array<Schema.Struct<{
|
|
46
|
+
readonly clip_id: Schema.String;
|
|
47
|
+
readonly prompt: Schema.String;
|
|
48
|
+
readonly metadata: Schema.String;
|
|
49
|
+
readonly frames: Schema.Number;
|
|
50
|
+
readonly seconds: Schema.Number;
|
|
51
|
+
readonly seed: Schema.Number;
|
|
52
|
+
readonly ready: Schema.Boolean;
|
|
53
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
54
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
55
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
56
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
57
|
+
}>>;
|
|
58
|
+
}>;
|
|
59
|
+
export type Queue = typeof Queue.Type;
|
|
60
|
+
export declare const State: Schema.Struct<{
|
|
61
|
+
readonly clip_seconds: Schema.Number;
|
|
62
|
+
readonly clip_seconds_min: Schema.Number;
|
|
63
|
+
readonly clip_seconds_max: Schema.Number;
|
|
64
|
+
readonly seed: Schema.Number;
|
|
65
|
+
readonly autoplay: Schema.Boolean;
|
|
66
|
+
readonly flush_on_clip_end: Schema.Boolean;
|
|
67
|
+
readonly aspect: Schema.String;
|
|
68
|
+
readonly width: Schema.Number;
|
|
69
|
+
readonly height: Schema.Number;
|
|
70
|
+
readonly playing: Schema.Boolean;
|
|
71
|
+
readonly playing_clip_id: Schema.NullOr<Schema.String>;
|
|
72
|
+
readonly generation_queued: Schema.Number;
|
|
73
|
+
readonly generation_capacity: Schema.Number;
|
|
74
|
+
readonly playout_queued: Schema.Number;
|
|
75
|
+
readonly playout_capacity: Schema.Number;
|
|
76
|
+
readonly clips_played: Schema.Number;
|
|
77
|
+
readonly seconds_sent: Schema.Number;
|
|
78
|
+
readonly valid_commands: Schema.$Array<Schema.String>;
|
|
79
|
+
}>;
|
|
80
|
+
export type State = typeof State.Type;
|
|
81
|
+
export declare const Payloads: {
|
|
82
|
+
readonly clip_queued: Schema.Struct<{
|
|
83
|
+
readonly clip: Schema.Struct<{
|
|
84
|
+
readonly clip_id: Schema.String;
|
|
85
|
+
readonly prompt: Schema.String;
|
|
86
|
+
readonly metadata: Schema.String;
|
|
87
|
+
readonly frames: Schema.Number;
|
|
88
|
+
readonly seconds: Schema.Number;
|
|
89
|
+
readonly seed: Schema.Number;
|
|
90
|
+
readonly ready: Schema.Boolean;
|
|
91
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
92
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
93
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
94
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
95
|
+
}>;
|
|
96
|
+
}>;
|
|
97
|
+
readonly clip_moved: Schema.Struct<{
|
|
98
|
+
readonly clip: Schema.Struct<{
|
|
99
|
+
readonly clip_id: Schema.String;
|
|
100
|
+
readonly prompt: Schema.String;
|
|
101
|
+
readonly metadata: Schema.String;
|
|
102
|
+
readonly frames: Schema.Number;
|
|
103
|
+
readonly seconds: Schema.Number;
|
|
104
|
+
readonly seed: Schema.Number;
|
|
105
|
+
readonly ready: Schema.Boolean;
|
|
106
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
107
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
108
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
109
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
110
|
+
}>;
|
|
111
|
+
readonly queue: Schema.Literals<readonly ["generation", "playout"]>;
|
|
112
|
+
readonly position: Schema.Number;
|
|
113
|
+
}>;
|
|
114
|
+
readonly clip_popped: Schema.Struct<{
|
|
115
|
+
readonly clip: Schema.Struct<{
|
|
116
|
+
readonly clip_id: Schema.String;
|
|
117
|
+
readonly prompt: Schema.String;
|
|
118
|
+
readonly metadata: Schema.String;
|
|
119
|
+
readonly frames: Schema.Number;
|
|
120
|
+
readonly seconds: Schema.Number;
|
|
121
|
+
readonly seed: Schema.Number;
|
|
122
|
+
readonly ready: Schema.Boolean;
|
|
123
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
124
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
125
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
126
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
127
|
+
}>;
|
|
128
|
+
}>;
|
|
129
|
+
readonly clip_generated: Schema.Struct<{
|
|
130
|
+
readonly clip: Schema.Struct<{
|
|
131
|
+
readonly clip_id: Schema.String;
|
|
132
|
+
readonly prompt: Schema.String;
|
|
133
|
+
readonly metadata: Schema.String;
|
|
134
|
+
readonly frames: Schema.Number;
|
|
135
|
+
readonly seconds: Schema.Number;
|
|
136
|
+
readonly seed: Schema.Number;
|
|
137
|
+
readonly ready: Schema.Boolean;
|
|
138
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
139
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
140
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
141
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
142
|
+
}>;
|
|
143
|
+
}>;
|
|
144
|
+
readonly clip_failed: Schema.Struct<{
|
|
145
|
+
readonly clip: Schema.Struct<{
|
|
146
|
+
readonly clip_id: Schema.String;
|
|
147
|
+
readonly prompt: Schema.String;
|
|
148
|
+
readonly metadata: Schema.String;
|
|
149
|
+
readonly frames: Schema.Number;
|
|
150
|
+
readonly seconds: Schema.Number;
|
|
151
|
+
readonly seed: Schema.Number;
|
|
152
|
+
readonly ready: Schema.Boolean;
|
|
153
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
154
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
155
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
156
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
157
|
+
}>;
|
|
158
|
+
readonly reason: Schema.String;
|
|
159
|
+
}>;
|
|
160
|
+
readonly clip_started: Schema.Struct<{
|
|
161
|
+
readonly clip: Schema.Struct<{
|
|
162
|
+
readonly clip_id: Schema.String;
|
|
163
|
+
readonly prompt: Schema.String;
|
|
164
|
+
readonly metadata: Schema.String;
|
|
165
|
+
readonly frames: Schema.Number;
|
|
166
|
+
readonly seconds: Schema.Number;
|
|
167
|
+
readonly seed: Schema.Number;
|
|
168
|
+
readonly ready: Schema.Boolean;
|
|
169
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
170
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
171
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
172
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
173
|
+
}>;
|
|
174
|
+
}>;
|
|
175
|
+
readonly clip_finished: Schema.Struct<{
|
|
176
|
+
readonly clip: Schema.Struct<{
|
|
177
|
+
readonly clip_id: Schema.String;
|
|
178
|
+
readonly prompt: Schema.String;
|
|
179
|
+
readonly metadata: Schema.String;
|
|
180
|
+
readonly frames: Schema.Number;
|
|
181
|
+
readonly seconds: Schema.Number;
|
|
182
|
+
readonly seed: Schema.Number;
|
|
183
|
+
readonly ready: Schema.Boolean;
|
|
184
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
185
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
186
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
187
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
188
|
+
}>;
|
|
189
|
+
readonly seconds_sent: Schema.Number;
|
|
190
|
+
}>;
|
|
191
|
+
readonly clip_stopped: Schema.Struct<{
|
|
192
|
+
readonly clip: Schema.Struct<{
|
|
193
|
+
readonly clip_id: Schema.String;
|
|
194
|
+
readonly prompt: Schema.String;
|
|
195
|
+
readonly metadata: Schema.String;
|
|
196
|
+
readonly frames: Schema.Number;
|
|
197
|
+
readonly seconds: Schema.Number;
|
|
198
|
+
readonly seed: Schema.Number;
|
|
199
|
+
readonly ready: Schema.Boolean;
|
|
200
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
201
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
202
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
203
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
204
|
+
}>;
|
|
205
|
+
readonly seconds_sent: Schema.Number;
|
|
206
|
+
}>;
|
|
207
|
+
readonly queue_update: Schema.Struct<{
|
|
208
|
+
readonly generation: Schema.$Array<Schema.Struct<{
|
|
209
|
+
readonly clip_id: Schema.String;
|
|
210
|
+
readonly prompt: Schema.String;
|
|
211
|
+
readonly metadata: Schema.String;
|
|
212
|
+
readonly frames: Schema.Number;
|
|
213
|
+
readonly seconds: Schema.Number;
|
|
214
|
+
readonly seed: Schema.Number;
|
|
215
|
+
readonly ready: Schema.Boolean;
|
|
216
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
217
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
218
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
219
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
220
|
+
}>>;
|
|
221
|
+
readonly playout: Schema.$Array<Schema.Struct<{
|
|
222
|
+
readonly clip_id: Schema.String;
|
|
223
|
+
readonly prompt: Schema.String;
|
|
224
|
+
readonly metadata: Schema.String;
|
|
225
|
+
readonly frames: Schema.Number;
|
|
226
|
+
readonly seconds: Schema.Number;
|
|
227
|
+
readonly seed: Schema.Number;
|
|
228
|
+
readonly ready: Schema.Boolean;
|
|
229
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
230
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
231
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
232
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
233
|
+
}>>;
|
|
234
|
+
readonly history: Schema.$Array<Schema.Struct<{
|
|
235
|
+
readonly clip_id: Schema.String;
|
|
236
|
+
readonly prompt: Schema.String;
|
|
237
|
+
readonly metadata: Schema.String;
|
|
238
|
+
readonly frames: Schema.Number;
|
|
239
|
+
readonly seconds: Schema.Number;
|
|
240
|
+
readonly seed: Schema.Number;
|
|
241
|
+
readonly ready: Schema.Boolean;
|
|
242
|
+
readonly has_reference_image: Schema.optionalKey<Schema.Boolean>;
|
|
243
|
+
readonly reference_image_count: Schema.optionalKey<Schema.Number>;
|
|
244
|
+
readonly has_reference_audio: Schema.optionalKey<Schema.Boolean>;
|
|
245
|
+
readonly reference_audio_count: Schema.optionalKey<Schema.Number>;
|
|
246
|
+
}>>;
|
|
247
|
+
}>;
|
|
248
|
+
readonly state_update: Schema.Struct<{
|
|
249
|
+
readonly clip_seconds: Schema.Number;
|
|
250
|
+
readonly clip_seconds_min: Schema.Number;
|
|
251
|
+
readonly clip_seconds_max: Schema.Number;
|
|
252
|
+
readonly seed: Schema.Number;
|
|
253
|
+
readonly autoplay: Schema.Boolean;
|
|
254
|
+
readonly flush_on_clip_end: Schema.Boolean;
|
|
255
|
+
readonly aspect: Schema.String;
|
|
256
|
+
readonly width: Schema.Number;
|
|
257
|
+
readonly height: Schema.Number;
|
|
258
|
+
readonly playing: Schema.Boolean;
|
|
259
|
+
readonly playing_clip_id: Schema.NullOr<Schema.String>;
|
|
260
|
+
readonly generation_queued: Schema.Number;
|
|
261
|
+
readonly generation_capacity: Schema.Number;
|
|
262
|
+
readonly playout_queued: Schema.Number;
|
|
263
|
+
readonly playout_capacity: Schema.Number;
|
|
264
|
+
readonly clips_played: Schema.Number;
|
|
265
|
+
readonly seconds_sent: Schema.Number;
|
|
266
|
+
readonly valid_commands: Schema.$Array<Schema.String>;
|
|
267
|
+
}>;
|
|
268
|
+
readonly command_error: Schema.Struct<{
|
|
269
|
+
readonly command: Schema.String;
|
|
270
|
+
readonly reason: Schema.String;
|
|
271
|
+
}>;
|
|
272
|
+
readonly seed_accepted: Schema.Struct<{
|
|
273
|
+
readonly seed: Schema.Number;
|
|
274
|
+
}>;
|
|
275
|
+
readonly clip_length_accepted: Schema.Struct<{
|
|
276
|
+
readonly clip_seconds: Schema.Number;
|
|
277
|
+
readonly frames: Schema.Number;
|
|
278
|
+
}>;
|
|
279
|
+
readonly canvas_accepted: Schema.Struct<{
|
|
280
|
+
readonly aspect: Schema.String;
|
|
281
|
+
readonly width: Schema.Number;
|
|
282
|
+
readonly height: Schema.Number;
|
|
283
|
+
}>;
|
|
284
|
+
readonly autoplay_accepted: Schema.Struct<{
|
|
285
|
+
readonly enabled: Schema.Boolean;
|
|
286
|
+
}>;
|
|
287
|
+
readonly flush_accepted: Schema.Struct<{
|
|
288
|
+
readonly enabled: Schema.Boolean;
|
|
289
|
+
}>;
|
|
290
|
+
readonly session_reset: Schema.Struct<{
|
|
291
|
+
readonly cleared_clips: Schema.Number;
|
|
292
|
+
readonly was_playing: Schema.Boolean;
|
|
293
|
+
}>;
|
|
294
|
+
};
|
|
295
|
+
export type MessageType = keyof typeof Payloads;
|
|
296
|
+
export type Payload<K extends MessageType> = (typeof Payloads)[K]["Type"];
|
|
297
|
+
export type Message = {
|
|
298
|
+
[K in MessageType]: {
|
|
299
|
+
readonly type: K;
|
|
300
|
+
readonly data: Payload<K>;
|
|
301
|
+
};
|
|
302
|
+
}[MessageType];
|
|
303
|
+
export type DecodedMessage = Message | {
|
|
304
|
+
readonly type: "unknown";
|
|
305
|
+
readonly name: string;
|
|
306
|
+
readonly data: JsonObject | undefined;
|
|
307
|
+
};
|
|
308
|
+
/** Unknown events remain observable. A known message never accepts a partial payload. */
|
|
309
|
+
export declare const decodeMessage: (type: string, input: unknown) => DecodedMessage;
|
|
310
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/h3/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAW7C,kFAAkF;AAClF,eAAO,MAAM,IAAI;;;;;;;;;;;;EAYf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC;AAEpC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAEtC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;EAmBhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAEtC,eAAO,MAAM,QAAQ;aACnB,WAAW;;;;;;;;;;;;;;;aACX,UAAU;;;;;;;;;;;;;;;;;aAKV,WAAW;;;;;;;;;;;;;;;aACX,cAAc;;;;;;;;;;;;;;;aACd,WAAW;;;;;;;;;;;;;;;;aACX,YAAY;;;;;;;;;;;;;;;aACZ,aAAa;;;;;;;;;;;;;;;;aACb,YAAY;;;;;;;;;;;;;;;;aACZ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aACZ,YAAY;;;;;;;;;;;;;;;;;;;;aACZ,aAAa;;;;aACb,aAAa;;;aACb,oBAAoB;;;;aACpB,eAAe;;;;;aACf,iBAAiB;;;aACjB,cAAc;;;aACd,aAAa;;;;CACL,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAC;AAChD,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,OAAO,GAAG;KACnB,CAAC,IAAI,WAAW,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE;CACpE,CAAC,WAAW,CAAC,CAAC;AACf,MAAM,MAAM,cAAc,GACtB,OAAO,GACP;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAU/F,yFAAyF;AACzF,eAAO,MAAM,aAAa,SAAU,MAAM,SAAS,OAAO,KAAG,cAuC5D,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { ReactorError } from "../errors.js";
|
|
3
|
+
import { jsonObject } from "../json.js";
|
|
4
|
+
const NumberValue = Schema.Number.check(Schema.isFinite());
|
|
5
|
+
const Integer = NumberValue.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
6
|
+
const Positive = Integer.check(Schema.isGreaterThan(0));
|
|
7
|
+
const Id = Schema.String.check(Schema.isUUID());
|
|
8
|
+
/** Required fields follow the H3 Reference Turbo Realtime 0.5.5 documentation. */
|
|
9
|
+
export const Clip = Schema.Struct({
|
|
10
|
+
clip_id: Id,
|
|
11
|
+
prompt: Schema.String,
|
|
12
|
+
metadata: Schema.String,
|
|
13
|
+
frames: Positive,
|
|
14
|
+
seconds: NumberValue.check(Schema.isGreaterThan(0)),
|
|
15
|
+
seed: Integer,
|
|
16
|
+
ready: Schema.Boolean,
|
|
17
|
+
has_reference_image: Schema.optionalKey(Schema.Boolean),
|
|
18
|
+
reference_image_count: Schema.optionalKey(Integer),
|
|
19
|
+
has_reference_audio: Schema.optionalKey(Schema.Boolean),
|
|
20
|
+
reference_audio_count: Schema.optionalKey(Integer),
|
|
21
|
+
});
|
|
22
|
+
export const Queue = Schema.Struct({
|
|
23
|
+
generation: Schema.Array(Clip),
|
|
24
|
+
playout: Schema.Array(Clip),
|
|
25
|
+
history: Schema.Array(Clip),
|
|
26
|
+
});
|
|
27
|
+
export const State = Schema.Struct({
|
|
28
|
+
clip_seconds: NumberValue,
|
|
29
|
+
clip_seconds_min: NumberValue,
|
|
30
|
+
clip_seconds_max: NumberValue,
|
|
31
|
+
seed: Integer,
|
|
32
|
+
autoplay: Schema.Boolean,
|
|
33
|
+
flush_on_clip_end: Schema.Boolean,
|
|
34
|
+
aspect: Schema.String,
|
|
35
|
+
width: Positive,
|
|
36
|
+
height: Positive,
|
|
37
|
+
playing: Schema.Boolean,
|
|
38
|
+
playing_clip_id: Schema.NullOr(Id),
|
|
39
|
+
generation_queued: Integer,
|
|
40
|
+
generation_capacity: Positive,
|
|
41
|
+
playout_queued: Integer,
|
|
42
|
+
playout_capacity: Positive,
|
|
43
|
+
clips_played: Integer,
|
|
44
|
+
seconds_sent: NumberValue.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
45
|
+
valid_commands: Schema.Array(Schema.String),
|
|
46
|
+
});
|
|
47
|
+
export const Payloads = {
|
|
48
|
+
clip_queued: Schema.Struct({ clip: Clip }),
|
|
49
|
+
clip_moved: Schema.Struct({
|
|
50
|
+
clip: Clip,
|
|
51
|
+
queue: Schema.Literals(["generation", "playout"]),
|
|
52
|
+
position: Integer,
|
|
53
|
+
}),
|
|
54
|
+
clip_popped: Schema.Struct({ clip: Clip }),
|
|
55
|
+
clip_generated: Schema.Struct({ clip: Clip }),
|
|
56
|
+
clip_failed: Schema.Struct({ clip: Clip, reason: Schema.String }),
|
|
57
|
+
clip_started: Schema.Struct({ clip: Clip }),
|
|
58
|
+
clip_finished: Schema.Struct({ clip: Clip, seconds_sent: NumberValue }),
|
|
59
|
+
clip_stopped: Schema.Struct({ clip: Clip, seconds_sent: NumberValue }),
|
|
60
|
+
queue_update: Queue,
|
|
61
|
+
state_update: State,
|
|
62
|
+
command_error: Schema.Struct({ command: Schema.String, reason: Schema.String }),
|
|
63
|
+
seed_accepted: Schema.Struct({ seed: Integer }),
|
|
64
|
+
clip_length_accepted: Schema.Struct({ clip_seconds: NumberValue, frames: Positive }),
|
|
65
|
+
canvas_accepted: Schema.Struct({ aspect: Schema.String, width: Positive, height: Positive }),
|
|
66
|
+
autoplay_accepted: Schema.Struct({ enabled: Schema.Boolean }),
|
|
67
|
+
flush_accepted: Schema.Struct({ enabled: Schema.Boolean }),
|
|
68
|
+
session_reset: Schema.Struct({ cleared_clips: Integer, was_playing: Schema.Boolean }),
|
|
69
|
+
};
|
|
70
|
+
const freeze = (value) => {
|
|
71
|
+
if (value !== null && typeof value === "object") {
|
|
72
|
+
for (const child of Object.values(value))
|
|
73
|
+
freeze(child);
|
|
74
|
+
Object.freeze(value);
|
|
75
|
+
}
|
|
76
|
+
return value;
|
|
77
|
+
};
|
|
78
|
+
/** Unknown events remain observable. A known message never accepts a partial payload. */
|
|
79
|
+
export const decodeMessage = (type, input) => {
|
|
80
|
+
if (!Object.hasOwn(Payloads, type))
|
|
81
|
+
return Object.freeze({
|
|
82
|
+
type: "unknown",
|
|
83
|
+
name: type,
|
|
84
|
+
data: input === undefined ? undefined : jsonObject(input),
|
|
85
|
+
});
|
|
86
|
+
try {
|
|
87
|
+
const schema = Payloads[type];
|
|
88
|
+
const data = Schema.decodeUnknownSync(schema)(input);
|
|
89
|
+
const message = { type, data };
|
|
90
|
+
if (message.type === "state_update") {
|
|
91
|
+
const state = message.data;
|
|
92
|
+
if (state.clip_seconds_min <= 0 ||
|
|
93
|
+
state.clip_seconds_max < state.clip_seconds_min ||
|
|
94
|
+
state.clip_seconds <= 0 ||
|
|
95
|
+
state.playing !== (state.playing_clip_id !== null))
|
|
96
|
+
throw new Error("inconsistent state");
|
|
97
|
+
}
|
|
98
|
+
if (message.type === "queue_update") {
|
|
99
|
+
const queued = [...message.data.generation, ...message.data.playout].map((clip) => clip.clip_id);
|
|
100
|
+
const history = message.data.history.map((clip) => clip.clip_id);
|
|
101
|
+
// A retained history entry may describe a clip that is still in playout;
|
|
102
|
+
// duplicate positions within queues/history remain ambiguous.
|
|
103
|
+
if (new Set(queued).size !== queued.length || new Set(history).size !== history.length)
|
|
104
|
+
throw new Error("duplicate queue identity");
|
|
105
|
+
}
|
|
106
|
+
return freeze(message);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
throw new ReactorError("Protocol", `H3 ${type} payload is malformed`, {
|
|
110
|
+
operation: "h3 observation",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/h3/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC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AoB,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CACtE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CACvB,CAAC;YACF,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjE,yEAAyE;YACzE,8DAA8D;YAC9D,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM;gBACpF,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,YAAY,CAAC,UAAU,EAAE,MAAM,IAAI,uBAAuB,EAAE;YACpE,SAAS,EAAE,gBAAgB;SAC5B,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** Documentation revision selected by this adapter, not an assertion about a server version. */
|
|
2
|
+
export declare const modelName: "reactor/h3-reference-to-video-turbo-realtime";
|
|
3
|
+
export declare const documentedVersion: "0.5.5";
|
|
4
|
+
export declare const source = "https://docs.reactor.inc/model-api-reference/h3-reference-to-video-turbo-realtime/schema";
|
|
5
|
+
export declare const requestSeconds: Readonly<{
|
|
6
|
+
min: 5;
|
|
7
|
+
max: 15.084;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const canvases: Readonly<{
|
|
10
|
+
"16:9": Readonly<{
|
|
11
|
+
width: 1344;
|
|
12
|
+
height: 768;
|
|
13
|
+
}>;
|
|
14
|
+
"1:1": Readonly<{
|
|
15
|
+
width: 768;
|
|
16
|
+
height: 768;
|
|
17
|
+
}>;
|
|
18
|
+
"9:16": Readonly<{
|
|
19
|
+
width: 768;
|
|
20
|
+
height: 1344;
|
|
21
|
+
}>;
|
|
22
|
+
"4:3": Readonly<{
|
|
23
|
+
width: 1024;
|
|
24
|
+
height: 768;
|
|
25
|
+
}>;
|
|
26
|
+
}>;
|
|
27
|
+
/** SDK image safety bounds; byte validation does not replace the model's image decoder. */
|
|
28
|
+
export declare const referenceLimits: Readonly<{
|
|
29
|
+
maxImages: 9;
|
|
30
|
+
maxBytes: number;
|
|
31
|
+
maxPixels: 25000000;
|
|
32
|
+
minAspect: 0.25;
|
|
33
|
+
maxAspect: 4;
|
|
34
|
+
}>;
|
|
35
|
+
/** Adapter limits shared by request capture, reference validation and profile declarations. */
|
|
36
|
+
export declare const metadataMaxChars = 2000;
|
|
37
|
+
export declare const imageMimeTypes: readonly ["image/jpeg", "image/png", "image/webp"];
|
|
38
|
+
/** Shared H3 timing data and explicit defaults used by offline orchestration. */
|
|
39
|
+
export type CanvasAspect = keyof typeof canvases;
|
|
40
|
+
export interface ModelProfile {
|
|
41
|
+
/** Wire model name passed to the SDK. */
|
|
42
|
+
readonly modelName: string;
|
|
43
|
+
readonly fps: number;
|
|
44
|
+
/** Legal output lengths are `minFrames + k * frameStep`, `k >= 0`, up to `maxFrames`. */
|
|
45
|
+
readonly minFrames: number;
|
|
46
|
+
readonly maxFrames: number;
|
|
47
|
+
readonly frameStep: number;
|
|
48
|
+
/** Requested lengths the provider accepts before aligning them up to the grid. */
|
|
49
|
+
readonly requestSeconds: {
|
|
50
|
+
readonly min: number;
|
|
51
|
+
readonly max: number;
|
|
52
|
+
};
|
|
53
|
+
readonly prompt: {
|
|
54
|
+
readonly maxChars: number;
|
|
55
|
+
/** Provider-side text budget. It is not a local hard limit because the provider tokenizer is authoritative. */
|
|
56
|
+
readonly maxTokens: number;
|
|
57
|
+
/** Conservative characters-per-token used to estimate the token bound locally. */
|
|
58
|
+
readonly charsPerTokenEstimate: number;
|
|
59
|
+
};
|
|
60
|
+
readonly references: {
|
|
61
|
+
readonly min: number;
|
|
62
|
+
readonly max: number;
|
|
63
|
+
readonly maxBytes: number;
|
|
64
|
+
readonly maxPixels: number;
|
|
65
|
+
/** width / height must lie within [minAspect, maxAspect]. */
|
|
66
|
+
readonly minAspect: number;
|
|
67
|
+
readonly maxAspect: number;
|
|
68
|
+
readonly mimeTypes: ReadonlyArray<string>;
|
|
69
|
+
};
|
|
70
|
+
readonly metadataMaxChars: number;
|
|
71
|
+
readonly canvases: ReadonlyArray<{
|
|
72
|
+
readonly aspect: CanvasAspect;
|
|
73
|
+
readonly width: number;
|
|
74
|
+
readonly height: number;
|
|
75
|
+
}>;
|
|
76
|
+
/** Defaults for offline simulation; live provider snapshots remain authoritative. */
|
|
77
|
+
readonly expectedCapacities: {
|
|
78
|
+
readonly generation: number;
|
|
79
|
+
readonly playout: number;
|
|
80
|
+
};
|
|
81
|
+
/** Bounded continuation hints for orchestration; not a claim that the deployment retains a clip. */
|
|
82
|
+
readonly continuationWindow: number;
|
|
83
|
+
readonly audio: {
|
|
84
|
+
readonly sampleRate: number;
|
|
85
|
+
readonly channels: number;
|
|
86
|
+
};
|
|
87
|
+
readonly tracks: {
|
|
88
|
+
readonly video: string;
|
|
89
|
+
readonly audio: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export declare const h3ReferenceTurboRealtime: ModelProfile;
|
|
93
|
+
export declare const minSeconds: (p: ModelProfile) => number;
|
|
94
|
+
export declare const maxSeconds: (p: ModelProfile) => number;
|
|
95
|
+
/** Snap upward on this profile's frame grid. Actual admitted lengths come from Clip.frames and Clip.seconds. */
|
|
96
|
+
export declare const alignFrames: (p: ModelProfile, seconds: number) => number;
|
|
97
|
+
export declare const alignSecondsTo: (p: ModelProfile, seconds: number) => number;
|
|
98
|
+
/** Clamp into the accepted request range, then align. Always yields a length the provider accepts. */
|
|
99
|
+
export declare const clampSecondsTo: (p: ModelProfile, seconds: number) => number;
|
|
100
|
+
/** True when `seconds` is a length the provider accepts as a request. */
|
|
101
|
+
export declare const isRequestableSeconds: (p: ModelProfile, seconds: number) => boolean;
|
|
102
|
+
/** Advisory token-count estimate for caller budgeting. The adapter does not reject from this estimate; the provider tokenizer is authoritative. */
|
|
103
|
+
export declare const estimateTokens: (p: ModelProfile, prompt: string) => number;
|
|
104
|
+
export declare const canvasSize: (p: ModelProfile, aspect: CanvasAspect) => {
|
|
105
|
+
readonly aspect: CanvasAspect;
|
|
106
|
+
readonly width: number;
|
|
107
|
+
readonly height: number;
|
|
108
|
+
} | undefined;
|
|
109
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/h3/profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,eAAO,MAAM,SAAS,EAAG,8CAAuD,CAAC;AACjF,eAAO,MAAM,iBAAiB,EAAG,OAAgB,CAAC;AAClD,eAAO,MAAM,MAAM,6FACyE,CAAC;AAC7F,eAAO,MAAM,cAAc;;;EAAyC,CAAC;AACrE,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;EAKnB,CAAC;AACH,2FAA2F;AAC3F,eAAO,MAAM,eAAe;;;;;;EAM1B,CAAC;AACH,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,OAAQ,CAAC;AACtC,eAAO,MAAM,cAAc,oDAAoE,CAAC;AAEhG,iFAAiF;AACjF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,QAAQ,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yFAAyF;IAC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AAM,CAAA;KAAE,CAAC;IACvF,oGAAoG;IACpG,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AAED,eAAO,MAAM,wBAAwB,EAAE,YA4BtC,CAAC;AAEF,eAAO,MAAM,UAAU,MAAO,YAAY,WAAwB,CAAC;AACnE,eAAO,MAAM,UAAU,MAAO,YAAY,WAAwB,CAAC;AAEnE,gHAAgH;AAChH,eAAO,MAAM,WAAW,MAAO,YAAY,WAAW,MAAM,KAAG,MAK9D,CAAC;AAEF,eAAO,MAAM,cAAc,MAAO,YAAY,WAAW,MAAM,KAAG,MACjC,CAAC;AAElC,sGAAsG;AACtG,eAAO,MAAM,cAAc,MAAO,YAAY,WAAW,MAAM,KAAG,MAO/D,CAAC;AAEJ,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,MAAO,YAAY,WAAW,MAAM,KAAG,OACwB,CAAC;AAEjG,mJAAmJ;AACnJ,eAAO,MAAM,cAAc,MAAO,YAAY,UAAU,MAAM,KAAG,MACN,CAAC;AAE5D,eAAO,MAAM,UAAU,MAAO,YAAY,UAAU,YAAY;qBA1E3C,YAAY;oBACb,MAAM;qBACL,MAAM;aAyEkB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Documentation revision selected by this adapter, not an assertion about a server version. */
|
|
2
|
+
export const modelName = "reactor/h3-reference-to-video-turbo-realtime";
|
|
3
|
+
export const documentedVersion = "0.5.5";
|
|
4
|
+
export const source = "https://docs.reactor.inc/model-api-reference/h3-reference-to-video-turbo-realtime/schema";
|
|
5
|
+
export const requestSeconds = Object.freeze({ min: 5, max: 15.084 });
|
|
6
|
+
export const canvases = Object.freeze({
|
|
7
|
+
"16:9": Object.freeze({ width: 1344, height: 768 }),
|
|
8
|
+
"1:1": Object.freeze({ width: 768, height: 768 }),
|
|
9
|
+
"9:16": Object.freeze({ width: 768, height: 1344 }),
|
|
10
|
+
"4:3": Object.freeze({ width: 1024, height: 768 }),
|
|
11
|
+
});
|
|
12
|
+
/** SDK image safety bounds; byte validation does not replace the model's image decoder. */
|
|
13
|
+
export const referenceLimits = Object.freeze({
|
|
14
|
+
maxImages: 9,
|
|
15
|
+
maxBytes: 25 * 1024 * 1024,
|
|
16
|
+
maxPixels: 25_000_000,
|
|
17
|
+
minAspect: 0.25,
|
|
18
|
+
maxAspect: 4,
|
|
19
|
+
});
|
|
20
|
+
/** Adapter limits shared by request capture, reference validation and profile declarations. */
|
|
21
|
+
export const metadataMaxChars = 2_000;
|
|
22
|
+
export const imageMimeTypes = Object.freeze(["image/jpeg", "image/png", "image/webp"]);
|
|
23
|
+
export const h3ReferenceTurboRealtime = {
|
|
24
|
+
modelName,
|
|
25
|
+
fps: 24,
|
|
26
|
+
minFrames: 124,
|
|
27
|
+
maxFrames: 362,
|
|
28
|
+
frameStep: 17,
|
|
29
|
+
requestSeconds,
|
|
30
|
+
// No provider character limit; the text budget is ~2,000 tokens ("roughly 8,000 characters of English
|
|
31
|
+
// prose") and exceeding it fails the clip at build. maxChars is our own sanity bound.
|
|
32
|
+
prompt: { maxChars: 12_000, maxTokens: 2_000, charsPerTokenEstimate: 3.5 },
|
|
33
|
+
references: {
|
|
34
|
+
min: 0,
|
|
35
|
+
max: referenceLimits.maxImages,
|
|
36
|
+
maxBytes: referenceLimits.maxBytes,
|
|
37
|
+
maxPixels: referenceLimits.maxPixels,
|
|
38
|
+
minAspect: referenceLimits.minAspect,
|
|
39
|
+
maxAspect: referenceLimits.maxAspect,
|
|
40
|
+
mimeTypes: [...imageMimeTypes],
|
|
41
|
+
},
|
|
42
|
+
metadataMaxChars,
|
|
43
|
+
canvases: Object.entries(canvases).map(([aspect, size]) => ({
|
|
44
|
+
aspect: aspect,
|
|
45
|
+
...size,
|
|
46
|
+
})),
|
|
47
|
+
expectedCapacities: { generation: 20, playout: 10 },
|
|
48
|
+
continuationWindow: 8,
|
|
49
|
+
audio: { sampleRate: 48_000, channels: 1 },
|
|
50
|
+
tracks: { video: "main_video", audio: "main_audio" },
|
|
51
|
+
};
|
|
52
|
+
export const minSeconds = (p) => p.minFrames / p.fps;
|
|
53
|
+
export const maxSeconds = (p) => p.maxFrames / p.fps;
|
|
54
|
+
/** Snap upward on this profile's frame grid. Actual admitted lengths come from Clip.frames and Clip.seconds. */
|
|
55
|
+
export const alignFrames = (p, seconds) => {
|
|
56
|
+
if (!Number.isFinite(seconds))
|
|
57
|
+
throw new RangeError("clip length must be finite");
|
|
58
|
+
const frames = Math.ceil(seconds * p.fps - 1e-6);
|
|
59
|
+
const steps = Math.ceil(Math.max(0, frames - p.minFrames) / p.frameStep);
|
|
60
|
+
return Math.min(p.maxFrames, p.minFrames + steps * p.frameStep);
|
|
61
|
+
};
|
|
62
|
+
export const alignSecondsTo = (p, seconds) => alignFrames(p, seconds) / p.fps;
|
|
63
|
+
/** Clamp into the accepted request range, then align. Always yields a length the provider accepts. */
|
|
64
|
+
export const clampSecondsTo = (p, seconds) => alignSecondsTo(p, Math.min(p.requestSeconds.max, Math.max(p.requestSeconds.min, Number.isFinite(seconds) ? seconds : p.requestSeconds.min)));
|
|
65
|
+
/** True when `seconds` is a length the provider accepts as a request. */
|
|
66
|
+
export const isRequestableSeconds = (p, seconds) => Number.isFinite(seconds) && seconds >= p.requestSeconds.min && seconds <= p.requestSeconds.max;
|
|
67
|
+
/** Advisory token-count estimate for caller budgeting. The adapter does not reject from this estimate; the provider tokenizer is authoritative. */
|
|
68
|
+
export const estimateTokens = (p, prompt) => Math.ceil(prompt.length / p.prompt.charsPerTokenEstimate);
|
|
69
|
+
export const canvasSize = (p, aspect) => p.canvases.find((c) => c.aspect === aspect);
|
|
70
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/h3/profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,8CAAuD,CAAC;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAgB,CAAC;AAClD,MAAM,CAAC,MAAM,MAAM,GACjB,0FAA0F,CAAC;AAC7F,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;CACnD,CAAC,CAAC;AACH,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;IAC1B,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,CAAC;CACb,CAAC,CAAC;AACH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG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