@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
@@ -1,21 +1,22 @@
1
- # aai Voice Agent
1
+ # AssemblyAI Agent SDK
2
2
 
3
- You are helping build a voice agent using the **aai** framework.
3
+ You are helping build a voice agent with the **AssemblyAI Agent SDK**.
4
4
 
5
5
  ## Workflow
6
6
 
7
7
  The fast loop: edit → `pnpm dev` (browser, talk to it) →
8
8
  `pnpm test` (logic) → `pnpm build` (validate bundle).
9
9
 
10
- 1. **Iterate in `pnpm dev`** — browser UI, and `pnpm dev -- --watch` to
11
- rebuild and restart on every save. Speak to the agent to verify behavior
12
- end-to-end. This is the primary feedback loop. Watching is OPT-IN because a
13
- restart ends in-flight voice sessions, which is right while you are editing
14
- and wrong while something is driving the agent for twenty minutes;
15
- `AAI_DEV_WATCH=1` is the same switch for a process supervisor.
10
+ 1. **Iterate in `pnpm dev`** — browser UI, and it rebuilds and restarts on
11
+ every save when you are at a terminal. Speak to the agent to verify behavior
12
+ end-to-end. This is the primary feedback loop. Watching is on for a PERSON
13
+ and off for everything else: a restart ends in-flight voice sessions, which
14
+ is right while you are editing and wrong while something drives the agent
15
+ for twenty minutes, and a harness or supervisor has no TTY. `AAI_DEV_WATCH=0`
16
+ turns it off at a terminal, `AAI_DEV_WATCH=1` on for a process supervisor.
16
17
  2. **Run `pnpm test` after logic changes** — vitest. Co-locate tests as
