@sonara/client 0.36.2 → 0.37.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.
@@ -52,9 +52,13 @@ export interface StreamMessage {
52
52
  t?: number;
53
53
  /**
54
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.
55
+ * same text again later in the turn is not read twice. It may also come
56
+ * after an `ask` marked `lead_in_pending` (protocol 1.16, runtime 0.37.0),
57
+ * with its `lead_in_id`; an empty `delta` then says there is none.
56
58
  */
57
59
  lead_in?: boolean;
60
+ /** The `lead_in_id` of the question this late lead-in belongs to. */
61
+ lead_in_id?: string;
58
62
  [extra: string]: unknown;
59
63
  }
60
64
  /** `agent` (needs `channels`): streaming turns, decisions, earcons. */
@@ -76,7 +80,9 @@ export declare class AgentApi {
76
80
  * and `set_size` in `extra`. By default (agent key `question_step` `"off"`,
77
81
  * protocol 1.11, runtime 0.32.0) every question of the set is read in
78
82
  * order, "Question k of N."; with `set question_step "on"` only question 1
79
- * is read and the others wait for `nextQuestion`.
83
+ * is read and the others wait for `nextQuestion`. `extra.lead_in_pending`
84
+ * (protocol 1.16, runtime 0.37.0) with `extra.lead_in_id`: the question
85
+ * waits up to 2 s for a `stream` with `lead_in` and that id sent after it.
80
86
  */
81
87
  ask(channel: string, kind: AskKind, text: string, options?: unknown[], extra?: Extra): Promise<Reply>;
82
88
  /**
@@ -79,7 +79,9 @@ class AgentApi {
79
79
  * and `set_size` in `extra`. By default (agent key `question_step` `"off"`,
80
80
  * protocol 1.11, runtime 0.32.0) every question of the set is read in
81
81
  * order, "Question k of N."; with `set question_step "on"` only question 1
82
- * is read and the others wait for `nextQuestion`.
82
+ * is read and the others wait for `nextQuestion`. `extra.lead_in_pending`
83
+ * (protocol 1.16, runtime 0.37.0) with `extra.lead_in_id`: the question
84
+ * waits up to 2 s for a `stream` with `lead_in` and that id sent after it.
83
85
  */
84
86
  ask(channel, kind, text, options, extra = {}) {
85
87
  return this.send("ask", defined({ ...extra, channel, kind, text, options }));
@@ -1,5 +1,5 @@
1
1
  /** Version of this package, sent as `client.version` in `hello`. */
2
- export declare const VERSION = "0.36.2";
2
+ export declare const VERSION = "0.37.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.36.2";
5
+ exports.VERSION = "0.37.0";
6
6
  /** Protocol this client speaks. */
7
7
  exports.PROTOCOL = { major: 1, minor: 0 };
@@ -52,9 +52,13 @@ export interface StreamMessage {
52
52
  t?: number;
53
53
  /**
54
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.
55
+ * same text again later in the turn is not read twice. It may also come
56
+ * after an `ask` marked `lead_in_pending` (protocol 1.16, runtime 0.37.0),
57
+ * with its `lead_in_id`; an empty `delta` then says there is none.
56
58
  */
57
59
  lead_in?: boolean;
60
+ /** The `lead_in_id` of the question this late lead-in belongs to. */
61
+ lead_in_id?: string;
58
62
  [extra: string]: unknown;
59
63
  }
60
64
  /** `agent` (needs `channels`): streaming turns, decisions, earcons. */
@@ -76,7 +80,9 @@ export declare class AgentApi {
76
80
  * and `set_size` in `extra`. By default (agent key `question_step` `"off"`,
77
81
  * protocol 1.11, runtime 0.32.0) every question of the set is read in
78
82
  * order, "Question k of N."; with `set question_step "on"` only question 1
79
- * is read and the others wait for `nextQuestion`.
83
+ * is read and the others wait for `nextQuestion`. `extra.lead_in_pending`
84
+ * (protocol 1.16, runtime 0.37.0) with `extra.lead_in_id`: the question
85
+ * waits up to 2 s for a `stream` with `lead_in` and that id sent after it.
80
86
  */
81
87
  ask(channel: string, kind: AskKind, text: string, options?: unknown[], extra?: Extra): Promise<Reply>;
82
88
  /**
@@ -75,7 +75,9 @@ export class AgentApi {
75
75
  * and `set_size` in `extra`. By default (agent key `question_step` `"off"`,
76
76
  * protocol 1.11, runtime 0.32.0) every question of the set is read in
77
77
  * order, "Question k of N."; with `set question_step "on"` only question 1
78
- * is read and the others wait for `nextQuestion`.
78
+ * is read and the others wait for `nextQuestion`. `extra.lead_in_pending`
79
+ * (protocol 1.16, runtime 0.37.0) with `extra.lead_in_id`: the question
80
+ * waits up to 2 s for a `stream` with `lead_in` and that id sent after it.
79
81
  */
80
82
  ask(channel, kind, text, options, extra = {}) {
81
83
  return this.send("ask", defined({ ...extra, channel, kind, text, options }));
@@ -1,5 +1,5 @@
1
1
  /** Version of this package, sent as `client.version` in `hello`. */
2
- export declare const VERSION = "0.36.2";
2
+ export declare const VERSION = "0.37.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.36.2";
2
+ export const VERSION = "0.37.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.36.2",
3
+ "version": "0.37.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": {