@runtypelabs/persona 4.26.1 → 4.28.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.
Files changed (61) hide show
  1. package/dist/approval-ui.d.cts +18 -0
  2. package/dist/approval-ui.d.ts +18 -0
  3. package/dist/artifacts-ui.d.cts +18 -0
  4. package/dist/artifacts-ui.d.ts +18 -0
  5. package/dist/chunk-AALCT54S.js +1 -0
  6. package/dist/{client-history-GOZWBDA5.js → client-history-LV3KHEFA.js} +1 -1
  7. package/dist/client-history.js +1 -1
  8. package/dist/client-stream-N22JHTLE.js +4 -0
  9. package/dist/client-stream.js +3 -3
  10. package/dist/codegen.cjs +1 -1
  11. package/dist/codegen.js +1 -1
  12. package/dist/context-mentions.d.cts +18 -0
  13. package/dist/context-mentions.d.ts +18 -0
  14. package/dist/event-stream-view.d.cts +18 -0
  15. package/dist/event-stream-view.d.ts +18 -0
  16. package/dist/forms-ui.d.cts +26 -0
  17. package/dist/forms-ui.d.ts +26 -0
  18. package/dist/index.cjs +57 -57
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +34 -0
  21. package/dist/index.d.ts +34 -0
  22. package/dist/index.global.js +1 -1
  23. package/dist/index.global.js.map +1 -1
  24. package/dist/index.js +58 -58
  25. package/dist/index.js.map +1 -1
  26. package/dist/session-reconnect.d.cts +18 -0
  27. package/dist/session-reconnect.d.ts +18 -0
  28. package/dist/smart-dom-reader.d.cts +18 -0
  29. package/dist/smart-dom-reader.d.ts +18 -0
  30. package/dist/theme-editor-preview.cjs +66 -66
  31. package/dist/theme-editor-preview.d.cts +18 -0
  32. package/dist/theme-editor-preview.d.ts +18 -0
  33. package/dist/theme-editor-preview.js +31 -31
  34. package/dist/theme-editor.d.cts +18 -0
  35. package/dist/theme-editor.d.ts +18 -0
  36. package/dist/voice-runtime-LVUMPUDS.js +17 -0
  37. package/dist/voice-runtime.cjs +7 -7
  38. package/dist/voice-runtime.d.cts +33 -0
  39. package/dist/voice-runtime.d.ts +33 -0
  40. package/dist/voice-runtime.js +7 -7
  41. package/package.json +1 -1
  42. package/src/client-stream.ts +10 -3
  43. package/src/client.interrupt.test.ts +18 -0
  44. package/src/client.test.ts +20 -0
  45. package/src/client.ts +7 -0
  46. package/src/session.ts +16 -3
  47. package/src/session.voice.test.ts +199 -3
  48. package/src/types.ts +24 -0
  49. package/src/ui.composer-defer-one.test.ts +17 -0
  50. package/src/ui.ts +49 -12
  51. package/src/voice/__fixtures__/voice-wire/server/session_end-provider-error.json +6 -0
  52. package/src/voice/__fixtures__/voice-wire/server/session_end-unknown-reason.json +4 -0
  53. package/src/voice/__fixtures__/voice-wire/server/session_end.json +5 -0
  54. package/src/voice/runtype-voice-provider.ts +205 -21
  55. package/src/voice/voice-clause-buffer.test.ts +143 -0
  56. package/src/voice/voice-clause-buffer.ts +187 -0
  57. package/src/voice/voice-delegation.ts +111 -13
  58. package/src/voice/voice.test.ts +433 -2
  59. package/dist/chunk-GKPCIQPB.js +0 -1
  60. package/dist/client-stream-42FOI3EC.js +0 -4
  61. package/dist/voice-runtime-XLU6YK2N.js +0 -17
@@ -7089,6 +7089,11 @@ interface VoiceProvider {
7089
7089
  setSessionBridge?(bridge: VoiceSessionBridge): void;
7090
7090
  /** The AI-disclosure notice for the live call, if one should show (speech-to-speech). */
7091
7091
  getDisclosure?(): string | null;
7092
+ /**
7093
+ * Status-line text for the call, returned once: why the server ended it
7094
+ * (`session_end`) or that it is reconnecting. `null` when there is none.
7095
+ */
7096
+ takeNotice?(): string | null;
7092
7097
  }
7093
7098
  /** Metadata on a {@link VoiceProvider.onTranscript} update. */
