@sonara/client 0.21.6 → 0.22.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.
@@ -56,8 +56,23 @@ export declare class AgentApi {
56
56
  turnStart(channel: string, turn: string | number, extra?: Extra): Promise<Reply>;
57
57
  /** `turn_end`. */
58
58
  turnEnd(channel: string, turn: string | number, extra?: Extra): Promise<Reply>;
59
- /** `ask`: a question, permission or plan, spoken with priority. */
59
+ /**
60
+ * `ask`: a question, permission or plan, spoken with priority. A question
61
+ * of a set (protocol 1.6, runtime 0.22.0) carries `set_index` (0-based)
62
+ * and `set_size` in `extra`: only the first is read, "Question 1 of N.".
63
+ */
60
64
  ask(channel: string, kind: AskKind, text: string, options?: unknown[], extra?: Extra): Promise<Reply>;
65
+ /**
66
+ * `control` `next_question` (protocol 1.6): question 1 from the message
67
+ * text, else the next question of the set. Resolves `{channel, question,
68
+ * of, edge}`, `channel` null when no session has a question set.
69
+ */
70
+ nextQuestion(extra?: Extra): Promise<Reply>;
71
+ /**
72
+ * `control` `previous_question` (protocol 1.6): question 1 from the
73
+ * message text, else the question before (question 1 again on question 1).
74
+ */
75
+ previousQuestion(extra?: Extra): Promise<Reply>;
61
76
  /** `earcon`. */
62
77
  earcon(kind: string, extra?: Extra): Promise<Reply>;
63
78
  /** `set mute_level` 0, 1 or 2. */
@@ -62,10 +62,29 @@ class AgentApi {
62
62
  turnEnd(channel, turn, extra = {}) {
63
63
  return this.send("turn_end", defined({ ...extra, channel, turn }));
64
64
  }
65
- /** `ask`: a question, permission or plan, spoken with priority. */
65
+ /**
66
+ * `ask`: a question, permission or plan, spoken with priority. A question
67
+ * of a set (protocol 1.6, runtime 0.22.0) carries `set_index` (0-based)
68
+ * and `set_size` in `extra`: only the first is read, "Question 1 of N.".
69
+ */
66
70
  ask(channel, kind, text, options, extra = {}) {
67
71
  return this.send("ask", defined({ ...extra, channel, kind, text, options }));
68
72
  }
73
+ /**
74
+ * `control` `next_question` (protocol 1.6): question 1 from the message
75
+ * text, else the next question of the set. Resolves `{channel, question,
76
+ * of, edge}`, `channel` null when no session has a question set.
77
+ */
78
+ nextQuestion(extra = {}) {
79
+ return this.send("control", defined({ ...extra, action: "next_question" }));
80
+ }
81
+ /**
82
+ * `control` `previous_question` (protocol 1.6): question 1 from the
83
+ * message text, else the question before (question 1 again on question 1).
84
+ */
85
+ previousQuestion(extra = {}) {
86
+ return this.send("control", defined({ ...extra, action: "previous_question" }));
87
+ }
69
88
  /** `earcon`. */
70
89
  earcon(kind, extra = {}) {
71
90
  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.21.6";
2
+ export declare const VERSION = "0.22.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.21.6";
5
+ exports.VERSION = "0.22.0";
6
6
  /** Protocol this client speaks. */
7
7
  exports.PROTOCOL = { major: 1, minor: 0 };
@@ -56,8 +56,23 @@ export declare class AgentApi {
56
56
  turnStart(channel: string, turn: string | number, extra?: Extra): Promise<Reply>;
57
57
  /** `turn_end`. */
58
58
  turnEnd(channel: string, turn: string | number, extra?: Extra): Promise<Reply>;
59
- /** `ask`: a question, permission or plan, spoken with priority. */
59
+ /**
60
+ * `ask`: a question, permission or plan, spoken with priority. A question
61
+ * of a set (protocol 1.6, runtime 0.22.0) carries `set_index` (0-based)
62
+ * and `set_size` in `extra`: only the first is read, "Question 1 of N.".
63
+ */
60
64
  ask(channel: string, kind: AskKind, text: string, options?: unknown[], extra?: Extra): Promise<Reply>;
65
+ /**
66
+ * `control` `next_question` (protocol 1.6): question 1 from the message
67
+ * text, else the next question of the set. Resolves `{channel, question,
68
+ * of, edge}`, `channel` null when no session has a question set.
69
+ */
70
+ nextQuestion(extra?: Extra): Promise<Reply>;
71
+ /**
72
+ * `control` `previous_question` (protocol 1.6): question 1 from the
73
+ * message text, else the question before (question 1 again on question 1).
74
+ */
75
+ previousQuestion(extra?: Extra): Promise<Reply>;
61
76
  /** `earcon`. */
62
77
  earcon(kind: string, extra?: Extra): Promise<Reply>;
63
78
  /** `set mute_level` 0, 1 or 2. */
@@ -58,10 +58,29 @@ export class AgentApi {
58
58
  turnEnd(channel, turn, extra = {}) {
59
59
  return this.send("turn_end", defined({ ...extra, channel, turn }));
60
60
  }
61
- /** `ask`: a question, permission or plan, spoken with priority. */
61
+ /**
62
+ * `ask`: a question, permission or plan, spoken with priority. A question
63
+ * of a set (protocol 1.6, runtime 0.22.0) carries `set_index` (0-based)
64
+ * and `set_size` in `extra`: only the first is read, "Question 1 of N.".
65
+ */
62
66
  ask(channel, kind, text, options, extra = {}) {
63
67
  return this.send("ask", defined({ ...extra, channel, kind, text, options }));
64
68
  }
69
+ /**
70
+ * `control` `next_question` (protocol 1.6): question 1 from the message
71
+ * text, else the next question of the set. Resolves `{channel, question,
72
+ * of, edge}`, `channel` null when no session has a question set.
73
+ */
74
+ nextQuestion(extra = {}) {
75
+ return this.send("control", defined({ ...extra, action: "next_question" }));
76
+ }
77
+ /**
78
+ * `control` `previous_question` (protocol 1.6): question 1 from the
79
+ * message text, else the question before (question 1 again on question 1).
80
+ */
81
+ previousQuestion(extra = {}) {
82
+ return this.send("control", defined({ ...extra, action: "previous_question" }));
83
+ }
65
84
  /** `earcon`. */
66
85
  earcon(kind, extra = {}) {
67
86
  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.21.6";
2
+ export declare const VERSION = "0.22.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.21.6";
2
+ export const VERSION = "0.22.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.21.6",
3
+ "version": "0.22.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": {