@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.
- package/README.md +3 -2
- package/dist/{_build-target-55dJisQ-.mjs → _build-target-C08aM-Es.mjs} +511 -41
- package/dist/_build-target.d.ts +109 -2
- package/dist/_deno-target.d.ts +15 -14
- package/dist/_dev-env.d.ts +19 -13
- package/dist/{_dev-server-BzWB6-4y.mjs → _dev-server-CLU9xjH5.mjs} +27 -19
- package/dist/_dev-server.d.ts +4 -3
- package/dist/_dev-vite-config.d.ts +1 -1
- package/dist/_init.d.ts +39 -0
- package/dist/_modal-target.d.ts +11 -6
- package/dist/_preflight-CnW9QiE7.mjs +116 -0
- package/dist/_preflight.d.ts +110 -5
- package/dist/{_server-common-De0haHr9.mjs → _server-common-DAcv1nC5.mjs} +46 -2
- package/dist/_server-common.d.ts +39 -0
- package/dist/_target-bundle.d.ts +112 -0
- package/dist/_target-entry.d.ts +81 -0
- package/dist/{_templates-CuP74F8D.mjs → _templates-IMeKMVIj.mjs} +1 -1
- package/dist/{_vitest-runner-AVR9VtXh.mjs → _vitest-runner-CZNGj0ZC.mjs} +22 -17
- package/dist/_vitest-runner.d.ts +36 -24
- package/dist/{_workflow-determinism-CvpqMpdh.mjs → _workflow-determinism-CLxFQ5ox.mjs} +1 -1
- package/dist/_workflow-determinism.d.ts +1 -1
- package/dist/{build-ButI2IKc.mjs → build-DrQTSc2R.mjs} +187 -289
- package/dist/build.d.ts +88 -2
- package/dist/cli.mjs +20 -16
- package/dist/{deploy-CGqPU5U-.mjs → deploy-B68-x7xM.mjs} +14 -6
- package/dist/deploy.d.ts +9 -0
- package/dist/{dev-kodAY23K.mjs → dev-ChsrNHpK.mjs} +1 -1
- package/dist/dev.d.ts +1 -1
- package/dist/{eval-DvoSz7SZ.mjs → eval-DB07kTxO.mjs} +2 -2
- package/dist/init-W-4k-lCF.mjs +559 -0
- package/dist/init.d.ts +43 -3
- package/dist/scaffold/CLAUDE.md +87 -100
- package/dist/scaffold/package.json +6 -6
- package/dist/scaffold/vite.config.ts +29 -1
- package/dist/start.mjs +1 -1
- package/dist/{studio-CtRBVVFR.mjs → studio-DEAJGBXa.mjs} +20 -10
- package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.eval.test.ts +20 -6
- package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.ts +28 -0
- package/dist/templates/{hiring-desk → applicant-screening-agent}/crews.ts +1 -1
- package/dist/templates/{hiring-desk → applicant-screening-agent}/shared.ts +11 -11
- package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screening_status.ts +1 -1
- package/dist/templates/{call-audit → call-audit-workflow}/agent.ts +4 -2
- package/dist/templates/{call-audit → call-audit-workflow}/client.tsx +3 -3
- package/dist/templates/{call-audit → call-audit-workflow}/guards.test.ts +2 -2
- package/dist/templates/{call-audit → call-audit-workflow}/workflows/summarize.ts +1 -1
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.eval.test.ts +3 -2
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.test.ts +1 -1
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.ts +1 -0
- package/dist/templates/coding-agent/agent.eval.test.ts +136 -0
- package/dist/templates/coding-agent/agent.test.ts +109 -0
- package/dist/templates/coding-agent/agent.ts +45 -0
- package/dist/templates/coding-agent/chat.ts +63 -0
- package/dist/templates/coding-agent/shared.ts +46 -0
- package/dist/templates/coding-agent/system-prompt.md +32 -0
- package/dist/templates/coding-agent/tools/bash.ts +6 -0
- package/dist/templates/coding-agent/tools/delete_file.ts +6 -0
- package/dist/templates/coding-agent/tools/edit_file.ts +6 -0
- package/dist/templates/coding-agent/tools/glob.ts +6 -0
- package/dist/templates/coding-agent/tools/grep.ts +6 -0
- package/dist/templates/coding-agent/tools/list_files.ts +6 -0
- package/dist/templates/coding-agent/tools/read_file.ts +6 -0
- package/dist/templates/coding-agent/tools/todo_write.ts +6 -0
- package/dist/templates/coding-agent/tools/write_file.ts +6 -0
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.test.ts +2 -2
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.ts +2 -1
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/modes.test.ts +1 -1
- package/dist/templates/{redline → document-redline-workflow}/agent.ts +4 -2
- package/dist/templates/{redline → document-redline-workflow}/client.tsx +1 -1
- package/dist/templates/{redline → document-redline-workflow}/workflows/redline.ts +1 -1
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.test.ts +104 -1
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.ts +15 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/events.ts +1 -1
- package/dist/templates/emergency-dispatch-agent/guardrails.ts +105 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/system-prompt.md +1 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_create.ts +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.eval.test.ts +8 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.test.ts +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.ts +1 -0
- package/dist/templates/{night-owl → entertainment-picks-agent}/client.tsx +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/system-prompt.md +6 -0
- package/dist/templates/{night-owl → entertainment-picks-agent}/tools/revisit.ts +7 -0
- package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.eval.test.ts +84 -23
- package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.ts +1 -0
- package/dist/templates/{executive-assistant → executive-inbox-agent}/meeting.ts +2 -2
- package/dist/templates/{executive-assistant → executive-inbox-agent}/prompts.ts +3 -1
- package/dist/templates/{executive-assistant → executive-inbox-agent}/shared.ts +2 -2
- package/dist/templates/{executive-assistant → executive-inbox-agent}/system-prompt.md +3 -3
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/meeting_assistant.ts +3 -3
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/open_email.ts +8 -16
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/send_calendar_invite.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.eval.test.ts +85 -21
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.test.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.ts +6 -3
- package/dist/templates/{hotel-desk → hotel-reception-agent}/client.tsx +14 -2
- package/dist/templates/{hotel-desk → hotel-reception-agent}/concierge.ts +3 -2
- package/dist/templates/{hotel-desk → hotel-reception-agent}/desk-seams.test.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/disputes.ts +9 -11
- package/dist/templates/{hotel-desk → hotel-reception-agent}/events.ts +2 -1
- package/dist/templates/hotel-reception-agent/session.ts +56 -0
- package/dist/templates/{hotel-desk → hotel-reception-agent}/shared.ts +21 -22
- package/dist/templates/{hotel-desk → hotel-reception-agent}/system-prompt.md +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/abandon_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/add_to_waitlist.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_airport_car.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_restaurant_reservation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_room_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_restaurant_availability.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_room_availability.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/choose_room.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/confirm_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispatch_emergency.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispute_charge.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/flag_late_arrival.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_guest_history.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_invoice.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_restaurant_reservation.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/modify_restaurant_reservation.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_card.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_followup.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_group_inquiry.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_guest_details.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reinstate_booking.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/request_flight_reconfirmation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resend_confirmation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reserve_table.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resolve_room_conflict.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/schedule_wakeup_call.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_do_not_disturb.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_extras.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_stay.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_booking_modification.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_room_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/take_guest_message.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/transfer_call.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/update_card.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/verify_booking.ts +2 -1
- package/dist/templates/{link-digest → link-digest-workflow}/agent.eval.test.ts +16 -1
- package/dist/templates/{link-digest → link-digest-workflow}/agent.test.ts +2 -2
- package/dist/templates/{link-digest → link-digest-workflow}/agent.ts +8 -3
- package/dist/templates/{link-digest → link-digest-workflow}/client.tsx +2 -2
- package/dist/templates/{link-digest → link-digest-workflow}/workflows/digest.ts +1 -1
- package/dist/templates/{health-assistant → medication-safety-agent}/agent.test.ts +55 -1
- package/dist/templates/medication-safety-agent/agent.ts +62 -0
- package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.test.ts +4 -4
- package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.ts +5 -1
- package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/recap.ts +3 -3
- package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.ts +3 -0
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.eval.test.ts +1 -1
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.test.ts +1 -1
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.ts +6 -2
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/client.tsx +3 -3
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/digest.ts +1 -1
- package/dist/templates/{simple → quickstart-agent}/agent.eval.test.ts +39 -3
- package/dist/templates/{simple → quickstart-agent}/agent.test.ts +25 -3
- package/dist/templates/quickstart-agent/agent.ts +24 -0
- package/dist/templates/quickstart-agent/system-prompt.md +8 -0
- package/dist/templates/quickstart-agent/tools/get_weather.ts +59 -0
- package/dist/templates/{research-workflow → research-handoff-agent}/agent.test.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/agent.ts +5 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/filing.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/research.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/review.ts +1 -1
- package/dist/templates/{plan-and-execute → research-planner-agent}/agent.eval.test.ts +24 -2
- package/dist/templates/{plan-and-execute → research-planner-agent}/agent.ts +3 -0
- package/dist/templates/{plan-and-execute → research-planner-agent}/shared.ts +1 -1
- package/dist/templates/{plan-and-execute → research-planner-agent}/system-prompt.md +1 -1
- package/dist/templates/{retail → retail-orders-agent}/agent.ts +32 -3
- package/dist/templates/retail-orders-agent/keyterms.ts +154 -0
- package/dist/templates/{retail → retail-orders-agent}/pending.ts +2 -2
- package/dist/templates/{retail → retail-orders-agent}/resolve.ts +18 -3
- package/dist/templates/{retail → retail-orders-agent}/shared.ts +1 -1
- package/dist/templates/{retail → retail-orders-agent}/store.ts +3 -3
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.eval.test.ts +37 -5
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.test.ts +38 -6
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.ts +5 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/call.ts +1 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/shared.ts +15 -3
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/acknowledge_disclosure.ts +14 -0
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/dispatch_truck.ts +1 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/lookup_coverage.ts +11 -0
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/service_disclosure.ts +17 -11
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.test.ts +4 -0
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.test.ts +1 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.ts +5 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/client.tsx +1 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/summarize.ts +1 -1
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.eval.test.ts +6 -0
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.test.ts +125 -1
- package/dist/templates/tabletop-rpg-agent/agent.ts +58 -0
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/shared.ts +84 -3
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/system-prompt.md +1 -1
- package/dist/templates/tabletop-rpg-agent/tools/check_state.ts +37 -0
- package/dist/templates/{support-line → technical-support-agent}/agent.test.ts +3 -3
- package/dist/templates/{support-line → technical-support-agent}/agent.ts +5 -1
- package/dist/templates/technical-support-agent/knowledge.ts +165 -0
- package/dist/templates/{support-line → technical-support-agent}/nodes.ts +3 -2
- package/dist/templates/{support-line → technical-support-agent}/procedure.ts +4 -3
- package/dist/templates/technical-support-agent/shared.ts +145 -0
- package/dist/templates/{support-line → technical-support-agent}/tools/list_topics.ts +2 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.eval.test.ts +39 -6
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.test.ts +79 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.ts +30 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/client.tsx +2 -2
- package/dist/templates/{infocom-adventure → text-adventure-agent}/shared.ts +37 -0
- package/dist/templates/{infocom-adventure → text-adventure-agent}/system-prompt.md +9 -2
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.eval.test.ts +21 -7
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.test.ts +23 -11
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.ts +5 -2
- package/dist/templates/{briefing-desk → topic-briefing-agent}/shared.ts +11 -11
- package/dist/templates/{briefing-desk → topic-briefing-agent}/slack.ts +1 -1
- package/dist/templates/{briefing-desk → topic-briefing-agent}/system-prompt.md +13 -8
- package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/send_briefing.ts +43 -5
- package/dist/templates/transcription-workflow/agent.test.ts +1 -1
- package/dist/templates/transcription-workflow/agent.ts +4 -1
- package/dist/templates/transcription-workflow/client.tsx +1 -1
- package/dist/templates/transcription-workflow/workflows/batch.ts +2 -2
- package/dist/templates/transcription-workflow/workflows/transcribe.ts +1 -1
- package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.ts +4 -0
- package/dist/templates/{travel-concierge → travel-concierge-agent}/shared.ts +1 -1
- package/dist/templates/{web-researcher → web-research-agent}/agent.eval.test.ts +32 -6
- package/dist/templates/{web-researcher → web-research-agent}/agent.test.ts +17 -1
- package/dist/templates/{web-researcher → web-research-agent}/agent.ts +31 -1
- package/dist/templates/{web-researcher → web-research-agent}/system-prompt.md +8 -2
- package/dist/templates/{word-wrangler → word-game-agent}/agent.eval.test.ts +79 -18
- package/dist/templates/{word-wrangler → word-game-agent}/agent.ts +20 -0
- package/dist/templates/{word-wrangler → word-game-agent}/game.ts +1 -1
- package/dist/templates/{word-wrangler → word-game-agent}/shared.ts +1 -1
- package/dist/test-CjKPQ9_B.mjs +102 -0
- package/dist/test.d.ts +37 -12
- package/package.json +5 -5
- package/dist/_init-BzQbV8Zh.mjs +0 -199
- package/dist/_preflight-CcAR577V.mjs +0 -46
- package/dist/init-D363Ls5u.mjs +0 -183
- package/dist/templates/health-assistant/agent.ts +0 -15
- package/dist/templates/simple/agent.ts +0 -8
- package/dist/templates/solo-rpg/agent.ts +0 -29
- package/dist/templates/solo-rpg/tools/check_state.ts +0 -28
- package/dist/templates/support-line/shared.ts +0 -281
- package/dist/test-Cllnx81G.mjs +0 -83
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.test.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/client.tsx +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/leads.json +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.test.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/system-prompt.md +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/candidate_details.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/proceed_to_emails.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/read_email.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/rescore_with_feedback.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screen_candidates.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/agent.test.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/audit.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/ingest.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/media.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/sync-api.ts +0 -0
- /package/dist/templates/{code-interpreter → code-interpreter-agent}/system-prompt.md +0 -0
- /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/stages.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/agent.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/form.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/workflows/prompts.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/client.tsx +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/shared.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_add_note.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_escalate.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_get.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_triage.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_update_status.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_dashboard.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_protocols.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_run_scenario.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_dispatch.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_get_available.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_update_status.ts +0 -0
- /package/dist/templates/{night-owl → entertainment-picks-agent}/shared.ts +0 -0
- /package/dist/templates/{night-owl → entertainment-picks-agent}/tools/recommend.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.test.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/calendar.test.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/client.tsx +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/inbox.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/nodes.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/review.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/accept.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ask_question.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/draft_reply.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/edit.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ignore.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/inbox_status.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/new_email.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/respond.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/review_memory.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/triage_inbox.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/booking.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/card.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/catalogs.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/desk.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/hotel.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/policies.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/records.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/restaurant.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/seed.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_business_center.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_spa_appointment.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_tour.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_policy.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/order_flowers.ts +0 -0
- /package/dist/templates/{link-digest → link-digest-workflow}/api-client.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/fda.test.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/fda.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/system-prompt.md +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/tools/check_drug_interaction.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/tools/medication_lookup.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/shared.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/cancel_recap.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/keep_transcript.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_progress.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_status.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/request_recap.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/tokens.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.test.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/client.tsx +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/shared.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/system-prompt.md +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/add_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/place_order.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/remove_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/set_customer_name.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/update_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/view_order.ts +0 -0
- /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/feeds.ts +0 -0
- /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/slack.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/shared.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/file_it_now.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/request_research.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_progress.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_status.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/notes.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/prompts.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/agent.test.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/client.tsx +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/procedure.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/prompts.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/plan_status.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/revise_plan.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/start_plan.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/work_next_step.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/agent.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/authenticate.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/cancel.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/client.tsx +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/payment.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/pending.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/refund.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/registry.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/resolve.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/returns.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/seed.json +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/seed.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/shared.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/store.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/swap.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/swap.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/system-prompt.md +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_change.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_pending_order.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/confirm_change.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/exchange_delivered_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_email.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_name_zip.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_item_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_order_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_product_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_user_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/list_all_product_types.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_payment.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_user_address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/return_delivered_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/transfer_to_human_agents.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/events.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/system-prompt.md +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/job_status.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/report_location.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.ts +0 -0
- /package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/transcribe.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/client.tsx +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/action_roll.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/burn_momentum.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/oracle.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/setup_character.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/update_state.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/client.tsx +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/knowledge.json +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/prompts.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/system-prompt.md +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/tools/answer_question.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/tools/log_ticket.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_drop.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_flag.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_get.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_move.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_restart.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_score.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_take.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/briefing_so_far.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/research_topic.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/verify_claim.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.test.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/call-events.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/client.tsx +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/routing.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/system-prompt.md +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_car_rental.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_excursion.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_hotel.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_action.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_ticket.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/complete_or_escalate.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/confirm_action.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/lookup_booking.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_car_rentals.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_excursions.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_flights.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_hotels.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_car_rental_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_excursion_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_flight_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_hotel_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/update_ticket.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/agent.test.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/client.tsx +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/guess.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/player.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/system-prompt.md +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/final_score.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/relay_description.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/repeat_word.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/skip_word.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/start_game.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/words.ts +0 -0
package/dist/scaffold/CLAUDE.md
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AssemblyAI Agent SDK
|
|
2
2
|
|
|
3
|
-
You are helping build a voice agent
|
|
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
|
|
11
|
-
|
|
12
|
-
end-to-end. This is the primary feedback loop. Watching is
|
|
13
|
-
restart ends in-flight voice sessions, which
|
|
14
|
-
and wrong while something
|
|
15
|
-
|
|
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-
|
|
18
|
-
**When the project has an `agent.test.ts` (the default `
|
|
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 `
|
|
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
|
-
|
|
89
|
-
`pizza-ordering`, `retail` (the most
|
|
90
|
-
relational store
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
`
|
|
97
|
-
caller can redirect between them), and `redline` (the
|
|
98
|
-
critique, revise
|
|
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
|
|
121
|
-
aai test --
|
|
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`
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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-
|
|
799
|
-
hands AssemblyAI a `webhook_url` and parks on the delivery instead of polling
|
|
800
|
-
for twenty minutes. Five things about that shape,
|
|
801
|
-
|
|
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,
|
|
1053
|
-
|
|
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
|
|
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
|
|
1130
|
-
Both are on `@alexkroman1/aai/step`, and `spoken-summary`
|
|
1131
|
-
|
|
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
|
|
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
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
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
|
|
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-
|
|
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
|
|
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`.**
|
|
2122
|
-
|
|
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`
|
|
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
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
-
|
|
2457
|
-
|
|
2458
|
-
|
|
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"
|
|
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
|
|
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`.**
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
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": "
|
|
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": "^
|
|
19
|
-
"@alexkroman1/aai-cli": "^
|
|
20
|
-
"@alexkroman1/aai-runtime": "^
|
|
21
|
-
"@alexkroman1/aai-ui": "^
|
|
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: [
|
|
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 {
|
|
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 {
|
|
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-
|
|
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
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
194
|
-
//
|
|
195
|
-
//
|
|
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
|
|
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
|
-
|
|
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-
|
|
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
|
|
331
|
-
* utterance
|
|
332
|
-
* "
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
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
|
-
|
|
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. `
|
|
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({
|