@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
@@ -49,7 +49,7 @@
49
49
  * and it pays for the breadth with seven baselined occurrences in this repo.
50
50
  * Measured before writing this: a faithful port reports **all seven and nothing
51
51
  * else** — and all seven are correct code. Each is a read inside a step-called
52
- * helper (`timed`, `pollTranscript`, `file`), which `link-digest`'s own comment
52
+ * helper (`timed`, `pollTranscript`, `file`), which `link-digest-workflow`'s own comment
53
53
  * explains: "the `ctx.step` callback boundary is not decidable from a line …
54
54
  * Anything at BODY level is the bug, not an exception."
55
55
  *
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env node
2
- import { _ as DENO_ENTRY_FILE, a as VERCEL_ENTRY_SOURCE, c as VERCEL_STATIC_DIR, d as MODAL_ENTRY_FILE, f as MODAL_ENTRY_SOURCE, g as DENO_CONFIG_SOURCE, h as DENO_CONFIG_FILE, i as VERCEL_BUILD_CONFIG_SOURCE, l as vercelFunctionConfigSource, m as MODAL_PORT, n as TARGET_OUTPUTS, o as VERCEL_FUNCTION_DIR, p as MODAL_OUTPUT_DIR, r as resolveBuildTarget, s as VERCEL_OUTPUT_DIR, u as MODAL_APP_FILE, v as DENO_ENTRY_SOURCE, y as DENO_OUTPUT_DIR } from "./_build-target-55dJisQ-.mjs";
2
+ import { _ as DENO_CONFIG_FILE, a as resolveDeploySteps, b as DENO_ENTRY_SOURCE, c as VERCEL_FUNCTION_DIR, d as vercelFunctionConfigSource, f as modalAppSource, g as MODAL_OUTPUT_DIR, h as MODAL_ENTRY_SOURCE, i as resolveBuildTarget, l as VERCEL_OUTPUT_DIR, m as MODAL_ENTRY_FILE, n as SECRET_NAME_PLACEHOLDER, o as VERCEL_BUILD_CONFIG_SOURCE, p as MODAL_APP_FILE, r as TARGET_OUTPUTS, s as VERCEL_ENTRY_SOURCE, u as VERCEL_STATIC_DIR, v as DENO_CONFIG_SOURCE, x as DENO_OUTPUT_DIR, y as DENO_ENTRY_FILE } from "./_build-target-C08aM-Es.mjs";
3
3
  import { a as ok, t as CliError } from "./_output-DBP9Op_d.mjs";
4
4
  import { n as log, r as notify } from "./_ui-DCt4qZrk.mjs";
5
5
  import { n as withPreservedNodeEnv } from "./_vite-env-kejF0p2L.mjs";
6
6
  import { n as WORKER_ARTIFACT_REL, t as CLIENT_ARTIFACT_REL } from "./_artifacts-BJOYGQPp.mjs";
7
- import { r as evalWorkerBundle, t as buildAgentBundle } from "./_bundler-DM0d0M7m.mjs";
7
+ import { r as declaredEnvNames, t as DEPLOY_ENV_DECLARATION_FILE } from "./_server-common-DAcv1nC5.mjs";
8
+ import { i as evalWorkerConfig, r as evalWorkerBundle, t as buildAgentBundle } from "./_bundler-DM0d0M7m.mjs";
8
9
  import { assertTypechecks } from "./_typecheck-gate-U3jcil8L.mjs";
9
- import { n as classifyVitestError, r as runVitest } from "./_vitest-runner-AVR9VtXh.mjs";
10
- import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-CvpqMpdh.mjs";
11
- import { TEST_FILES } from "./test-Cllnx81G.mjs";
10
+ import { n as classifyVitestError, r as runVitest } from "./_vitest-runner-CZNGj0ZC.mjs";
11
+ import { n as scanWorkflowDeterminism, t as determinismWarnings } from "./_workflow-determinism-CLxFQ5ox.mjs";
12
+ import { TEST_FILES } from "./test-CjKPQ9_B.mjs";
12
13
  import path from "node:path";
13
14
  import fs from "node:fs/promises";
14
15
  import { invariant } from "@alexkroman1/aai/internal";
@@ -35,11 +36,77 @@ import { DEFAULT_SYSTEM_PROMPT } from "@alexkroman1/aai";
35
36
  * A bundle removes the question. The host resolves nothing, installs nothing,
36
37
  * and what runs is what the project's own lockfile pinned.
37
38
  *
39
+ * ...as long as the bundle really has nothing left to resolve, which is what
40
+ * {@link JSDOC_FREE_COMMENTS} is about — a bundle can carry a dependency it
41
+ * never imports.
42
+ *
38
43
  * The entry is written INTO the project rather than a temp directory, because
39
44
  * that is what makes `@alexkroman1/aai-cli/start` resolve against the user's
40
45
  * install. Removed in a `finally`: a build that throws must not leave a file
41
46
  * that looks authored.
42
47
  */
