@wildix/wilma-voice-client 0.0.5 → 0.0.7

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.
@@ -2,13 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
4
  const sha256_js_1 = require("@aws-crypto/sha256-js");
5
+ const smithy_react_native_1 = require("@wildix/smithy-react-native");
5
6
  const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
6
7
  const getRuntimeConfig = (config) => {
7
8
  const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
9
+ (0, smithy_react_native_1.installReactNativeGlobals)();
8
10
  return {
9
11
  ...browserDefaults,
10
12
  ...config,
11
13
  runtime: "react-native",
14
+ requestHandler: smithy_react_native_1.XhrHttpHandler.create(config?.requestHandler),
12
15
  sha256: config?.sha256 ?? sha256_js_1.Sha256,
13
16
  };
14
17
  };
@@ -57,8 +57,7 @@ const _VCP = "VoiceConnectParams";
57
57
  const _VE = "ValidationException";
58
58
  const _VEE = "VoiceErrorEvent";
59
59
  const _a = "action";
60
- const _aD = "agentDeployment";
61
- const _aDg = "agentDraft";
60
+ const _aD = "agentDraft";
62
61
  const _aI = "agentId";
63
62
  const _aN = "agentName";
64
63
  const _aV = "agentVersion";
@@ -374,8 +373,8 @@ exports.VoiceAudioFormat$ = [3, n1, _VAF,
374
373
  ];
375
374
  exports.VoiceConnectParams$ = [3, n1, _VCP,
376
375
  0,
377
- [_sIe, _aI, _pV, _aD, _aV, _aDg, _cI, _l, _cN, _cNa, _cE, _cC, _v, _iM, _va, _iMn, _iA, _oA],
378
- [0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, () => exports.VoiceAudioFormat$, () => exports.VoiceAudioFormat$], 2
376
+ [_sIe, _aI, _pV, _aV, _aD, _cI, _l, _cN, _cNa, _cE, _cC, _v, _iM, _va, _iMn, _iA, _oA],
377
+ [0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, () => exports.VoiceAudioFormat$, () => exports.VoiceAudioFormat$], 2
379
378
  ];
