@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/README.md +11 -7
- package/dist/client.d.ts +35 -23
- package/dist/client.js +35 -25
- package/dist/conversation.d.ts +10 -8
- package/dist/conversation.js +23 -23
- package/dist/errors.d.ts +24 -16
- package/dist/errors.js +19 -39
- package/dist/events.d.ts +28 -22
- package/dist/gen/index.d.ts +1 -1
- package/dist/gen/types.gen.d.ts +211 -260
- package/dist/protocol.gen.d.ts +7 -4
- package/dist/protocol.gen.js +7 -4
- package/dist/socket.js +6 -8
- package/dist/token.d.ts +1 -1
- package/dist/transport.js +3 -3
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
154
|
-
|
|
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
|
-
|
|
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. `
|
|
172
|
-
*
|
|
173
|
-
* `
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
187
|
+
recording_id: string | null;
|
|
183
188
|
}
|
|
184
|
-
/** The answer to `ping`,
|
|
185
|
-
export interface PongFrame
|
|
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
|
package/dist/gen/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { ClientOptions,
|
|
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';
|