48
+ /**
49
+ * Drop JSDoc from the bundle, and KEEP the other two comment classes.
50
+ *
51
+ * ## A commented `import()` is a real dependency
52
+ *
53
+ * A JSDoc `@type {import(<specifier>).Webidl}` is a comment to every runtime
54
+ * that executes this file and an EDGE in the module graph to every tool that
55
+ * walks it. Deno resolves the specifier out of a JSDoc type position, so a
56
+ * bundle full of third-party JSDoc arrives at Deno Deploy carrying dependencies
57
+ * that were never bundled because nothing imports them.
58
+ *
59
+ * **Every specifier below is written with a `<placeholder>` rather than
60
+ * quoted**, and that is this bug rather than pedantry: spelling them the real
61
+ * way made `pnpm check:knip` fail on THIS file, reporting `selderee` as an
62
+ * unlisted dependency and undici's relative path as an unresolved import — a
63
+ * comment describing the defect reproducing it, in a second graph-walking tool.
64
+ * Keep the placeholders.
65
+ *
66
+ * **Deno Deploy TOLERATES them today, and that is not a reason to ship them.**
67
+ * Measured, because the first version of this comment guessed otherwise and was
68
+ * wrong: a `quickstart-agent` emit carrying all the JSDoc below deployed and
69
+ * served a full voice session, so nothing here is load-bearing for that host.
70
+ * What the phantom edges cost is the property `app.py` states in its own header
71
+ * — "a bundle with no imports left to resolve" — which was false: `deno info`
72
+ * on the emitted entry reported NINE unresolvable specifiers, and after this
73
+ * setting reports zero. Any tool that walks the graph rather than executing it
74
+ * sees them (`deno info`, `deno check`, `@vercel/nft`), and a host that starts
75
+ * enforcing what Deploy currently ignores would present as a build failure with
76
+ * no line of ours in it.
77
+ *
78
+ * Nine phantom specifiers in that bundle, from THREE sources, which is why
79
+ * this is a bundler setting rather than nine fixes:
80
+ * - undici's JSDoc — `../api/api-request`, `../dispatcher/client`,
81
+ * `../core/request`, `types/dispatcher`, `types/client`, `types/webidl`
82
+ * - html-to-text's — a `@param` naming the `selderee` package, which IS in the
83
+ * bundle, so the bare specifier resolves nowhere from inside it
84
+ * - **our own SDK's** — an `{@link import(<step-generate-json>)}` in the
85
+ * workflow docs' prose, the half no dependency bump would ever fix
86
+ *
87
+ * ## Why not `comments: false`
88
+ *
89
+ * `annotation` carries `@__PURE__` and `@__NO_SIDE_EFFECTS__`: those are
90
+ * instructions to the tree-shaker, and dropping them changes what the bundle
91
+ * DOES, not just how it reads. `legal` carries `@license` and `@preserve` from
92
+ * every third-party package in here — stripping those wholesale is a licensing
93
+ * decision and not one a deploy target gets to make quietly. `jsdoc` is the
94
+ * only class that can name a module, so it is the only one that goes.
95
+ *
96
+ * Applied to EVERY target rather than to Deno alone, on this module's own
97
+ * thesis: what a host does with the graph "differs in ways that are all bad",
98
+ * and a phantom edge is a hazard to any host that walks one — `@vercel/nft`
99
+ * traces imports too. One bundler, one behaviour.
100
+ *
101
+ * @see https://docs.deno.com/runtime/reference/cli/info — `deno info` resolves
102
+ * the graph instead of executing it, which is why it is the gate and why
103
+ * booting the emitted directory is not.
104
+ */
105
+ const JSDOC_FREE_COMMENTS = {
106
+ legal: true,
107
+ annotation: true,
108
+ jsdoc: false
109
+ };
43
110
  /** Bundle `source` as if it were a module in `cwd`, and answer the code. */
44
111
  async function bundleTargetEntry(cwd, source, name) {
45
112
  const entryPath = path.join(cwd, ".aai", `${name}-entry.mjs`);
@@ -64,7 +131,8 @@ async function bundleTargetEntry(cwd, source, name) {
64
131
  write: false,
65
132
  rollupOptions: { output: {
66
133
  entryFileNames: "[name].mjs",
67
- codeSplitting: false
134
+ codeSplitting: false,
135
+ comments: JSDOC_FREE_COMMENTS
68
136
  } }
69
137
  }
70
138
  }));
@@ -178,281 +246,6 @@ async function emitDenoOutput(cwd, options = {}) {
178
246
  await fs.writeFile(path.join(outputDir, DENO_CONFIG_FILE), DENO_CONFIG_SOURCE, "utf-8");
179
247
  }
180
248
  //#endregion
