@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
@@ -27,9 +27,9 @@
27
27
  * a roster can express.
28
28
  * - `explainer` and `counterpoint` are on the ROSTER (`agent({ subagents })`),
29
29
  * because choosing between them IS reading what the caller asked: "what does
30
- * curtailment mean" and "who says otherwise" want different specialists and
30
+ * curtailment mean" and "who says otherwise" want different subagents and
31
31
  * nothing else about them differs. They reach the model as one `delegate`
32
- * tool whose `coworker` argument is the two names, described by their own
32
+ * tool whose `subagent` argument is the two names, described by their own
33
33
  * {@link SubagentDef.description}s.
34
34
  *
35
35
  * The rule that follows: **name a subagent in code when the tool IS the choice;
@@ -56,18 +56,18 @@ import { type AssemblyAIGatewayModel, assemblyAILlm } from "@alexkroman1/aai/llm
56
56
  import { z } from "zod";
57
57
 
58
58
  /**
59
- * The model the three NARROW specialists share.
59
+ * The model the three NARROW subagents share.
60
60
  *
61
61
  * Named once because it is a fact about the DESK — checking one sentence,
62
62
  * defining one word and finding one objection are not the job `researcher`
63
63
  * does, so all three run somewhere cheaper — and each subagent still declares
64
- * its own `llm`, because which model a specialist runs on is part of what
65
- * declaring a specialist means.
64
+ * its own `llm`, because which model a subagent runs on is part of what
65
+ * declaring a subagent means.
66
66
  *
67
67
  * Annotated as {@link AssemblyAIGatewayModel} rather than left as three string
68
68
  * literals: `AssemblyAILlmOptions.model` widens to `string` so the gateway
69
69
  * accepts a name it has never heard of, and a typo in one of three copies is a
70
- * refusal from ONE specialist while the other two answer — the hardest shape of
70
+ * refusal from ONE subagent while the other two answer — the hardest shape of
71
71
  * failure to notice on a live call. Here it is a compile error.
72
72
  */
73
73
  export const CHEAP_MODEL: AssemblyAIGatewayModel = "gemini-2.5-flash-lite";
@@ -171,7 +171,7 @@ export const factChecker: TypedSubagentDef<Verdict> = subagent({
171
171
  });
172
172
 
173
173
  /**
174
- * The ROSTER's first specialist: what a word means.
174
+ * The ROSTER's first subagent: what a word means.
175
175
  *
176
176
  * No tools at all, which is legal and is the point — a definition is a
177
177
  * reasoning pass, and giving this one a search would let it wander off into
@@ -203,7 +203,7 @@ export const explainer = subagent({
203
203
  * Searches, like the fact-checker, and is told to do a different job with the
204
204
  * results — which is exactly the case a roster is for. Nothing about
205
205
  * `counterpoint` differs from `explainer` except what the caller wanted, so a
206
- * tool file per specialist would be two bodies differing in one identifier.
206
+ * tool file per subagent would be two bodies differing in one identifier.
207
207
  */