17
- `agent.test.ts` (see `pipeline-simple` template for a reference).
18
- **When the project has an `agent.test.ts` (the default `simple`
18
+ `agent.test.ts` (see `custom-pipeline-agent` template for a reference).
19
+ **When the project has an `agent.test.ts` (the default `quickstart-agent`
19
20
  template and several others ship one), it is yours to maintain.** It
20
21
  asserts the agent's shape — name, providers, tool names —
21
22
  so rewriting the agent without updating it leaves a test asserting an
@@ -38,7 +39,7 @@ The fast loop: edit → `pnpm dev` (browser, talk to it) →
38
39
  thing written out.
39
40
  3. **Run `pnpm eval` when you change what the agent DOES** — a test asserts
40
41
  the agent's shape; an eval drives a real session and asserts what it did.
41
- Cases live in `agent.eval.test.ts` (the `simple` template ships one):
42
+ Cases live in `agent.eval.test.ts` (the `quickstart-agent` template ships one):
42
43
 
43
44
  ```ts no-check
44
45
  import { describeEval } from "@alexkroman1/aai-runtime/eval/vitest";
@@ -84,19 +85,19 @@ The fast loop: edit → `pnpm dev` (browser, talk to it) →
84
85
  6. **Look at templates before writing custom code** — the CLI ships working
85
86
  examples inside its own package, at
86
87
  `node_modules/@alexkroman1/aai-cli/dist/templates/`. Read them directly;
87
- `aai init --template <name>` scaffolds a fresh project from one. Closest
88
- matches: `simple`, `pipeline-simple`, `web-researcher`, `solo-rpg`,
89
- `pizza-ordering`, `retail` (the most complex — 15 tools over a
90
- relational store, with a `syncState`-driven UI). Four are ports of agents you
91
- may already know from LangChain/LangGraph, and each says in its own source
92
- what had to change: `travel-concierge` (their customer-support bot —
93
- specialist desks, and every booking staged for a spoken confirmation before
94
- it applies), `support-line` (self-RAG/CRAG — retrieve, grade what came back,
88
+ `aai init --template <name>` scaffolds a fresh project from one. Closest:
89
+ `quickstart-agent`, `custom-pipeline-agent`, `web-research-agent`,
90
+ `tabletop-rpg-agent`, `pizza-ordering-agent`, `retail-orders-agent` (the most
91
+ complex — 15 tools over a relational store with a `syncState` UI). Four are
92
+ LangChain/LangGraph ports, and each says in its own source what had to change:
93
+ `travel-concierge-agent` (their customer-support bot — specialist desks, every
94
+ booking staged for a spoken confirmation before it applies),
95
+ `technical-support-agent` (self-RAG/CRAG — retrieve, grade what came back,
95
96
  rewrite the question, and refuse to speak an answer it cannot ground),
96
- `plan-and-execute` (plan then work the plan — one step per tool call, so the
97
- caller can redirect between them), and `redline` (the reflection agent — write,
98
- critique, revise, which is too slow for a phone and so is a PAGE over a
99
- durable run rather than a voice agent). When reading SDK
97
+ `research-planner-agent` (plan then work the plan — one step per tool call, so
98
+ the caller can redirect between them), and `document-redline-workflow` (the
99
+ reflection agent — write, critique, revise; too slow for a phone, so a PAGE
100
+ over a durable run rather than a voice agent). When reading SDK
100
101
  types under
101
102
  `node_modules/@alexkroman1/aai*/dist/`, note the built entry points
102
103
  re-export with source specifiers (`"./sdk/constants.ts"`,
@@ -117,8 +118,8 @@ Then:
117
118
  aai init # Scaffold a new agent
118
119
  aai templates # List available templates
119
120
  aai dev # Start local dev server
120
- aai test # Run agent.test.ts via vitest
121
- aai test --all # ...or every spec in the project
121
+ aai test # Run the project's specs via vitest
122
+ aai test --only # ...or agent.test.ts alone
122
123
  aai eval # Run agent.eval.test.ts against a model
123
124
  aai build # Bundle and validate
124
125
  aai deploy # Deploy to production
@@ -132,12 +133,11 @@ The scaffold's `package.json` exposes `dev`, `build`, `test`, `eval` and
132
133
  `deploy` as `pnpm <name>` shortcuts, which run the project's own copy of the
133
134
  CLI. Other commands (`init`, `templates`, `delete`, `secret`) are CLI-only.
134
135
 
135
- **`aai test` targets `agent.test.ts` and nothing else**, which `--all` widens.
136
- What matters is that a narrowed run does not report itself as a pass: when the
137
- project holds spec files the run did not cover, it FAILS and names them rather
138
- than printing a green line that says nothing about `tools/*.test.ts`. `pnpm
139
- test` (the scaffold's own script) already runs the whole suite, and so does the
140
- gate in front of `aai build`.
136
+ **`aai test` runs every non-eval spec in the project**, which `--only` narrows
137
+ to `agent.test.ts` for the fast inner loop. A narrowed run does not report
138
+ itself as a pass: it names the spec files it did not cover and answers
139
+ `complete: false`. `pnpm test` (the scaffold's own script) is `aai test`, and so
140
+ is the gate in front of `aai build`.
141
141
 
142
142
  ## Running it yourself (`npm start`)
143
143
 
@@ -312,6 +312,8 @@ export default agent({
312
312
  // all four types are on "@alexkroman1/aai",
313
313
  // and on their own stage subpath
314
314
  sttPrompt?: string; // STT guidance for jargon/acronyms
315
+ voicePresets?: VoicePresetName[]; // opt-in prompt presets — see below; each one
316
+ // costs tokens on EVERY model request
315
317
  builtinTools?: BuiltinTool[]; // see built-in tools table
316
318
  // (there is no `tools` field — a tool is a FILE;
317
319
  // see "A file in tools/ IS a tool")
@@ -411,18 +413,12 @@ import { agent } from "@alexkroman1/aai";
411
413
  export default agent({ name: "My Agent" });
412
414
  ```
413
415
 
414
- Declare neither and the agent runs on `DEFAULT_SYSTEM_PROMPT`, exported from
415
- `@alexkroman1/aai` so you can read what you are replacing — or compose against
416
- it, rather than restating the voice rules at the bottom of this guide:
417
-
418
- ```ts
419
- import { DEFAULT_SYSTEM_PROMPT, agent } from "@alexkroman1/aai";
420
-
421
- export default agent({
422
- name: "My Agent",
423
- systemPrompt: `${DEFAULT_SYSTEM_PROMPT}\n\nYou only ever discuss pizza.`,
424
- });
425
- ```
416
+ **Your prompt is ADDED to the defaults, never a replacement** — the framework
417
+ emits its voice sections and appends yours last, yours winning on conflict.
418
+ Write ONLY your own domain rules; never interpolate `DEFAULT_SYSTEM_PROMPT`
419
+ (exported to be READ). Nothing is replaced, so composing sends ~10,000
420
+ characters twice a turn; a leading copy is dropped with a warning, one
421
+ elsewhere is sent.
426
422
 
427
423
  ```markdown
428
424
  <!-- system-prompt.md -->
@@ -795,10 +791,10 @@ Five things worth knowing:
795
791
  #### A third-party callback is an OPTIMIZATION over a reconciling read
796
792
 
797
793
  The webhook route is how a payment provider, a transcription service or an
798
- approval mailer resumes a run, and `recap-workflow` is the worked example — it
799
- hands AssemblyAI a `webhook_url` and parks on the delivery instead of polling
800
- for twenty minutes. Five things about that shape, and every one of them is a
801
- trap somebody has already paid for:
794
+ approval mailer resumes a run, and `meeting-recap-agent` is the worked example —
795
+ it hands AssemblyAI a `webhook_url` and parks on the delivery instead of polling
796
+ for twenty minutes. Five things about that shape, every one a trap somebody has
797
+ already paid for:
802
798
 
803
799
  - **Mint it with `stepWebhookUrl(token)`, from inside the step that hands it
804
800
  over.** That is the step-side half of `ctx.workflows.publicWebhookUrl` — the
@@ -1025,7 +1021,7 @@ export async function measure(uploadId: string) {
1025
1021
  }
1026
1022
  ```
1027
1023
 
1028
- `call-audit` is the worked example for all three at once.
1024
+ `call-audit-workflow` is the worked example for all three at once.
1029
1025
 
1030
1026
  ### Posting somewhere — `@alexkroman1/aai/channels`
1031
1027
 
@@ -1049,11 +1045,11 @@ export async function announce(headline: string, points: string[]) {
1049
1045
 
1050
1046
  The webhook URL is a secret like any other — declare it in `requiredEnv` and set
1051
1047
  it with `aai secret put`. A channel's credential is its DESTINATION and is
1052
- passed in, which is why no channel reads an env var of its own. `ChannelMessage`
1053
- is rendered per platform, so the same message is legal on a channel kind added
1048
+ passed in, so no channel reads an env var of its own. `ChannelMessage` is
1049
+ rendered per platform, so the same message is legal on a channel kind added
1054
1050
  later; `isSlackWebhookUrl` / `isSlackWorkflowTriggerUrl` validate a pasted URL
1055
- before a run depends on it, and `explainChannelFailure` turns a refusal into a sentence
1056
- a person can act on. `podcast-digest` is the worked example.
1051
+ before a run depends on it, and `explainChannelFailure` turns a refusal into a
1052
+ sentence a person can act on. `podcast-digest-workflow` is the worked example.
1057
1053
 
1058
1054
  ### A step's HTTP: use `stepFetch`, not `fetch`
1059
1055
 
@@ -1126,9 +1122,9 @@ it for free.
1126
1122
  ### A step can SPEAK, and store the file it made
1127
1123
 
1128
1124
  A workflow whose answer is a FILE — a summary read aloud, a rendered image, a
1129
- generated PDF — needs two things a first draft reaches for and does not find.
1130
- Both are on `@alexkroman1/aai/step`, and `spoken-summary` is the template that
1131
- shows the whole round trip.
1125
+ generated PDF — needs two things a first draft reaches for and misses.
1126
+ Both are on `@alexkroman1/aai/step`, and `spoken-summary-workflow` shows the
1127
+ whole round trip.
1132
1128
 
1133
1129
  ```ts
1134
1130
  import { stepSpeak, stepWriteUpload } from "@alexkroman1/aai/step";
@@ -1394,9 +1390,7 @@ bridge transcodes in both directions, so the agent, its tools and its slots
1394
1390
  behave exactly as they do in the browser — a phone call is a transport, not a
1395
1391
  mode. Nothing else about `agent.ts` changes to support one.
1396
1392
 
1397
- **An agent that declares nothing answers no carrier**, which is a change from
1398
- earlier releases: every voice agent used to serve both carriers' framing from
1399
- the moment it booted, whether or not it had a phone number. `/phone` is the one
1393
+ **An agent that declares nothing answers no carrier.** `/phone` is the one
1400
1394
  door dialled from OUTSIDE your deployment, by a carrier following a number, so
1401
1395
  it is opened by a sentence in `agent.ts` rather than inherited. `aai dev` and a
1402
1396
  deployed sandbox honour the same declaration, so a call refused after a deploy
@@ -1788,10 +1782,10 @@ export const checkout = dialog("checkout", {
1788
1782
 
1789
1783
  A tool declared with `checkout.tool({...})` is REFUSED unless the dialog is in a
1790
1784
  state that allows it, and the refusal reaches the model as a `ToolFailure` it
1791
- can recover from — the point being that the gate is enforced at EXECUTION
1792
- rather than hoped for in a prompt. The states and events are inferred from the
1793
- spec, so a misspelled `send` is a compile error. `dispatch-center` and
1794
- `solo-rpg` are the worked examples.
1785
+ can recover from — the gate is enforced at EXECUTION rather than hoped for in a
1786
+ prompt. The states and events are inferred from the spec, so a misspelled `send`
1787
+ is a compile error. `emergency-dispatch-agent` and `tabletop-rpg-agent` are the
1788
+ worked examples.
1795
1789
 
1796
1790
  **`procedure()` runs a flow YOU drive, with no model in the loop.** Where a
1797
1791
  dialog constrains a conversation, a procedure is an algorithm with branches,
@@ -1806,10 +1800,10 @@ const result = await answer.run({ question }, { signal: ctx.signal });
1806
1800
  ```
1807
1801
 
1808
1802
  `run` resolves with the machine's output, or throws `ProcedureNotFinishedError`
1809
- if it stops without reaching a final state — which is what makes "we ran out of
1803
+ if it stops without reaching a final state — which makes "we ran out of
1810
1804
  attempts" a state you declare and handle rather than an error. Options are
1811
1805
  `ProcedureRunOptions`; the machine is an XState machine, and `xstate` is already
1812
- an SDK dependency. `support-line` is the worked example.
1806
+ an SDK dependency. `technical-support-agent` is the worked example.
1813
1807
 
1814
1808
  ### Subagents (`ctx.delegate`)
1815
1809
 
@@ -2113,15 +2107,13 @@ wrong in ways that only show up on real pages: `<[^>]+>` cuts a tag whose
2113
2107
  attribute contains a `>`, `<script[^>]*>[\s\S]*?<\/script>` leaves the whole
2114
2108
  script in your prompt when the page was truncated mid-tag, and
2115
2109
  `indexOf("<title>")` finds an entry's title rather than a channel's. The
2116
- `link-digest` and `podcast-digest` templates each shipped a version of those
2110
+ `link-digest-workflow` and `podcast-digest-workflow` templates each shipped one
2117
2111
  before this subpath existed.
2118
2112
 
2119
2113
  ## Persisting data — bring your own client
2120
2114
 
2121
- **There is no `ctx.db`.** It was a SQL handle on the tool context, backed first
2122
- by a Postgres the platform provisioned per app and later by a `DATABASE_URL` an
2123
- author set. The platform provisions no database, and no longer hands tool code
2124
- one either.
2115
+ **There is no `ctx.db`.** The platform provisions no database and hands tool
2116
+ code none.
2125
2117
 
2126
2118
  So a tool that needs to persist anything uses a client of its own:
2127
2119
 
@@ -2377,8 +2369,8 @@ import { Form, WorkflowFields } from "@alexkroman1/aai-ui";
2377
2369
  </Form>;
2378
2370
  ```
2379
2371
 
2380
- `transcription-workflow` is the all-declared version; `link-digest` writes its
2381
- form by hand, which is what the two are for.
2372
+ `transcription-workflow` is the all-declared version; `link-digest-workflow`
2373
+ writes its form by hand, which is what the two are for.
2382
2374
 
2383
2375
  The usual shape — note `StartScreen` **wraps** the app rather than sitting
2384
2376
  beside it; writing `<StartScreen ... />` self-closing is a `TS2741:
@@ -2448,14 +2440,24 @@ Never hardcode secrets in agent code.
2448
2440
 
2449
2441
  ## Voice rules for systemPrompt
2450
2442
 
2451
- - Short, punchy sentences — optimize for speech, not text
2452
- - Never mention "search results" or "sources" — speak as if knowledge is
2453
- your own
2454
- - No visual formatting (bullets, bold) — use "First", "Next", "Finally"
2455
- - Lead with the most important information
2456
- - Keep answers to 1-3 sentences
2457
- - No exclamation points — calm, conversational tone
2458
- - No hedging ("It seems that", "I believe")
2443
+ **Don't restate the voice rules — the framework always emits them** (read
2444
+ `DEFAULT_SYSTEM_PROMPT`; your own prompt is APPENDED to it). Write only what
2445
+ the defaults cannot say: "use run_code for ANY math", "you ARE the game".
2446
+ "Search first" and "don't guess" they already say.
2447
+
2448
+ ### Opt-in prompt presets
2449
+
2450
+ `agent({ voicePresets: ["echoVerification", "natoAlphabet"] })` switches on
2451
+ named behaviours instead of writing them. They compose, each is removable on
2452
+ its own, and each is paid for on EVERY model request: `echoVerification`
2453
+ (~190 tokens — read critical values back and get a yes), `speechNormalization`
2454
+ (~920 — money, dates, phone numbers and emails as spoken words, `"$758.08"`
2455
+ as "seven fifty-eight dollars and eight cents") and `natoAlphabet` (~190 —
2456
+ "That's B as in Bravo, 7, K as in Kilo, 2 — correct?"). `VOICE_PRESETS` holds
2457
+ the exact text. The two spelling presets override the default "don't spell
2458
+ things back", so use them where a wrong value costs more than a slow call;
2459
+ `speechNormalization` is the PROMPT layer only, and for the agent's OWN data
2460
+ the renderers below do it in code for free.
2459
2461
 
2460
2462
  **Speech goes both ways, and `@alexkroman1/aai` publishes both conversions.**
2461
2463
  Inbound: `spokenDigits("four one five")` is `"415"`, `spokenOrdinal("the third
@@ -2464,7 +2466,7 @@ phrase meant — answering a `ToolFailure` when nothing matches or several do, t
2464
2466
  case a hand-written `.find()` gets wrong.
2465
2467
 
2466
2468
  Outbound: an engine handed `$240.50` may read "dollar sign two hundred forty
2467
- point five zero", and `19:30` as "nineteen thirty" — right text, wrong call.
2469
+ point five zero" — right text, wrong call.
2468
2470
  Render the words first: `spokenMoney(240.5)` is `"240 dollars and 50 cents"`,
2469
2471
  `spokenDate("2026-06-08")` is `"Monday, June 8"`, `spokenTime("18:30")` is
2470
2472
  `"6:30 PM"`. `mintCode("HTL")` mints a reference with no `0`/`O`, `1`/`I` or
@@ -2481,19 +2483,9 @@ substitute, so a dice roll or a minted code is something a spec can assert.
2481
2483
  `randomInt`, `pickOne` and `shuffled` take it last. A WORKFLOW body wants its
2482
2484
  own journaled `ctx.random()` instead.
2483
2485
 
2484
- Patterns by agent type:
2485
-
2486
- - **Code execution:** "You MUST use run_code for ANY math, counting, or
2487
- data processing. NEVER do mental math."
2488
- - **Research:** "Search first. Never guess or rely on memory for factual
2489
- questions."
2490
- - **FAQ/support:** "Base answers strictly on your knowledge — don't guess."
2491
- - **Game/interactive:** "You ARE the game. Keep descriptions to 2-4
2492
- sentences. No visual formatting."
2493
-
2494
2486
  ## Gotchas
2495
2487
 
2496
- Common mistakes when working in aai projects:
2488
+ Common mistakes when working in agent projects:
2497
2489
 
2498
2490
  - **Tool execute must return a value.** A missing return = `undefined` in
2499
2491
  LLM context = the model thinks the tool failed.
@@ -2513,20 +2505,15 @@ Common mistakes when working in aai projects:
2513
2505
  `client.tsx`. Missing this = unstyled UI.
2514
2506
  - **Don't create `tailwind.config.js`.** Tailwind v4 is configured via
2515
2507
  CSS; the config file is ignored.
2516
- - **Voice prompts ≠ chat prompts.** No bullets, no bold, no exclamation
2517
- points. See "Voice rules" above.
2518
2508
  - **`fetch` to private IPs is blocked** (SSRF protection). Use public URLs.
2519
2509
  - **`run_code` only executes on the deployed platform.** It runs inside the
2520
2510
  platform's Modal/Deno sandbox; the self-hosted `aai dev` server has no
2521
2511
  sandbox, so there `run_code` refuses with an error result. Deploy to test
2522
2512
  it end-to-end, or use the `calculate` builtin for simple arithmetic in dev.
2523
- - **There is no `ctx.db`.** The platform provisions no database and hands tool
2524
- code none, so a tool that persists brings its own client — see "Persisting
2525
- data". Two consequences worth knowing before you do: a deployed agent reads a
2526
- secret when its sandbox is BUILT, so a newly set `DATABASE_URL` reaches it on
2527
- the next deploy rather than immediately; and a database you bring is shared by
2528
- every session of the deployment, so key rows yourself if sessions must not see
2529
- each other's data (or keep session-scoped data in a `sessionSlot`).
2513
+ - **There is no `ctx.db`.** A tool that persists brings its own client — see
2514
+ "Persisting data". A secret is read when the sandbox is BUILT, so a newly set
2515
+ `DATABASE_URL` arrives on the next deploy rather than immediately, and the
2516
+ database is shared by every session, so key rows yourself.
2530
2517
  - **Rime language codes are ISO 639-3** (3-letter, e.g. `"eng"`), not
2531
2518
  ISO 639-1 (`"en"`).
2532
2519
 
@@ -9,16 +9,16 @@
9
9
  "prestart": "aai build --skip-tests",
10
10
  "start": "aai start",
11
11
  "build": "aai build",
12
- "test": "vitest run --exclude \"**/*.eval.test.*\"",
13
- "test:agent": "aai test",
12
+ "test": "aai test",
13
+ "test:agent": "aai test --only",
14
14
  "eval": "aai eval",
15
15
  "publish:agent": "aai publish"
16
16
  },