181
- //#region src/_modal-app.ts
182
- /**
183
- * The Modal app definition `aai build --target modal` emits — `app.py`.
184
- *
185
- * ## Why this target is a generated PYTHON file
186
- *
187
- * Every other target emits the host's expected entry shape and lets the host
188
- * hold the rest: Vercel reads a routing table it already understands, Deno
189
- * Deploy takes a directory and an entrypoint. Modal has no such descriptor.
190
- * Its deploy unit is a Python module — `modal.App`, an image recipe, and a
191
- * decorated function — and `modal deploy` runs that module rather than reading
192
- * a manifest out of it. So the "preset" for Modal is the module itself, which
193
- * is why this is the one target whose emit generates code in another language.
194
- *
195
- * ## The knobs are DEPLOY-TIME ENV, not edits to this file
196
- *
197
- * The awkward consequence is that Modal's policy — how many containers, how
198
- * much CPU, which secret — lives in Python arguments rather than in a platform
199
- * dashboard. A generated file carrying policy is a file people edit, and this
200
- * one is overwritten by the next `aai build`, so "do not edit" would be a lie
201
- * the first time somebody wanted a warm container.
202
- *
203
- * Four knobs are therefore read from the environment at deploy time
204
- * ({@link MODAL_ENV_KNOBS}), which keeps the project committing nothing
205
- * host-specific — the property `_build-target.ts` opens by defending:
206
- *
207
- * ```sh
208
- * AAI_MODAL_MIN_CONTAINERS=1 modal deploy .aai/modal/app.py
209
- * ```
210
- *
211
- * The rest — cpu, memory, timeout, concurrency — stays a documented constant
212
- * in the emitted file. Those are the numbers a reader needs to SEE to trust
213
- * the deployment, and regenerating restates the default, which is the same
214
- * contract every other generated artifact here has.
215
- */
216
- /**
217
- * The Node major the emitted image may not go below — the SDK's own `engines`
218
- * floor.
219
- *
220
- * The tag otherwise tracks the Node running the build, so the bundle runs on
221
- * the runtime it was bundled for. Modal pulls any tag that exists on Docker
222
- * Hub, so there is nothing to clamp from ABOVE — unlike `vercelNodeRuntime`,
223
- * whose platform publishes a fixed list. The floor is the half that matters:
224
- * npm does not enforce `engines` by default, so a build on Node 22 would
225
- * otherwise emit a `node:22-slim` image in which the SDK genuinely does not
226
- * run, and the failure would arrive as a crash-looping container.
227
- */
228
- const MODAL_NODE_MAJOR_FLOOR = 24;
229
- /**
230
- * The Python `add_python` layers beside Node.
231
- *
232
- * Matches `scripts/modal_image.py`, which is the same arrangement one layer up:
233
- * the container entrypoint is Modal's own Python runtime, and it spawns node.
234
- */
235
- const MODAL_ADD_PYTHON = "3.13";
236
- /** What a name sanitizes to when nothing usable survives — see {@link modalAppName}. */
237
- const MODAL_FALLBACK_APP_NAME = "aai-agent";
238
- /**
239
- * Modal caps a resource name at 64 characters. Truncated rather than refused:
240
- * the name is cosmetic (it appears in the app's URL), and failing a build over
241
- * a long agent name would be the target's first impression.
242
- */
243
- const MODAL_NAME_MAX = 64;
244
- /**
245
- * An agent name as a Modal app name.
246
- *
247
- * Modal accepts a narrow character set here and the name reaches a hostname —
248
- * a deployed function is served at `<workspace>--<app>-<function>.modal.run` —
249
- * so anything outside `[a-z0-9-]` becomes a dash rather than being passed
250
- * through and rejected by the platform. Agent names are free text
251
- * (`define({ name: "Retail Support Bot" })`), which is why this is a mapping
252
- * and not a validation.
253
- *
254
- * Collapsed and trimmed, because `--` is what a hostname reader sees as the
255
- * workspace separator, and a leading or trailing dash is not a legal label.
256
- */
257
- function modalAppName(agentName) {
258
- const slug = agentName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, MODAL_NAME_MAX).replace(/-+$/g, "");
259
- return slug === "" ? MODAL_FALLBACK_APP_NAME : slug;
260
- }
261
- /**
262
- * The Modal Secret the deployment reads its env from.
263
- *
264
- * `-env` rather than the app name alone: the secret holds exactly what
265
- * `.env.example` declares, and a name that says so makes
266
- * `modal secret create <name> …` self-explaining. Derived rather than
267
- * configured, so the emitted file and the command in its docstring cannot name
268
- * two different secrets.
269
- */
270
- function modalSecretName(appName) {
271
- return `${appName}-env`.slice(0, MODAL_NAME_MAX);
272
- }
273
- /** `node:<major>-slim` for the Node running this build, floored at the SDK's minimum. */
274
- function modalNodeImageTag(version = process.versions.node) {
275
- const major = Number.parseInt(version.split(".")[0] ?? "", 10);
276
- return `node:${Number.isNaN(major) || major < MODAL_NODE_MAJOR_FLOOR ? MODAL_NODE_MAJOR_FLOOR : major}-slim`;
277
- }
278
- /**
279
- * Render `app.py` for this agent.
280
- *
281
- * Every number the platform needs appears ONCE and is interpolated, so the
282
- * emitted file cannot disagree with itself or with the entry beside it — see
283
- * {@link MODAL_PORT} for the failure that motivates it.
284
- */
285
- function modalAppSource(options) {
286
- const app = modalAppName(options.name);
287
- const secret = modalSecretName(app);
288
- const image = options.nodeImage ?? modalNodeImageTag();
289
- return `# Generated by \`aai build --target modal\` — do not edit, and do not commit.
290
- """Deploys this agent to Modal.
291
-
292
- modal secret create ${secret} ASSEMBLYAI_API_KEY=... # once
293
- modal deploy .aai/modal/${MODAL_APP_FILE}
294
-
295
- Everything this serves is in THIS directory. \`${MODAL_ENTRY_FILE}\` is a bundle
296
- with no imports left to resolve, so the image installs nothing, carries no
297
- lockfile and needs no node_modules.
298
-
299
- Policy is read from the environment at DEPLOY time rather than edited here,
300
- because \`aai build --target modal\` overwrites this file:
301
-
302
- AAI_MODAL_APP app name (default: ${app})
303
- AAI_MODAL_SECRET secret holding the agent env (default: ${secret})
304
- AAI_MODAL_MIN_CONTAINERS warm floor (default: 0, i.e. scales to zero)
305
- AAI_MODAL_MAX_CONTAINERS autoscaler ceiling (default: 10)
306
- """
307
-
308
- import atexit
309
- import contextlib
310
- import os
311
- import signal
312
- import subprocess
313
- from pathlib import Path
314
-
315
- import modal
316
-
317
- # This file's OWN directory, never the shell's. \`modal deploy\` resolves a
318
- # relative local path against the directory it was invoked FROM, so an
319
- # \`add_local_dir(".")\` here would upload the project root or nothing at all,
320
- # depending on where the deploy was run.
321
- HERE = Path(__file__).parent
322
-
323
- # Bound to \`@modal.web_server\` and baked into the image env from this one
324
- # place. The proxy routes to the port it is told about, and a node process
325
- # reading a different number listens where nothing is routed — a deployment
326
- # that builds, starts, reports healthy and answers no request.
327
- PORT = ${MODAL_PORT}
328
-
329
- # The node server, spawned by \`server()\` below.
330
- ENTRY = "${MODAL_ENTRY_FILE}"
331
-
332
- APP_NAME = os.environ.get("AAI_MODAL_APP", "${app}")
333
- SECRET_NAME = os.environ.get("AAI_MODAL_SECRET", "${secret}")
334
- MIN_CONTAINERS = int(os.environ.get("AAI_MODAL_MIN_CONTAINERS", "0"))
335
- MAX_CONTAINERS = int(os.environ.get("AAI_MODAL_MAX_CONTAINERS", "10"))
336
-
337
- # How long a container stop waits for node to close its sessions before the
338
- # force-kill. Modal's own SIGKILL backstop still bounds the real grace period,
339
- # so this is headroom rather than a budget the shutdown spends.
340
- NODE_STOP_TIMEOUT_SECS = 30
341
-
342
- image = (
343
- # \`add_python\` layers Modal's own Python beside Node: the container
344
- # entrypoint is that Python runtime, and it spawns node. The Node major
345
- # tracks the one this was BUILT with, so the bundle runs on the runtime it
346
- # was bundled for.
347
- modal.Image.from_registry("${image}", add_python="${MODAL_ADD_PYTHON}")
348
- .env({"NODE_ENV": "production", "PORT": str(PORT)})
349
- # \`copy=True\` puts these files in an image LAYER. The default mounts them
350
- # at container start instead, which re-uploads the browser client on every
351
- # cold start and makes the boot slower the larger the UI gets.
352
- .add_local_dir(
353
- HERE,
354
- remote_path="/app",
355
- copy=True,
356
- ignore=["${MODAL_APP_FILE}", "__pycache__"],
357
- )
358
- )
359
-
360
- app = modal.App(APP_NAME)
361
-
362
-
363
- def _run_node(entry: str, env: dict[str, str]) -> subprocess.Popen:
364
- """Spawn the node server and hand container stop signals to it.
365
-
366
- Modal stops a container by signalling THIS Python process, and a child
367
- spawned with a bare Popen receives nothing of its own — so the node
368
- server's SIGTERM handler, the thing that closes live voice sessions, would
369
- never run on a scale-in or a redeploy. Every call in progress would just
370
- lose its socket.
371
-
372
- Two hooks, because neither alone is reliable: \`signal.signal\` only works on
373
- the main thread and Modal may call this off it, while the atexit fallback
374
- catches the runtime handling the signal itself and exiting normally. Both
375
- funnel into one memoized stop(), and the node handler is idempotent, so
376
- double delivery is harmless.
377
- """
378
- proc = subprocess.Popen(["node", entry], cwd="/app", env=env)
379
- stopped = False
380
-
381
- def stop() -> None:
382
- nonlocal stopped
383
- if stopped or proc.poll() is not None:
384
- return
385
- stopped = True
386
- with contextlib.suppress(ProcessLookupError):
387
- proc.send_signal(signal.SIGTERM)
388
- with contextlib.suppress(subprocess.TimeoutExpired):
389
- proc.wait(timeout=NODE_STOP_TIMEOUT_SECS)
390
- if proc.poll() is None:
391
- proc.kill()
392
-
393
- def forward(signum: int) -> None:
394
- previous = signal.getsignal(signum)
395
-
396
- def handler(sig: int, frame: object) -> None:
397
- stop()
398
- if callable(previous):
399
- previous(sig, frame)
400
- elif previous == signal.SIG_DFL:
401
- # Re-deliver with the default disposition so this runtime still
402
- # dies the way the platform expects.
403
- signal.signal(sig, signal.SIG_DFL)
404
- os.kill(os.getpid(), sig)
405
-
406
- signal.signal(signum, handler)
407
-
408
- for signum in (signal.SIGTERM, signal.SIGINT):
409
- with contextlib.suppress(ValueError): # not the main thread
410
- forward(signum)
411
-
412
- atexit.register(stop)
413
- return proc
414
-
415
-
416
- @app.function(
417
- image=image,
418
- # Values live in a Modal Secret; the \`.env.example\` beside this file
419
- # DECLARES which names reach \`ctx.env\`. Deploy FAILS when the secret does
420
- # not exist, which is the right time to hear about it — the alternative is
421
- # a container that starts and has no provider credential.
422
- secrets=[modal.Secret.from_name(SECRET_NAME)],
423
- # An audio pipeline is not a burstable workload: STT framing, the LLM turn
424
- # and TTS playback all run in this process.
425
- cpu=1,
426
- memory=1024,
427
- min_containers=MIN_CONTAINERS,
428
- max_containers=MAX_CONTAINERS,
429
- # Hold a container after the last call rather than paying a cold start on
430
- # the next one.
431
- scaledown_window=300,
432
- # Bounds ONE input, and a WebSocket is one input for as long as the call
433
- # lasts — so this is the longest single call this deployment will carry.
434
- timeout=3600,
435
- )
436
- # Without this a container serves ONE input at a time, and a voice call holds
437
- # its input until the caller hangs up: the second caller would wait out the
438
- # first, and every asset request for the browser client would queue behind
439
- # whichever call is in progress. \`target_inputs\` is the scale-out set point,
440
- # under the cap, so a container is joined by another before it saturates.
441
- @modal.concurrent(max_inputs=50, target_inputs=25)
442
- @modal.web_server(port=PORT, startup_timeout=180)
443
- def server() -> None:
444
- env = os.environ.copy()
445
- # Modal points this at an in-container Unix socket serving its own Python
446
- # task runtime. The \`modal\` JS SDK prefers that variable over the public
447
- # endpoint, so anything in node that talks to Modal would dial a socket
448
- # that does not answer it.
449
- env.pop("MODAL_SERVER_URL", None)
450
- # _run_node, not a bare Popen, so the container's stop signal reaches node
451
- # and live sessions are closed rather than dropped.
452
- _run_node(ENTRY, env)
453
- `;
454
- }
455
- //#endregion
456
249
  //#region src/_modal-output.ts