380
379
  exports.VoiceErrorEvent$ = [3, n1, _VEE,
381
380
  0,
@@ -1,11 +1,14 @@
1
1
  import { Sha256 } from "@aws-crypto/sha256-js";
2
+ import { installReactNativeGlobals, XhrHttpHandler as RequestHandler } from "@wildix/smithy-react-native";
2
3
  import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
3
4
  export const getRuntimeConfig = (config) => {
4
5
  const browserDefaults = getBrowserRuntimeConfig(config);
6
+ installReactNativeGlobals();
5
7
  return {
6
8
  ...browserDefaults,
7
9
  ...config,
8
10
  runtime: "react-native",
11
+ requestHandler: RequestHandler.create(config?.requestHandler),
9
12
  sha256: config?.sha256 ?? Sha256,
10
13
  };
11
14
  };
@@ -53,8 +53,7 @@ const _VCP = "VoiceConnectParams";
53
53
  const _VE = "ValidationException";
54
54
  const _VEE = "VoiceErrorEvent";
55
55
  const _a = "action";
56
- const _aD = "agentDeployment";
57
- const _aDg = "agentDraft";
56
+ const _aD = "agentDraft";
58
57
  const _aI = "agentId";
59
58
  const _aN = "agentName";
60
59
  const _aV = "agentVersion";
@@ -370,8 +369,8 @@ export var VoiceAudioFormat$ = [3, n1, _VAF,
370
369
  ];
371
370
  export var VoiceConnectParams$ = [3, n1, _VCP,
372
371
  0,
373
- [_sIe, _aI, _pV, _aD, _aV, _aDg, _cI, _l, _cN, _cNa, _cE, _cC, _v, _iM, _va, _iMn, _iA, _oA],
374
- [0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, () => VoiceAudioFormat$, () => VoiceAudioFormat$], 2
372
+ [_sIe, _aI, _pV, _aV, _aD, _cI, _l, _cN, _cNa, _cE, _cC, _v, _iM, _va, _iMn, _iA, _oA],
373
+ [0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, () => VoiceAudioFormat$, () => VoiceAudioFormat$], 2
375
374
  ];
376
375
  export var VoiceErrorEvent$ = [3, n1, _VEE,
377
376
  0,
@@ -52,15 +52,14 @@ export interface WilmaVoice {
52
52
  * (engine, instructions, capabilities and channels.voice settings). This is a runtime only: there
53
53
  * is no agent/bot CRUD here — agents are authored and versioned in wilma-agents.
54
54
  *
55
- * The WebSocket (transport host `wilma-voice-ws.wildix.com`) preserves the wim-voicebots message
56
- * protocol so existing PBX clients work unchanged: the PBX transcribes caller speech and sends
57
- * `transcription` / `reply` text, and the service returns `say` / `play` / `stop` / `hangup` /
58
- * `transfer`. In addition, web/app clients connect with inputMode=AUDIO and push raw caller `audio`
59
- * chunks, which the service transcribes server-side. Every WebSocket message shape (connect params,
60
- * events and commands) is declared as a structure and enumerated by DescribeVoiceProtocol so the
61
- * generated SDKs carry the types and (de)serializers; the WebSocket transport itself is hand-coded,
62
- * as in wim-voicebots. The HTTP Send* operations push the same commands into a live session
63
- * out-of-band.
55
+ * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), PBX clients transcribe caller
56
+ * speech themselves and send `transcription` / `reply` text, while web/app clients connect with
57
+ * inputMode=AUDIO and push raw caller `audio` chunks that the service transcribes server-side;
58
+ * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. Every WebSocket message
59
+ * shape (connect params, events and commands) is declared as a structure and enumerated by
60
+ * DescribeVoiceProtocol so the generated SDKs carry the types and (de)serializers; the WebSocket
61
+ * transport itself is hand-coded. The HTTP Send* operations push the same commands into a live
62
+ * session out-of-band.
64
63
  *
65
64
  * Session observability and history are recorded in wilma-traces; this service does not expose
66
65
  * bot configuration, traces or listing.
@@ -156,15 +156,14 @@ export interface WilmaVoiceClientResolvedConfig extends WilmaVoiceClientResolved
156
156
  * (engine, instructions, capabilities and channels.voice settings). This is a runtime only: there
157
157
  * is no agent/bot CRUD here — agents are authored and versioned in wilma-agents.
158
158
  *
159
- * The WebSocket (transport host `wilma-voice-ws.wildix.com`) preserves the wim-voicebots message
160
- * protocol so existing PBX clients work unchanged: the PBX transcribes caller speech and sends
161
- * `transcription` / `reply` text, and the service returns `say` / `play` / `stop` / `hangup` /
162
- * `transfer`. In addition, web/app clients connect with inputMode=AUDIO and push raw caller `audio`
163
- * chunks, which the service transcribes server-side. Every WebSocket message shape (connect params,
164
- * events and commands) is declared as a structure and enumerated by DescribeVoiceProtocol so the
165
- * generated SDKs carry the types and (de)serializers; the WebSocket transport itself is hand-coded,
166
- * as in wim-voicebots. The HTTP Send* operations push the same commands into a live session
167
- * out-of-band.
159
+ * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), PBX clients transcribe caller
160
+ * speech themselves and send `transcription` / `reply` text, while web/app clients connect with
161
+ * inputMode=AUDIO and push raw caller `audio` chunks that the service transcribes server-side;
162
+ * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. Every WebSocket message
163
+ * shape (connect params, events and commands) is declared as a structure and enumerated by
164
+ * DescribeVoiceProtocol so the generated SDKs carry the types and (de)serializers; the WebSocket
165
+ * transport itself is hand-coded. The HTTP Send* operations push the same commands into a live
166
+ * session out-of-band.
168
167
  *
169
168
  * Session observability and history are recorded in wilma-traces; this service does not expose
170
169
  * bot configuration, traces or listing.
@@ -44,7 +44,6 @@ declare const DescribeVoiceProtocolCommand_base: {
44
44
  * // protocolVersion: Number("int"),
45
45
  * // sessionId: "STRING_VALUE", // required
46
46
  * // agentId: "STRING_VALUE", // required
47
- * // agentDeployment: "STRING_VALUE",
48
47
  * // agentVersion: Number("int"),
49
48
  * // agentDraft: true || false,
50
49
  * // callId: "STRING_VALUE",
@@ -5,15 +5,14 @@
5
5
  * (engine, instructions, capabilities and channels.voice settings). This is a runtime only: there
6
6
  * is no agent/bot CRUD here — agents are authored and versioned in wilma-agents.
7
7
  *
8
- * The WebSocket (transport host `wilma-voice-ws.wildix.com`) preserves the wim-voicebots message
9
- * protocol so existing PBX clients work unchanged: the PBX transcribes caller speech and sends
10
- * `transcription` / `reply` text, and the service returns `say` / `play` / `stop` / `hangup` /
11
- * `transfer`. In addition, web/app clients connect with inputMode=AUDIO and push raw caller `audio`
12
- * chunks, which the service transcribes server-side. Every WebSocket message shape (connect params,
13
- * events and commands) is declared as a structure and enumerated by DescribeVoiceProtocol so the
14
- * generated SDKs carry the types and (de)serializers; the WebSocket transport itself is hand-coded,
15
- * as in wim-voicebots. The HTTP Send* operations push the same commands into a live session
16
- * out-of-band.
8
+ * On the WebSocket (transport host `wilma-voice-ws.wildix.com`), PBX clients transcribe caller
9
+ * speech themselves and send `transcription` / `reply` text, while web/app clients connect with
10
+ * inputMode=AUDIO and push raw caller `audio` chunks that the service transcribes server-side;
11
+ * the service returns `say` / `play` / `stop` / `hangup` / `transfer`. Every WebSocket message
12
+ * shape (connect params, events and commands) is declared as a structure and enumerated by
13
+ * DescribeVoiceProtocol so the generated SDKs carry the types and (de)serializers; the WebSocket
14
+ * transport itself is hand-coded. The HTTP Send* operations push the same commands into a live
15
+ * session out-of-band.
17
16
  *
18
17
  * Session observability and history are recorded in wilma-traces; this service does not expose
19
18
  * bot configuration, traces or listing.
@@ -76,7 +76,7 @@ export declare const VoiceInputMode: {
76
76
  */
77
77
  readonly AUDIO: "audio";
78
78
  /**
79
- * The client sends `transcription` / `reply` text events; it performs speech-to-text itself (PBX behaviour, same as wim-voicebots).
79
+ * The client sends `transcription` / `reply` text events; it performs speech-to-text itself (PBX behaviour).
80
80
  */
81
81
  readonly TRANSCRIPTION: "transcription";
82
82
  };
@@ -117,7 +117,7 @@ export interface VoiceAudioFormat {
117
117
  */
118
118
  export interface VoiceConnectParams {
119
119
  /**
120
- * Protocol version advertised by the client (wim-voicebots `v`). 0 (or absent) is the legacy PBX protocol; >= 1 enables the sessionStarted event.
120
+ * Protocol version advertised by the client (query parameter `v`). 0 (or absent) is the legacy PBX protocol; >= 1 enables the sessionStarted event.
121
121
  * @public
122
122
  */
123
123
  protocolVersion?: number | undefined;
@@ -132,17 +132,12 @@ export interface VoiceConnectParams {
132
132
  */
133
133
  agentId: string;
134
134
  /**
135
- * Deployment used to resolve the published agent version. Defaults to 'production'. Mutually exclusive with agentVersion and agentDraft.
136
- * @public
137
- */
138
- agentDeployment?: string | undefined;
139
- /**
140
- * Published agent version to run. Mutually exclusive with agentDeployment and agentDraft.
135
+ * Published agent version to run. Mutually exclusive with agentDraft. When neither is set, the agent's deployment configuration selects the version.
141
136
  * @public
142
137
  */
143
138
  agentVersion?: number | undefined;
144
139
  /**
145
- * Run the agent's current draft (for testing). Mutually exclusive with agentDeployment and agentVersion.
140
+ * Run the agent's current draft (for testing). Mutually exclusive with agentVersion.
146
141
  * @public
147
142
  */
148
143
  agentDraft?: boolean | undefined;
@@ -1,11 +1,12 @@
1
+ import { XhrHttpHandler as RequestHandler } from "@wildix/smithy-react-native";
1
2
  import type { WilmaVoiceClientConfig } from "./WilmaVoiceClient";
2
3
  /**
3
4
  * @internal
4
5
  */
5
6
  export declare const getRuntimeConfig: (config: WilmaVoiceClientConfig) => {
6
7
  runtime: string;
8
+ requestHandler: RequestHandler;
7
9
  sha256: import("@smithy/types").HashConstructor;
8
- requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/core/protocols").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
9
10
  cacheMiddleware?: boolean;
10
11
  protocol: import("@smithy/types").ClientProtocol<any, any> | import("@smithy/types").ClientProtocolCtor<any, any> | typeof import("@aws-sdk/core/protocols").AwsRestJsonProtocol;
11
12
  protocolSettings: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wilma-voice-client",
3
3
  "description": "@wildix/wilma-voice-client client",
4
- "version": "0.0.5",
4
+ "version": "0.0.7",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -24,7 +24,8 @@
24
24
  "@smithy/core": "^3.24.5",
25
25
  "@smithy/fetch-http-handler": "^5.4.5",
26
26
  "@smithy/node-http-handler": "^4.7.5",
27
- "@smithy/types": "^4.14.2"
27
+ "@smithy/types": "^4.14.2",
28
+ "@wildix/smithy-react-native": "^1.0.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@tsconfig/node20": "20.1.8",
@@ -48,10 +49,11 @@
48
49
  "dist-*/**"
49
50
  ],
50
51
  "license": "Apache-2.0",
51
- "browser": {
52
- "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
53
- },
54
52
  "react-native": {
53
+ "@aws-sdk/core/client": "@aws-sdk/core/dist-es/submodules/client/index.native.js",
55
54
  "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
55
+ },
56
+ "browser": {
57
+ "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
56
58
  }
57
59
  }