@archboard/codex-realtime-voice 0.0.0-stage → 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.
@@ -0,0 +1,43 @@
1
+ // src/shared/protocol/gateway-envelope.ts
2
+ const BROWSER_GATEWAY_ERROR_CODES = [
3
+ "disposed",
4
+ "invalid_input",
5
+ "invalid_command",
6
+ "invalid_projection",
7
+ "not_ready",
8
+ "thread_capability_required",
9
+ "link_required",
10
+ "link_changed",
11
+ "lease_required",
12
+ "lease_expired",
13
+ "lease_released",
14
+ "lease_transferred",
15
+ "child_disconnected",
16
+ "approval_not_pending",
17
+ "dynamic_approval_not_pending",
18
+ "unsupported_command",
19
+ "command_failed",
20
+ "outcome_unknown"
21
+ ];
22
+ /** Every snapshot field a delta may carry, in snapshot order. */
23
+ const BROWSER_SNAPSHOT_DELTA_KEYS = [
24
+ "readiness",
25
+ "account",
26
+ "login",
27
+ "threadLink",
28
+ "timeline",
29
+ "queue",
30
+ "settings",
31
+ "approvals",
32
+ "dynamicApprovals",
33
+ "contextDelivery",
34
+ "coordinator",
35
+ "voice",
36
+ "spokenApproval",
37
+ "voiceContext",
38
+ "coordinatorTimeline",
39
+ "workhorses",
40
+ "lease",
41
+ "operation"
42
+ ];
43
+ export { BROWSER_SNAPSHOT_DELTA_KEYS as n, BROWSER_GATEWAY_ERROR_CODES as t };
@@ -0,0 +1,36 @@
1
+ import { R as BrowserCommandId, Y as TurnId, p as BrowserSnapshot, y as DeliveryOutcome } from "./snapshot-BCrCORmt.mjs";
2
+ import { t as AnswerSdp } from "./realtime-contract-wHmSyUIe.mjs";
3
+ declare const BROWSER_GATEWAY_ERROR_CODES: readonly ["disposed", "invalid_input", "invalid_command", "invalid_projection", "not_ready", "thread_capability_required", "link_required", "link_changed", "lease_required", "lease_expired", "lease_released", "lease_transferred", "child_disconnected", "approval_not_pending", "dynamic_approval_not_pending", "unsupported_command", "command_failed", "outcome_unknown"];
4
+ type BrowserGatewayErrorCode = (typeof BROWSER_GATEWAY_ERROR_CODES)[number];
5
+ interface BrowserGatewaySnapshotMessage {
6
+ readonly kind: "snapshot";
7
+ readonly sequence: number;
8
+ readonly snapshot: BrowserSnapshot;
9
+ }
10
+ type BrowserSnapshotDelta = Partial<Omit<BrowserSnapshot, "kind" | "version">>;
11
+ interface BrowserGatewayDeltaMessage {
12
+ readonly kind: "delta";
13
+ readonly sequence: number;
14
+ readonly delta: BrowserSnapshotDelta;
15
+ }
16
+ type BrowserGatewayMessage = BrowserGatewaySnapshotMessage | BrowserGatewayDeltaMessage;
17
+ interface BrowserGatewayCommandResult {
18
+ readonly kind: "command_result";
19
+ readonly commandId: BrowserCommandId | null;
20
+ readonly outcome: DeliveryOutcome;
21
+ readonly code: BrowserGatewayErrorCode | null;
22
+ readonly message: string | null;
23
+ readonly snapshot: BrowserSnapshot;
24
+ /** Accepted turn identity from the command response, independent of later status. */
25
+ readonly turnId?: TurnId;
26
+ readonly realtimeAnswer?: AnswerSdp;
27
+ readonly realtimeSessionHandle?: string;
28
+ }
29
+ interface BrowserGatewayAccountReadResult {
30
+ readonly kind: "account_read";
31
+ readonly outcome: DeliveryOutcome;
32
+ readonly code: BrowserGatewayErrorCode | null;
33
+ readonly message: string | null;
34
+ readonly snapshot: BrowserSnapshot;
35
+ }
36
+ export { BrowserGatewaySnapshotMessage as a, BrowserGatewayMessage as i, BrowserGatewayCommandResult as n, BrowserGatewayErrorCode as r, BrowserGatewayAccountReadResult as t };