457
250
  /**
458
251
  * Assemble a self-contained Modal deployment directory — `.aai/modal/`.
@@ -519,7 +312,7 @@ async function emitModalOutput(cwd, options) {
519
312
  * a DECLARATION; the second holds a developer's own keys, and copying it would
520
313
  * bake them into a deployment artifact and let them silently win over the
521
314
  * values set in the Vercel project. Declarations ship, values come from the
522
- * platform environment. Verified by building the `simple` template: a local
315
+ * platform environment. Verified by building the `quickstart-agent` template: a local
523
316
  * `.env` with live credentials landed in the function until this list dropped
524
317
  * it.
525
318
  */
@@ -594,17 +387,18 @@ const FRAMEWORK_DEFAULT_PROMPT_SOURCE = "the framework default (DEFAULT_SYSTEM_P
594
387
  * is what an agent with no file legitimately looks like. So this is a report
595
388
  * rather than a check.
596
389
  *
597
- * Decided by comparing VALUES against the built agent's resolved prompt, which
390
+ * Decided by comparing VALUES against the built agent's declared prompt, which
598
391
  * is the same method `withSystemPrompt` uses and for the same reason — the
599
392
  * alternative asks the bundler's module graph a question, and the author may
600
393
  * have imported the file and composed it, which is neither "the file" nor
