@elizaos/shared 2.0.0-beta.1 → 2.0.3-beta.3

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 (1101) hide show
  1. package/api/agent-api-types.d.ts +210 -0
  2. package/api/agent-api-types.d.ts.map +1 -0
  3. package/api/agent-api-types.js +11 -0
  4. package/api/agent-api-types.js.map +1 -0
  5. package/api/http-helpers.d.ts +3 -0
  6. package/api/http-helpers.d.ts.map +1 -0
  7. package/api/http-helpers.js +2 -0
  8. package/api/http-helpers.js.map +1 -0
  9. package/api/route-helpers.d.ts +2 -0
  10. package/api/route-helpers.d.ts.map +1 -0
  11. package/app-hero-art.d.ts.map +1 -0
  12. package/app-hero-art.js +344 -0
  13. package/app-hero-art.js.map +1 -0
  14. package/brand/index.d.ts +130 -0
  15. package/brand/index.d.ts.map +1 -0
  16. package/brand/index.js +126 -0
  17. package/brand/index.js.map +1 -0
  18. package/brand-classic/index.d.ts +158 -0
  19. package/brand-classic/index.d.ts.map +1 -0
  20. package/brand-classic/index.js +91 -0
  21. package/brand-classic/index.js.map +1 -0
  22. package/character-language.d.ts +16 -0
  23. package/character-language.d.ts.map +1 -0
  24. package/character-language.js +58 -0
  25. package/character-language.js.map +1 -0
  26. package/character-presets.characters.d.ts +22 -0
  27. package/character-presets.characters.d.ts.map +1 -0
  28. package/character-presets.characters.js +2617 -0
  29. package/character-presets.characters.js.map +1 -0
  30. package/character-presets.d.ts +42 -0
  31. package/character-presets.d.ts.map +1 -0
  32. package/character-presets.js +176 -0
  33. package/character-presets.js.map +1 -0
  34. package/character-presets.shared.d.ts +2 -0
  35. package/character-presets.shared.d.ts.map +1 -0
  36. package/character-presets.shared.js +8 -0
  37. package/character-presets.shared.js.map +1 -0
  38. package/checkout/index.d.ts +48 -0
  39. package/checkout/index.d.ts.map +1 -0
  40. package/checkout/index.js +59 -0
  41. package/checkout/index.js.map +1 -0
  42. package/cli/parse-duration.d.ts.map +1 -0
  43. package/cli/parse-duration.js +26 -0
  44. package/cli/parse-duration.js.map +1 -0
  45. package/config/allowed-hosts.js +44 -0
  46. package/config/allowed-hosts.js.map +1 -0
  47. package/config/api-key-prefix-hints.d.ts +24 -0
  48. package/config/api-key-prefix-hints.d.ts.map +1 -0
  49. package/config/api-key-prefix-hints.js +26 -0
  50. package/config/api-key-prefix-hints.js.map +1 -0
  51. package/config/app-config.d.ts +274 -0
  52. package/config/app-config.d.ts.map +1 -0
  53. package/config/app-config.js +64 -0
  54. package/config/app-config.js.map +1 -0
  55. package/config/app-manifest.d.ts.map +1 -0
  56. package/config/app-manifest.js +115 -0
  57. package/config/app-manifest.js.map +1 -0
  58. package/config/boot-config-store.d.ts +71 -0
  59. package/config/boot-config-store.d.ts.map +1 -0
  60. package/config/boot-config-store.js +77 -0
  61. package/config/boot-config-store.js.map +1 -0
  62. package/config/branding.d.ts +53 -0
  63. package/config/branding.d.ts.map +1 -0
  64. package/config/branding.js +23 -0
  65. package/config/branding.js.map +1 -0
  66. package/config/cloud-only.d.ts +8 -0
  67. package/config/cloud-only.d.ts.map +1 -0
  68. package/config/cloud-only.js +26 -0
  69. package/config/cloud-only.js.map +1 -0
  70. package/config/config-catalog.d.ts.map +1 -0
  71. package/config/config-catalog.js +719 -0
  72. package/config/config-catalog.js.map +1 -0
  73. package/config/config.js +23 -0
  74. package/config/config.js.map +1 -0
  75. package/config/distribution-profile.js +29 -0
  76. package/config/distribution-profile.js.map +1 -0
  77. package/config/env-vars.d.ts.map +1 -0
  78. package/config/index.d.ts +12 -0
  79. package/config/index.d.ts.map +1 -0
  80. package/config/index.js +15 -0
  81. package/config/index.js.map +1 -0
  82. package/config/plugin-auto-enable-engine.js +45 -0
  83. package/config/plugin-auto-enable-engine.js.map +1 -0
  84. package/config/plugin-manifest.d.ts.map +1 -0
  85. package/config/plugin-manifest.js +281 -0
  86. package/config/plugin-manifest.js.map +1 -0
  87. package/config/runtime-mode.d.ts.map +1 -0
  88. package/config/runtime-mode.js +107 -0
  89. package/config/runtime-mode.js.map +1 -0
  90. package/config/types.agent-defaults.d.ts +388 -0
  91. package/config/types.agent-defaults.d.ts.map +1 -0
  92. package/config/types.agents.d.ts +119 -0
  93. package/config/types.agents.d.ts.map +1 -0
  94. package/config/types.eliza.d.ts +689 -0
  95. package/config/types.eliza.d.ts.map +1 -0
  96. package/config/types.messages.d.ts +176 -0
  97. package/config/types.messages.d.ts.map +1 -0
  98. package/config/types.tools.d.ts +400 -0
  99. package/config/types.tools.d.ts.map +1 -0
  100. package/config/ui-spec.d.ts +164 -0
  101. package/config/ui-spec.d.ts.map +1 -0
  102. package/config/zod-schema.agent-runtime.d.ts +1087 -0
  103. package/config/zod-schema.core.d.ts +1048 -0
  104. package/connectors.d.ts +5 -0
  105. package/connectors.d.ts.map +1 -0
  106. package/connectors.js +73 -0
  107. package/connectors.js.map +1 -0
  108. package/contracts/agent-routes.d.ts +63 -0
  109. package/contracts/agent-routes.d.ts.map +1 -0
  110. package/contracts/agent-routes.js +55 -0
  111. package/contracts/agent-routes.js.map +1 -0
  112. package/contracts/app-permissions-routes.d.ts +148 -0
  113. package/contracts/app-permissions-routes.d.ts.map +1 -0
  114. package/contracts/app-permissions-routes.js +96 -0
  115. package/contracts/app-permissions-routes.js.map +1 -0
  116. package/contracts/app-permissions.d.ts +122 -0
  117. package/contracts/app-permissions.d.ts.map +1 -0
  118. package/contracts/app-permissions.js +163 -0
  119. package/contracts/app-permissions.js.map +1 -0
  120. package/contracts/apps-favorites-routes.d.ts +44 -0
  121. package/contracts/apps-favorites-routes.d.ts.map +1 -0
  122. package/contracts/apps-favorites-routes.js +48 -0
  123. package/contracts/apps-favorites-routes.js.map +1 -0
  124. package/contracts/apps-lifecycle-routes.d.ts +185 -0
  125. package/contracts/apps-lifecycle-routes.d.ts.map +1 -0
  126. package/contracts/apps-lifecycle-routes.js +204 -0
  127. package/contracts/apps-lifecycle-routes.js.map +1 -0
  128. package/contracts/apps-loading-routes.d.ts +64 -0
  129. package/contracts/apps-loading-routes.d.ts.map +1 -0
  130. package/contracts/apps-loading-routes.js +65 -0
  131. package/contracts/apps-loading-routes.js.map +1 -0
  132. package/contracts/apps-runs-routes.d.ts +33 -0
  133. package/contracts/apps-runs-routes.d.ts.map +1 -0
  134. package/contracts/apps-runs-routes.js +38 -0
  135. package/contracts/apps-runs-routes.js.map +1 -0
  136. package/contracts/apps.d.ts +1159 -0
  137. package/contracts/apps.d.ts.map +1 -0
  138. package/contracts/apps.js +400 -0
  139. package/contracts/apps.js.map +1 -0
  140. package/contracts/auth-routes.d.ts +23 -0
  141. package/contracts/auth-routes.d.ts.map +1 -0
  142. package/contracts/auth-routes.js +25 -0
  143. package/contracts/auth-routes.js.map +1 -0
  144. package/contracts/calendar.d.ts +181 -0
  145. package/contracts/calendar.d.ts.map +1 -0
  146. package/contracts/calendar.js +19 -0
  147. package/contracts/calendar.js.map +1 -0
  148. package/contracts/character-routes.d.ts +70 -0
  149. package/contracts/character-routes.d.ts.map +1 -0
  150. package/contracts/character-routes.js +49 -0
  151. package/contracts/character-routes.js.map +1 -0
  152. package/contracts/cloud-coding-containers.d.ts +432 -0
  153. package/contracts/cloud-coding-containers.d.ts.map +1 -0
  154. package/contracts/cloud-coding-containers.js +135 -0
  155. package/contracts/cloud-coding-containers.js.map +1 -0
  156. package/contracts/cloud-topology.js +72 -0
  157. package/contracts/cloud-topology.js.map +1 -0
  158. package/contracts/connector-routes.d.ts +39 -0
  159. package/contracts/connector-routes.d.ts.map +1 -0
  160. package/contracts/connector-routes.js +50 -0
  161. package/contracts/connector-routes.js.map +1 -0
  162. package/contracts/content-pack.d.ts +131 -0
  163. package/contracts/content-pack.d.ts.map +1 -0
  164. package/contracts/content-pack.js +103 -0
  165. package/contracts/conversation-routes.d.ts +191 -0
  166. package/contracts/conversation-routes.d.ts.map +1 -0
  167. package/contracts/conversation-routes.js +106 -0
  168. package/contracts/conversation-routes.js.map +1 -0
  169. package/contracts/diagnostics-routes.d.ts +33 -0
  170. package/contracts/diagnostics-routes.d.ts.map +1 -0
  171. package/contracts/diagnostics-routes.js +26 -0
  172. package/contracts/diagnostics-routes.js.map +1 -0
  173. package/contracts/first-run-options.d.ts +531 -0
  174. package/contracts/first-run-options.d.ts.map +1 -0
  175. package/contracts/first-run-options.js +1186 -0
  176. package/contracts/first-run-options.js.map +1 -0
  177. package/contracts/first-run-routes.d.ts +167 -0
  178. package/contracts/first-run-routes.d.ts.map +1 -0
  179. package/contracts/first-run-routes.js +115 -0
  180. package/contracts/first-run-routes.js.map +1 -0
  181. package/contracts/health.d.ts +30 -0
  182. package/contracts/health.d.ts.map +1 -0
  183. package/contracts/health.js +29 -0
  184. package/contracts/health.js.map +1 -0
  185. package/contracts/inbox-routes.d.ts +37 -0
  186. package/contracts/inbox-routes.d.ts.map +1 -0
  187. package/contracts/inbox-routes.js +44 -0
  188. package/contracts/inbox-routes.js.map +1 -0
  189. package/contracts/index.d.ts +42 -0
  190. package/contracts/index.d.ts.map +1 -0
  191. package/contracts/index.js +42 -0
  192. package/contracts/index.js.map +1 -0
  193. package/contracts/memory-routes.d.ts +27 -0
  194. package/contracts/memory-routes.d.ts.map +1 -0
  195. package/contracts/memory-routes.js +23 -0
  196. package/contracts/memory-routes.js.map +1 -0
  197. package/contracts/misc-routes.d.ts +192 -0
  198. package/contracts/misc-routes.d.ts.map +1 -0
  199. package/contracts/misc-routes.js +155 -0
  200. package/contracts/misc-routes.js.map +1 -0
  201. package/contracts/permissions-routes.d.ts +31 -0
  202. package/contracts/permissions-routes.d.ts.map +1 -0
  203. package/contracts/permissions-routes.js +34 -0
  204. package/contracts/permissions-routes.js.map +1 -0
  205. package/contracts/permissions.d.ts +109 -0
  206. package/contracts/permissions.d.ts.map +1 -0
  207. package/contracts/permissions.js +41 -0
  208. package/contracts/permissions.js.map +1 -0
  209. package/contracts/personal-assistant.d.ts +2931 -0
  210. package/contracts/personal-assistant.d.ts.map +1 -0
  211. package/contracts/personal-assistant.js +583 -0
  212. package/contracts/personal-assistant.js.map +1 -0
  213. package/contracts/plugin-routes.d.ts +105 -0
  214. package/contracts/plugin-routes.d.ts.map +1 -0
  215. package/contracts/plugin-routes.js +81 -0
  216. package/contracts/plugin-routes.js.map +1 -0
  217. package/contracts/relationships-routes.d.ts +23 -0
  218. package/contracts/relationships-routes.d.ts.map +1 -0
  219. package/contracts/relationships-routes.js +22 -0
  220. package/contracts/relationships-routes.js.map +1 -0
  221. package/contracts/service-routing.d.ts +49 -0
  222. package/contracts/service-routing.d.ts.map +1 -0
  223. package/contracts/service-routing.js +403 -0
  224. package/contracts/service-routing.js.map +1 -0
  225. package/contracts/skills-routes.d.ts +116 -0
  226. package/contracts/skills-routes.d.ts.map +1 -0
  227. package/contracts/skills-routes.js +115 -0
  228. package/contracts/skills-routes.js.map +1 -0
  229. package/contracts/subscription-routes.d.ts +47 -0
  230. package/contracts/subscription-routes.d.ts.map +1 -0
  231. package/contracts/subscription-routes.js +50 -0
  232. package/contracts/subscription-routes.js.map +1 -0
  233. package/contracts/tail-routes.d.ts +78 -0
  234. package/contracts/tail-routes.d.ts.map +1 -0
  235. package/contracts/tail-routes.js +63 -0
  236. package/contracts/tail-routes.js.map +1 -0
  237. package/contracts/theme.d.ts +134 -0
  238. package/contracts/theme.d.ts.map +1 -0
  239. package/contracts/theme.js +132 -0
  240. package/contracts/theme.js.map +1 -0
  241. package/contracts/update-status.d.ts +100 -0
  242. package/contracts/update-status.d.ts.map +1 -0
  243. package/contracts/update-status.js +45 -0
  244. package/contracts/update-status.js.map +1 -0
  245. package/contracts/wallet-routes.d.ts +82 -0
  246. package/contracts/wallet-routes.d.ts.map +1 -0
  247. package/contracts/wallet-routes.js +49 -0
  248. package/contracts/wallet-routes.js.map +1 -0
  249. package/contracts/wallet.d.ts +57 -0
  250. package/contracts/wallet.d.ts.map +1 -0
  251. package/contracts/wallet.js +200 -0
  252. package/contracts/wallet.js.map +1 -0
  253. package/contracts/workbench-routes.d.ts +231 -0
  254. package/contracts/workbench-routes.d.ts.map +1 -0
  255. package/contracts/workbench-routes.js +183 -0
  256. package/contracts/workbench-routes.js.map +1 -0
  257. package/db/drizzle-database.d.ts +13 -0
  258. package/db/drizzle-database.d.ts.map +1 -0
  259. package/db/drizzle-database.js +2 -0
  260. package/db/drizzle-database.js.map +1 -0
  261. package/dev-settings-banner-style.d.ts +14 -0
  262. package/dev-settings-banner-style.js +58 -0
  263. package/dev-settings-banner-style.js.map +1 -0
  264. package/dev-settings-figlet-heading.d.ts.map +1 -0
  265. package/dev-settings-figlet-heading.js +49 -0
  266. package/dev-settings-figlet-heading.js.map +1 -0
  267. package/elizacloud/base-url.d.ts +6 -0
  268. package/elizacloud/base-url.d.ts.map +1 -0
  269. package/elizacloud/base-url.js +65 -0
  270. package/elizacloud/base-url.js.map +1 -0
  271. package/elizacloud/cloud-provisioning.d.ts +9 -0
  272. package/elizacloud/cloud-provisioning.d.ts.map +1 -0
  273. package/elizacloud/cloud-provisioning.js +25 -0
  274. package/elizacloud/cloud-provisioning.js.map +1 -0
  275. package/elizacloud/cloud-secrets.d.ts +23 -0
  276. package/elizacloud/cloud-secrets.d.ts.map +1 -0
  277. package/elizacloud/cloud-secrets.js +51 -0
  278. package/elizacloud/cloud-secrets.js.map +1 -0
  279. package/elizacloud/index.d.ts +6 -0
  280. package/elizacloud/index.d.ts.map +1 -0
  281. package/elizacloud/index.js +6 -0
  282. package/elizacloud/index.js.map +1 -0
  283. package/elizacloud/is-cloud-reachable.d.ts +19 -0
  284. package/elizacloud/is-cloud-reachable.d.ts.map +1 -0
  285. package/elizacloud/is-cloud-reachable.js +44 -0
  286. package/elizacloud/is-cloud-reachable.js.map +1 -0
  287. package/elizacloud/server-cloud-tts.d.ts +21 -0
  288. package/elizacloud/server-cloud-tts.d.ts.map +1 -0
  289. package/elizacloud/server-cloud-tts.js +293 -0
  290. package/elizacloud/server-cloud-tts.js.map +1 -0
  291. package/email-classification/email-classifier.d.ts +57 -0
  292. package/email-classification/email-classifier.d.ts.map +1 -0
  293. package/email-classification/email-classifier.js +348 -0
  294. package/email-classification/email-classifier.js.map +1 -0
  295. package/email-classification/index.d.ts +12 -0
  296. package/email-classification/index.d.ts.map +1 -0
  297. package/email-classification/index.js +12 -0
  298. package/email-classification/index.js.map +1 -0
  299. package/email-classification/wrap-untrusted-email-content.d.ts +15 -0
  300. package/email-classification/wrap-untrusted-email-content.d.ts.map +1 -0
  301. package/email-classification/wrap-untrusted-email-content.js +24 -0
  302. package/email-classification/wrap-untrusted-email-content.js.map +1 -0
  303. package/env-utils.d.ts +11 -0
  304. package/env-utils.d.ts.map +1 -0
  305. package/env-utils.js +11 -0
  306. package/env-utils.js.map +1 -0
  307. package/events/index.d.ts +68 -0
  308. package/events/index.d.ts.map +1 -0
  309. package/events/index.js +53 -0
  310. package/events/index.js.map +1 -0
  311. package/events.d.ts +2 -0
  312. package/events.d.ts.map +1 -0
  313. package/events.js +2 -0
  314. package/events.js.map +1 -0
  315. package/format-error.d.ts +15 -0
  316. package/format-error.d.ts.map +1 -0
  317. package/format-error.js +17 -0
  318. package/format-error.js.map +1 -0
  319. package/hardware-catalog/index.d.ts +204 -0
  320. package/hardware-catalog/index.d.ts.map +1 -0
  321. package/hardware-catalog/index.js +174 -0
  322. package/hardware-catalog/index.js.map +1 -0
  323. package/i18n/generated/validation-keyword-data.d.ts +3054 -0
  324. package/i18n/generated/validation-keyword-data.d.ts.map +1 -0
  325. package/i18n/generated/validation-keyword-data.js +3058 -0
  326. package/i18n/generated/validation-keyword-data.js.map +1 -0
  327. package/i18n/keyword-matching.d.ts.map +1 -0
  328. package/i18n/keyword-matching.js +116 -0
  329. package/i18n/keyword-matching.js.map +1 -0
  330. package/index.d.ts +106 -0
  331. package/index.d.ts.map +1 -0
  332. package/index.js +139 -0
  333. package/index.js.map +1 -0
  334. package/knowledge-graph/entity-types.d.ts +135 -0
  335. package/knowledge-graph/entity-types.d.ts.map +1 -0
  336. package/knowledge-graph/entity-types.js +75 -0
  337. package/knowledge-graph/entity-types.js.map +1 -0
  338. package/knowledge-graph/index.d.ts +13 -0
  339. package/knowledge-graph/index.d.ts.map +1 -0
  340. package/knowledge-graph/index.js +13 -0
  341. package/knowledge-graph/index.js.map +1 -0
  342. package/knowledge-graph/merge.d.ts +76 -0
  343. package/knowledge-graph/merge.d.ts.map +1 -0
  344. package/knowledge-graph/merge.js +175 -0
  345. package/knowledge-graph/merge.js.map +1 -0
  346. package/knowledge-graph/relationship-types.d.ts +105 -0
  347. package/knowledge-graph/relationship-types.d.ts.map +1 -0
  348. package/knowledge-graph/relationship-types.js +114 -0
  349. package/knowledge-graph/relationship-types.js.map +1 -0
  350. package/lifeops-constants/index.d.ts +9 -0
  351. package/lifeops-constants/index.d.ts.map +1 -0
  352. package/lifeops-constants/index.js +9 -0
  353. package/lifeops-constants/index.js.map +1 -0
  354. package/lifeops-constants/service-constants.d.ts +79 -0
  355. package/lifeops-constants/service-constants.d.ts.map +1 -0
  356. package/lifeops-constants/service-constants.js +123 -0
  357. package/lifeops-constants/service-constants.js.map +1 -0
  358. package/lifeops-normalize/index.d.ts +12 -0
  359. package/lifeops-normalize/index.d.ts.map +1 -0
  360. package/lifeops-normalize/index.js +12 -0
  361. package/lifeops-normalize/index.js.map +1 -0
  362. package/lifeops-normalize/service-error.d.ts +14 -0
  363. package/lifeops-normalize/service-error.d.ts.map +1 -0
  364. package/lifeops-normalize/service-error.js +19 -0
  365. package/lifeops-normalize/service-error.js.map +1 -0
  366. package/lifeops-normalize/service-normalize.d.ts +38 -0
  367. package/lifeops-normalize/service-normalize.d.ts.map +1 -0
  368. package/lifeops-normalize/service-normalize.js +205 -0
  369. package/lifeops-normalize/service-normalize.js.map +1 -0
  370. package/lifeops-normalize/time-zone.d.ts +12 -0
  371. package/lifeops-normalize/time-zone.d.ts.map +1 -0
  372. package/lifeops-normalize/time-zone.js +29 -0
  373. package/lifeops-normalize/time-zone.js.map +1 -0
  374. package/local-inference/catalog.d.ts +122 -0
  375. package/local-inference/catalog.d.ts.map +1 -0
  376. package/local-inference/catalog.js +534 -0
  377. package/local-inference/catalog.js.map +1 -0
  378. package/local-inference/device-fit.d.ts +73 -0
  379. package/local-inference/device-fit.d.ts.map +1 -0
  380. package/local-inference/device-fit.js +155 -0
  381. package/local-inference/device-fit.js.map +1 -0
  382. package/local-inference/gpu-profiles.d.ts +110 -0
  383. package/local-inference/gpu-profiles.d.ts.map +1 -0
  384. package/local-inference/gpu-profiles.js +191 -0
  385. package/local-inference/gpu-profiles.js.map +1 -0
  386. package/local-inference/hf-proxy.d.ts +43 -0
  387. package/local-inference/hf-proxy.d.ts.map +1 -0
  388. package/local-inference/hf-proxy.js +50 -0
  389. package/local-inference/hf-proxy.js.map +1 -0
  390. package/local-inference/hub-auth.d.ts +26 -0
  391. package/local-inference/hub-auth.d.ts.map +1 -0
  392. package/local-inference/hub-auth.js +48 -0
  393. package/local-inference/hub-auth.js.map +1 -0
  394. package/local-inference/index.d.ts +26 -0
  395. package/local-inference/index.d.ts.map +1 -0
  396. package/local-inference/index.js +23 -0
  397. package/local-inference/index.js.map +1 -0
  398. package/local-inference/manifest-signature.d.ts +61 -0
  399. package/local-inference/manifest-signature.d.ts.map +1 -0
  400. package/local-inference/manifest-signature.js +129 -0
  401. package/local-inference/manifest-signature.js.map +1 -0
  402. package/local-inference/network-policy.d.ts +115 -0
  403. package/local-inference/network-policy.d.ts.map +1 -0
  404. package/local-inference/network-policy.js +154 -0
  405. package/local-inference/network-policy.js.map +1 -0
  406. package/local-inference/paths.d.ts +24 -0
  407. package/local-inference/paths.js +40 -0
  408. package/local-inference/providers-types.d.ts +56 -0
  409. package/local-inference/providers-types.d.ts.map +1 -0
  410. package/local-inference/providers-types.js +19 -0
  411. package/local-inference/providers-types.js.map +1 -0
  412. package/local-inference/routing-preferences.d.ts +42 -0
  413. package/local-inference/routing-preferences.d.ts.map +1 -0
  414. package/local-inference/routing-preferences.js +96 -0
  415. package/local-inference/routing-preferences.js.map +1 -0
  416. package/local-inference/runtime-class.d.ts +29 -0
  417. package/local-inference/runtime-class.d.ts.map +1 -0
  418. package/local-inference/runtime-class.js +30 -0
  419. package/local-inference/runtime-class.js.map +1 -0
  420. package/local-inference/throughput.d.ts +74 -0
  421. package/local-inference/throughput.d.ts.map +1 -0
  422. package/local-inference/throughput.js +84 -0
  423. package/local-inference/throughput.js.map +1 -0
  424. package/local-inference/types.d.ts +548 -0
  425. package/local-inference/types.d.ts.map +1 -0
  426. package/local-inference/types.js +22 -0
  427. package/local-inference/types.js.map +1 -0
  428. package/local-inference/voice-models.d.ts +156 -0
  429. package/local-inference/voice-models.d.ts.map +1 -0
  430. package/local-inference/voice-models.js +769 -0
  431. package/local-inference/voice-models.js.map +1 -0
  432. package/local-inference-gpu/gpu-overrides.d.ts +97 -0
  433. package/local-inference-gpu/gpu-overrides.d.ts.map +1 -0
  434. package/local-inference-gpu/gpu-overrides.js +76 -0
  435. package/local-inference-gpu/gpu-overrides.js.map +1 -0
  436. package/local-inference-gpu/gpu-profile-loader.d.ts +83 -0
  437. package/local-inference-gpu/gpu-profile-loader.d.ts.map +1 -0
  438. package/local-inference-gpu/gpu-profile-loader.js +196 -0
  439. package/local-inference-gpu/gpu-profile-loader.js.map +1 -0
  440. package/local-inference-gpu/gpu-profile-schema.d.ts +208 -0
  441. package/local-inference-gpu/gpu-profile-schema.d.ts.map +1 -0
  442. package/local-inference-gpu/gpu-profile-schema.js +123 -0
  443. package/local-inference-gpu/gpu-profile-schema.js.map +1 -0
  444. package/local-inference-gpu/gpu-tier-detect.d.ts +61 -0
  445. package/local-inference-gpu/gpu-tier-detect.d.ts.map +1 -0
  446. package/local-inference-gpu/gpu-tier-detect.js +93 -0
  447. package/local-inference-gpu/gpu-tier-detect.js.map +1 -0
  448. package/local-inference-gpu/gpu-tier-profiles.d.ts +110 -0
  449. package/local-inference-gpu/gpu-tier-profiles.d.ts.map +1 -0
  450. package/local-inference-gpu/gpu-tier-profiles.js +235 -0
  451. package/local-inference-gpu/gpu-tier-profiles.js.map +1 -0
  452. package/loopback-trust.d.ts +73 -0
  453. package/loopback-trust.d.ts.map +1 -0
  454. package/loopback-trust.js +241 -0
  455. package/loopback-trust.js.map +1 -0
  456. package/package.json +208 -30
  457. package/restart.d.ts +28 -0
  458. package/restart.d.ts.map +1 -0
  459. package/restart.js +30 -0
  460. package/restart.js.map +1 -0
  461. package/runtime-env.d.ts +84 -0
  462. package/runtime-env.d.ts.map +1 -0
  463. package/runtime-env.js +270 -0
  464. package/runtime-env.js.map +1 -0
  465. package/self-edit.d.ts +64 -0
  466. package/self-edit.d.ts.map +1 -0
  467. package/self-edit.js +133 -0
  468. package/self-edit.js.map +1 -0
  469. package/settings-debug.d.ts +9 -0
  470. package/settings-debug.d.ts.map +1 -0
  471. package/settings-debug.js +9 -0
  472. package/settings-debug.js.map +1 -0
  473. package/spoken-text.d.ts.map +1 -0
  474. package/spoken-text.js +58 -0
  475. package/spoken-text.js.map +1 -0
  476. package/steward-session-client/index.d.ts +150 -0
  477. package/steward-session-client/index.d.ts.map +1 -0
  478. package/steward-session-client/index.js +192 -0
  479. package/steward-session-client/index.js.map +1 -0
  480. package/steward-session-client/steward-oauth-pkce.d.ts +24 -0
  481. package/steward-session-client/steward-oauth-pkce.d.ts.map +1 -0
  482. package/steward-session-client/steward-oauth-pkce.js +105 -0
  483. package/steward-session-client/steward-oauth-pkce.js.map +1 -0
  484. package/test-env-config.d.ts +81 -0
  485. package/test-env-config.d.ts.map +1 -0
  486. package/test-env-config.js +125 -0
  487. package/test-env-config.js.map +1 -0
  488. package/test-support/test-helpers.d.ts +79 -0
  489. package/test-support/test-helpers.d.ts.map +1 -0
  490. package/test-support/test-helpers.js +341 -0
  491. package/test-support/test-helpers.js.map +1 -0
  492. package/transcripts.d.ts +141 -0
  493. package/transcripts.d.ts.map +1 -0
  494. package/transcripts.js +162 -0
  495. package/transcripts.js.map +1 -0
  496. package/type-guards.d.ts +7 -0
  497. package/type-guards.d.ts.map +1 -0
  498. package/type-guards.js +27 -0
  499. package/type-guards.js.map +1 -0
  500. package/types/index.d.ts +654 -0
  501. package/types/index.d.ts.map +1 -0
  502. package/utils/assistant-text.d.ts +13 -0
  503. package/utils/assistant-text.d.ts.map +1 -0
  504. package/utils/assistant-text.js +292 -0
  505. package/utils/assistant-text.js.map +1 -0
  506. package/utils/browser-tab-kit-types.d.ts +81 -0
  507. package/utils/browser-tab-kit-types.js +23 -0
  508. package/utils/browser-tabs-renderer-registry.d.ts +56 -0
  509. package/utils/browser-tabs-renderer-registry.d.ts.map +1 -0
  510. package/utils/browser-tabs-renderer-registry.js +1282 -0
  511. package/utils/browser-tabs-renderer-registry.js.map +1 -0
  512. package/utils/documents-upload-image.js +147 -0
  513. package/utils/documents-upload-image.js.map +1 -0
  514. package/utils/env.d.ts +35 -0
  515. package/utils/env.d.ts.map +1 -0
  516. package/utils/env.js +133 -0
  517. package/utils/env.js.map +1 -0
  518. package/utils/errors.d.ts +14 -0
  519. package/utils/errors.d.ts.map +1 -0
  520. package/utils/errors.js +23 -0
  521. package/utils/errors.js.map +1 -0
  522. package/utils/exec-safety.d.ts.map +1 -0
  523. package/utils/exec-safety.js +25 -0
  524. package/utils/exec-safety.js.map +1 -0
  525. package/utils/format.d.ts +85 -0
  526. package/utils/format.d.ts.map +1 -0
  527. package/utils/format.js +140 -0
  528. package/utils/format.js.map +1 -0
  529. package/utils/log-prefix.d.ts.map +1 -0
  530. package/utils/log-prefix.js +44 -0
  531. package/utils/log-prefix.js.map +1 -0
  532. package/utils/name-tokens.d.ts +24 -0
  533. package/utils/name-tokens.js +37 -0
  534. package/utils/namespace-defaults.d.ts +10 -0
  535. package/utils/namespace-defaults.d.ts.map +1 -0
  536. package/utils/namespace-defaults.js +17 -0
  537. package/utils/namespace-defaults.js.map +1 -0
  538. package/utils/number-parsing.d.ts.map +1 -0
  539. package/utils/number-parsing.js +57 -0
  540. package/utils/number-parsing.js.map +1 -0
  541. package/utils/permission-deep-links.d.ts +35 -0
  542. package/utils/permission-deep-links.d.ts.map +1 -0
  543. package/utils/permission-deep-links.js +95 -0
  544. package/utils/permission-deep-links.js.map +1 -0
  545. package/utils/serialise.js +22 -0
  546. package/utils/serialise.js.map +1 -0
  547. package/utils/sql-compat.js +112 -0
  548. package/utils/sql-compat.js.map +1 -0
  549. package/utils/streaming-text.d.ts +9 -0
  550. package/utils/streaming-text.d.ts.map +1 -0
  551. package/utils/streaming-text.js +116 -0
  552. package/utils/streaming-text.js.map +1 -0
  553. package/utils/string-hash.d.ts +11 -0
  554. package/utils/string-hash.d.ts.map +1 -0
  555. package/utils/string-hash.js +17 -0
  556. package/utils/string-hash.js.map +1 -0
  557. package/utils/tts-debug.d.ts +10 -0
  558. package/utils/tts-debug.d.ts.map +1 -0
  559. package/utils/tts-debug.js +73 -0
  560. package/utils/tts-debug.js.map +1 -0
  561. package/view-hero-art.d.ts +75 -0
  562. package/view-hero-art.d.ts.map +1 -0
  563. package/view-hero-art.js +354 -0
  564. package/view-hero-art.js.map +1 -0
  565. package/voice/first-sentence-snip.d.ts +68 -0
  566. package/voice/first-sentence-snip.d.ts.map +1 -0
  567. package/voice/first-sentence-snip.js +284 -0
  568. package/voice/first-sentence-snip.js.map +1 -0
  569. package/voice/owner-inference.d.ts +57 -0
  570. package/voice/owner-inference.d.ts.map +1 -0
  571. package/voice/owner-inference.js +73 -0
  572. package/voice/owner-inference.js.map +1 -0
  573. package/voice/respond-gate.d.ts +88 -0
  574. package/voice/respond-gate.d.ts.map +1 -0
  575. package/voice/respond-gate.js +139 -0
  576. package/voice/respond-gate.js.map +1 -0
  577. package/voice/voice-cancellation-token.d.ts +127 -0
  578. package/voice/voice-cancellation-token.d.ts.map +1 -0
  579. package/voice/voice-cancellation-token.js +186 -0
  580. package/voice/voice-cancellation-token.js.map +1 -0
  581. package/voice-eot.d.ts +42 -0
  582. package/voice-eot.d.ts.map +1 -0
  583. package/voice-eot.js +158 -0
  584. package/voice-eot.js.map +1 -0
  585. package/voice-wer.d.ts +19 -0
  586. package/voice-wer.d.ts.map +1 -0
  587. package/voice-wer.js +42 -0
  588. package/voice-wer.js.map +1 -0
  589. package/voice.d.ts +55 -0
  590. package/voice.d.ts.map +1 -0
  591. package/voice.js +337 -0
  592. package/voice.js.map +1 -0
  593. package/dist/api/chat-contracts.d.ts +0 -2
  594. package/dist/api/chat-contracts.d.ts.map +0 -1
  595. package/dist/api/chat-contracts.js +0 -2
  596. package/dist/api/chat-contracts.js.map +0 -1
  597. package/dist/api/http-helpers.d.ts +0 -50
  598. package/dist/api/http-helpers.d.ts.map +0 -1
  599. package/dist/api/http-helpers.js +0 -168
  600. package/dist/api/http-helpers.js.map +0 -1
  601. package/dist/api/route-helpers.d.ts +0 -16
  602. package/dist/api/route-helpers.d.ts.map +0 -1
  603. package/dist/app-hero-art.d.ts.map +0 -1
  604. package/dist/app-hero-art.js +0 -358
  605. package/dist/app-hero-art.js.map +0 -1
  606. package/dist/cli/parse-duration.d.ts.map +0 -1
  607. package/dist/cli/parse-duration.js +0 -28
  608. package/dist/cli/parse-duration.js.map +0 -1
  609. package/dist/config/allowed-hosts.js +0 -44
  610. package/dist/config/allowed-hosts.js.map +0 -1
  611. package/dist/config/api-key-prefix-hints.d.ts +0 -25
  612. package/dist/config/api-key-prefix-hints.d.ts.map +0 -1
  613. package/dist/config/api-key-prefix-hints.js +0 -27
  614. package/dist/config/api-key-prefix-hints.js.map +0 -1
  615. package/dist/config/app-config.d.ts +0 -273
  616. package/dist/config/app-config.d.ts.map +0 -1
  617. package/dist/config/app-config.js +0 -32
  618. package/dist/config/app-config.js.map +0 -1
  619. package/dist/config/app-manifest.d.ts.map +0 -1
  620. package/dist/config/app-manifest.js +0 -109
  621. package/dist/config/app-manifest.js.map +0 -1
  622. package/dist/config/boot-config-react.d.ts +0 -5
  623. package/dist/config/boot-config-react.d.ts.map +0 -1
  624. package/dist/config/boot-config-react.js +0 -8
  625. package/dist/config/boot-config-react.js.map +0 -1
  626. package/dist/config/boot-config-store.d.ts +0 -74
  627. package/dist/config/boot-config-store.d.ts.map +0 -1
  628. package/dist/config/boot-config-store.js +0 -121
  629. package/dist/config/boot-config-store.js.map +0 -1
  630. package/dist/config/branding-react.d.ts +0 -4
  631. package/dist/config/branding-react.d.ts.map +0 -1
  632. package/dist/config/branding-react.js +0 -12
  633. package/dist/config/branding-react.js.map +0 -1
  634. package/dist/config/branding.d.ts +0 -53
  635. package/dist/config/branding.d.ts.map +0 -1
  636. package/dist/config/branding.js +0 -23
  637. package/dist/config/branding.js.map +0 -1
  638. package/dist/config/cloud-only.d.ts +0 -6
  639. package/dist/config/cloud-only.d.ts.map +0 -1
  640. package/dist/config/cloud-only.js +0 -16
  641. package/dist/config/cloud-only.js.map +0 -1
  642. package/dist/config/config-catalog.d.ts.map +0 -1
  643. package/dist/config/config-catalog.js +0 -710
  644. package/dist/config/config-catalog.js.map +0 -1
  645. package/dist/config/config.js +0 -23
  646. package/dist/config/config.js.map +0 -1
  647. package/dist/config/distribution-profile.js +0 -29
  648. package/dist/config/distribution-profile.js.map +0 -1
  649. package/dist/config/env-vars.d.ts.map +0 -1
  650. package/dist/config/index.d.ts +0 -14
  651. package/dist/config/index.d.ts.map +0 -1
  652. package/dist/config/index.js +0 -17
  653. package/dist/config/index.js.map +0 -1
  654. package/dist/config/plugin-auto-enable-engine.js +0 -45
  655. package/dist/config/plugin-auto-enable-engine.js.map +0 -1
  656. package/dist/config/plugin-manifest.d.ts.map +0 -1
  657. package/dist/config/plugin-manifest.js +0 -272
  658. package/dist/config/plugin-manifest.js.map +0 -1
  659. package/dist/config/runtime-mode.d.ts.map +0 -1
  660. package/dist/config/runtime-mode.js +0 -103
  661. package/dist/config/runtime-mode.js.map +0 -1
  662. package/dist/config/types.agent-defaults.d.ts +0 -383
  663. package/dist/config/types.agent-defaults.d.ts.map +0 -1
  664. package/dist/config/types.agents.d.ts +0 -114
  665. package/dist/config/types.agents.d.ts.map +0 -1
  666. package/dist/config/types.eliza.d.ts +0 -689
  667. package/dist/config/types.eliza.d.ts.map +0 -1
  668. package/dist/config/types.messages.d.ts +0 -176
  669. package/dist/config/types.messages.d.ts.map +0 -1
  670. package/dist/config/types.tools.d.ts +0 -400
  671. package/dist/config/types.tools.d.ts.map +0 -1
  672. package/dist/config/ui-spec.d.ts +0 -164
  673. package/dist/config/ui-spec.d.ts.map +0 -1
  674. package/dist/config/zod-schema.agent-runtime.d.ts +0 -1087
  675. package/dist/config/zod-schema.core.d.ts +0 -1048
  676. package/dist/connectors.d.ts +0 -2
  677. package/dist/connectors.d.ts.map +0 -1
  678. package/dist/connectors.js +0 -2
  679. package/dist/connectors.js.map +0 -1
  680. package/dist/contracts/apps.d.ts +0 -279
  681. package/dist/contracts/apps.d.ts.map +0 -1
  682. package/dist/contracts/apps.js +0 -218
  683. package/dist/contracts/apps.js.map +0 -1
  684. package/dist/contracts/cloud-topology.js +0 -72
  685. package/dist/contracts/cloud-topology.js.map +0 -1
  686. package/dist/contracts/content-pack.d.ts +0 -131
  687. package/dist/contracts/content-pack.d.ts.map +0 -1
  688. package/dist/contracts/content-pack.js +0 -103
  689. package/dist/contracts/health.d.ts +0 -30
  690. package/dist/contracts/health.d.ts.map +0 -1
  691. package/dist/contracts/health.js +0 -29
  692. package/dist/contracts/health.js.map +0 -1
  693. package/dist/contracts/index.d.ts +0 -16
  694. package/dist/contracts/index.d.ts.map +0 -1
  695. package/dist/contracts/index.js +0 -16
  696. package/dist/contracts/index.js.map +0 -1
  697. package/dist/contracts/lifeops.d.ts +0 -3140
  698. package/dist/contracts/lifeops.d.ts.map +0 -1
  699. package/dist/contracts/lifeops.js +0 -587
  700. package/dist/contracts/lifeops.js.map +0 -1
  701. package/dist/contracts/onboarding.d.ts +0 -507
  702. package/dist/contracts/onboarding.d.ts.map +0 -1
  703. package/dist/contracts/onboarding.js +0 -1141
  704. package/dist/contracts/onboarding.js.map +0 -1
  705. package/dist/contracts/permissions.d.ts +0 -121
  706. package/dist/contracts/permissions.d.ts.map +0 -1
  707. package/dist/contracts/permissions.js +0 -31
  708. package/dist/contracts/permissions.js.map +0 -1
  709. package/dist/contracts/service-routing.d.ts +0 -155
  710. package/dist/contracts/service-routing.d.ts.map +0 -1
  711. package/dist/contracts/service-routing.js +0 -395
  712. package/dist/contracts/service-routing.js.map +0 -1
  713. package/dist/contracts/theme.d.ts +0 -136
  714. package/dist/contracts/theme.d.ts.map +0 -1
  715. package/dist/contracts/theme.js +0 -134
  716. package/dist/contracts/theme.js.map +0 -1
  717. package/dist/contracts/wallet.d.ts +0 -622
  718. package/dist/contracts/wallet.d.ts.map +0 -1
  719. package/dist/contracts/wallet.js +0 -194
  720. package/dist/contracts/wallet.js.map +0 -1
  721. package/dist/dev-settings-banner-style.d.ts +0 -14
  722. package/dist/dev-settings-banner-style.js +0 -58
  723. package/dist/dev-settings-banner-style.js.map +0 -1
  724. package/dist/dev-settings-figlet-heading.d.ts.map +0 -1
  725. package/dist/dev-settings-figlet-heading.js +0 -56
  726. package/dist/dev-settings-figlet-heading.js.map +0 -1
  727. package/dist/env-utils.d.ts +0 -2
  728. package/dist/env-utils.d.ts.map +0 -1
  729. package/dist/env-utils.js +0 -13
  730. package/dist/env-utils.js.map +0 -1
  731. package/dist/events/index.d.ts +0 -62
  732. package/dist/events/index.d.ts.map +0 -1
  733. package/dist/events/index.js +0 -52
  734. package/dist/events/index.js.map +0 -1
  735. package/dist/format-error.d.ts +0 -14
  736. package/dist/format-error.d.ts.map +0 -1
  737. package/dist/format-error.js +0 -18
  738. package/dist/format-error.js.map +0 -1
  739. package/dist/i18n/generated/validation-keyword-data.d.ts +0 -3080
  740. package/dist/i18n/generated/validation-keyword-data.d.ts.map +0 -1
  741. package/dist/i18n/generated/validation-keyword-data.js +0 -3084
  742. package/dist/i18n/generated/validation-keyword-data.js.map +0 -1
  743. package/dist/i18n/keyword-matching.d.ts.map +0 -1
  744. package/dist/i18n/keyword-matching.js +0 -113
  745. package/dist/i18n/keyword-matching.js.map +0 -1
  746. package/dist/index.d.ts +0 -93
  747. package/dist/index.d.ts.map +0 -1
  748. package/dist/index.js +0 -105
  749. package/dist/index.js.map +0 -1
  750. package/dist/local-inference/index.d.ts +0 -16
  751. package/dist/local-inference/index.d.ts.map +0 -1
  752. package/dist/local-inference/index.js +0 -16
  753. package/dist/local-inference/index.js.map +0 -1
  754. package/dist/local-inference/paths.d.ts +0 -24
  755. package/dist/local-inference/paths.js +0 -40
  756. package/dist/local-inference/routing-preferences.d.ts +0 -31
  757. package/dist/local-inference/routing-preferences.d.ts.map +0 -1
  758. package/dist/local-inference/routing-preferences.js +0 -73
  759. package/dist/local-inference/routing-preferences.js.map +0 -1
  760. package/dist/local-inference/types.d.ts +0 -62
  761. package/dist/local-inference/types.d.ts.map +0 -1
  762. package/dist/local-inference/types.js +0 -25
  763. package/dist/local-inference/types.js.map +0 -1
  764. package/dist/onboarding-presets.characters.d.ts +0 -22
  765. package/dist/onboarding-presets.characters.d.ts.map +0 -1
  766. package/dist/onboarding-presets.characters.js +0 -2617
  767. package/dist/onboarding-presets.characters.js.map +0 -1
  768. package/dist/onboarding-presets.d.ts +0 -40
  769. package/dist/onboarding-presets.d.ts.map +0 -1
  770. package/dist/onboarding-presets.js +0 -181
  771. package/dist/onboarding-presets.js.map +0 -1
  772. package/dist/onboarding-presets.shared.d.ts +0 -2
  773. package/dist/onboarding-presets.shared.d.ts.map +0 -1
  774. package/dist/onboarding-presets.shared.js +0 -8
  775. package/dist/onboarding-presets.shared.js.map +0 -1
  776. package/dist/package.json +0 -50
  777. package/dist/restart.d.ts +0 -27
  778. package/dist/restart.d.ts.map +0 -1
  779. package/dist/restart.js +0 -29
  780. package/dist/restart.js.map +0 -1
  781. package/dist/runtime-env.d.ts +0 -84
  782. package/dist/runtime-env.d.ts.map +0 -1
  783. package/dist/runtime-env.js +0 -262
  784. package/dist/runtime-env.js.map +0 -1
  785. package/dist/self-edit.d.ts +0 -64
  786. package/dist/self-edit.d.ts.map +0 -1
  787. package/dist/self-edit.js +0 -133
  788. package/dist/self-edit.js.map +0 -1
  789. package/dist/settings-debug.d.ts +0 -20
  790. package/dist/settings-debug.d.ts.map +0 -1
  791. package/dist/settings-debug.js +0 -122
  792. package/dist/settings-debug.js.map +0 -1
  793. package/dist/spoken-text.d.ts.map +0 -1
  794. package/dist/spoken-text.js +0 -57
  795. package/dist/spoken-text.js.map +0 -1
  796. package/dist/test-support/test-helpers.d.ts +0 -112
  797. package/dist/test-support/test-helpers.d.ts.map +0 -1
  798. package/dist/test-support/test-helpers.js +0 -416
  799. package/dist/test-support/test-helpers.js.map +0 -1
  800. package/dist/themes/index.d.ts +0 -7
  801. package/dist/themes/index.d.ts.map +0 -1
  802. package/dist/themes/index.js +0 -6
  803. package/dist/themes/index.js.map +0 -1
  804. package/dist/themes/presets.d.ts +0 -15
  805. package/dist/themes/presets.d.ts.map +0 -1
  806. package/dist/themes/presets.js +0 -789
  807. package/dist/themes/presets.js.map +0 -1
  808. package/dist/type-guards.d.ts +0 -30
  809. package/dist/type-guards.d.ts.map +0 -1
  810. package/dist/type-guards.js +0 -50
  811. package/dist/type-guards.js.map +0 -1
  812. package/dist/types/index.d.ts +0 -655
  813. package/dist/types/index.d.ts.map +0 -1
  814. package/dist/utils/assistant-text.d.ts +0 -2
  815. package/dist/utils/assistant-text.d.ts.map +0 -1
  816. package/dist/utils/assistant-text.js +0 -168
  817. package/dist/utils/assistant-text.js.map +0 -1
  818. package/dist/utils/browser-tab-kit-types.d.ts +0 -81
  819. package/dist/utils/browser-tab-kit-types.js +0 -23
  820. package/dist/utils/browser-tabs-renderer-registry.d.ts +0 -56
  821. package/dist/utils/browser-tabs-renderer-registry.d.ts.map +0 -1
  822. package/dist/utils/browser-tabs-renderer-registry.js +0 -962
  823. package/dist/utils/browser-tabs-renderer-registry.js.map +0 -1
  824. package/dist/utils/documents-upload-image.js +0 -147
  825. package/dist/utils/documents-upload-image.js.map +0 -1
  826. package/dist/utils/env.d.ts +0 -34
  827. package/dist/utils/env.d.ts.map +0 -1
  828. package/dist/utils/env.js +0 -131
  829. package/dist/utils/env.js.map +0 -1
  830. package/dist/utils/errors.d.ts +0 -13
  831. package/dist/utils/errors.d.ts.map +0 -1
  832. package/dist/utils/errors.js +0 -26
  833. package/dist/utils/errors.js.map +0 -1
  834. package/dist/utils/exec-safety.d.ts.map +0 -1
  835. package/dist/utils/exec-safety.js +0 -22
  836. package/dist/utils/exec-safety.js.map +0 -1
  837. package/dist/utils/format.d.ts +0 -66
  838. package/dist/utils/format.d.ts.map +0 -1
  839. package/dist/utils/format.js +0 -122
  840. package/dist/utils/format.js.map +0 -1
  841. package/dist/utils/index.d.ts +0 -12
  842. package/dist/utils/index.d.ts.map +0 -1
  843. package/dist/utils/index.js +0 -12
  844. package/dist/utils/index.js.map +0 -1
  845. package/dist/utils/log-prefix.d.ts.map +0 -1
  846. package/dist/utils/log-prefix.js +0 -54
  847. package/dist/utils/log-prefix.js.map +0 -1
  848. package/dist/utils/name-tokens.d.ts +0 -24
  849. package/dist/utils/name-tokens.js +0 -37
  850. package/dist/utils/namespace-defaults.d.ts +0 -6
  851. package/dist/utils/namespace-defaults.d.ts.map +0 -1
  852. package/dist/utils/namespace-defaults.js +0 -16
  853. package/dist/utils/namespace-defaults.js.map +0 -1
  854. package/dist/utils/number-parsing.d.ts.map +0 -1
  855. package/dist/utils/number-parsing.js +0 -52
  856. package/dist/utils/number-parsing.js.map +0 -1
  857. package/dist/utils/permission-deep-links.d.ts +0 -34
  858. package/dist/utils/permission-deep-links.d.ts.map +0 -1
  859. package/dist/utils/permission-deep-links.js +0 -84
  860. package/dist/utils/permission-deep-links.js.map +0 -1
  861. package/dist/utils/serialise.js +0 -22
  862. package/dist/utils/serialise.js.map +0 -1
  863. package/dist/utils/sql-compat.js +0 -112
  864. package/dist/utils/sql-compat.js.map +0 -1
  865. package/dist/utils/streaming-text.d.ts +0 -9
  866. package/dist/utils/streaming-text.d.ts.map +0 -1
  867. package/dist/utils/streaming-text.js +0 -113
  868. package/dist/utils/streaming-text.js.map +0 -1
  869. package/dist/utils/tts-debug.d.ts +0 -9
  870. package/dist/utils/tts-debug.d.ts.map +0 -1
  871. package/dist/utils/tts-debug.js +0 -70
  872. package/dist/utils/tts-debug.js.map +0 -1
  873. package/dist/voice.d.ts +0 -40
  874. package/dist/voice.d.ts.map +0 -1
  875. package/dist/voice.js +0 -296
  876. package/dist/voice.js.map +0 -1
  877. /package/{dist/api → api}/route-helpers.js +0 -0
  878. /package/{dist/api → api}/route-helpers.js.map +0 -0
  879. /package/{dist/app-hero-art.d.ts → app-hero-art.d.ts} +0 -0
  880. /package/{dist/awareness → awareness}/index.d.ts +0 -0
  881. /package/{dist/awareness → awareness}/index.d.ts.map +0 -0
  882. /package/{dist/awareness → awareness}/index.js +0 -0
  883. /package/{dist/awareness → awareness}/index.js.map +0 -0
  884. /package/{dist/awareness → awareness}/registry.d.ts +0 -0
  885. /package/{dist/awareness → awareness}/registry.d.ts.map +0 -0
  886. /package/{dist/awareness → awareness}/registry.js +0 -0
  887. /package/{dist/awareness → awareness}/registry.js.map +0 -0
  888. /package/{dist/cli → cli}/parse-duration.d.ts +0 -0
  889. /package/{dist/config → config}/allowed-hosts.d.ts +0 -0
  890. /package/{dist/config → config}/allowed-hosts.d.ts.map +0 -0
  891. /package/{dist/config → config}/app-manifest.d.ts +0 -0
  892. /package/{dist/config → config}/boot-config.d.ts +0 -0
  893. /package/{dist/config → config}/boot-config.d.ts.map +0 -0
  894. /package/{dist/config → config}/boot-config.js +0 -0
  895. /package/{dist/config → config}/boot-config.js.map +0 -0
  896. /package/{dist/config → config}/config-catalog.d.ts +0 -0
  897. /package/{dist/config → config}/config-paths.d.ts +0 -0
  898. /package/{dist/config → config}/config-paths.d.ts.map +0 -0
  899. /package/{dist/config → config}/config-paths.js +0 -0
  900. /package/{dist/config → config}/config-paths.js.map +0 -0
  901. /package/{dist/config → config}/config.d.ts +0 -0
  902. /package/{dist/config → config}/config.d.ts.map +0 -0
  903. /package/{dist/config → config}/distribution-profile.d.ts +0 -0
  904. /package/{dist/config → config}/distribution-profile.d.ts.map +0 -0
  905. /package/{dist/config → config}/env-vars.d.ts +0 -0
  906. /package/{dist/config → config}/env-vars.js +0 -0
  907. /package/{dist/config → config}/env-vars.js.map +0 -0
  908. /package/{dist/config → config}/plugin-auto-enable-engine.d.ts +0 -0
  909. /package/{dist/config → config}/plugin-auto-enable-engine.d.ts.map +0 -0
  910. /package/{dist/config → config}/plugin-auto-enable.d.ts +0 -0
  911. /package/{dist/config → config}/plugin-auto-enable.d.ts.map +0 -0
  912. /package/{dist/config → config}/plugin-auto-enable.js +0 -0
  913. /package/{dist/config → config}/plugin-auto-enable.js.map +0 -0
  914. /package/{dist/config → config}/plugin-manifest.d.ts +0 -0
  915. /package/{dist/config → config}/plugin-ui-spec.d.ts +0 -0
  916. /package/{dist/config → config}/plugin-ui-spec.d.ts.map +0 -0
  917. /package/{dist/config → config}/plugin-ui-spec.js +0 -0
  918. /package/{dist/config → config}/plugin-ui-spec.js.map +0 -0
  919. /package/{dist/config → config}/runtime-mode.d.ts +0 -0
  920. /package/{dist/config → config}/runtime-overrides.d.ts +0 -0
  921. /package/{dist/config → config}/runtime-overrides.d.ts.map +0 -0
  922. /package/{dist/config → config}/runtime-overrides.js +0 -0
  923. /package/{dist/config → config}/runtime-overrides.js.map +0 -0
  924. /package/{dist/config → config}/schema.d.ts +0 -0
  925. /package/{dist/config → config}/schema.d.ts.map +0 -0
  926. /package/{dist/config → config}/schema.js +0 -0
  927. /package/{dist/config → config}/schema.js.map +0 -0
  928. /package/{dist/config → config}/types.agent-defaults.js +0 -0
  929. /package/{dist/config → config}/types.agent-defaults.js.map +0 -0
  930. /package/{dist/config → config}/types.agents.js +0 -0
  931. /package/{dist/config → config}/types.agents.js.map +0 -0
  932. /package/{dist/config → config}/types.d.ts +0 -0
  933. /package/{dist/config → config}/types.d.ts.map +0 -0
  934. /package/{dist/config → config}/types.eliza.js +0 -0
  935. /package/{dist/config → config}/types.eliza.js.map +0 -0
  936. /package/{dist/config → config}/types.gateway.d.ts +0 -0
  937. /package/{dist/config → config}/types.gateway.d.ts.map +0 -0
  938. /package/{dist/config → config}/types.gateway.js +0 -0
  939. /package/{dist/config → config}/types.gateway.js.map +0 -0
  940. /package/{dist/config → config}/types.hooks.d.ts +0 -0
  941. /package/{dist/config → config}/types.hooks.d.ts.map +0 -0
  942. /package/{dist/config → config}/types.hooks.js +0 -0
  943. /package/{dist/config → config}/types.hooks.js.map +0 -0
  944. /package/{dist/config → config}/types.js +0 -0
  945. /package/{dist/config → config}/types.js.map +0 -0
  946. /package/{dist/config → config}/types.messages.js +0 -0
  947. /package/{dist/config → config}/types.messages.js.map +0 -0
  948. /package/{dist/config → config}/types.tools.js +0 -0
  949. /package/{dist/config → config}/types.tools.js.map +0 -0
  950. /package/{dist/config → config}/ui-spec.js +0 -0
  951. /package/{dist/config → config}/ui-spec.js.map +0 -0
  952. /package/{dist/config → config}/wechat-config.d.ts +0 -0
  953. /package/{dist/config → config}/wechat-config.d.ts.map +0 -0
  954. /package/{dist/config → config}/wechat-config.js +0 -0
  955. /package/{dist/config → config}/wechat-config.js.map +0 -0
  956. /package/{dist/config → config}/zod-schema.agent-runtime.d.ts.map +0 -0
  957. /package/{dist/config → config}/zod-schema.agent-runtime.js +0 -0
  958. /package/{dist/config → config}/zod-schema.agent-runtime.js.map +0 -0
  959. /package/{dist/config → config}/zod-schema.core.d.ts.map +0 -0
  960. /package/{dist/config → config}/zod-schema.core.js +0 -0
  961. /package/{dist/config → config}/zod-schema.core.js.map +0 -0
  962. /package/{dist/connector-cred-types.d.ts → connector-cred-types.d.ts} +0 -0
  963. /package/{dist/connector-cred-types.d.ts.map → connector-cred-types.d.ts.map} +0 -0
  964. /package/{dist/connector-cred-types.js → connector-cred-types.js} +0 -0
  965. /package/{dist/connector-cred-types.js.map → connector-cred-types.js.map} +0 -0
  966. /package/{dist/contracts → contracts}/awareness.d.ts +0 -0
  967. /package/{dist/contracts → contracts}/awareness.d.ts.map +0 -0
  968. /package/{dist/contracts → contracts}/awareness.js +0 -0
  969. /package/{dist/contracts → contracts}/awareness.js.map +0 -0
  970. /package/{dist/contracts → contracts}/cloud-topology.d.ts +0 -0
  971. /package/{dist/contracts → contracts}/cloud-topology.d.ts.map +0 -0
  972. /package/{dist/contracts → contracts}/config.d.ts +0 -0
  973. /package/{dist/contracts → contracts}/config.d.ts.map +0 -0
  974. /package/{dist/contracts → contracts}/config.js +0 -0
  975. /package/{dist/contracts → contracts}/config.js.map +0 -0
  976. /package/{dist/contracts → contracts}/content-pack.js.map +0 -0
  977. /package/{dist/contracts → contracts}/drop.d.ts +0 -0
  978. /package/{dist/contracts → contracts}/drop.d.ts.map +0 -0
  979. /package/{dist/contracts → contracts}/drop.js +0 -0
  980. /package/{dist/contracts → contracts}/drop.js.map +0 -0
  981. /package/{dist/contracts → contracts}/feature-result.d.ts +0 -0
  982. /package/{dist/contracts → contracts}/feature-result.d.ts.map +0 -0
  983. /package/{dist/contracts → contracts}/feature-result.js +0 -0
  984. /package/{dist/contracts → contracts}/feature-result.js.map +0 -0
  985. /package/{dist/contracts → contracts}/inbox.d.ts +0 -0
  986. /package/{dist/contracts → contracts}/inbox.d.ts.map +0 -0
  987. /package/{dist/contracts → contracts}/inbox.js +0 -0
  988. /package/{dist/contracts → contracts}/inbox.js.map +0 -0
  989. /package/{dist/contracts → contracts}/lifeops-connector-degradation.d.ts +0 -0
  990. /package/{dist/contracts → contracts}/lifeops-connector-degradation.d.ts.map +0 -0
  991. /package/{dist/contracts → contracts}/lifeops-connector-degradation.js +0 -0
  992. /package/{dist/contracts → contracts}/lifeops-connector-degradation.js.map +0 -0
  993. /package/{dist/contracts → contracts}/verification.d.ts +0 -0
  994. /package/{dist/contracts → contracts}/verification.d.ts.map +0 -0
  995. /package/{dist/contracts → contracts}/verification.js +0 -0
  996. /package/{dist/contracts → contracts}/verification.js.map +0 -0
  997. /package/{dist/dev-settings-banner-style.d.ts.map → dev-settings-banner-style.d.ts.map} +0 -0
  998. /package/{dist/dev-settings-figlet-heading.d.ts → dev-settings-figlet-heading.d.ts} +0 -0
  999. /package/{dist/dev-settings-table.d.ts → dev-settings-table.d.ts} +0 -0
  1000. /package/{dist/dev-settings-table.d.ts.map → dev-settings-table.d.ts.map} +0 -0
  1001. /package/{dist/dev-settings-table.js → dev-settings-table.js} +0 -0
  1002. /package/{dist/dev-settings-table.js.map → dev-settings-table.js.map} +0 -0
  1003. /package/{dist/i18n → i18n}/keyword-matching.d.ts +0 -0
  1004. /package/{dist/i18n → i18n}/validation-keywords.d.ts +0 -0
  1005. /package/{dist/i18n → i18n}/validation-keywords.d.ts.map +0 -0
  1006. /package/{dist/i18n → i18n}/validation-keywords.js +0 -0
  1007. /package/{dist/i18n → i18n}/validation-keywords.js.map +0 -0
  1008. /package/{dist/local-inference → local-inference}/paths.d.ts.map +0 -0
  1009. /package/{dist/local-inference → local-inference}/paths.js.map +0 -0
  1010. /package/{dist/local-inference → local-inference}/verify.d.ts +0 -0
  1011. /package/{dist/local-inference → local-inference}/verify.d.ts.map +0 -0
  1012. /package/{dist/local-inference → local-inference}/verify.js +0 -0
  1013. /package/{dist/local-inference → local-inference}/verify.js.map +0 -0
  1014. /package/{dist/platform → platform}/is-native-server.d.ts +0 -0
  1015. /package/{dist/platform → platform}/is-native-server.d.ts.map +0 -0
  1016. /package/{dist/platform → platform}/is-native-server.js +0 -0
  1017. /package/{dist/platform → platform}/is-native-server.js.map +0 -0
  1018. /package/{dist/recent-messages-state.d.ts → recent-messages-state.d.ts} +0 -0
  1019. /package/{dist/recent-messages-state.d.ts.map → recent-messages-state.d.ts.map} +0 -0
  1020. /package/{dist/recent-messages-state.js → recent-messages-state.js} +0 -0
  1021. /package/{dist/recent-messages-state.js.map → recent-messages-state.js.map} +0 -0
  1022. /package/{dist/spoken-text.d.ts → spoken-text.d.ts} +0 -0
  1023. /package/{dist/terminal → terminal}/links.d.ts +0 -0
  1024. /package/{dist/terminal → terminal}/links.d.ts.map +0 -0
  1025. /package/{dist/terminal → terminal}/links.js +0 -0
  1026. /package/{dist/terminal → terminal}/links.js.map +0 -0
  1027. /package/{dist/terminal → terminal}/palette.d.ts +0 -0
  1028. /package/{dist/terminal → terminal}/palette.d.ts.map +0 -0
  1029. /package/{dist/terminal → terminal}/palette.js +0 -0
  1030. /package/{dist/terminal → terminal}/palette.js.map +0 -0
  1031. /package/{dist/terminal → terminal}/theme.d.ts +0 -0
  1032. /package/{dist/terminal → terminal}/theme.d.ts.map +0 -0
  1033. /package/{dist/terminal → terminal}/theme.js +0 -0
  1034. /package/{dist/terminal → terminal}/theme.js.map +0 -0
  1035. /package/{dist/test-support → test-support}/process-helpers.d.ts +0 -0
  1036. /package/{dist/test-support → test-support}/process-helpers.d.ts.map +0 -0
  1037. /package/{dist/test-support → test-support}/process-helpers.js +0 -0
  1038. /package/{dist/test-support → test-support}/process-helpers.js.map +0 -0
  1039. /package/{dist/types → types}/index.js +0 -0
  1040. /package/{dist/types → types}/index.js.map +0 -0
  1041. /package/{dist/utils → utils}/asset-url.d.ts +0 -0
  1042. /package/{dist/utils → utils}/asset-url.d.ts.map +0 -0
  1043. /package/{dist/utils → utils}/asset-url.js +0 -0
  1044. /package/{dist/utils → utils}/asset-url.js.map +0 -0
  1045. /package/{dist/utils → utils}/browser-tab-kit-types.d.ts.map +0 -0
  1046. /package/{dist/utils → utils}/browser-tab-kit-types.js.map +0 -0
  1047. /package/{dist/utils → utils}/character-message-examples.d.ts +0 -0
  1048. /package/{dist/utils → utils}/character-message-examples.d.ts.map +0 -0
  1049. /package/{dist/utils → utils}/character-message-examples.js +0 -0
  1050. /package/{dist/utils → utils}/character-message-examples.js.map +0 -0
  1051. /package/{dist/utils → utils}/cloud-status.d.ts +0 -0
  1052. /package/{dist/utils → utils}/cloud-status.d.ts.map +0 -0
  1053. /package/{dist/utils → utils}/cloud-status.js +0 -0
  1054. /package/{dist/utils → utils}/cloud-status.js.map +0 -0
  1055. /package/{dist/utils → utils}/documents-upload-image.d.ts +0 -0
  1056. /package/{dist/utils → utils}/documents-upload-image.d.ts.map +0 -0
  1057. /package/{dist/utils → utils}/eliza-cloud-model-route.d.ts +0 -0
  1058. /package/{dist/utils → utils}/eliza-cloud-model-route.d.ts.map +0 -0
  1059. /package/{dist/utils → utils}/eliza-cloud-model-route.js +0 -0
  1060. /package/{dist/utils → utils}/eliza-cloud-model-route.js.map +0 -0
  1061. /package/{dist/utils → utils}/eliza-globals.d.ts +0 -0
  1062. /package/{dist/utils → utils}/eliza-globals.d.ts.map +0 -0
  1063. /package/{dist/utils → utils}/eliza-globals.js +0 -0
  1064. /package/{dist/utils → utils}/eliza-globals.js.map +0 -0
  1065. /package/{dist/utils → utils}/eliza-root.d.ts +0 -0
  1066. /package/{dist/utils → utils}/eliza-root.d.ts.map +0 -0
  1067. /package/{dist/utils → utils}/eliza-root.js +0 -0
  1068. /package/{dist/utils → utils}/eliza-root.js.map +0 -0
  1069. /package/{dist/utils → utils}/exec-safety.d.ts +0 -0
  1070. /package/{dist/utils → utils}/labels.d.ts +0 -0
  1071. /package/{dist/utils → utils}/labels.d.ts.map +0 -0
  1072. /package/{dist/utils → utils}/labels.js +0 -0
  1073. /package/{dist/utils → utils}/labels.js.map +0 -0
  1074. /package/{dist/utils → utils}/log-prefix.d.ts +0 -0
  1075. /package/{dist/utils → utils}/name-tokens.d.ts.map +0 -0
  1076. /package/{dist/utils → utils}/name-tokens.js.map +0 -0
  1077. /package/{dist/utils → utils}/number-parsing.d.ts +0 -0
  1078. /package/{dist/utils → utils}/owner-name.d.ts +0 -0
  1079. /package/{dist/utils → utils}/owner-name.d.ts.map +0 -0
  1080. /package/{dist/utils → utils}/owner-name.js +0 -0
  1081. /package/{dist/utils → utils}/owner-name.js.map +0 -0
  1082. /package/{dist/utils → utils}/rate-limiter.d.ts +0 -0
  1083. /package/{dist/utils → utils}/rate-limiter.d.ts.map +0 -0
  1084. /package/{dist/utils → utils}/rate-limiter.js +0 -0
  1085. /package/{dist/utils → utils}/rate-limiter.js.map +0 -0
  1086. /package/{dist/utils → utils}/serialise.d.ts +0 -0
  1087. /package/{dist/utils → utils}/serialise.d.ts.map +0 -0
  1088. /package/{dist/utils → utils}/sql-compat.d.ts +0 -0
  1089. /package/{dist/utils → utils}/sql-compat.d.ts.map +0 -0
  1090. /package/{dist/utils → utils}/subscription-auth.d.ts +0 -0
  1091. /package/{dist/utils → utils}/subscription-auth.d.ts.map +0 -0
  1092. /package/{dist/utils → utils}/subscription-auth.js +0 -0
  1093. /package/{dist/utils → utils}/subscription-auth.js.map +0 -0
  1094. /package/{dist/utils → utils}/trajectory-format.d.ts +0 -0
  1095. /package/{dist/utils → utils}/trajectory-format.d.ts.map +0 -0
  1096. /package/{dist/utils → utils}/trajectory-format.js +0 -0
  1097. /package/{dist/utils → utils}/trajectory-format.js.map +0 -0
  1098. /package/{dist/validation-keywords.d.ts → validation-keywords.d.ts} +0 -0
  1099. /package/{dist/validation-keywords.d.ts.map → validation-keywords.d.ts.map} +0 -0
  1100. /package/{dist/validation-keywords.js → validation-keywords.js} +0 -0
  1101. /package/{dist/validation-keywords.js.map → validation-keywords.js.map} +0 -0