7094
7099
  type VoiceTranscriptMetadata = {
@@ -7120,6 +7125,13 @@ type VoiceDelegationRequest = {
7120
7125
  role: string;
7121
7126
  content: unknown;
7122
7127
  }>;
7128
+ /**
7129
+ * Set when the server streams delegated answers (`delegation_stream`): called
7130
+ * with each speakable piece of the turn's answer, in order, while it renders.
7131
+ * The pieces, concatenated, are a prefix of the result's `text`; the result
7132
+ * says how much of it with `streamedChars`.
7133
+ */
7134
+ stream?: (text: string) => void;
7123
7135
  };
7124
7136
  /**
7125
7137
  * How a delegated turn ended, or that it waits on an approval (contract
@@ -7150,6 +7162,12 @@ type VoiceDelegationResult = {
7150
7162
  * @default true
7151
7163
  */
7152
7164
  inChat?: boolean;
7165
+ /**
7166
+ * How many leading characters of `text` already went out through
7167
+ * `request.stream` (the rest, such as an approval script, is unstreamed).
7168
+ * Omitted or 0: nothing was streamed.
7169
+ */
7170
+ streamedChars?: number;
7153
7171
  /**
7154
7172
  * Set when the turn parked on approvals (`text` then asks for the decision).
7155
7173
  * Resolves with the terminal result once the visitor decides (or the
@@ -7089,6 +7089,11 @@ interface VoiceProvider {
7089
7089
  setSessionBridge?(bridge: VoiceSessionBridge): void;
7090
7090
  /** The AI-disclosure notice for the live call, if one should show (speech-to-speech). */
7091
7091
  getDisclosure?(): string | null;
7092
+ /**
7093
+ * Status-line text for the call, returned once: why the server ended it
7094
+ * (`session_end`) or that it is reconnecting. `null` when there is none.
7095
+ */
7096
+ takeNotice?(): string | null;
7092
7097
  }
7093
7098
  /** Metadata on a {@link VoiceProvider.onTranscript} update. */
7094
7099
  type VoiceTranscriptMetadata = {
@@ -7120,6 +7125,13 @@ type VoiceDelegationRequest = {
7120
7125
  role: string;
7121
7126
  content: unknown;
7122
7127
  }>;
7128
+ /**
7129
+ * Set when the server streams delegated answers (`delegation_stream`): called
7130
+ * with each speakable piece of the turn's answer, in order, while it renders.
7131
+ * The pieces, concatenated, are a prefix of the result's `text`; the result
7132
+ * says how much of it with `streamedChars`.
7133
+ */
7134
+ stream?: (text: string) => void;
7123
7135
  };
7124
7136
  /**
7125
7137
  * How a delegated turn ended, or that it waits on an approval (contract
@@ -7150,6 +7162,12 @@ type VoiceDelegationResult = {
7150
7162
  * @default true
7151
7163
  */
7152
7164
  inChat?: boolean;
7165
+ /**
7166
+ * How many leading characters of `text` already went out through
7167
+ * `request.stream` (the rest, such as an approval script, is unstreamed).
7168
+ * Omitted or 0: nothing was streamed.
7169
+ */
7170
+ streamedChars?: number;
7153
7171
  /**
7154
7172
  * Set when the turn parked on approvals (`text` then asks for the decision).
7155
7173
  * Resolves with the terminal result once the visitor decides (or the
@@ -7258,6 +7258,11 @@ interface VoiceProvider {
7258
7258
  setSessionBridge?(bridge: VoiceSessionBridge): void;
7259
7259
  /** The AI-disclosure notice for the live call, if one should show (speech-to-speech). */
7260
7260
  getDisclosure?(): string | null;
7261
+ /**
7262
+ * Status-line text for the call, returned once: why the server ended it
7263
+ * (`session_end`) or that it is reconnecting. `null` when there is none.
7264
+ */
7265
+ takeNotice?(): string | null;
7261
7266
  }
7262
7267
  /** Metadata on a {@link VoiceProvider.onTranscript} update. */
7263
7268
  type VoiceTranscriptMetadata = {
@@ -7289,6 +7294,13 @@ type VoiceDelegationRequest = {
7289
7294
  role: string;
7290
7295
  content: unknown;
7291
7296
  }>;
7297
+ /**
7298
+ * Set when the server streams delegated answers (`delegation_stream`): called
7299
+ * with each speakable piece of the turn's answer, in order, while it renders.
7300
+ * The pieces, concatenated, are a prefix of the result's `text`; the result
7301
+ * says how much of it with `streamedChars`.
7302
+ */
7303
+ stream?: (text: string) => void;
7292
7304
  };
7293
7305
  /**
7294
7306
  * How a delegated turn ended, or that it waits on an approval (contract
@@ -7319,6 +7331,12 @@ type VoiceDelegationResult = {
7319
7331
  * @default true
7320
7332
  */
7321
7333
  inChat?: boolean;
