@signalwire/sdk 2.0.5 → 3.5.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 (656) hide show
  1. package/CHANGELOG.md +785 -0
  2. package/LICENSE +21 -0
  3. package/README.md +163 -68
  4. package/dist/AGENTS.md +13 -0
  5. package/dist/AgentBase.d.ts +481 -126
  6. package/dist/AgentBase.js +1502 -438
  7. package/dist/AgentBase.js.map +1 -1
  8. package/dist/AgentServer.d.ts +21 -0
  9. package/dist/AgentServer.js +154 -47
  10. package/dist/AgentServer.js.map +1 -1
  11. package/dist/AuthHandler.d.ts +14 -2
  12. package/dist/AuthHandler.js +7 -2
  13. package/dist/AuthHandler.js.map +1 -1
  14. package/dist/ConfigLoader.d.ts +5 -13
  15. package/dist/ConfigLoader.js +15 -29
  16. package/dist/ConfigLoader.js.map +1 -1
  17. package/dist/ContextBuilder.d.ts +202 -9
  18. package/dist/ContextBuilder.js +219 -36
  19. package/dist/ContextBuilder.js.map +1 -1
  20. package/dist/DataMap.d.ts +158 -45
  21. package/dist/DataMap.js +167 -52
  22. package/dist/DataMap.js.map +1 -1
  23. package/dist/FunctionResult.d.ts +277 -83
  24. package/dist/FunctionResult.js +444 -116
  25. package/dist/FunctionResult.js.map +1 -1
  26. package/dist/Logger.d.ts +30 -5
  27. package/dist/Logger.js +77 -19
  28. package/dist/Logger.js.map +1 -1
  29. package/dist/POM/PromptObjectModel.d.ts +12 -1
  30. package/dist/POM/PromptObjectModel.js +25 -9
  31. package/dist/POM/PromptObjectModel.js.map +1 -1
  32. package/dist/ParameterSchema.d.ts +306 -0
  33. package/dist/ParameterSchema.js +251 -0
  34. package/dist/ParameterSchema.js.map +1 -0
  35. package/dist/PlatformContracts.d.ts +21 -0
  36. package/dist/PlatformContracts.generated.d.ts +109 -0
  37. package/dist/PlatformContracts.generated.js +8 -0
  38. package/dist/PlatformContracts.generated.js.map +1 -0
  39. package/dist/PlatformContracts.js +2 -0
  40. package/dist/PlatformContracts.js.map +1 -0
  41. package/dist/PomBuilder.d.ts +18 -0
  42. package/dist/PomBuilder.js +53 -3
  43. package/dist/PomBuilder.js.map +1 -1
  44. package/dist/PostPrompt.d.ts +110 -0
  45. package/dist/PostPrompt.js +204 -0
  46. package/dist/PostPrompt.js.map +1 -0
  47. package/dist/PromptManager.d.ts +22 -1
  48. package/dist/PromptManager.js +28 -1
  49. package/dist/PromptManager.js.map +1 -1
  50. package/dist/PublicFetch.d.ts +132 -0
  51. package/dist/PublicFetch.js +311 -0
  52. package/dist/PublicFetch.js.map +1 -0
  53. package/dist/RobotsTxt.d.ts +41 -0
  54. package/dist/RobotsTxt.js +152 -0
  55. package/dist/RobotsTxt.js.map +1 -0
  56. package/dist/SWMLHandler.js.map +1 -1
  57. package/dist/SWMLService.d.ts +158 -58
  58. package/dist/SWMLService.js +435 -127
  59. package/dist/SWMLService.js.map +1 -1
  60. package/dist/SchemaUtils.d.ts +115 -2
  61. package/dist/SchemaUtils.js +444 -12
  62. package/dist/SchemaUtils.js.map +1 -1
  63. package/dist/SecurityUtils.d.ts +49 -9
  64. package/dist/SecurityUtils.js +153 -51
  65. package/dist/SecurityUtils.js.map +1 -1
  66. package/dist/ServerlessAdapter.d.ts +156 -7
  67. package/dist/ServerlessAdapter.js +399 -42
  68. package/dist/ServerlessAdapter.js.map +1 -1
  69. package/dist/SessionManager.d.ts +11 -2
  70. package/dist/SessionManager.js +50 -18
  71. package/dist/SessionManager.js.map +1 -1
  72. package/dist/SslConfig.d.ts +2 -1
  73. package/dist/SslConfig.js +4 -1
  74. package/dist/SslConfig.js.map +1 -1
  75. package/dist/SwaigActions.generated.d.ts +23 -0
  76. package/dist/SwaigActions.generated.js +8 -0
  77. package/dist/SwaigActions.generated.js.map +1 -0
  78. package/dist/SwaigContracts.d.ts +15 -0
  79. package/dist/SwaigContracts.generated.d.ts +264 -0
  80. package/dist/SwaigContracts.generated.js +12 -0
  81. package/dist/SwaigContracts.generated.js.map +1 -0
  82. package/dist/SwaigContracts.js +2 -0
  83. package/dist/SwaigContracts.js.map +1 -0
  84. package/dist/SwaigFunction.d.ts +110 -4
  85. package/dist/SwaigFunction.js +151 -19
  86. package/dist/SwaigFunction.js.map +1 -1
  87. package/dist/SwmlBuilder.d.ts +68 -19
  88. package/dist/SwmlBuilder.js +74 -38
  89. package/dist/SwmlBuilder.js.map +1 -1
  90. package/dist/SwmlVerbMethods.generated.d.ts +41 -4
  91. package/dist/SwmlVerbMethods.generated.js +1 -1
  92. package/dist/TypeInference.d.ts +39 -3
  93. package/dist/TypeInference.js +256 -16
  94. package/dist/TypeInference.js.map +1 -1
  95. package/dist/WebService.d.ts +79 -11
  96. package/dist/WebService.js +320 -109
  97. package/dist/WebService.js.map +1 -1
  98. package/dist/WebhookMiddleware.d.ts +119 -0
  99. package/dist/WebhookMiddleware.js +271 -0
  100. package/dist/WebhookMiddleware.js.map +1 -0
  101. package/dist/WebhookValidator.d.ts +92 -0
  102. package/dist/WebhookValidator.js +409 -0
  103. package/dist/WebhookValidator.js.map +1 -0
  104. package/dist/agents/BedrockAgent.d.ts +162 -0
  105. package/dist/agents/BedrockAgent.js +323 -0
  106. package/dist/agents/BedrockAgent.js.map +1 -0
  107. package/dist/ai-chat/AIChatClient.d.ts +316 -0
  108. package/dist/ai-chat/AIChatClient.js +535 -0
  109. package/dist/ai-chat/AIChatClient.js.map +1 -0
  110. package/dist/ai-chat/ChatGateway.d.ts +408 -0
  111. package/dist/ai-chat/ChatGateway.js +747 -0
  112. package/dist/ai-chat/ChatGateway.js.map +1 -0
  113. package/dist/ai-chat/HandoffRouter.d.ts +282 -0
  114. package/dist/ai-chat/HandoffRouter.js +518 -0
  115. package/dist/ai-chat/HandoffRouter.js.map +1 -0
  116. package/dist/ai-chat/index.d.ts +12 -0
  117. package/dist/ai-chat/index.js +10 -0
  118. package/dist/ai-chat/index.js.map +1 -0
  119. package/dist/capabilities.d.ts +64 -0
  120. package/dist/capabilities.js +95 -0
  121. package/dist/capabilities.js.map +1 -0
  122. package/dist/cli/agent-loader.d.ts +32 -6
  123. package/dist/cli/agent-loader.js +92 -33
  124. package/dist/cli/agent-loader.js.map +1 -1
  125. package/dist/cli/datamap-exec.d.ts +175 -0
  126. package/dist/cli/datamap-exec.js +1284 -0
  127. package/dist/cli/datamap-exec.js.map +1 -0
  128. package/dist/cli/function-args.d.ts +40 -0
  129. package/dist/cli/function-args.js +146 -0
  130. package/dist/cli/function-args.js.map +1 -0
  131. package/dist/cli/simulation.d.ts +99 -0
  132. package/dist/cli/simulation.js +490 -0
  133. package/dist/cli/simulation.js.map +1 -0
  134. package/dist/cli/swaig-test.d.ts +12 -25
  135. package/dist/cli/swaig-test.js +935 -371
  136. package/dist/cli/swaig-test.js.map +1 -1
  137. package/dist/cli/tsdocs/agentsNote.d.ts +30 -0
  138. package/dist/cli/tsdocs/agentsNote.js +92 -0
  139. package/dist/cli/tsdocs/agentsNote.js.map +1 -0
  140. package/dist/cli/tsdocs/api-index.json +1 -0
  141. package/dist/cli/tsdocs/api.d.ts +91 -0
  142. package/dist/cli/tsdocs/api.js +372 -0
  143. package/dist/cli/tsdocs/api.js.map +1 -0
  144. package/dist/cli/tsdocs/apiTypes.d.ts +64 -0
  145. package/dist/cli/tsdocs/apiTypes.js +7 -0
  146. package/dist/cli/tsdocs/apiTypes.js.map +1 -0
  147. package/dist/cli/tsdocs/bin.d.ts +6 -0
  148. package/dist/cli/tsdocs/bin.js +23 -0
  149. package/dist/cli/tsdocs/bin.js.map +1 -0
  150. package/dist/cli/tsdocs/files.d.ts +108 -0
  151. package/dist/cli/tsdocs/files.js +287 -0
  152. package/dist/cli/tsdocs/files.js.map +1 -0
  153. package/dist/cli/tsdocs/index.d.ts +28 -0
  154. package/dist/cli/tsdocs/index.js +307 -0
  155. package/dist/cli/tsdocs/index.js.map +1 -0
  156. package/dist/cli/tsdocs/live.d.ts +41 -0
  157. package/dist/cli/tsdocs/live.js +202 -0
  158. package/dist/cli/tsdocs/live.js.map +1 -0
  159. package/dist/cli/tsdocs/locate.d.ts +51 -0
  160. package/dist/cli/tsdocs/locate.js +75 -0
  161. package/dist/cli/tsdocs/locate.js.map +1 -0
  162. package/dist/cli/tsdocs/render.d.ts +75 -0
  163. package/dist/cli/tsdocs/render.js +323 -0
  164. package/dist/cli/tsdocs/render.js.map +1 -0
  165. package/dist/cli/tsdocs/topics.d.ts +43 -0
  166. package/dist/cli/tsdocs/topics.js +916 -0
  167. package/dist/cli/tsdocs/topics.js.map +1 -0
  168. package/dist/index.d.ts +47 -68
  169. package/dist/index.js +44 -73
  170. package/dist/index.js.map +1 -1
  171. package/dist/livewire/index.d.ts +229 -155
  172. package/dist/livewire/index.js +298 -195
  173. package/dist/livewire/index.js.map +1 -1
  174. package/dist/llms.txt +65 -0
  175. package/dist/prefabs/CallSessionStore.d.ts +52 -0
  176. package/dist/prefabs/CallSessionStore.js +72 -0
  177. package/dist/prefabs/CallSessionStore.js.map +1 -0
  178. package/dist/prefabs/ConciergeAgent.d.ts +13 -1
  179. package/dist/prefabs/ConciergeAgent.js +36 -31
  180. package/dist/prefabs/ConciergeAgent.js.map +1 -1
  181. package/dist/prefabs/FAQBotAgent.d.ts +9 -1
  182. package/dist/prefabs/FAQBotAgent.js +113 -47
  183. package/dist/prefabs/FAQBotAgent.js.map +1 -1
  184. package/dist/prefabs/InfoGathererAgent.d.ts +22 -3
  185. package/dist/prefabs/InfoGathererAgent.js +67 -58
  186. package/dist/prefabs/InfoGathererAgent.js.map +1 -1
  187. package/dist/prefabs/ReceptionistAgent.d.ts +16 -5
  188. package/dist/prefabs/ReceptionistAgent.js +39 -31
  189. package/dist/prefabs/ReceptionistAgent.js.map +1 -1
  190. package/dist/prefabs/SurveyAgent.d.ts +22 -4
  191. package/dist/prefabs/SurveyAgent.js +84 -68
  192. package/dist/prefabs/SurveyAgent.js.map +1 -1
  193. package/dist/relay/Action.d.ts +44 -21
  194. package/dist/relay/Action.js +75 -17
  195. package/dist/relay/Action.js.map +1 -1
  196. package/dist/relay/Call.d.ts +312 -47
  197. package/dist/relay/Call.js +369 -18
  198. package/dist/relay/Call.js.map +1 -1
  199. package/dist/relay/Deferred.js.map +1 -1
  200. package/dist/relay/Message.d.ts +26 -5
  201. package/dist/relay/Message.js +36 -6
  202. package/dist/relay/Message.js.map +1 -1
  203. package/dist/relay/RelayClient.d.ts +44 -17
  204. package/dist/relay/RelayClient.js +175 -65
  205. package/dist/relay/RelayClient.js.map +1 -1
  206. package/dist/relay/RelayError.d.ts +14 -0
  207. package/dist/relay/RelayError.js +15 -0
  208. package/dist/relay/RelayError.js.map +1 -1
  209. package/dist/relay/RelayEvent.d.ts +96 -65
  210. package/dist/relay/RelayEvent.js +85 -56
  211. package/dist/relay/RelayEvent.js.map +1 -1
  212. package/dist/relay/closedSets.d.ts +111 -0
  213. package/dist/relay/closedSets.js +83 -0
  214. package/dist/relay/closedSets.js.map +1 -0
  215. package/dist/relay/index.d.ts +3 -1
  216. package/dist/relay/index.js +1 -0
  217. package/dist/relay/index.js.map +1 -1
  218. package/dist/relay/normalize.js.map +1 -1
  219. package/dist/relay/protocol.types.generated.d.ts +1195 -0
  220. package/dist/relay/protocol.types.generated.js +8 -0
  221. package/dist/relay/protocol.types.generated.js.map +1 -0
  222. package/dist/relay/types.d.ts +73 -42
  223. package/dist/rest/HttpClient.d.ts +36 -8
  224. package/dist/rest/HttpClient.js +233 -40
  225. package/dist/rest/HttpClient.js.map +1 -1
  226. package/dist/rest/RequestOptions.d.ts +110 -0
  227. package/dist/rest/RequestOptions.js +113 -0
  228. package/dist/rest/RequestOptions.js.map +1 -0
  229. package/dist/rest/RestError.d.ts +52 -6
  230. package/dist/rest/RestError.js +89 -5
  231. package/dist/rest/RestError.js.map +1 -1
  232. package/dist/rest/base/CrudResource.d.ts +16 -26
  233. package/dist/rest/base/CrudResource.js +19 -33
  234. package/dist/rest/base/CrudResource.js.map +1 -1
  235. package/dist/rest/base/CrudWithAddresses.d.ts +3 -2
  236. package/dist/rest/base/CrudWithAddresses.js +2 -2
  237. package/dist/rest/base/CrudWithAddresses.js.map +1 -1
  238. package/dist/rest/base/FabricResource.d.ts +15 -0
  239. package/dist/rest/base/FabricResource.js +16 -0
  240. package/dist/rest/base/FabricResource.js.map +1 -0
  241. package/dist/rest/base/ReadResource.d.ts +62 -0
  242. package/dist/rest/base/ReadResource.js +69 -0
  243. package/dist/rest/base/ReadResource.js.map +1 -0
  244. package/dist/rest/callHandler.d.ts +5 -2
  245. package/dist/rest/callHandler.js +4 -1
  246. package/dist/rest/callHandler.js.map +1 -1
  247. package/dist/rest/index.d.ts +18 -77
  248. package/dist/rest/index.js +47 -120
  249. package/dist/rest/index.js.map +1 -1
  250. package/dist/rest/namespaces/_client_tree_generated.d.ts +103 -0
  251. package/dist/rest/namespaces/_client_tree_generated.js +171 -0
  252. package/dist/rest/namespaces/_client_tree_generated.js.map +1 -0
  253. package/dist/rest/namespaces/addresses.d.ts +3 -42
  254. package/dist/rest/namespaces/addresses.js +3 -50
  255. package/dist/rest/namespaces/addresses.js.map +1 -1
  256. package/dist/rest/namespaces/calling.d.ts +6 -378
  257. package/dist/rest/namespaces/calling.js +6 -473
  258. package/dist/rest/namespaces/calling.js.map +1 -1
  259. package/dist/rest/namespaces/calling.resources.generated.d.ts +165 -0
  260. package/dist/rest/namespaces/calling.resources.generated.js +477 -0
  261. package/dist/rest/namespaces/calling.resources.generated.js.map +1 -0
  262. package/dist/rest/namespaces/calling.types.generated.d.ts +2917 -0
  263. package/dist/rest/namespaces/calling.types.generated.js +8 -0
  264. package/dist/rest/namespaces/calling.types.generated.js.map +1 -0
  265. package/dist/rest/namespaces/chat.d.ts +4 -18
  266. package/dist/rest/namespaces/chat.js +4 -21
  267. package/dist/rest/namespaces/chat.js.map +1 -1
  268. package/dist/rest/namespaces/chat.resources.generated.d.ts +12 -0
  269. package/dist/rest/namespaces/chat.resources.generated.js +29 -0
  270. package/dist/rest/namespaces/chat.resources.generated.js.map +1 -0
  271. package/dist/rest/namespaces/chat.types.generated.d.ts +56 -0
  272. package/dist/rest/namespaces/chat.types.generated.js +8 -0
  273. package/dist/rest/namespaces/chat.types.generated.js.map +1 -0
  274. package/dist/rest/namespaces/datasphere.d.ts +6 -62
  275. package/dist/rest/namespaces/datasphere.js +6 -72
  276. package/dist/rest/namespaces/datasphere.js.map +1 -1
  277. package/dist/rest/namespaces/datasphere.resources.generated.d.ts +25 -0
  278. package/dist/rest/namespaces/datasphere.resources.generated.js +50 -0
  279. package/dist/rest/namespaces/datasphere.resources.generated.js.map +1 -0
  280. package/dist/rest/namespaces/datasphere.types.generated.d.ts +180 -0
  281. package/dist/rest/namespaces/datasphere.types.generated.js +8 -0
  282. package/dist/rest/namespaces/datasphere.types.generated.js.map +1 -0
  283. package/dist/rest/namespaces/fabric.d.ts +11 -327
  284. package/dist/rest/namespaces/fabric.js +14 -439
  285. package/dist/rest/namespaces/fabric.js.map +1 -1
  286. package/dist/rest/namespaces/fabric.resources.generated.d.ts +195 -0
  287. package/dist/rest/namespaces/fabric.resources.generated.js +399 -0
  288. package/dist/rest/namespaces/fabric.resources.generated.js.map +1 -0
  289. package/dist/rest/namespaces/fabric.types.generated.d.ts +4557 -0
  290. package/dist/rest/namespaces/fabric.types.generated.js +8 -0
  291. package/dist/rest/namespaces/fabric.types.generated.js.map +1 -0
  292. package/dist/rest/namespaces/fax.resources.generated.d.ts +6 -0
  293. package/dist/rest/namespaces/fax.resources.generated.js +14 -0
  294. package/dist/rest/namespaces/fax.resources.generated.js.map +1 -0
  295. package/dist/rest/namespaces/fax.types.generated.d.ts +131 -0
  296. package/dist/rest/namespaces/fax.types.generated.js +8 -0
  297. package/dist/rest/namespaces/fax.types.generated.js.map +1 -0
  298. package/dist/rest/namespaces/imported-numbers.d.ts +3 -18
  299. package/dist/rest/namespaces/imported-numbers.js +3 -21
  300. package/dist/rest/namespaces/imported-numbers.js.map +1 -1
  301. package/dist/rest/namespaces/logs.d.ts +10 -101
  302. package/dist/rest/namespaces/logs.js +10 -128
  303. package/dist/rest/namespaces/logs.js.map +1 -1
  304. package/dist/rest/namespaces/logs.resources.generated.d.ts +9 -0
  305. package/dist/rest/namespaces/logs.resources.generated.js +17 -0
  306. package/dist/rest/namespaces/logs.resources.generated.js.map +1 -0
  307. package/dist/rest/namespaces/logs.types.generated.d.ts +131 -0
  308. package/dist/rest/namespaces/logs.types.generated.js +8 -0
  309. package/dist/rest/namespaces/logs.types.generated.js.map +1 -0
  310. package/dist/rest/namespaces/lookup.d.ts +3 -25
  311. package/dist/rest/namespaces/lookup.js +3 -27
  312. package/dist/rest/namespaces/lookup.js.map +1 -1
  313. package/dist/rest/namespaces/message.resources.generated.d.ts +6 -0
  314. package/dist/rest/namespaces/message.resources.generated.js +14 -0
  315. package/dist/rest/namespaces/message.resources.generated.js.map +1 -0
  316. package/dist/rest/namespaces/message.types.generated.d.ts +122 -0
  317. package/dist/rest/namespaces/message.types.generated.js +8 -0
  318. package/dist/rest/namespaces/message.types.generated.js.map +1 -0
  319. package/dist/rest/namespaces/messages.resources.generated.d.ts +18 -0
  320. package/dist/rest/namespaces/messages.resources.generated.js +44 -0
  321. package/dist/rest/namespaces/messages.resources.generated.js.map +1 -0
  322. package/dist/rest/namespaces/messages.types.generated.d.ts +99 -0
  323. package/dist/rest/namespaces/messages.types.generated.js +8 -0
  324. package/dist/rest/namespaces/messages.types.generated.js.map +1 -0
  325. package/dist/rest/namespaces/mfa.d.ts +3 -42
  326. package/dist/rest/namespaces/mfa.js +3 -49
  327. package/dist/rest/namespaces/mfa.js.map +1 -1
  328. package/dist/rest/namespaces/number-groups.d.ts +3 -45
  329. package/dist/rest/namespaces/number-groups.js +3 -53
  330. package/dist/rest/namespaces/number-groups.js.map +1 -1
  331. package/dist/rest/namespaces/phone-numbers.d.ts +8 -196
  332. package/dist/rest/namespaces/phone-numbers.js +8 -230
  333. package/dist/rest/namespaces/phone-numbers.js.map +1 -1
  334. package/dist/rest/namespaces/project.d.ts +6 -42
  335. package/dist/rest/namespaces/project.js +6 -51
  336. package/dist/rest/namespaces/project.js.map +1 -1
  337. package/dist/rest/namespaces/project.resources.generated.d.ts +17 -0
  338. package/dist/rest/namespaces/project.resources.generated.js +44 -0
  339. package/dist/rest/namespaces/project.resources.generated.js.map +1 -0
  340. package/dist/rest/namespaces/project.types.generated.d.ts +58 -0
  341. package/dist/rest/namespaces/project.types.generated.js +8 -0
  342. package/dist/rest/namespaces/project.types.generated.js.map +1 -0
  343. package/dist/rest/namespaces/projects.resources.generated.d.ts +12 -0
  344. package/dist/rest/namespaces/projects.resources.generated.js +25 -0
  345. package/dist/rest/namespaces/projects.resources.generated.js.map +1 -0
  346. package/dist/rest/namespaces/projects.types.generated.d.ts +77 -0
  347. package/dist/rest/namespaces/projects.types.generated.js +8 -0
  348. package/dist/rest/namespaces/projects.types.generated.js.map +1 -0
  349. package/dist/rest/namespaces/pubsub.d.ts +4 -18
  350. package/dist/rest/namespaces/pubsub.js +4 -21
  351. package/dist/rest/namespaces/pubsub.js.map +1 -1
  352. package/dist/rest/namespaces/pubsub.resources.generated.d.ts +12 -0
  353. package/dist/rest/namespaces/pubsub.resources.generated.js +29 -0
  354. package/dist/rest/namespaces/pubsub.resources.generated.js.map +1 -0
  355. package/dist/rest/namespaces/pubsub.types.generated.d.ts +60 -0
  356. package/dist/rest/namespaces/pubsub.types.generated.js +8 -0
  357. package/dist/rest/namespaces/pubsub.types.generated.js.map +1 -0
  358. package/dist/rest/namespaces/queues.d.ts +3 -38
  359. package/dist/rest/namespaces/queues.js +3 -44
  360. package/dist/rest/namespaces/queues.js.map +1 -1
  361. package/dist/rest/namespaces/recordings.d.ts +3 -34
  362. package/dist/rest/namespaces/recordings.js +3 -40
  363. package/dist/rest/namespaces/recordings.js.map +1 -1
  364. package/dist/rest/namespaces/registry.d.ts +6 -137
  365. package/dist/rest/namespaces/registry.js +6 -173
  366. package/dist/rest/namespaces/registry.js.map +1 -1
  367. package/dist/rest/namespaces/relay-rest.resources.generated.d.ts +168 -0
  368. package/dist/rest/namespaces/relay-rest.resources.generated.js +430 -0
  369. package/dist/rest/namespaces/relay-rest.resources.generated.js.map +1 -0
  370. package/dist/rest/namespaces/relay-rest.types.generated.d.ts +1906 -0
  371. package/dist/rest/namespaces/relay-rest.types.generated.js +8 -0
  372. package/dist/rest/namespaces/relay-rest.types.generated.js.map +1 -0
  373. package/dist/rest/namespaces/short-codes.d.ts +3 -35
  374. package/dist/rest/namespaces/short-codes.js +3 -41
  375. package/dist/rest/namespaces/short-codes.js.map +1 -1
  376. package/dist/rest/namespaces/sip-profile.d.ts +3 -24
  377. package/dist/rest/namespaces/sip-profile.js +3 -29
  378. package/dist/rest/namespaces/sip-profile.js.map +1 -1
  379. package/dist/rest/namespaces/verified-callers.d.ts +3 -29
  380. package/dist/rest/namespaces/verified-callers.js +3 -34
  381. package/dist/rest/namespaces/verified-callers.js.map +1 -1
  382. package/dist/rest/namespaces/video.d.ts +10 -227
  383. package/dist/rest/namespaces/video.js +10 -288
  384. package/dist/rest/namespaces/video.js.map +1 -1
  385. package/dist/rest/namespaces/video.resources.generated.d.ts +81 -0
  386. package/dist/rest/namespaces/video.resources.generated.js +171 -0
  387. package/dist/rest/namespaces/video.resources.generated.js.map +1 -0
  388. package/dist/rest/namespaces/video.types.generated.d.ts +771 -0
  389. package/dist/rest/namespaces/video.types.generated.js +8 -0
  390. package/dist/rest/namespaces/video.types.generated.js.map +1 -0
  391. package/dist/rest/namespaces/voice.resources.generated.d.ts +9 -0
  392. package/dist/rest/namespaces/voice.resources.generated.js +17 -0
  393. package/dist/rest/namespaces/voice.resources.generated.js.map +1 -0
  394. package/dist/rest/namespaces/voice.types.generated.d.ts +214 -0
  395. package/dist/rest/namespaces/voice.types.generated.js +8 -0
  396. package/dist/rest/namespaces/voice.types.generated.js.map +1 -0
  397. package/dist/rest/pagination.d.ts +5 -1
  398. package/dist/rest/pagination.js +40 -20
  399. package/dist/rest/pagination.js.map +1 -1
  400. package/dist/rest/types.d.ts +21 -3
  401. package/dist/schema.json +299 -98
  402. package/dist/skills/SkillBase.d.ts +97 -20
  403. package/dist/skills/SkillBase.js +100 -17
  404. package/dist/skills/SkillBase.js.map +1 -1
  405. package/dist/skills/SkillManager.d.ts +66 -13
  406. package/dist/skills/SkillManager.js +101 -20
  407. package/dist/skills/SkillManager.js.map +1 -1
  408. package/dist/skills/SkillName.d.ts +44 -0
  409. package/dist/skills/SkillName.js +2 -0
  410. package/dist/skills/SkillName.js.map +1 -0
  411. package/dist/skills/SkillRegistry.d.ts +22 -11
  412. package/dist/skills/SkillRegistry.js +47 -17
  413. package/dist/skills/SkillRegistry.js.map +1 -1
  414. package/dist/skills/builtin/api_ninjas_trivia.d.ts +3 -1
  415. package/dist/skills/builtin/api_ninjas_trivia.js +18 -6
  416. package/dist/skills/builtin/api_ninjas_trivia.js.map +1 -1
  417. package/dist/skills/builtin/ask_claude.d.ts +14 -4
  418. package/dist/skills/builtin/ask_claude.js +36 -14
  419. package/dist/skills/builtin/ask_claude.js.map +1 -1
  420. package/dist/skills/builtin/claude_skills.d.ts +3 -1
  421. package/dist/skills/builtin/claude_skills.js +19 -15
  422. package/dist/skills/builtin/claude_skills.js.map +1 -1
  423. package/dist/skills/builtin/custom_skills.d.ts +10 -3
  424. package/dist/skills/builtin/custom_skills.js +26 -9
  425. package/dist/skills/builtin/custom_skills.js.map +1 -1
  426. package/dist/skills/builtin/datasphere.d.ts +5 -3
  427. package/dist/skills/builtin/datasphere.js +21 -22
  428. package/dist/skills/builtin/datasphere.js.map +1 -1
  429. package/dist/skills/builtin/datasphere_serverless.d.ts +12 -1
  430. package/dist/skills/builtin/datasphere_serverless.js +17 -6
  431. package/dist/skills/builtin/datasphere_serverless.js.map +1 -1
  432. package/dist/skills/builtin/datetime.d.ts +3 -1
  433. package/dist/skills/builtin/datetime.js +11 -7
  434. package/dist/skills/builtin/datetime.js.map +1 -1
  435. package/dist/skills/builtin/google_maps.d.ts +29 -14
  436. package/dist/skills/builtin/google_maps.js +89 -269
  437. package/dist/skills/builtin/google_maps.js.map +1 -1
  438. package/dist/skills/builtin/index.d.ts +8 -6
  439. package/dist/skills/builtin/index.js +8 -6
  440. package/dist/skills/builtin/index.js.map +1 -1
  441. package/dist/skills/builtin/info_gatherer.d.ts +4 -2
  442. package/dist/skills/builtin/info_gatherer.js +20 -12
  443. package/dist/skills/builtin/info_gatherer.js.map +1 -1
  444. package/dist/skills/builtin/joke.d.ts +16 -6
  445. package/dist/skills/builtin/joke.js +54 -37
  446. package/dist/skills/builtin/joke.js.map +1 -1
  447. package/dist/skills/builtin/math.d.ts +3 -1
  448. package/dist/skills/builtin/math.js +14 -9
  449. package/dist/skills/builtin/math.js.map +1 -1
  450. package/dist/skills/builtin/mcp_gateway.d.ts +34 -5
  451. package/dist/skills/builtin/mcp_gateway.js +77 -46
  452. package/dist/skills/builtin/mcp_gateway.js.map +1 -1
  453. package/dist/skills/builtin/native_vector_search.d.ts +19 -5
  454. package/dist/skills/builtin/native_vector_search.js +179 -61
  455. package/dist/skills/builtin/native_vector_search.js.map +1 -1
  456. package/dist/skills/builtin/play_background_file.d.ts +21 -15
  457. package/dist/skills/builtin/play_background_file.js +43 -122
  458. package/dist/skills/builtin/play_background_file.js.map +1 -1
  459. package/dist/skills/builtin/spider.d.ts +42 -4
  460. package/dist/skills/builtin/spider.js +277 -104
  461. package/dist/skills/builtin/spider.js.map +1 -1
  462. package/dist/skills/builtin/swml_transfer.d.ts +14 -3
  463. package/dist/skills/builtin/swml_transfer.js +45 -24
  464. package/dist/skills/builtin/swml_transfer.js.map +1 -1
  465. package/dist/skills/builtin/weather_api.d.ts +24 -13
  466. package/dist/skills/builtin/weather_api.js +38 -30
  467. package/dist/skills/builtin/weather_api.js.map +1 -1
  468. package/dist/skills/builtin/web_search.d.ts +48 -10
  469. package/dist/skills/builtin/web_search.js +294 -100
  470. package/dist/skills/builtin/web_search.js.map +1 -1
  471. package/dist/skills/builtin/wikipedia_search.d.ts +4 -2
  472. package/dist/skills/builtin/wikipedia_search.js +14 -13
  473. package/dist/skills/builtin/wikipedia_search.js.map +1 -1
  474. package/dist/skills/index.d.ts +3 -2
  475. package/dist/skills/index.js +1 -1
  476. package/dist/skills/index.js.map +1 -1
  477. package/dist/swml_verbs_generated.d.ts +2824 -0
  478. package/dist/swml_verbs_generated.js +12 -0
  479. package/dist/swml_verbs_generated.js.map +1 -0
  480. package/dist/types.d.ts +59 -6
  481. package/dist/web.d.ts +27 -0
  482. package/dist/web.js +20 -0
  483. package/dist/web.js.map +1 -0
  484. package/docs/agent-guide.md +1034 -0
  485. package/docs/ai_chat.md +560 -0
  486. package/docs/api-reference.md +3534 -0
  487. package/docs/architecture.md +846 -0
  488. package/docs/bedrock_agent.md +411 -0
  489. package/docs/cli-guide.md +403 -0
  490. package/docs/cloud_functions_guide.md +399 -0
  491. package/docs/configuration.md +548 -0
  492. package/docs/contexts-guide.md +884 -0
  493. package/docs/datamap-guide.md +1160 -0
  494. package/docs/developer_pain_points.md +548 -0
  495. package/docs/llm_parameters.md +298 -0
  496. package/docs/mcp_gateway_reference.md +354 -0
  497. package/docs/mcp_integration.md +162 -0
  498. package/docs/pgi_agent_guide.md +1820 -0
  499. package/docs/prefabs-guide.md +815 -0
  500. package/docs/programmatically_governed_inference.md +301 -0
  501. package/docs/sdk_features.md +501 -0
  502. package/docs/security.md +559 -0
  503. package/docs/serverless-guide.md +520 -0
  504. package/docs/skills-guide.md +1223 -0
  505. package/docs/skills-system.md +405 -0
  506. package/docs/skills_parameter_schema.md +417 -0
  507. package/docs/swaig-reference.md +1938 -0
  508. package/docs/swml_service_guide.md +573 -0
  509. package/docs/third_party_skills.md +410 -0
  510. package/docs/web_service.md +666 -0
  511. package/examples/README.md +202 -0
  512. package/examples/advanced-datamap.ts +108 -0
  513. package/examples/advanced-dynamic-config.ts +70 -0
  514. package/examples/auto-vivified.ts +95 -0
  515. package/examples/call-flow.ts +65 -0
  516. package/examples/comprehensive-dynamic.ts +125 -0
  517. package/examples/contexts-steps.ts +65 -0
  518. package/examples/custom-path.ts +45 -0
  519. package/examples/datamap-tools.ts +51 -0
  520. package/examples/datasphere-multi-instance.ts +66 -0
  521. package/examples/datasphere-serverless-env.ts +87 -0
  522. package/examples/datasphere-webhook-env.ts +65 -0
  523. package/examples/datasphere.ts +56 -0
  524. package/examples/declarative.ts +100 -0
  525. package/examples/dynamic-config.ts +54 -0
  526. package/examples/dynamic-info-gatherer.ts +69 -0
  527. package/examples/dynamic-swml-service.ts +67 -0
  528. package/examples/gather-info.ts +95 -0
  529. package/examples/gather-per-question-functions-demo.ts +139 -0
  530. package/examples/joke-agent.ts +34 -0
  531. package/examples/kubernetes-agent.ts +45 -0
  532. package/examples/llm-params.ts +75 -0
  533. package/examples/mcp-agent.ts +89 -0
  534. package/examples/mcp-gateway.ts +81 -0
  535. package/examples/multi-agent.ts +80 -0
  536. package/examples/multi-endpoint.ts +79 -0
  537. package/examples/pgi/case-domain.ts +114 -0
  538. package/examples/pgi/serve.ts +16 -0
  539. package/examples/pgi/support-agent.ts +265 -0
  540. package/examples/pom-prompt.ts +70 -0
  541. package/examples/prefab-concierge.ts +42 -0
  542. package/examples/prefab-faq.ts +58 -0
  543. package/examples/prefab-info-gatherer.ts +33 -0
  544. package/examples/prefab-receptionist.ts +36 -0
  545. package/examples/prefab-survey.ts +69 -0
  546. package/examples/quickstart-agent.ts +29 -0
  547. package/examples/quickstart-relay.ts +25 -0
  548. package/examples/quickstart-rest.ts +25 -0
  549. package/examples/record-call.ts +65 -0
  550. package/examples/relay-demo.ts +33 -0
  551. package/examples/room-and-sip.ts +93 -0
  552. package/examples/serverless-lambda.ts +43 -0
  553. package/examples/session-state.ts +83 -0
  554. package/examples/simple-agent.ts +36 -0
  555. package/examples/simple-static.ts +29 -0
  556. package/examples/skills-demo.ts +41 -0
  557. package/examples/step-function-inheritance-demo.ts +124 -0
  558. package/examples/swaig-features.ts +193 -0
  559. package/examples/swml-service-routing.ts +66 -0
  560. package/examples/swml-service.ts +38 -0
  561. package/examples/swmlservice_ai_sidecar.ts +104 -0
  562. package/examples/swmlservice_swaig_standalone.ts +79 -0
  563. package/examples/tap.ts +67 -0
  564. package/examples/typed-tools.ts +68 -0
  565. package/examples/verb-methods.ts +45 -0
  566. package/examples/web-search-multi-instance.ts +75 -0
  567. package/examples/web-search.ts +38 -0
  568. package/examples/wikipedia.ts +36 -0
  569. package/livewire/README.md +164 -0
  570. package/livewire/docs/migration-guide.md +251 -0
  571. package/livewire/examples/livewire-basic-agent.ts +74 -0
  572. package/livewire/examples/livewire-handoff.ts +196 -0
  573. package/livewire/examples/livewire-multi-tool.ts +121 -0
  574. package/package.json +85 -13
  575. package/relay/README.md +101 -0
  576. package/relay/docs/call-methods.md +622 -0
  577. package/relay/docs/client-reference.md +281 -0
  578. package/relay/docs/events.md +193 -0
  579. package/relay/docs/getting-started.md +221 -0
  580. package/relay/docs/guide.md +386 -0
  581. package/relay/docs/messaging.md +246 -0
  582. package/relay/examples/relay-inbound.ts +66 -0
  583. package/relay/examples/relay-messaging.ts +74 -0
  584. package/relay/examples/relay-outbound.ts +76 -0
  585. package/rest/README.md +141 -0
  586. package/rest/docs/calling.md +313 -0
  587. package/rest/docs/client-reference.md +149 -0
  588. package/rest/docs/fabric.md +192 -0
  589. package/rest/docs/getting-started.md +138 -0
  590. package/rest/docs/guide.md +421 -0
  591. package/rest/docs/namespaces.md +367 -0
  592. package/rest/docs/phone-binding.md +116 -0
  593. package/rest/examples/rest-10dlc-registration.ts +177 -0
  594. package/rest/examples/rest-bind-phone-to-swml-webhook.ts +66 -0
  595. package/rest/examples/rest-calling-ivr-and-ai.ts +136 -0
  596. package/rest/examples/rest-calling-play-and-record.ts +98 -0
  597. package/rest/examples/rest-client.ts +59 -0
  598. package/rest/examples/rest-datasphere-search.ts +81 -0
  599. package/rest/examples/rest-fabric-conferences-and-routing.ts +147 -0
  600. package/rest/examples/rest-fabric-subscribers-and-sip.ts +106 -0
  601. package/rest/examples/rest-fabric-swml-and-callflows.ts +101 -0
  602. package/rest/examples/rest-manage-resources.ts +64 -0
  603. package/rest/examples/rest-phone-number-management.ts +200 -0
  604. package/rest/examples/rest-queues-mfa-and-recordings.ts +143 -0
  605. package/rest/examples/rest-video-rooms.ts +186 -0
  606. package/tutorial/fred/fred.ts +218 -0
  607. package/tutorial/fred/tutorial/01-introduction.md +141 -0
  608. package/tutorial/fred/tutorial/02-setup.md +304 -0
  609. package/tutorial/fred/tutorial/03-basic-agent.md +284 -0
  610. package/tutorial/fred/tutorial/04-wikipedia-skill.md +298 -0
  611. package/tutorial/fred/tutorial/05-custom-functions.md +347 -0
  612. package/tutorial/fred/tutorial/06-running-testing.md +642 -0
  613. package/tutorial/fred/tutorial/README.md +56 -0
  614. package/tutorial/fred/tutorial/appendix-complete-code.md +632 -0
  615. package/tutorial/fred/tutorial/appendix-docker-deployment.md +504 -0
  616. package/tutorial/full-guardrails-agent/handlers.ts +436 -0
  617. package/tutorial/full-guardrails-agent/penny.ts +305 -0
  618. package/tutorial/full-guardrails-agent/reservations.ts +1109 -0
  619. package/tutorial/full-guardrails-agent/tutorial/01-why-guardrails.md +149 -0
  620. package/tutorial/full-guardrails-agent/tutorial/02-design-first.md +139 -0
  621. package/tutorial/full-guardrails-agent/tutorial/03-rules-first.md +422 -0
  622. package/tutorial/full-guardrails-agent/tutorial/04-the-shell.md +238 -0
  623. package/tutorial/full-guardrails-agent/tutorial/05-steps-and-scoping.md +247 -0
  624. package/tutorial/full-guardrails-agent/tutorial/06-tools-that-decide.md +467 -0
  625. package/tutorial/full-guardrails-agent/tutorial/07-gather-and-projection.md +160 -0
  626. package/tutorial/full-guardrails-agent/tutorial/08-the-verification-gate.md +333 -0
  627. package/tutorial/full-guardrails-agent/tutorial/09-people-and-endings.md +313 -0
  628. package/tutorial/full-guardrails-agent/tutorial/10-testing-and-running.md +387 -0
  629. package/tutorial/full-guardrails-agent/tutorial/README.md +106 -0
  630. package/tutorial/full-guardrails-agent/tutorial/appendix-complete-code.md +2207 -0
  631. package/tutorial/full-guardrails-agent/tutorial/appendix-deployment.md +191 -0
  632. package/tutorial/full-guardrails-agent/tutorial/appendix-technique-map.md +117 -0
  633. package/tutorial/full-guardrails-agent/workflow.ts +219 -0
  634. package/tutorial/multi_agents/README.md +175 -0
  635. package/tutorial/multi_agents/advanced_agent.ts +395 -0
  636. package/tutorial/multi_agents/extending_agents.ts +641 -0
  637. package/tutorial/multi_agents/knowledge.ts +59 -0
  638. package/tutorial/multi_agents/lesson1_first_agent.md +368 -0
  639. package/tutorial/multi_agents/lesson2_knowledge_bases.md +404 -0
  640. package/tutorial/multi_agents/lesson3_multi_agent_systems.md +621 -0
  641. package/tutorial/multi_agents/lesson4_advanced_features.md +805 -0
  642. package/tutorial/multi_agents/lesson5_extending_agents.md +856 -0
  643. package/tutorial/multi_agents/pc_builder.ts +529 -0
  644. package/tutorial/multi_agents/sales_agent.ts +88 -0
  645. package/tutorial/multi_agents/sales_agent_with_search.ts +116 -0
  646. package/tutorial/multi_agents/sales_knowledge.md +139 -0
  647. package/tutorial/multi_agents/support_knowledge.md +256 -0
  648. package/dist/cli/mock-data.d.ts +0 -37
  649. package/dist/cli/mock-data.js +0 -80
  650. package/dist/cli/mock-data.js.map +0 -1
  651. package/dist/generateVerbTypes.d.ts +0 -11
  652. package/dist/generateVerbTypes.js +0 -265
  653. package/dist/generateVerbTypes.js.map +0 -1
  654. package/dist/rest/namespaces/compat.d.ts +0 -585
  655. package/dist/rest/namespaces/compat.js +0 -735
  656. package/dist/rest/namespaces/compat.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,785 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@signalwire/sdk` are documented here. This project
4
+ follows [Semantic Versioning](https://semver.org/).
5
+
6
+ ## 3.5.0 (2026-09-29)
7
+
8
+ Brings the TypeScript SDK to parity with signalwire-python 3.5.1: the
9
+ security fixes, the per-call configuration and tool-response API, the
10
+ AI Chat gateway and handoff router, swaig-test's DataMap simulator, the
11
+ packaged documentation (`sw-tsdocs`) and the tutorials. It also adopts the
12
+ reference SDK's per-request transport envelope across the REST surface. Some
13
+ changes break existing code; see Changed (breaking) and Notes for upgraders.
14
+
15
+ ### Added
16
+
17
+ - `sw-tsdocs`: the SDK's documentation for the installed version, for people
18
+ and coding agents. With no arguments it prints an index; `sw-tsdocs <topic>`
19
+ covers an area, with the installed docs to read, examples and API names;
20
+ `sw-tsdocs api <name>` prints a signature, JSDoc, source location and members
21
+ from the package's declarations; `examples`, `grep`, `show` and `path` find
22
+ the installed files; and `sw-tsdocs init` adds a section to a project's
23
+ `AGENTS.md` that tells coding agents to use it. `swaig-test --help` points
24
+ to it, and the package's `dist/llms.txt` and `dist/AGENTS.md` list the docs.
25
+ - The package ships its docs and examples: `docs/`, `examples/` (without the
26
+ audit harnesses), the RELAY, REST and LiveWire READMEs, docs and examples,
27
+ and `CHANGELOG.md`, in their repository layout. The examples import
28
+ `'@signalwire/sdk'`, so a copy runs as it is. The tarball grows from about
29
+ 1.0 MB to 1.9 MB.
30
+ - Three tutorials, shipped in the package under `tutorial/` and listed by
31
+ `sw-tsdocs tutorials`: Fred, a voice agent that answers from Wikipedia;
32
+ Penny, a restaurant reservation line built with Programmatically Governed
33
+ Inference; and a multi-agent tutorial (a sales agent with knowledge-base
34
+ search, then specialists behind one `AgentServer`). Their lessons quote
35
+ the code with include markers, and their tests run in the SDK's suite.
36
+ - `AgentBase` option `swaigSecret` (or `SIGNALWIRE_SWAIG_SECRET`): the
37
+ secret that signs SWAIG function tokens, so a token minted by one replica,
38
+ or before a restart, still validates. Without it each process generates
39
+ its own.
40
+ - `AgentBase.addPerCallConfig(cb)`: per-request configuration callbacks that
41
+ accumulate and run in order on the same copy, so separate pieces of code
42
+ can each configure what they own. `setDynamicConfigCallback` replaces the
43
+ whole chain.
44
+ - `AgentBase.onCallEnd(handler)`: run handlers with the transcript when the
45
+ call ends. It registers the platform's reserved `hangup_hook` function and
46
+ turns on `swaig_post_conversation`, without which the hook carries no
47
+ transcript.
48
+ - `AgentBase.mount(appOrRouter, { prefix })`: serve another Hono app or a
49
+ fetch handler alongside the agent's routes. The mount survives the agent
50
+ rebuilding its app, answers its own CORS preflights and sets its own
51
+ headers, and isn't behind the agent's basic auth.
52
+ - `FunctionResult` can separate what a tool did from what the model should
53
+ say: `setToolResponse(toolResult, toolPrompt)` (or the constructor's third
54
+ and fourth arguments) sends `response` as
55
+ `{ tool_result, tool_prompt }`, so a status line isn't read aloud and an
56
+ instruction isn't taken for data. The plain string form is unchanged.
57
+ - `FunctionResult.hold(prompt, timeout, step, timeoutStep)`: a prompt is
58
+ delivered before the hold lands (it sets the structured response and
59
+ `postProcess`), and `step`/`timeoutStep` move the call to a step when it's
60
+ taken off hold or the hold times out. `hold()` and `hold(120)` are
61
+ unchanged.
62
+ - `FunctionResult.rpcAiMessage()` takes `globalData`, merged into the other
63
+ call's global data, and its message text is optional;
64
+ `rpcAiGlobalData(callId, data)` sends data only.
65
+ - `userVariables`, `declaredCapabilities` and `hasCapability` read the
66
+ capabilities a browser client declares in its user variables, such as
67
+ `display_content`. A capability counts only when declared truthy; a missing
68
+ or malformed declaration means not declared. They're hints about what the
69
+ client can render, not permissions, since the caller sets them.
70
+ - `normalizePostPrompt(body)` returns one `NormalizedPostPrompt` for a
71
+ post-prompt from either the voice or the chat engine: the medium, the
72
+ conversation and call IDs, the parsed summary, and the user and assistant
73
+ turns with tool calls and the chat engine's summary echo removed.
74
+ `parsePostPromptData`, `dialogueTurns` and `stripJsonFence` are exported for
75
+ the individual steps. None of them throws on malformed input.
76
+ - `ChatGateway`: lets a browser chat widget use the AI Chat service
77
+ through your app without holding an API token. The widget presents a
78
+ publishable key; the gateway checks it and the page's origin, keeps the
79
+ conversation id in a signed handle, sends its own `config_url`, and caps
80
+ new conversations per window and turns per conversation. `router()` is a
81
+ Hono app for `agent.mount(gateway.router(), { prefix: '/chat' })`; a chat
82
+ reply is streamed through, keepalive padding included. `start` opens a
83
+ conversation so the agent speaks first, and `log` returns only the user
84
+ and assistant turns. The browser's `user_meta_data` is forwarded, limited
85
+ to 8 KiB. `SIGNALWIRE_CHAT_GATEWAY_KEY` and
86
+ `SIGNALWIRE_CHAT_GATEWAY_SECRET` supply the key and handle secret.
87
+ - `HandoffRouter`: the `/handoff`, `/escalate` and `/say` routes the
88
+ SignalWire address widget calls beside a gateway, to move a conversation
89
+ between a call and chat and to type into a live call. The browser proves
90
+ which call it's on with a single-use nonce the application registers from
91
+ the dial. The next medium starts after the application's callback
92
+ captures the previous leg, or after `captureTimeout` if the capture fails
93
+ or takes too long. Typing is capped per call; a `sendMessage` that
94
+ throws or returns `false` doesn't count. The routes answer their own
95
+ CORS preflights for origins the gateway allows.
96
+ - `AIChatClient.rawPost(method, params)` returns the response with its body
97
+ unread, for a proxy that streams it through.
98
+ - `AIChatClient` reads a service URL from `RAILS_DEV_MODE` (a boolean value
99
+ is ignored), accepts a space hostname (`example.signalwire.com`) in
100
+ `space`/`SIGNALWIRE_SPACE` as the REST client does (#186), sends the SDK's
101
+ User-Agent, and warns when a conversation id holds characters the service
102
+ will strip.
103
+ - `swaig-test` sends its requests through the agent's own HTTP app, as
104
+ SignalWire would: the SWML is fetched with a simulated call (so basic
105
+ auth, signatures, the dynamic config callback and webhook tokens run as on
106
+ a server, and the callback runs once for `--dump-swml`), and `--exec`
107
+ calls a function at the `web_hook_url` its SWML gives it. It gains the
108
+ Python SDK's options:
109
+ - Function arguments after `--exec <function>` as `--name value`, typed by
110
+ the function's schema, with a warning for an argument the function
111
+ doesn't declare (`--arg name=value` still works).
112
+ - A DataMap simulator, so `--exec` runs a DataMap function; external
113
+ webhook functions are called at their URL.
114
+ - `--query-params`, `--header`, `--body`, `--method`, `--user-vars`,
115
+ `--custom-data`, `--minimal`, `--fake-full-data`, `--override-json`,
116
+ `--project-id`, `--space-id`, `--help-platforms` and `--help-examples`.
117
+ - Serverless simulation that runs any action with the platform's
118
+ environment, with `--aws-*`, `--cgi-*`, `--gcp-*` and `--azure-*`
119
+ options (`--aws-api-gateway-id` and `--aws-stage` give an API Gateway
120
+ URL), and the Python platform names `cloud_function` and
121
+ `azure_function`.
122
+ - `--list-tools` lists DataMap and external functions with their
123
+ parameters.
124
+ - It finds an agent the file constructs without exporting (the
125
+ quickstart's), and `--route` picks a service in a file with several.
126
+ - The simulated call is the same when `--exec` finds the function and
127
+ when it calls it, so `--override`, `--override-json` and the call flags
128
+ reach a dynamic config callback both times. A plain `SWMLService`'s
129
+ function is called through its `/swaig` route.
130
+ - Requests are signed over `SWML_PROXY_URL_BASE` when it's set, as the
131
+ platform signs them. Credentials in an external webhook URL are sent as
132
+ basic auth.
133
+ - `--exec` exits `0` when every webhook of a DataMap function fails and
134
+ it has no fallback output, printing the platform's generic error. A webhook's timeout covers its body.
135
+ - A simulated platform's environment replaces other platforms' variables
136
+ the shell had set, and they're restored afterwards.
137
+ - **`requestOptions` on every REST resource verb** — each `list` / `paginate` /
138
+ `get` / `create` / `update` / `delete` / `list_addresses` and every generated
139
+ operation / command-dispatch / set-method now accepts a trailing optional
140
+ `requestOptions?: RequestOptionsInit` (timeout / retries / backoff /
141
+ `abortSignal`), threaded to the transport and forwarded to every page fetch by
142
+ `paginate()`. Mirrors the Python reference's keyword-only `request_options`.
143
+ - Custom-CA env vars for outbound TLS documented: `SIGNALWIRE_REST_CA_FILE`
144
+ (REST) and `SIGNALWIRE_RELAY_CA_FILE` (RELAY) — opt-in trust-adding, never
145
+ disables verification.
146
+
147
+ ### Changed (breaking)
148
+
149
+ - Generated REST resource verb signatures gained the trailing `requestOptions`
150
+ parameter (inserted before the `**kwargs`/`**params` variadic tail). Existing
151
+ call sites keep working — the parameter is optional and the variadic tail is
152
+ preserved — but the declared signatures changed, hence the MAJOR bump.
153
+ - `mcp_gateway` TLS verification is a two-key opt-in: disabling it now requires
154
+ BOTH `verify_ssl=false` AND `allow_insecure_tls=true`; the secure default
155
+ (verification ON) is preserved and a lone `verify_ssl=false` is ignored.
156
+
157
+ ### Security
158
+
159
+ - With a dynamic config callback set, only SWML rendering used the
160
+ callback's per-request copy of the agent; SWAIG function calls and summary
161
+ deliveries ran on the agent itself. A tool the callback made `secure` ran
162
+ the agent's own unsecured tool with no token, and a tool the callback
163
+ registered was advertised in the SWML but answered `404`. A function call
164
+ and a summary now run on a copy the callback configured from that request,
165
+ so the tool that runs, and whose token is checked, is the one the SWML
166
+ advertised.
167
+ - The agent's `/mcp` endpoint (`enableMcpServer()`) had no authentication, so
168
+ anyone who could reach the server could run the agent's tools, secure ones
169
+ included. It now requires the agent's basic auth credentials, and lists and
170
+ calls only the tools the agent runs itself, not external webhook tools. An
171
+ MCP client must now send an `Authorization` header.
172
+ - A secure SWAIG function ran when the request carried no token at all;
173
+ only a wrong token was refused. Now a secure function runs only with a valid
174
+ token for that function and call, and a request with no token or no
175
+ `call_id` is refused like a wrong one.
176
+ - Tokens for a call whose id contains a dot (composed conversation ids such as
177
+ `root.2`) never validated, so that call's secure functions were refused.
178
+ - `GET /?call_id=<id>` now mints the SWML's function tokens for that call. It
179
+ used to ignore the query and mint them for a random session.
180
+ - A `POST` to the post-prompt endpoint delivered a summary to `onSummary`
181
+ with no token; the token minted into the post-prompt URL was never checked.
182
+ It now needs that token for the call (`403` otherwise), and a request whose
183
+ URL and body name different calls gets `400`, so one call's token can't
184
+ deliver another call's summary.
185
+ - A `GET` to the post-prompt endpoint called `onSummary` with an empty
186
+ summary. It now returns the SWML document, like the agent's root.
187
+ - Routing-callback paths (`registerRoutingCallback`) render SWML like the
188
+ root, but a `POST` to one skipped the webhook signature check. With a
189
+ signing key set, it now needs a valid signature like the root; a `GET`
190
+ stays unsigned.
191
+ - The spider and web_search skills checked a URL before fetching it, then
192
+ followed redirects, so a public page that redirected to an internal
193
+ address, such as a cloud metadata service, was fetched and returned. A
194
+ hostname whose DNS answer changed between the check and the connection had
195
+ the same effect. They now check every request, redirects included (up to
196
+ 10), and refuse a connection to a private or internal address. A redirect
197
+ to another origin drops the `Authorization` and `Cookie` headers.
198
+ - `isPrivateIp()`, `validateUrl()` and `resolveAndValidateUrl()` let through
199
+ every IPv6 literal written in URL brackets (`http://[::1]/`), IPv4-mapped
200
+ addresses such as `::ffff:169.254.169.254`, the unspecified address `::`,
201
+ and `0.0.0.0/8`. They now block all of them. `validateUrl()` also refuses
202
+ a URL that isn't http or https, and a hostname that doesn't resolve (it
203
+ used to allow a DNS failure), and checks every address a hostname resolves
204
+ to, not only the first.
205
+ - The per-request copy of an agent that a dynamic config callback configures
206
+ shared many fields with the agent itself, so what one call's callback
207
+ changed reached every later call. A query param added with
208
+ `addSwaigQueryParams()` (a tenant id, say) appeared in the next caller's
209
+ webhook URLs; `addMcpServer()`, `addFunctionInclude()` and
210
+ `addInternalFiller()` accumulated on the agent; `setPromptLlmParams()`
211
+ changed the agent's own settings; and `resetContexts()` cleared the agent's
212
+ contexts. The copy now has its own copies of all of these, and of the SIP
213
+ usernames, routing callbacks, verbs, params and global data. Plain data,
214
+ arrays, Maps, Sets, Dates and contexts are copied; other objects in them
215
+ (a `URL`, a `RegExp`, a class instance) are shared with the agent, so
216
+ don't mutate one of those in place from a callback.
217
+ - Webhook signature validation accepts the stronger
218
+ `X-SignalWire-Sha256-Signature` header (hex HMAC-SHA256 of the URL and raw
219
+ body), preferred over the SHA-1 `X-SignalWire-Signature` when present, and
220
+ falls back to the SHA-1 header so existing deployments keep working. New
221
+ exports: `validateWebhookSignatureSha256()` and
222
+ `SIGNALWIRE_SHA256_SIGNATURE_HEADER`.
223
+ - `redactUrl()` left the password in a URL with an empty user
224
+ (`http://:secret@host`), and masked only the first URL in a string. It now
225
+ masks both.
226
+ - native_vector_search: a `remote_url` with only a user or only a password
227
+ kept its credentials in the URL, so the request failed and the error, which
228
+ quoted the whole URL, was logged at ERROR. Either one is now sent as basic
229
+ auth and removed from the URL. ERROR logs record only an error's type; its
230
+ message, which can echo the caller's query, a remote error or a URL, is
231
+ logged at DEBUG with URLs redacted.
232
+ - Serverless signature checks now use the URL SignalWire signed: the URL the
233
+ platform was called on, with its query, and the raw body. They used the URL
234
+ the adapter built for routing, so with a signing key set, signed requests
235
+ got `403` behind an API Gateway stage, a CGI script path or an Azure
236
+ function app, on Google Cloud Functions (the query was dropped and the
237
+ parsed body re-serialized), and on API Gateway REST (its `Host` header was
238
+ missed). API Gateway REST events, which lose the query's original encoding,
239
+ are checked with both the `+` and `%20` forms. Behind a trusted forwarded
240
+ host, the platform's path prefix is kept.
241
+ - Azure Functions requests, whose URL is absolute, are routed by the path
242
+ below `/api/<function>`; they got `404`.
243
+ - `run()` and `runServerless()` in CGI mode read the request body from stdin
244
+ and write the CGI response to stdout. They read no body and wrote nothing.
245
+ - A per-request copy shared the agent's tool objects, so a dynamic config
246
+ callback that changed a tool (turning `secure` off for one tenant, say)
247
+ changed it for every later call. The copy now has its own tools.
248
+ - A Google Cloud Function on `cloudfunctions.net` refused SignalWire's
249
+ signed requests with `403`: the signature was checked over the request's
250
+ URL, without the function name the webhook URL carries. It's checked over
251
+ the webhook URL only, so a signature made for another function on the
252
+ same host doesn't pass.
253
+ - `SWML_RATE_LIMIT` counted every client in one bucket unless
254
+ `SWML_TRUST_PROXY_HEADERS` was set, so one client over the limit got every
255
+ other client refused, SignalWire included. Each client is keyed by its
256
+ connection address, or on a serverless platform by the address the
257
+ platform reports (Lambda's source IP, a Cloud Function request's `ip`,
258
+ CGI's `REMOTE_ADDR`).
259
+ - Overriding `validateBasicAuth()` on an agent had no effect: the routes
260
+ compared credentials themselves, and not in constant time. Every
261
+ protected route now checks through `validateBasicAuth()`, whose default
262
+ compares in constant time.
263
+ - `WebService` served files through symbolic links that pointed outside a
264
+ mounted directory. It resolves the real path and refuses anything outside
265
+ the mount.
266
+ - `HandoffRouter.register()` reset a nonce when it was registered again, so
267
+ re-sending a call's SWML request reset the `/say` message cap, revived a
268
+ nonce `/handoff` had redeemed, and could move a live nonce to another
269
+ call. The first registration now stands, and a redeemed nonce stays used.
270
+ - The mcp_gateway skill and native_vector_search in remote mode checked
271
+ their URL only at setup; every request, redirects included, is now
272
+ checked for private and internal addresses. This holds for mcp_gateway
273
+ with `verify_ssl: false` and `allow_insecure_tls: true` too, which went
274
+ through its own TLS dispatcher unchecked and now skips only the
275
+ certificate check (and no longer needs the `undici` package).
276
+ - `WebService` checked `blockedExtensions` and `allowedExtensions` against
277
+ the requested name only, so a symbolic link inside a mount (`alias.txt`
278
+ pointing to `.env`) served a blocked file, and a dot entry such as `.git`
279
+ didn't block files under a `.git` directory. The checks now apply to the
280
+ file actually read, including the `index.html` fallback and listings,
281
+ and a dot entry matches a directory on the path.
282
+ - `SkillRegistry.unregister()` and `clear()` removed locked skills, so a
283
+ built-in could be removed and replaced by another class. Locked names
284
+ stay.
285
+ - The `swml_transfer` skill wrote each destination, and each pattern as the
286
+ regular expression source, into the prompt, so a destination URL with
287
+ credentials (`https://user:pass@host/swml`) was shown to the model. The
288
+ prompt and the tool description now name the destination without its
289
+ credentials and the pattern without its regular expression syntax. The
290
+ transfer still uses the full URL.
291
+
292
+ - `WebService` served files whose path below a mount had a dot-named
293
+ component, such as `.env.production`, `.ssh/id_rsa` or `.aws/credentials`,
294
+ including through symbolic links into such directories. Any such path is
295
+ now refused with 403, except under `.well-known`.
296
+ - `WebService` served every mounted file, and `/`, without authentication
297
+ when no password was configured. It now requires basic-auth credentials:
298
+ `start()` throws without them, and every route but `/health` answers 401.
299
+ `/health` no longer requires credentials.
300
+ - `ChatGateway` and `HandoffRouter` parsed request bodies of any size, and
301
+ passed on a chat message or `/say` text of any size as a turn. They now
302
+ answer 413 for a body over `MAX_REQUEST_BODY_BYTES` (64 KiB), refusing an
303
+ oversized declared `Content-Length` before reading, and for a message or
304
+ `/say` text over `MAX_MESSAGE_BYTES` (8 KiB of UTF-8), checked before a
305
+ conversation is created, a turn is counted or a nonce is looked up. Both
306
+ constants are exported. A body the application's own middleware already
307
+ read is read from Hono's cache, within the same limit.
308
+ - `HandoffRouter.say()` didn't write its typing-slot count back to the
309
+ `registry`, so a registry that returns copies recorded neither the slot
310
+ nor the refund for a failed delivery, and `maxMessagesPerCall` could be
311
+ passed. It now writes the entry back and refunds against the stored entry,
312
+ matched by conversation, call and registration time.
313
+ - `swml_transfer` stopped at the first `@` when it removed a destination's
314
+ credentials from the prompt, so a password containing an unencoded `@`
315
+ showed its tail to the model. It now removes the whole authority up to its
316
+ last `@`.
317
+
318
+ ### Fixed
319
+
320
+ - Agents: `AgentBase.serve()` and `AgentServer.run()` serve HTTPS from
321
+ `SWML_SSL_ENABLED`, `SWML_SSL_CERT_PATH` and `SWML_SSL_KEY_PATH`, as the
322
+ Python SDK does; they served plain HTTP. The webhook URLs then use
323
+ `https`, on `SWML_SSL_DOMAIN` when it's set. `SWML_SSL_ENABLED` accepts
324
+ `true`, `1` or `yes`, and `stop()` closes the server `serve()` started.
325
+ When the certificate or key file is missing, it warns and serves HTTP,
326
+ and the webhook URLs stay `http`.
327
+ - The `native_vector_search` skill's `search_stats` in global data reported
328
+ the configured `backend` option (by default `sqlite`, a mode this port
329
+ doesn't have) when it searched in memory; it reports `memory`.
330
+ - `run()` on Cloud Run, which sets `K_SERVICE` but not `FUNCTION_TARGET`,
331
+ handled one empty request instead of starting the server.
332
+ - `*` in `SWML_ALLOWED_HOSTS` refused every host, and in
333
+ `SWML_CORS_ORIGINS` allowed no origin; it now allows all, as in Python.
334
+ - `schemaValidation: false` and `schemaPath` now apply to the verbs an
335
+ agent renders; only `SWML_SKIP_SCHEMA_VALIDATION` worked.
336
+ - `addLanguage()` emitted fillers as objects the schema doesn't define.
337
+ `LanguageConfig` gains `speechFillers`, and fillers are emitted as string
338
+ arrays, as the Python SDK emits them; the object forms are flattened with
339
+ a warning.
340
+ - `defineContexts()` given a plain object ignored it; it renders it as the
341
+ contexts and returns the agent, as the Python SDK does with a dict.
342
+ - Tool arguments that don't match the tool's schema log a warning before
343
+ the handler runs, as in the Python SDK; `validateArgs()` was never called.
344
+ Each schema's validator is compiled once and cached.
345
+ - A skill's `swaig_fields: { secure: false }` now lets its tools run
346
+ without a per-call token; it only changed the rendered definition.
347
+ - `getRegisteredTools()` returned an empty description and no parameters
348
+ for DataMap tools.
349
+ - `suppressLogs: true` didn't silence the warnings the constructor logged
350
+ first.
351
+ - `SWMLService` routing callbacks: an async callback was redirected to
352
+ `[object Promise]`, and a throwing one failed the request. The route
353
+ awaits the callback and otherwise serves the request's SWML.
354
+ - `AgentServer.setupSipRouting()` and `registerGlobalRoutingCallback()`
355
+ called after `register()` served the callback at a doubled path
356
+ (`/sales/sales/sip`) or not at all, and threw once the server had served
357
+ a request. The server's app is rebuilt when its routes change, and
358
+ `unregister()` removes the agent's routes too (they stayed served).
359
+ - `SWMLService.serve()` warns when the service serves without basic auth
360
+ because its credentials were generated (the Python SDK enforces them;
361
+ see PORT_BEHAVIORAL_NOTES.md).
362
+ - DataMap: a webhook's output reads the tool's arguments as
363
+ `${input.args.x}`; `${args.x}` expands to nothing there on the platform.
364
+ The datasphere_serverless skill's result and the DataMap examples read
365
+ them that way now.
366
+ - swaig-test's DataMap simulator follows the platform: the template data
367
+ each stage reads, `nomatch-output`, webhook `expressions`, foreach with
368
+ the webhook's data, `params` as the body whenever set, the first webhook
369
+ requested deciding the result, `error_keys` failing by presence,
370
+ case-insensitive patterns, and headers sent as written. Its template
371
+ helpers are the platform's `lc:`, `enc:` and `fmt_ph:`, applied in the
372
+ platform's fixed order (so `${enc:url:x}` reads the missing path
373
+ `url:x`, as on the platform); `enc:` encodes what the platform encodes;
374
+ and a single expression or webhook object is read as the platform reads
375
+ it.
376
+ - swaig-test: `--help` shows `--call-direction inbound|outbound` and
377
+ lists `--project-id` and `--space-id`; the Lambda and Cloud Functions
378
+ simulations honor the function name, region and project options; the
379
+ Azure simulation names the function.
380
+ - RELAY: a sent message with an `on()` listener stayed tracked after it
381
+ finished; `DialOptions` and `SendMessageOptions` are the types `dial()`
382
+ and `sendMessage()` take; the `stream()` track values are the protocol's.
383
+ - LiveWire: `runApp()` serves the agent of the session its entry function
384
+ starts (it served nothing, so the quick start and examples started no
385
+ server); an LLM plugin object sets the model (it rendered
386
+ `[object Object]`); `tools` may be an object keyed by name, as LiveKit
387
+ agents-js takes it.
388
+ - Bedrock: `BedrockAgent` warns when a render leaves hints, languages,
389
+ pronunciation, multilingual or debug settings out of the verb, and when
390
+ `setPromptLlmParams()` gets a non-number.
391
+ - `WebService` takes credentials from `SWML_BASIC_AUTH_USER` and
392
+ `SWML_BASIC_AUTH_PASSWORD` and the config file; `addDirectory()` and
393
+ `removeDirectory()` work on a running service, and a `/` mount serves; an
394
+ invalid `web_service.json` is skipped with a warning.
395
+ - Prefabs: `InfoGathererAgent` passes the request's query parameters and
396
+ headers to its callback (it passed `{}`); `SurveyAgent` and
397
+ `ReceptionistAgent` drop a call's state when its summary arrives, after
398
+ an hour idle, or beyond 10,000 calls.
399
+ - Skills: importing the SDK no longer fails without optional packages
400
+ (mcp_gateway imported undici, which isn't a dependency); weather_api
401
+ loads with `api_key` alone and defaults to Fahrenheit, as its schema says;
402
+ google_maps and ask_claude read their `api_key` parameter;
403
+ `agent.skillManager.loadSkill()` registers the skill on the agent;
404
+ discovery scans `addSkillDirectory()` directories and finds compiled
405
+ `skill.js`; custom_skills honors a parameter's `required`; schema
406
+ defaults and descriptions match the code.
407
+ - Examples: `llm-params.ts`, `advanced-datamap.ts`, `gather-info.ts`,
408
+ `mcp-gateway.ts`, the DataSphere examples and `serverless-lambda.ts` did
409
+ what their headers said only in part, or threw on load; they're fixed.
410
+ - `defineContexts()` called with no argument replaced the agent's contexts
411
+ with a new, empty builder. It returns the existing builder, creating one
412
+ on first use, as the Python SDK's `define_contexts()` does; pass a
413
+ `ContextBuilder` to replace the workflow.
414
+ - RELAY `Call.userEvent()` sent only `event` and dropped the other fields
415
+ its options accept. It sends them all, as the Python SDK does.
416
+ - RELAY `sendMessage()` sent an empty `context` when the client had no
417
+ relay protocol yet, instead of `'default'`.
418
+ - The RELAY outbound and messaging examples passed milliseconds to
419
+ `wait()`, which takes seconds.
420
+ - Contexts and steps rendered as `ai.contexts`, beside the prompt. The
421
+ platform reads them inside the prompt, as `ai.prompt.contexts`, which is
422
+ where the Python SDK renders them; they now render there.
423
+ - `swaig-test --exec` ignored `--call-state`, and an `--override` key
424
+ nothing read was accepted silently (#188). The call data flags now apply
425
+ to every action, `--override` takes a dotted path (`call.state=answered`),
426
+ and an override whose path isn't in the simulated request gets a warning.
427
+ - The `DataMap` class's doc example passed `true` as `parameter()`'s fourth
428
+ argument, which drops `required`; it takes `{ required: true }`.
429
+ - On a serverless platform, the SWML's webhook URLs pointed at
430
+ `http://localhost:3000` unless `SWML_PROXY_URL_BASE` was set. They now use
431
+ the URL the platform serves the function on, as the Python SDK does: a
432
+ Lambda function URL (`AWS_LAMBDA_FUNCTION_URL`), the CGI script's URL, a
433
+ Google Cloud Function's URL (`FUNCTION_URL`, or built from the project,
434
+ region and service), or an Azure Function's (`AZURE_FUNCTION_URL`, or
435
+ built from `WEBSITE_SITE_NAME` and `AZURE_FUNCTION_NAME`). Behind Azure
436
+ and Google Cloud Functions handlers, the URL the request arrived on is
437
+ used. `SWML_PROXY_URL_BASE` still takes precedence. An agent running its
438
+ own server with `serve()` keeps its host and port, and a Google Cloud
439
+ Function is recognized by `FUNCTION_TARGET` (or `FUNCTION_URL`), so a
440
+ server on Cloud Run, which sets `K_SERVICE`, isn't taken for one.
441
+ - Schema validation of `amazon_bedrock`, `cond`, `connect`, `execute`,
442
+ `ai_sidecar`, `join_conference` and `switch` checked only their required
443
+ properties: their schemas refer back to the document schema, the
444
+ per-verb validator couldn't compile, and validation silently fell back.
445
+ They're now fully validated, like the other verbs and as the Python SDK
446
+ validates them. A failed choice among allowed values names them
447
+ (`voice_id must be one of: tiffany, matthew, ...`).
448
+ - The joke skill's result now tells the model to tell the joke
449
+ (`Tell this joke to the user: ...`). Given only the joke, the model
450
+ answered it instead of relaying it. The tool description is `Get a joke
451
+ to tell the caller`.
452
+ - `native_vector_search`: `keyword_weight` is described as what it does
453
+ here, in-memory ranking only, and setting it with `remote_url` logs a
454
+ warning, since the server ranks remote results. `model_name` is
455
+ described as having no effect in this SDK. (The Python SDK deprecated
456
+ `keyword_weight` because its engine ignores it; this SDK's in-memory
457
+ ranking uses it.)
458
+ - The spider skill advertised settings it didn't honor. `follow_robots_txt`
459
+ was never checked: with it on, `scrape_url`, `extract_structured_data`
460
+ and `crawl_site` now skip pages the site's robots.txt disallows for
461
+ `user_agent`, check each redirect's target too, and keep a site's rules
462
+ for 24 hours (a robots.txt that fails with a server or network error is
463
+ tried again on the next request). The schema's defaults now match the
464
+ skill's (`max_text_length` 3000, `follow_robots_txt` false,
465
+ `user_agent` `Spider/1.0 (SignalWire AI Agent)`), and `extract_type`
466
+ lists `fast_text`, `markdown` and `structured`. The never-implemented
467
+ `clean_text`, `full_text`, `html` and `custom` still run as `fast_text`,
468
+ with a warning; any other value fails setup. `concurrent_requests` is
469
+ deprecated and has no effect.
470
+ - `BedrockAgent` rendered its `amazon_bedrock` prompt without
471
+ `max_tokens`, which the constructor and `setInferenceParams()` stored, and
472
+ dropped `presence_penalty` and `frequency_penalty`, which the Bedrock
473
+ prompt defines. `setPromptLlmParams()` now works: `temperature`, `top_p`
474
+ and `max_tokens` update the inference settings, and `confidence` and the
475
+ two penalties go into the prompt; any other setting, such as
476
+ `barge_confidence`, is ignored with a warning. The documented example
477
+ voice is one Bedrock offers (`tiffany`, `matthew`, `amy`, `lupe` or
478
+ `carlos`).
479
+ - `AIChatClient`'s read timeout (`readIdleTimeoutSeconds`, default 60) was
480
+ a limit on the whole request, so a slow reply the service kept alive with
481
+ keepalive padding was cut off at 60 seconds. It's now an idle timeout that
482
+ every chunk restarts.
483
+ - `FunctionResult.executeSwml(swml, true)` put `transfer` inside the SWML
484
+ document, where it isn't a SWML key, so the call never left the agent. It
485
+ now goes beside the document, as `connect()` sends it.
486
+ - `FunctionResult.tap()` accepted `direction: 'hear'`, which the engine
487
+ rejects, and left the direction out for the default `both`, so the verb's
488
+ own default (`speak`) tapped less than asked. Directions are now
489
+ `speak`/`listen`/`both` (`TAP_DIRECTIONS` too), and the direction is
490
+ always sent.
491
+ - The prefab agents' tool handlers (FAQ bot, info gatherer, receptionist,
492
+ survey, concierge) run on the agent running the call, so a dynamic config
493
+ callback that changes their data (a tenant's FAQs, say) takes effect in
494
+ the tools too. They were bound to the agent itself.
495
+ - `onSwmlRequest(requestData, callbackPath, context)` receives the Hono
496
+ context on a served request, as documented; it was always undefined.
497
+ - A plain `SWMLService`'s `/swaig` answered `{}` for an `async` tool
498
+ handler, since it didn't await the result. It now awaits it, and returns a
499
+ `FunctionResult` or string result as a SWAIG response.
500
+ - `AgentServer` served an agent under its route twice (`/sales/sales`),
501
+ so `register(agent)` answered `404` at the agent's own route.
502
+ `asRouter()` now returns the agent's routes relative to its root, like the
503
+ reference's `as_router()`, and `AgentServer` mounts it under the route;
504
+ `getApp()` still serves them under the agent's route.
505
+ - An agent's app and `AgentServer` serve a path with a trailing slash or
506
+ repeated slashes (`/agent/swaig/`, `/agent//swaig`) like the plain path,
507
+ with the same auth and signature checks; they answered `404`. `asRouter()`
508
+ registers `/swaig/`, `/post_prompt/` and routing-callback paths with a
509
+ trailing slash too, for a host app with strict routing.
510
+ - `AgentServer.getApp()` threw ("Can not add a route since the matcher is
511
+ already built") when called again after the server had handled a request.
512
+ - Constructor arguments take precedence over an agent's config file, as
513
+ documented. The file's `service.name` always replaced the `name` passed to
514
+ `AgentBase`, and its route and host replaced a `route: '/'` or
515
+ `host: '0.0.0.0'` passed on purpose; now the file fills in only what the
516
+ caller left out.
517
+ - `AgentBase` ignored basic auth credentials in its config file. Credentials
518
+ now resolve as: constructor, config file, environment, generated.
519
+ `getBasicAuthCredentials(true)` reports `'config file'` for the file's
520
+ (`SWMLService` reported them as `'environment'`), and the file's
521
+ `security.auth.basic` key is read as well as `security.basicAuth`. A
522
+ password set without a user (in the file or `SWML_BASIC_AUTH_PASSWORD`)
523
+ gets the user `signalwire`.
524
+ - A tool handler gets the agent running the call as a third argument,
525
+ `(args, rawData, agent)`: with a dynamic config callback, the request's
526
+ configured copy, so the handler sees what the callback set up. `onSummary`
527
+ runs on that copy too. Existing two-argument handlers are unaffected.
528
+ - A `fetch_conversation` request to the post-prompt endpoint now gets back
529
+ what `onSummary` returns, as the platform expects; the endpoint answered
530
+ `{ ok: true }` either way. Other deliveries now answer `{ success: true }`,
531
+ as the reference does.
532
+ - `GET /swaig` (with `?call_id=` for a call's tokens) returns the SWML
533
+ document, like the agent's root; it answered `400`.
534
+ - The per-request copy of an agent loaded every skill again, running each
535
+ skill's `setup()` on every request, and its skill list was empty while
536
+ that finished. It now starts with the skills the agent loaded, without
537
+ setting them up again. Removing one from the copy leaves the agent's
538
+ instance alone.
539
+ - With a dynamic config callback, an agent's structured (POM) prompt was
540
+ rendered to text on the per-request copy, and a section the callback added
541
+ with `promptAddSection()` was lost. The copy now keeps the POM sections, so
542
+ the prompt stays structured and includes the callback's sections.
543
+ - `LOG_LEVEL` is case-insensitive and an unknown value falls back to `info`
544
+ (never `debug`).
545
+ - `paginate()` guards against a repeating server cursor (no infinite loop).
546
+ - SWAIG `/swaig` handlers receive the unwrapped `argument.parsed` flat args.
547
+
548
+ - `DataMap.body()` wrote a `body` key, which the platform doesn't read, so
549
+ the webhook went out with no request body. That included
550
+ `createSimpleApiTool({ body })`. `body()` now sets the webhook's `params`,
551
+ which the platform sends as the JSON body, and the request is a POST.
552
+ `createSimpleApiTool()` leaves out an empty `body: {}`, so a GET tool
553
+ stays a GET.
554
+ - `FunctionResult.pay()` sent whatever it was given for `timeout`,
555
+ `max_attempts`, `min_postal_code_length` and `security_code`. It now
556
+ checks them (an integer, a boolean, a numeric string, `"true"`/`"false"`
557
+ or a SWML variable reference) and throws for anything else. It still
558
+ sends all five pay settings as strings, as the platform reads them: its
559
+ SWML validator requires strings for `security_code` and `postal_code`,
560
+ and the pay request reads all five as strings.
561
+ - `FunctionResult.joinConference()` refused `maxParticipants` above 250 and
562
+ dropped an explicit 250. It now accepts any integer of 2 or more, as the
563
+ platform does (the schema's cap of 100000 isn't enforced), or a SWML
564
+ variable reference, and sends the value whenever it's given.
565
+ - LiveWire: `allowInterruptions: false` set the `barge_confidence` AI param,
566
+ which the platform doesn't read, so callers could still interrupt the
567
+ agent. It now sets `enable_barge: false`. The LLM parameters guide no
568
+ longer presents `barge_confidence` as a working setting and points to
569
+ `barge_min_words`, `enable_barge` and `barge_match_string`.
570
+ - `BedrockAgent` copied `contexts`, `confidence` and the two penalties into
571
+ the Bedrock prompt. The platform's Bedrock session reads only the prompt's
572
+ text, `voice_id`, `temperature` and `top_p` (it uses 1024 for
573
+ `max_tokens`), and the schema rejects `contexts`. The prompt now carries
574
+ only those, and the agent warns once per agent for each left-out feature
575
+ (hints, languages, pronunciation rules, multilingual settings, contexts)
576
+ instead of on every render; `setPromptLlmParams()` warns about the
577
+ settings it ignores.
578
+ - `BedrockAgent` stored `temperature`, `top_p` and `max_tokens` as given, so
579
+ a value such as `"hot"` reached the SWML, and `setPromptLlmParams()`
580
+ ignored numeric strings. The constructor, `setInferenceParams()`,
581
+ `setLlmTemperature()` and `setPromptLlmParams()` now convert numeric
582
+ strings, keep a `${var}` reference for `temperature` and `top_p`, and
583
+ throw for anything else, changing nothing.
584
+ - The `info_gatherer` and `claude_skills` parameter schemas advertised a
585
+ `tool_name` parameter the skills never read. They no longer list it.
586
+ `env_var` in a parameter schema is described as a hint for configuration
587
+ tools, which the SDK doesn't read.
588
+ - `WebService` served no files when a parent Hono app mounted it under a
589
+ prefix with `route()`, because it looked up its folders by the full
590
+ request path. It now works from the path below the prefix, matched at a
591
+ segment boundary, and its directory redirects and overview links keep the
592
+ prefix.
593
+ - `WebService` served a directory's `index.html` in place when the URL had
594
+ no trailing slash, which broke the page's relative links. It now answers
595
+ with a 307 redirect to the slash form, on this host, with the path's
596
+ percent-encoding kept.
597
+ - swaig-test's DataMap simulator now does what the platform does where it
598
+ used to differ on purpose: an unresolved template expands to an empty
599
+ string (with a note on stderr), not `<MISSING:path>`; names match without
600
+ regard to case; `fmt_ph` formats North American numbers (any number, with the optional
601
+ `libphonenumber-js` installed), and reads a vanity number's letters as
602
+ keypad digits, as the platform's libphonenumber does (`1-800-FLOWERS` is
603
+ `(800) 356-9377`); the call data
604
+ holds `meta_data`, the call details and `prompt_vars`, and the webhook
605
+ stage adds `prompt_vars` and `global_data`; a matched webhook expression's
606
+ result is expanded twice; a template expands only once; outputs are
607
+ expanded as JSON text; and when nothing produces a result the tool returns
608
+ the platform's `{"response": "There was an error processing this
609
+ request."}`.
610
+ - swaig-test's DataMap simulator followed webhook redirects with browser
611
+ rules: at most 10, and a POST turned into a bodyless GET after a 301, 302
612
+ or 303. It now follows them as the platform's curl does: up to 15, and a
613
+ POST is sent again with its body. Every hop is still checked for private
614
+ addresses, and credentials are still dropped on a change of origin.
615
+ - swaig-test's DataMap simulator read `${meta_data.x}` from the function's
616
+ own `meta_data` only. It now merges the function's `meta_data` over
617
+ `global_data`, key by key, as the platform does when it loads the
618
+ function. `swaig-test --exec` also passes the agent's global data when
619
+ `--custom-data` has no `global_data`.
620
+ - swaig-test's DataMap simulator reported `http_code` 0 when a webhook
621
+ request failed after a redirect, such as a redirect loop past the limit or
622
+ a redirect target that doesn't connect. It now reports the last status it
623
+ received, as the platform's curl does, and 0 only when no response came
624
+ back.
625
+ - `swaig-test --custom-data` now reaches DataMap functions as the call data
626
+ the platform adds, such as `global_data` and `prompt_vars`. Before, a
627
+ DataMap tool that read `${global_data.x}` always got an empty value.
628
+ - `swaig-test --simulate-serverless` now builds the function URL from parts
629
+ given by `--env` or `--env-file`, not only by flags, and uses a part given
630
+ under its other name (`GCP_PROJECT`, `GOOGLE_CLOUD_REGION`,
631
+ `FUNCTION_TARGET`, `AZURE_FUNCTIONS_APP_NAME`) instead of the preset's
632
+ value under the preferred name. For example, `--env AWS_REGION=eu-west-1`
633
+ used to keep the preset's us-east-1 URL.
634
+ - Tutorials: Penny asks a locked-out caller before connecting them with a
635
+ person, and Fred's dated fun facts are replaced with checked ones.
636
+
637
+ ### Notes for upgraders
638
+
639
+ - An agent's `validateBasicAuth()` override now replaces the credential
640
+ check on every route. An override written to add a check and return
641
+ `true` must call `super.validateBasicAuth()` to keep the comparison.
642
+ - `SWML_SSL_ENABLED` with a certificate and key makes an agent serve HTTPS.
643
+ An agent behind a TLS-terminating proxy with those variables set should
644
+ unset them.
645
+ - `LanguageConfig`'s object forms of `fillers` and `functionFillers` still
646
+ work, flattened into lists with a warning; pass `speechFillers` and
647
+ `functionFillers` as string arrays.
648
+ - In a DataMap webhook's output, read the tool's arguments as
649
+ `${input.args.x}`; `${args.x}` there always expanded to nothing on the
650
+ platform.
651
+ - `swaig-test`: everything after `--exec <function>` is now an argument
652
+ for the function, so put the CLI's own options (`--raw`, `--verbose`)
653
+ before `--exec`. `--route` now picks the service with that route instead
654
+ of changing the agent's route. `--call-state` defaults to `created`. The
655
+ output of `--dump-swml` is the JSON document alone, and `--exec` prints
656
+ `RESULT:` and the response. `--simulate-serverless` runs the chosen
657
+ action with the platform's environment instead of printing a simulated
658
+ platform response.
659
+ - A `FunctionResult`'s structured response (`setToolResponse()`, or the
660
+ constructor's third and fourth arguments) is sent by `toDict()`; the
661
+ `response` property stays the plain string. `setResponse()` clears the
662
+ structured form; assigning `response` directly doesn't.
663
+ - Adding an `execute`, `connect`, `cond`, `switch`, `join_conference`,
664
+ `ai_sidecar` or `amazon_bedrock` verb with an unknown or mistyped key
665
+ now fails schema validation, where it used to pass. The first of these
666
+ verbs validated in a process compiles the document schema, which takes
667
+ up to about a second; `SWML_SKIP_SCHEMA_VALIDATION=true` turns
668
+ validation off.
669
+ - `FunctionResult.tap({ direction: 'hear' })` now throws; use `'listen'`.
670
+ - `rpcAiMessage()` throws when given neither message text nor global data.
671
+ - `asRouter()` returns routes relative to the agent's root. Mount it under
672
+ the agent's route: `hostApp.route(agent.route, agent.asRouter())`. Code
673
+ that mounted it at `/` to get the routes under the agent's route should use
674
+ `getApp()`, or mount it at the route.
675
+ - A subclass that passes its own default (say `route: '/'`) to `AgentBase`
676
+ now overrides a route set in the config file even when its caller didn't
677
+ pass one. Forward only the options the caller gave.
678
+ - Basic auth credentials in a config file now win over
679
+ `SWML_BASIC_AUTH_USER`/`SWML_BASIC_AUTH_PASSWORD`.
680
+ - With a dynamic config callback set, a function call runs on the
681
+ request's configured copy of the agent, and so does `onSummary`. A handler
682
+ gets the copy as its third argument; a handler that captured the agent (an
683
+ arrow function, or a method passed with `.bind(this)`) still sees the agent
684
+ itself, so read per-call configuration from the third argument. The SDK's
685
+ prefabs do. State `onSummary` keeps by assigning to the agent
686
+ (`this.count += 1`) now lands on the copy and is gone after the request;
687
+ keep it in an object the agent already holds, or in your own storage.
688
+ - An agent subclass with JavaScript `#private` fields can't be copied per
689
+ request (a copy doesn't carry them), so with a dynamic config callback its
690
+ methods that read them throw on the copy. Use TypeScript `private` fields.
691
+ - An exception from `onSummary` is logged, and the post-prompt endpoint
692
+ answers `{ success: true }`, as the reference does; it used to answer 500.
693
+ - The post-prompt endpoint answers a delivered summary with
694
+ `{ success: true }` instead of `{ ok: true }`.
695
+ - A secure SWAIG function called directly, for example with `curl`, now
696
+ needs the token from its `web_hook_url` in the SWML, fetched with
697
+ `GET /?call_id=<id>`. SignalWire's own requests already carry it, and
698
+ `swaig-test` is unaffected.
699
+ - A `POST` to the post-prompt endpoint needs the token from the SWML's
700
+ `post_prompt_url`; SignalWire's requests already carry it.
701
+ - An MCP client that calls an agent's `/mcp` endpoint must send the agent's
702
+ basic auth credentials.
703
+ - The spider and web_search skills fetch pages directly, ignoring any
704
+ environment proxy. To fetch through a proxy that blocks private
705
+ destinations itself, set `SWML_URL_FETCH_USE_PROXY` and turn on Node's proxy
706
+ support (`NODE_USE_ENV_PROXY=1`) with `HTTP_PROXY`/`HTTPS_PROXY`; a request
707
+ that `NO_PROXY` exempts still connects directly, with the address check.
708
+ - `validateUrl()` refuses a hostname that doesn't resolve. Code that relied on
709
+ it passing unresolvable hosts, such as tests that stub `fetch`, can set
710
+ `SWML_ALLOW_PRIVATE_URLS` while testing.
711
+ - `WebService` needs credentials. Set `SWML_BASIC_AUTH_USER` and
712
+ `SWML_BASIC_AUTH_PASSWORD`, pass `basicAuth: [user, password]`, or set
713
+ `security.auth.basic` in the config file; otherwise `start()` throws, and
714
+ an app from `getApp()` refuses every request but `/health`. Clients,
715
+ including URLs the platform fetches such as `play` URLs, must send the
716
+ credentials. Load balancers can keep probing `/health` without them.
717
+ - A DataMap `body()` is now sent, and makes the webhook a POST even when
718
+ it's declared `GET`. `body()` and `params()` now write the same field, so
719
+ the later call wins; a tool that called both must merge them into one
720
+ object. A hand-written `body` key in a raw `data_map` is still not sent.
721
+ - `pay()` throws for a value that isn't an integer or a boolean (such as
722
+ `timeout: 'soon'` or `maxAttempts: 1.5`).
723
+ `joinConference()` now sends an explicit `maxParticipants: 250`, and
724
+ throws for a value below 2.
725
+ - `BedrockAgent` throws on a non-numeric `temperature`, `top_p` or
726
+ `max_tokens`, where it used to store the value, or in
727
+ `setPromptLlmParams()`, warn and ignore it. `confidence`,
728
+ `presence_penalty` and `frequency_penalty` are no longer sent in the
729
+ Bedrock prompt.
730
+ - swaig-test's DataMap simulator writes an empty string for an unresolved
731
+ template, as the platform does, and returns the platform's generic error
732
+ response when nothing produces a result, and `swaig-test --exec` exits
733
+ with status 0 then, as it does for an output that isn't valid JSON after
734
+ expansion. Scripts that looked for `<MISSING:`, the old error object or
735
+ exit status 1 should read the result and stderr's notes instead.
736
+
737
+ ## 3.2.0
738
+
739
+ Adds the **Messages** REST resource (send + redact).
740
+
741
+ ### Added
742
+
743
+ - `client.messages` — `Messages` resource bound to `/api/messaging/messages`
744
+ (`BaseResource`) with `create` (POST — send an SMS/MMS) and `update` (PATCH
745
+ `/{message_id}` — redact a message body). Generated from
746
+ `porting-sdk/rest-apis/messages` via the spec-discovery REST generator.
747
+ Distinct from the message **logs** namespace (`client.logs.messages`, read-only
748
+ `/api/messaging/logs`).
749
+
750
+ ### Fixed
751
+
752
+ - REST generator: a spec field literally named `body` (the Messages create/redact
753
+ bodies) no longer collides with the assembled request-body local variable — the
754
+ local falls back to `body_` when a `body` parameter is emitted.
755
+
756
+ ## 3.1.0
757
+
758
+ Adds the plural **Projects** REST resource.
759
+
760
+ ### Added
761
+
762
+ - `client.projects` — full-CRUD `Projects` resource bound to `/api/projects`
763
+ (list, get, create, update, delete) plus `rotateSigningKey` (POST
764
+ `/{id}/signing-key/rotate`). Generated from `porting-sdk/rest-apis/projects`
765
+ via the spec-discovery REST generator. Distinct from the singular
766
+ `project` token namespace (`/api/project/tokens`).
767
+
768
+ ## 3.0.2
769
+
770
+ Release-readiness milestone for the TypeScript SDK.
771
+
772
+ ### Added
773
+
774
+ - `exports` map in `package.json` exposing the public entry point and the
775
+ `@signalwire/sdk/livewire` subpath (previously importable only from the source
776
+ tree), plus `package.json` self-export for tooling.
777
+ - Package metadata: `keywords`, `bugs`, and `author` fields.
778
+ - `port_signatures.baseline.json` — the committed public-API surface floor that
779
+ the SEMVER-DIFF gate diffs the working tree against.
780
+ - This CHANGELOG.
781
+
782
+ ### Notes
783
+
784
+ - No public API signatures were removed or retyped; the surface is unchanged
785
+ from the recorded baseline.