@ouro.bot/cli 0.1.0-alpha.59 → 0.1.0-alpha.590

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 (409) hide show
  1. package/README.md +127 -23
  2. package/RepairGuide.ouro/agent.json +5 -0
  3. package/RepairGuide.ouro/psyche/IDENTITY.md +19 -0
  4. package/RepairGuide.ouro/psyche/SOUL.md +55 -0
  5. package/RepairGuide.ouro/skills/diagnose-broken-remote.md +63 -0
  6. package/RepairGuide.ouro/skills/diagnose-stacked-typed-issues.md +35 -0
  7. package/RepairGuide.ouro/skills/diagnose-sync-blocked.md +54 -0
  8. package/RepairGuide.ouro/skills/diagnose-vault-expired.md +60 -0
  9. package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/agent.json +4 -2
  10. package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/SOUL.md +2 -2
  11. package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-serpent.md +1 -1
  12. package/changelog.json +3805 -0
  13. package/dist/arc/attention-types.js +8 -0
  14. package/dist/arc/cares.js +140 -0
  15. package/dist/arc/episodes.js +117 -0
  16. package/dist/arc/intentions.js +133 -0
  17. package/dist/arc/json-store.js +117 -0
  18. package/dist/arc/obligations.js +237 -0
  19. package/dist/arc/packets.js +193 -0
  20. package/dist/arc/presence.js +185 -0
  21. package/dist/arc/task-lifecycle.js +65 -0
  22. package/dist/heart/active-work.js +837 -26
  23. package/dist/heart/agent-entry.js +69 -3
  24. package/dist/heart/attachments/image-normalize.js +194 -0
  25. package/dist/heart/attachments/materialize.js +97 -0
  26. package/dist/heart/attachments/originals.js +88 -0
  27. package/dist/heart/attachments/render.js +29 -0
  28. package/dist/heart/attachments/sources/adapter.js +2 -0
  29. package/dist/heart/attachments/sources/bluebubbles.js +156 -0
  30. package/dist/heart/attachments/sources/cli-local-file.js +78 -0
  31. package/dist/heart/attachments/sources/index.js +16 -0
  32. package/dist/heart/attachments/store.js +103 -0
  33. package/dist/heart/attachments/types.js +93 -0
  34. package/dist/heart/auth/auth-flow.js +479 -0
  35. package/dist/heart/background-operations.js +281 -0
  36. package/dist/heart/bundle-state.js +168 -0
  37. package/dist/heart/commitments.js +111 -0
  38. package/dist/heart/config-registry.js +322 -0
  39. package/dist/heart/config.js +114 -118
  40. package/dist/heart/core.js +909 -246
  41. package/dist/heart/cross-chat-delivery.js +3 -18
  42. package/dist/heart/daemon/agent-config-check.js +419 -0
  43. package/dist/heart/daemon/agent-discovery.js +102 -3
  44. package/dist/heart/daemon/agent-service.js +522 -0
  45. package/dist/heart/daemon/agentic-repair.js +547 -0
  46. package/dist/heart/daemon/bluebubbles-health-diagnostics.js +122 -0
  47. package/dist/heart/daemon/boot-sync-probe.js +197 -0
  48. package/dist/heart/daemon/cadence.js +70 -0
  49. package/dist/heart/daemon/cli-defaults.js +776 -0
  50. package/dist/heart/daemon/cli-exec.js +7559 -0
  51. package/dist/heart/daemon/cli-help.js +498 -0
  52. package/dist/heart/daemon/cli-parse.js +1592 -0
  53. package/dist/heart/daemon/cli-render-doctor.js +57 -0
  54. package/dist/heart/daemon/cli-render.js +763 -0
  55. package/dist/heart/daemon/cli-types.js +8 -0
  56. package/dist/heart/daemon/connect-bay.js +323 -0
  57. package/dist/heart/daemon/daemon-cli.js +29 -1703
  58. package/dist/heart/daemon/daemon-entry.js +387 -2
  59. package/dist/heart/daemon/daemon-health.js +176 -0
  60. package/dist/heart/daemon/daemon-rollup.js +57 -0
  61. package/dist/heart/daemon/daemon-runtime-sync.js +88 -13
  62. package/dist/heart/daemon/daemon-tombstone.js +236 -0
  63. package/dist/heart/daemon/daemon.js +815 -70
  64. package/dist/heart/daemon/dns-workflow.js +394 -0
  65. package/dist/heart/daemon/doctor-types.js +8 -0
  66. package/dist/heart/daemon/doctor.js +873 -0
  67. package/dist/heart/daemon/health-monitor.js +122 -1
  68. package/dist/heart/daemon/hooks/agent-config-v2.js +33 -0
  69. package/dist/heart/daemon/hooks/bundle-meta.js +115 -1
  70. package/dist/heart/daemon/http-health-probe.js +80 -0
  71. package/dist/heart/daemon/human-command-screens.js +234 -0
  72. package/dist/heart/daemon/human-readiness.js +114 -0
  73. package/dist/heart/daemon/inner-status.js +89 -0
  74. package/dist/heart/daemon/interactive-repair.js +394 -0
  75. package/dist/heart/daemon/launchd.js +37 -8
  76. package/dist/heart/daemon/log-tailer.js +78 -9
  77. package/dist/heart/daemon/logs-prune.js +110 -0
  78. package/dist/heart/daemon/mcp-canary.js +297 -0
  79. package/dist/heart/daemon/os-cron-deps.js +135 -0
  80. package/dist/heart/daemon/os-cron.js +14 -12
  81. package/dist/heart/daemon/ouro-bot-entry.js +4 -2
  82. package/dist/heart/daemon/ouro-entry.js +3 -1
  83. package/dist/heart/daemon/process-manager.js +375 -33
  84. package/dist/heart/daemon/provider-discovery.js +137 -0
  85. package/dist/heart/daemon/provider-ping-progress.js +83 -0
  86. package/dist/heart/daemon/pulse.js +475 -0
  87. package/dist/heart/daemon/readiness-repair.js +365 -0
  88. package/dist/heart/daemon/run-hooks.js +2 -0
  89. package/dist/heart/daemon/runtime-logging.js +10 -2
  90. package/dist/heart/daemon/runtime-metadata.js +2 -30
  91. package/dist/heart/daemon/safe-mode.js +161 -0
  92. package/dist/heart/daemon/sense-manager.js +462 -38
  93. package/dist/heart/daemon/session-id-resolver.js +131 -0
  94. package/dist/heart/daemon/skill-management-installer.js +94 -0
  95. package/dist/heart/daemon/socket-client.js +158 -11
  96. package/dist/heart/daemon/stale-bundle-prune.js +96 -0
  97. package/dist/heart/daemon/startup-tui.js +330 -0
  98. package/dist/heart/daemon/task-scheduler.js +3 -25
  99. package/dist/heart/daemon/terminal-ui.js +499 -0
  100. package/dist/heart/daemon/thoughts.js +162 -17
  101. package/dist/heart/daemon/up-progress.js +366 -0
  102. package/dist/heart/daemon/vault-items.js +56 -0
  103. package/dist/heart/delegation.js +1 -1
  104. package/dist/heart/habits/habit-migration.js +189 -0
  105. package/dist/heart/habits/habit-parser.js +140 -0
  106. package/dist/heart/habits/habit-runtime-state.js +100 -0
  107. package/dist/heart/habits/habit-scheduler.js +372 -0
  108. package/dist/heart/{daemon → hatch}/hatch-flow.js +32 -56
  109. package/dist/heart/{daemon → hatch}/hatch-specialist.js +6 -8
  110. package/dist/heart/{daemon → hatch}/specialist-prompt.js +12 -9
  111. package/dist/heart/{daemon → hatch}/specialist-tools.js +35 -12
  112. package/dist/heart/identity.js +166 -55
  113. package/dist/heart/kept-notes.js +357 -0
  114. package/dist/heart/kicks.js +1 -1
  115. package/dist/heart/machine-identity.js +161 -0
  116. package/dist/heart/mail-import-discovery.js +353 -0
  117. package/dist/heart/mailbox/mailbox-http-hooks.js +66 -0
  118. package/dist/heart/mailbox/mailbox-http-response.js +7 -0
  119. package/dist/heart/mailbox/mailbox-http-routes.js +246 -0
  120. package/dist/heart/mailbox/mailbox-http-static.js +103 -0
  121. package/dist/heart/mailbox/mailbox-http-transport.js +116 -0
  122. package/dist/heart/mailbox/mailbox-http.js +99 -0
  123. package/dist/heart/mailbox/mailbox-read.js +31 -0
  124. package/dist/heart/mailbox/mailbox-types.js +27 -0
  125. package/dist/heart/mailbox/mailbox-view.js +195 -0
  126. package/dist/heart/mailbox/readers/agent-machine.js +382 -0
  127. package/dist/heart/mailbox/readers/continuity-readers.js +338 -0
  128. package/dist/heart/mailbox/readers/mail.js +362 -0
  129. package/dist/heart/mailbox/readers/runtime-readers.js +651 -0
  130. package/dist/heart/mailbox/readers/sessions.js +232 -0
  131. package/dist/heart/mailbox/readers/shared.js +111 -0
  132. package/dist/heart/mcp/mcp-server.js +656 -0
  133. package/dist/heart/migrate-config.js +100 -0
  134. package/dist/heart/model-capabilities.js +19 -0
  135. package/dist/heart/platform.js +81 -0
  136. package/dist/heart/provider-attempt.js +134 -0
  137. package/dist/heart/provider-binding-resolver.js +267 -0
  138. package/dist/heart/provider-credentials.js +425 -0
  139. package/dist/heart/provider-failover.js +301 -0
  140. package/dist/heart/provider-models.js +81 -0
  141. package/dist/heart/provider-ping.js +262 -0
  142. package/dist/heart/provider-readiness-cache.js +40 -0
  143. package/dist/heart/provider-visibility.js +188 -0
  144. package/dist/heart/providers/anthropic-token.js +131 -0
  145. package/dist/heart/providers/anthropic.js +139 -52
  146. package/dist/heart/providers/azure.js +97 -13
  147. package/dist/heart/providers/error-classification.js +127 -0
  148. package/dist/heart/providers/github-copilot.js +145 -0
  149. package/dist/heart/providers/minimax-vlm.js +189 -0
  150. package/dist/heart/providers/minimax.js +26 -8
  151. package/dist/heart/providers/openai-codex.js +55 -40
  152. package/dist/heart/runtime-capability-check.js +170 -0
  153. package/dist/heart/runtime-credentials.js +367 -0
  154. package/dist/heart/runtime-cwd.js +87 -0
  155. package/dist/heart/sense-truth.js +13 -4
  156. package/dist/heart/session-activity.js +43 -22
  157. package/dist/heart/session-events.js +1149 -0
  158. package/dist/heart/session-playback-cli-main.js +5 -0
  159. package/dist/heart/session-playback-cli.js +36 -0
  160. package/dist/heart/session-playback.js +231 -0
  161. package/dist/heart/session-stats-cli-main.js +5 -0
  162. package/dist/heart/session-stats.js +182 -0
  163. package/dist/heart/session-transcript.js +243 -0
  164. package/dist/heart/start-of-turn-packet.js +345 -0
  165. package/dist/heart/streaming.js +44 -27
  166. package/dist/heart/sync-classification.js +176 -0
  167. package/dist/heart/sync.js +449 -0
  168. package/dist/heart/target-resolution.js +9 -5
  169. package/dist/heart/tempo.js +93 -0
  170. package/dist/heart/temporal-view.js +41 -0
  171. package/dist/heart/timeouts.js +101 -0
  172. package/dist/heart/tool-activity-callbacks.js +59 -0
  173. package/dist/heart/tool-description.js +143 -0
  174. package/dist/heart/tool-friction.js +55 -0
  175. package/dist/heart/tool-loop.js +200 -0
  176. package/dist/heart/turn-context.js +421 -0
  177. package/dist/heart/{daemon → versioning}/ouro-bot-global-installer.js +6 -5
  178. package/dist/heart/{daemon → versioning}/ouro-bot-wrapper.js +1 -1
  179. package/dist/heart/versioning/ouro-path-installer.js +426 -0
  180. package/dist/heart/versioning/ouro-version-manager.js +295 -0
  181. package/dist/heart/{daemon → versioning}/staged-restart.js +40 -8
  182. package/dist/heart/{daemon → versioning}/update-checker.js +6 -1
  183. package/dist/heart/{daemon → versioning}/update-hooks.js +63 -59
  184. package/dist/mailbox-ui/assets/index-B-461hes.js +61 -0
  185. package/dist/mailbox-ui/assets/index-BPr5vNuM.css +1 -0
  186. package/dist/mailbox-ui/index.html +15 -0
  187. package/dist/mailroom/attention.js +167 -0
  188. package/dist/mailroom/autonomy.js +209 -0
  189. package/dist/mailroom/blob-store.js +674 -0
  190. package/dist/mailroom/body-cache.js +61 -0
  191. package/dist/mailroom/core.js +720 -0
  192. package/dist/mailroom/entry.js +160 -0
  193. package/dist/mailroom/file-store.js +430 -0
  194. package/dist/mailroom/mbox-import.js +383 -0
  195. package/dist/mailroom/outbound.js +380 -0
  196. package/dist/mailroom/policy.js +263 -0
  197. package/dist/mailroom/reader.js +233 -0
  198. package/dist/mailroom/search-cache.js +268 -0
  199. package/dist/mailroom/search-relevance.js +319 -0
  200. package/dist/mailroom/smtp-ingress.js +176 -0
  201. package/dist/mailroom/source-state.js +176 -0
  202. package/dist/mailroom/thread.js +109 -0
  203. package/dist/mailroom/travel-extract.js +89 -0
  204. package/dist/mind/bundle-manifest.js +7 -1
  205. package/dist/mind/context.js +165 -101
  206. package/dist/mind/diary-integrity.js +60 -0
  207. package/dist/mind/{memory.js → diary.js} +62 -75
  208. package/dist/mind/embedding-provider.js +60 -0
  209. package/dist/mind/file-state.js +179 -0
  210. package/dist/mind/friends/channel.js +39 -0
  211. package/dist/mind/friends/resolver.js +54 -2
  212. package/dist/mind/friends/store-file.js +39 -3
  213. package/dist/mind/friends/types.js +2 -2
  214. package/dist/mind/journal-index.js +161 -0
  215. package/dist/mind/note-search.js +268 -0
  216. package/dist/mind/obligation-steering.js +221 -0
  217. package/dist/mind/pending.js +4 -0
  218. package/dist/mind/prompt-refresh.js +3 -2
  219. package/dist/mind/prompt.js +1039 -135
  220. package/dist/mind/provenance-trust.js +26 -0
  221. package/dist/mind/scrutiny.js +173 -0
  222. package/dist/nerves/cli-logging.js +7 -1
  223. package/dist/nerves/coverage/audit-rules.js +15 -6
  224. package/dist/nerves/coverage/audit.js +28 -2
  225. package/dist/nerves/coverage/cli.js +1 -1
  226. package/dist/nerves/coverage/contract.js +5 -5
  227. package/dist/nerves/coverage/file-completeness.js +129 -5
  228. package/dist/nerves/event-buffer.js +111 -0
  229. package/dist/nerves/index.js +224 -4
  230. package/dist/nerves/observation.js +20 -0
  231. package/dist/nerves/redact.js +79 -0
  232. package/dist/nerves/review/cli-main.js +5 -0
  233. package/dist/nerves/review/cli.js +156 -0
  234. package/dist/nerves/review/core.js +152 -0
  235. package/dist/nerves/runtime.js +5 -1
  236. package/dist/repertoire/ado-client.js +15 -56
  237. package/dist/repertoire/ado-semantic.js +11 -10
  238. package/dist/repertoire/api-client.js +97 -0
  239. package/dist/repertoire/bitwarden-store.js +997 -0
  240. package/dist/repertoire/bundle-templates.js +72 -0
  241. package/dist/repertoire/bw-installer.js +180 -0
  242. package/dist/repertoire/coding/codex-jsonl.js +64 -0
  243. package/dist/repertoire/coding/context-pack.js +330 -0
  244. package/dist/repertoire/coding/feedback.js +197 -30
  245. package/dist/repertoire/coding/manager.js +158 -9
  246. package/dist/repertoire/coding/spawner.js +55 -9
  247. package/dist/repertoire/coding/tools.js +170 -7
  248. package/dist/repertoire/commerce-errors.js +109 -0
  249. package/dist/repertoire/commerce-self-test.js +156 -0
  250. package/dist/repertoire/credential-access.js +178 -0
  251. package/dist/repertoire/duffel-client.js +185 -0
  252. package/dist/repertoire/github-client.js +14 -55
  253. package/dist/repertoire/graph-client.js +11 -52
  254. package/dist/repertoire/guardrails.js +396 -0
  255. package/dist/repertoire/mcp-client.js +295 -0
  256. package/dist/repertoire/mcp-manager.js +362 -0
  257. package/dist/repertoire/mcp-tools.js +63 -0
  258. package/dist/repertoire/shell-sessions.js +133 -0
  259. package/dist/repertoire/skills.js +15 -24
  260. package/dist/repertoire/stripe-client.js +131 -0
  261. package/dist/repertoire/tasks/board.js +31 -5
  262. package/dist/repertoire/tasks/fix.js +182 -0
  263. package/dist/repertoire/tasks/index.js +16 -4
  264. package/dist/repertoire/tasks/lifecycle.js +2 -2
  265. package/dist/repertoire/tasks/parser.js +3 -2
  266. package/dist/repertoire/tasks/scanner.js +194 -37
  267. package/dist/repertoire/tasks/transitions.js +16 -78
  268. package/dist/repertoire/tool-results.js +29 -0
  269. package/dist/repertoire/tools-attachments.js +317 -0
  270. package/dist/repertoire/tools-base.js +47 -1082
  271. package/dist/repertoire/tools-bluebubbles.js +1 -0
  272. package/dist/repertoire/tools-bridge.js +142 -0
  273. package/dist/repertoire/tools-bundle.js +984 -0
  274. package/dist/repertoire/tools-config.js +185 -0
  275. package/dist/repertoire/tools-continuity.js +248 -0
  276. package/dist/repertoire/tools-credential.js +381 -0
  277. package/dist/repertoire/tools-files.js +342 -0
  278. package/dist/repertoire/tools-flight.js +224 -0
  279. package/dist/repertoire/tools-flow.js +119 -0
  280. package/dist/repertoire/tools-github.js +1 -7
  281. package/dist/repertoire/tools-mail.js +1911 -0
  282. package/dist/repertoire/tools-notes.js +421 -0
  283. package/dist/repertoire/tools-session.js +809 -0
  284. package/dist/repertoire/tools-shell.js +120 -0
  285. package/dist/repertoire/tools-stripe.js +180 -0
  286. package/dist/repertoire/tools-surface.js +345 -0
  287. package/dist/repertoire/tools-teams.js +9 -39
  288. package/dist/repertoire/tools-travel.js +125 -0
  289. package/dist/repertoire/tools-trip.js +604 -0
  290. package/dist/repertoire/tools-user-profile.js +144 -0
  291. package/dist/repertoire/tools-vault.js +40 -0
  292. package/dist/repertoire/tools-voice.js +144 -0
  293. package/dist/repertoire/tools.js +115 -103
  294. package/dist/repertoire/travel-api-client.js +360 -0
  295. package/dist/repertoire/user-profile.js +131 -0
  296. package/dist/repertoire/vault-setup.js +246 -0
  297. package/dist/repertoire/vault-unlock.js +594 -0
  298. package/dist/scripts/claude-code-hook.js +41 -0
  299. package/dist/scripts/claude-code-stop-hook.js +47 -0
  300. package/dist/senses/attention-queue.js +116 -0
  301. package/dist/senses/bluebubbles/active-turns.js +216 -0
  302. package/dist/senses/bluebubbles/attachment-cache.js +53 -0
  303. package/dist/senses/bluebubbles/attachment-download.js +137 -0
  304. package/dist/senses/{bluebubbles-client.js → bluebubbles/client.js} +219 -18
  305. package/dist/senses/bluebubbles/entry.js +77 -0
  306. package/dist/senses/{bluebubbles-inbound-log.js → bluebubbles/inbound-log.js} +20 -3
  307. package/dist/senses/bluebubbles/index.js +2487 -0
  308. package/dist/senses/{bluebubbles-media.js → bluebubbles/media.js} +121 -71
  309. package/dist/senses/{bluebubbles-model.js → bluebubbles/model.js} +33 -12
  310. package/dist/senses/{bluebubbles-mutation-log.js → bluebubbles/mutation-log.js} +3 -3
  311. package/dist/senses/bluebubbles/processed-log.js +133 -0
  312. package/dist/senses/bluebubbles/replay.js +137 -0
  313. package/dist/senses/{bluebubbles-runtime-state.js → bluebubbles/runtime-state.js} +30 -2
  314. package/dist/senses/{bluebubbles-session-cleanup.js → bluebubbles/session-cleanup.js} +1 -1
  315. package/dist/senses/bluebubbles-meta-guard.js +40 -0
  316. package/dist/senses/cli/bracketed-paste.js +82 -0
  317. package/dist/senses/cli/image-paste.js +287 -0
  318. package/dist/senses/cli/image-ref-navigation.js +75 -0
  319. package/dist/senses/cli/ink-app.js +156 -0
  320. package/dist/senses/cli/inline-diff.js +64 -0
  321. package/dist/senses/cli/input-keys.js +174 -0
  322. package/dist/senses/cli/kill-ring.js +86 -0
  323. package/dist/senses/cli/message-list.js +51 -0
  324. package/dist/senses/cli/ouro-tui.js +607 -0
  325. package/dist/senses/cli/spinner-imperative.js +135 -0
  326. package/dist/senses/cli/spinner.js +101 -0
  327. package/dist/senses/cli/status-line.js +60 -0
  328. package/dist/senses/cli/streaming-markdown.js +526 -0
  329. package/dist/senses/cli/tool-display.js +85 -0
  330. package/dist/senses/cli/tool-render.js +85 -0
  331. package/dist/senses/cli/tui-store.js +240 -0
  332. package/dist/senses/cli/virtual-list.js +35 -0
  333. package/dist/senses/cli-entry.js +60 -8
  334. package/dist/senses/cli-layout.js +100 -0
  335. package/dist/senses/cli.js +516 -204
  336. package/dist/senses/commands.js +66 -3
  337. package/dist/senses/habit-turn-message.js +108 -0
  338. package/dist/senses/inner-dialog-worker.js +175 -21
  339. package/dist/senses/inner-dialog.js +330 -27
  340. package/dist/senses/mail-entry.js +66 -0
  341. package/dist/senses/mail.js +379 -0
  342. package/dist/senses/pipeline.js +654 -181
  343. package/dist/senses/proactive-content-guard.js +51 -0
  344. package/dist/senses/shared-turn.js +392 -0
  345. package/dist/senses/surface-tool.js +70 -0
  346. package/dist/senses/teams-entry.js +60 -8
  347. package/dist/senses/teams.js +387 -98
  348. package/dist/senses/trust-gate.js +100 -5
  349. package/dist/senses/voice/audio-playback.js +237 -0
  350. package/dist/senses/voice/audio-routing.js +119 -0
  351. package/dist/senses/voice/elevenlabs.js +202 -0
  352. package/dist/senses/voice/floor-control.js +398 -0
  353. package/dist/senses/voice/floor-controller.js +115 -0
  354. package/dist/senses/voice/golden-path.js +116 -0
  355. package/dist/senses/voice/index.js +29 -0
  356. package/dist/senses/voice/meeting.js +113 -0
  357. package/dist/senses/voice/outbound.js +190 -0
  358. package/dist/senses/voice/phone.js +33 -0
  359. package/dist/senses/voice/playback.js +139 -0
  360. package/dist/senses/voice/realtime-eval.js +496 -0
  361. package/dist/senses/voice/realtime-trace.js +531 -0
  362. package/dist/senses/voice/transcript.js +70 -0
  363. package/dist/senses/voice/turn.js +191 -0
  364. package/dist/senses/voice/twilio-phone-runtime.js +794 -0
  365. package/dist/senses/voice/twilio-phone.js +4995 -0
  366. package/dist/senses/voice/types.js +2 -0
  367. package/dist/senses/voice/whisper.js +161 -0
  368. package/dist/senses/voice-entry.js +81 -0
  369. package/dist/senses/voice-realtime-eval-command.js +99 -0
  370. package/dist/senses/voice-realtime-eval-entry.js +21 -0
  371. package/dist/senses/voice-twilio-entry.js +87 -0
  372. package/dist/trips/core.js +138 -0
  373. package/dist/trips/store.js +265 -0
  374. package/package.json +42 -7
  375. package/skills/agent-commerce.md +106 -0
  376. package/skills/browser-navigation.md +117 -0
  377. package/skills/commerce-setup-guide.md +116 -0
  378. package/skills/commerce-setup.md +84 -0
  379. package/skills/configure-dev-tools.md +99 -0
  380. package/skills/travel-planning.md +138 -0
  381. package/dist/heart/daemon/auth-flow.js +0 -351
  382. package/dist/heart/daemon/ouro-path-installer.js +0 -178
  383. package/dist/heart/daemon/subagent-installer.js +0 -166
  384. package/dist/heart/safe-workspace.js +0 -228
  385. package/dist/heart/session-recall.js +0 -116
  386. package/dist/mind/associative-recall.js +0 -209
  387. package/dist/senses/bluebubbles-entry.js +0 -13
  388. package/dist/senses/bluebubbles.js +0 -1177
  389. package/dist/senses/debug-activity.js +0 -148
  390. package/subagents/README.md +0 -86
  391. package/subagents/work-doer.md +0 -237
  392. package/subagents/work-merger.md +0 -618
  393. package/subagents/work-planner.md +0 -390
  394. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/basilisk.md +0 -0
  395. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jafar.md +0 -0
  396. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/jormungandr.md +0 -0
  397. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/kaa.md +0 -0
  398. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/medusa.md +0 -0
  399. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/monty.md +0 -0
  400. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/nagini.md +0 -0
  401. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/ouroboros.md +0 -0
  402. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/python.md +0 -0
  403. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/quetzalcoatl.md +0 -0
  404. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/sir-hiss.md +0 -0
  405. /package/{AdoptionSpecialist.ouro → SerpentGuide.ouro}/psyche/identities/the-snake.md +0 -0
  406. /package/dist/heart/{daemon → hatch}/hatch-animation.js +0 -0
  407. /package/dist/heart/{daemon → hatch}/specialist-orchestrator.js +0 -0
  408. /package/dist/heart/{daemon → versioning}/ouro-uti.js +0 -0
  409. /package/dist/heart/{daemon → versioning}/wrapper-publish-guard.js +0 -0
