@lumavox/client 0.1.1 → 0.4.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/dist/events.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Every frame the edge sends, as it sends it: the wire's own field names,
3
3
  * snake_case included, so the docs' WebSocket page and these types read
4
- * the same.
4
+ * the same — and every field always there, `null` where it does not apply.
5
5
  *
6
6
  * **Hand-written, and held twice.** `ServerFrames` is keyed by the event
7
7
  * names `protocol.gen.ts` takes from the edge's vocabulary, so an event the
@@ -9,7 +9,7 @@
9
9
  * test (`apps/edge/test/sdk.test.ts`) holds every field of every frame the
10
10
  * real conversation object sends to these, both ways.
11
11
  */
12
- import type { RelationInfo } from "./gen/index.js";
12
+ import type { ErrorCode, RelationInfo } from "./gen/index.js";
13
13
  import type { ServerEventName } from "./protocol.gen.js";
14
14
  interface Frame<T extends ServerEventName> {
15
15
  type: T;
@@ -51,7 +51,8 @@ export interface TurnStartFrame extends Frame<"turn.start">, InTurn {
51
51
  /** A spoken turn's transcript, before the reply. */
52
52
  export interface HeardFrame extends Frame<"heard">, InTurn {
53
53
  text: string;
54
- seconds: number;
54
+ /** How long the recording was. */
55
+ audio_seconds: number;
55
56
  }
56
57
  /** The open recording as heard so far: a caption, replaced by the next. */
57
58
  export interface HeardPartialFrame extends Frame<"heard.partial"> {
@@ -60,10 +61,11 @@ export interface HeardPartialFrame extends Frame<"heard.partial"> {
60
61
  /** A `transcribeOnly` recording's words: part of no turn. */
61
62
  export interface TranscriptFrame extends Frame<"transcript"> {
62
63
  text: string;
63
- seconds: number;
64
+ /** How long the recording was. */
65
+ audio_seconds: number;
64
66
  request_id: string;
65
67
  /** The recording's id, which the SDK names every recording with. */
66
- id?: string;
68
+ recording_id: string | null;
67
69
  }
68
70
  export interface MoodFrame extends Frame<"mood">, InTurn {
69
71
  mood: string;
@@ -109,7 +111,7 @@ export interface AudioStartFrame extends Frame<"audio.start">, InTurn, AudioForm
109
111
  export interface AudioEndFrame extends Frame<"audio.end">, InTurn {
110
112
  chunk: number;
111
113
  bytes: number;
112
- audio_s: number;
114
+ audio_seconds: number;
113
115
  }
114
116
  /** After `mute`, once the last audio window has closed. */
115
117
  export interface MutedFrame extends Frame<"muted">, InTurn {
@@ -150,10 +152,8 @@ export interface TurnDoneFrame extends Frame<"turn.done">, InTurn {
150
152
  output_tokens: number | null;
151
153
  mood: string | null;
152
154
  mood_intensity: number | null;
153
- /** Always `null`: a relationship that moved arrives as its own frame. */
154
- relation: null;
155
- /** `true` when the reply was cut short. */
156
- truncated: true | null;
155
+ /** Whether the reply was cut short. */
156
+ truncated: boolean;
157
157
  chunks_spoken: number;
158
158
  heard: string | null;
159
159
  heard_seconds: number | null;
@@ -164,25 +164,31 @@ export interface InterruptedFrame extends Frame<"interrupted">, InTurn {
164
164
  message: string;
165
165
  mood: string | null;
166
166
  mood_intensity: number | null;
167
- detail: string | null;
167
+ /** Why it stopped: `cancel`, or the failure its `error` named. */
168
+ reason: string | null;
168
169
  }
169
170
  /**
170
171
  * Something went wrong. It does not end the connection, and inside a turn
171
- * it does not end the turn. `detail` alone: a frame refused; `stage:
172
- * "speech"`: the reply could not be spoken; `status`: the turn or a
173
- * `transcribeOnly` recording failed.
172
+ * it does not end the turn. `code` is the REST API's (`conflict` for a
173
+ * turn already running, `insufficient_credits`, `provider_failed`, …);
174
+ * `stage: "speech"` when only the speaking failed.
174
175
  */
175
176
  export interface ErrorFrame extends Frame<"error"> {
176
- detail: string;
177
- turn?: string;
178
- status?: number;
179
- stage?: string;
180
- request_id?: string;
177
+ code: ErrorCode;
178
+ message: string;
179
+ /** The turn it ended or interrupted. */
180
+ turn: string | null;
181
+ stage: "speech" | null;
182
+ /** The reply's chunk that could not be spoken. */
183
+ chunk: number | null;
184
+ /** A `transcribeOnly` recording's request. */
185
+ request_id: string | null;
181
186
  /** The recording it refused or failed. */
182
- id?: string;
187
+ recording_id: string | null;
183
188
  }
184
- /** The answer to `ping`, and sent unprompted after 30 s of client silence. */
185
- export interface PongFrame extends Frame<"pong"> {
189
+ /** The answer to `ping`, from the edge's runtime: the one frame with no `seq`. */
190
+ export interface PongFrame {
191
+ type: "pong";
186
192
  }
187
193
  /**
188
194
  * Every event, by name. **Exhaustive**: a name in the vocabulary with no
@@ -1 +1 @@
1
- export type { ClientOptions, CompactData, CompactError, CompactErrors, CompactionInfo, CompactRequest, CompactResponse, CompactResponses, CreateSessionData, CreateSessionError, CreateSessionErrors, CreateSessionResponse, CreateSessionResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, ErrorInfo, ErrorResponse, ExtractData, ExtractError, ExtractErrors, ExtractResponse, ExtractResponses, FactInfo, FactList, ForgetFactData, ForgetFactError, ForgetFactErrors, ForgetFactResponse, ForgetFactResponses, ForgetUserFactsData, ForgetUserFactsError, ForgetUserFactsErrors, ForgetUserFactsResponse, ForgetUserFactsResponses, ForgottenFacts, GetSessionDetailData, GetSessionDetailError, GetSessionDetailErrors, GetSessionDetailResponse, GetSessionDetailResponses, KnowledgeCitation, KnowledgeLookupInfo, ListFactsData, ListFactsError, ListFactsErrors, ListFactsResponse, ListFactsResponses, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, MessageInfo, MessageKnowledge, RelationInfo, RelationList, SessionCreateRequest, SessionDetail, SessionInfo } from './types.gen.js';
1
+ export type { ClientOptions, CompactionInfo, CompactRequest, CompactSessionData, CompactSessionError, CompactSessionErrors, CompactSessionResponse, CompactSessionResponses, CreateSessionData, CreateSessionError, CreateSessionErrors, CreateSessionResponse, CreateSessionResponses, DeleteAllFactsData, DeleteAllFactsError, DeleteAllFactsErrors, DeleteAllFactsResponse, DeleteAllFactsResponses, DeleteFactData, DeleteFactError, DeleteFactErrors, DeleteFactResponse, DeleteFactResponses, DeleteSessionData, DeleteSessionError, DeleteSessionErrors, DeleteSessionResponse, DeleteSessionResponses, ErrorCode, ErrorInfo, ErrorResponse, ExtractSessionFactsData, ExtractSessionFactsError, ExtractSessionFactsErrors, ExtractSessionFactsResponse, ExtractSessionFactsResponses, FactInfo, FactPage, FactsDeleted, GetSessionData, GetSessionError, GetSessionErrors, GetSessionResponse, GetSessionResponses, KnowledgeCitation, KnowledgeLookupInfo, ListFactsData, ListFactsError, ListFactsErrors, ListFactsResponse, ListFactsResponses, ListRelationsData, ListRelationsError, ListRelationsErrors, ListRelationsResponse, ListRelationsResponses, ListSessionsData, ListSessionsError, ListSessionsErrors, ListSessionsResponse, ListSessionsResponses, MessageInfo, MessageKnowledge, MessagePage, RelationInfo, RelationPage, SessionCreateRequest, SessionDetail, SessionInfo, SessionPage, ValidationIssue } from './types.gen.js';