208
208
  export const counterpoint = subagent({
209
209
  name: "counterpoint",
@@ -223,13 +223,13 @@ export const counterpoint = subagent({
223
223
  });
224
224
 
225
225
  /**
226
- * The roster `agent({ subagents })` publishes — the specialists the MODEL picks
226
+ * The roster `agent({ subagents })` publishes — the subagents the MODEL picks
227
227
  * between.
228
228
  *
229
229
  * Declared here rather than inline in `agent.ts` so that membership sits beside
230
230
  * the definitions, which is where the question "should this one be routable?"
231
231
  * gets answered. `researcher` and `factChecker` are deliberately absent: each is
232
- * reached by a tool that does real work around the delegation, and a specialist
232
+ * reached by a tool that does real work around the delegation, and a subagent
233
233
  * reachable both ways gives the model a second, worse route to it.
234
234
  */
235
235
  export const roster: SubagentRoster = [explainer, counterpoint];
@@ -305,7 +305,7 @@ export function totalWork(findings: readonly DeepReadonly<Finding>[]): AngleWork
305
305
  * Run one angle and reduce it to what the board holds.
306
306
  *
307
307
  * Takes the DELEGATE rather than the whole tool context — the same seam
308
- * `plan-and-execute` puts on `ctx.generate`. The desk's own logic is then
308
+ * `research-planner-agent` puts on `ctx.generate`. The desk's own logic is then
309
309
  * exercised against a fake without a context at all, and the tool that fans
310
310
  * these out stays one line per angle.
311
311
  */
@@ -15,7 +15,7 @@
15
15
  * it, leaving {@link briefingMessage} as the only thing here that a reader of
16
16
  * THIS template has to think about.
17
17
  *
18
- * It is a pure function for the same reason `podcast-digest`'s is: a spec
18
+ * It is a pure function for the same reason `podcast-digest-workflow`'s is: a spec
19
19
  * asserts what the desk would post without a network and without knowing
20
20
  * Slack's payload shape. Asserting the payload itself — `renderChannelPayload`,
21
21
  * the Block Kit, the escaping — would pin the SDK's rendering from the outside,
@@ -5,7 +5,7 @@ and you have a small team of researchers you can put on it.
5
5
 
6
6
  - You have no way to look anything up yourself. Everything you know about the
7
7
  outside world comes back from `research_topic`, `verify_claim` or `delegate`.
8
- - `delegate` hands one question to a specialist: the explainer for "what does
8
+ - `delegate` hands one question to a subagent: the explainer for "what does
9
9
  that word mean", the counterpoint for "who says otherwise". Use it for a
10
10
  question that stands on its own — a subject worth several angles is
11
11
  `research_topic`, and a fact to check is `verify_claim`.
@@ -16,13 +16,16 @@ and you have a small team of researchers you can put on it.
16
16
  - Each angle must stand on its own. A researcher has not heard this call and
17
17
  cannot see the others' work, so "the same but for Europe" is not an angle;
18
18
  "how European home battery prices moved in 2025" is.
19
- - Say you are looking it up BEFORE you call the tool. A silent line is the
20
- worst thing that can happen on a phone call, and a briefing takes a moment.
19
+ - Call the tool BEFORE you say anything about it. Speaking ends your turn, so
20
+ "let me look that up" with no result behind it is a promise you never keep —
21
+ the caller hears it, the researchers never run, and the next thing they say
22
+ has to prompt you all over again. Report what came back, never what you are
23
+ about to do.
21
24
  - `send_briefing` posts what is on the board to the team's channel. Offer it
22
25
  when the caller wants the briefing in writing or wants it passed on to
23
- someone who was not on the call, and say you are sending it before you call
24
- it. If it comes back refusing, say plainly that it has not sent — never let
25
- them hang up believing it did.
26
+ someone who was not on the call, and call it before you say it has gone. If
27
+ it comes back refusing, say plainly that it has not sent — never let them
28
+ hang up believing it did.
26
29
 
27
30
  ## How you talk
28
31
 
@@ -37,8 +40,10 @@ and you have a small team of researchers you can put on it.
37
40
  - If the caller pushes back on a fact, check it with `verify_claim` rather than
38
41
  defending it. If it comes back contradicted, correct yourself plainly. If it
39
42
  comes back `unusable`, say it is unresolved — do not round it up to confirmed.
40
- - `briefing_so_far` is for a recap. It costs nothing, so use it rather than
41
- reciting from memory.
43
+ - `briefing_so_far` is for a recap. It costs nothing, so ALWAYS call it when
44
+ the caller asks what you have — including when you believe the board is
45
+ empty. Reciting "nothing yet" from memory is the same mistake as reciting a
46
+ finding from memory: the board is the record, not your recollection of it.
42
47
 
43
48
  ## What not to do
44
49
 
@@ -1,9 +1,28 @@
1
- import { errorMessage, isToolFailure, requireEnv, toolFailure } from "@alexkroman1/aai";
1
+ import {
2
+ errorMessage,
3
+ isToolFailure,
4
+ requireEnv,
5
+ type ToolErrorHandler,
6
+ toolFailure,
7
+ } from "@alexkroman1/aai";
2
8
  import { ChannelDeliveryError, sendToChannel } from "@alexkroman1/aai/channels";
3
9
  import { z } from "zod";
4
10
  import { briefingSlot } from "../shared.ts";
5
11
  import { briefingChannel, briefingMessage, DESTINATION_ENV } from "../slack.ts";
6
12
 
13
+ /**
14
+ * Anything that reaches here is a deploy nobody finished or a bug in this file
15
+ * — see the note on the tool below — and neither is fixed by asking the model
16
+ * to try again, so it goes back up as a fatal failure.
17
+ *
18
+ * Named, with its type spelled, because the type is what says what the two
19
+ * outcomes are: RETURN a `ToolFailure` (or a string) and the model reads it and
20
+ * carries on; THROW and the call ends without an answer.
21
+ */
22
+ const unfinishedDeployIsFatal: ToolErrorHandler = (err) => {
23
+ throw err;
24
+ };
25
+
7
26
  /**
8
27
  * Post the board to the desk's Slack channel, so the briefing outlives the
9
28
  * call.
@@ -24,10 +43,24 @@ import { briefingChannel, briefingMessage, DESTINATION_ENV } from "../slack.ts";
24
43
  * the one deliberate throw in this template. A missing key is not a refusal the
25
44
  * desk can talk its way around and not something the caller did — it is a
26
45
  * deploy nobody finished — so the SDK's own message names the variable and how
27
- * to set it, and the runtime hands that to the model rather than letting the
28
- * first property access surface as a `TypeError` the caller hears as an
29
- * unexplained apology. Everything a call CAN recover from is a `ToolFailure`
30
- * below.
46
+ * to set it. Everything a call CAN recover from is a `ToolFailure` below.
47
+ *
48
+ * **And `onError` is what makes that throw mean something.** Without it the
49
+ * runtime hands every exception to the model as this call's result, so a
50
+ * webhook nobody configured reads as an ordinary hiccup: the desk apologises,
51
+ * calls `send_briefing` again, gets the same sentence, and spends the reply's
52
+ * whole `maxSteps` budget on a variable that will still be unset on the next
53
+ * attempt. Re-throwing declares the failure FATAL — the call rejects, the model
54
+ * is handed nothing to retry against, and the runtime reports it as a `tool`
55
+ * session error where whoever deployed this can see it.
56
+ *
57
+ * **Blanket, and only because of the shape of this body.** Every failure the
58
+ * desk can talk about is RETURNED above and below — the empty board, a
59
+ * destination that is not Slack, both halves of a `ChannelDeliveryError` — so
60
+ * anything that reaches `onError` here is a deploy that is not finished or a
61
+ * bug in this file, and neither is fixed by asking the model to try again. A
62
+ * tool whose body can throw for a transient reason should classify instead:
63
+ * return a `ToolFailure` for the recoverable throws and re-throw only the rest.
31
64
  */
32
65
  export default briefingSlot.tool({
33
66
  description:
@@ -74,4 +107,9 @@ export default briefingSlot.tool({
74
107
  "the briefing back out — they have it in writing now.",
75
108
  };
76
109
  },
110
+ // See the note above: the only throw this body has is `requireEnv`'s, and a
111
+ // missing webhook is unfixable from inside the call. Re-throwing keeps the
112
+ // SDK's own message — which names the variable and how to set it — as the
113
+ // fatal error's `cause`.
114
+ onError: unfinishedDeployIsFatal,
77
115
  });
@@ -189,7 +189,7 @@ describe("the agent declares its three workflows", () => {
189
189
  // to edit rather than satisfy. `workflowApp()` declares no session, so a
190
190
  // tool has no conversation to be called from — a name appearing here means
191
191
  // the voice path crept back in and the tool will never run. If you want a
192
- // voice agent that STARTS a workflow, `research-workflow` is that template,
192
+ // voice agent that STARTS a workflow, `research-handoff-agent` is that template,
193
193
  // and this line is what tells you you are on the wrong one.
194
194
  expect(Object.keys(agentDef.tools ?? {})).toEqual([]);
195
195
  });
@@ -3,7 +3,7 @@
3
3
  * A WORKFLOW APP that really transcribes: point it at a recording and it comes
4
4
  * back with the text.
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. What this one adds is a
9
9
  * workflow that does real, rate-limited, provider-shaped work:
@@ -178,6 +178,9 @@ export const transcribeBatch = workflow({
178
178
 
179
179
  export default workflowApp({
180
180
  name: "Transcription Desk",
181
+ // The listing line. It names all THREE routes because choosing between them
182
+ // is the product.
183
+ description: "Transcribes a recording three ways: chunked, streaming while it uploads, or batch",
181
184
  workflows: { transcribe, transcribeStream, transcribeBatch },
182
185
  // Checked at deploy time, so a missing key is a warning naming it rather than
183
186
  // a run that fails on its second step.
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * The transcription desk's page: a form, a progress log, and a transcript.
4
4
  *
5
- * `link-digest` is the smaller example and the one to read first — it shows the
5
+ * `link-digest-workflow` is the smaller example and the one to read first — it shows the
6
6
  * layer under `<Form>` raw: a hand-written `<form>` with its own `useState`,
7
7
  * handing an object to `submit()`. This page is the same thing with the two
8
8
  * pieces that hand-rolling gets tedious:
@@ -28,7 +28,7 @@
28
28
  * `stepTranscribeUpload` / `stepTranscribeSubmit` / `stepTranscribePoll` on
29
29
  * `@alexkroman1/aai/step` own the URL, the raw-key auth, the windowed streaming
30
30
  * upload, the PLURAL `speech_models` field and the failure classification. This file
31
- * used to spell all of that out, and so did `spoken-summary` — the same ~200 lines
31
+ * used to spell all of that out, and so did `spoken-summary-workflow` — the same ~200 lines
32
32
  * twice, reworded, identical in behaviour, and drifting apart at the edges.
33
33
  *
34
34
  * What stays here is what a dependency cannot decide: how many steps to cut the job
@@ -41,7 +41,7 @@
41
41
  *
42
42
  * The wait. A job takes minutes, and nothing about an HTTP request survives minutes:
43
43
  * the poll has to outlive the process that started it, which is exactly what a
44
- * durable `sleep` is. `recap-workflow` ports Temporal's `polling` sample for this
44
+ * durable `sleep` is. `meeting-recap-agent` ports Temporal's `polling` sample for this
45
45
  * shape and its module doc carries the argument; this is the same pattern with the
46
46
  * poll bounded by attempts rather than by a deadline.
47
47
  *
@@ -3,7 +3,7 @@
3
3
  * The durable half of the transcription desk: split a recording, transcribe
4
4
  * every piece, stitch the pieces back together.
5
5
  *
6
- * Read `research-workflow/workflows/research.ts` first. It states the two rules
6
+ * Read `research-handoff-agent/workflows/research.ts` first. It states the two rules
7
7
  * every directive body obeys — replayed from the top, so no live handles and no
8
8
  * undurable decisions; step arguments and return values are serialized, so pass
9
9
  * an id and not a payload — and both hold here unchanged. What this template
@@ -29,6 +29,10 @@ import { gateFlow, tripProjection } from "./shared.ts";
29
29
  */
30
30
  export default agent({
31
31
  name: "Swiss Air Concierge",
32
+ // What the desk does, for whoever is reading a list of agents. It names the
33
+ // four specialists as the four things a caller can ask for, which is how a
34
+ // caller would say it and how the dialog stack is organised.
35
+ description: "Changes flights, hotels, car rentals and excursions for a booked traveller",
32
36
  // The stack, the ticket and the itinerary exist before the first tool call,
33
37
  // so a resumed connection has something to project.
34
38
  // One projection replaces a `ctx.send` in each of eleven tools — and is the
@@ -483,7 +483,7 @@ type DeskToolDef<P extends ToolInputSchema, V, R> = Omit<SlotToolDef<P, V, R>, "
483
483
  * Nine tools used to open with the same two lines, and a wrapper is what makes
484
484
  * the narrowing STRUCTURAL rather than remembered: their graph binds a tool set
485
485
  * per node, and the tenth desk tool written here cannot forget the gate the way
486
- * a copied prologue can. It is the per-agent wrapper `retail` demonstrates, at
486
+ * a copied prologue can. It is the per-agent wrapper `retail-orders-agent` demonstrates, at
487
487
  * its smallest — all this one adds is the gate, so what it takes is the SLOT's
488
488
  * OWN {@link SlotToolDef} rather than a spec of its own, and a tool file reads
489
489
  * exactly as it did minus the prologue.
@@ -11,10 +11,10 @@
11
11
  // that is where it lives: the build discovers the file, so an eval driving
12
12
  // `agent.ts` alone would measure Scout with none of its own rules — and its
13
13
  // rules are the entire subject of this file. The reasoning is spelled out in
14
- // `../code-interpreter/agent.eval.test.ts`.
14
+ // `../code-interpreter-agent/agent.eval.test.ts`.
15
15
 
16
16
  import agentDef from "virtual:aai/agent";
17
- import { expectToolBeforeSpeech } from "@alexkroman1/aai-runtime/eval";
17
+ import { describeTurn, expectToolBeforeSpeech } from "@alexkroman1/aai-runtime/eval";
18
18
  import { describeEval } from "@alexkroman1/aai-runtime/eval/vitest";
19
19
  import { expect } from "vitest";
20
20
 
@@ -66,16 +66,42 @@ describeEval(agentDef, (test) => {
66
66
  test(
67
67
  "cites a site that appeared in its own results",
68
68
  async ({ session }) => {
69
- const turn = await session.say("Who is the current CEO of Boeing?");
69
+ // A fact with ABUNDANT, stable sources, because this case measures the
70
+ // CITATION and everything else has to be a foregone conclusion. Two other
71
+ // questions failed here for opposite reasons: "who is the current CEO of
72
+ // Boeing" is answerable from training data, so a run answered it from
73
+ // memory and cited nothing; "the latest news about Boeing this week" made
74
+ // the desk really search and come back empty ("I'm having trouble pulling
75
+ // up the latest news"), which is a thin news day and not a citation bug.
76
+ // Whether Scout searches a fact it is sure of is the case ABOVE.
77
+ const turn = await session.say("Who was the first person to walk on the moon?");
70
78
 
71
79
  const labels = hostLabels(turn);
72
- expect(labels.length).toBeGreaterThan(0);
80
+ const spoken = turn.text.toLowerCase();
81
+
82
+ // BOTH branches are the same rule, and the open web decides which one
83
+ // this run gets. A search that comes back empty or errors is not a
84
+ // citation bug — but it is where the stronger half of the claim lives, so
85
+ // the case measures that instead of failing on a thin result. Measured
86
+ // failing exactly here: "I couldn't reach the information right now. But
87
+ // according to historical records, Neil Armstrong was the first person to
88
+ // walk on the moon" obeyed "say that instead of naming a source" to the
89
+ // letter while stating a fact it had never read. The prompt now says to
90
+ // stop there, and this is what holds it to that.
91
+ if (labels.length === 0) {
92
+ expect(spoken, describeTurn(turn)).toMatch(/could ?n.?t|cannot|unable|no results|nothing/);
93
+ expect(spoken, describeTurn(turn)).not.toMatch(/armstrong/);
94
+ return;
95
+ }
96
+
73
97
  // "Cite sources by website name" — and cite one you read. A reply that
74
98
  // names an outlet absent from the results is the fabrication this case
75
99
  // exists to catch, and it fails here exactly like a reply that cites
76
100
  // nothing at all.
77
- const spoken = turn.text.toLowerCase();
78
- expect(labels.filter((label) => spoken.includes(label))).not.toEqual([]);
101
+ expect(
102
+ labels.filter((label) => spoken.includes(label)),
103
+ describeTurn(turn),
104
+ ).not.toEqual([]);
79
105
  },
80
106
  { live: true },
81
107
  );
@@ -32,7 +32,7 @@ import promptFile from "./system-prompt.md?raw";
32
32
  * import is also the file's existence check — `deployedAgent` is handed the
33
33
  * prompt and nothing else, and refuses a call with no project files at all.
34
34
  */
35
- describe("web-researcher template", () => {
35
+ describe("web-research-agent template", () => {
36
36
  test("is deployable: validates, is nameable, and every stage its mode needs is filled", () => {
37
37
  // This template declares no provider at all — the whole voice pipeline is
38
38
  // the injected all-AssemblyAI default, which is what lets the starter run
@@ -85,6 +85,22 @@ describe("web-researcher template", () => {
85
85
  // never says "search" is the framework default wearing Scout's name.
86
86
  expect(expectPromptBuiltinsDeclared(agentDef)).toContain("web_search");
87
87
  });
88
+
89
+ test("one call has a ceiling on what it can spend", () => {
90
+ // Scout is the only starter whose context grows with text it did not write:
91
+ // every `visit_webpage` result is appended to the conversation and re-sent
92
+ // on every later turn, and `maxSteps` bounds one reply rather than a call.
93
+ // So the failure this catches is a deletion — the budget is a whole line
94
+ // that reads like tidy-up, and losing it is invisible until somebody's bill
95
+ // arrives.
96
+ //
97
+ // The NUMBER is deliberately not pinned, per this file's own rule: raising
98
+ // or lowering the ceiling is a first customization, and a spec that fails
99
+ // on it fails inside a file the user never wrote. What must survive is that
100
+ // there is a ceiling at all.
101
+ const totalTokens = expectDeployable(agentDef).usageLimits?.totalTokens;
102
+ expect(totalTokens).toBeGreaterThan(0);
103
+ });
88
104
  });
89
105
 
90
106
  /** A plausible endpoint, only ever read back out of the config this sets. */
@@ -4,7 +4,7 @@
4
4
  * The two builtins are the whole agent — `system-prompt.md` holds the rules
5
5
  * that make it a researcher rather than a talkative model, and there is no
6
6
  * `tools/` directory. Keep it that way: a question with four sides wants
7
- * `briefing-desk`, which puts a subagent on each of them. This template is the
7
+ * `topic-briefing-agent`, which puts a subagent on each of them. This template is the
8
8
  * one lookup, done properly and cited.
9
9
  *
10
10
  * **It is also the worked example for `mcpServers`** — the OTHER way an agent
@@ -90,9 +90,39 @@ const mcpServers: McpServers | undefined = ARCHIVE ? { [ARCHIVE_KEY]: ARCHIVE }
90
90
 
91
91
  export default agent({
92
92
  name: "Scout",
93
+ // The listing line — a registry row, `aai list`, the studio's picker. Never
94
+ // the model: the researcher rules are `system-prompt.md`'s. It names the
95
+ // citation because that is what separates Scout from a model guessing.
96
+ description: "Answers questions by searching the open web and citing what it found",
93
97
  greeting:
94
98
  "Hey, I'm Scout. I search the web for answers. Try asking me something like, what happened in tech news today, or who won the last World Cup.",
95
99
  builtinTools: ["web_search", "visit_webpage"],
100
+ /**
101
+ * A ceiling on what one call may spend — the one knob this starter needs and
102
+ * the other templates do not.
103
+ *
104
+ * Scout is the only agent here whose context grows with text it did not
105
+ * write. Every `visit_webpage` result (capped at `MAX_PAGE_CHARS`, ~2,500
106
+ * tokens) is appended to the conversation and RE-SENT on every later turn, so
107
+ * a long call reading a dozen pages spends roughly the square of what it
108
+ * read. Nothing else bounds that: `maxSteps` bounds one reply, not a call.
109
+ *
110
+ * The number is deliberately far above any real research call — a few pages
111
+ * over a few dozen turns lands an order of magnitude under it — so it is a
112
+ * runaway guard and not a budget a caller can feel. It is here because this
113
+ * is a STARTER: it deploys with two builtins and no credential of its own, on
114
+ * somebody's URL, and the shape of "left running" is exactly what this
115
+ * catches.
116
+ *
117
+ * **What it costs is stated rather than hidden.** Crossing it is fatal: the
118
+ * session ends with an `error.reported` frame and a browser client releases
119
+ * the microphone, so the caller hears a dropped call rather than an
120
+ * explanation. An agent that wants to say something first watches
121
+ * `usage.updated` through `agent({ events })` and speaks before the cap
122
+ * arrives — a fair amount of machinery for a starter, which is why this one
123
+ * takes the blunt version and says so.
124
+ */
125
+ usageLimits: { totalTokens: 500_000 },
96
126
  // Spread rather than `mcpServers: undefined`: an agent with no archive
97
127
  // declares no server and asks a deploy for no credential, which is the
98
128
  // shape every field on this call already has.
@@ -4,6 +4,13 @@ THE RULE: every turn where the caller asks for a fact begins with a web_search
4
4
  call. Not a sentence, not a reply — the search. You have no knowledge of your
5
5
  own, so until a result comes back you have nothing to say.
6
6
 
7
+ - WHEN A SEARCH COMES BACK EMPTY OR ERRORS, the whole of your reply is that you
8
+ could not find it and they can ask again. Nothing else. Do not add the answer
9
+ you already knew, not after "but", not as background, not as "historical
10
+ records say", not even if you are sure — a fact with no source is the one
11
+ thing this desk must never say, and putting an apology in front of it makes it
12
+ worse rather than better. There is no version of this reply that contains the
13
+ answer.
7
14
  - Search even when you are certain. Certainty is the case this rule exists for:
8
15
  "Who won the 2022 World Cup?" is a search, because a fact you did not just
9
16
  read is stale and has no source to attach to it.
@@ -11,8 +18,7 @@ own, so until a result comes back you have nothing to say.
11
18
  appear in a web_search or visit_webpage result you read in THIS turn.
12
19
  - Name the source in the answer, every time: "According to Reuters, ..." or
13
20
  "Wikipedia says ...". Name the site the result actually came from — naming a
14
- publication you did not just read is a fabrication. If nothing usable came
15
- back, say that instead of naming a source.
21
+ publication you did not just read is a fabrication.
16
22
  - Use visit_webpage when the search snippets aren't detailed enough.
17
23
  - Some deployments give you extra research tools whose names begin with `mcp_`
18
24
  — a private archive, a wiki, a docs server the open web cannot reach. Use
@@ -17,6 +17,8 @@ import { lastStateIn, toolNames, toolResultIn } from "@alexkroman1/aai-runtime/e
17
17
  import { describeEval } from "@alexkroman1/aai-runtime/eval/vitest";
18
18
  import { expect } from "vitest";
19
19
  import { z } from "zod";
20
+ import { isCorrectGuess } from "./guess.ts";
21
+ import { allWords } from "./words.ts";
20
22
 
21
23
  /** The scoreboard, as these cases read it. */
22
24
  const Board = z.object({
@@ -27,8 +29,29 @@ const Board = z.object({
27
29
  wrongGuesses: z.array(z.string()),
28
30
  });
29
31
 
30
- /** A scripted player who is always wrong — the word is random, so a script cannot be right. */
31
- const WRONG_PLAYER = ['{"guess":"zebra crossing","remark":"Is it a zebra crossing?"}'];
32
+ /**
33
+ * A scripted player who is always wrong.
34
+ *
35
+ * The old guess here was "zebra crossing", under the reasoning that "the word is
36
+ * random, so a script cannot be right". That reasoning does not hold, and the
37
+ * case failed in CI on it: `isCorrectGuess` rules a guess correct when the WORD
38
+ * appears as a whole word INSIDE it (`containsWord`, so that "Is it a giraffe?"
39
+ * relayed whole still scores), `zebra` is one of the 220 words, and
40
+ * `pickWords` draws the round's word at random — so roughly one run in 220 drew
41
+ * `zebra`, matched it inside "zebra crossing", and scored the wrong guess
42
+ * correct.
43
+ *
44
+ * A guess is only reliably wrong if NO word in the list matches it, which is a
45
+ * fact about the list rather than a thing to eyeball — {@link wrongEverywhere}
46
+ * below asserts it, so a future word list that adds "wombat" fails this case
47
+ * loudly instead of flaking once every few hundred runs.
48
+ */
49
+ const WRONG_GUESS = "purple wombat";
50
+ const WRONG_PLAYER = [`{"guess":"${WRONG_GUESS}","remark":"Is it a ${WRONG_GUESS}?"}`];
51
+
52
+ /** Every word this guess would be scored CORRECT against — must be none. */
53
+ const wrongEverywhere = (): string[] =>
54
+ allWords().filter((word) => isCorrectGuess(WRONG_GUESS, word));
32
55
 
33
56
  describeEval(agentDef, (test) => {
34
57
  test(
@@ -56,7 +79,7 @@ describeEval(agentDef, (test) => {
56
79
 
57
80
  test(
58
81
  "a description goes to the player, and a wrong guess is relayed without a point",
59
- async ({ session }) => {
82
+ async ({ session, mode }) => {
60
83
  await session.say("Ready!");
61
84
  const turn = await session.say(
62
85
  "It's an animal with black and white stripes, lives in Africa.",
@@ -67,20 +90,49 @@ describeEval(agentDef, (test) => {
67
90
  turn.toolCalls,
68
91
  "relay_description",
69
92
  dialogResultSchema(
70
- z.object({ verdict: z.string(), playerSaid: z.string(), score: z.number() }),
93
+ z.object({
94
+ verdict: z.string(),
95
+ playerSaid: z.string(),
96
+ guess: z.string(),
97
+ score: z.number(),
98
+ }),
71
99
  ),
72
100
  );
73
- expect(relayed.result).toMatchObject({
74
- verdict: "wrong",
75
- playerSaid: "Is it a zebra crossing?",
76
- score: 0,
77
- });
78
- // The round is still on: a wrong guess moves nothing.
79
- expect(relayed.state).toBe("playing");
80
- expect(lastStateIn(turn.events, Board)).toMatchObject({
81
- score: 0,
82
- wrongGuesses: ["zebra crossing"],
83
- });
101
+ // The player really answered, and the host relayed rather than ruling on
102
+ // the guess itself — the claim in this case's name, and the half that
103
+ // holds in either mode.
104
+ expect(relayed.result.playerSaid.length).toBeGreaterThan(0);
105
+ // WHICH verdict came back is the game's business, not this case's: the
106
+ // word is drawn at random and `zebra` is in the pool, so live — where a
107
+ // real model plays the player — this description is right about as often
108
+ // as the draw allows. What holds either way is that the verdict and the
109
+ // score agree, and that a wrong guess leaves the round standing.
110
+ if (relayed.result.verdict === "wrong") {
111
+ expect(relayed.result.score).toBe(0);
112
+ expect(relayed.state).toBe("playing");
113
+ expect(lastStateIn(turn.events, Board)).toMatchObject({
114
+ score: 0,
115
+ wrongGuesses: [relayed.result.guess],
116
+ });
117
+ } else {
118
+ expect(relayed.result.verdict).toBe("correct");
119
+ expect(relayed.result.score).toBe(1);
120
+ }
121
+ // Only a SCRIPT can pin the player's exact words. `WRONG_PLAYER` is what
122
+ // makes them predictable, so asserting them against a live model asserts
123
+ // the script rather than the agent — which is how this case used to fail
124
+ // on "Is it a zebra?" being a perfectly good wrong guess.
125
+ if (mode === "stub") {
126
+ // The claim this case rests on, checked rather than assumed — see
127
+ // WRONG_GUESS for the run that proved assuming it is not enough.
128
+ expect(wrongEverywhere()).toEqual([]);
129
+ expect(relayed.result).toMatchObject({
130
+ verdict: "wrong",
131
+ playerSaid: `Is it a ${WRONG_GUESS}?`,
132
+ guess: WRONG_GUESS,
133
+ score: 0,
134
+ });
135
+ }
84
136
  },
85
137
  {
86
138
  stubReply: [
@@ -90,7 +142,7 @@ describeEval(agentDef, (test) => {
90
142
  tool: "relay_description",
91
143
  args: { description: "an animal with black and white stripes, lives in Africa" },
92
144
  },
93
- "The player asks: is it a zebra crossing?",
145
+ `The player asks: is it a ${WRONG_GUESS}?`,
94
146
  ],
95
147
  stubGenerate: WRONG_PLAYER,
96
148
  },
@@ -105,9 +157,15 @@ describeEval(agentDef, (test) => {
105
157
  "start_game",
106
158
  dialogResultSchema(z.object({ word: z.string() })),
107
159
  ).result;
160
+ // A DESCRIPTION that happens to contain the word, not a question about it.
161
+ // "How would I even describe that?" is the describer asking for help, and
162
+ // a host that answered it in words — or reached for `repeat_word` — was
163
+ // reading the turn correctly while this case failed it for not relaying.
108
164
  // The host's relay below is sanitized — the word is not in the script's
109
165
  // args — and the tool still rules a foul off what the caller actually said.
110
- const turn = await session.say(`Okay, my word is ${word}. How would I even describe that?`);
166
+ const turn = await session.say(
167
+ `Okay, so ${word} — it's the sort of thing you would find around a house.`,
168
+ );
111
169
 
112
170
  const relayed = toolResultIn(
113
171
  turn.toolCalls,
@@ -122,7 +180,10 @@ describeEval(agentDef, (test) => {
122
180
  stubReply: [
123
181
  { tool: "start_game" },
124
182
  "Here's your first word.",
125
- { tool: "relay_description", args: { description: "how would I even describe that" } },
183
+ {
184
+ tool: "relay_description",
185
+ args: { description: "it's the sort of thing you would find around a house" },
186
+ },
126
187
  "You said the word - that one's forfeited. Your next word is on the screen.",
127
188
  ],
128
189
  stubGenerate: WRONG_PLAYER,
@@ -11,9 +11,29 @@ import { GAME_EVENTS, gameProjection } from "./shared.ts";
11
11
  * `relay_description`, on its own prompt with only the current word's context —
12
12
  * which is what their parallel pipeline, resampler and per-word reconnect were
13
13
  * built to arrange. The referee is a function.
14
+ *
15
+ * **No guardrails, though a game about a forbidden word looks like the template
16
+ * for them.** The rule the game turns on is the DESCRIBER's, and it is already
17
+ * mechanical — `isFoul` over `game.spoken`. It is also not a refusal: a foul
18
+ * FORFEITS the word and scores it, so an `inputGuardrails` entry, which answers
19
+ * instead of the model and runs no tool, would swallow the very turn that has to
20
+ * be recorded.
21
+ *
22
+ * The host's own rule ("never say the current word") has a legal exception every
23
+ * round — it says the word when it GIVES or REPEATS one, out of a tool result —
24
+ * and an output guardrail is handed the text and `AgentSessionContext`, which
25
+ * deliberately carries no `messages`. So it cannot tell the round's opening line
26
+ * from a hint. It would also be paid for in this template's one currency: a held
27
+ * reply cannot stream, turning time-to-first-word into time-to-last-token on a
28
+ * two-minute clock whose `bargeIn: { minWords: 1 }` exists so the describer can
29
+ * talk over the host.
14
30
  */
15
31
  export default agent({
16
32
  name: "Word Wrangler",
33
+ // The listing line — a registry row, the studio's picker, never the model.
34
+ // Three participants in one sentence, because that is the whole shape of the
35
+ // thing and what makes it worth reading `shared.ts` for.
36
+ description: "Hosts a two-minute word game between the caller and an A.I. guesser",
17
37
  // The scoreboard: the word the describer is looking at, the score, the clock.
18
38
  syncState: gameProjection,
19
39
  /**