@@ -0,0 +1,496 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gradeVoiceRealtimeEvalTimeline = gradeVoiceRealtimeEvalTimeline;
4
+ exports.buildVoiceRealtimeEvalHappyPath = buildVoiceRealtimeEvalHappyPath;
5
+ exports.buildVoiceRealtimeEvalDefaultExpectation = buildVoiceRealtimeEvalDefaultExpectation;
6
+ exports.runBuiltInVoiceRealtimeEvalSuite = runBuiltInVoiceRealtimeEvalSuite;
7
+ exports.summarizeVoiceRealtimeEvalSuite = summarizeVoiceRealtimeEvalSuite;
8
+ const runtime_1 = require("../../nerves/runtime");
9
+ function validateTimeline(scenarioId, events, expectation) {
10
+ const normalizedScenarioId = scenarioId.trim();
11
+ if (!normalizedScenarioId)
12
+ throw new Error("voice eval scenario id is empty");
13
+ if (events.length === 0)
14
+ throw new Error("voice eval timeline is empty");
15
+ const budgets = [
16
+ expectation.maxFirstAssistantAudioMs,
17
+ expectation.maxUserTurnResponseMs,
18
+ expectation.maxToolPresenceMs,
19
+ expectation.maxBargeInClearMs,
20
+ expectation.maxBargeInTruncateMs,
21
+ ];
22
+ if (budgets.some((budget) => !Number.isFinite(budget) || budget <= 0)) {
23
+ throw new Error("voice eval latency budgets must be positive");
24
+ }
25
+ return normalizedScenarioId;
26
+ }
27
+ function sortedEvents(events) {
28
+ return [...events].sort((left, right) => left.atMs - right.atMs);
29
+ }
30
+ function firstEvent(events, type) {
31
+ return events.find((event) => event.type === type);
32
+ }
33
+ function allEvents(events, type) {
34
+ return events.filter((event) => event.type === type);
35
+ }
36
+ function lowerText(value) {
37
+ return value?.toLowerCase() ?? "";
38
+ }
39
+ function pushFinding(findings, finding) {
40
+ findings.push(finding);
41
+ }
42
+ function floorDiagnostic(event, floor) {
43
+ return {
44
+ phase: event.floorPhase ?? floor?.floorPhase,
45
+ floorOwner: event.floorOwner ?? floor?.floorOwner,
46
+ speechDecision: event.speechDecision,
47
+ decisionReason: event.decisionReason ?? floor?.decisionReason,
48
+ responseId: event.type === "speech.policy.decision" || event.type === "response.requested"
49
+ ? event.correlationId
50
+ : undefined,
51
+ toolCallId: event.type === "tool.result.ready" || event.type === "tool.result.spoken"
52
+ ? event.correlationId
53
+ : undefined,
54
+ pendingSpeechId: event.pendingSpeechId ?? floor?.pendingSpeechId,
55
+ activeAssistantSpeechId: event.activeAssistantSpeechId ?? floor?.activeAssistantSpeechId,
56
+ pendingToolCallIds: event.pendingToolCallIds ?? floor?.pendingToolCallIds,
57
+ staleToolCallIds: event.staleToolCallIds ?? floor?.staleToolCallIds,
58
+ interruptionTurnId: event.interruptionTurnId ?? floor?.interruptionTurnId,
59
+ };
60
+ }
61
+ function gradeFirstAudio(events, expectation, findings) {
62
+ const connected = firstEvent(events, "call.connected");
63
+ const firstAudio = firstEvent(events, "assistant.audio.started");
64
+ if (!connected || !firstAudio) {
65
+ pushFinding(findings, {
66
+ code: "first_audio_missing",
67
+ severity: "fail",
68
+ message: "Voice call did not produce assistant audio after connect.",
69
+ source: connected?.source ?? firstAudio?.source,
70
+ atMs: connected?.atMs ?? firstAudio?.atMs,
71
+ });
72
+ return undefined;
73
+ }
74
+ const ttfaMs = firstAudio.atMs - connected.atMs;
75
+ if (ttfaMs > expectation.maxFirstAssistantAudioMs) {
76
+ pushFinding(findings, {
77
+ code: "first_audio_late",
78
+ severity: "fail",
79
+ message: `First assistant audio started after ${ttfaMs}ms, over the ${expectation.maxFirstAssistantAudioMs}ms budget.`,
80
+ source: firstAudio.source,
81
+ atMs: firstAudio.atMs,
82
+ });
83
+ }
84
+ return ttfaMs;
85
+ }
86
+ function gradeFirstUserResponse(events, expectation, findings) {
87
+ const userTranscript = firstEvent(events, "user.transcript.done");
88
+ if (!userTranscript)
89
+ return undefined;
90
+ const response = events.find((event) => event.type === "response.requested"
91
+ && event.atMs >= userTranscript.atMs
92
+ && (!userTranscript.correlationId || event.correlationId === userTranscript.correlationId));
93
+ if (!response) {
94
+ pushFinding(findings, {
95
+ code: "user_response_missing",
96
+ severity: "fail",
97
+ message: "No voice response was requested after the caller transcript completed.",
98
+ source: userTranscript.source,
99
+ atMs: userTranscript.atMs,
100
+ });
101
+ return undefined;
102
+ }
103
+ const latencyMs = response.atMs - userTranscript.atMs;
104
+ if (latencyMs > expectation.maxUserTurnResponseMs) {
105
+ pushFinding(findings, {
106
+ code: "user_response_late",
107
+ severity: "fail",
108
+ message: `Voice response was requested after ${latencyMs}ms, over the ${expectation.maxUserTurnResponseMs}ms budget.`,
109
+ source: response.source,
110
+ atMs: response.atMs,
111
+ });
112
+ }
113
+ return latencyMs;
114
+ }
115
+ function gradeToolPresence(events, expectation, findings) {
116
+ const toolCall = firstEvent(events, "tool.call.started");
117
+ if (!toolCall)
118
+ return undefined;
119
+ const holding = events.find((event) => event.type === "tool.holding.started"
120
+ && event.atMs >= toolCall.atMs
121
+ && (!toolCall.correlationId || event.correlationId === toolCall.correlationId));
122
+ if (!holding) {
123
+ pushFinding(findings, {
124
+ code: "tool_presence_missing",
125
+ severity: "fail",
126
+ message: "Tool call did not produce a short voice holding phrase.",
127
+ source: toolCall.source,
128
+ atMs: toolCall.atMs,
129
+ });
130
+ return undefined;
131
+ }
132
+ const latencyMs = holding.atMs - toolCall.atMs;
133
+ if (latencyMs > expectation.maxToolPresenceMs) {
134
+ pushFinding(findings, {
135
+ code: "tool_presence_late",
136
+ severity: "fail",
137
+ message: `Tool holding phrase started after ${latencyMs}ms, over the ${expectation.maxToolPresenceMs}ms budget.`,
138
+ source: holding.source,
139
+ atMs: holding.atMs,
140
+ });
141
+ }
142
+ return latencyMs;
143
+ }
144
+ function gradeBargeIn(events, expectation, findings) {
145
+ const bargeIn = firstEvent(events, "barge_in.detected");
146
+ if (!bargeIn)
147
+ return {};
148
+ const clear = events.find((event) => event.type === "transport.playback_cleared" && event.atMs >= bargeIn.atMs);
149
+ const truncate = events.find((event) => event.type === "response.truncated" && event.atMs >= bargeIn.atMs);
150
+ const metrics = {};
151
+ if (!clear) {
152
+ pushFinding(findings, {
153
+ code: "barge_in_clear_missing",
154
+ severity: "fail",
155
+ message: "Caller barge-in did not clear transport playback.",
156
+ source: bargeIn.source,
157
+ atMs: bargeIn.atMs,
158
+ });
159
+ }
160
+ else {
161
+ metrics.firstBargeInClearMs = clear.atMs - bargeIn.atMs;
162
+ if (metrics.firstBargeInClearMs > expectation.maxBargeInClearMs) {
163
+ pushFinding(findings, {
164
+ code: "barge_in_clear_late",
165
+ severity: "fail",
166
+ message: `Barge-in playback clear took ${metrics.firstBargeInClearMs}ms, over the ${expectation.maxBargeInClearMs}ms budget.`,
167
+ source: clear.source,
168
+ atMs: clear.atMs,
169
+ });
170
+ }
171
+ }
172
+ if (!truncate) {
173
+ pushFinding(findings, {
174
+ code: "barge_in_truncate_missing",
175
+ severity: "fail",
176
+ message: "Caller barge-in did not truncate the active Realtime response.",
177
+ source: bargeIn.source,
178
+ atMs: bargeIn.atMs,
179
+ });
180
+ }
181
+ else {
182
+ metrics.firstBargeInTruncateMs = truncate.atMs - bargeIn.atMs;
183
+ if (metrics.firstBargeInTruncateMs > expectation.maxBargeInTruncateMs) {
184
+ pushFinding(findings, {
185
+ code: "barge_in_truncate_late",
186
+ severity: "fail",
187
+ message: `Barge-in response truncation took ${metrics.firstBargeInTruncateMs}ms, over the ${expectation.maxBargeInTruncateMs}ms budget.`,
188
+ source: truncate.source,
189
+ atMs: truncate.atMs,
190
+ });
191
+ }
192
+ }
193
+ return metrics;
194
+ }
195
+ function gradeManualFloorControl(events, findings) {
196
+ const session = allEvents(events, "session.updated").find((event) => event.session?.turnDetection);
197
+ if (session?.session?.turnDetection?.createResponse === false
198
+ && session.session.turnDetection.interruptResponse === false) {
199
+ return;
200
+ }
201
+ pushFinding(findings, {
202
+ code: "manual_floor_control_missing",
203
+ severity: "fail",
204
+ message: "Realtime session did not disable provider auto-response and provider interruption.",
205
+ source: session?.source,
206
+ atMs: session?.atMs,
207
+ });
208
+ }
209
+ function gradeFriendContext(events, requirement, findings) {
210
+ const context = firstEvent(events, "voice.context.injected");
211
+ if (context?.friendId === requirement.friendId
212
+ && context.sessionKey === requirement.sessionKey
213
+ && lowerText(context.text).includes(requirement.marker.toLowerCase())) {
214
+ return;
215
+ }
216
+ pushFinding(findings, {
217
+ code: "friend_context_mismatch",
218
+ severity: "fail",
219
+ message: "Voice context did not preserve the expected friend identity, trust marker, and stable session key.",
220
+ source: context?.source,
221
+ atMs: context?.atMs,
222
+ });
223
+ }
224
+ function gradeTranscripts(events, requirements, findings) {
225
+ for (const requirement of requirements) {
226
+ const type = requirement.role === "assistant"
227
+ ? "assistant.transcript.done"
228
+ : "user.transcript.done";
229
+ const found = allEvents(events, type).some((event) => lowerText(event.text).includes(requirement.contains.toLowerCase()));
230
+ if (!found) {
231
+ pushFinding(findings, {
232
+ code: "transcript_missing",
233
+ severity: "fail",
234
+ message: `Missing ${requirement.role} transcript containing "${requirement.contains}".`,
235
+ });
236
+ }
237
+ }
238
+ }
239
+ function gradeHangup(events, findings) {
240
+ const hangup = firstEvent(events, "call.hangup.requested");
241
+ if (hangup)
242
+ return;
243
+ const ended = firstEvent(events, "call.ended");
244
+ pushFinding(findings, {
245
+ code: "hangup_missing",
246
+ severity: "fail",
247
+ message: "Voice eval expected an agent-controlled hangup request before call end.",
248
+ source: ended?.source,
249
+ atMs: ended?.atMs,
250
+ });
251
+ }
252
+ function gradeOverlappingResponses(events, findings) {
253
+ for (const response of allEvents(events, "response.requested")) {
254
+ const activeAudio = allEvents(events, "assistant.audio.started").find((started) => {
255
+ const done = events.find((event) => {
256
+ if (event.atMs < started.atMs)
257
+ return false;
258
+ if (event.type === "response.truncated" || event.type === "call.hangup.requested")
259
+ return true;
260
+ if (event.type !== "assistant.audio.done" && event.type !== "assistant.transcript.done")
261
+ return false;
262
+ return !started.correlationId || !event.correlationId || event.correlationId === started.correlationId;
263
+ });
264
+ return response.atMs > started.atMs && (!done || response.atMs < done.atMs);
265
+ });
266
+ if (activeAudio) {
267
+ pushFinding(findings, {
268
+ code: "response_overlap",
269
+ severity: "fail",
270
+ message: "Voice response was requested while assistant audio was still active.",
271
+ source: response.source,
272
+ atMs: response.atMs,
273
+ });
274
+ return;
275
+ }
276
+ }
277
+ }
278
+ function floorIsCallerOwned(floor) {
279
+ return floor?.floorOwner === "caller" || floor?.floorPhase === "caller-speaking" || floor?.floorPhase === "interrupted";
280
+ }
281
+ function floorIsTerminal(floor) {
282
+ return floor?.floorOwner === "terminal" || floor?.floorPhase === "hangup" || floor?.floorPhase === "ended";
283
+ }
284
+ function gradeDuplexFloorPolicy(events, findings) {
285
+ let floor;
286
+ let hangupAtMs;
287
+ for (const event of events) {
288
+ if (event.type === "floor.state.changed") {
289
+ floor = event;
290
+ continue;
291
+ }
292
+ if (event.type === "call.hangup.requested")
293
+ hangupAtMs = event.atMs;
294
+ if (event.type === "speech.policy.decision" && event.speechDecision === "allow") {
295
+ if (floorIsCallerOwned(floor)) {
296
+ pushFinding(findings, {
297
+ code: "speech_allowed_while_caller_has_floor",
298
+ severity: "fail",
299
+ message: "Voice speech policy allowed assistant speech while the caller owned the floor.",
300
+ source: event.source,
301
+ atMs: event.atMs,
302
+ floor: floorDiagnostic(event, floor),
303
+ });
304
+ }
305
+ else if (floorIsTerminal(floor) || hangupAtMs !== undefined) {
306
+ pushFinding(findings, {
307
+ code: "speech_allowed_after_hangup",
308
+ severity: "fail",
309
+ message: "Voice speech policy allowed assistant speech after hangup began.",
310
+ source: event.source,
311
+ atMs: event.atMs,
312
+ floor: floorDiagnostic(event, floor),
313
+ });
314
+ }
315
+ }
316
+ if (event.type === "tool.result.spoken") {
317
+ const diagnostic = floorDiagnostic(event, floor);
318
+ if (event.correlationId && floor?.staleToolCallIds?.includes(event.correlationId)) {
319
+ pushFinding(findings, {
320
+ code: "stale_tool_result_spoken",
321
+ severity: "fail",
322
+ message: "Voice spoke a tool result that the floor model had already marked stale.",
323
+ source: event.source,
324
+ atMs: event.atMs,
325
+ floor: diagnostic,
326
+ });
327
+ }
328
+ else if (floorIsCallerOwned(floor)) {
329
+ pushFinding(findings, {
330
+ code: "tool_result_spoken_while_caller_has_floor",
331
+ severity: "fail",
332
+ message: "Voice spoke a tool result while the caller owned the floor.",
333
+ source: event.source,
334
+ atMs: event.atMs,
335
+ floor: diagnostic,
336
+ });
337
+ }
338
+ else if (floorIsTerminal(floor) || hangupAtMs !== undefined) {
339
+ pushFinding(findings, {
340
+ code: "tool_result_spoken_after_hangup",
341
+ severity: "fail",
342
+ message: "Voice spoke a tool result after hangup began.",
343
+ source: event.source,
344
+ atMs: event.atMs,
345
+ floor: diagnostic,
346
+ });
347
+ }
348
+ }
349
+ if (event.type === "response.requested" && hangupAtMs !== undefined && event.atMs > hangupAtMs) {
350
+ pushFinding(findings, {
351
+ code: "response_after_hangup",
352
+ severity: "fail",
353
+ message: "Voice requested a new response after hangup had already been requested.",
354
+ source: event.source,
355
+ atMs: event.atMs,
356
+ floor: floorDiagnostic(event, floor),
357
+ });
358
+ }
359
+ }
360
+ }
361
+ function collectTransportSources(events) {
362
+ return [...new Set(events.flatMap((event) => event.source ? [event.source.transport] : []))].sort();
363
+ }
364
+ function gradeVoiceRealtimeEvalTimeline(scenarioId, timeline, expectation) {
365
+ const normalizedScenarioId = validateTimeline(scenarioId, timeline, expectation);
366
+ const events = sortedEvents(timeline);
367
+ (0, runtime_1.emitNervesEvent)({
368
+ component: "senses",
369
+ event: "senses.voice_realtime_eval_start",
370
+ message: "starting Voice realtime eval timeline grading",
371
+ meta: { scenarioId: normalizedScenarioId, events: events.length },
372
+ });
373
+ const findings = [];
374
+ const metrics = {
375
+ ttfaMs: gradeFirstAudio(events, expectation, findings),
376
+ firstUserResponseMs: gradeFirstUserResponse(events, expectation, findings),
377
+ firstToolPresenceMs: gradeToolPresence(events, expectation, findings),
378
+ ...gradeBargeIn(events, expectation, findings),
379
+ };
380
+ if (expectation.requireManualFloorControl)
381
+ gradeManualFloorControl(events, findings);
382
+ if (expectation.requireFriendContext)
383
+ gradeFriendContext(events, expectation.requireFriendContext, findings);
384
+ if (expectation.requiredTranscripts)
385
+ gradeTranscripts(events, expectation.requiredTranscripts, findings);
386
+ if (expectation.requireHangup)
387
+ gradeHangup(events, findings);
388
+ gradeOverlappingResponses(events, findings);
389
+ gradeDuplexFloorPolicy(events, findings);
390
+ const report = {
391
+ scenarioId: normalizedScenarioId,
392
+ passed: findings.every((finding) => finding.severity !== "fail"),
393
+ findings,
394
+ metrics,
395
+ transportSources: collectTransportSources(events),
396
+ };
397
+ (0, runtime_1.emitNervesEvent)({
398
+ component: "senses",
399
+ event: "senses.voice_realtime_eval_end",
400
+ message: "finished Voice realtime eval timeline grading",
401
+ meta: { scenarioId: normalizedScenarioId, passed: report.passed, findings: findings.length },
402
+ });
403
+ return report;
404
+ }
405
+ function buildVoiceRealtimeEvalHappyPath() {
406
+ return [
407
+ { type: "call.connected", atMs: 0, source: { transport: "openai-sip", id: "sip-call-1" } },
408
+ {
409
+ type: "voice.context.injected",
410
+ atMs: 80,
411
+ friendId: "friend-ari",
412
+ sessionKey: "twilio-phone-friend-ari-via-ouro",
413
+ text: "Resolved voice friend: Ari (friendId=friend-ari, trust=family).",
414
+ source: { transport: "voice-eval" },
415
+ },
416
+ {
417
+ type: "session.updated",
418
+ atMs: 100,
419
+ session: { turnDetection: { createResponse: false, interruptResponse: false } },
420
+ source: { transport: "openai-realtime-control", id: "ws-1" },
421
+ },
422
+ { type: "response.requested", atMs: 120, correlationId: "greeting", source: { transport: "openai-realtime-control", id: "ws-1" } },
423
+ { type: "assistant.audio.started", atMs: 720, correlationId: "greeting", source: { transport: "openai-sip", id: "sip-call-1" } },
424
+ { type: "assistant.audio.done", atMs: 1_820, correlationId: "greeting", source: { transport: "openai-sip", id: "sip-call-1" } },
425
+ {
426
+ type: "assistant.transcript.done",
427
+ atMs: 1_840,
428
+ correlationId: "greeting",
429
+ text: "Hey Ari, I am checking the weather now.",
430
+ source: { transport: "openai-realtime-control", id: "ws-1" },
431
+ },
432
+ {
433
+ type: "user.transcript.done",
434
+ atMs: 2_200,
435
+ correlationId: "user-1",
436
+ text: "Can you check the weather and then hang up?",
437
+ source: { transport: "twilio-media-stream", id: "stream-1" },
438
+ },
439
+ { type: "response.requested", atMs: 2_480, correlationId: "user-1", source: { transport: "openai-realtime-control", id: "ws-1" } },
440
+ { type: "assistant.audio.started", atMs: 2_540, correlationId: "user-1", source: { transport: "openai-sip", id: "sip-call-1" } },
441
+ { type: "assistant.audio.done", atMs: 2_820, correlationId: "user-1", source: { transport: "openai-sip", id: "sip-call-1" } },
442
+ { type: "tool.call.started", atMs: 3_000, correlationId: "tool-1", toolName: "weather_lookup", source: { transport: "openai-realtime-control", id: "ws-1" } },
443
+ { type: "tool.holding.started", atMs: 3_260, correlationId: "tool-1", text: "One sec, checking.", source: { transport: "openai-sip", id: "sip-call-1" } },
444
+ { type: "tool.call.completed", atMs: 3_800, correlationId: "tool-1", toolName: "weather_lookup", source: { transport: "openai-realtime-control", id: "ws-1" } },
445
+ { type: "barge_in.detected", atMs: 4_100, source: { transport: "twilio-media-stream", id: "stream-1" } },
446
+ { type: "transport.playback_cleared", atMs: 4_140, source: { transport: "twilio-media-stream", id: "stream-1" } },
447
+ { type: "response.truncated", atMs: 4_170, source: { transport: "openai-realtime-control", id: "ws-1" } },
448
+ { type: "call.hangup.requested", atMs: 5_000, source: { transport: "openai-realtime-control", id: "ws-1" } },
449
+ { type: "call.ended", atMs: 5_100, source: { transport: "openai-sip", id: "sip-call-1" } },
450
+ ];
451
+ }
452
+ function buildVoiceRealtimeEvalDefaultExpectation() {
453
+ return {
454
+ maxFirstAssistantAudioMs: 1_200,
455
+ maxUserTurnResponseMs: 900,
456
+ maxToolPresenceMs: 600,
457
+ maxBargeInClearMs: 120,
458
+ maxBargeInTruncateMs: 180,
459
+ requireManualFloorControl: true,
460
+ requireFriendContext: {
461
+ friendId: "friend-ari",
462
+ sessionKey: "twilio-phone-friend-ari-via-ouro",
463
+ marker: "trust=family",
464
+ },
465
+ requireHangup: true,
466
+ requiredTranscripts: [
467
+ { role: "user", contains: "weather" },
468
+ { role: "assistant", contains: "checking the weather" },
469
+ ],
470
+ };
471
+ }
472
+ function buildKnownBadLatencyPath() {
473
+ return buildVoiceRealtimeEvalHappyPath().map((event) => {
474
+ if (event.type === "assistant.audio.started" && event.correlationId === "greeting")
475
+ return { ...event, atMs: 1_900 };
476
+ if (event.type === "response.requested" && event.correlationId === "user-1")
477
+ return { ...event, atMs: 3_500 };
478
+ return event;
479
+ });
480
+ }
481
+ function runBuiltInVoiceRealtimeEvalSuite() {
482
+ const expectation = buildVoiceRealtimeEvalDefaultExpectation();
483
+ return [
484
+ gradeVoiceRealtimeEvalTimeline("voice-happy-path", buildVoiceRealtimeEvalHappyPath(), expectation),
485
+ gradeVoiceRealtimeEvalTimeline("voice-known-bad-latency", buildKnownBadLatencyPath(), expectation),
486
+ ];
487
+ }
488
+ function summarizeVoiceRealtimeEvalSuite(reports) {
489
+ const failedScenarioIds = reports.filter((report) => !report.passed).map((report) => report.scenarioId);
490
+ return {
491
+ passed: reports.length - failedScenarioIds.length,
492
+ failed: failedScenarioIds.length,
493
+ total: reports.length,
494
+ failedScenarioIds,
495
+ };
496
+ }