@@ -0,0 +1,284 @@
1
+ /**
2
+ * First-sentence snip helper for the TTS first-line cache.
3
+ *
4
+ * Pure, deterministic, no I/O. Both the local runtime and the Eliza Cloud
5
+ * `/api/v1/voice/tts` route call into this module so that byte-equal sentence
6
+ * text on either side maps to byte-equal cache keys.
7
+ *
8
+ * Algorithm summary (see R4 §2 in `.swarm/research/R4-tts-cache.md`):
9
+ * 1. Trim leading whitespace.
10
+ * 2. Walk char-by-char, tracking quote depth (skip terminators inside
11
+ * `"..."`/`'...'`/`“...”`), decimal context (digit-`.`-digit isn't a
12
+ * boundary), and abbreviation context (e.g. `Mr.`, `e.g.`, `U.S.`).
13
+ * 3. First surviving terminator (`.`/`!`/`?`/`…`/`。`/`!`/`?`) or `\n`
14
+ * ends the sentence. Consume any contiguous run of terminators that
15
+ * follow (so `"Wait..."` stays intact).
16
+ * 4. If no terminator and no newline → null (don't cache unterminated text).
17
+ * 5. Apply ≤10-word filter on the normalised form. If wordCount > 10,
18
+ * return null (don't cache).
19
+ *
20
+ * `FIRST_SENTENCE_SNIP_VERSION` is part of the cache key — bumping it
21
+ * invalidates every existing cached entry.
22
+ */
23
+ /**
24
+ * Cache-key algorithm version. Bump when the snip/normalise logic changes
25
+ * in a way that would produce different keys for the same input. Local and
26
+ * cloud caches re-key off this constant, so a bump rolls the entire cache.
27
+ */
28
+ export const FIRST_SENTENCE_SNIP_VERSION = "1";
29
+ /**
30
+ * Maximum word count (Unicode-aware) for a cacheable first-sentence snip.
31
+ * Beyond this the bytes won't repeat often enough to amortise the cache.
32
+ */
33
+ export const FIRST_SENTENCE_MAX_WORDS = 10;
34
+ const ABBREVIATIONS = new Set([
35
+ "mr",
36
+ "mrs",
37
+ "ms",
38
+ "mx",
39
+ "dr",
40
+ "st",
41
+ "jr",
42
+ "sr",
43
+ "prof",
44
+ "vs",
45
+ "etc",
46
+ "eg",
47
+ "ie",
48
+ "fig",
49
+ "no",
50
+ "vol",
51
+ "ch",
52
+ "pt",
53
+ "co",
54
+ "inc",
55
+ "ltd",
56
+ "us",
57
+ "uk",
58
+ "usa",
59
+ ]);
60
+ /**
61
+ * Terminator chars that end a sentence. Includes CJK `。!?` so multilingual
62
+ * inputs aren't refused.
63
+ */
64
+ const TERMINATOR_REGEX = /[.!?…。!?]/u;
65
+ const QUOTE_PAIRS = new Map([
66
+ ['"', '"'],
67
+ ["'", "'"],
68
+ ["“", "”"],
69
+ ["‘", "’"],
70
+ ["«", "»"],
71
+ ["「", "」"],
72
+ ["『", "』"],
73
+ ]);
74
+ const CLOSE_QUOTES = new Set(QUOTE_PAIRS.values());
75
+ function isDigit(ch) {
76
+ return ch >= "0" && ch <= "9";
77
+ }
78
+ function isAlpha(ch) {
79
+ if (!ch)
80
+ return false;
81
+ const code = ch.charCodeAt(0);
82
+ return ((code >= 65 && code <= 90) || // A-Z
83
+ (code >= 97 && code <= 122) // a-z
84
+ );
85
+ }
86
+ /**
87
+ * Lower-case + strip dots from a token to compare against `ABBREVIATIONS`.
88
+ * Used to detect things like `Mr.` / `U.S.` / `e.g.` where the dot is part of
89
+ * an abbreviation rather than a sentence terminator.
90
+ */
91
+ function isAbbrevToken(token) {
92
+ if (token.length === 0 || token.length > 6)
93
+ return false;
94
+ const lower = token.toLowerCase().replace(/\./g, "");
95
+ if (!lower)
96
+ return false;
97
+ return ABBREVIATIONS.has(lower);
98
+ }
99
+ /**
100
+ * Walk the input forwards looking for the first sentence-terminating position.
101
+ * Returns the *inclusive* end index of the terminator run (so the snip is
102
+ * `text.slice(start, endInclusive + 1)`), or -1 if no terminator was found.
103
+ *
104
+ * `start` is the position after any leading whitespace.
105
+ */
106
+ function findTerminatorEnd(text, start) {
107
+ let i = start;
108
+ const quoteStack = [];
109
+ while (i < text.length) {
110
+ const ch = text[i] ?? "";
111
+ // Newline acts as a soft terminator (e.g. message body broken into lines).
112
+ if (ch === "\n") {
113
+ // Strip trailing whitespace from the run by returning index of \n.
114
+ return i;
115
+ }
116
+ // Open / close quotes for skipping terminators inside.
117
+ const closer = QUOTE_PAIRS.get(ch);
118
+ if (closer && closer !== ch) {
119
+ // Asymmetric pair → push the expected closer.
120
+ quoteStack.push(closer);
121
+ i++;
122
+ continue;
123
+ }
124
+ if (quoteStack.length > 0 && ch === quoteStack[quoteStack.length - 1]) {
125
+ quoteStack.pop();
126
+ i++;
127
+ continue;
128
+ }
129
+ // Symmetric ASCII quotes: toggle stack only when not already inside an
130
+ // asymmetric quote.
131
+ //
132
+ // Apostrophes (`'`) are NEVER treated as quote delimiters when they sit
133
+ // between two letters (contractions like `it's`, possessives like
134
+ // `Eliza's`) — otherwise a stray apostrophe would swallow the rest of
135
+ // the input and we'd never find a terminator.
136
+ if (ch === "'" && quoteStack.length === 0) {
137
+ const prev = i > 0 ? text[i - 1] : "";
138
+ const next = i + 1 < text.length ? text[i + 1] : "";
139
+ if (!(isAlpha(prev) && isAlpha(next))) {
140
+ quoteStack.push(ch);
141
+ }
142
+ i++;
143
+ continue;
144
+ }
145
+ if (ch === '"' && quoteStack.length === 0) {
146
+ quoteStack.push(ch);
147
+ i++;
148
+ continue;
149
+ }
150
+ if (quoteStack.length > 0 &&
151
+ CLOSE_QUOTES.has(quoteStack[quoteStack.length - 1] ?? "") &&
152
+ ch === quoteStack[quoteStack.length - 1]) {
153
+ quoteStack.pop();
154
+ i++;
155
+ continue;
156
+ }
157
+ // Skip everything inside quotes.
158
+ if (quoteStack.length > 0) {
159
+ i++;
160
+ continue;
161
+ }
162
+ if (!TERMINATOR_REGEX.test(ch)) {
163
+ i++;
164
+ continue;
165
+ }
166
+ // Candidate terminator. Apply guards.
167
+ if (ch === ".") {
168
+ // Decimal context: digit . digit
169
+ const prev = i > 0 ? text[i - 1] : "";
170
+ const next = i + 1 < text.length ? text[i + 1] : "";
171
+ if (isDigit(prev) && isDigit(next)) {
172
+ i++;
173
+ continue;
174
+ }
175
+ // Abbreviation context: look backwards for an alpha run, possibly
176
+ // with internal dots (e.g. `U.S.`). Bound the look-back to 6 chars.
177
+ let j = i - 1;
178
+ let token = "";
179
+ while (j >= 0 && j >= i - 6) {
180
+ const tj = text[j] ?? "";
181
+ if (isAlpha(tj) || tj === ".") {
182
+ token = tj + token;
183
+ j--;
184
+ continue;
185
+ }
186
+ break;
187
+ }
188
+ if (token && isAbbrevToken(token)) {
189
+ i++;
190
+ continue;
191
+ }
192
+ // Also: avoid treating mid-word dot as terminator if followed
193
+ // immediately by alpha and no whitespace (e.g. "foo.bar"
194
+ // shouldn't terminate). Cache hit rate is more important than
195
+ // being clever here — conservative: skip.
196
+ if (isAlpha(next)) {
197
+ i++;
198
+ continue;
199
+ }
200
+ }
201
+ // Valid terminator. Consume any contiguous run of terminator chars so
202
+ // `Wait...` stays intact, then return the inclusive end.
203
+ let end = i;
204
+ while (end + 1 < text.length) {
205
+ const nxt = text[end + 1] ?? "";
206
+ if (TERMINATOR_REGEX.test(nxt)) {
207
+ end++;
208
+ continue;
209
+ }
210
+ break;
211
+ }
212
+ return end;
213
+ }
214
+ return -1;
215
+ }
216
+ /**
217
+ * Unicode-aware word count. Hyphenated words and apostrophe-internal words
218
+ * count as one (e.g. "twenty-three" → 1, "it's" → 1). Dotted acronyms with
219
+ * single-letter segments (e.g. "U.S.", "U.S.A.") count as one word. Decimal
220
+ * numbers like "3.14" count as one word.
221
+ */
222
+ export function wordCount(s) {
223
+ if (!s)
224
+ return 0;
225
+ const matches = s.match(
226
+ // In priority order:
227
+ // - decimal number (digits . digits, possibly multi-segment)
228
+ // - dotted acronym (≥2 single-letter dot pairs)
229
+ // - regular word with optional hyphen/apostrophe internal joiners
230
+ /\p{N}+(?:\.\p{N}+)+|(?:\p{L}\.){2,}|[\p{L}\p{N}]+(?:[’'-][\p{L}\p{N}]+)*/gu);
231
+ return matches ? matches.length : 0;
232
+ }
233
+ /**
234
+ * Normalise a snip for cache-key purposes. NFC + lower-case + collapse
235
+ * whitespace + strip trailing terminators/whitespace. Apostrophes preserved.
236
+ */
237
+ export function normalizeForKey(snip) {
238
+ let s = snip.normalize("NFC");
239
+ // Trim leading whitespace including zero-width space (U+200B).
240
+ s = s.replace(/^[\s​]+/u, "").replace(/[\s​]+$/u, "");
241
+ s = s.toLowerCase();
242
+ s = s.replace(/\s+/gu, " ");
243
+ // Strip trailing terminator/whitespace run. CJK terminators included.
244
+ s = s.replace(/[\s​.!?…。!?]+$/gu, "");
245
+ return s;
246
+ }
247
+ /**
248
+ * Attempt to snip the first sentence from `text`. Returns `null` if:
249
+ * - input is empty / whitespace only
250
+ * - no sentence-terminator found
251
+ * - normalised snip has > 10 words
252
+ * - normalised snip is empty after stripping terminators
253
+ *
254
+ * Otherwise returns a `FirstSentenceSnipResult` carrying the raw and
255
+ * normalised forms plus the word count.
256
+ */
257
+ export function firstSentenceSnip(text) {
258
+ if (typeof text !== "string" || text.length === 0)
259
+ return null;
260
+ // Find start after leading whitespace (incl. zero-width space).
261
+ const trimMatch = /^[\s​]+/u.exec(text);
262
+ const start = trimMatch ? trimMatch[0].length : 0;
263
+ if (start >= text.length)
264
+ return null;
265
+ const end = findTerminatorEnd(text, start);
266
+ if (end < 0)
267
+ return null;
268
+ const raw = text.slice(start, end + 1);
269
+ const normalized = normalizeForKey(raw);
270
+ if (!normalized)
271
+ return null;
272
+ const wc = wordCount(normalized);
273
+ if (wc === 0)
274
+ return null;
275
+ if (wc > FIRST_SENTENCE_MAX_WORDS)
276
+ return null;
277
+ return {
278
+ raw,
279
+ normalized,
280
+ wordCount: wc,
281
+ endOffset: end + 1,
282
+ };
283
+ }
284
+ //# sourceMappingURL=first-sentence-snip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"first-sentence-snip.js","sourceRoot":"","sources":["../../src/voice/first-sentence-snip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAY,CAAC;AAGxD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAW,CAAC;AAEpD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAS;IACpC,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;CACN,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAM,WAAW,GAAgC,IAAI,GAAG,CAAC;IACvD,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CA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UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,MAAM,EAAE,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1B,IAAI,EAAE,GAAG,wBAAwB;QAAE,OAAO,IAAI,CAAC;IAE/C,OAAO;QACL,GAAG;QACH,UAAU;QACV,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,GAAG,GAAG,CAAC;KACnB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Owner-candidate inference for voice (#8785).
3
+ *
4
+ * "How does the agent know which speaker is the device OWNER?" Today the owner
5
+ * entity must be enrolled explicitly (the first-run voice flow). But when no
6
+ * owner is set, the agent should still be able to FORM a hypothesis from what it
7
+ * hears — the person who speaks to it most, most confidently, and clearly more
8
+ * than anyone else is the likely owner. This is the pure decision logic a
9
+ * provider/evaluator runs when the owner is unknown: it accumulates recognized
10
+ * voice turns and proposes a candidate only when the evidence is both sufficient
11
+ * (enough confident observations) and unambiguous (a clear lead over the
12
+ * runner-up). Otherwise it stays UNDECIDED — it never guesses an owner from one
13
+ * stray turn, because a wrong owner is a security and personalization hazard.
14
+ *
15
+ * Pure (no I/O, no models); the runtime feeds it the diarized/recognized
16
+ * observations and acts on a decided candidate (e.g. prompt to confirm, or set
17
+ * the owner setting). The Voice Workbench exercises the SAME function so the
18
+ * inference is benchmarked, not just shipped.
19
+ */
20
+ /** One recognized voice turn: which enrolled/clustered speaker, how confident. */
21
+ export interface OwnerObservation {
22
+ /** The entity/cluster the recognized voice resolved to (null = unrecognized). */
23
+ entityId: string | null;
24
+ /** Recognition confidence 0..1 (cosine-rescaled by the attribution pipeline). */
25
+ confidence: number;
26
+ }
27
+ export interface OwnerInferenceOptions {
28
+ /** Minimum qualifying observations before any candidate is proposed. */
29
+ minObservations?: number;
30
+ /** Confidence floor; observations below it don't count toward a candidate. */
31
+ minConfidence?: number;
32
+ /**
33
+ * Minimum lead (in confidence-weighted score) the top speaker must hold over
34
+ * the runner-up to be unambiguous. Prevents naming an owner in a two-equals
35
+ * household.
36
+ */
37
+ minMargin?: number;
38
+ }
39
+ export interface OwnerInferenceResult {
40
+ /** The proposed owner entity, or null when the evidence is insufficient. */
41
+ ownerEntityId: string | null;
42
+ /** Confidence-weighted share of the proposed owner (0..1), 0 when undecided. */
43
+ share: number;
44
+ /** Number of qualifying (confident, recognized) observations considered. */
45
+ qualifyingObservations: number;
46
+ /** Why the function decided / declined — surfaced for the provider's logs. */
47
+ reason: string;
48
+ }
49
+ /**
50
+ * Propose the most likely owner from recognized voice observations, or stay
51
+ * undecided. A candidate is returned only when there are at least
52
+ * `minObservations` confident, recognized turns AND the top speaker leads the
53
+ * runner-up by at least `minMargin` (confidence-weighted). Ties and thin
54
+ * evidence yield `ownerEntityId: null`.
55
+ */
56
+ export declare function resolveOwnerCandidate(observations: ReadonlyArray<OwnerObservation>, options?: OwnerInferenceOptions): OwnerInferenceResult;
57
+ //# sourceMappingURL=owner-inference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-inference.d.ts","sourceRoot":"","sources":["../../src/voice/owner-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAC7C,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA4CtB"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Owner-candidate inference for voice (#8785).
3
+ *
4
+ * "How does the agent know which speaker is the device OWNER?" Today the owner
5
+ * entity must be enrolled explicitly (the first-run voice flow). But when no
6
+ * owner is set, the agent should still be able to FORM a hypothesis from what it
7
+ * hears — the person who speaks to it most, most confidently, and clearly more
8
+ * than anyone else is the likely owner. This is the pure decision logic a
9
+ * provider/evaluator runs when the owner is unknown: it accumulates recognized
10
+ * voice turns and proposes a candidate only when the evidence is both sufficient
11
+ * (enough confident observations) and unambiguous (a clear lead over the
12
+ * runner-up). Otherwise it stays UNDECIDED — it never guesses an owner from one
13
+ * stray turn, because a wrong owner is a security and personalization hazard.
14
+ *
15
+ * Pure (no I/O, no models); the runtime feeds it the diarized/recognized
16
+ * observations and acts on a decided candidate (e.g. prompt to confirm, or set
17
+ * the owner setting). The Voice Workbench exercises the SAME function so the
18
+ * inference is benchmarked, not just shipped.
19
+ */
20
+ const DEFAULT_MIN_OBSERVATIONS = 3;
21
+ const DEFAULT_MIN_CONFIDENCE = 0.7;
22
+ const DEFAULT_MIN_MARGIN = 1;
23
+ /**
24
+ * Propose the most likely owner from recognized voice observations, or stay
25
+ * undecided. A candidate is returned only when there are at least
26
+ * `minObservations` confident, recognized turns AND the top speaker leads the
27
+ * runner-up by at least `minMargin` (confidence-weighted). Ties and thin
28
+ * evidence yield `ownerEntityId: null`.
29
+ */
30
+ export function resolveOwnerCandidate(observations, options = {}) {
31
+ const minObservations = options.minObservations ?? DEFAULT_MIN_OBSERVATIONS;
32
+ const minConfidence = options.minConfidence ?? DEFAULT_MIN_CONFIDENCE;
33
+ const minMargin = options.minMargin ?? DEFAULT_MIN_MARGIN;
34
+ const scores = new Map();
35
+ let qualifying = 0;
36
+ let totalScore = 0;
37
+ for (const obs of observations) {
38
+ if (obs.entityId === null)
39
+ continue;
40
+ if (!(obs.confidence >= minConfidence))
41
+ continue;
42
+ qualifying += 1;
43
+ const next = (scores.get(obs.entityId) ?? 0) + obs.confidence;
44
+ scores.set(obs.entityId, next);
45
+ totalScore += obs.confidence;
46
+ }
47
+ if (qualifying < minObservations) {
48
+ return {
49
+ ownerEntityId: null,
50
+ share: 0,
51
+ qualifyingObservations: qualifying,
52
+ reason: `insufficient evidence (${qualifying}/${minObservations} confident observations)`,
53
+ };
54
+ }
55
+ const ranked = [...scores.entries()].sort((a, b) => b[1] - a[1]);
56
+ const [topId, topScore] = ranked[0];
57
+ const runnerUpScore = ranked[1]?.[1] ?? 0;
58
+ if (topScore - runnerUpScore < minMargin) {
59
+ return {
60
+ ownerEntityId: null,
61
+ share: totalScore > 0 ? topScore / totalScore : 0,
62
+ qualifyingObservations: qualifying,
63
+ reason: `ambiguous lead (top ${topScore.toFixed(2)} vs runner-up ${runnerUpScore.toFixed(2)}, margin < ${minMargin})`,
64
+ };
65
+ }
66
+ return {
67
+ ownerEntityId: topId,
68
+ share: totalScore > 0 ? topScore / totalScore : 0,
69
+ qualifyingObservations: qualifying,
70
+ reason: `dominant speaker (${topScore.toFixed(2)} of ${totalScore.toFixed(2)} over ${qualifying} observations)`,
71
+ };
72
+ }
73
+ //# sourceMappingURL=owner-inference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-inference.js","sourceRoot":"","sources":["../../src/voice/owner-inference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAkCH,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,sBAAsB,GAAG,GAAG,CAAC;A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C,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,QAAQ,GAAG,aAAa,GAAG,SAAS,EAAE,CAAC;QACzC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,KAAK,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YACjD,sBAAsB,EAAE,UAAU;YAClC,MAAM,EAAE,uBAAuB,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,SAAS,GAAG;SACtH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,KAAK,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QACjD,sBAAsB,EAAE,UAAU;QAClC,MAAM,EAAE,qBAAqB,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,gBAAgB;KAChH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Canonical client-side shouldRespond / echo-rejection gate for always-on voice.
3
+ *
4
+ * In always-on ("hands-free") mode the mic is open continuously, so the
5
+ * recognizer transcribes EVERYTHING it hears — the agent's own text-to-speech
6
+ * bleeding back into the mic, the speaker's disfluent thinking noises ("um…"),
7
+ * and other people in the room. Sending those as turns makes the agent reply to
8
+ * itself, to filler, or to a bystander — the "responding when it's not
9
+ * appropriate" problem.
10
+ *
11
+ * This is the SINGLE definition of that gate, shared by:
12
+ * - the UI shell capture loop (`@elizaos/ui` `voice/should-respond` +
13
+ * `voice/voice-turn-signal` re-export from here), and
14
+ * - the Voice Workbench headless runner (the plugin's real-decision-logic
15
+ * services adapter calls these so the benchmark exercises the SAME code the
16
+ * client runs — no drift between what we test and what we ship).
17
+ *
18
+ * Pure (no DOM, no I/O); the only dependency is the canonical syntactic EOT
19
+ * heuristic in `@elizaos/shared/voice-eot`.
20
+ */
21
+ /** How recent the agent's reply must be for the echo guard to apply. */
22
+ export declare const ECHO_WINDOW_MS = 9000;
23
+ /** Word-overlap fraction above which a turn is treated as TTS echo. */
24
+ export declare const ECHO_OVERLAP_THRESHOLD = 0.7;
25
+ export interface ShouldRespondContext {
26
+ /** The agent's most recent spoken reply, for the echo guard. */
27
+ recentAgentReply?: string;
28
+ /** Age of that reply in ms; the echo guard applies while it's recent. */
29
+ replyAgeMs?: number;
30
+ /**
31
+ * True while the agent is CURRENTLY speaking. Forces the echo guard on
32
+ * regardless of `replyAgeMs`, because a long reply's TTS is actively bleeding
33
+ * into the open mic even though its message was created many seconds ago (the
34
+ * age-only window would have already expired mid-speech).
35
+ */
36
+ agentSpeaking?: boolean;
37
+ }
38
+ /**
39
+ * Whether a transcribed voice turn should be sent to the agent (i.e. warrants a
40
+ * response). Returns false for pure disfluency and for near-verbatim echoes of
41
+ * the agent's recent speech.
42
+ */
43
+ export declare function shouldRespondToVoiceTurn(transcript: string, context?: ShouldRespondContext): boolean;
44
+ /** Mirrors the server-side VoiceTurnSignalMetadata shape the gate parses. */
45
+ export interface VoiceTurnSignal {
46
+ endOfTurnProbability: number;
47
+ nextSpeaker: "agent" | "user" | "unknown";
48
+ agentShouldSpeak: boolean;
49
+ source: string;
50
+ }
51
+ /** Live speaker attribution from diarization (only where audio frames exist). */
52
+ export interface VoiceTurnSpeakerAttribution {
53
+ /** Enrolled entity this turn was attributed to, or null when unknown. */
54
+ entityId: string | null;
55
+ /** Match confidence 0..1 (cosine-rescaled by the attribution pipeline). */
56
+ confidence: number;
57
+ /** True when attributed to the device owner / primary enrolled speaker. */
58
+ isOwner?: boolean;
59
+ }
60
+ export interface BuildVoiceTurnSignalContext extends ShouldRespondContext {
61
+ /** Speaker attribution for this turn (diarization; desktop/server only). */
62
+ speaker?: VoiceTurnSpeakerAttribution;
63
+ /** True when a wake word ("hey eliza") fired within the recent listen window. */
64
+ wakeWordActive?: boolean;
65
+ /** Entity ids the agent answers to without a wake word (owner + enrolled). */
66
+ knownSpeakerEntityIds?: readonly string[];
67
+ /**
68
+ * Cosine similarity (0..1) of THIS turn's speaker embedding against the
69
+ * agent's own TTS-voice imprint, when the speaker encoder is available. High =
70
+ * the agent is hearing ITSELF (its TTS bled back into the mic). This is the
71
+ * ACOUSTIC self-echo signal — it catches an echo the transcript word-overlap
72
+ * guard misses (a mis-transcribed echo whose words don't match the reply).
73
+ */
74
+ selfVoiceSimilarity?: number;
75
+ }
76
+ /** Server SUPPRESS threshold for EOT — below this reads as "user still talking". */
77
+ export declare const SERVER_EOT_SUPPRESS_THRESHOLD = 0.4;
78
+ /** Only a CONFIDENT bystander attribution is allowed to silence a turn. */
79
+ export declare const BYSTANDER_SUPPRESS_CONFIDENCE = 0.7;
80
+ /**
81
+ * Cosine at/above which an incoming turn is treated as the agent's OWN voice and
82
+ * hard-suppressed. WeSpeaker enrolls the device owner at ~0.78; the agent's own
83
+ * TTS imprint is a tighter, single-source match, so a slightly lower bar is
84
+ * safe and catches echo the transcript guard cannot.
85
+ */
86
+ export declare const AGENT_SELF_VOICE_THRESHOLD = 0.7;
87
+ export declare function buildVoiceTurnSignal(transcript: string, context?: BuildVoiceTurnSignalContext): VoiceTurnSignal;
88
+ //# sourceMappingURL=respond-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"respond-gate.d.ts","sourceRoot":"","sources":["../../src/voice/respond-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAqBH,wEAAwE;AACxE,eAAO,MAAM,cAAc,OAAO,CAAC;AAC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AClB,OAAO,GAAE,2BAAgC,GACxC,eAAe,CA0DjB"}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * Canonical client-side shouldRespond / echo-rejection gate for always-on voice.
3
+ *
4
+ * In always-on ("hands-free") mode the mic is open continuously, so the
5
+ * recognizer transcribes EVERYTHING it hears — the agent's own text-to-speech
6
+ * bleeding back into the mic, the speaker's disfluent thinking noises ("um…"),
7
+ * and other people in the room. Sending those as turns makes the agent reply to
8
+ * itself, to filler, or to a bystander — the "responding when it's not
9
+ * appropriate" problem.
10
+ *
11
+ * This is the SINGLE definition of that gate, shared by:
12
+ * - the UI shell capture loop (`@elizaos/ui` `voice/should-respond` +
13
+ * `voice/voice-turn-signal` re-export from here), and
14
+ * - the Voice Workbench headless runner (the plugin's real-decision-logic
15
+ * services adapter calls these so the benchmark exercises the SAME code the
16
+ * client runs — no drift between what we test and what we ship).
17
+ *
18
+ * Pure (no DOM, no I/O); the only dependency is the canonical syntactic EOT
19
+ * heuristic in `@elizaos/shared/voice-eot`.
20
+ */
21
+ import { scoreEndOfTurnHeuristic } from "../voice-eot.js";
22
+ /** Pure disfluencies — never a meaningful turn on their own. NOT answers. */
23
+ const DISFLUENCIES = new Set([
24
+ "um",
25
+ "uh",
26
+ "uhh",
27
+ "uhm",
28
+ "umm",
29
+ "hmm",
30
+ "hm",
31
+ "mm",
32
+ "mmm",
33
+ "er",
34
+ "erm",
35
+ "ah",
36
+ "eh",
37
+ ]);
38
+ /** How recent the agent's reply must be for the echo guard to apply. */
39
+ export const ECHO_WINDOW_MS = 9000;
40
+ /** Word-overlap fraction above which a turn is treated as TTS echo. */
41
+ export const ECHO_OVERLAP_THRESHOLD = 0.7;
42
+ function words(text) {
43
+ return text
44
+ .toLowerCase()
45
+ .replace(/[^a-z0-9'\s-]/gi, "")
46
+ .split(/\s+/)
47
+ .filter(Boolean);
48
+ }
49
+ /**
50
+ * Whether a transcribed voice turn should be sent to the agent (i.e. warrants a
51
+ * response). Returns false for pure disfluency and for near-verbatim echoes of
52
+ * the agent's recent speech.
53
+ */
54
+ export function shouldRespondToVoiceTurn(transcript, context = {}) {
55
+ const w = words(transcript);
56
+ if (w.length === 0)
57
+ return false;
58
+ // Pure disfluency ("um", "uh huh"… with nothing substantive) → ignore.
59
+ if (w.every((word) => DISFLUENCIES.has(word)))
60
+ return false;
61
+ // Self-echo: the agent's own TTS heard back through the mic. Only consider it
62
+ // while the reply is recent, and only for multi-word turns (a one-word answer
63
+ // shouldn't be suppressed just because the word also appears in the reply).
64
+ const reply = context.recentAgentReply?.trim();
65
+ const age = context.replyAgeMs ?? Number.POSITIVE_INFINITY;
66
+ const echoActive = context.agentSpeaking === true || age <= ECHO_WINDOW_MS;
67
+ if (reply && echoActive && w.length >= 2) {
68
+ const replyWords = new Set(words(reply));
69
+ if (replyWords.size > 0) {
70
+ const overlap = w.filter((word) => replyWords.has(word)).length / w.length;
71
+ if (overlap >= ECHO_OVERLAP_THRESHOLD)
72
+ return false;
73
+ }
74
+ }
75
+ return true;
76
+ }
77
+ /** Server SUPPRESS threshold for EOT — below this reads as "user still talking". */
78
+ export const SERVER_EOT_SUPPRESS_THRESHOLD = 0.4;
79
+ /** Only a CONFIDENT bystander attribution is allowed to silence a turn. */
80
+ export const BYSTANDER_SUPPRESS_CONFIDENCE = 0.7;
81
+ /**
82
+ * Cosine at/above which an incoming turn is treated as the agent's OWN voice and
83
+ * hard-suppressed. WeSpeaker enrolls the device owner at ~0.78; the agent's own
84
+ * TTS imprint is a tighter, single-source match, so a slightly lower bar is
85
+ * safe and catches echo the transcript guard cannot.
86
+ */
87
+ export const AGENT_SELF_VOICE_THRESHOLD = 0.7;
88
+ export function buildVoiceTurnSignal(transcript, context = {}) {
89
+ const endOfTurnProbability = scoreEndOfTurnHeuristic(transcript);
90
+ // Transcript-level gate: the agent's own TTS echoed back through the mic, or
91
+ // pure thinking-noise ("um", "uh").
92
+ let agentShouldSpeak = shouldRespondToVoiceTurn(transcript, context);
93
+ // Audio-frame gate (only when diarization attributed the turn): a CONFIDENT
94
+ // bystander — someone who is neither the owner nor an enrolled speaker — who
95
+ // did NOT say the wake word is cross-talk, not a turn addressed to the agent.
96
+ // An uncertain attribution must never silence a real turn (fail open).
97
+ const speaker = context.speaker;
98
+ if (agentShouldSpeak && speaker && context.wakeWordActive !== true) {
99
+ const known = new Set(context.knownSpeakerEntityIds ?? []);
100
+ const enrolled = speaker.isOwner === true ||
101
+ (speaker.entityId !== null && known.has(speaker.entityId));
102
+ const confidentBystander = !enrolled &&
103
+ speaker.entityId !== null &&
104
+ speaker.confidence >= BYSTANDER_SUPPRESS_CONFIDENCE;
105
+ if (confidentBystander)
106
+ agentShouldSpeak = false;
107
+ }
108
+ // The wake word is an explicit address: it overrides bystander doubt and a
109
+ // soft echo/disfluency miss, because the user deliberately summoned the agent.
110
+ if (context.wakeWordActive === true)
111
+ agentShouldSpeak = true;
112
+ // Acoustic self-voice rejection: if the incoming voice MATCHES the agent's own
113
+ // TTS imprint while it is (or just was) speaking, it is the agent hearing
114
+ // itself — hard-suppress, even past the wake word. This is definitive (the
115
+ // owner cannot sound like the agent's synthetic voice) and catches the echo
116
+ // the transcript word-overlap guard misses (e.g. a mis-transcribed echo, or a
117
+ // "hey eliza" that the agent itself spoke).
118
+ const replyRecent = context.agentSpeaking === true ||
119
+ (context.replyAgeMs ?? Number.POSITIVE_INFINITY) <= ECHO_WINDOW_MS;
120
+ const isSelfVoice = context.selfVoiceSimilarity !== undefined &&
121
+ context.selfVoiceSimilarity >= AGENT_SELF_VOICE_THRESHOLD &&
122
+ replyRecent;
123
+ if (isSelfVoice)
124
+ agentShouldSpeak = false;
125
+ const nextSpeaker = !agentShouldSpeak
126
+ ? "user"
127
+ : endOfTurnProbability < SERVER_EOT_SUPPRESS_THRESHOLD
128
+ ? "user"
129
+ : "agent";
130
+ const source = isSelfVoice
131
+ ? "client-ambient+self-voice"
132
+ : context.wakeWordActive
133
+ ? "client-ambient+wakeword"
134
+ : speaker
135
+ ? "client-ambient+diarization"
136
+ : "client-ambient";
137
+ return { endOfTurnProbability, nextSpeaker, agentShouldSpeak, source };
138
+ }
139
+ //# sourceMappingURL=respond-gate.js.map