7334
+ /**
7335
+ * How many leading characters of `text` already went out through
7336
+ * `request.stream` (the rest, such as an approval script, is unstreamed).
7337
+ * Omitted or 0: nothing was streamed.
7338
+ */
7339
+ streamedChars?: number;
7322
7340
  /**
7323
7341
  * Set when the turn parked on approvals (`text` then asks for the decision).
7324
7342
  * Resolves with the terminal result once the visitor decides (or the
@@ -10502,6 +10520,12 @@ type DispatchOptions = {
10502
10520
  * `submitMode: "interrupt"` so the server cancels the prior run.
10503
10521
  */
10504
10522
  interrupt?: boolean;
10523
+ /**
10524
+ * Client-token only: a voice model reads the reply aloud (a delegated voice
10525
+ * turn). Sends `voice: { spoken: true }` so the server asks for a speakable
10526
+ * answer.
10527
+ */
10528
+ voiceSpoken?: boolean;
10505
10529
  };
10506
10530
  type SSEHandler = (event: AgentWidgetEvent) => void;
10507
10531
  type SSEEventCallback = (eventType: string, payload: unknown) => void;
@@ -10903,6 +10927,8 @@ declare class AgentWidgetSession {
10903
10927
  * Get current voice status
10904
10928
  */
10905
10929
  getVoiceStatus(): VoiceStatus;
10930
+ /** The voice call's pending status-line notice (why it ended, or reconnecting), once. */
10931
+ getVoiceNotice(): string | null;
10906
10932
  /** The live call's AI-disclosure notice, if it shows one. */
10907
10933
  getVoiceDisclosure(): string | null;
10908
10934
  /**
@@ -7258,6 +7258,11 @@ interface VoiceProvider {
7258
7258
  setSessionBridge?(bridge: VoiceSessionBridge): void;
7259
7259
  /** The AI-disclosure notice for the live call, if one should show (speech-to-speech). */
7260
7260
  getDisclosure?(): string | null;
7261
+ /**
7262
+ * Status-line text for the call, returned once: why the server ended it
7263
+ * (`session_end`) or that it is reconnecting. `null` when there is none.
7264
+ */
7265
+ takeNotice?(): string | null;
7261
7266
  }
7262
7267
  /** Metadata on a {@link VoiceProvider.onTranscript} update. */
7263
7268
  type VoiceTranscriptMetadata = {
@@ -7289,6 +7294,13 @@ type VoiceDelegationRequest = {
7289
7294
  role: string;
7290
7295
  content: unknown;
7291
7296
  }>;
7297
+ /**
7298
+ * Set when the server streams delegated answers (`delegation_stream`): called
7299
+ * with each speakable piece of the turn's answer, in order, while it renders.
7300
+ * The pieces, concatenated, are a prefix of the result's `text`; the result
7301
+ * says how much of it with `streamedChars`.
7302
+ */
7303
+ stream?: (text: string) => void;
7292
7304
  };
7293
7305
  /**
7294
7306
  * How a delegated turn ended, or that it waits on an approval (contract
@@ -7319,6 +7331,12 @@ type VoiceDelegationResult = {
7319
7331
  * @default true
7320
7332
  */
7321
7333
  inChat?: boolean;
7334
+ /**
7335
+ * How many leading characters of `text` already went out through
7336
+ * `request.stream` (the rest, such as an approval script, is unstreamed).
7337
+ * Omitted or 0: nothing was streamed.
7338
+ */
7339
+ streamedChars?: number;
7322
7340
  /**
7323
7341
  * Set when the turn parked on approvals (`text` then asks for the decision).
7324
7342
  * Resolves with the terminal result once the visitor decides (or the
@@ -10502,6 +10520,12 @@ type DispatchOptions = {
10502
10520
  * `submitMode: "interrupt"` so the server cancels the prior run.
10503
10521
  */
10504
10522
  interrupt?: boolean;
10523
+ /**
10524
+ * Client-token only: a voice model reads the reply aloud (a delegated voice
10525
+ * turn). Sends `voice: { spoken: true }` so the server asks for a speakable
10526
+ * answer.
10527
+ */
10528
+ voiceSpoken?: boolean;
10505
10529
  };
10506
10530
  type SSEHandler = (event: AgentWidgetEvent) => void;
10507
10531
  type SSEEventCallback = (eventType: string, payload: unknown) => void;
@@ -10903,6 +10927,8 @@ declare class AgentWidgetSession {
10903
10927
  * Get current voice status
10904
10928
  */
10905
10929
  getVoiceStatus(): VoiceStatus;
10930
+ /** The voice call's pending status-line notice (why it ended, or reconnecting), once. */
10931
+ getVoiceNotice(): string | null;
10906
10932
  /** The live call's AI-disclosure notice, if it shows one. */
10907
10933
  getVoiceDisclosure(): string | null;
10908
10934
  /**