@alexkroman1/aai-cli 16.0.1 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/README.md +3 -2
  2. package/dist/{_build-target-55dJisQ-.mjs → _build-target-C08aM-Es.mjs} +511 -41
  3. package/dist/_build-target.d.ts +109 -2
  4. package/dist/_deno-target.d.ts +15 -14
  5. package/dist/_dev-env.d.ts +19 -13
  6. package/dist/{_dev-server-BzWB6-4y.mjs → _dev-server-CLU9xjH5.mjs} +27 -19
  7. package/dist/_dev-server.d.ts +4 -3
  8. package/dist/_dev-vite-config.d.ts +1 -1
  9. package/dist/_init.d.ts +39 -0
  10. package/dist/_modal-target.d.ts +11 -6
  11. package/dist/_preflight-CnW9QiE7.mjs +116 -0
  12. package/dist/_preflight.d.ts +110 -5
  13. package/dist/{_server-common-De0haHr9.mjs → _server-common-DAcv1nC5.mjs} +46 -2
  14. package/dist/_server-common.d.ts +39 -0
  15. package/dist/_target-bundle.d.ts +112 -0
  16. package/dist/_target-entry.d.ts +81 -0
  17. package/dist/{_templates-CuP74F8D.mjs → _templates-IMeKMVIj.mjs} +1 -1
  18. package/dist/{_vitest-runner-AVR9VtXh.mjs → _vitest-runner-CZNGj0ZC.mjs} +22 -17
  19. package/dist/_vitest-runner.d.ts +36 -24
  20. package/dist/{_workflow-determinism-CvpqMpdh.mjs → _workflow-determinism-CLxFQ5ox.mjs} +1 -1
  21. package/dist/_workflow-determinism.d.ts +1 -1
  22. package/dist/{build-ButI2IKc.mjs → build-DrQTSc2R.mjs} +187 -289
  23. package/dist/build.d.ts +88 -2
  24. package/dist/cli.mjs +20 -16
  25. package/dist/{deploy-CGqPU5U-.mjs → deploy-B68-x7xM.mjs} +14 -6
  26. package/dist/deploy.d.ts +9 -0
  27. package/dist/{dev-kodAY23K.mjs → dev-ChsrNHpK.mjs} +1 -1
  28. package/dist/dev.d.ts +1 -1
  29. package/dist/{eval-DvoSz7SZ.mjs → eval-DB07kTxO.mjs} +2 -2
  30. package/dist/init-W-4k-lCF.mjs +559 -0
  31. package/dist/init.d.ts +43 -3
  32. package/dist/scaffold/CLAUDE.md +87 -100
  33. package/dist/scaffold/package.json +6 -6
  34. package/dist/scaffold/vite.config.ts +29 -1
  35. package/dist/start.mjs +1 -1
  36. package/dist/{studio-CtRBVVFR.mjs → studio-DEAJGBXa.mjs} +20 -10
  37. package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.eval.test.ts +20 -6
  38. package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.ts +28 -0
  39. package/dist/templates/{hiring-desk → applicant-screening-agent}/crews.ts +1 -1
  40. package/dist/templates/{hiring-desk → applicant-screening-agent}/shared.ts +11 -11
  41. package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screening_status.ts +1 -1
  42. package/dist/templates/{call-audit → call-audit-workflow}/agent.ts +4 -2
  43. package/dist/templates/{call-audit → call-audit-workflow}/client.tsx +3 -3
  44. package/dist/templates/{call-audit → call-audit-workflow}/guards.test.ts +2 -2
  45. package/dist/templates/{call-audit → call-audit-workflow}/workflows/summarize.ts +1 -1
  46. package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.eval.test.ts +3 -2
  47. package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.test.ts +1 -1
  48. package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.ts +1 -0
  49. package/dist/templates/coding-agent/agent.eval.test.ts +136 -0
  50. package/dist/templates/coding-agent/agent.test.ts +109 -0
  51. package/dist/templates/coding-agent/agent.ts +45 -0
  52. package/dist/templates/coding-agent/chat.ts +63 -0
  53. package/dist/templates/coding-agent/shared.ts +46 -0
  54. package/dist/templates/coding-agent/system-prompt.md +32 -0
  55. package/dist/templates/coding-agent/tools/bash.ts +6 -0
  56. package/dist/templates/coding-agent/tools/delete_file.ts +6 -0
  57. package/dist/templates/coding-agent/tools/edit_file.ts +6 -0
  58. package/dist/templates/coding-agent/tools/glob.ts +6 -0
  59. package/dist/templates/coding-agent/tools/grep.ts +6 -0
  60. package/dist/templates/coding-agent/tools/list_files.ts +6 -0
  61. package/dist/templates/coding-agent/tools/read_file.ts +6 -0
  62. package/dist/templates/coding-agent/tools/todo_write.ts +6 -0
  63. package/dist/templates/coding-agent/tools/write_file.ts +6 -0
  64. package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.test.ts +2 -2
  65. package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.ts +2 -1
  66. package/dist/templates/{pipeline-simple → custom-pipeline-agent}/modes.test.ts +1 -1
  67. package/dist/templates/{redline → document-redline-workflow}/agent.ts +4 -2
  68. package/dist/templates/{redline → document-redline-workflow}/client.tsx +1 -1
  69. package/dist/templates/{redline → document-redline-workflow}/workflows/redline.ts +1 -1
  70. package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.test.ts +104 -1
  71. package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.ts +15 -0
  72. package/dist/templates/{dispatch-center → emergency-dispatch-agent}/events.ts +1 -1
  73. package/dist/templates/emergency-dispatch-agent/guardrails.ts +105 -0
  74. package/dist/templates/{dispatch-center → emergency-dispatch-agent}/system-prompt.md +1 -0
  75. package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_create.ts +1 -1
  76. package/dist/templates/{night-owl → entertainment-picks-agent}/agent.eval.test.ts +8 -1
  77. package/dist/templates/{night-owl → entertainment-picks-agent}/agent.test.ts +1 -1
  78. package/dist/templates/{night-owl → entertainment-picks-agent}/agent.ts +1 -0
  79. package/dist/templates/{night-owl → entertainment-picks-agent}/client.tsx +1 -1
  80. package/dist/templates/{night-owl → entertainment-picks-agent}/system-prompt.md +6 -0
  81. package/dist/templates/{night-owl → entertainment-picks-agent}/tools/revisit.ts +7 -0
  82. package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.eval.test.ts +84 -23
  83. package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.ts +1 -0
  84. package/dist/templates/{executive-assistant → executive-inbox-agent}/meeting.ts +2 -2
  85. package/dist/templates/{executive-assistant → executive-inbox-agent}/prompts.ts +3 -1
  86. package/dist/templates/{executive-assistant → executive-inbox-agent}/shared.ts +2 -2
  87. package/dist/templates/{executive-assistant → executive-inbox-agent}/system-prompt.md +3 -3
  88. package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/meeting_assistant.ts +3 -3
  89. package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/open_email.ts +8 -16
  90. package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/send_calendar_invite.ts +1 -1
  91. package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.eval.test.ts +85 -21
  92. package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.test.ts +2 -1
  93. package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.ts +6 -3
  94. package/dist/templates/{hotel-desk → hotel-reception-agent}/client.tsx +14 -2
  95. package/dist/templates/{hotel-desk → hotel-reception-agent}/concierge.ts +3 -2
  96. package/dist/templates/{hotel-desk → hotel-reception-agent}/desk-seams.test.ts +2 -1
  97. package/dist/templates/{hotel-desk → hotel-reception-agent}/disputes.ts +9 -11
  98. package/dist/templates/{hotel-desk → hotel-reception-agent}/events.ts +2 -1
  99. package/dist/templates/hotel-reception-agent/session.ts +56 -0
  100. package/dist/templates/{hotel-desk → hotel-reception-agent}/shared.ts +21 -22
  101. package/dist/templates/{hotel-desk → hotel-reception-agent}/system-prompt.md +1 -1
  102. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/abandon_booking.ts +2 -1
  103. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/add_to_waitlist.ts +2 -1
  104. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_airport_car.ts +2 -1
  105. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_restaurant_reservation.ts +2 -1
  106. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_room_booking.ts +2 -1
  107. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_restaurant_availability.ts +1 -1
  108. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_room_availability.ts +1 -1
  109. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/choose_room.ts +1 -1
  110. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/confirm_booking.ts +2 -1
  111. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispatch_emergency.ts +2 -1
  112. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispute_charge.ts +2 -1
  113. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/flag_late_arrival.ts +2 -1
  114. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_booking.ts +2 -1
  115. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_guest_history.ts +1 -1
  116. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_invoice.ts +2 -1
  117. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_restaurant_reservation.ts +1 -1
  118. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/modify_restaurant_reservation.ts +1 -1
  119. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_card.ts +1 -1
  120. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_followup.ts +2 -1
  121. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_group_inquiry.ts +2 -1
  122. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_guest_details.ts +1 -1
  123. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reinstate_booking.ts +1 -1
  124. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/request_flight_reconfirmation.ts +2 -1
  125. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resend_confirmation.ts +2 -1
  126. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reserve_table.ts +1 -1
  127. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resolve_room_conflict.ts +2 -1
  128. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/schedule_wakeup_call.ts +2 -1
  129. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_do_not_disturb.ts +2 -1
  130. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_extras.ts +1 -1
  131. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_stay.ts +2 -1
  132. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_booking_modification.ts +2 -1
  133. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_room_booking.ts +2 -1
  134. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/take_guest_message.ts +2 -1
  135. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/transfer_call.ts +2 -1
  136. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/update_card.ts +2 -1
  137. package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/verify_booking.ts +2 -1
  138. package/dist/templates/{link-digest → link-digest-workflow}/agent.eval.test.ts +16 -1
  139. package/dist/templates/{link-digest → link-digest-workflow}/agent.test.ts +2 -2
  140. package/dist/templates/{link-digest → link-digest-workflow}/agent.ts +8 -3
  141. package/dist/templates/{link-digest → link-digest-workflow}/client.tsx +2 -2
  142. package/dist/templates/{link-digest → link-digest-workflow}/workflows/digest.ts +1 -1
  143. package/dist/templates/{health-assistant → medication-safety-agent}/agent.test.ts +55 -1
  144. package/dist/templates/medication-safety-agent/agent.ts +62 -0
  145. package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.test.ts +4 -4
  146. package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.ts +5 -1
  147. package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/recap.ts +3 -3
  148. package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.ts +3 -0
  149. package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.eval.test.ts +1 -1
  150. package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.test.ts +1 -1
  151. package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.ts +6 -2
  152. package/dist/templates/{podcast-digest → podcast-digest-workflow}/client.tsx +3 -3
  153. package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/digest.ts +1 -1
  154. package/dist/templates/{simple → quickstart-agent}/agent.eval.test.ts +39 -3
  155. package/dist/templates/{simple → quickstart-agent}/agent.test.ts +25 -3
  156. package/dist/templates/quickstart-agent/agent.ts +24 -0
  157. package/dist/templates/quickstart-agent/system-prompt.md +8 -0
  158. package/dist/templates/quickstart-agent/tools/get_weather.ts +59 -0
  159. package/dist/templates/{research-workflow → research-handoff-agent}/agent.test.ts +1 -1
  160. package/dist/templates/{research-workflow → research-handoff-agent}/agent.ts +5 -1
  161. package/dist/templates/{research-workflow → research-handoff-agent}/workflows/filing.ts +1 -1
  162. package/dist/templates/{research-workflow → research-handoff-agent}/workflows/research.ts +1 -1
  163. package/dist/templates/{research-workflow → research-handoff-agent}/workflows/review.ts +1 -1
  164. package/dist/templates/{plan-and-execute → research-planner-agent}/agent.eval.test.ts +24 -2
  165. package/dist/templates/{plan-and-execute → research-planner-agent}/agent.ts +3 -0
  166. package/dist/templates/{plan-and-execute → research-planner-agent}/shared.ts +1 -1
  167. package/dist/templates/{plan-and-execute → research-planner-agent}/system-prompt.md +1 -1
  168. package/dist/templates/{retail → retail-orders-agent}/agent.ts +32 -3
  169. package/dist/templates/retail-orders-agent/keyterms.ts +154 -0
  170. package/dist/templates/{retail → retail-orders-agent}/pending.ts +2 -2
  171. package/dist/templates/{retail → retail-orders-agent}/resolve.ts +18 -3
  172. package/dist/templates/{retail → retail-orders-agent}/shared.ts +1 -1
  173. package/dist/templates/{retail → retail-orders-agent}/store.ts +3 -3
  174. package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.eval.test.ts +37 -5
  175. package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.test.ts +38 -6
  176. package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.ts +5 -1
  177. package/dist/templates/{roadside-assist → roadside-assistance-agent}/call.ts +1 -1
  178. package/dist/templates/{roadside-assist → roadside-assistance-agent}/shared.ts +15 -3
  179. package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/acknowledge_disclosure.ts +14 -0
  180. package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/dispatch_truck.ts +1 -1
  181. package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/lookup_coverage.ts +11 -0
  182. package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/service_disclosure.ts +17 -11
  183. package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.test.ts +4 -0
  184. package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.test.ts +1 -1
  185. package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.ts +5 -1
  186. package/dist/templates/{spoken-summary → spoken-summary-workflow}/client.tsx +1 -1
  187. package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/summarize.ts +1 -1
  188. package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.eval.test.ts +6 -0
  189. package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.test.ts +125 -1
  190. package/dist/templates/tabletop-rpg-agent/agent.ts +58 -0
  191. package/dist/templates/{solo-rpg → tabletop-rpg-agent}/shared.ts +84 -3
  192. package/dist/templates/{solo-rpg → tabletop-rpg-agent}/system-prompt.md +1 -1
  193. package/dist/templates/tabletop-rpg-agent/tools/check_state.ts +37 -0
  194. package/dist/templates/{support-line → technical-support-agent}/agent.test.ts +3 -3
  195. package/dist/templates/{support-line → technical-support-agent}/agent.ts +5 -1
  196. package/dist/templates/technical-support-agent/knowledge.ts +165 -0
  197. package/dist/templates/{support-line → technical-support-agent}/nodes.ts +3 -2
  198. package/dist/templates/{support-line → technical-support-agent}/procedure.ts +4 -3
  199. package/dist/templates/technical-support-agent/shared.ts +145 -0
  200. package/dist/templates/{support-line → technical-support-agent}/tools/list_topics.ts +2 -1
  201. package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.eval.test.ts +39 -6
  202. package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.test.ts +79 -1
  203. package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.ts +30 -1
  204. package/dist/templates/{infocom-adventure → text-adventure-agent}/client.tsx +2 -2
  205. package/dist/templates/{infocom-adventure → text-adventure-agent}/shared.ts +37 -0
  206. package/dist/templates/{infocom-adventure → text-adventure-agent}/system-prompt.md +9 -2
  207. package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.eval.test.ts +21 -7
  208. package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.test.ts +23 -11
  209. package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.ts +5 -2
  210. package/dist/templates/{briefing-desk → topic-briefing-agent}/shared.ts +11 -11
  211. package/dist/templates/{briefing-desk → topic-briefing-agent}/slack.ts +1 -1
  212. package/dist/templates/{briefing-desk → topic-briefing-agent}/system-prompt.md +13 -8
  213. package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/send_briefing.ts +43 -5
  214. package/dist/templates/transcription-workflow/agent.test.ts +1 -1
  215. package/dist/templates/transcription-workflow/agent.ts +4 -1
  216. package/dist/templates/transcription-workflow/client.tsx +1 -1
  217. package/dist/templates/transcription-workflow/workflows/batch.ts +2 -2
  218. package/dist/templates/transcription-workflow/workflows/transcribe.ts +1 -1
  219. package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.ts +4 -0
  220. package/dist/templates/{travel-concierge → travel-concierge-agent}/shared.ts +1 -1
  221. package/dist/templates/{web-researcher → web-research-agent}/agent.eval.test.ts +32 -6
  222. package/dist/templates/{web-researcher → web-research-agent}/agent.test.ts +17 -1
  223. package/dist/templates/{web-researcher → web-research-agent}/agent.ts +31 -1
  224. package/dist/templates/{web-researcher → web-research-agent}/system-prompt.md +8 -2
  225. package/dist/templates/{word-wrangler → word-game-agent}/agent.eval.test.ts +79 -18
  226. package/dist/templates/{word-wrangler → word-game-agent}/agent.ts +20 -0
  227. package/dist/templates/{word-wrangler → word-game-agent}/game.ts +1 -1
  228. package/dist/templates/{word-wrangler → word-game-agent}/shared.ts +1 -1
  229. package/dist/test-CjKPQ9_B.mjs +102 -0
  230. package/dist/test.d.ts +37 -12
  231. package/package.json +5 -5
  232. package/dist/_init-BzQbV8Zh.mjs +0 -199
  233. package/dist/_preflight-CcAR577V.mjs +0 -46
  234. package/dist/init-D363Ls5u.mjs +0 -183
  235. package/dist/templates/health-assistant/agent.ts +0 -15
  236. package/dist/templates/simple/agent.ts +0 -8
  237. package/dist/templates/solo-rpg/agent.ts +0 -29
  238. package/dist/templates/solo-rpg/tools/check_state.ts +0 -28
  239. package/dist/templates/support-line/shared.ts +0 -281
  240. package/dist/test-Cllnx81G.mjs +0 -83
  241. /package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.test.ts +0 -0
  242. /package/dist/templates/{hiring-desk → applicant-screening-agent}/client.tsx +0 -0
  243. /package/dist/templates/{hiring-desk → applicant-screening-agent}/leads.json +0 -0
  244. /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.test.ts +0 -0
  245. /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.ts +0 -0
  246. /package/dist/templates/{hiring-desk → applicant-screening-agent}/system-prompt.md +0 -0
  247. /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/candidate_details.ts +0 -0
  248. /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/proceed_to_emails.ts +0 -0
  249. /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/read_email.ts +0 -0
  250. /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/rescore_with_feedback.ts +0 -0
  251. /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screen_candidates.ts +0 -0
  252. /package/dist/templates/{call-audit → call-audit-workflow}/agent.eval.test.ts +0 -0
  253. /package/dist/templates/{call-audit → call-audit-workflow}/agent.test.ts +0 -0
  254. /package/dist/templates/{call-audit → call-audit-workflow}/workflows/audit.ts +0 -0
  255. /package/dist/templates/{call-audit → call-audit-workflow}/workflows/ingest.ts +0 -0
  256. /package/dist/templates/{call-audit → call-audit-workflow}/workflows/media.ts +0 -0
  257. /package/dist/templates/{call-audit → call-audit-workflow}/workflows/sync-api.ts +0 -0
  258. /package/dist/templates/{code-interpreter → code-interpreter-agent}/system-prompt.md +0 -0
  259. /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.eval.test.ts +0 -0
  260. /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/stages.test.ts +0 -0
  261. /package/dist/templates/{redline → document-redline-workflow}/agent.eval.test.ts +0 -0
  262. /package/dist/templates/{redline → document-redline-workflow}/agent.test.ts +0 -0
  263. /package/dist/templates/{redline → document-redline-workflow}/form.ts +0 -0
  264. /package/dist/templates/{redline → document-redline-workflow}/workflows/prompts.ts +0 -0
  265. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.eval.test.ts +0 -0
  266. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/client.tsx +0 -0
  267. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/shared.ts +0 -0
  268. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_add_note.ts +0 -0
  269. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_escalate.ts +0 -0
  270. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_get.ts +0 -0
  271. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_triage.ts +0 -0
  272. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_update_status.ts +0 -0
  273. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_dashboard.ts +0 -0
  274. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_protocols.ts +0 -0
  275. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_run_scenario.ts +0 -0
  276. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_dispatch.ts +0 -0
  277. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_get_available.ts +0 -0
  278. /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_update_status.ts +0 -0
  279. /package/dist/templates/{night-owl → entertainment-picks-agent}/shared.ts +0 -0
  280. /package/dist/templates/{night-owl → entertainment-picks-agent}/tools/recommend.ts +0 -0
  281. /package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.test.ts +0 -0
  282. /package/dist/templates/{executive-assistant → executive-inbox-agent}/calendar.test.ts +0 -0
  283. /package/dist/templates/{executive-assistant → executive-inbox-agent}/client.tsx +0 -0
  284. /package/dist/templates/{executive-assistant → executive-inbox-agent}/inbox.ts +0 -0
  285. /package/dist/templates/{executive-assistant → executive-inbox-agent}/nodes.ts +0 -0
  286. /package/dist/templates/{executive-assistant → executive-inbox-agent}/review.ts +0 -0
  287. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/accept.ts +0 -0
  288. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ask_question.ts +0 -0
  289. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/draft_reply.ts +0 -0
  290. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/edit.ts +0 -0
  291. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ignore.ts +0 -0
  292. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/inbox_status.ts +0 -0
  293. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/new_email.ts +0 -0
  294. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/respond.ts +0 -0
  295. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/review_memory.ts +0 -0
  296. /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/triage_inbox.ts +0 -0
  297. /package/dist/templates/{hotel-desk → hotel-reception-agent}/booking.ts +0 -0
  298. /package/dist/templates/{hotel-desk → hotel-reception-agent}/card.ts +0 -0
  299. /package/dist/templates/{hotel-desk → hotel-reception-agent}/catalogs.ts +0 -0
  300. /package/dist/templates/{hotel-desk → hotel-reception-agent}/desk.ts +0 -0
  301. /package/dist/templates/{hotel-desk → hotel-reception-agent}/hotel.ts +0 -0
  302. /package/dist/templates/{hotel-desk → hotel-reception-agent}/policies.ts +0 -0
  303. /package/dist/templates/{hotel-desk → hotel-reception-agent}/records.ts +0 -0
  304. /package/dist/templates/{hotel-desk → hotel-reception-agent}/restaurant.ts +0 -0
  305. /package/dist/templates/{hotel-desk → hotel-reception-agent}/seed.ts +0 -0
  306. /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_business_center.ts +0 -0
  307. /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_spa_appointment.ts +0 -0
  308. /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_tour.ts +0 -0
  309. /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_policy.ts +0 -0
  310. /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/order_flowers.ts +0 -0
  311. /package/dist/templates/{link-digest → link-digest-workflow}/api-client.ts +0 -0
  312. /package/dist/templates/{health-assistant → medication-safety-agent}/agent.eval.test.ts +0 -0
  313. /package/dist/templates/{health-assistant → medication-safety-agent}/fda.test.ts +0 -0
  314. /package/dist/templates/{health-assistant → medication-safety-agent}/fda.ts +0 -0
  315. /package/dist/templates/{health-assistant → medication-safety-agent}/system-prompt.md +0 -0
  316. /package/dist/templates/{health-assistant → medication-safety-agent}/tools/check_drug_interaction.ts +0 -0
  317. /package/dist/templates/{health-assistant → medication-safety-agent}/tools/medication_lookup.ts +0 -0
  318. /package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.eval.test.ts +0 -0
  319. /package/dist/templates/{recap-workflow → meeting-recap-agent}/shared.ts +0 -0
  320. /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/cancel_recap.ts +0 -0
  321. /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/keep_transcript.ts +0 -0
  322. /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_progress.ts +0 -0
  323. /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_status.ts +0 -0
  324. /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/request_recap.ts +0 -0
  325. /package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/tokens.ts +0 -0
  326. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.eval.test.ts +0 -0
  327. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.test.ts +0 -0
  328. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/client.tsx +0 -0
  329. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/shared.ts +0 -0
  330. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/system-prompt.md +0 -0
  331. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/add_pizza.ts +0 -0
  332. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/place_order.ts +0 -0
  333. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/remove_pizza.ts +0 -0
  334. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/set_customer_name.ts +0 -0
  335. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/update_pizza.ts +0 -0
  336. /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/view_order.ts +0 -0
  337. /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/feeds.ts +0 -0
  338. /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/slack.ts +0 -0
  339. /package/dist/templates/{research-workflow → research-handoff-agent}/agent.eval.test.ts +0 -0
  340. /package/dist/templates/{research-workflow → research-handoff-agent}/shared.ts +0 -0
  341. /package/dist/templates/{research-workflow → research-handoff-agent}/tools/file_it_now.ts +0 -0
  342. /package/dist/templates/{research-workflow → research-handoff-agent}/tools/request_research.ts +0 -0
  343. /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_progress.ts +0 -0
  344. /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_status.ts +0 -0
  345. /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/notes.ts +0 -0
  346. /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/prompts.ts +0 -0
  347. /package/dist/templates/{plan-and-execute → research-planner-agent}/agent.test.ts +0 -0
  348. /package/dist/templates/{plan-and-execute → research-planner-agent}/client.tsx +0 -0
  349. /package/dist/templates/{plan-and-execute → research-planner-agent}/procedure.ts +0 -0
  350. /package/dist/templates/{plan-and-execute → research-planner-agent}/prompts.ts +0 -0
  351. /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/plan_status.ts +0 -0
  352. /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/revise_plan.ts +0 -0
  353. /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/start_plan.ts +0 -0
  354. /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/work_next_step.ts +0 -0
  355. /package/dist/templates/{retail → retail-orders-agent}/address.ts +0 -0
  356. /package/dist/templates/{retail → retail-orders-agent}/agent.eval.test.ts +0 -0
  357. /package/dist/templates/{retail → retail-orders-agent}/agent.test.ts +0 -0
  358. /package/dist/templates/{retail → retail-orders-agent}/authenticate.ts +0 -0
  359. /package/dist/templates/{retail → retail-orders-agent}/cancel.ts +0 -0
  360. /package/dist/templates/{retail → retail-orders-agent}/client.tsx +0 -0
  361. /package/dist/templates/{retail → retail-orders-agent}/payment.ts +0 -0
  362. /package/dist/templates/{retail → retail-orders-agent}/pending.test.ts +0 -0
  363. /package/dist/templates/{retail → retail-orders-agent}/refund.ts +0 -0
  364. /package/dist/templates/{retail → retail-orders-agent}/registry.test.ts +0 -0
  365. /package/dist/templates/{retail → retail-orders-agent}/resolve.test.ts +0 -0
  366. /package/dist/templates/{retail → retail-orders-agent}/returns.ts +0 -0
  367. /package/dist/templates/{retail → retail-orders-agent}/seed.json +0 -0
  368. /package/dist/templates/{retail → retail-orders-agent}/seed.test.ts +0 -0
  369. /package/dist/templates/{retail → retail-orders-agent}/shared.test.ts +0 -0
  370. /package/dist/templates/{retail → retail-orders-agent}/store.test.ts +0 -0
  371. /package/dist/templates/{retail → retail-orders-agent}/swap.test.ts +0 -0
  372. /package/dist/templates/{retail → retail-orders-agent}/swap.ts +0 -0
  373. /package/dist/templates/{retail → retail-orders-agent}/system-prompt.md +0 -0
  374. /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_change.ts +0 -0
  375. /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_pending_order.ts +0 -0
  376. /package/dist/templates/{retail → retail-orders-agent}/tools/confirm_change.ts +0 -0
  377. /package/dist/templates/{retail → retail-orders-agent}/tools/exchange_delivered_order_items.ts +0 -0
  378. /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_email.ts +0 -0
  379. /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_name_zip.ts +0 -0
  380. /package/dist/templates/{retail → retail-orders-agent}/tools/get_item_details.ts +0 -0
  381. /package/dist/templates/{retail → retail-orders-agent}/tools/get_order_details.ts +0 -0
  382. /package/dist/templates/{retail → retail-orders-agent}/tools/get_product_details.ts +0 -0
  383. /package/dist/templates/{retail → retail-orders-agent}/tools/get_user_details.ts +0 -0
  384. /package/dist/templates/{retail → retail-orders-agent}/tools/list_all_product_types.ts +0 -0
  385. /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_address.ts +0 -0
  386. /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_items.ts +0 -0
  387. /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_payment.ts +0 -0
  388. /package/dist/templates/{retail → retail-orders-agent}/tools/modify_user_address.ts +0 -0
  389. /package/dist/templates/{retail → retail-orders-agent}/tools/return_delivered_order_items.ts +0 -0
  390. /package/dist/templates/{retail → retail-orders-agent}/tools/transfer_to_human_agents.ts +0 -0
  391. /package/dist/templates/{roadside-assist → roadside-assistance-agent}/events.ts +0 -0
  392. /package/dist/templates/{roadside-assist → roadside-assistance-agent}/system-prompt.md +0 -0
  393. /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/job_status.ts +0 -0
  394. /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/report_location.ts +0 -0
  395. /package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.ts +0 -0
  396. /package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.eval.test.ts +0 -0
  397. /package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/transcribe.ts +0 -0
  398. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/client.tsx +0 -0
  399. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/action_roll.ts +0 -0
  400. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/burn_momentum.ts +0 -0
  401. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/oracle.ts +0 -0
  402. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/setup_character.ts +0 -0
  403. /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/update_state.ts +0 -0
  404. /package/dist/templates/{support-line → technical-support-agent}/agent.eval.test.ts +0 -0
  405. /package/dist/templates/{support-line → technical-support-agent}/client.tsx +0 -0
  406. /package/dist/templates/{support-line → technical-support-agent}/knowledge.json +0 -0
  407. /package/dist/templates/{support-line → technical-support-agent}/prompts.ts +0 -0
  408. /package/dist/templates/{support-line → technical-support-agent}/system-prompt.md +0 -0
  409. /package/dist/templates/{support-line → technical-support-agent}/tools/answer_question.ts +0 -0
  410. /package/dist/templates/{support-line → technical-support-agent}/tools/log_ticket.ts +0 -0
  411. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_drop.ts +0 -0
  412. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_flag.ts +0 -0
  413. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_get.ts +0 -0
  414. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_move.ts +0 -0
  415. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_restart.ts +0 -0
  416. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_score.ts +0 -0
  417. /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_take.ts +0 -0
  418. /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/briefing_so_far.ts +0 -0
  419. /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/research_topic.ts +0 -0
  420. /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/verify_claim.ts +0 -0
  421. /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.eval.test.ts +0 -0
  422. /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.test.ts +0 -0
  423. /package/dist/templates/{travel-concierge → travel-concierge-agent}/call-events.ts +0 -0
  424. /package/dist/templates/{travel-concierge → travel-concierge-agent}/client.tsx +0 -0
  425. /package/dist/templates/{travel-concierge → travel-concierge-agent}/routing.ts +0 -0
  426. /package/dist/templates/{travel-concierge → travel-concierge-agent}/system-prompt.md +0 -0
  427. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_car_rental.ts +0 -0
  428. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_excursion.ts +0 -0
  429. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_hotel.ts +0 -0
  430. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_action.ts +0 -0
  431. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_ticket.ts +0 -0
  432. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/complete_or_escalate.ts +0 -0
  433. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/confirm_action.ts +0 -0
  434. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/lookup_booking.ts +0 -0
  435. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_car_rentals.ts +0 -0
  436. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_excursions.ts +0 -0
  437. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_flights.ts +0 -0
  438. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_hotels.ts +0 -0
  439. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_car_rental_assistant.ts +0 -0
  440. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_excursion_assistant.ts +0 -0
  441. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_flight_assistant.ts +0 -0
  442. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_hotel_assistant.ts +0 -0
  443. /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/update_ticket.ts +0 -0
  444. /package/dist/templates/{word-wrangler → word-game-agent}/agent.test.ts +0 -0
  445. /package/dist/templates/{word-wrangler → word-game-agent}/client.tsx +0 -0
  446. /package/dist/templates/{word-wrangler → word-game-agent}/guess.ts +0 -0
  447. /package/dist/templates/{word-wrangler → word-game-agent}/player.ts +0 -0
  448. /package/dist/templates/{word-wrangler → word-game-agent}/system-prompt.md +0 -0
  449. /package/dist/templates/{word-wrangler → word-game-agent}/tools/final_score.ts +0 -0
  450. /package/dist/templates/{word-wrangler → word-game-agent}/tools/relay_description.ts +0 -0
  451. /package/dist/templates/{word-wrangler → word-game-agent}/tools/repeat_word.ts +0 -0
  452. /package/dist/templates/{word-wrangler → word-game-agent}/tools/skip_word.ts +0 -0
  453. /package/dist/templates/{word-wrangler → word-game-agent}/tools/start_game.ts +0 -0
  454. /package/dist/templates/{word-wrangler → word-game-agent}/words.ts +0 -0
@@ -0,0 +1,154 @@
1
+ /**
2
+ * What this store's callers say that a general recognizer has no reason to
3
+ * expect — the `keyterms_prompt` this agent opens its STT stream with.
4
+ *
5
+ * A mis-heard entity is this template's worst failure and the one hardest to
6
+ * see: "wireless earbuds" heard as "wireless ear buds" resolves to nothing,
7
+ * "Bluetooth speaker" heard as "blue tooth speaker" resolves to nothing, and
8
+ * the model then tells a caller their own order does not contain an item they
9
+ * are holding. Nothing in the transcript looks wrong.
10
+ *
11
+ * ## Why the list is SHORT, and stays short
12
+ *
13
+ * AssemblyAI's guidance and Vapi's published keyword advice agree on three
14
+ * rules, and all three point the same way:
15
+ *
16
+ * - **Uncommon words and proper nouns only.** "Laptop", "notebook", "grill"
17
+ * and "return" are all in this domain and none of them is here: a general
18
+ * model already recognizes them, and boosting a common word buys false
19
+ * positives on everything that sounds like it.
20
+ * - **The exact spelling and casing you want in the transcript.** These are
21
+ * the strings the model is being asked to produce, so `"USB-C"` and
22
+ * `"usb c"` are different requests — and `resolve.ts`, which matches a
23
+ * spoken item against the account, is matching against whatever comes out.
24
+ * - **Start small.** Over-boosting makes the model hear terms nobody said,
25
+ * which is the same failure pointed the other way. The cap is 100 terms;
26
+ * this is well under it deliberately, and the way to extend it is one term
27
+ * at a time against a transcript that got that term wrong.
28
+ *
29
+ * There are no ORDER IDS here, and there cannot be: they are per account
30
+ * (`#W2378156`), they arrive one call at a time, and a hundred slots would
31
+ * cover a rounding error's worth of them. The mechanisms that carry those are
32
+ * the other two — `agent_context`, refreshed with the agent's own last reply
33
+ * so the recognizer knows an order number was just asked for, and
34
+ * `resolve.ts`'s spoken-identifier matching on the way back.
35
+ */
36
+
37
+ /**
38
+ * Multi-word product names whose halves are ordinary words.
39
+ *
40
+ * This is the shape of term keyterms are actually for: every word in
41
+ * "electric kettle" is common, and the PAIR is what the recognizer splits,
42
+ * mangles, or resolves to a near neighbour.
43
+ */
44
+ const PRODUCTS = [
45
+ "wireless earbuds",
46
+ "mechanical keyboard",
47
+ "espresso machine",
48
+ "electric kettle",
49
+ "smart thermostat",
50
+ "air purifier",
51
+ "portable charger",
52
+ "indoor security camera",
53
+ "vacuum cleaner",
54
+ "patio umbrella",
55
+ "hiking boots",
56
+ "jigsaw puzzle",
57
+ "luggage set",
58
+ "dumbbell set",
59
+ "yoga mat",
60
+ "e-reader",
61
+ "action camera",
62
+ "Bluetooth speaker",
63
+ ] as const;
64
+
65
+ /**
66
+ * The option vocabulary a caller uses to pick a VARIANT.
67
+ *
68
+ * A variant is what an exchange turns on, so mis-hearing one is a wrong
69
+ * `item_id` rather than a wrong word — the same class of failure as a mis-read
70
+ * order number, arriving through the part of the sentence nobody watches.
71
+ */
72
+ const OPTIONS = [
73
+ "stainless steel",
74
+ "matte black",
75
+ "USB-C",
76
+ "OLED",
77
+ "1080p",
78
+ "4K",
79
+ "noise cancelling",
80
+ "tactile switch",
81
+ "linear switch",
82
+ ] as const;
83
+
84
+ /**
85
+ * The words this domain's PROCEDURE is conducted in.
86
+ *
87
+ * Every one of them decides which tool the model reaches for, so a swap
88
+ * between two of them is a wrong action rather than a wrong noun: "exchange"
89
+ * heard as "change" is a different tool, and "gift card" heard as "gift
90
+ * certificate" sends a refund somewhere the account cannot receive it.
91
+ */
92
+ const PROCEDURE = [
93
+ "order number",
94
+ "item number",
95
+ "tracking number",
96
+ "payment method",
97
+ "original payment method",
98
+ "gift card",
99
+ "store credit",
100
+ "PayPal",
101
+ "exchange",
102
+ "modify",
103
+ ] as const;
104
+
105
+ /**
106
+ * The list this agent's `assemblyAIStt({ keyterms })` sends.
107
+ *
108
+ * Assembled from the three groups above rather than written flat, because the
109
+ * REASON a term is here is the only thing that makes the next edit a judgement
110
+ * instead of a guess — a term nobody can place in one of these groups probably
111
+ * should not be added.
112
+ */
113
+ export const RETAIL_KEYTERMS: readonly string[] = [...PRODUCTS, ...OPTIONS, ...PROCEDURE];
114
+
115
+ /**
116
+ * The names on this store's accounts — boosted ONLY while the call is
117
+ * identifying its caller.
118
+ *
119
+ * Per state rather than per session, and the reason is the whole point of a
120
+ * per-phase keyterm list: a personal name is the hardest thing on this call to
121
+ * recognize and the least useful thing to boost afterwards. "Aarav" competes
122
+ * with nothing once the caller is authenticated, and a permanently boosted
123
+ * name list is a permanent source of false positives on every later turn — the
124
+ * over-boosting AssemblyAI's own guidance warns about.
125
+ *
126
+ * Only the UNCOMMON ones are here. "Smith", "Brown" and "Anderson" are in this
127
+ * store's seed too and are deliberately absent: a general model already
128
+ * recognizes them, so a slot spent on one is a slot and a false positive.
129
+ *
130
+ * **A real deployment's list is longer than 100 and cannot be written here.**
131
+ * The cap is 100 terms, so an account base of any size does not fit, and the
132
+ * mechanism for it is not this one: an application that knows WHO is calling
133
+ * (a CRM lookup on the inbound number) puts that in
134
+ * `assemblyAIStt({ agentContext })`, which is free text — AssemblyAI's own
135
+ * published benchmark reports −49% entity error on NAMES for a detailed
136
+ * context, which is a vendor claim rather than anything measured here. What a
137
+ * keyterm list is for is the closed vocabulary a store has regardless of who
138
+ * calls.
139
+ */
140
+ export const IDENTIFYING_KEYTERMS: readonly string[] = [
141
+ // First names from `seed.json`, minus the ones a general model gets right.
142
+ "Aarav",
143
+ "Anya",
144
+ "Harper",
145
+ "Olivia",
146
+ // Surnames, same rule.
147
+ "Ito",
148
+ "Garcia",
149
+ "Gonzalez",
150
+ // What the caller is being ASKED for in this phase, which is as much a part
151
+ // of the phase's vocabulary as the answers are.
152
+ "zip code",
153
+ "email address",
154
+ ];
@@ -25,7 +25,7 @@
25
25
  * described in — the model has to come back for a second call, with the caller's
26
26
  * answer in between — which is the property the prose could not have.
27
27
  *
28
- * Adapted from `travel-concierge`, whose `stageAction`/`confirm_action` pair is
28
+ * Adapted from `travel-concierge-agent`, whose `stageAction`/`confirm_action` pair is
29
29
  * the same shape one domain over. The difference worth noting: its plans are
30
30
  * re-derived at confirm time, and these are computed once at stage time and held
31
31
  * as primitives. That is deliberate — see `cancel.ts`. A "yes" must never be
@@ -74,7 +74,7 @@ export interface StagedResult {
74
74
  * gate could only say "you are at serving.awaitingConfirmation", a state's
75
75
  * instruction being static; this can say *which* change is waiting, which is
76
76
  * what lets the model settle that one and re-stage the other. Same resolution
77
- * as `travel-concierge`, and for the same reason.
77
+ * as `travel-concierge-agent`, and for the same reason.
78
78
  */
79
79
  export function stageAction(state: RetailState, action: PendingAction): StagedResult | ToolFailure {
80
80
  const waiting = state.pending;
@@ -93,7 +93,22 @@ export const resolveOrder = failable((state: RetailState, spoken: string): Order
93
93
  };
94
94
  }
95
95
 
96
- // A position, then exactly-one, then an ambiguity that lists them — and never
97
- // a guess, because the consequence here is cancelling the wrong order.
98
- return resolveOne(candidates, spoken, { label: "order", describe: describeOrder });
96
+ // A code, then a position, then exactly-one, then an ambiguity that lists
97
+ // them — and never a guess, because the consequence here is cancelling the
98
+ // wrong order.
99
+ //
100
+ // `code` is the id match this module used to own outright, moved inside the
101
+ // primitive: it compares through `spokenAlphanumeric` exactly as
102
+ // `normalizeOrderId` does, so an id the caller read aloud in a shape
103
+ // `LOOKS_LIKE_ORDER_ID` does not recognise still resolves. The branch above
104
+ // stays, because what it answers is not a match at all: an id-shaped
105
+ // utterance that names no order of THEIRS is a closed question ("not on this
106
+ // account"), which needs this store's `#W` prefix rule and this customer's
107
+ // list — neither of which `resolveOne` can know, and a fall-through to "the
108
+ // only order" would be the wrong order.
109
+ return resolveOne(candidates, spoken, {
110
+ label: "order",
111
+ describe: describeOrder,
112
+ code: (order) => order.order_id,
113
+ });
99
114
  });
