@sonara/client 0.32.18 → 0.34.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.
@@ -50,6 +50,11 @@ export interface StreamMessage {
50
50
  final: boolean;
51
51
  /** Sender start time, so late text from a previous turn is dropped. */
52
52
  t?: number;
53
+ /**
54
+ * The text before a question, sent with it (protocol 1.13, #323): the
55
+ * same text again later in the turn is not read twice.
56
+ */
57
+ lead_in?: boolean;
53
58
  [extra: string]: unknown;
54
59
  }
55
60
  /** `agent` (needs `channels`): streaming turns, decisions, earcons. */
@@ -82,6 +87,14 @@ export declare class AgentApi {
82
87
  * message text, else the question before (question 1 again on question 1).
83
88
  */
84
89
  previousQuestion(extra?: Extra): Promise<Reply>;
90
+ /**
91
+ * `question_shown` (protocol 1.12, #323): the terminal shows `text`, a
92
+ * question of the session's set as on screen, or with `{ review: true }`
93
+ * the review of the answers. Reply: `moved`, `question`, `of`.
94
+ */
95
+ questionShown(channel: string, text: string | {
96
+ review: true;
97
+ }, extra?: Extra): Promise<Reply>;
85
98
  /** `earcon`. */
86
99
  earcon(kind: string, extra?: Extra): Promise<Reply>;
87
100
  /** `set mute_level` 0, 1 or 2. */
@@ -96,6 +96,15 @@ class AgentApi {
96
96
  previousQuestion(extra = {}) {
97
97
  return this.send("control", defined({ ...extra, action: "previous_question" }));
98
98
  }
99
+ /**
100
+ * `question_shown` (protocol 1.12, #323): the terminal shows `text`, a
101
+ * question of the session's set as on screen, or with `{ review: true }`
102
+ * the review of the answers. Reply: `moved`, `question`, `of`.
103
+ */
104
+ questionShown(channel, text, extra = {}) {
105
+ const shown = typeof text === "string" ? { text } : { review: true };
106
+ return this.send("question_shown", defined({ ...extra, channel, ...shown }));
107
+ }
99
108
  /** `earcon`. */
100
109
  earcon(kind, extra = {}) {
101
110
  return this.send("earcon", defined({ ...extra, kind }));
@@ -1,5 +1,5 @@
1
1
  /** Version of this package, sent as `client.version` in `hello`. */
2
- export declare const VERSION = "0.32.18";
2
+ export declare const VERSION = "0.34.0";
3
3
  /** Protocol this client speaks. */
4
4
  export declare const PROTOCOL: {
5
5
  readonly major: 1;
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTOCOL = exports.VERSION = void 0;
4
4
  /** Version of this package, sent as `client.version` in `hello`. */
5
- exports.VERSION = "0.32.18";
5
+ exports.VERSION = "0.34.0";
6
6
  /** Protocol this client speaks. */
7
7
  exports.PROTOCOL = { major: 1, minor: 0 };
@@ -50,6 +50,11 @@ export interface StreamMessage {
50
50
  final: boolean;
51
51
  /** Sender start time, so late text from a previous turn is dropped. */
52
52
  t?: number;
53
+ /**
54
+ * The text before a question, sent with it (protocol 1.13, #323): the
55
+ * same text again later in the turn is not read twice.
56
+ */
57
+ lead_in?: boolean;
53
58
  [extra: string]: unknown;
54
59
  }
55
60
  /** `agent` (needs `channels`): streaming turns, decisions, earcons. */
@@ -82,6 +87,14 @@ export declare class AgentApi {
82
87
  * message text, else the question before (question 1 again on question 1).
83
88
  */
84
89
  previousQuestion(extra?: Extra): Promise<Reply>;
90
+ /**
91
+ * `question_shown` (protocol 1.12, #323): the terminal shows `text`, a
92
+ * question of the session's set as on screen, or with `{ review: true }`
93
+ * the review of the answers. Reply: `moved`, `question`, `of`.
94
+ */
95
+ questionShown(channel: string, text: string | {
96
+ review: true;
97
+ }, extra?: Extra): Promise<Reply>;
85
98
  /** `earcon`. */
86
99
  earcon(kind: string, extra?: Extra): Promise<Reply>;
87
100
  /** `set mute_level` 0, 1 or 2. */
@@ -92,6 +92,15 @@ export class AgentApi {
92
92
  previousQuestion(extra = {}) {
93
93
  return this.send("control", defined({ ...extra, action: "previous_question" }));
94
94
  }
95
+ /**
96
+ * `question_shown` (protocol 1.12, #323): the terminal shows `text`, a
97
+ * question of the session's set as on screen, or with `{ review: true }`
98
+ * the review of the answers. Reply: `moved`, `question`, `of`.
99
+ */
100
+ questionShown(channel, text, extra = {}) {
101
+ const shown = typeof text === "string" ? { text } : { review: true };
102
+ return this.send("question_shown", defined({ ...extra, channel, ...shown }));
103
+ }
95
104
  /** `earcon`. */
96
105
  earcon(kind, extra = {}) {
97
106
  return this.send("earcon", defined({ ...extra, kind }));
@@ -1,5 +1,5 @@
1
1
  /** Version of this package, sent as `client.version` in `hello`. */
2
- export declare const VERSION = "0.32.18";
2
+ export declare const VERSION = "0.34.0";
3
3
  /** Protocol this client speaks. */
4
4
  export declare const PROTOCOL: {
5
5
  readonly major: 1;
@@ -1,4 +1,4 @@
1
1
  /** Version of this package, sent as `client.version` in `hello`. */
2
- export const VERSION = "0.32.18";
2
+ export const VERSION = "0.34.0";
3
3
  /** Protocol this client speaks. */
4
4
  export const PROTOCOL = { major: 1, minor: 0 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonara/client",
3
- "version": "0.32.18",
3
+ "version": "0.34.0",
4
4
  "description": "Client for the Sonara text-to-speech runtime (protocol v1): connect, speak, control, live state. Zero dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {