@elizaos/shared 2.0.0-alpha.538 → 2.0.11-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (729) 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/api/route-helpers.js +2 -0
  12. package/api/route-helpers.js.map +1 -0
  13. package/app-hero-art.d.ts.map +1 -1
  14. package/app-hero-art.js +5 -13
  15. package/app-hero-art.js.map +1 -1
  16. package/brand/index.d.ts +130 -0
  17. package/brand/index.d.ts.map +1 -0
  18. package/brand/index.js +126 -0
  19. package/brand/index.js.map +1 -0
  20. package/brand-classic/index.d.ts +158 -0
  21. package/brand-classic/index.d.ts.map +1 -0
  22. package/brand-classic/index.js +91 -0
  23. package/brand-classic/index.js.map +1 -0
  24. package/character-language.d.ts +16 -0
  25. package/character-language.d.ts.map +1 -0
  26. package/character-language.js +58 -0
  27. package/character-language.js.map +1 -0
  28. package/{onboarding-presets.characters.d.ts → character-presets.characters.d.ts} +2 -2
  29. package/character-presets.characters.d.ts.map +1 -0
  30. package/{onboarding-presets.characters.js → character-presets.characters.js} +1 -1
  31. package/character-presets.characters.js.map +1 -0
  32. package/{onboarding-presets.d.ts → character-presets.d.ts} +7 -5
  33. package/character-presets.d.ts.map +1 -0
  34. package/{onboarding-presets.js → character-presets.js} +53 -58
  35. package/character-presets.js.map +1 -0
  36. package/{onboarding-presets.shared.d.ts → character-presets.shared.d.ts} +1 -1
  37. package/character-presets.shared.d.ts.map +1 -0
  38. package/{onboarding-presets.shared.js → character-presets.shared.js} +1 -1
  39. package/character-presets.shared.js.map +1 -0
  40. package/checkout/index.d.ts +48 -0
  41. package/checkout/index.d.ts.map +1 -0
  42. package/checkout/index.js +59 -0
  43. package/checkout/index.js.map +1 -0
  44. package/cli/parse-duration.d.ts +5 -0
  45. package/cli/parse-duration.d.ts.map +1 -0
  46. package/cli/parse-duration.js +26 -0
  47. package/cli/parse-duration.js.map +1 -0
  48. package/config/allowed-hosts.d.ts +8 -0
  49. package/config/allowed-hosts.d.ts.map +1 -0
  50. package/config/allowed-hosts.js +44 -0
  51. package/config/allowed-hosts.js.map +1 -0
  52. package/config/api-key-prefix-hints.d.ts +24 -0
  53. package/config/api-key-prefix-hints.d.ts.map +1 -0
  54. package/config/api-key-prefix-hints.js +26 -0
  55. package/config/api-key-prefix-hints.js.map +1 -0
  56. package/config/app-config.d.ts +274 -0
  57. package/config/app-config.d.ts.map +1 -0
  58. package/config/app-config.js +64 -0
  59. package/config/app-config.js.map +1 -0
  60. package/config/app-manifest.d.ts +75 -0
  61. package/config/app-manifest.d.ts.map +1 -0
  62. package/config/app-manifest.js +115 -0
  63. package/config/app-manifest.js.map +1 -0
  64. package/config/boot-config-store.d.ts +74 -0
  65. package/config/boot-config-store.d.ts.map +1 -0
  66. package/config/boot-config-store.js +121 -0
  67. package/config/boot-config-store.js.map +1 -0
  68. package/config/boot-config.d.ts +6 -0
  69. package/config/boot-config.d.ts.map +1 -0
  70. package/config/boot-config.js +6 -0
  71. package/config/boot-config.js.map +1 -0
  72. package/config/branding.d.ts +53 -0
  73. package/config/branding.d.ts.map +1 -0
  74. package/config/branding.js +23 -0
  75. package/config/branding.js.map +1 -0
  76. package/config/cloud-only.d.ts +8 -0
  77. package/config/cloud-only.d.ts.map +1 -0
  78. package/config/cloud-only.js +26 -0
  79. package/config/cloud-only.js.map +1 -0
  80. package/config/config-catalog.d.ts +371 -0
  81. package/config/config-catalog.d.ts.map +1 -0
  82. package/config/config-catalog.js +719 -0
  83. package/config/config-catalog.js.map +1 -0
  84. package/config/config-paths.d.ts +11 -0
  85. package/config/config-paths.d.ts.map +1 -0
  86. package/config/config-paths.js +74 -0
  87. package/config/config-paths.js.map +1 -0
  88. package/config/config.d.ts +11 -0
  89. package/config/config.d.ts.map +1 -0
  90. package/config/config.js +23 -0
  91. package/config/config.js.map +1 -0
  92. package/config/distribution-profile.d.ts +16 -0
  93. package/config/distribution-profile.d.ts.map +1 -0
  94. package/config/distribution-profile.js +29 -0
  95. package/config/distribution-profile.js.map +1 -0
  96. package/config/env-vars.d.ts +2 -0
  97. package/config/env-vars.d.ts.map +1 -0
  98. package/config/env-vars.js +2 -0
  99. package/config/env-vars.js.map +1 -0
  100. package/config/index.d.ts +12 -0
  101. package/config/index.d.ts.map +1 -0
  102. package/config/index.js +15 -0
  103. package/config/index.js.map +1 -0
  104. package/config/plugin-auto-enable-engine.d.ts +4 -0
  105. package/config/plugin-auto-enable-engine.d.ts.map +1 -0
  106. package/config/plugin-auto-enable-engine.js +45 -0
  107. package/config/plugin-auto-enable-engine.js.map +1 -0
  108. package/config/plugin-auto-enable.d.ts +2 -0
  109. package/config/plugin-auto-enable.d.ts.map +1 -0
  110. package/config/plugin-auto-enable.js +8 -0
  111. package/config/plugin-auto-enable.js.map +1 -0
  112. package/config/plugin-manifest.d.ts +89 -0
  113. package/config/plugin-manifest.d.ts.map +1 -0
  114. package/config/plugin-manifest.js +281 -0
  115. package/config/plugin-manifest.js.map +1 -0
  116. package/config/plugin-ui-spec.d.ts +42 -0
  117. package/config/plugin-ui-spec.d.ts.map +1 -0
  118. package/config/plugin-ui-spec.js +257 -0
  119. package/config/plugin-ui-spec.js.map +1 -0
  120. package/config/runtime-mode.d.ts +54 -0
  121. package/config/runtime-mode.d.ts.map +1 -0
  122. package/config/runtime-mode.js +107 -0
  123. package/config/runtime-mode.js.map +1 -0
  124. package/config/runtime-overrides.d.ts +16 -0
  125. package/config/runtime-overrides.d.ts.map +1 -0
  126. package/config/runtime-overrides.js +49 -0
  127. package/config/runtime-overrides.js.map +1 -0
  128. package/config/schema.d.ts +7 -0
  129. package/config/schema.d.ts.map +1 -0
  130. package/config/schema.js +30 -0
  131. package/config/schema.js.map +1 -0
  132. package/config/types.agent-defaults.d.ts +6 -1
  133. package/config/types.agent-defaults.d.ts.map +1 -1
  134. package/config/types.agents.d.ts +9 -4
  135. package/config/types.agents.d.ts.map +1 -1
  136. package/config/types.eliza.d.ts +27 -49
  137. package/config/types.eliza.d.ts.map +1 -1
  138. package/config/types.messages.d.ts +2 -2
  139. package/config/types.messages.d.ts.map +1 -1
  140. package/config/types.tools.d.ts +2 -2
  141. package/config/types.tools.d.ts.map +1 -1
  142. package/config/ui-spec.d.ts +164 -0
  143. package/config/ui-spec.d.ts.map +1 -0
  144. package/config/ui-spec.js +14 -0
  145. package/config/ui-spec.js.map +1 -0
  146. package/config/wechat-config.d.ts +2 -0
  147. package/config/wechat-config.d.ts.map +1 -0
  148. package/config/wechat-config.js +2 -0
  149. package/config/wechat-config.js.map +1 -0
  150. package/config/zod-schema.agent-runtime.d.ts +1087 -0
  151. package/config/zod-schema.agent-runtime.d.ts.map +1 -0
  152. package/config/zod-schema.agent-runtime.js +764 -0
  153. package/config/zod-schema.agent-runtime.js.map +1 -0
  154. package/config/zod-schema.core.d.ts +1048 -0
  155. package/config/zod-schema.core.d.ts.map +1 -0
  156. package/config/zod-schema.core.js +707 -0
  157. package/config/zod-schema.core.js.map +1 -0
  158. package/connector-cred-types.d.ts +3 -3
  159. package/connector-cred-types.js +4 -4
  160. package/connectors.d.ts +0 -8
  161. package/connectors.d.ts.map +1 -1
  162. package/connectors.js +26 -50
  163. package/connectors.js.map +1 -1
  164. package/contracts/agent-routes.d.ts +63 -0
  165. package/contracts/agent-routes.d.ts.map +1 -0
  166. package/contracts/agent-routes.js +55 -0
  167. package/contracts/agent-routes.js.map +1 -0
  168. package/contracts/app-permissions-routes.d.ts +148 -0
  169. package/contracts/app-permissions-routes.d.ts.map +1 -0
  170. package/contracts/app-permissions-routes.js +96 -0
  171. package/contracts/app-permissions-routes.js.map +1 -0
  172. package/contracts/app-permissions.d.ts +122 -0
  173. package/contracts/app-permissions.d.ts.map +1 -0
  174. package/contracts/app-permissions.js +163 -0
  175. package/contracts/app-permissions.js.map +1 -0
  176. package/contracts/apps-favorites-routes.d.ts +44 -0
  177. package/contracts/apps-favorites-routes.d.ts.map +1 -0
  178. package/contracts/apps-favorites-routes.js +48 -0
  179. package/contracts/apps-favorites-routes.js.map +1 -0
  180. package/contracts/apps-lifecycle-routes.d.ts +185 -0
  181. package/contracts/apps-lifecycle-routes.d.ts.map +1 -0
  182. package/contracts/apps-lifecycle-routes.js +204 -0
  183. package/contracts/apps-lifecycle-routes.js.map +1 -0
  184. package/contracts/apps-loading-routes.d.ts +64 -0
  185. package/contracts/apps-loading-routes.d.ts.map +1 -0
  186. package/contracts/apps-loading-routes.js +65 -0
  187. package/contracts/apps-loading-routes.js.map +1 -0
  188. package/contracts/apps-runs-routes.d.ts +33 -0
  189. package/contracts/apps-runs-routes.d.ts.map +1 -0
  190. package/contracts/apps-runs-routes.js +38 -0
  191. package/contracts/apps-runs-routes.js.map +1 -0
  192. package/contracts/apps.d.ts +883 -3
  193. package/contracts/apps.d.ts.map +1 -1
  194. package/contracts/apps.js +278 -40
  195. package/contracts/apps.js.map +1 -1
  196. package/contracts/auth-routes.d.ts +23 -0
  197. package/contracts/auth-routes.d.ts.map +1 -0
  198. package/contracts/auth-routes.js +25 -0
  199. package/contracts/auth-routes.js.map +1 -0
  200. package/contracts/awareness.d.ts +1 -1
  201. package/contracts/calendar.d.ts +181 -0
  202. package/contracts/calendar.d.ts.map +1 -0
  203. package/contracts/calendar.js +19 -0
  204. package/contracts/calendar.js.map +1 -0
  205. package/contracts/character-routes.d.ts +70 -0
  206. package/contracts/character-routes.d.ts.map +1 -0
  207. package/contracts/character-routes.js +49 -0
  208. package/contracts/character-routes.js.map +1 -0
  209. package/contracts/cloud-coding-containers.d.ts +432 -0
  210. package/contracts/cloud-coding-containers.d.ts.map +1 -0
  211. package/contracts/cloud-coding-containers.js +135 -0
  212. package/contracts/cloud-coding-containers.js.map +1 -0
  213. package/contracts/cloud-topology.js +7 -7
  214. package/contracts/cloud-topology.js.map +1 -1
  215. package/contracts/config.d.ts +52 -4
  216. package/contracts/config.d.ts.map +1 -1
  217. package/contracts/connector-routes.d.ts +39 -0
  218. package/contracts/connector-routes.d.ts.map +1 -0
  219. package/contracts/connector-routes.js +50 -0
  220. package/contracts/connector-routes.js.map +1 -0
  221. package/contracts/content-pack.d.ts +2 -2
  222. package/contracts/content-pack.d.ts.map +1 -1
  223. package/contracts/content-pack.js +1 -1
  224. package/contracts/conversation-routes.d.ts +195 -0
  225. package/contracts/conversation-routes.d.ts.map +1 -0
  226. package/contracts/conversation-routes.js +107 -0
  227. package/contracts/conversation-routes.js.map +1 -0
  228. package/contracts/diagnostics-routes.d.ts +33 -0
  229. package/contracts/diagnostics-routes.d.ts.map +1 -0
  230. package/contracts/diagnostics-routes.js +26 -0
  231. package/contracts/diagnostics-routes.js.map +1 -0
  232. package/contracts/feature-result.d.ts +24 -0
  233. package/contracts/feature-result.d.ts.map +1 -0
  234. package/contracts/feature-result.js +7 -0
  235. package/contracts/feature-result.js.map +1 -0
  236. package/contracts/{onboarding.d.ts → first-run-options.d.ts} +172 -69
  237. package/contracts/first-run-options.d.ts.map +1 -0
  238. package/contracts/{onboarding.js → first-run-options.js} +222 -91
  239. package/contracts/first-run-options.js.map +1 -0
  240. package/contracts/first-run-routes.d.ts +167 -0
  241. package/contracts/first-run-routes.d.ts.map +1 -0
  242. package/contracts/first-run-routes.js +115 -0
  243. package/contracts/first-run-routes.js.map +1 -0
  244. package/contracts/health.d.ts +30 -0
  245. package/contracts/health.d.ts.map +1 -0
  246. package/contracts/health.js +29 -0
  247. package/contracts/health.js.map +1 -0
  248. package/contracts/inbox-routes.d.ts +37 -0
  249. package/contracts/inbox-routes.d.ts.map +1 -0
  250. package/contracts/inbox-routes.js +44 -0
  251. package/contracts/inbox-routes.js.map +1 -0
  252. package/contracts/index.d.ts +30 -3
  253. package/contracts/index.d.ts.map +1 -1
  254. package/contracts/index.js +30 -3
  255. package/contracts/index.js.map +1 -1
  256. package/contracts/memory-routes.d.ts +27 -0
  257. package/contracts/memory-routes.d.ts.map +1 -0
  258. package/contracts/memory-routes.js +23 -0
  259. package/contracts/memory-routes.js.map +1 -0
  260. package/contracts/misc-routes.d.ts +192 -0
  261. package/contracts/misc-routes.d.ts.map +1 -0
  262. package/contracts/misc-routes.js +155 -0
  263. package/contracts/misc-routes.js.map +1 -0
  264. package/contracts/permissions-routes.d.ts +31 -0
  265. package/contracts/permissions-routes.d.ts.map +1 -0
  266. package/contracts/permissions-routes.js +34 -0
  267. package/contracts/permissions-routes.js.map +1 -0
  268. package/contracts/permissions.d.ts +81 -11
  269. package/contracts/permissions.d.ts.map +1 -1
  270. package/contracts/permissions.js +37 -1
  271. package/contracts/permissions.js.map +1 -1
  272. package/contracts/{lifeops.d.ts → personal-assistant.d.ts} +368 -170
  273. package/contracts/personal-assistant.d.ts.map +1 -0
  274. package/contracts/{lifeops.js → personal-assistant.js} +39 -13
  275. package/contracts/personal-assistant.js.map +1 -0
  276. package/contracts/plugin-routes.d.ts +105 -0
  277. package/contracts/plugin-routes.d.ts.map +1 -0
  278. package/contracts/plugin-routes.js +81 -0
  279. package/contracts/plugin-routes.js.map +1 -0
  280. package/contracts/relationships-routes.d.ts +23 -0
  281. package/contracts/relationships-routes.d.ts.map +1 -0
  282. package/contracts/relationships-routes.js +22 -0
  283. package/contracts/relationships-routes.js.map +1 -0
  284. package/contracts/service-routing.d.ts +7 -121
  285. package/contracts/service-routing.d.ts.map +1 -1
  286. package/contracts/service-routing.js +19 -12
  287. package/contracts/service-routing.js.map +1 -1
  288. package/contracts/skills-routes.d.ts +116 -0
  289. package/contracts/skills-routes.d.ts.map +1 -0
  290. package/contracts/skills-routes.js +115 -0
  291. package/contracts/skills-routes.js.map +1 -0
  292. package/contracts/subscription-routes.d.ts +47 -0
  293. package/contracts/subscription-routes.d.ts.map +1 -0
  294. package/contracts/subscription-routes.js +50 -0
  295. package/contracts/subscription-routes.js.map +1 -0
  296. package/contracts/tail-routes.d.ts +78 -0
  297. package/contracts/tail-routes.d.ts.map +1 -0
  298. package/contracts/tail-routes.js +63 -0
  299. package/contracts/tail-routes.js.map +1 -0
  300. package/contracts/theme.d.ts +0 -2
  301. package/contracts/theme.d.ts.map +1 -1
  302. package/contracts/theme.js +0 -2
  303. package/contracts/theme.js.map +1 -1
  304. package/contracts/update-status.d.ts +100 -0
  305. package/contracts/update-status.d.ts.map +1 -0
  306. package/contracts/update-status.js +45 -0
  307. package/contracts/update-status.js.map +1 -0
  308. package/contracts/wallet-routes.d.ts +82 -0
  309. package/contracts/wallet-routes.d.ts.map +1 -0
  310. package/contracts/wallet-routes.js +49 -0
  311. package/contracts/wallet-routes.js.map +1 -0
  312. package/contracts/wallet.d.ts +12 -570
  313. package/contracts/wallet.d.ts.map +1 -1
  314. package/contracts/wallet.js +139 -0
  315. package/contracts/wallet.js.map +1 -1
  316. package/contracts/workbench-routes.d.ts +231 -0
  317. package/contracts/workbench-routes.d.ts.map +1 -0
  318. package/contracts/workbench-routes.js +183 -0
  319. package/contracts/workbench-routes.js.map +1 -0
  320. package/db/drizzle-database.d.ts +13 -0
  321. package/db/drizzle-database.d.ts.map +1 -0
  322. package/db/drizzle-database.js +2 -0
  323. package/db/drizzle-database.js.map +1 -0
  324. package/dev-settings-banner-style.d.ts +1 -1
  325. package/dev-settings-banner-style.js +2 -2
  326. package/dev-settings-banner-style.js.map +1 -1
  327. package/dev-settings-figlet-heading.d.ts.map +1 -1
  328. package/dev-settings-figlet-heading.js +1 -8
  329. package/dev-settings-figlet-heading.js.map +1 -1
  330. package/elizacloud/base-url.d.ts +6 -0
  331. package/elizacloud/base-url.d.ts.map +1 -0
  332. package/elizacloud/base-url.js +65 -0
  333. package/elizacloud/base-url.js.map +1 -0
  334. package/elizacloud/cloud-provisioning.d.ts +9 -0
  335. package/elizacloud/cloud-provisioning.d.ts.map +1 -0
  336. package/elizacloud/cloud-provisioning.js +25 -0
  337. package/elizacloud/cloud-provisioning.js.map +1 -0
  338. package/elizacloud/cloud-secrets.d.ts +23 -0
  339. package/elizacloud/cloud-secrets.d.ts.map +1 -0
  340. package/elizacloud/cloud-secrets.js +51 -0
  341. package/elizacloud/cloud-secrets.js.map +1 -0
  342. package/elizacloud/index.d.ts +6 -0
  343. package/elizacloud/index.d.ts.map +1 -0
  344. package/elizacloud/index.js +6 -0
  345. package/elizacloud/index.js.map +1 -0
  346. package/elizacloud/is-cloud-reachable.d.ts +19 -0
  347. package/elizacloud/is-cloud-reachable.d.ts.map +1 -0
  348. package/elizacloud/is-cloud-reachable.js +44 -0
  349. package/elizacloud/is-cloud-reachable.js.map +1 -0
  350. package/elizacloud/server-cloud-tts.d.ts +21 -0
  351. package/elizacloud/server-cloud-tts.d.ts.map +1 -0
  352. package/elizacloud/server-cloud-tts.js +293 -0
  353. package/elizacloud/server-cloud-tts.js.map +1 -0
  354. package/email-classification/email-classifier.d.ts +57 -0
  355. package/email-classification/email-classifier.d.ts.map +1 -0
  356. package/email-classification/email-classifier.js +348 -0
  357. package/email-classification/email-classifier.js.map +1 -0
  358. package/email-classification/index.d.ts +12 -0
  359. package/email-classification/index.d.ts.map +1 -0
  360. package/email-classification/index.js +12 -0
  361. package/email-classification/index.js.map +1 -0
  362. package/email-classification/wrap-untrusted-email-content.d.ts +15 -0
  363. package/email-classification/wrap-untrusted-email-content.d.ts.map +1 -0
  364. package/email-classification/wrap-untrusted-email-content.js +24 -0
  365. package/email-classification/wrap-untrusted-email-content.js.map +1 -0
  366. package/env-utils.d.ts +1 -4
  367. package/env-utils.d.ts.map +1 -1
  368. package/env-utils.js +9 -1
  369. package/env-utils.js.map +1 -1
  370. package/events/index.d.ts +68 -0
  371. package/events/index.d.ts.map +1 -0
  372. package/events/index.js +53 -0
  373. package/events/index.js.map +1 -0
  374. package/hardware-catalog/index.d.ts +204 -0
  375. package/hardware-catalog/index.d.ts.map +1 -0
  376. package/hardware-catalog/index.js +174 -0
  377. package/hardware-catalog/index.js.map +1 -0
  378. package/i18n/generated/validation-keyword-data.d.ts +2711 -748
  379. package/i18n/generated/validation-keyword-data.d.ts.map +1 -1
  380. package/i18n/generated/validation-keyword-data.js +2711 -748
  381. package/i18n/generated/validation-keyword-data.js.map +1 -1
  382. package/i18n/keyword-matching.d.ts.map +1 -1
  383. package/i18n/keyword-matching.js +4 -1
  384. package/i18n/keyword-matching.js.map +1 -1
  385. package/index.d.ts +82 -7
  386. package/index.d.ts.map +1 -1
  387. package/index.js +109 -13
  388. package/index.js.map +1 -1
  389. package/knowledge-graph/entity-types.d.ts +135 -0
  390. package/knowledge-graph/entity-types.d.ts.map +1 -0
  391. package/knowledge-graph/entity-types.js +75 -0
  392. package/knowledge-graph/entity-types.js.map +1 -0
  393. package/knowledge-graph/index.d.ts +13 -0
  394. package/knowledge-graph/index.d.ts.map +1 -0
  395. package/knowledge-graph/index.js +13 -0
  396. package/knowledge-graph/index.js.map +1 -0
  397. package/knowledge-graph/merge.d.ts +76 -0
  398. package/knowledge-graph/merge.d.ts.map +1 -0
  399. package/knowledge-graph/merge.js +175 -0
  400. package/knowledge-graph/merge.js.map +1 -0
  401. package/knowledge-graph/relationship-types.d.ts +105 -0
  402. package/knowledge-graph/relationship-types.d.ts.map +1 -0
  403. package/knowledge-graph/relationship-types.js +114 -0
  404. package/knowledge-graph/relationship-types.js.map +1 -0
  405. package/lifeops-constants/index.d.ts +9 -0
  406. package/lifeops-constants/index.d.ts.map +1 -0
  407. package/lifeops-constants/index.js +9 -0
  408. package/lifeops-constants/index.js.map +1 -0
  409. package/lifeops-constants/service-constants.d.ts +79 -0
  410. package/lifeops-constants/service-constants.d.ts.map +1 -0
  411. package/lifeops-constants/service-constants.js +123 -0
  412. package/lifeops-constants/service-constants.js.map +1 -0
  413. package/lifeops-normalize/index.d.ts +12 -0
  414. package/lifeops-normalize/index.d.ts.map +1 -0
  415. package/lifeops-normalize/index.js +12 -0
  416. package/lifeops-normalize/index.js.map +1 -0
  417. package/lifeops-normalize/service-error.d.ts +14 -0
  418. package/lifeops-normalize/service-error.d.ts.map +1 -0
  419. package/lifeops-normalize/service-error.js +19 -0
  420. package/lifeops-normalize/service-error.js.map +1 -0
  421. package/lifeops-normalize/service-normalize.d.ts +38 -0
  422. package/lifeops-normalize/service-normalize.d.ts.map +1 -0
  423. package/lifeops-normalize/service-normalize.js +205 -0
  424. package/lifeops-normalize/service-normalize.js.map +1 -0
  425. package/lifeops-normalize/time-zone.d.ts +12 -0
  426. package/lifeops-normalize/time-zone.d.ts.map +1 -0
  427. package/lifeops-normalize/time-zone.js +29 -0
  428. package/lifeops-normalize/time-zone.js.map +1 -0
  429. package/local-inference/catalog.d.ts +97 -0
  430. package/local-inference/catalog.d.ts.map +1 -0
  431. package/local-inference/catalog.js +547 -0
  432. package/local-inference/catalog.js.map +1 -0
  433. package/local-inference/gpu-profiles.d.ts +110 -0
  434. package/local-inference/gpu-profiles.d.ts.map +1 -0
  435. package/local-inference/gpu-profiles.js +214 -0
  436. package/local-inference/gpu-profiles.js.map +1 -0
  437. package/local-inference/index.d.ts +21 -0
  438. package/local-inference/index.d.ts.map +1 -0
  439. package/local-inference/index.js +18 -0
  440. package/local-inference/index.js.map +1 -0
  441. package/local-inference/manifest-signature.d.ts +61 -0
  442. package/local-inference/manifest-signature.d.ts.map +1 -0
  443. package/local-inference/manifest-signature.js +129 -0
  444. package/local-inference/manifest-signature.js.map +1 -0
  445. package/local-inference/network-policy.d.ts +115 -0
  446. package/local-inference/network-policy.d.ts.map +1 -0
  447. package/local-inference/network-policy.js +154 -0
  448. package/local-inference/network-policy.js.map +1 -0
  449. package/local-inference/paths.d.ts +24 -0
  450. package/local-inference/paths.d.ts.map +1 -0
  451. package/local-inference/paths.js +40 -0
  452. package/local-inference/paths.js.map +1 -0
  453. package/local-inference/providers-types.d.ts +56 -0
  454. package/local-inference/providers-types.d.ts.map +1 -0
  455. package/local-inference/providers-types.js +19 -0
  456. package/local-inference/providers-types.js.map +1 -0
  457. package/local-inference/routing-preferences.d.ts +31 -0
  458. package/local-inference/routing-preferences.d.ts.map +1 -0
  459. package/local-inference/routing-preferences.js +73 -0
  460. package/local-inference/routing-preferences.js.map +1 -0
  461. package/local-inference/throughput.d.ts +74 -0
  462. package/local-inference/throughput.d.ts.map +1 -0
  463. package/local-inference/throughput.js +84 -0
  464. package/local-inference/throughput.js.map +1 -0
  465. package/local-inference/types.d.ts +510 -0
  466. package/local-inference/types.d.ts.map +1 -0
  467. package/local-inference/types.js +22 -0
  468. package/local-inference/types.js.map +1 -0
  469. package/local-inference/verify.d.ts +39 -0
  470. package/local-inference/verify.d.ts.map +1 -0
  471. package/local-inference/verify.js +105 -0
  472. package/local-inference/verify.js.map +1 -0
  473. package/local-inference/voice-models.d.ts +156 -0
  474. package/local-inference/voice-models.d.ts.map +1 -0
  475. package/local-inference/voice-models.js +746 -0
  476. package/local-inference/voice-models.js.map +1 -0
  477. package/local-inference-gpu/gpu-overrides.d.ts +97 -0
  478. package/local-inference-gpu/gpu-overrides.d.ts.map +1 -0
  479. package/local-inference-gpu/gpu-overrides.js +76 -0
  480. package/local-inference-gpu/gpu-overrides.js.map +1 -0
  481. package/local-inference-gpu/gpu-profile-loader.d.ts +83 -0
  482. package/local-inference-gpu/gpu-profile-loader.d.ts.map +1 -0
  483. package/local-inference-gpu/gpu-profile-loader.js +196 -0
  484. package/local-inference-gpu/gpu-profile-loader.js.map +1 -0
  485. package/local-inference-gpu/gpu-profile-schema.d.ts +208 -0
  486. package/local-inference-gpu/gpu-profile-schema.d.ts.map +1 -0
  487. package/local-inference-gpu/gpu-profile-schema.js +123 -0
  488. package/local-inference-gpu/gpu-profile-schema.js.map +1 -0
  489. package/local-inference-gpu/gpu-tier-detect.d.ts +61 -0
  490. package/local-inference-gpu/gpu-tier-detect.d.ts.map +1 -0
  491. package/local-inference-gpu/gpu-tier-detect.js +93 -0
  492. package/local-inference-gpu/gpu-tier-detect.js.map +1 -0
  493. package/local-inference-gpu/gpu-tier-profiles.d.ts +110 -0
  494. package/local-inference-gpu/gpu-tier-profiles.d.ts.map +1 -0
  495. package/local-inference-gpu/gpu-tier-profiles.js +235 -0
  496. package/local-inference-gpu/gpu-tier-profiles.js.map +1 -0
  497. package/package.json +111 -160
  498. package/platform/is-native-server.d.ts +9 -0
  499. package/platform/is-native-server.d.ts.map +1 -0
  500. package/platform/is-native-server.js +12 -0
  501. package/platform/is-native-server.js.map +1 -0
  502. package/restart.d.ts +2 -1
  503. package/restart.d.ts.map +1 -1
  504. package/restart.js +3 -2
  505. package/restart.js.map +1 -1
  506. package/runtime-env.d.ts +2 -2
  507. package/runtime-env.d.ts.map +1 -1
  508. package/runtime-env.js +15 -7
  509. package/runtime-env.js.map +1 -1
  510. package/self-edit.d.ts +4 -4
  511. package/self-edit.d.ts.map +1 -1
  512. package/self-edit.js +5 -5
  513. package/self-edit.js.map +1 -1
  514. package/settings-debug.d.ts.map +1 -1
  515. package/settings-debug.js +45 -38
  516. package/settings-debug.js.map +1 -1
  517. package/spoken-text.d.ts.map +1 -1
  518. package/spoken-text.js +3 -2
  519. package/spoken-text.js.map +1 -1
  520. package/steward-session-client/index.d.ts +172 -0
  521. package/steward-session-client/index.d.ts.map +1 -0
  522. package/steward-session-client/index.js +248 -0
  523. package/steward-session-client/index.js.map +1 -0
  524. package/steward-session-client/steward-oauth-pkce.d.ts +24 -0
  525. package/steward-session-client/steward-oauth-pkce.d.ts.map +1 -0
  526. package/steward-session-client/steward-oauth-pkce.js +105 -0
  527. package/steward-session-client/steward-oauth-pkce.js.map +1 -0
  528. package/terminal/links.d.ts +9 -0
  529. package/terminal/links.d.ts.map +1 -0
  530. package/terminal/links.js +21 -0
  531. package/terminal/links.js.map +1 -0
  532. package/terminal/palette.d.ts +11 -0
  533. package/terminal/palette.d.ts.map +1 -0
  534. package/terminal/palette.js +13 -0
  535. package/terminal/palette.js.map +1 -0
  536. package/terminal/theme.d.ts +17 -0
  537. package/terminal/theme.d.ts.map +1 -0
  538. package/terminal/theme.js +25 -0
  539. package/terminal/theme.js.map +1 -0
  540. package/test-support/process-helpers.d.ts +13 -0
  541. package/test-support/process-helpers.d.ts.map +1 -0
  542. package/test-support/process-helpers.js +24 -0
  543. package/test-support/process-helpers.js.map +1 -0
  544. package/test-support/test-helpers.d.ts +79 -0
  545. package/test-support/test-helpers.d.ts.map +1 -0
  546. package/test-support/test-helpers.js +341 -0
  547. package/test-support/test-helpers.js.map +1 -0
  548. package/transcripts.d.ts +111 -0
  549. package/transcripts.d.ts.map +1 -0
  550. package/transcripts.js +106 -0
  551. package/transcripts.js.map +1 -0
  552. package/type-guards.d.ts +1 -23
  553. package/type-guards.d.ts.map +1 -1
  554. package/type-guards.js +6 -23
  555. package/type-guards.js.map +1 -1
  556. package/types/index.d.ts +654 -0
  557. package/types/index.d.ts.map +1 -0
  558. package/types/index.js +5 -0
  559. package/types/index.js.map +1 -0
  560. package/utils/asset-url.d.ts +24 -0
  561. package/utils/asset-url.d.ts.map +1 -0
  562. package/utils/asset-url.js +151 -0
  563. package/utils/asset-url.js.map +1 -0
  564. package/utils/assistant-text.d.ts +13 -0
  565. package/utils/assistant-text.d.ts.map +1 -0
  566. package/utils/assistant-text.js +292 -0
  567. package/utils/assistant-text.js.map +1 -0
  568. package/utils/browser-tab-kit-types.d.ts +81 -0
  569. package/utils/browser-tab-kit-types.d.ts.map +1 -0
  570. package/utils/browser-tab-kit-types.js +23 -0
  571. package/utils/browser-tab-kit-types.js.map +1 -0
  572. package/utils/browser-tabs-renderer-registry.d.ts +56 -0
  573. package/utils/browser-tabs-renderer-registry.d.ts.map +1 -0
  574. package/utils/browser-tabs-renderer-registry.js +1282 -0
  575. package/utils/browser-tabs-renderer-registry.js.map +1 -0
  576. package/utils/character-message-examples.d.ts +7 -0
  577. package/utils/character-message-examples.d.ts.map +1 -0
  578. package/utils/character-message-examples.js +123 -0
  579. package/utils/character-message-examples.js.map +1 -0
  580. package/utils/cloud-status.d.ts +3 -0
  581. package/utils/cloud-status.d.ts.map +1 -0
  582. package/utils/cloud-status.js +11 -0
  583. package/utils/cloud-status.js.map +1 -0
  584. package/utils/documents-upload-image.d.ts +27 -0
  585. package/utils/documents-upload-image.d.ts.map +1 -0
  586. package/utils/documents-upload-image.js +147 -0
  587. package/utils/documents-upload-image.js.map +1 -0
  588. package/utils/eliza-cloud-model-route.d.ts +3 -0
  589. package/utils/eliza-cloud-model-route.d.ts.map +1 -0
  590. package/utils/eliza-cloud-model-route.js +10 -0
  591. package/utils/eliza-cloud-model-route.js.map +1 -0
  592. package/utils/eliza-globals.d.ts +13 -0
  593. package/utils/eliza-globals.d.ts.map +1 -0
  594. package/utils/eliza-globals.js +49 -0
  595. package/utils/eliza-globals.js.map +1 -0
  596. package/utils/eliza-root.d.ts +9 -0
  597. package/utils/eliza-root.d.ts.map +1 -0
  598. package/utils/eliza-root.js +102 -0
  599. package/utils/eliza-root.js.map +1 -0
  600. package/utils/env.d.ts +34 -0
  601. package/utils/env.d.ts.map +1 -0
  602. package/utils/env.js +142 -0
  603. package/utils/env.js.map +1 -0
  604. package/utils/errors.d.ts +13 -0
  605. package/utils/errors.d.ts.map +1 -0
  606. package/utils/errors.js +26 -0
  607. package/utils/errors.js.map +1 -0
  608. package/utils/exec-safety.d.ts +2 -0
  609. package/utils/exec-safety.d.ts.map +1 -0
  610. package/utils/exec-safety.js +25 -0
  611. package/utils/exec-safety.js.map +1 -0
  612. package/utils/format.d.ts +85 -0
  613. package/utils/format.d.ts.map +1 -0
  614. package/utils/format.js +140 -0
  615. package/utils/format.js.map +1 -0
  616. package/utils/labels.d.ts +6 -0
  617. package/utils/labels.d.ts.map +1 -0
  618. package/utils/labels.js +42 -0
  619. package/utils/labels.js.map +1 -0
  620. package/utils/log-prefix.d.ts +2 -0
  621. package/utils/log-prefix.d.ts.map +1 -0
  622. package/utils/log-prefix.js +44 -0
  623. package/utils/log-prefix.js.map +1 -0
  624. package/utils/name-tokens.d.ts +24 -0
  625. package/utils/name-tokens.d.ts.map +1 -0
  626. package/utils/name-tokens.js +37 -0
  627. package/utils/name-tokens.js.map +1 -0
  628. package/utils/namespace-defaults.d.ts +10 -0
  629. package/utils/namespace-defaults.d.ts.map +1 -0
  630. package/utils/namespace-defaults.js +17 -0
  631. package/utils/namespace-defaults.js.map +1 -0
  632. package/utils/number-parsing.d.ts +26 -0
  633. package/utils/number-parsing.d.ts.map +1 -0
  634. package/utils/number-parsing.js +57 -0
  635. package/utils/number-parsing.js.map +1 -0
  636. package/utils/owner-name.d.ts +3 -0
  637. package/utils/owner-name.d.ts.map +1 -0
  638. package/utils/owner-name.js +8 -0
  639. package/utils/owner-name.js.map +1 -0
  640. package/utils/permission-deep-links.d.ts +35 -0
  641. package/utils/permission-deep-links.d.ts.map +1 -0
  642. package/utils/permission-deep-links.js +95 -0
  643. package/utils/permission-deep-links.js.map +1 -0
  644. package/utils/rate-limiter.d.ts +32 -0
  645. package/utils/rate-limiter.d.ts.map +1 -0
  646. package/utils/rate-limiter.js +53 -0
  647. package/utils/rate-limiter.js.map +1 -0
  648. package/utils/serialise.d.ts +12 -0
  649. package/utils/serialise.d.ts.map +1 -0
  650. package/utils/serialise.js +22 -0
  651. package/utils/serialise.js.map +1 -0
  652. package/utils/sql-compat.d.ts +10 -0
  653. package/utils/sql-compat.d.ts.map +1 -0
  654. package/utils/sql-compat.js +112 -0
  655. package/utils/sql-compat.js.map +1 -0
  656. package/utils/streaming-text.d.ts +9 -0
  657. package/utils/streaming-text.d.ts.map +1 -0
  658. package/utils/streaming-text.js +116 -0
  659. package/utils/streaming-text.js.map +1 -0
  660. package/utils/subscription-auth.d.ts +9 -0
  661. package/utils/subscription-auth.d.ts.map +1 -0
  662. package/utils/subscription-auth.js +49 -0
  663. package/utils/subscription-auth.js.map +1 -0
  664. package/utils/trajectory-format.d.ts +6 -0
  665. package/utils/trajectory-format.d.ts.map +1 -0
  666. package/utils/trajectory-format.js +44 -0
  667. package/utils/trajectory-format.js.map +1 -0
  668. package/utils/tts-debug.d.ts +10 -0
  669. package/utils/tts-debug.d.ts.map +1 -0
  670. package/utils/tts-debug.js +73 -0
  671. package/utils/tts-debug.js.map +1 -0
  672. package/view-hero-art.d.ts +75 -0
  673. package/view-hero-art.d.ts.map +1 -0
  674. package/view-hero-art.js +360 -0
  675. package/view-hero-art.js.map +1 -0
  676. package/voice/first-sentence-snip.d.ts +68 -0
  677. package/voice/first-sentence-snip.d.ts.map +1 -0
  678. package/voice/first-sentence-snip.js +284 -0
  679. package/voice/first-sentence-snip.js.map +1 -0
  680. package/voice/voice-cancellation-token.d.ts +127 -0
  681. package/voice/voice-cancellation-token.d.ts.map +1 -0
  682. package/voice/voice-cancellation-token.js +186 -0
  683. package/voice/voice-cancellation-token.js.map +1 -0
  684. package/voice-wer.d.ts +19 -0
  685. package/voice-wer.d.ts.map +1 -0
  686. package/voice-wer.js +42 -0
  687. package/voice-wer.js.map +1 -0
  688. package/voice.d.ts +55 -0
  689. package/voice.d.ts.map +1 -0
  690. package/voice.js +337 -0
  691. package/voice.js.map +1 -0
  692. package/contracts/lifeops-extensions.d.ts +0 -340
  693. package/contracts/lifeops-extensions.d.ts.map +0 -1
  694. package/contracts/lifeops-extensions.js +0 -37
  695. package/contracts/lifeops-extensions.js.map +0 -1
  696. package/contracts/lifeops.d.ts.map +0 -1
  697. package/contracts/lifeops.js.map +0 -1
  698. package/contracts/onboarding.d.ts.map +0 -1
  699. package/contracts/onboarding.js.map +0 -1
  700. package/contracts/scratchpad.d.ts +0 -136
  701. package/contracts/scratchpad.d.ts.map +0 -1
  702. package/contracts/scratchpad.js +0 -91
  703. package/contracts/scratchpad.js.map +0 -1
  704. package/eliza-core-roles.d.ts +0 -79
  705. package/eliza-core-roles.d.ts.map +0 -1
  706. package/eliza-core-roles.js +0 -600
  707. package/eliza-core-roles.js.map +0 -1
  708. package/env-utils.impl.d.ts +0 -2
  709. package/env-utils.impl.d.ts.map +0 -1
  710. package/env-utils.impl.js +0 -10
  711. package/env-utils.impl.js.map +0 -1
  712. package/onboarding-presets.characters.d.ts.map +0 -1
  713. package/onboarding-presets.characters.js.map +0 -1
  714. package/onboarding-presets.d.ts.map +0 -1
  715. package/onboarding-presets.js.map +0 -1
  716. package/onboarding-presets.shared.d.ts.map +0 -1
  717. package/onboarding-presets.shared.js.map +0 -1
  718. package/themes/index.d.ts +0 -7
  719. package/themes/index.d.ts.map +0 -1
  720. package/themes/index.js +0 -6
  721. package/themes/index.js.map +0 -1
  722. package/themes/presets.d.ts +0 -15
  723. package/themes/presets.d.ts.map +0 -1
  724. package/themes/presets.js +0 -789
  725. package/themes/presets.js.map +0 -1
  726. package/types.d.ts +0 -27
  727. package/types.d.ts.map +0 -1
  728. package/types.js +0 -2
  729. package/types.js.map +0 -1
@@ -0,0 +1,79 @@
1
+ import type http from "node:http";
2
+ /** Standardized test result for mocked updater checks. */
3
+ export type MockUpdateCheckResult = {
4
+ updateAvailable: boolean;
5
+ currentVersion: string;
6
+ latestVersion: string | null;
7
+ channel: string;
8
+ distTag: string;
9
+ cached: boolean;
10
+ error: string | null;
11
+ };
12
+ /** Snapshot and restore the configured environment variables around a test. */
13
+ export declare function createEnvSandbox(keys: readonly string[]): {
14
+ clear: () => void;
15
+ restore: () => void;
16
+ };
17
+ export type PluginModuleShape = {
18
+ [key: string]: unknown;
19
+ default?: unknown;
20
+ plugin?: unknown;
21
+ };
22
+ /** Loose plugin-shape predicate used in dynamic test imports across suites. */
23
+ export declare function looksLikePlugin(value: unknown): value is {
24
+ name: string;
25
+ };
26
+ /** Extract a plugin-like object from a dynamic module export shape. */
27
+ export declare function extractPlugin(mod: PluginModuleShape): {
28
+ name: string;
29
+ } | null;
30
+ export declare function isPackageImportResolvable(packageName: string): boolean;
31
+ export declare function isWorkspaceDependency(version: string | undefined): boolean;
32
+ export declare function resolveDiscordPluginImportSpecifier(): string | null;
33
+ export declare function resolveTelegramPluginImportSpecifier(): string | null;
34
+ export declare function resolveLensPluginImportSpecifier(): string | null;
35
+ export declare function resolveFarcasterPluginImportSpecifier(): string | null;
36
+ export declare function resolveNostrPluginImportSpecifier(): string | null;
37
+ export declare function resolveMatrixPluginImportSpecifier(): string | null;
38
+ export declare function resolveFeishuPluginImportSpecifier(): string | null;
39
+ export declare function resolveWechatPluginImportSpecifier(): string | null;
40
+ /** Build a mock update check result with deterministic defaults. */
41
+ export declare function buildMockUpdateCheckResult(overrides?: Partial<MockUpdateCheckResult>): MockUpdateCheckResult;
42
+ /** Small utility to wait for asynchronous side-effects in tests. */
43
+ export declare function waitMs(ms: number): Promise<void>;
44
+ type MockResponsePayload<T> = {
45
+ res: MockHttpServerResponse;
46
+ getStatus: () => number;
47
+ getJson: () => T;
48
+ };
49
+ type MockHttpServerResponse = http.ServerResponse & {
50
+ _status: number;
51
+ _body: string;
52
+ writeHead: (statusCode: number) => void;
53
+ };
54
+ type MockBodyChunk = string | Buffer;
55
+ export type MockRequestOptions = {
56
+ method?: string;
57
+ url?: string;
58
+ headers?: Record<string, string>;
59
+ body?: unknown;
60
+ bodyChunks?: MockBodyChunk[];
61
+ json?: boolean;
62
+ };
63
+ /** Create a lightweight mocked HTTP response used by handler tests. */
64
+ export declare function createMockHttpResponse<T = unknown>(): MockResponsePayload<T>;
65
+ export declare function createMockHeadersRequest(headers?: Record<string, string>, options?: Omit<MockRequestOptions, "headers" | "body">): http.IncomingMessage & {
66
+ destroy: () => void;
67
+ };
68
+ export declare function createMockIncomingMessage({ method, url, headers, body, bodyChunks, json, }: MockRequestOptions): http.IncomingMessage & {
69
+ destroy: () => void;
70
+ };
71
+ export declare function createMockJsonRequest(body: unknown, options?: Omit<MockRequestOptions, "body" | "json">): http.IncomingMessage & {
72
+ destroy: () => void;
73
+ };
74
+ /** Return true when optional plugin imports are intentionally unavailable in this env. */
75
+ export declare function isOptionalImportError(error: unknown, extraMarkers?: readonly string[]): boolean;
76
+ /** Safely import optional plugin modules while allowing hard failures to bubble. */
77
+ export declare function tryOptionalDynamicImport<T>(moduleName: string, markers?: readonly string[]): Promise<T | null>;
78
+ export {};
79
+ //# sourceMappingURL=test-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/test-support/test-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAmBlC,0DAA0D;AAC1D,MAAM,MAAM,qBAAqB,GAAG;IAClC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE;iBAGpC,IAAI;mBAOF,IAAI;EAWzB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAMzE;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,GAAG,EAAE,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAS7E;AAED,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAK1E;AAuED,wBAAgB,mCAAmC,IAAI,MAAM,GAAG,IAAI,CAKnE;AAOD,w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O,CAAC;CAChB,CAAC;AAEF,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,OAAO,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAqC5E;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,MAAM,CAAM,GACzD,IAAI,CAAC,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAKhD;AAED,wBAAgB,yBAAyB,CAAC,EACxC,MAAc,EACd,GAAS,EACT,OAAoC,EACpC,IAAI,EACJ,UAAU,EACV,IAAY,GACb,EAAE,kBAAkB,GAAG,IAAI,CAAC,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAmCrE;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAM,GACtD,IAAI,CAAC,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAMhD;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,GACnC,OAAO,CAKT;AAED,oFAAoF;AACpF,wBAAsB,wBAAwB,CAAC,CAAC,EAC9C,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAOnB"}
@@ -0,0 +1,341 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
9
+ import { EventEmitter } from "node:events";
10
+ import { existsSync } from "node:fs";
11
+ import { ServerResponse } from "node:http";
12
+ import { createRequire } from "node:module";
13
+ import path from "node:path";
14
+ import { fileURLToPath, pathToFileURL } from "node:url";
15
+ const OPTIONAL_IMPORT_ERROR_MARKERS = [
16
+ "Cannot find module",
17
+ "Cannot find package",
18
+ "ERR_MODULE_NOT_FOUND",
19
+ "MODULE_NOT_FOUND",
20
+ "Dynamic require of",
21
+ "native addon module",
22
+ "Failed to resolve entry",
23
+ "tfjs_binding",
24
+ "NAPI_MODULE_NOT_FOUND",
25
+ "spec not found",
26
+ ];
27
+ /** Snapshot and restore the configured environment variables around a test. */
28
+ export function createEnvSandbox(keys) {
29
+ const backup = {};
30
+ function clear() {
31
+ for (const key of keys) {
32
+ backup[key] = process.env[key];
33
+ delete process.env[key];
34
+ }
35
+ }
36
+ function restore() {
37
+ for (const key of keys) {
38
+ if (backup[key] === undefined) {
39
+ delete process.env[key];
40
+ }
41
+ else {
42
+ process.env[key] = backup[key];
43
+ }
44
+ }
45
+ }
46
+ return { clear, restore };
47
+ }
48
+ /** Loose plugin-shape predicate used in dynamic test imports across suites. */
49
+ export function looksLikePlugin(value) {
50
+ return (value != null &&
51
+ typeof value === "object" &&
52
+ typeof value.name === "string");
53
+ }
54
+ /** Extract a plugin-like object from a dynamic module export shape. */
55
+ export function extractPlugin(mod) {
56
+ if (looksLikePlugin(mod.default))
57
+ return mod.default;
58
+ if (looksLikePlugin(mod.plugin))
59
+ return mod.plugin;
60
+ if (looksLikePlugin(mod))
61
+ return mod;
62
+ for (const key of Object.keys(mod)) {
63
+ if (key === "default" || key === "plugin")
64
+ continue;
65
+ if (looksLikePlugin(mod[key]))
66
+ return mod[key];
67
+ }
68
+ return null;
69
+ }
70
+ export function isPackageImportResolvable(packageName) {
71
+ const require = createRequire(import.meta.url);
72
+ try {
73
+ require.resolve(packageName);
74
+ return true;
75
+ }
76
+ catch {
77
+ return false;
78
+ }
79
+ }
80
+ export function isWorkspaceDependency(version) {
81
+ return (typeof version === "string" &&
82
+ (version.startsWith(".") || version.startsWith("workspace:")));
83
+ }
84
+ const DISCORD_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-discord";
85
+ const DISCORD_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
86
+ "../plugins/plugin-discord/dist/index",
87
+ ];
88
+ const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
89
+ function resolveFirstExistingPath(relativeEntryPaths) {
90
+ for (const relativeEntryPath of relativeEntryPaths) {
91
+ const absoluteEntryPath = path.resolve(PACKAGE_ROOT, relativeEntryPath);
92
+ if (existsSync(absoluteEntryPath)) {
93
+ return pathToFileURL(absoluteEntryPath).href;
94
+ }
95
+ }
96
+ return null;
97
+ }
98
+ function resolveNodeModulesEntry(packageName, relativeEntryPath) {
99
+ const packageSegments = packageName.split("/");
100
+ const entryPath = path.resolve(PACKAGE_ROOT, "node_modules", ...packageSegments, relativeEntryPath);
101
+ return existsSync(entryPath) ? pathToFileURL(entryPath).href : null;
102
+ }
103
+ function resolvePluginImportSpecifier({ packageName, alternatePackageNames = [], nodeModulesEntries = [], localEntries = [], }) {
104
+ for (const candidatePackageName of [packageName, ...alternatePackageNames]) {
105
+ if (isPackageImportResolvable(candidatePackageName)) {
106
+ return candidatePackageName;
107
+ }
108
+ }
109
+ for (const entry of nodeModulesEntries) {
110
+ const resolved = resolveNodeModulesEntry(entry.packageName, entry.relativeEntryPath);
111
+ if (resolved)
112
+ return resolved;
113
+ }
114
+ return resolveFirstExistingPath(localEntries);
115
+ }
116
+ export function resolveDiscordPluginImportSpecifier() {
117
+ return resolvePluginImportSpecifier({
118
+ packageName: DISCORD_PLUGIN_PACKAGE_NAME,
119
+ localEntries: DISCORD_PLUGIN_LOCAL_ENTRY_CANDIDATES,
120
+ });
121
+ }
122
+ const TELEGRAM_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-telegram";
123
+ const TELEGRAM_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
124
+ "../plugins/plugin-telegram/dist/index",
125
+ ];
126
+ export function resolveTelegramPluginImportSpecifier() {
127
+ return resolvePluginImportSpecifier({
128
+ packageName: TELEGRAM_PLUGIN_PACKAGE_NAME,
129
+ nodeModulesEntries: [
130
+ {
131
+ packageName: TELEGRAM_PLUGIN_PACKAGE_NAME,
132
+ relativeEntryPath: "dist/index.js",
133
+ },
134
+ ],
135
+ localEntries: TELEGRAM_PLUGIN_LOCAL_ENTRY_CANDIDATES,
136
+ });
137
+ }
138
+ const LENS_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-lens";
139
+ const LENS_PLUGIN_FALLBACK_PACKAGE = "@elizaos-plugins/client-lens";
140
+ const LENS_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
141
+ "../plugins/plugin-lens/dist/index",
142
+ "../../client-lens/dist/index",
143
+ "../../client-lens/src/index",
144
+ ];
145
+ export function resolveLensPluginImportSpecifier() {
146
+ return resolvePluginImportSpecifier({
147
+ packageName: LENS_PLUGIN_PACKAGE_NAME,
148
+ alternatePackageNames: [LENS_PLUGIN_FALLBACK_PACKAGE],
149
+ nodeModulesEntries: [
150
+ {
151
+ packageName: LENS_PLUGIN_FALLBACK_PACKAGE,
152
+ relativeEntryPath: "src/index.ts",
153
+ },
154
+ {
155
+ packageName: LENS_PLUGIN_FALLBACK_PACKAGE,
156
+ relativeEntryPath: "dist/index.js",
157
+ },
158
+ ],
159
+ localEntries: LENS_PLUGIN_LOCAL_ENTRY_CANDIDATES,
160
+ });
161
+ }
162
+ const FARCASTER_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-farcaster";
163
+ const FARCASTER_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
164
+ "../plugins/plugin-farcaster/dist/node/index.node.js",
165
+ ];
166
+ export function resolveFarcasterPluginImportSpecifier() {
167
+ return resolvePluginImportSpecifier({
168
+ packageName: FARCASTER_PLUGIN_PACKAGE_NAME,
169
+ localEntries: FARCASTER_PLUGIN_LOCAL_ENTRY_CANDIDATES,
170
+ });
171
+ }
172
+ const NOSTR_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-nostr";
173
+ const NOSTR_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
174
+ "../plugins/plugin-nostr/dist/index",
175
+ ];
176
+ export function resolveNostrPluginImportSpecifier() {
177
+ return resolvePluginImportSpecifier({
178
+ packageName: NOSTR_PLUGIN_PACKAGE_NAME,
179
+ localEntries: NOSTR_PLUGIN_LOCAL_ENTRY_CANDIDATES,
180
+ });
181
+ }
182
+ const MATRIX_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-matrix";
183
+ const MATRIX_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
184
+ "../plugins/plugin-matrix/dist/index",
185
+ ];
186
+ export function resolveMatrixPluginImportSpecifier() {
187
+ return resolvePluginImportSpecifier({
188
+ packageName: MATRIX_PLUGIN_PACKAGE_NAME,
189
+ localEntries: MATRIX_PLUGIN_LOCAL_ENTRY_CANDIDATES,
190
+ });
191
+ }
192
+ const FEISHU_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-feishu";
193
+ const FEISHU_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
194
+ "../plugins/plugin-feishu/dist/index",
195
+ ];
196
+ export function resolveFeishuPluginImportSpecifier() {
197
+ return resolvePluginImportSpecifier({
198
+ packageName: FEISHU_PLUGIN_PACKAGE_NAME,
199
+ nodeModulesEntries: [
200
+ {
201
+ packageName: FEISHU_PLUGIN_PACKAGE_NAME,
202
+ relativeEntryPath: "dist/index.js",
203
+ },
204
+ ],
205
+ localEntries: FEISHU_PLUGIN_LOCAL_ENTRY_CANDIDATES,
206
+ });
207
+ }
208
+ const WECHAT_PLUGIN_PACKAGE_NAME = "@elizaos/plugin-wechat";
209
+ const WECHAT_PLUGIN_LEGACY_PACKAGE_NAME = "@elizaai/plugin-wechat";
210
+ const WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES = [
211
+ "src/index.ts",
212
+ "dist/index.js",
213
+ ];
214
+ export function resolveWechatPluginImportSpecifier() {
215
+ return resolvePluginImportSpecifier({
216
+ packageName: WECHAT_PLUGIN_PACKAGE_NAME,
217
+ alternatePackageNames: [WECHAT_PLUGIN_LEGACY_PACKAGE_NAME],
218
+ nodeModulesEntries: [
219
+ ...WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES.map((relativeEntryPath) => ({
220
+ packageName: WECHAT_PLUGIN_PACKAGE_NAME,
221
+ relativeEntryPath,
222
+ })),
223
+ ...WECHAT_PLUGIN_LOCAL_ENTRY_CANDIDATES.map((relativeEntryPath) => ({
224
+ packageName: WECHAT_PLUGIN_LEGACY_PACKAGE_NAME,
225
+ relativeEntryPath,
226
+ })),
227
+ ],
228
+ });
229
+ }
230
+ /** Build a mock update check result with deterministic defaults. */
231
+ export function buildMockUpdateCheckResult(overrides = {}) {
232
+ return {
233
+ updateAvailable: false,
234
+ currentVersion: "2.0.0",
235
+ latestVersion: "2.0.0",
236
+ channel: "stable",
237
+ distTag: "latest",
238
+ cached: false,
239
+ error: null,
240
+ ...overrides,
241
+ };
242
+ }
243
+ /** Small utility to wait for asynchronous side-effects in tests. */
244
+ export function waitMs(ms) {
245
+ return new Promise((resolve) => setTimeout(resolve, ms));
246
+ }
247
+ /** Create a lightweight mocked HTTP response used by handler tests. */
248
+ export function createMockHttpResponse() {
249
+ let statusCode = 200;
250
+ let legacyStatus = 0;
251
+ let payload = "";
252
+ const res = Object.create(ServerResponse.prototype);
253
+ Object.defineProperty(res, "statusCode", {
254
+ get() {
255
+ return statusCode;
256
+ },
257
+ set(value) {
258
+ statusCode = value;
259
+ legacyStatus = value;
260
+ },
261
+ configurable: true,
262
+ });
263
+ res._status = legacyStatus;
264
+ res._body = payload;
265
+ res.setHeader = () => res;
266
+ res.writeHead = ((value) => {
267
+ statusCode = value;
268
+ legacyStatus = value;
269
+ return res;
270
+ });
271
+ res.end = ((chunk) => {
272
+ payload = chunk ? chunk.toString() : "";
273
+ res._body = payload;
274
+ legacyStatus = statusCode;
275
+ res._status = legacyStatus;
276
+ return res;
277
+ });
278
+ return {
279
+ res,
280
+ getStatus: () => statusCode,
281
+ getJson: () => (payload ? JSON.parse(payload) : null),
282
+ };
283
+ }
284
+ export function createMockHeadersRequest(headers = {}, options = {}) {
285
+ return createMockIncomingMessage({
286
+ ...options,
287
+ headers,
288
+ });
289
+ }
290
+ export function createMockIncomingMessage({ method = "GET", url = "/", headers = { host: "localhost:2138" }, body, bodyChunks, json = false, }) {
291
+ const req = new EventEmitter();
292
+ req.method = method;
293
+ req.url = url;
294
+ req.headers = headers;
295
+ req.destroy = ((_) => req);
296
+ const chunks = [];
297
+ if (bodyChunks !== undefined) {
298
+ for (const chunk of bodyChunks) {
299
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk, "utf-8") : chunk);
300
+ }
301
+ }
302
+ else if (body !== undefined) {
303
+ const encoded = typeof body === "string"
304
+ ? Buffer.from(body, "utf-8")
305
+ : body instanceof Buffer
306
+ ? body
307
+ : json
308
+ ? Buffer.from(JSON.stringify(body), "utf-8")
309
+ : Buffer.from(String(body), "utf-8");
310
+ chunks.push(encoded);
311
+ }
312
+ for (const chunk of chunks) {
313
+ queueMicrotask(() => req.emit("data", chunk));
314
+ }
315
+ queueMicrotask(() => req.emit("end"));
316
+ return req;
317
+ }
318
+ export function createMockJsonRequest(body, options = {}) {
319
+ return createMockIncomingMessage({
320
+ ...options,
321
+ body,
322
+ json: true,
323
+ });
324
+ }
325
+ /** Return true when optional plugin imports are intentionally unavailable in this env. */
326
+ export function isOptionalImportError(error, extraMarkers = []) {
327
+ const message = error instanceof Error ? error.message : String(error);
328
+ return OPTIONAL_IMPORT_ERROR_MARKERS.concat(extraMarkers).some((marker) => message.includes(marker));
329
+ }
330
+ /** Safely import optional plugin modules while allowing hard failures to bubble. */
331
+ export async function tryOptionalDynamicImport(moduleName, markers) {
332
+ try {
333
+ return (await import(__rewriteRelativeImportExtension(/* @vite-ignore */ moduleName)));
334
+ }
335
+ catch (error) {
336
+ if (isOptionalImportError(error, markers))
337
+ return null;
338
+ throw error;
339
+ }
340
+ }
341
+ //# sourceMappingURL=test-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/test-support/test-helpers.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,6BAA6B,GAAG;IACpC,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,yBAAyB;IACzB,cAAc;IACd,uBAAuB;IACvB,gBAAgB;CACjB,CAAC;AAaF,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IACtD,MAAM,MAAM,GAAuC,EAAE,CAAC;IAEtD,SAAS,KAAK;QACZ,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/B,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,SAAS,OAAO;QACd,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS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QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Transcripts — the canonical contract for a recorded + transcribed session.
3
+ *
4
+ * One shape, shared across every layer: the ASR/diarization pipeline that
5
+ * PRODUCES a transcript (plugin-local-inference), the service that STORES it and
6
+ * mirrors its text into the knowledge/documents store, the API route + client
7
+ * that TRANSPORT it, and the Transcripts view that PLAYS it back with
8
+ * word-synced highlighting. Keeping the shape here (pure, browser- + node-safe)
9
+ * means the word-timing model is defined exactly once.
10
+ *
11
+ * Timing convention: every `startMs`/`endMs` is milliseconds from the START of
12
+ * the recording's audio (0 = first sample), so the same numbers drive both the
13
+ * stored record and the `<audio>.currentTime`-based player highlight.
14
+ */
15
+ /** A single transcribed word with playback-synced timing (ms from audio start). */
16
+ export interface TranscriptWord {
17
+ text: string;
18
+ startMs: number;
19
+ endMs: number;
20
+ /** ASR confidence 0..1, when the backend reports it. */
21
+ confidence?: number;
22
+ }
23
+ /**
24
+ * One diarized, word-timed span — a single speaker's contiguous utterance.
25
+ * `words` is empty only when the ASR backend supplied no per-word timing (the
26
+ * player then falls back to segment-level highlighting).
27
+ */
28
+ export interface TranscriptSegment {
29
+ id: string;
30
+ /** Stable speaker label within this transcript (e.g. "Speaker 1" or a name). */
31
+ speakerLabel?: string;
32
+ /** Resolved elizaOS entity id when the voice was recognized (evidence-linked). */
33
+ speakerEntityId?: string;
34
+ startMs: number;
35
+ endMs: number;
36
+ /** Segment text (the join of `words`, or raw ASR text when words are absent). */
37
+ text: string;
38
+ words: TranscriptWord[];
39
+ confidence?: number;
40
+ }
41
+ export type TranscriptSource = "voice-session" | "import" | "call" | "unknown";
42
+ /** Visibility scope — mirrors the documents store's `DocumentVisibilityScope`. */
43
+ export type TranscriptScope = "owner-private" | "user-private" | "global" | "agent-private";
44
+ export type TranscriptStatus = "recording" | "processing" | "ready" | "failed";
45
+ /** A recorded + transcribed session: audio + word-timed diarized segments. */
46
+ export interface Transcript {
47
+ id: string;
48
+ title: string;
49
+ /** Epoch ms when recording started. */
50
+ createdAt: number;
51
+ /** Epoch ms when the session ended; absent while still recording. */
52
+ endedAt?: number;
53
+ durationMs: number;
54
+ /** Served audio URL (content-addressed media store); absent if not retained. */
55
+ audioUrl?: string;
56
+ audioContentType?: string;
57
+ segments: TranscriptSegment[];
58
+ source: TranscriptSource;
59
+ scope: TranscriptScope;
60
+ status: TranscriptStatus;
61
+ /** The mirrored documents/knowledge item id (the searchable text copy). */
62
+ knowledgeDocumentId?: string;
63
+ /** Distinct speaker count across segments. */
64
+ speakerCount: number;
65
+ metadata?: Record<string, unknown>;
66
+ }
67
+ /** Compact list-row projection for the transcripts index. */
68
+ export interface TranscriptSummary {
69
+ id: string;
70
+ title: string;
71
+ createdAt: number;
72
+ durationMs: number;
73
+ speakerCount: number;
74
+ status: TranscriptStatus;
75
+ /** First slice of the transcript text, for the list row. */
76
+ preview: string;
77
+ hasAudio: boolean;
78
+ }
79
+ /** Default characters of transcript text kept for a list-row preview. */
80
+ export declare const TRANSCRIPT_PREVIEW_CHARS = 160;
81
+ /** Distinct speaker labels across the segments (unlabeled segments ignored). */
82
+ export declare function transcriptSpeakerCount(segments: ReadonlyArray<TranscriptSegment>): number;
83
+ /** Recording length in ms — the largest segment end (0 when empty). */
84
+ export declare function transcriptDurationMs(segments: ReadonlyArray<TranscriptSegment>): number;
85
+ /**
86
+ * Render the transcript as plain, speaker-labeled lines — the exact text that is
87
+ * mirrored into the knowledge/documents store (so search + the provider read
88
+ * the same words a human sees) and used for previews. One line per segment:
89
+ * `Speaker: text` (label omitted when unknown).
90
+ */
91
+ export declare function transcriptPlainText(segments: ReadonlyArray<TranscriptSegment>): string;
92
+ /** A one-line preview of the transcript text, capped to `max` chars. */
93
+ export declare function transcriptPreview(segments: ReadonlyArray<TranscriptSegment>, max?: number): string;
94
+ /** Project a full transcript to its list-row summary. */
95
+ export declare function summarizeTranscript(transcript: Transcript): TranscriptSummary;
96
+ /** A word flattened across segments, carrying its origin indices for the UI. */
97
+ export interface FlatTranscriptWord extends TranscriptWord {
98
+ segmentIndex: number;
99
+ wordIndex: number;
100
+ }
101
+ /** Flatten all segments' words into one time-ordered array (for player sync). */
102
+ export declare function flattenTranscriptWords(segments: ReadonlyArray<TranscriptSegment>): FlatTranscriptWord[];
103
+ /**
104
+ * Index of the word active at playback time `ms` within a flattened, ascending
105
+ * word list, via binary search (cheap enough to call every `timeupdate`/frame).
106
+ * Returns the last word whose `startMs <= ms`; -1 before the first word starts.
107
+ * A word stays "active" until the next word begins, so gaps between words keep
108
+ * the previous word lit rather than flickering off.
109
+ */
110
+ export declare function activeWordIndex(words: ReadonlyArray<FlatTranscriptWord>, ms: number): number;
111
+ //# sourceMappingURL=transcripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transcripts.d.ts","sourceRoot":"","sources":["../src/transcripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,mFAAmF;AACnF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE/E,kFAAkF;AAClF,MAAM,M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ED,uEAAuE;AACvE,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,GACzC,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,GACzC,MAAM,CASR;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,EAC1C,GAAG,SAA2B,GAC7B,MAAM,CAQR;AAED,yDAAyD;AACzD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,iBAAiB,CAW7E;AAED,gFAAgF;AAChF,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,GACzC,kBAAkB,EAAE,CAQtB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,EACxC,EAAE,EAAE,MAAM,GACT,MAAM,CAcR"}
package/transcripts.js ADDED
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Transcripts — the canonical contract for a recorded + transcribed session.
3
+ *
4
+ * One shape, shared across every layer: the ASR/diarization pipeline that
5
+ * PRODUCES a transcript (plugin-local-inference), the service that STORES it and
6
+ * mirrors its text into the knowledge/documents store, the API route + client
7
+ * that TRANSPORT it, and the Transcripts view that PLAYS it back with
8
+ * word-synced highlighting. Keeping the shape here (pure, browser- + node-safe)
9
+ * means the word-timing model is defined exactly once.
10
+ *
11
+ * Timing convention: every `startMs`/`endMs` is milliseconds from the START of
12
+ * the recording's audio (0 = first sample), so the same numbers drive both the
13
+ * stored record and the `<audio>.currentTime`-based player highlight.
14
+ */
15
+ /** Default characters of transcript text kept for a list-row preview. */
16
+ export const TRANSCRIPT_PREVIEW_CHARS = 160;
17
+ /** Distinct speaker labels across the segments (unlabeled segments ignored). */
18
+ export function transcriptSpeakerCount(segments) {
19
+ const labels = new Set();
20
+ for (const s of segments)
21
+ if (s.speakerLabel)
22
+ labels.add(s.speakerLabel);
23
+ return labels.size;
24
+ }
25
+ /** Recording length in ms — the largest segment end (0 when empty). */
26
+ export function transcriptDurationMs(segments) {
27
+ let max = 0;
28
+ for (const s of segments)
29
+ if (s.endMs > max)
30
+ max = s.endMs;
31
+ return max;
32
+ }
33
+ /**
34
+ * Render the transcript as plain, speaker-labeled lines — the exact text that is
35
+ * mirrored into the knowledge/documents store (so search + the provider read
36
+ * the same words a human sees) and used for previews. One line per segment:
37
+ * `Speaker: text` (label omitted when unknown).
38
+ */
39
+ export function transcriptPlainText(segments) {
40
+ return segments
41
+ .map((s) => {
42
+ const text = s.text.trim();
43
+ if (!text)
44
+ return "";
45
+ return s.speakerLabel ? `${s.speakerLabel}: ${text}` : text;
46
+ })
47
+ .filter((line) => line.length > 0)
48
+ .join("\n");
49
+ }
50
+ /** A one-line preview of the transcript text, capped to `max` chars. */
51
+ export function transcriptPreview(segments, max = TRANSCRIPT_PREVIEW_CHARS) {
52
+ const flat = segments
53
+ .map((s) => s.text.trim())
54
+ .filter(Boolean)
55
+ .join(" ")
56
+ .replace(/\s+/g, " ")
57
+ .trim();
58
+ return flat.length > max ? `${flat.slice(0, max - 1).trimEnd()}…` : flat;
59
+ }
60
+ /** Project a full transcript to its list-row summary. */
61
+ export function summarizeTranscript(transcript) {
62
+ return {
63
+ id: transcript.id,
64
+ title: transcript.title,
65
+ createdAt: transcript.createdAt,
66
+ durationMs: transcript.durationMs,
67
+ speakerCount: transcript.speakerCount,
68
+ status: transcript.status,
69
+ preview: transcriptPreview(transcript.segments),
70
+ hasAudio: Boolean(transcript.audioUrl),
71
+ };
72
+ }
73
+ /** Flatten all segments' words into one time-ordered array (for player sync). */
74
+ export function flattenTranscriptWords(segments) {
75
+ const out = [];
76
+ segments.forEach((segment, segmentIndex) => {
77
+ segment.words.forEach((word, wordIndex) => {
78
+ out.push({ ...word, segmentIndex, wordIndex });
79
+ });
80
+ });
81
+ return out;
82
+ }
83
+ /**
84
+ * Index of the word active at playback time `ms` within a flattened, ascending
85
+ * word list, via binary search (cheap enough to call every `timeupdate`/frame).
86
+ * Returns the last word whose `startMs <= ms`; -1 before the first word starts.
87
+ * A word stays "active" until the next word begins, so gaps between words keep
88
+ * the previous word lit rather than flickering off.
89
+ */
90
+ export function activeWordIndex(words, ms) {
91
+ let lo = 0;
92
+ let hi = words.length - 1;
93
+ let found = -1;
94
+ while (lo <= hi) {
95
+ const mid = (lo + hi) >> 1;
96
+ if (words[mid].startMs <= ms) {
97
+ found = mid;
98
+ lo = mid + 1;
99
+ }
100
+ else {
101
+ hi = mid - 1;
102
+ }
103
+ }
104
+ return found;
105
+ }
106
+ //# sourceMappingURL=transcripts.js.map