601
394
  * "agent.ts" alone.
602
395
  */
603
- async function systemPromptSource(cwd, resolved) {
604
- if (resolved === DEFAULT_SYSTEM_PROMPT) return FRAMEWORK_DEFAULT_PROMPT_SOURCE;
396
+ async function systemPromptSource(cwd, declared) {
397
+ if (typeof declared !== "string") return "agent.ts (a per-request resolver)";
398
+ if (declared === DEFAULT_SYSTEM_PROMPT) return FRAMEWORK_DEFAULT_PROMPT_SOURCE;
605
399
  const trimmed = (await fs.readFile(path.join(cwd, SYSTEM_PROMPT_FILE), "utf-8").catch(() => void 0))?.trim();
606
- if (trimmed === void 0 || trimmed === "" || !resolved.includes(trimmed)) return "agent.ts";
607
- return resolved.trim() === trimmed ? SYSTEM_PROMPT_FILE : `agent.ts (composing ${SYSTEM_PROMPT_FILE})`;
400
+ if (trimmed === void 0 || trimmed === "" || !declared.includes(trimmed)) return "agent.ts";
401
+ return declared.trim() === trimmed ? SYSTEM_PROMPT_FILE : `agent.ts (composing ${SYSTEM_PROMPT_FILE})`;
608
402
  }
609
403
  /**
610
404
  * Map a {@link runVitest} failure to a CliError — distinguishing a real test
@@ -636,8 +430,22 @@ async function executeBuild(opts) {
636
430
  await fs.writeFile(worker, bundle.worker, "utf-8");
637
431
  await emitTargetFiles(cwd, target, { name: agentDef.name });
638
432
  const output = TARGET_OUTPUTS[target];
433
+ const deployConfig = output.dir === void 0 ? void 0 : await evalWorkerConfig(bundle.worker);
434
+ const missingEnv = await missingDeployEnv(cwd, target, process.env, deployConfig || void 0);
435
+ for (const warning of missingEnvWarnings(missingEnv, target, agentDef.name)) notify("warn", warning);
639
436
  if (output.dir !== void 0) log.info(`Target ${target}: wrote ${output.dir}`);
640
- if (output.deploy !== void 0) log.info(`Deploy it with \`${output.deploy}\``);
437
+ const deploy = resolveDeploySteps(target, {
438
+ agentName: agentDef.name,
439
+ missingEnv
440
+ });
441
+ if (deploy.length > 0) {
442
+ log.info("Deploy it with:");
443
+ deploy.filter((step) => step.when !== "build").forEach((step, index) => {
444
+ const note = step.when === "once" ? " (first deploy only)" : "";
445
+ log.info(` ${index + 1}. ${step.run}${note}`);
446
+ });
447
+ log.info(`Re-run \`aai build --target ${target}\` before every deploy.`);
448
+ }
641
449
  const systemPrompt = await systemPromptSource(cwd, agentDef.systemPrompt);
642
450
  log.info(`System prompt: ${systemPrompt}`);
643
451
  log.success("Build complete");
@@ -648,7 +456,8 @@ async function executeBuild(opts) {
648
456
  systemPrompt,
649
457
  target,
650
458
  outputDir: output.dir,
651
- deploy: output.deploy
459
+ deploy,
460
+ missingEnv
652
461
  });
653
462
  }
654
463
  /**
@@ -685,5 +494,94 @@ async function emitTargetFiles(cwd, target, agent) {
685
494
  default: throw new Error(`Unhandled build target ${String(target)}`);
686
495
  }
687
496
  }
497
+ /**
498
+ * Which variables the DEPLOYMENT declares that this build's host has no value
499
+ * for — the check behind the warning `aai build` prints for a host target.
500
+ *
501
+ * ## Where the DECLARATIONS come from
502
+ *
503
+ * Two sources, and for a long time only the first: `.env.example`, the one
504
+ * dotenv file that ships, plus — when the caller has the built bundle's
505
+ * normalized config — {@link requiredEnvNames}, i.e. the provider credentials
506
+ * the stt/llm/tts/s2s descriptors imply and the agent's own `requiredEnv`.
507
+ *
508
+ * The example file alone was the wrong half of a pair. `anywhere.md` told
509
+ * authors to "list what your tools read in `requiredEnv`" and promised the
510
+ * build would warn by name about anything the deployment was missing, which was
511
+ * true of the MANAGED path (`_preflight.ts`, which has always derived both) and
512
+ * false here — so an agent declaring `requiredEnv: ["ORDERS_API_KEY"]` and no
513
+ * matching example entry got neither the warning nor the `env add` step the
514
+ * `perSecret` sequence expands from this same list. Both paths now read one
515
+ * derivation.
516
+ *
517
+ * `.env.example` stays a source rather than becoming redundant: it is where a
518
+ * variable that nothing static can see gets declared — one a tool reads
519
+ * straight off `process.env`, or a host setting like `PORT` — and it is what a
520
+ * user editing a deployment's configuration actually reads.
521
+ *
522
+ * ## Why the host environment and not `resolveServerEnv`
523
+ *
524
+ * The obvious implementation resolves {@link DEPLOY_ENV_FILES} the way the
525
+ * deployment will and reports what came back empty. It is wrong here, and
526
+ * wrong in exactly the case worth catching: `.env` is uploaded into a host's
527
+ * BUILD workspace (Vercel filters uploads by `.vercelignore`, never by
528
+ * `.gitignore`'s contents) and is deliberately NOT copied into the deployment
529
+ * artifact — see `RUNTIME_FILES` in `_vercel-output.ts`, where shipping it was
530
+ * a credential leak. So a developer's own `.env` sitting beside the build would
531
+ * satisfy a resolver and satisfy nothing at runtime, silencing the warning for
532
+ * the one deployment that needs it.
533
+ *
534
+ * Values therefore come from `env` alone, and declarations from
535
+ * {@link DEPLOY_ENV_DECLARATION_FILE} alone — the single file that ships.
536
+ *
537
+ * ## What it can and cannot see
538
+ *
539
+ * On a host-run build this is precise: the build container's environment IS the
540
+ * project's configured variables, so a name missing here is a name missing at
541
+ * runtime. That is the zero-config path `TARGET_ENV_MARKERS` describes and the
542
+ * failure this was written for — a Vercel deployment whose `ASSEMBLYAI_API_KEY`
543
+ * was never set, which built green and died at its first session.
544
+ *
545
+ * Two inaccuracies follow from a build being unable to interrogate its own
546
+ * host, and both are why this WARNS rather than gates. A variable a host
547
+ * exposes only at runtime (Vercel's sensitive variables) is reported though it
548
+ * will resolve. And a build run locally reads the developer's shell, which says
549
+ * nothing about what the host has — so an exported value hides a name the
550
+ * platform is still missing.
551
+ *
552
+ * @param env - Where values are read from. Defaults to the build's own
553
+ * environment; a parameter so a spec need not mutate `process.env`.
554
+ * @param config - The built bundle's `__aaiConfig`, when the caller has it.
555
+ * Omitted, only `.env.example` is read — which is what a spec asserting the
556
+ * file-declaration half wants, and what an older bundle carrying no such
557
+ * export leaves the caller with.
558
+ */
559
+ async function missingDeployEnv(cwd, target, env = process.env, config) {
560
+ if (TARGET_OUTPUTS[target].dir === void 0) return [];
561
+ const derived = config ? (await import("./_preflight-CnW9QiE7.mjs")).requiredEnvNames(config) : [];
562
+ const declared = await declaredEnvNames(cwd, [DEPLOY_ENV_DECLARATION_FILE]);
563
+ return [.../* @__PURE__ */ new Set([...declared, ...derived])].filter((name) => {
564
+ const value = env[name];
565
+ return value === void 0 || value === "";
566
+ });
567
+ }
568
+ /**
569
+ * One warning sentence per variable {@link missingDeployEnv} reported, naming
570
+ * the command that sets it where the target knows one.
571
+ *
572
+ * A sentence each rather than one combined line, matching `agentConfigWarnings`
573
+ * and `determinismWarnings`: each is independently actionable, and the command
574
+ * differs per name.
575
+ */
576
+ function missingEnvWarnings(missing, target, agentName) {
577
+ const secret = resolveDeploySteps(target, {
578
+ agentName,
579
+ missingEnv: []
580
+ }).find((step) => step.when === "perSecret")?.run;
581
+ return missing.map((name) => {
582
+ const fix = secret === void 0 ? `Set it in the ${target} environment` : `Set it with \`${secret.replaceAll(SECRET_NAME_PLACEHOLDER, name)}\``;
583
+ return `${name} is declared in ${DEPLOY_ENV_DECLARATION_FILE} but has no value in this build's environment, so the deployed agent will see none. ${fix}, then deploy again.`;
584
+ });
585
+ }
688
586
  //#endregion
689
587
  export { executeBuild };
package/dist/build.d.ts CHANGED
@@ -11,8 +11,9 @@
11
11
  *
12
12
  * `--target` decides what else it emits — see `_build-target.ts`.
13
13
  */
14
- import { type BuildTarget } from "./_build-target.ts";
14
+ import { type BuildTarget, type DeployStep } from "./_build-target.ts";
15
15
  import { type CommandResult } from "./_output.ts";
16
+ import type { PreflightConfig } from "./_preflight.ts";
16
17
  /**
17
18
  * Where the built worker lands, relative to the project root — under `.aai/`,
18
19
  * beside the built client, so one gitignore rule covers every build output.
@@ -43,9 +44,22 @@ type BuildData = {
43
44
  * above is: `log` is silenced under `--json`, so a CI job that builds and
44
45
  * then deploys could read neither the directory it should upload nor the
45
46
  * command that uploads it, and had to restate both from this file.
47
+ *
48
+ * `deploy` is the RESOLVED sequence — see {@link resolveDeploySteps} — so a
49
+ * CI job can execute it in order rather than re-encoding each host's
50
+ * prerequisites. Empty for a target that deploys nowhere.
46
51
  */
47
52
  outputDir: string | undefined;
48
- deploy: string | undefined;
53
+ deploy: DeployStep[];
54
+ /**
55
+ * Variables the deployment DECLARES and this build's host had no value for —
56
+ * see {@link missingDeployEnv}. Empty for a target that deploys nowhere.
57
+ *
58
+ * On the result as well as in a warning, for the reason `outputDir` above is:
59
+ * `log` is silenced under `--json`, and this is the field a CI job would gate
60
+ * its own deploy step on.
61
+ */
62
+ missingEnv: string[];
49
63
  };
50
64
  export declare function executeBuild(opts: {
51
65
  cwd: string;
@@ -57,3 +71,75 @@ export declare function executeBuild(opts: {
57
71
  */
58
72
  target?: string | undefined;
59
73
  }): Promise<CommandResult<BuildData>>;
74
+ /**
75
+ * Which variables the DEPLOYMENT declares that this build's host has no value
76
+ * for — the check behind the warning `aai build` prints for a host target.
77
+ *
78
+ * ## Where the DECLARATIONS come from
79
+ *
80
+ * Two sources, and for a long time only the first: `.env.example`, the one
81
+ * dotenv file that ships, plus — when the caller has the built bundle's
82
+ * normalized config — {@link requiredEnvNames}, i.e. the provider credentials
83
+ * the stt/llm/tts/s2s descriptors imply and the agent's own `requiredEnv`.
84
+ *
85
+ * The example file alone was the wrong half of a pair. `anywhere.md` told
86
+ * authors to "list what your tools read in `requiredEnv`" and promised the
87
+ * build would warn by name about anything the deployment was missing, which was
88
+ * true of the MANAGED path (`_preflight.ts`, which has always derived both) and
89
+ * false here — so an agent declaring `requiredEnv: ["ORDERS_API_KEY"]` and no
90
+ * matching example entry got neither the warning nor the `env add` step the
91
+ * `perSecret` sequence expands from this same list. Both paths now read one
92
+ * derivation.
93
+ *
94
+ * `.env.example` stays a source rather than becoming redundant: it is where a
95
+ * variable that nothing static can see gets declared — one a tool reads
96
+ * straight off `process.env`, or a host setting like `PORT` — and it is what a
97
+ * user editing a deployment's configuration actually reads.
98
+ *
99
+ * ## Why the host environment and not `resolveServerEnv`
100
+ *
101
+ * The obvious implementation resolves {@link DEPLOY_ENV_FILES} the way the
102
+ * deployment will and reports what came back empty. It is wrong here, and
103
+ * wrong in exactly the case worth catching: `.env` is uploaded into a host's
104
+ * BUILD workspace (Vercel filters uploads by `.vercelignore`, never by
105
+ * `.gitignore`'s contents) and is deliberately NOT copied into the deployment
106
+ * artifact — see `RUNTIME_FILES` in `_vercel-output.ts`, where shipping it was
107
+ * a credential leak. So a developer's own `.env` sitting beside the build would
108
+ * satisfy a resolver and satisfy nothing at runtime, silencing the warning for
109
+ * the one deployment that needs it.
110
+ *
111
+ * Values therefore come from `env` alone, and declarations from
112
+ * {@link DEPLOY_ENV_DECLARATION_FILE} alone — the single file that ships.
113
+ *
114
+ * ## What it can and cannot see
115
+ *
116
+ * On a host-run build this is precise: the build container's environment IS the
117
+ * project's configured variables, so a name missing here is a name missing at
118
+ * runtime. That is the zero-config path `TARGET_ENV_MARKERS` describes and the
119
+ * failure this was written for — a Vercel deployment whose `ASSEMBLYAI_API_KEY`
120
+ * was never set, which built green and died at its first session.
121
+ *
122
+ * Two inaccuracies follow from a build being unable to interrogate its own
123
+ * host, and both are why this WARNS rather than gates. A variable a host
124
+ * exposes only at runtime (Vercel's sensitive variables) is reported though it
125
+ * will resolve. And a build run locally reads the developer's shell, which says
126
+ * nothing about what the host has — so an exported value hides a name the
127
+ * platform is still missing.
128
+ *
129
+ * @param env - Where values are read from. Defaults to the build's own
130
+ * environment; a parameter so a spec need not mutate `process.env`.
131
+ * @param config - The built bundle's `__aaiConfig`, when the caller has it.
132
+ * Omitted, only `.env.example` is read — which is what a spec asserting the
133
+ * file-declaration half wants, and what an older bundle carrying no such
134
+ * export leaves the caller with.
135
+ */
136
+ export declare function missingDeployEnv(cwd: string, target: BuildTarget, env?: Record<string, string | undefined>, config?: PreflightConfig): Promise<string[]>;
137
+ /**
138
+ * One warning sentence per variable {@link missingDeployEnv} reported, naming
139
+ * the command that sets it where the target knows one.
140
+ *
141
+ * A sentence each rather than one combined line, matching `agentConfigWarnings`
142
+ * and `determinismWarnings`: each is independently actionable, and the command
143
+ * differs per name.
144
+ */
145
+ export declare function missingEnvWarnings(missing: readonly string[], target: BuildTarget, agentName: string): string[];