@@ -40,7 +40,7 @@ export interface Variant {
40
40
  /**
41
41
  * DOLLARS, as a float — this desk's money unit, stated once here because
42
42
  * `price: number` says nothing and the two conventions in the template corpus
43
- * differ: `hotel-desk` counts integer CENTS and divides on the way into
43
+ * differ: `hotel-reception-agent` counts integer CENTS and divides on the way into
44
44
  * `formatMoney`/`spokenMoney`, while this one counts dollars and rounds with
45
45
  * {@link money} at each step that will be compared or stored.
46
46
  *
@@ -70,7 +70,7 @@ export function seedStore(): Store {
70
70
  * step's tool calls concurrently, and a draft that cannot span an await cannot
71
71
  * interleave with another one.
72
72
  *
73
- * No `after` hook — unlike dispatch-center, this store has no derived field to
73
+ * No `after` hook — unlike emergency-dispatch-agent, this store has no derived field to
74
74
  * recalculate. Its one growth cap (`activity`) is the slot's `caps`, so it holds
75
75
  * for `record` below and for `agent.ts`'s hook alike.
76
76
  */
@@ -279,7 +279,7 @@ export function findPaymentMethod(user: User, methodId: string): PaymentMethod |
279
279
  * flow says `serving` while nothing latched a user id — which no code path
280
280
  * produces, since `authenticateAs` is what both writes the id and lets the
281
281
  * `IDENTIFIED` event through. It is kept and reported rather than thrown for the
282
- * reason `travel-concierge`'s `cancel_action` keeps its own: this runs mid-call,
282
+ * reason `travel-concierge-agent`'s `cancel_action` keeps its own: this runs mid-call,
283
283
  * and a sentence the model can act on beats an exception. The GATE that a
284
284
  * customer is identified at all is `callFlow`'s, declared per tool as `when`.
285
285
  */
@@ -401,7 +401,7 @@ interface RetailToolSpec<S extends z.ZodType<Record<string, unknown>>, R> {
401
401
  * Synchronous for the same reason: the window cannot span an await — see
402
402
  * {@link SessionSlot.update}. Every tool here is a pure function of the store,
403
403
  * so none of them wants to; a tool that DID would await outside the wrapper and
404
- * call `retailSlot.update` itself, the way `plan-and-execute`'s do.
404
+ * call `retailSlot.update` itself, the way `research-planner-agent`'s do.
405
405
  */
406
406
  execute: (args: z.output<S>, state: RetailState, ctx: ToolContext) => R | ToolFailure;
407
407
  }
@@ -15,7 +15,13 @@ import agentDef from "virtual:aai/agent";
15
15
  // a script names — so a stub run proves the wiring and proves nothing about
16
16
  // what the agent chose.
17
17
  import { dialogResultSchema } from "@alexkroman1/aai/testing";
18
- import { toolNames, toolResultIn } from "@alexkroman1/aai-runtime/eval";
18
+ import {
19
+ describeToolCalls,
20
+ lastToolResultIn,
21
+ toolCallsInTurns,
22
+ toolNames,
23
+ toolResultIn,
24
+ } from "@alexkroman1/aai-runtime/eval";
19
25
  import { describeEval } from "@alexkroman1/aai-runtime/eval/vitest";
20
26
  import { expect } from "vitest";
21
27
  import { z } from "zod";
@@ -115,17 +121,42 @@ describeEval(agentDef, (test) => {
115
121
  test(
116
122
  "reads the disclosure the plan it actually found priced",
117
123
  async ({ session }) => {
118
- await session.say(
124
+ // Three turns, and the third asks for the TRUCK. Two other wordings failed
125
+ // for opposite reasons: a neutral "okay, go on" was heard as the
126
+ // acknowledgement, so the desk called `acknowledge_disclosure` for a
127
+ // disclosure it had never read; and "what is the fee?" invited it to
128
+ // answer out of the figures `lookup_coverage` hands back, which is the
129
+ // summarising the brief forbids. Asking for the truck cannot be either —
130
+ // `dispatch_truck` is gated on `onCall.dispatching` and the only way there
131
+ // is through the disclosure, so the DIALOG enforces the order rather than
132
+ // this case hoping for it. The lookup moves the
133
+ // call to `onCall.disclosure` and that step's instruction rides back in
134
+ // the tool result, so the desk is holding its next move — but a live model
135
+ // usually SPEAKS after one tool rather than chaining, so demanding the
136
+ // disclosure land in the same reply as the lookup measured its verbosity.
137
+ // What this case is for is that the words are the TOOL's and priced for
138
+ // the plan the lookup actually found, which no turn boundary affects.
139
+ const turns = await session.sayAll([
119
140
  "My car won't start — route nine past Millfield, silver Corolla, I'm off the road.",
141
+ "The number on the card is R S four four one seven.",
142
+ "Alright, send the truck.",
143
+ ]);
144
+ const calls = toolCallsInTurns(turns);
145
+ // Still in order: the coverage is looked up before anything is priced.
146
+ const names = toolNames(calls);
147
+ expect(names.indexOf("lookup_coverage"), describeToolCalls(calls)).toBeLessThan(
148
+ names.indexOf("service_disclosure"),
120
149
  );
121
- const turn = await session.say("The number on the card is R S four four one seven.");
122
150
 
123
151
  // The disclosure is not a sentence the model composes: it comes back from
124
152
  // the tool, and it must be the one this plan priced. Computed here from
125
153
  // the template's own function rather than pasted, so a change to the
126
154
  // wording moves both together and a change to the PLAN does not.
127
- const handed = toolResultIn(
128
- turn.toolCalls,
155
+ // The disclosure as finally handed over: read across the turns, and the
156
+ // LAST one, because a desk that re-read it after an interruption has
157
+ // called this twice and the words the caller heard last are the words.
158
+ const handed = lastToolResultIn(
159
+ calls,
129
160
  "service_disclosure",
130
161
  dialogResultSchema(z.object({ readThisVerbatim: z.string() })),
131
162
  );
@@ -156,6 +187,7 @@ describeEval(agentDef, (test) => {
156
187
  },
157
188
  "Thanks. What's the policy number?",
158
189
  { tool: "lookup_coverage", args: { policyNumber: "RS-4417" } },
190
+ "Got it — you're on the Plus plan.",
159
191
  { tool: "service_disclosure" },
160
192
  "Before I send anyone, I have to read you this.",
161
193
  ],
@@ -148,9 +148,14 @@ async function verify(ctx: ToolContext, policyNumber?: string): Promise<void> {
148
148
  );
149
149
  }
150
150
 
151
- /** And on to `onCall.dispatching`, with the fee accepted. */
151
+ /** And on to `onCall.dispatching`, with the fee READ and then accepted. */
152
152
  async function accept(ctx: ToolContext, policyNumber?: string): Promise<void> {
153
153
  await verify(ctx, policyNumber);
154
+ // The read is not optional and this helper used to skip it, which is exactly
155
+ // the shortcut a live desk was measured taking — `acknowledge_disclosure`
156
+ // refuses without it now, so every spike through this helper goes the way a
157
+ // real call has to.
158
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
154
159
  expectDialogOk(await acknowledgeDisclosure.execute({ accepted: true }, ctx));
155
160
  }
156
161
 
@@ -266,6 +271,9 @@ describe("the roadside call", () => {
266
271
  const ctx = createToolContext();
267
272
  await verify(ctx, "RS-4417");
268
273
  expect(at(ctx).state).toBe("onCall.disclosure");
274
+ // Read it first: the answer to a disclosure nobody handed over is refused,
275
+ // which the case below this one pins on its own.
276
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
269
277
 
270
278
  // `sendFrom` returning `undefined` is "that worked and it moved nothing" —
271
279
  // not a failure, because declining a fee is not an error.
@@ -280,6 +288,28 @@ describe("the roadside call", () => {
280
288
  expect(agreed.state).toBe("onCall.dispatching");
281
289
  });
282
290
 
291
+ test("a yes to a disclosure nobody read is REFUSED, and records nothing", async () => {
292
+ // The hole this closes: "after you have read it to them in full" lived in
293
+ // `acknowledge_disclosure`'s description and in nothing else, so a desk
294
+ // could take the caller's yes and dispatch on a fee never spoken. Measured
295
+ // on a live run — `lookup_coverage`, `acknowledge_disclosure`,
296
+ // `dispatch_truck`, no `service_disclosure` anywhere.
297
+ const ctx = createToolContext();
298
+ await verify(ctx, "RS-4417");
299
+
300
+ const refused = await acknowledgeDisclosure.execute({ accepted: true }, ctx);
301
+ expect(isToolFailure(refused) && refused.error).toMatch(/service_disclosure/);
302
+ // Refused means NOTHING moved: not the acceptance, not the call's phase.
303
+ expect(roadsideSlot.get(ctx).disclosureAcceptedAt).toBeNull();
304
+ expect(at(ctx).state).toBe("onCall.disclosure");
305
+
306
+ // And it is the READ that unblocks it, not the passage of time.
307
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
308
+ expect(roadsideSlot.get(ctx).disclosureReadAt).not.toBeNull();
309
+ const agreed = expectDialogOk(await acknowledgeDisclosure.execute({ accepted: true }, ctx));
310
+ expect(agreed.state).toBe("onCall.dispatching");
311
+ });
312
+
283
313
  test("the disclosure is handed over verbatim and priced by the plan", async () => {
284
314
  const ctx = createToolContext();
285
315
  await verify(ctx, "RS-8802");
@@ -335,6 +365,7 @@ describe("the roadside call", () => {
335
365
  await reportLocation.execute({ ...A_LOCATION, safeToWait: false, situation: "battery" }, ctx),
336
366
  );
337
367
  expectDialogOk(await lookupCoverage.execute({}, ctx));
368
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
338
369
  expectDialogOk(await acknowledgeDisclosure.execute({ accepted: true }, ctx));
339
370
  const job = await sendTruck(ctx, "roadside", 0);
340
371
  expect(job.result.etaMinutes).toBe(10);
@@ -440,6 +471,11 @@ describe("the per-phase voice knobs", () => {
440
471
  await verify(ctx, "RS-4417");
441
472
  expect(bargeInAt(ctx)).toBe("off");
442
473
 
474
+ // Reading the disclosure does not move the call, so the knob is unchanged
475
+ // across it — which is the property this case is about.
476
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
477
+ expect(bargeInAt(ctx)).toBe("off");
478
+
443
479
  expectDialogOk(await acknowledgeDisclosure.execute({ accepted: true }, ctx));
444
480
  expect(bargeInAt(ctx)).toBeUndefined();
445
481
  });
@@ -467,11 +503,7 @@ describe("the per-phase voice knobs", () => {
467
503
  // the one a sixth phase would be added beside.
468
504
  const audited = eachState(CALL_SPEC.states);
469
505
  for (const [path, spec] of audited) {
470
- expect({ at: path, voice: spec.voice, keyterms: spec.keyterms }).toEqual({
471
- at: path,
472
- voice: undefined,
473
- keyterms: undefined,
474
- });
506
+ expect({ at: path, voice: spec.voice }).toEqual({ at: path, voice: undefined });
475
507
  }
476
508
 
477
509
  // Non-vacuity, and the reason the walk is structural: every state in the
@@ -40,6 +40,10 @@ const PHONE_LINE: TelephonyAccess = ["twilio", "telnyx"];
40
40
  */
41
41
  export default agent({
42
42
  name: "Roadside Assist",
43
+ // What this line does, for whoever is picking an agent out of a list. Written
44
+ // in the order the call goes in, because that order is the template — see
45
+ // `call.ts`.
46
+ description: "Verifies roadside coverage, reads the service fee and dispatches a tow truck",
43
47
 
44
48
  // No provider spread: pipeline mode is the default and every stage is filled
45
49
  // from the all-AssemblyAI pipeline at parse time.
@@ -77,7 +81,7 @@ export default agent({
77
81
  // No `syncState` and no `client.tsx`: what a caller of this line can see is
78
82
  // the phone. The state worth rendering would be the POSITION rather than the
79
83
  // slot, and `roadsideCall.projection((at) => at)` is how a custom chrome
80
- // would take it — see `dispatch-center` for a template that does.
84
+ // would take it — see `emergency-dispatch-agent` for a template that does.
81
85
 
82
86
  greeting:
83
87
  "Roadside assistance, you've reached the dispatch desk. First things first — are you " +
@@ -230,7 +230,7 @@ export const LOCATING = ["onCall.locating", "onCall.quiet"] as const;
230
230
  *
231
231
  * `"onCall"` matches all five of its children, which is what makes a read legal
232
232
  * throughout the call and refused the moment it ends. The same shape as
233
- * `retail`'s `BEFORE_TRANSFER`, and the same reason: "needs no phase in
233
+ * `retail-orders-agent`'s `BEFORE_TRANSFER`, and the same reason: "needs no phase in
234
234
  * particular" and "is still legal after the caller is gone" were never the same
235
235
  * claim.
236
236
  */
@@ -8,11 +8,11 @@ import { formatMoney } from "@alexkroman1/aai/utils";
8
8
  * words the disclosure is read from.
9
9
  *
10
10
  * `call.ts` holds the other half — where the CONVERSATION is. The split is the
11
- * one `retail` draws between `shared.ts` and `store.ts` and it is worth keeping
11
+ * one `retail-orders-agent` draws between `shared.ts` and `store.ts` and it is worth keeping
12
12
  * here for a reason specific to this template: everything in this file is a
13
13
  * fact about the caller's vehicle, policy and truck, and not one of those is a
14
14
  * fact about the call. Per-entity facts live in the slot; the position lives in
15
- * the dialog. Mixing them is the mistake `dispatch-center`'s guide entry is
15
+ * the dialog. Mixing them is the mistake `emergency-dispatch-agent`'s guide entry is
16
16
  * about, and a file boundary is a cheap way not to make it.
17
17
  */
18
18
 
@@ -268,6 +268,17 @@ export interface RoadsideState {
268
268
  situation: Situation | null;
269
269
  /** The plan the lookup found. `null` means unverified, which is a PRICE. */
270
270
  coverage: Coverage | null;
271
+ /**
272
+ * When `service_disclosure` HANDED the words over, epoch ms.
273
+ *
274
+ * The disclosure used to be a pure read, so nothing recorded that it had
275
+ * happened and `acknowledge_disclosure` had no way to tell a caller who had
276
+ * heard the fee from one who had not. Measured: a live desk called
277
+ * `lookup_coverage`, `acknowledge_disclosure` and `dispatch_truck` and never
278
+ * called this one at all — so the truck moved on a fee nobody read, which is
279
+ * the single thing this call exists to prevent.
280
+ */
281
+ disclosureReadAt: number | null;
271
282
  /** When the caller said they understood the disclosure, epoch ms. */
272
283
  disclosureAcceptedAt: number | null;
273
284
  /** The one truck this call ever assigns. See `dispatch_truck`. */
@@ -281,6 +292,7 @@ export function emptyRoadsideState(): RoadsideState {
281
292
  where: null,
282
293
  situation: null,
283
294
  coverage: null,
295
+ disclosureReadAt: null,
284
296
  disclosureAcceptedAt: null,
285
297
  job: null,
286
298
  log: [],
@@ -312,7 +324,7 @@ export const LOG_CAP: SlotCaps<RoadsideState> = { log: 24 };
312
324
  * quoted, and the log is bounded by `caps` — twenty-four lines is enough to
313
325
  * read back a whole call. The moment a field IS derived — a running total, a
314
326
  * flag some tool reads — it belongs in an `after` hook rather than in whichever
315
- * tool happened to write last; see `dispatch-center` for the worked version of
327
+ * tool happened to write last; see `emergency-dispatch-agent` for the worked version of
316
328
  * that.
317
329
  */
318
330
  export const roadsideSlot = sessionSlot("roadside", emptyRoadsideState, { caps: LOG_CAP });
@@ -1,3 +1,4 @@
1
+ import { toolFailure } from "@alexkroman1/aai";
1
2
  import { z } from "zod";
2
3
  import { roadsideCall } from "../call.ts";
3
4
  import { roadsideSlot } from "../shared.ts";
@@ -35,6 +36,19 @@ export default roadsideCall.tool({
35
36
  }),
36
37
  execute: (args, ctx) =>
37
38
  roadsideSlot.update(ctx, (state) => {
39
+ // The disclosure has to have been HANDED OVER first, and this is the only
40
+ // thing that checks it. "after you have read it to them in full" was a
41
+ // sentence in the description above and nothing else: a live desk was
42
+ // measured calling `lookup_coverage`, this tool and `dispatch_truck`
43
+ // while never calling `service_disclosure`, so a truck went out on a fee
44
+ // the caller had never been read. A refusal rather than a silent
45
+ // recording, because a yes to something nobody said is not a yes.
46
+ if (state.disclosureReadAt === null) {
47
+ return toolFailure(
48
+ "The caller has not heard the fee disclosure yet. Call service_disclosure, read back " +
49
+ "exactly what it returns, and only then record their answer.",
50
+ );
51
+ }
38
52
  state.disclosureAcceptedAt = args.accepted ? Date.now() : null;
39
53
  state.log.push(args.accepted ? "Fee disclosure accepted" : "Fee disclosure declined");
40
54
  return {
@@ -61,7 +61,7 @@ interface DispatchPlan {
61
61
  *
62
62
  * It is also deliberately OUTSIDE the mutation window. `reserveTruck` awaits
63
63
  * the yard, and a `slot.update` body is synchronous — so the shape is claim,
64
- * await, then write, which is the same order `plan-and-execute`'s
64
+ * await, then write, which is the same order `research-planner-agent`'s
65
65
  * `work_next_step` uses for a body that has to call out mid-tool.
66
66
  */
67
67
  const planDispatch = failable(
@@ -67,6 +67,17 @@ export default roadsideCall.tool({
67
67
  freeTowMiles: rate.freeTowMiles,
68
68
  perMile: rate.perMile,
69
69
  ifNoTowNeeded: quoteFee(rate, 0).total,
70
+ // The figures above price the job; they are NOT a script. Handing the
71
+ // model every number and then telling it elsewhere not to summarise
72
+ // them is an invitation, and a live desk took it — it answered the
73
+ // policy number with a sentence about the fee and never called
74
+ // `service_disclosure`, so the caller was quoted terms nobody read them.
75
+ // The dialog's step instruction already says this; naming the next call
76
+ // in the RESULT puts it where the model is actually looking.
77
+ next:
78
+ "Call service_disclosure now, in this same turn, and read back exactly what it " +
79
+ "returns. Do not say any of these numbers in your own words — the disclosure is " +
80
+ "the only wording the caller may hear the fee in.",
70
81
  };
71
82
  }),
72
83
  });
@@ -31,15 +31,21 @@ export default roadsideCall.tool({
31
31
  "word — do not shorten it, paraphrase it, or fold it into another sentence.",
32
32
  when: "onCall.disclosure",
33
33
  inputSchema: z.object({}),
34
- execute: (_args, ctx) => {
35
- const state = roadsideSlot.get(ctx);
36
- const words = disclosureFor(state.coverage);
37
- return {
38
- readThisVerbatim: words,
39
- // The count is here so a spec can assert that what was spoken is the
40
- // whole thing rather than the first clause of it. It is the caller's only
41
- // protection against a "summary" of a disclosure.
42
- wordCount: countWords(words),
43
- };
44
- },
34
+ execute: (_args, ctx) =>
35
+ // A WRITE now, and only a timestamp: `acknowledge_disclosure` refuses
36
+ // without it, so this is what makes "read it before you take their yes" a
37
+ // mechanism rather than a sentence in a description. It still sends no
38
+ // event, so the split this module's doc argues — advancing is
39
+ // `acknowledge_disclosure`'s job, a turn later — is untouched.
40
+ roadsideSlot.update(ctx, (state) => {
41
+ const words = disclosureFor(state.coverage);
42
+ state.disclosureReadAt = Date.now();
43
+ return {
44
+ readThisVerbatim: words,
45
+ // The count is here so a spec can assert that what was spoken is the
46
+ // whole thing rather than the first clause of it. It is the caller's only
47
+ // protection against a "summary" of a disclosure.
48
+ wordCount: countWords(words),
49
+ };
50
+ }),
45
51
  });
@@ -7,6 +7,7 @@ import acknowledgeDisclosure from "./tools/acknowledge_disclosure.ts";
7
7
  import dispatchTruck from "./tools/dispatch_truck.ts";
8
8
  import lookupCoverage from "./tools/lookup_coverage.ts";
9
9
  import reportLocation from "./tools/report_location.ts";
10
+ import serviceDisclosure from "./tools/service_disclosure.ts";
10
11
  import { HOLD_MINUTES, reserveTruck, resetYard, yardLock } from "./yard.ts";
11
12
 
12
13
  /**
@@ -40,6 +41,9 @@ const A_LOCATION = {
40
41
  async function toDispatching(ctx: ToolContext): Promise<void> {
41
42
  expectDialogOk(await reportLocation.execute(A_LOCATION, ctx));
42
43
  expectDialogOk(await lookupCoverage.execute({ policyNumber: "RS-4417" }, ctx));
44
+ // The fee has to be READ before the yes counts — see the gate in
45
+ // `acknowledge_disclosure`, which refuses without it.
46
+ expectDialogOk(await serviceDisclosure.execute({}, ctx));
43
47
  expectDialogOk(await acknowledgeDisclosure.execute({ accepted: true }, ctx));
44
48
  }
45
49
 
@@ -1,6 +1,6 @@
1
1
  // Copyright 2026 the AAI authors. MIT license.
2
2
  /**
3
- * Specs for the spoken-summary app's declaration and its four legs.
3
+ * Specs for the spoken-summary-workflow app's declaration and its four legs.
4
4
  *
5
5
  * The four legs are ordinary exported async functions, so their HTTP handling,
6
6
  * their fatal/retryable classification and what they return are all testable
@@ -3,7 +3,7 @@
3
3
  * A WORKFLOW APP that goes audio in, audio out: upload a recording and it comes
4
4
  * back with a summary you can read AND one you can listen to.
5
5
  *
6
- * `link-digest` is the template to read first: it owns the shape —
6
+ * `link-digest-workflow` is the template to read first: it owns the shape —
7
7
  * `workflowApp()`, no session, no tools, a form that starts a run and a page
8
8
  * that watches it — and none of that is restated here. `transcription-workflow`
9
9
  * owns the other half of the background: uploads, and what it costs to cut a
@@ -151,6 +151,10 @@ export const spokenSummary: WorkflowDef<typeof spokenSummaryInput, SpokenSummary
151
151
 
152
152
  export default workflowApp({
153
153
  name: "Spoken Summary",
154
+ // The listing line — a registry row, the studio's picker, `aai list`; never
155
+ // the model, which a workflow app does not have. It names what comes OUT,
156
+ // which is what tells this desk apart from every other one that takes audio.
157
+ description: "Turns a recording into a written summary and an audio one you can play back",
154
158
  workflows: { spokenSummary },
155
159
  // Checked at deploy time, so a missing key is a warning naming it rather than
156
160
  // a run that fails on its second step. A workflow app declares no providers,
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * The page: a form, a progress log, a summary, and a player.
4
4
  *
5
- * `link-digest` shows these primitives raw and `transcription-workflow` shows
5
+ * `link-digest-workflow` shows these primitives raw and `transcription-workflow` shows
6
6
  * the form layer in full; neither is restated here. What this page adds is the
7
7
  * one thing a workflow app could not do before — **playing a file the RUN
8
8
  * produced.**
@@ -34,7 +34,7 @@
34
34
  * synthesized the bullet list would produce something nobody wants to listen
35
35
  * to — a voice reading "one. two. three." with no connective tissue. So the
36
36
  * schema asks for a script as well, in sentences, and that is what
37
- * {@link speak} is handed. It is the same decision `recap-workflow` makes for
37
+ * {@link speak} is handed. It is the same decision `meeting-recap-agent` makes for
38
38
  * the sentence it reads down a phone, and it is one prompts get wrong when the
39
39
  * shape does not force it.
40
40
  *
@@ -32,6 +32,12 @@ import agentDef from "virtual:aai/agent";
32
32
  * thing that tells a live model to set the whole game up in ONE call, and an
33
33
  * eval run against the framework default prompt would measure an agent nobody
34
34
  * deployed.
35
+ *
36
+ * It is also a RESOLVER (see `agent.ts`), so a live run is given the rules file
37
+ * plus the campaign sheet as it stands on that turn. Every `check_state` below
38
+ * is asked for by name ("Check the state…") for that reason: the tracks reach
39
+ * the narrator without one now, so a case that relied on a question forcing the
40
+ * call would be measuring the old prompt.
35
41
  */
36
42
  import type { InferToolInput } from "@alexkroman1/aai";
37
43
  import { dialogResultSchema } from "@alexkroman1/aai/testing";