17
17
  "dependencies": {
18
- "@alexkroman1/aai": "^16.0.1",
19
- "@alexkroman1/aai-cli": "^16.0.1",
20
- "@alexkroman1/aai-runtime": "^16.0.1",
21
- "@alexkroman1/aai-ui": "^16.0.1",
18
+ "@alexkroman1/aai": "^17.0.0",
19
+ "@alexkroman1/aai-cli": "^17.0.0",
20
+ "@alexkroman1/aai-runtime": "^17.0.0",
21
+ "@alexkroman1/aai-ui": "^17.0.0",
22
22
  "react": "^19.2.8",
23
23
  "react-dom": "^19.2.8",
24
24
  "tailwindcss": "^4.0.0",
@@ -3,7 +3,35 @@ import react from "@vitejs/plugin-react";
3
3
  import { defineConfig } from "vite";
4
4
 
5
5
  export default defineConfig({
6
- plugins: [react(), tailwindcss()],
6
+ plugins: [
7
+ react({
8
+ // React Fast Refresh makes any module that DECLARES a component a
9
+ // boundary, but can only refresh one whose every EXPORT is a component.
10
+ // A module that is a boundary and cannot be refreshed is the worst case:
11
+ // it gets re-executed, and only then discarded for a page reload. Two
12
+ // kinds of file here are exactly that, and both must be named because
13
+ // passing `exclude` replaces the plugin's default — hence node_modules
14
+ // below, which is that default.
15
+ //
16
+ // `dist/`: a prebuilt dependency. A bundled chunk mixes components with
17
+ // constants, so it can never be a valid boundary. The node_modules
18
+ // default normally hides this, and does NOT when a package is LINKED,
19
+ // because the symlink resolves to a real path outside node_modules.
20
+ // Measured against a linked `@alexkroman1/aai-ui`: one rebuild of it
21
+ // produced 33 partial updates, 12 invalidations and 8 throws of "Session
22
+ // hooks must be used within <SessionProvider>" — a re-executed context
23
+ // module mints a fresh context while the mounted tree holds the old one.
24
+ //
25
+ // `client.tsx`: the entry MOUNTS. Re-executing it is a second
26
+ // `mountClient()` on the same element ("ReactDOMClient.createRoot() on a
27
+ // container that has already been passed to createRoot()"), and since it
28
+ // exports nothing it could never have refreshed anyway. Excluded, an edit
29
+ // to it is one clean page reload — and a component in its OWN file still
30
+ // fast-refreshes, which is the reason to put it there.
31
+ exclude: [/\/node_modules\//, /\/dist\//, /\/client\.tsx$/],
32
+ }),
33
+ tailwindcss(),
34
+ ],
7
35
  build: {
8
36
  target: "es2022",
9
37
  minify: true,
package/dist/start.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { n as log } from "./_ui-DCt4qZrk.mjs";
3
3
  import { n as WORKER_ARTIFACT_REL, t as CLIENT_ARTIFACT_REL } from "./_artifacts-BJOYGQPp.mjs";
4
- import { n as resolveServerEnv, t as DEPLOY_ENV_FILES } from "./_server-common-De0haHr9.mjs";
4
+ import { i as resolveServerEnv, n as DEPLOY_ENV_FILES } from "./_server-common-DAcv1nC5.mjs";
5
5
  import { existsSync } from "node:fs";
6
6
  import path from "node:path";
7
7
  import { pathToFileURL } from "node:url";
@@ -3,9 +3,9 @@ import { a as ok, t as CliError } from "./_output-DBP9Op_d.mjs";
3
3
  import { n as log, t as fmtUrl } from "./_ui-DCt4qZrk.mjs";
4
4
  import { l as formatCappedList } from "./_utils-D5JGcjiW.mjs";
5
5
  import { s as updateProjectConfig } from "./_config-DYzC6WMD.mjs";
6
- import { n as resolveServerEnv } from "./_server-common-De0haHr9.mjs";
6
+ import { i as resolveServerEnv } from "./_server-common-DAcv1nC5.mjs";
7
7
  import { o as resolveDeployTarget } from "./_agent-BzUeqOdj.mjs";
8
- import { layerScaffold } from "./_templates-CuP74F8D.mjs";
8
+ import { layerScaffold } from "./_templates-IMeKMVIj.mjs";
9
9
  import { a as publishStudioProject, c as studioProjectUrl, f as checkedResponse, i as projectNameFromDir, n as fetchStudioProject, o as pushStudioSource, r as listStudioProjects, s as studioProjectApiUrl, t as collectSourceFiles, u as apiRequest } from "./_studio-DnR_BqFp.mjs";
10
10
  import { existsSync } from "node:fs";
11
11
  import path from "node:path";
@@ -145,10 +145,23 @@ async function executePush(opts) {
145
145
  });
146
146
  }
147
147
  /**
148
- * Mirror `.env` into the deployed agent's secrets (the same `/:slug/secret`
149
- * routes `aai secret` uses). Secrets are merged into the agent env at
150
- * deploy time, which is why publish syncs them BEFORE deploying when the
151
- * slug is already known.
148
+ * Mirror `.env` into the project's secrets, which is what makes this callable
149
+ * BEFORE anything has been deployed.
150
+ *
151
+ * The route is the PROJECT's (`/studio/projects/:project/secret`), and that is
152
+ * the whole reason publish syncs unconditionally rather than only once a slug
153
+ * exists. A project holds its own secret record — `studio-secrets.ts` argues
154
+ * it, and the argument is exactly this failure: writing only to the slugs that
155
+ * exist forces "deploy it broken, then attach the key, then deploy again",
156
+ * which was the shortest path to a working agent and is not an order anybody
157
+ * should have to learn. `reconcileProjectSecrets` is wired as the broker's
158
+ * post-deploy hook and FLOORS a newly minted slug from that record, so the
159
+ * deploy this call precedes picks the values up as it claims its slug — and
160
+ * the preview agent, auto-deployed on the first edit, gets them too.
161
+ *
162
+ * Only the project row has to exist, and `pushProject` has already created it:
163
+ * server-side, a project with nothing deployed resolves to an empty target set
164
+ * and the record write is the whole operation.
152
165
  */
153
166
  async function syncEnvSecrets(cwd, serverUrl, apiKey, project) {
154
167
  const env = await resolveServerEnv(cwd);
@@ -168,7 +181,7 @@ async function executePublish(opts) {
168
181
  await assertTypechecks(opts.cwd, { skip: opts.skipTypecheck });
169
182
  const pushed = await pushProject(opts);
170
183
  const { project, serverUrl, apiKey } = pushed;
171
- if (pushed.slug) await syncEnvSecrets(opts.cwd, serverUrl, apiKey, project);
184
+ await syncEnvSecrets(opts.cwd, serverUrl, apiKey, project);
172
185
  log.step(`Publishing ${project} (builds in the project's sandbox)…`);
173
186
  const result = checkedResponse(await publishStudioProject(serverUrl, apiKey, project, { skipTypecheck: opts.skipTypecheck }), (value) => isRecord(value) && typeof value.slug === "string" && typeof value.output === "string", `the publish route at ${serverUrl}`);
174
187
  if (result.output.trim()) log.message(result.output.trim());
@@ -176,9 +189,6 @@ async function executePublish(opts) {
176
189
  serverUrl,
177
190
  slug: result.slug
178
191
  });
179
- if (!pushed.slug) {
180
- if ((await syncEnvSecrets(opts.cwd, serverUrl, apiKey, result.slug)).length > 0) log.info("They apply on the next `aai publish`.");
181
- }
182
192
  const agentUrl = `${serverUrl}/${result.slug}`;
183
193
  const studioUrl = studioProjectUrl(serverUrl, project);
184
194
  log.success(`Published ${fmtUrl(agentUrl)}`);
@@ -28,6 +28,7 @@ import { countWords } from "@alexkroman1/aai/utils";
28
28
  import {
29
29
  describeTurn,
30
30
  type EvalSession,
31
+ expectCalled,
31
32
  lastStateIn,
32
33
  toolNames,
33
34
  toolResultIn,
@@ -165,7 +166,11 @@ describeEval(agentDef, (test) => {
165
166
  // The browser was sent the whole table, not the three the caller heard.
166
167
  const view = hiringState(session);
167
168
  expect(view?.leaderboard).toHaveLength(LEADS.length);
168
- expect(view?.jobTitle).toBe("Junior React Developer");
169
+ // CONTAINS, not equals: the title is whatever the desk passed through from
170
+ // the caller, who said "the Junior React Developer contract" — so a model
171
+ // that carried the word "contract" across was being faithful, and pinning
172
+ // the exact string failed it for that.
173
+ expect(view?.jobTitle).toContain("Junior React Developer");
169
174
  // Nothing outside the desk's own six tools was called: the evaluator is a
170
175
  // `ctx.generate` inside a tool, never a tool the desk holds.
171
176
  expect(toolNames(turn.toolCalls).filter((name) => !DESK_TOOLS.includes(name))).toEqual([]);
@@ -190,11 +195,20 @@ describeEval(agentDef, (test) => {
190
195
  const calls = turn.toolCalls.filter((call) => call.name === "screen_candidates");
191
196
  expect(calls, describeTurn(turn)).toHaveLength(1);
192
197
  const screened = toolResultIn(turn.toolCalls, "screen_candidates", Screened);
193
- // Their "don't use numbers like 100, 75, or 50" rule, measured: a live
194
- // evaluator that ties three applicants at 75 has produced a list, not a
195
- // ranking, and the desk cannot read back "who stands out" from a tie.
198
+ // Their "don't use numbers like 100, 75, or 50" rule, measured — but only
199
+ // as far as the rule can reach. Each candidate is a SEPARATE
200
+ // `ctx.generate` that never sees the others' numbers, so two independent
201
+ // evaluations landing on the same score is arithmetic rather than a
202
+ // failure, and demanding all three distinct failed this case on a 2-of-3
203
+ // collision. What the rule actually buys is numbers specific enough that
204
+ // the sort is a RANKING and not the three-way tie at 75 it was written
205
+ // against.
196
206
  const scores = screened.top.map((one) => one.score);
197
- expect(new Set(scores).size).toBe(scores.length);
207
+ expect(new Set(scores).size, JSON.stringify(scores)).toBeGreaterThan(1);
208
+ for (const score of scores) expect([50, 75, 100]).not.toContain(score);
209
+ // And the read-back order IS those numbers sorted — not the desk's own
210
+ // view of twelve bios.
211
+ expect([...scores].sort((a, b) => b - a)).toEqual(scores);
198
212
  for (const one of screened.top) expect(one.reason.length).toBeGreaterThan(30);
199
213
  // What the caller HEARS names the evaluator's top pick. A desk that read
200
214
  // twelve bios and formed its own view would name whoever it fancied.
@@ -221,7 +235,7 @@ describeEval(agentDef, (test) => {
221
235
  // it has no scores of its own to re-order by — and it must not screen from
222
236
  // scratch, which would throw the ranking the caller just heard away.
223
237
  const names = toolNames(turn.toolCalls);
224
- expect(names, describeTurn(turn)).toContain("rescore_with_feedback");
238
+ expectCalled(turn, "rescore_with_feedback");
225
239
  expect(names).not.toContain("screen_candidates");
226
240
  const rescored = toolResultIn(turn.toolCalls, "rescore_with_feedback", Rescored);
227
241
  expect(rescored.state).toBe("reviewing");
@@ -29,6 +29,34 @@ import { hiringProjection } from "./shared.ts";
29
29
  */
30
30
  export default agent({
31
31
  name: "Hiring Desk",
32
+ description:
33
+ "Screens a stack of applicants against a role and drafts each of them a follow-up email",
34
+ /**
35
+ * A ceiling on what one hiring call may spend.
36
+ *
37
+ * **This is the template where a budget has to cover DELEGATION, and until
38
+ * the meter did, it could not.** Almost nothing this desk spends is spent in
39
+ * the conversation: one screening round is twelve `ctx.generate({ schema })`
40
+ * calls through `scoreCandidates`, the caller may ask for up to
41
+ * `MAX_FEEDBACK_ROUNDS` more (`shared.ts`), and `proceed_to_emails` then runs twelve
42
+ * `ctx.delegate` subagents — each a full tool loop with a guardrail that may
43
+ * send an answer back. A cap that counted only the turns would bound the
44
+ * cheapest part of the call while reading as though it bounded the call;
45
+ * `UsageLimits` says which calls count, and all of the above do.
46
+ *
47
+ * The number is an ORDER OF MAGNITUDE rather than a measurement — nobody has
48
+ * run this against a real model and totalled it. It is sized from the shape:
49
+ * four scoring rounds of twelve, plus twelve emails and their revisions, plus
50
+ * the conversation around them, then multiplied to leave a legitimate call
51
+ * comfortably clear. What it catches is a desk left in a loop, not a hiring
52
+ * manager who is thorough. Pick yours from what `usage.updated` reports on a
53
+ * real screening.
54
+ *
55
+ * Reaching it ends the session at the next turn; a `ctx.generate` or
56
+ * `ctx.delegate` in between is refused with the same reason, which
57
+ * `mapSettled` reports per candidate rather than losing the whole fan-out.
58
+ */
59
+ usageLimits: { totalTokens: 750_000 },
32
60
  // The ranking, the feedback trail and the drafts' subject lines, pushed after
33
61
  // every tool call — a leaderboard is the one thing here nobody can hold by ear.
34
62
  syncState: hiringProjection,
@@ -226,7 +226,7 @@ export type Scored = Settled<Candidate, CandidateScore>;
226
226
  * Their `score_leads`: every candidate through Crew A, concurrently.
227
227
  *
228
228
  * Settled per candidate rather than raced to the first rejection, for the
229
- * reason `briefing-desk` settles its angles: a caller on the phone would rather
229
+ * reason `topic-briefing-agent` settles its angles: a caller on the phone would rather
230
230
  * hear eleven scores and one apology than an error, and the one that failed
231
231
  * is named so the desk can offer to score them again. `mapSettled` is that
232
232
  * policy — the `try` around each item, the window, and the item kept beside
@@ -327,21 +327,21 @@ export function describeRanked(candidate: RankedCandidate): string {
327
327
  * How a caller names one of twelve applicants — the desk's own vocabulary,
328
328
  * which is the half {@link resolveOne} does not own.
329
329
  *
330
- * A name matches on WHOLE parts: every part of the candidate's name the
331
- * utterance contains scores one, so "Priya" and "Raman" each resolve and
332
- * "Priya Raman" outscores both — a substring test would let "an" match Raman,
333
- * Tanaka and Kowalski at once. Declared as a constant rather than inline
334
- * because the annotation is what types `candidate` and `text` here; the three
335
- * tools that resolve a candidate all reach it through the one function below.
330
+ * A name matches on WHOLE parts, which is `resolveOne`'s `match`: every part of
331
+ * the candidate's name the utterance also says scores one, so "Priya" and
332
+ * "Raman" each resolve and "Priya Raman" outscores both. The hand-written
333
+ * version this replaces argued for exactly that and did not deliver it — it
334
+ * tested each part as a SUBSTRING of the utterance with a two-character floor,
335
+ * which is the shape that lets "an" match Raman, Tanaka and Kowalski at once.
336
+ * It also split on whitespace, so `Liam O'Connor` matched only an utterance
337
+ * STT punctuated identically. Declared as a constant rather than inline
338
+ * because the annotation is what types `candidate` here; the three tools that
339
+ * resolve a candidate all reach it through the one function below.
336
340
  */
337
341
  const CANDIDATE_MATCH: ResolveOneOptions<RankedCandidate> = {
338
342
  label: "candidate",
339
343
  describe: describeRanked,
340
- score: (candidate, text) =>
341
- candidate.name
342
- .toLowerCase()
343
- .split(/\s+/)
344
- .filter((part) => part.length > 1 && text.includes(part)).length,
344
+ match: (candidate) => candidate.name,
345
345
  };
346
346
 
347
347
  /**
@@ -20,7 +20,7 @@ import {
20
20
  * `hiringSlot.tool` rather than a `tool()` opening with `hiringSlot.get(ctx)`.**
21
21
  * The declaration is what makes "does this write?" visible: the body is handed
22
22
  * the state already frozen, so a line that tried to mutate it stops compiling
23
- * instead of throwing on the first live call. `plan-and-execute`'s `plan_status`
23
+ * instead of throwing on the first live call. `research-planner-agent`'s `plan_status`
24
24
  * is the same tool in the same position.
25
25
  */
26
26
  export default hiringSlot.tool({