@alexkroman1/aai-cli 0.12.3 → 0.13.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 +69 -0
- package/bin.mjs +58 -0
- package/dist/_agent-BopNO5Bq.mjs +152 -0
- package/dist/_agent.d.ts +83 -0
- package/dist/_api-client.d.ts +92 -0
- package/dist/_artifacts-BJOYGQPp.mjs +21 -0
- package/dist/_artifacts.d.ts +16 -0
- package/dist/_build-target-C08aM-Es.mjs +1119 -0
- package/dist/_build-target.d.ts +276 -0
- package/dist/_bundler-CgBw5Bcu.mjs +102 -0
- package/dist/_bundler.d.ts +60 -0
- package/dist/_cli-common.d.ts +173 -0
- package/dist/_client-plugins.d.ts +57 -0
- package/dist/_config-mq1I5Cva.mjs +263 -0
- package/dist/_config.d.ts +122 -0
- package/dist/_console-audio.d.ts +17 -0
- package/dist/_console-session.d.ts +70 -0
- package/dist/_default-html.d.ts +33 -0
- package/dist/_deno-output.d.ts +23 -0
- package/dist/_deno-target.d.ts +74 -0
- package/dist/_deploy.d.ts +22 -0
- package/dist/_dev-agent-env.d.ts +27 -0
- package/dist/_dev-env-D9Uy5wNt.mjs +89 -0
- package/dist/_dev-env.d.ts +77 -0
- package/dist/_dev-restart.d.ts +64 -0
- package/dist/_dev-server-BNq5OnUJ.mjs +737 -0
- package/dist/_dev-server.d.ts +89 -0
- package/dist/_dev-session-ticket.d.ts +63 -0
- package/dist/_dev-source.d.ts +55 -0
- package/dist/_dev-tunnel.d.ts +90 -0
- package/dist/_dev-typecheck.d.ts +38 -0
- package/dist/_dev-vite-config.d.ts +100 -0
- package/dist/_dev-watch.d.ts +35 -0
- package/dist/_dotenv-file.d.ts +45 -0
- package/dist/_e2e-test-utils.d.ts +120 -0
- package/dist/_fault-mode.d.ts +194 -0
- package/dist/_help.d.ts +31 -0
- package/dist/_init.d.ts +66 -0
- package/dist/_mock-api.d.ts +22 -0
- package/dist/_mock-registry.d.ts +17 -0
- package/dist/_modal-app.d.ts +77 -0
- package/dist/_modal-output.d.ts +31 -0
- package/dist/_modal-target.d.ts +69 -0
- package/dist/_output-DBP9Op_d.mjs +120 -0
- package/dist/_output.d.ts +74 -0
- package/dist/_preflight-Bv6Ct4ss.mjs +149 -0
- package/dist/_preflight.d.ts +170 -0
- package/dist/_resource-commands.d.ts +22 -0
- package/dist/_run-code-deno-C0AtfHeH.mjs +268 -0
- package/dist/_run-code-deno.d.ts +130 -0
- package/dist/_server-common-CVXIeWrY.mjs +114 -0
- package/dist/_server-common.d.ts +75 -0
- package/dist/_slug-api-DJuwYZ6T.mjs +68 -0
- package/dist/_slug-api.d.ts +61 -0
- package/dist/_stop-server.d.ts +17 -0
- package/dist/_studio-BH05zugt.mjs +251 -0
- package/dist/_studio-commands.d.ts +73 -0
- package/dist/_studio.d.ts +80 -0
- package/dist/_target-bundle.d.ts +139 -0
- package/dist/_target-drain.d.ts +44 -0
- package/dist/_target-entry.d.ts +81 -0
- package/dist/_target-output.d.ts +63 -0
- package/dist/_templates-Bv-rd0SO.mjs +135 -0
- package/dist/_templates.d.ts +82 -0
- package/dist/_typecheck-gate-CcX2gLJZ.mjs +19 -0
- package/dist/_typecheck-gate.d.ts +11 -0
- package/dist/_ui-Coe0zwmm.mjs +102 -0
- package/dist/_ui.d.ts +90 -0
- package/dist/_utils-BVLdBvdT.mjs +186 -0
- package/dist/_utils.d.ts +126 -0
- package/dist/_vercel-output.d.ts +48 -0
- package/dist/_vercel-target.d.ts +169 -0
- package/dist/_vite-env-BiyJ0GQH.mjs +105 -0
- package/dist/_vite-env.d.ts +38 -0
- package/dist/_vitest-runner-CKI8_K1b.mjs +207 -0
- package/dist/_vitest-runner.d.ts +182 -0
- package/dist/_workflow-determinism-CLxFQ5ox.mjs +198 -0
- package/dist/_workflow-determinism.d.ts +118 -0
- package/dist/build-B37oBfEv.mjs +592 -0
- package/dist/build.d.ts +146 -0
- package/dist/cli-workflow.d.ts +10 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +1063 -198
- package/dist/client-bundler-D4SeZJ8E.mjs +240 -0
- package/dist/client-bundler.d.ts +32 -0
- package/dist/client-bundler.mjs +3 -0
- package/dist/console-D6OOjjeJ.mjs +443 -0
- package/dist/console.d.ts +70 -0
- package/dist/delete-Br0EOH0g.mjs +55 -0
- package/dist/delete.d.ts +25 -0
- package/dist/deploy-CLUH5cv2.mjs +97 -0
- package/dist/deploy.d.ts +25 -0
- package/dist/dev-ZVuyPLUk.mjs +274 -0
- package/dist/dev.d.ts +34 -0
- package/dist/eval-Dl8o91yC.mjs +74 -0
- package/dist/eval.d.ts +46 -0
- package/dist/init-x3FsKl2q.mjs +609 -0
- package/dist/init.d.ts +101 -0
- package/dist/login-oJdBWu2B.mjs +166 -0
- package/dist/login.d.ts +54 -0
- package/dist/logs-BfRq1HX9.mjs +80 -0
- package/dist/logs.d.ts +65 -0
- package/dist/project-config.d.ts +23 -0
- package/dist/project-config.mjs +3 -0
- package/dist/scaffold/.env.example +51 -0
- package/dist/scaffold/CLAUDE.md +390 -0
- package/dist/scaffold/agent-guide/AGENT-API.md +223 -0
- package/dist/scaffold/agent-guide/HOSTING.md +140 -0
- package/dist/scaffold/agent-guide/PIPELINE-TUNING.md +235 -0
- package/dist/scaffold/agent-guide/PROVIDERS.md +143 -0
- package/dist/scaffold/agent-guide/TESTING-EVALS.md +158 -0
- package/dist/scaffold/agent-guide/TOOLS.md +628 -0
- package/dist/scaffold/agent-guide/UI.md +291 -0
- package/dist/scaffold/agent-guide/WORKFLOWS.md +801 -0
- package/dist/scaffold/package.json +38 -0
- package/dist/scaffold/pnpm-workspace.yaml +45 -0
- package/dist/scaffold/tsconfig.json +3 -0
- package/dist/scaffold/vitest.config.ts +8 -0
- package/dist/secret-Db1UWLSZ.mjs +300 -0
- package/dist/secret.d.ts +70 -0
- package/dist/start.d.ts +112 -0
- package/dist/start.mjs +183 -0
- package/dist/studio-DAoJApzD.mjs +209 -0
- package/dist/studio.d.ts +55 -0
- package/dist/templates/applicant-screening-agent/agent.eval.test.ts +258 -0
- package/dist/templates/applicant-screening-agent/agent.test.ts +987 -0
- package/dist/templates/applicant-screening-agent/agent.ts +66 -0
- package/dist/templates/applicant-screening-agent/client.tsx +154 -0
- package/dist/templates/applicant-screening-agent/crews.ts +432 -0
- package/dist/templates/applicant-screening-agent/leads.json +86 -0
- package/dist/templates/applicant-screening-agent/screening-lock.test.ts +77 -0
- package/dist/templates/applicant-screening-agent/screening-lock.ts +51 -0
- package/dist/templates/applicant-screening-agent/shared.ts +483 -0
- package/dist/templates/applicant-screening-agent/system-prompt.md +21 -0
- package/dist/templates/applicant-screening-agent/tools/candidate_details.ts +49 -0
- package/dist/templates/applicant-screening-agent/tools/proceed_to_emails.ts +127 -0
- package/dist/templates/applicant-screening-agent/tools/read_email.ts +50 -0
- package/dist/templates/applicant-screening-agent/tools/rescore_with_feedback.ts +140 -0
- package/dist/templates/applicant-screening-agent/tools/screen_candidates.ts +128 -0
- package/dist/templates/applicant-screening-agent/tools/screening_status.ts +51 -0
- package/dist/templates/call-audit-workflow/agent.eval.test.ts +492 -0
- package/dist/templates/call-audit-workflow/agent.test.ts +1032 -0
- package/dist/templates/call-audit-workflow/agent.ts +161 -0
- package/dist/templates/call-audit-workflow/client.tsx +236 -0
- package/dist/templates/call-audit-workflow/guards.test.ts +233 -0
- package/dist/templates/call-audit-workflow/workflows/audit.ts +391 -0
- package/dist/templates/call-audit-workflow/workflows/ingest.ts +279 -0
- package/dist/templates/call-audit-workflow/workflows/media.ts +729 -0
- package/dist/templates/call-audit-workflow/workflows/summarize.ts +201 -0
- package/dist/templates/call-audit-workflow/workflows/sync-api.ts +54 -0
- package/dist/templates/code-interpreter-agent/agent.eval.test.ts +195 -0
- package/dist/templates/code-interpreter-agent/agent.test.ts +91 -0
- package/dist/templates/code-interpreter-agent/agent.ts +9 -0
- package/dist/templates/code-interpreter-agent/system-prompt.md +18 -0
- package/dist/templates/coding-agent/agent.eval.test.ts +135 -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/custom-pipeline-agent/agent.eval.test.ts +79 -0
- package/dist/templates/custom-pipeline-agent/agent.test.ts +79 -0
- package/dist/templates/custom-pipeline-agent/agent.ts +13 -0
- package/dist/templates/custom-pipeline-agent/modes.test.ts +162 -0
- package/dist/templates/custom-pipeline-agent/stages.test.ts +330 -0
- package/dist/templates/document-redline-workflow/agent.eval.test.ts +254 -0
- package/dist/templates/document-redline-workflow/agent.test.ts +552 -0
- package/dist/templates/document-redline-workflow/agent.ts +112 -0
- package/dist/templates/document-redline-workflow/client.tsx +224 -0
- package/dist/templates/document-redline-workflow/form.ts +74 -0
- package/dist/templates/document-redline-workflow/workflows/prompts.ts +68 -0
- package/dist/templates/document-redline-workflow/workflows/redline.ts +317 -0
- package/dist/templates/emergency-dispatch-agent/agent.eval.test.ts +372 -0
- package/dist/templates/emergency-dispatch-agent/agent.test.ts +576 -0
- package/dist/templates/emergency-dispatch-agent/agent.ts +63 -0
- package/dist/templates/emergency-dispatch-agent/client.tsx +453 -0
- package/dist/templates/emergency-dispatch-agent/events.ts +48 -0
- package/dist/templates/emergency-dispatch-agent/guardrails.ts +105 -0
- package/dist/templates/emergency-dispatch-agent/shared.ts +768 -0
- package/dist/templates/emergency-dispatch-agent/system-prompt.md +42 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_add_note.ts +28 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_create.ts +95 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_escalate.ts +96 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_get.ts +40 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_triage.ts +90 -0
- package/dist/templates/emergency-dispatch-agent/tools/incident_update_status.ts +75 -0
- package/dist/templates/emergency-dispatch-agent/tools/ops_dashboard.ts +72 -0
- package/dist/templates/emergency-dispatch-agent/tools/ops_protocols.ts +27 -0
- package/dist/templates/emergency-dispatch-agent/tools/ops_run_scenario.ts +154 -0
- package/dist/templates/emergency-dispatch-agent/tools/resources_dispatch.ts +112 -0
- package/dist/templates/emergency-dispatch-agent/tools/resources_get_available.ts +34 -0
- package/dist/templates/emergency-dispatch-agent/tools/resources_update_status.ts +63 -0
- package/dist/templates/entertainment-picks-agent/agent.eval.test.ts +281 -0
- package/dist/templates/entertainment-picks-agent/agent.test.ts +260 -0
- package/dist/templates/entertainment-picks-agent/agent.ts +14 -0
- package/dist/templates/entertainment-picks-agent/client.tsx +169 -0
- package/dist/templates/entertainment-picks-agent/shared.ts +50 -0
- package/dist/templates/entertainment-picks-agent/system-prompt.md +19 -0
- package/dist/templates/entertainment-picks-agent/tools/recommend.ts +79 -0
- package/dist/templates/entertainment-picks-agent/tools/revisit.ts +56 -0
- package/dist/templates/executive-inbox-agent/agent.eval.test.ts +296 -0
- package/dist/templates/executive-inbox-agent/agent.test.ts +682 -0
- package/dist/templates/executive-inbox-agent/agent.ts +51 -0
- package/dist/templates/executive-inbox-agent/calendar.test.ts +203 -0
- package/dist/templates/executive-inbox-agent/client.tsx +195 -0
- package/dist/templates/executive-inbox-agent/inbox.ts +233 -0
- package/dist/templates/executive-inbox-agent/meeting.ts +138 -0
- package/dist/templates/executive-inbox-agent/nodes.ts +148 -0
- package/dist/templates/executive-inbox-agent/prompts.ts +333 -0
- package/dist/templates/executive-inbox-agent/review.ts +425 -0
- package/dist/templates/executive-inbox-agent/shared.ts +486 -0
- package/dist/templates/executive-inbox-agent/system-prompt.md +15 -0
- package/dist/templates/executive-inbox-agent/tools/accept.ts +10 -0
- package/dist/templates/executive-inbox-agent/tools/ask_question.ts +30 -0
- package/dist/templates/executive-inbox-agent/tools/draft_reply.ts +67 -0
- package/dist/templates/executive-inbox-agent/tools/edit.ts +10 -0
- package/dist/templates/executive-inbox-agent/tools/ignore.ts +10 -0
- package/dist/templates/executive-inbox-agent/tools/inbox_status.ts +27 -0
- package/dist/templates/executive-inbox-agent/tools/meeting_assistant.ts +52 -0
- package/dist/templates/executive-inbox-agent/tools/new_email.ts +50 -0
- package/dist/templates/executive-inbox-agent/tools/open_email.ts +157 -0
- package/dist/templates/executive-inbox-agent/tools/respond.ts +10 -0
- package/dist/templates/executive-inbox-agent/tools/review_memory.ts +22 -0
- package/dist/templates/executive-inbox-agent/tools/send_calendar_invite.ts +68 -0
- package/dist/templates/executive-inbox-agent/tools/triage_inbox.ts +75 -0
- package/dist/templates/front-desk-agent/agent.eval.test.ts +177 -0
- package/dist/templates/front-desk-agent/agent.test.ts +155 -0
- package/dist/templates/front-desk-agent/agent.ts +22 -0
- package/dist/templates/front-desk-agent/shared.ts +239 -0
- package/dist/templates/front-desk-agent/system-prompt.md +13 -0
- package/dist/templates/front-desk-agent/tools/verify_account.ts +41 -0
- package/dist/templates/home-assistant-agent/agent.eval.test.ts +176 -0
- package/dist/templates/home-assistant-agent/agent.test.ts +513 -0
- package/dist/templates/home-assistant-agent/agent.ts +37 -0
- package/dist/templates/home-assistant-agent/client.tsx +176 -0
- package/dist/templates/home-assistant-agent/ring.tsx +55 -0
- package/dist/templates/home-assistant-agent/shared.ts +130 -0
- package/dist/templates/home-assistant-agent/system-prompt.md +43 -0
- package/dist/templates/home-assistant-agent/tools/cancel_reminders.ts +16 -0
- package/dist/templates/home-assistant-agent/tools/deep_research.ts +55 -0
- package/dist/templates/home-assistant-agent/tools/remind_me.ts +53 -0
- package/dist/templates/home-assistant-agent/tools/stop.ts +25 -0
- package/dist/templates/home-assistant-agent/use-speaker.ts +98 -0
- package/dist/templates/home-assistant-agent/workflows/remind.ts +25 -0
- package/dist/templates/home-assistant-agent/workflows/research-prompts.ts +41 -0
- package/dist/templates/home-assistant-agent/workflows/research.ts +110 -0
- package/dist/templates/home-assistant-agent/workflows/text.ts +30 -0
- package/dist/templates/hotel-reception-agent/agent.eval.test.ts +241 -0
- package/dist/templates/hotel-reception-agent/agent.test.ts +1121 -0
- package/dist/templates/hotel-reception-agent/agent.ts +66 -0
- package/dist/templates/hotel-reception-agent/booking.ts +159 -0
- package/dist/templates/hotel-reception-agent/card.ts +92 -0
- package/dist/templates/hotel-reception-agent/catalogs.ts +219 -0
- package/dist/templates/hotel-reception-agent/client.tsx +150 -0
- package/dist/templates/hotel-reception-agent/concierge.ts +104 -0
- package/dist/templates/hotel-reception-agent/desk-seams.test.ts +339 -0
- package/dist/templates/hotel-reception-agent/desk.ts +220 -0
- package/dist/templates/hotel-reception-agent/disputes.ts +214 -0
- package/dist/templates/hotel-reception-agent/events.ts +80 -0
- package/dist/templates/hotel-reception-agent/hotel.ts +412 -0
- package/dist/templates/hotel-reception-agent/policies.ts +209 -0
- package/dist/templates/hotel-reception-agent/records.ts +384 -0
- package/dist/templates/hotel-reception-agent/restaurant.ts +147 -0
- package/dist/templates/hotel-reception-agent/seed.ts +955 -0
- package/dist/templates/hotel-reception-agent/session.ts +50 -0
- package/dist/templates/hotel-reception-agent/shared.ts +353 -0
- package/dist/templates/hotel-reception-agent/system-prompt.md +76 -0
- package/dist/templates/hotel-reception-agent/tools/abandon_booking.ts +31 -0
- package/dist/templates/hotel-reception-agent/tools/add_to_waitlist.ts +42 -0
- package/dist/templates/hotel-reception-agent/tools/book_airport_car.ts +58 -0
- package/dist/templates/hotel-reception-agent/tools/book_business_center.ts +44 -0
- package/dist/templates/hotel-reception-agent/tools/book_spa_appointment.ts +39 -0
- package/dist/templates/hotel-reception-agent/tools/book_tour.ts +35 -0
- package/dist/templates/hotel-reception-agent/tools/cancel_restaurant_reservation.ts +26 -0
- package/dist/templates/hotel-reception-agent/tools/cancel_room_booking.ts +64 -0
- package/dist/templates/hotel-reception-agent/tools/check_restaurant_availability.ts +24 -0
- package/dist/templates/hotel-reception-agent/tools/check_room_availability.ts +40 -0
- package/dist/templates/hotel-reception-agent/tools/choose_room.ts +93 -0
- package/dist/templates/hotel-reception-agent/tools/confirm_booking.ts +154 -0
- package/dist/templates/hotel-reception-agent/tools/dispatch_emergency.ts +62 -0
- package/dist/templates/hotel-reception-agent/tools/dispute_charge.ts +91 -0
- package/dist/templates/hotel-reception-agent/tools/flag_late_arrival.ts +27 -0
- package/dist/templates/hotel-reception-agent/tools/lookup_booking.ts +49 -0
- package/dist/templates/hotel-reception-agent/tools/lookup_guest_history.ts +28 -0
- package/dist/templates/hotel-reception-agent/tools/lookup_invoice.ts +27 -0
- package/dist/templates/hotel-reception-agent/tools/lookup_policy.ts +20 -0
- package/dist/templates/hotel-reception-agent/tools/lookup_restaurant_reservation.ts +27 -0
- package/dist/templates/hotel-reception-agent/tools/modify_restaurant_reservation.ts +75 -0
- package/dist/templates/hotel-reception-agent/tools/order_flowers.ts +40 -0
- package/dist/templates/hotel-reception-agent/tools/record_card.ts +46 -0
- package/dist/templates/hotel-reception-agent/tools/record_followup.ts +51 -0
- package/dist/templates/hotel-reception-agent/tools/record_group_inquiry.ts +45 -0
- package/dist/templates/hotel-reception-agent/tools/record_guest_details.ts +71 -0
- package/dist/templates/hotel-reception-agent/tools/reinstate_booking.ts +65 -0
- package/dist/templates/hotel-reception-agent/tools/request_flight_reconfirmation.ts +55 -0
- package/dist/templates/hotel-reception-agent/tools/resend_confirmation.ts +40 -0
- package/dist/templates/hotel-reception-agent/tools/reserve_table.ts +87 -0
- package/dist/templates/hotel-reception-agent/tools/resolve_room_conflict.ts +49 -0
- package/dist/templates/hotel-reception-agent/tools/schedule_wakeup_call.ts +49 -0
- package/dist/templates/hotel-reception-agent/tools/set_do_not_disturb.ts +29 -0
- package/dist/templates/hotel-reception-agent/tools/set_extras.ts +51 -0
- package/dist/templates/hotel-reception-agent/tools/set_stay.ts +98 -0
- package/dist/templates/hotel-reception-agent/tools/start_booking_modification.ts +58 -0
- package/dist/templates/hotel-reception-agent/tools/start_room_booking.ts +50 -0
- package/dist/templates/hotel-reception-agent/tools/take_guest_message.ts +72 -0
- package/dist/templates/hotel-reception-agent/tools/transfer_call.ts +48 -0
- package/dist/templates/hotel-reception-agent/tools/update_card.ts +46 -0
- package/dist/templates/hotel-reception-agent/tools/verify_booking.ts +96 -0
- package/dist/templates/link-digest-workflow/agent.eval.test.ts +231 -0
- package/dist/templates/link-digest-workflow/agent.test.ts +647 -0
- package/dist/templates/link-digest-workflow/agent.ts +100 -0
- package/dist/templates/link-digest-workflow/api-client.ts +144 -0
- package/dist/templates/link-digest-workflow/client.tsx +231 -0
- package/dist/templates/link-digest-workflow/workflows/digest.ts +334 -0
- package/dist/templates/medication-safety-agent/agent.eval.test.ts +182 -0
- package/dist/templates/medication-safety-agent/agent.test.ts +332 -0
- package/dist/templates/medication-safety-agent/agent.ts +62 -0
- package/dist/templates/medication-safety-agent/fda.test.ts +130 -0
- package/dist/templates/medication-safety-agent/fda.ts +159 -0
- package/dist/templates/medication-safety-agent/system-prompt.md +26 -0
- package/dist/templates/medication-safety-agent/tools/check_drug_interaction.ts +62 -0
- package/dist/templates/medication-safety-agent/tools/medication_lookup.ts +36 -0
- package/dist/templates/meeting-recap-agent/agent.eval.test.ts +446 -0
- package/dist/templates/meeting-recap-agent/agent.test.ts +1408 -0
- package/dist/templates/meeting-recap-agent/agent.ts +104 -0
- package/dist/templates/meeting-recap-agent/shared.ts +44 -0
- package/dist/templates/meeting-recap-agent/tools/cancel_recap.ts +23 -0
- package/dist/templates/meeting-recap-agent/tools/keep_transcript.ts +31 -0
- package/dist/templates/meeting-recap-agent/tools/recap_progress.ts +24 -0
- package/dist/templates/meeting-recap-agent/tools/recap_status.ts +45 -0
- package/dist/templates/meeting-recap-agent/tools/request_recap.ts +44 -0
- package/dist/templates/meeting-recap-agent/workflows/recap.ts +838 -0
- package/dist/templates/meeting-recap-agent/workflows/tokens.ts +47 -0
- package/dist/templates/pizza-ordering-agent/agent.eval.test.ts +228 -0
- package/dist/templates/pizza-ordering-agent/agent.test.ts +299 -0
- package/dist/templates/pizza-ordering-agent/agent.ts +24 -0
- package/dist/templates/pizza-ordering-agent/client.tsx +104 -0
- package/dist/templates/pizza-ordering-agent/shared.ts +225 -0
- package/dist/templates/pizza-ordering-agent/system-prompt.md +23 -0
- package/dist/templates/pizza-ordering-agent/tools/add_pizza.ts +27 -0
- package/dist/templates/pizza-ordering-agent/tools/place_order.ts +26 -0
- package/dist/templates/pizza-ordering-agent/tools/remove_pizza.ts +18 -0
- package/dist/templates/pizza-ordering-agent/tools/set_customer_name.ts +13 -0
- package/dist/templates/pizza-ordering-agent/tools/update_pizza.ts +28 -0
- package/dist/templates/pizza-ordering-agent/tools/view_order.ts +21 -0
- package/dist/templates/podcast-digest-workflow/agent.eval.test.ts +421 -0
- package/dist/templates/podcast-digest-workflow/agent.test.ts +1225 -0
- package/dist/templates/podcast-digest-workflow/agent.ts +143 -0
- package/dist/templates/podcast-digest-workflow/client.tsx +259 -0
- package/dist/templates/podcast-digest-workflow/workflows/digest.ts +499 -0
- package/dist/templates/podcast-digest-workflow/workflows/feeds.ts +575 -0
- package/dist/templates/podcast-digest-workflow/workflows/slack.ts +153 -0
- package/dist/templates/push-to-talk-agent/agent.eval.test.ts +78 -0
- package/dist/templates/push-to-talk-agent/agent.test.ts +63 -0
- package/dist/templates/push-to-talk-agent/agent.ts +22 -0
- package/dist/templates/push-to-talk-agent/client.tsx +124 -0
- package/dist/templates/push-to-talk-agent/shared.ts +28 -0
- package/dist/templates/push-to-talk-agent/system-prompt.md +11 -0
- package/dist/templates/push-to-talk-agent/tools/list_notes.ts +15 -0
- package/dist/templates/push-to-talk-agent/tools/save_note.ts +26 -0
- package/dist/templates/quickstart-agent/agent.eval.test.ts +148 -0
- package/dist/templates/quickstart-agent/agent.test.ts +96 -0
- package/dist/templates/quickstart-agent/agent.ts +25 -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-handoff-agent/agent.eval.test.ts +341 -0
- package/dist/templates/research-handoff-agent/agent.test.ts +831 -0
- package/dist/templates/research-handoff-agent/agent.ts +118 -0
- package/dist/templates/research-handoff-agent/shared.ts +41 -0
- package/dist/templates/research-handoff-agent/tools/file_it_now.ts +32 -0
- package/dist/templates/research-handoff-agent/tools/request_research.ts +33 -0
- package/dist/templates/research-handoff-agent/tools/research_progress.ts +23 -0
- package/dist/templates/research-handoff-agent/tools/research_status.ts +73 -0
- package/dist/templates/research-handoff-agent/workflows/filing.ts +164 -0
- package/dist/templates/research-handoff-agent/workflows/prompts.ts +46 -0
- package/dist/templates/research-handoff-agent/workflows/research.ts +100 -0
- package/dist/templates/research-handoff-agent/workflows/review.ts +43 -0
- package/dist/templates/research-planner-agent/agent.eval.test.ts +241 -0
- package/dist/templates/research-planner-agent/agent.test.ts +635 -0
- package/dist/templates/research-planner-agent/agent.ts +26 -0
- package/dist/templates/research-planner-agent/client.tsx +120 -0
- package/dist/templates/research-planner-agent/procedure.ts +287 -0
- package/dist/templates/research-planner-agent/prompts.ts +153 -0
- package/dist/templates/research-planner-agent/shared.ts +327 -0
- package/dist/templates/research-planner-agent/system-prompt.md +18 -0
- package/dist/templates/research-planner-agent/tools/plan_status.ts +41 -0
- package/dist/templates/research-planner-agent/tools/revise_plan.ts +71 -0
- package/dist/templates/research-planner-agent/tools/start_plan.ts +62 -0
- package/dist/templates/research-planner-agent/tools/work_next_step.ts +177 -0
- package/dist/templates/retail-orders-agent/address.ts +109 -0
- package/dist/templates/retail-orders-agent/agent.eval.test.ts +305 -0
- package/dist/templates/retail-orders-agent/agent.test.ts +1260 -0
- package/dist/templates/retail-orders-agent/agent.ts +103 -0
- package/dist/templates/retail-orders-agent/authenticate.ts +34 -0
- package/dist/templates/retail-orders-agent/cancel.ts +114 -0
- package/dist/templates/retail-orders-agent/client.tsx +579 -0
- package/dist/templates/retail-orders-agent/keyterms.ts +154 -0
- package/dist/templates/retail-orders-agent/payment.ts +103 -0
- package/dist/templates/retail-orders-agent/pending.test.ts +204 -0
- package/dist/templates/retail-orders-agent/pending.ts +137 -0
- package/dist/templates/retail-orders-agent/refund.ts +19 -0
- package/dist/templates/retail-orders-agent/registry.test.ts +446 -0
- package/dist/templates/retail-orders-agent/resolve.test.ts +100 -0
- package/dist/templates/retail-orders-agent/resolve.ts +114 -0
- package/dist/templates/retail-orders-agent/returns.ts +101 -0
- package/dist/templates/retail-orders-agent/seed.json +4260 -0
- package/dist/templates/retail-orders-agent/seed.test.ts +233 -0
- package/dist/templates/retail-orders-agent/shared.test.ts +240 -0
- package/dist/templates/retail-orders-agent/shared.ts +547 -0
- package/dist/templates/retail-orders-agent/store.test.ts +331 -0
- package/dist/templates/retail-orders-agent/store.ts +485 -0
- package/dist/templates/retail-orders-agent/swap.test.ts +189 -0
- package/dist/templates/retail-orders-agent/swap.ts +358 -0
- package/dist/templates/retail-orders-agent/system-prompt.md +152 -0
- package/dist/templates/retail-orders-agent/tools/cancel_change.ts +33 -0
- package/dist/templates/retail-orders-agent/tools/cancel_pending_order.ts +31 -0
- package/dist/templates/retail-orders-agent/tools/confirm_change.ts +42 -0
- package/dist/templates/retail-orders-agent/tools/exchange_delivered_order_items.ts +47 -0
- package/dist/templates/retail-orders-agent/tools/find_user_id_by_email.ts +31 -0
- package/dist/templates/retail-orders-agent/tools/find_user_id_by_name_zip.ts +36 -0
- package/dist/templates/retail-orders-agent/tools/get_item_details.ts +27 -0
- package/dist/templates/retail-orders-agent/tools/get_order_details.ts +37 -0
- package/dist/templates/retail-orders-agent/tools/get_product_details.ts +30 -0
- package/dist/templates/retail-orders-agent/tools/get_user_details.ts +37 -0
- package/dist/templates/retail-orders-agent/tools/list_all_product_types.ts +22 -0
- package/dist/templates/retail-orders-agent/tools/modify_pending_order_address.ts +27 -0
- package/dist/templates/retail-orders-agent/tools/modify_pending_order_items.ts +48 -0
- package/dist/templates/retail-orders-agent/tools/modify_pending_order_payment.ts +32 -0
- package/dist/templates/retail-orders-agent/tools/modify_user_address.ts +26 -0
- package/dist/templates/retail-orders-agent/tools/return_delivered_order_items.ts +37 -0
- package/dist/templates/retail-orders-agent/tools/transfer_to_human_agents.ts +28 -0
- package/dist/templates/roadside-assistance-agent/agent.eval.test.ts +283 -0
- package/dist/templates/roadside-assistance-agent/agent.test.ts +650 -0
- package/dist/templates/roadside-assistance-agent/agent.ts +89 -0
- package/dist/templates/roadside-assistance-agent/call.ts +232 -0
- package/dist/templates/roadside-assistance-agent/events.ts +92 -0
- package/dist/templates/roadside-assistance-agent/shared.ts +346 -0
- package/dist/templates/roadside-assistance-agent/system-prompt.md +37 -0
- package/dist/templates/roadside-assistance-agent/tools/acknowledge_disclosure.ts +61 -0
- package/dist/templates/roadside-assistance-agent/tools/dispatch_truck.ts +149 -0
- package/dist/templates/roadside-assistance-agent/tools/job_status.ts +38 -0
- package/dist/templates/roadside-assistance-agent/tools/lookup_coverage.ts +83 -0
- package/dist/templates/roadside-assistance-agent/tools/report_location.ts +79 -0
- package/dist/templates/roadside-assistance-agent/tools/service_disclosure.ts +51 -0
- package/dist/templates/roadside-assistance-agent/yard.test.ts +162 -0
- package/dist/templates/roadside-assistance-agent/yard.ts +183 -0
- package/dist/templates/spoken-summary-workflow/agent.eval.test.ts +354 -0
- package/dist/templates/spoken-summary-workflow/agent.test.ts +493 -0
- package/dist/templates/spoken-summary-workflow/agent.ts +164 -0
- package/dist/templates/spoken-summary-workflow/client.tsx +220 -0
- package/dist/templates/spoken-summary-workflow/workflows/summarize.ts +260 -0
- package/dist/templates/spoken-summary-workflow/workflows/transcribe.ts +137 -0
- package/dist/templates/tabletop-rpg-agent/agent.eval.test.ts +314 -0
- package/dist/templates/tabletop-rpg-agent/agent.test.ts +1000 -0
- package/dist/templates/tabletop-rpg-agent/agent.ts +58 -0
- package/dist/templates/tabletop-rpg-agent/client.tsx +814 -0
- package/dist/templates/tabletop-rpg-agent/shared.ts +1028 -0
- package/dist/templates/tabletop-rpg-agent/system-prompt.md +116 -0
- package/dist/templates/tabletop-rpg-agent/tools/action_roll.ts +119 -0
- package/dist/templates/tabletop-rpg-agent/tools/burn_momentum.ts +110 -0
- package/dist/templates/tabletop-rpg-agent/tools/check_state.ts +37 -0
- package/dist/templates/tabletop-rpg-agent/tools/oracle.ts +255 -0
- package/dist/templates/tabletop-rpg-agent/tools/setup_character.ts +228 -0
- package/dist/templates/tabletop-rpg-agent/tools/update_state.ts +194 -0
- package/dist/templates/technical-support-agent/agent.eval.test.ts +260 -0
- package/dist/templates/technical-support-agent/agent.test.ts +424 -0
- package/dist/templates/technical-support-agent/agent.ts +39 -0
- package/dist/templates/technical-support-agent/client.tsx +132 -0
- package/dist/templates/technical-support-agent/knowledge.json +65 -0
- package/dist/templates/technical-support-agent/knowledge.ts +165 -0
- package/dist/templates/technical-support-agent/nodes.ts +143 -0
- package/dist/templates/technical-support-agent/procedure.ts +453 -0
- package/dist/templates/technical-support-agent/prompts.ts +102 -0
- package/dist/templates/technical-support-agent/shared.ts +128 -0
- package/dist/templates/technical-support-agent/system-prompt.md +18 -0
- package/dist/templates/technical-support-agent/tools/answer_question.ts +134 -0
- package/dist/templates/technical-support-agent/tools/list_topics.ts +23 -0
- package/dist/templates/technical-support-agent/tools/log_ticket.ts +30 -0
- package/dist/templates/text-adventure-agent/agent.eval.test.ts +222 -0
- package/dist/templates/text-adventure-agent/agent.test.ts +429 -0
- package/dist/templates/text-adventure-agent/agent.ts +76 -0
- package/dist/templates/text-adventure-agent/client.tsx +359 -0
- package/dist/templates/text-adventure-agent/shared.ts +210 -0
- package/dist/templates/text-adventure-agent/system-prompt.md +50 -0
- package/dist/templates/text-adventure-agent/tools/game_state_drop.ts +29 -0
- package/dist/templates/text-adventure-agent/tools/game_state_flag.ts +13 -0
- package/dist/templates/text-adventure-agent/tools/game_state_get.ts +17 -0
- package/dist/templates/text-adventure-agent/tools/game_state_move.ts +15 -0
- package/dist/templates/text-adventure-agent/tools/game_state_restart.ts +13 -0
- package/dist/templates/text-adventure-agent/tools/game_state_score.ts +19 -0
- package/dist/templates/text-adventure-agent/tools/game_state_take.ts +13 -0
- package/dist/templates/topic-briefing-agent/agent.eval.test.ts +202 -0
- package/dist/templates/topic-briefing-agent/agent.test.ts +651 -0
- package/dist/templates/topic-briefing-agent/agent.ts +45 -0
- package/dist/templates/topic-briefing-agent/shared.ts +392 -0
- package/dist/templates/topic-briefing-agent/slack.ts +108 -0
- package/dist/templates/topic-briefing-agent/system-prompt.md +54 -0
- package/dist/templates/topic-briefing-agent/tools/briefing_so_far.ts +43 -0
- package/dist/templates/topic-briefing-agent/tools/research_topic.ts +80 -0
- package/dist/templates/topic-briefing-agent/tools/send_briefing.ts +115 -0
- package/dist/templates/topic-briefing-agent/tools/verify_claim.ts +123 -0
- package/dist/templates/transcription-workflow/agent.eval.test.ts +237 -0
- package/dist/templates/transcription-workflow/agent.test.ts +2032 -0
- package/dist/templates/transcription-workflow/agent.ts +188 -0
- package/dist/templates/transcription-workflow/client.tsx +511 -0
- package/dist/templates/transcription-workflow/recover.test.ts +222 -0
- package/dist/templates/transcription-workflow/recover.ts +154 -0
- package/dist/templates/transcription-workflow/run-panel.tsx +212 -0
- package/dist/templates/transcription-workflow/total-latency.tsx +170 -0
- package/dist/templates/transcription-workflow/workflows/batch.ts +189 -0
- package/dist/templates/transcription-workflow/workflows/downsample.ts +273 -0
- package/dist/templates/transcription-workflow/workflows/normalize.ts +385 -0
- package/dist/templates/transcription-workflow/workflows/stitch.ts +122 -0
- package/dist/templates/transcription-workflow/workflows/stream.ts +690 -0
- package/dist/templates/transcription-workflow/workflows/sync-api.ts +81 -0
- package/dist/templates/transcription-workflow/workflows/transcribe.ts +479 -0
- package/dist/templates/transcription-workflow/workflows/wav.ts +250 -0
- package/dist/templates/travel-concierge-agent/agent.eval.test.ts +300 -0
- package/dist/templates/travel-concierge-agent/agent.test.ts +601 -0
- package/dist/templates/travel-concierge-agent/agent.ts +62 -0
- package/dist/templates/travel-concierge-agent/call-events.ts +80 -0
- package/dist/templates/travel-concierge-agent/client.tsx +146 -0
- package/dist/templates/travel-concierge-agent/routing.ts +170 -0
- package/dist/templates/travel-concierge-agent/shared.ts +862 -0
- package/dist/templates/travel-concierge-agent/system-prompt.md +30 -0
- package/dist/templates/travel-concierge-agent/tools/book_car_rental.ts +21 -0
- package/dist/templates/travel-concierge-agent/tools/book_excursion.ts +19 -0
- package/dist/templates/travel-concierge-agent/tools/book_hotel.ts +21 -0
- package/dist/templates/travel-concierge-agent/tools/cancel_action.ts +9 -0
- package/dist/templates/travel-concierge-agent/tools/cancel_ticket.ts +21 -0
- package/dist/templates/travel-concierge-agent/tools/complete_or_escalate.ts +9 -0
- package/dist/templates/travel-concierge-agent/tools/confirm_action.ts +9 -0
- package/dist/templates/travel-concierge-agent/tools/lookup_booking.ts +36 -0
- package/dist/templates/travel-concierge-agent/tools/search_car_rentals.ts +36 -0
- package/dist/templates/travel-concierge-agent/tools/search_excursions.ts +40 -0
- package/dist/templates/travel-concierge-agent/tools/search_flights.ts +58 -0
- package/dist/templates/travel-concierge-agent/tools/search_hotels.ts +39 -0
- package/dist/templates/travel-concierge-agent/tools/to_car_rental_assistant.ts +11 -0
- package/dist/templates/travel-concierge-agent/tools/to_excursion_assistant.ts +11 -0
- package/dist/templates/travel-concierge-agent/tools/to_flight_assistant.ts +11 -0
- package/dist/templates/travel-concierge-agent/tools/to_hotel_assistant.ts +11 -0
- package/dist/templates/travel-concierge-agent/tools/update_ticket.ts +23 -0
- package/dist/templates/web-research-agent/agent.eval.test.ts +144 -0
- package/dist/templates/web-research-agent/agent.test.ts +181 -0
- package/dist/templates/web-research-agent/agent.ts +128 -0
- package/dist/templates/web-research-agent/system-prompt.md +33 -0
- package/dist/templates/word-game-agent/agent.eval.test.ts +222 -0
- package/dist/templates/word-game-agent/agent.test.ts +484 -0
- package/dist/templates/word-game-agent/agent.ts +55 -0
- package/dist/templates/word-game-agent/client.tsx +211 -0
- package/dist/templates/word-game-agent/game.ts +133 -0
- package/dist/templates/word-game-agent/guess.ts +63 -0
- package/dist/templates/word-game-agent/player.ts +67 -0
- package/dist/templates/word-game-agent/shared.ts +249 -0
- package/dist/templates/word-game-agent/system-prompt.md +15 -0
- package/dist/templates/word-game-agent/tools/final_score.ts +37 -0
- package/dist/templates/word-game-agent/tools/relay_description.ts +137 -0
- package/dist/templates/word-game-agent/tools/repeat_word.ts +19 -0
- package/dist/templates/word-game-agent/tools/skip_word.ts +31 -0
- package/dist/templates/word-game-agent/tools/start_game.ts +52 -0
- package/dist/templates/word-game-agent/words.ts +278 -0
- package/dist/test-XufelYGW.mjs +104 -0
- package/dist/test.d.ts +81 -0
- package/dist/typecheck.d.ts +44 -0
- package/dist/typecheck.mjs +185 -0
- package/dist/worker-bundler.d.ts +37 -0
- package/dist/worker-bundler.mjs +156 -0
- package/dist/workflow-CDUlTD5B.mjs +239 -0
- package/dist/workflow.d.ts +76 -0
- package/package.json +74 -28
- package/dist/_api-client-H4MFOr8j.mjs +0 -35
- package/dist/_bundler-DQtFVeww.mjs +0 -125
- package/dist/_discover-DzsMlg3G.mjs +0 -218
- package/dist/_init-CbMs9S2O.mjs +0 -56
- package/dist/_templates-BDkbj3TM.mjs +0 -72
- package/dist/_ui-DWGXImbO.mjs +0 -30
- package/dist/delete-CalIL6Pg.mjs +0 -34
- package/dist/deploy-CLs8gLHV.mjs +0 -53
- package/dist/dev-DEZKrw8v.mjs +0 -18
- package/dist/init-CNuntiij.mjs +0 -114
- package/dist/secret-xmLQ96Yz.mjs +0 -46
- package/dist/test-yqHGZPF3.mjs +0 -44
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { expectDeployable } from "@alexkroman1/aai-runtime/testing";
|
|
2
|
+
import { describe, expect, test } from "vitest";
|
|
3
|
+
import agentDef from "./agent.ts";
|
|
4
|
+
|
|
5
|
+
describe("custom-pipeline-agent template", () => {
|
|
6
|
+
test("is deployable: validates, is nameable, and every stage its mode needs is filled", () => {
|
|
7
|
+
// The three invariants every starter owes, thrown by name — the same
|
|
8
|
+
// conversion `aai build`/`aai deploy` run, so an invalid provider
|
|
9
|
+
// combination or tuning fails here rather than at the first live session.
|
|
10
|
+
// The name is deliberately NOT the literal: `aai init <project>` scaffolds
|
|
11
|
+
// this file verbatim, so a pinned name would be a test about the TEMPLATE
|
|
12
|
+
// inside somebody else's project — and renaming the agent is the first
|
|
13
|
+
// thing they will do. `not.toThrow()` because the helper's throw IS the
|
|
14
|
+
// finding: vitest quotes the message, which names the invariant that went.
|
|
15
|
+
expect(() => expectDeployable(agentDef)).not.toThrow();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("declares at least one stage itself, which is what makes it a pipeline", () => {
|
|
19
|
+
// WHICH stage is deliberately not asserted: `agent.ts` invites you to move
|
|
20
|
+
// the declaration ("Declare only the stage you want elsewhere"), so naming
|
|
21
|
+
// one here would redden on the edit the comment above it asks for.
|
|
22
|
+
const declared = (["stt", "llm", "tts"] as const).filter(
|
|
23
|
+
(stage) => agentDef[stage] !== undefined,
|
|
24
|
+
);
|
|
25
|
+
expect(declared.length).toBeGreaterThan(0);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("a stage you declare survives, and every stage you leave unset defaults to AssemblyAI", () => {
|
|
29
|
+
// The template's whole subject, stated so it survives a swap: the config a
|
|
30
|
+
// deploy carries agrees with the def wherever the def has an opinion, and
|
|
31
|
+
// fills the AssemblyAI default wherever it does not. `expectDeployable`
|
|
32
|
+
// already checks the first half (a declared stage survives as declared);
|
|
33
|
+
// WHICH default fills the rest is this template's claim, so it is here.
|
|
34
|
+
const config = expectDeployable(agentDef);
|
|
35
|
+
if (config.mode !== "pipeline") {
|
|
36
|
+
// Switched the def to `s2s`? Then there is no cascade to fill — S2S
|
|
37
|
+
// REPLACES the pipeline rather than joining it, which `expectDeployable`
|
|
38
|
+
// asserted and `stages.test.ts` is the worked example for.
|
|
39
|
+
expect(config.mode).toBe("s2s");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
for (const stage of ["stt", "llm", "tts"] as const) {
|
|
43
|
+
expect(config[stage]?.kind, stage).toBe(agentDef[stage]?.kind ?? "assemblyai");
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("a declared stage's TUNING survives too, not just its provider", () => {
|
|
48
|
+
// The half `kind` cannot see, and the one a swap loses quietly: a
|
|
49
|
+
// descriptor that arrives with its `options` dropped still reports the
|
|
50
|
+
// right provider while running the gateway's default model — a different,
|
|
51
|
+
// usually slower agent, with nothing on the line saying so. Read off the
|
|
52
|
+
// def rather than pinned, because changing the model id is the first
|
|
53
|
+
// tuning an author of this template tries. (This claim came from
|
|
54
|
+
// `math-buddy`, which declared an LLM for the same reason and was removed
|
|
55
|
+
// as a near-duplicate of `code-interpreter-agent`; the stage swap lives here.)
|
|
56
|
+
const config = expectDeployable(agentDef);
|
|
57
|
+
const declared = (["stt", "llm", "tts"] as const).filter(
|
|
58
|
+
(stage) => agentDef[stage] !== undefined,
|
|
59
|
+
);
|
|
60
|
+
// The loop below is a sweep over a FILTER, so it asserts nothing at all on
|
|
61
|
+
// a def that declares no stage — the state the test above forbids, said
|
|
62
|
+
// again here because a vacuous pass looks exactly like a passing one.
|
|
63
|
+
expect(declared.length).toBeGreaterThan(0);
|
|
64
|
+
for (const stage of declared) {
|
|
65
|
+
expect(config[stage]?.options, stage).toEqual(agentDef[stage]?.options);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
* The other stage swaps live BESIDE this file rather than in it.
|
|
72
|
+
*
|
|
73
|
+
* `stages.test.ts` is the provider catalog — every STT, LLM, TTS and S2S
|
|
74
|
+
* factory, the option type each takes, and the published defaults — and
|
|
75
|
+
* `modes.test.ts` is which stages a mode even has. They are specs and not
|
|
76
|
+
* `agent.ts` for the reason `agent.ts` declares one stage: a deployed agent
|
|
77
|
+
* needs a key per vendor it names, and the all-AssemblyAI default is what makes
|
|
78
|
+
* this starter run the moment it is deployed.
|
|
79
|
+
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { agent } from "@alexkroman1/aai";
|
|
2
|
+
import { llm } from "@alexkroman1/aai/llm";
|
|
3
|
+
|
|
4
|
+
export default agent({
|
|
5
|
+
name: "Custom Pipeline Assistant",
|
|
6
|
+
description: "Answers general questions on a pipeline whose stages you swap one at a time",
|
|
7
|
+
greeting: "Hi! I'm running in pipeline mode. What can I help with?",
|
|
8
|
+
// Declare only the stage you want elsewhere — here the LLM. Every stage
|
|
9
|
+
// left unset (STT and TTS here) runs on the AssemblyAI default, billed to
|
|
10
|
+
// the one key a published agent is guaranteed to have, so swapping a stage
|
|
11
|
+
// never means restating the other two.
|
|
12
|
+
llm: llm({ provider: "anthropic", model: "claude-haiku-4-5" }),
|
|
13
|
+
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which stages a MODE even has — the question `stages.test.ts` assumes.
|
|
3
|
+
*
|
|
4
|
+
* `agent()` takes one union, `AgentParams`, with one member per mode, and the
|
|
5
|
+
* member is selected by `mode` (absent means pipeline). That is why
|
|
6
|
+
* `agent({ mode: "s2s", s2s, tts })` does not compile: the S2S member has no
|
|
7
|
+
* `tts` at all. Each member is exported, so a helper that BUILDS a def — a
|
|
8
|
+
* factory, a config assembled across files — can name the shape it takes
|
|
9
|
+
* instead of widening to the whole union and losing the refusals.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
type AgentDef,
|
|
14
|
+
type AgentMode,
|
|
15
|
+
type AgentParams,
|
|
16
|
+
type AssemblyAIPipelineOptions,
|
|
17
|
+
agent,
|
|
18
|
+
assemblyAIPipeline,
|
|
19
|
+
assemblyAIS2s,
|
|
20
|
+
type PipelineAgentParams,
|
|
21
|
+
type PipelinePhrases,
|
|
22
|
+
type PipelineTuning,
|
|
23
|
+
requireEnv,
|
|
24
|
+
type S2sAgentParams,
|
|
25
|
+
type SharedAgentParams,
|
|
26
|
+
type TextAgentParams,
|
|
27
|
+
} from "@alexkroman1/aai";
|
|
28
|
+
import { llm } from "@alexkroman1/aai/llm";
|
|
29
|
+
import { toAgentConfig } from "@alexkroman1/aai/manifest";
|
|
30
|
+
import { assemblyAITts } from "@alexkroman1/aai/tts";
|
|
31
|
+
import { describe, expect, test } from "vitest";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The half every member has: who the agent is, and what it says.
|
|
35
|
+
*
|
|
36
|
+
* `SharedAgentParams` is `AgentParams` minus the provider fields and minus
|
|
37
|
+
* everything one mode owns, so spreading it into each member below is the
|
|
38
|
+
* union's own structure written down — and a field that moves out of the shared
|
|
39
|
+
* half reddens here rather than in three places that quietly disagree.
|
|
40
|
+
*
|
|
41
|
+
* `satisfies` rather than an annotation, and the reason is the text member: the
|
|
42
|
+
* shared half carries `sttPrompt` and `telephony`, which a text agent has no
|
|
43
|
+
* audio path for, so its member drops both. An ANNOTATED const would spread
|
|
44
|
+
* those two optional keys into every member; `satisfies` checks the object and
|
|
45
|
+
* keeps its own type.
|
|
46
|
+
*/
|
|
47
|
+
const SHARED = {
|
|
48
|
+
name: "Line",
|
|
49
|
+
greeting: "Hi! I'm running in pipeline mode. What can I help with?",
|
|
50
|
+
systemPrompt: "Answer in one or two sentences.",
|
|
51
|
+
} satisfies SharedAgentParams;
|
|
52
|
+
|
|
53
|
+
describe("three modes, three members", () => {
|
|
54
|
+
test("`mode` is what selects the member", () => {
|
|
55
|
+
// Keyed by the three SESSION modes — the fourth, `"workflow-app"`, is a
|
|
56
|
+
// front door with no session, so it has no stages to ask about.
|
|
57
|
+
const byMode: Record<Exclude<AgentMode, "workflow-app">, AgentParams> = {
|
|
58
|
+
// Pipeline is the DEFAULT arm and the one `agent.ts` is in: STT → LLM →
|
|
59
|
+
// TTS, each stage swappable, every one you leave unset filled from the
|
|
60
|
+
// all-AssemblyAI preset.
|
|
61
|
+
pipeline: {
|
|
62
|
+
...SHARED,
|
|
63
|
+
llm: llm({ provider: "anthropic", model: "claude-haiku-4-5" }),
|
|
64
|
+
} satisfies PipelineAgentParams,
|
|
65
|
+
// S2S replaces all three with one service-side loop.
|
|
66
|
+
s2s: { ...SHARED, mode: "s2s", s2s: assemblyAIS2s() } satisfies S2sAgentParams,
|
|
67
|
+
// Text has no audio path at all — no STT to bias, no voice, no telephony,
|
|
68
|
+
// and its member has none of those fields.
|
|
69
|
+
text: { ...SHARED, mode: "text" } satisfies TextAgentParams,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
for (const [mode, params] of Object.entries(byMode)) {
|
|
73
|
+
const def = agent(params);
|
|
74
|
+
// The definition carries the AUTHORED mode (pipeline is the default when
|
|
75
|
+
// none is written); the config carries the session mode it runs.
|
|
76
|
+
expect(def.mode, mode).toBe(mode);
|
|
77
|
+
expect(toAgentConfig(def).mode, mode).toBe(mode);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("`agent()` returns an `AgentDef` — the params with the conveniences lowered", () => {
|
|
82
|
+
// The two types are not the same shape, and this is the difference worth
|
|
83
|
+
// seeing: `AgentParams` is what an author WRITES (a model id string for
|
|
84
|
+
// `llm`), `AgentDef` is what comes back, with it already a provider
|
|
85
|
+
// descriptor. Everything downstream — the config, the bundle, the runtime —
|
|
86
|
+
// reads the second. A voice has no shorthand: it is the TTS descriptor's.
|
|
87
|
+
const def: AgentDef = agent({
|
|
88
|
+
...SHARED,
|
|
89
|
+
tts: assemblyAITts({ voice: "michael" }),
|
|
90
|
+
llm: "claude-sonnet-4-6",
|
|
91
|
+
});
|
|
92
|
+
expect(def.tts?.kind).toBe("assemblyai");
|
|
93
|
+
expect(def.tts?.options.voice).toBe("michael");
|
|
94
|
+
expect(def.llm?.options.model).toBe("claude-sonnet-4-6");
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test("the preset takes OPTIONS — one setting across the three stages at once", () => {
|
|
99
|
+
// That a bare `assemblyAIPipeline()` is exactly what an undeclared agent gets
|
|
100
|
+
// filled with is `quickstart-agent`'s claim, and it stays there. This is the half that
|
|
101
|
+
// template only points at: the options bag, which is the reason to reach for
|
|
102
|
+
// the preset rather than let the default fill happen. `region` applies to STT
|
|
103
|
+
// and the LLM gateway together, so a residency choice is made once instead of
|
|
104
|
+
// on two descriptors that can drift apart, and `voice` to TTS. (An EU agent
|
|
105
|
+
// also has to name a model the EU gateway carries — Claude and most Gemini
|
|
106
|
+
// ids — which is the half no shorthand can do for you.)
|
|
107
|
+
const options: AssemblyAIPipelineOptions = { region: "eu", voice: "michael" };
|
|
108
|
+
const pipeline = assemblyAIPipeline(options);
|
|
109
|
+
expect(pipeline.stt.options.region).toBe("eu");
|
|
110
|
+
expect(pipeline.llm.options.providerOptions).toMatchObject({ region: "eu" });
|
|
111
|
+
expect(pipeline.tts.options.voice).toBe("michael");
|
|
112
|
+
|
|
113
|
+
// And a stage declared AFTER the spread still wins — that is the whole point
|
|
114
|
+
// of it being a plain object, and it is how this template's own `agent.ts`
|
|
115
|
+
// would read if it wanted the other two stages visible in the config.
|
|
116
|
+
const mine = llm({ provider: "anthropic", model: "claude-haiku-4-5" });
|
|
117
|
+
expect(agent({ ...SHARED, ...pipeline, llm: mine }).llm).toBe(mine);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe("voice-UX tuning is pipeline-only", () => {
|
|
121
|
+
/**
|
|
122
|
+
* The knobs that only exist because there IS a cascade: barge-in, dead air,
|
|
123
|
+
* and what the agent says when a stage fails. `AgentDef` extends
|
|
124
|
+
* `PipelineTuning` and `PipelinePhrases`, so these sit on `agent()` beside the stages rather
|
|
125
|
+
* than on a descriptor — none of them belongs to one vendor.
|
|
126
|
+
*/
|
|
127
|
+
const TUNING: PipelineTuning & PipelinePhrases = {
|
|
128
|
+
interruption: { minWords: 3, minDurationMs: 200, resumeFalseInterruption: true },
|
|
129
|
+
silence: { deadAirCoverMs: 1200 },
|
|
130
|
+
turnTaking: { preemptiveGeneration: true },
|
|
131
|
+
errorPhrase: "Sorry — I lost that. Say it once more?",
|
|
132
|
+
startFailurePhrase: "I'm having trouble hearing you right now.",
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
test("every field survives into the config a deploy carries", () => {
|
|
136
|
+
// Same claim `agent.test.ts` makes about a stage's `options`, one level up:
|
|
137
|
+
// tuning that arrives dropped leaves a working agent with none of the voice
|
|
138
|
+
// behaviour its author configured, and nothing on the line saying so.
|
|
139
|
+
expect(toAgentConfig(agent({ ...SHARED, ...TUNING }))).toMatchObject(TUNING);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
test("and an S2S agent is refused it rather than ignoring it", () => {
|
|
143
|
+
// The S2S provider owns endpointing and barge-in service-side, so these
|
|
144
|
+
// would be silently ignored there. The type says so first (the S2S member
|
|
145
|
+
// has none of these fields), which is why this reaches the runtime rule by
|
|
146
|
+
// spreading — the half that also catches a raw `export default {...}`.
|
|
147
|
+
const s2sAgent = agent({ ...SHARED, mode: "s2s", s2s: assemblyAIS2s() });
|
|
148
|
+
expect(() => toAgentConfig({ ...s2sAgent, ...TUNING })).toThrow(/no effect on a "s2s" agent/);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test("a stage you swap brings its own credential", () => {
|
|
153
|
+
// The template's lesson, from the tool side. A descriptor never carries a
|
|
154
|
+
// key — `apiKeyEnv` names a VARIABLE, and the host reads it at session start
|
|
155
|
+
// — so a tool body calling the same vendor directly reads the same way, and
|
|
156
|
+
// `requireEnv` is that read: it fails by NAME instead of surfacing as a
|
|
157
|
+
// `TypeError` on the first property access, which the tool executor would
|
|
158
|
+
// hand to the model as an apology no log line explains.
|
|
159
|
+
const ctx = { env: { ANTHROPIC_API_KEY: "from-the-secret-store" } };
|
|
160
|
+
expect(requireEnv(ctx, "ANTHROPIC_API_KEY")).toBe("from-the-secret-store");
|
|
161
|
+
expect(() => requireEnv(ctx, "OPENAI_API_KEY")).toThrow(/OPENAI_API_KEY/);
|
|
162
|
+
});
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The provider catalog: every stage, every vendor, as compiling code.
|
|
3
|
+
*
|
|
4
|
+
* `agent.ts` declares ONE stage, because an agent should. This file is the menu
|
|
5
|
+
* it picked that line off — the shape of each of the other provider factories,
|
|
6
|
+
* the option type each takes, and the published constants an author needs to
|
|
7
|
+
* spell a default out loud.
|
|
8
|
+
*
|
|
9
|
+
* It lives in the spec rather than in `agent.ts` for a reason worth copying: a
|
|
10
|
+
* deployed agent needs a key per vendor it names, and the all-AssemblyAI
|
|
11
|
+
* default is what makes the starter run the moment it is deployed. Declaring a
|
|
12
|
+
* stage here shows the shape and costs the template nothing. (Before this file
|
|
13
|
+
* the whole surface had NO example anywhere: zero of the templates set `stt:`,
|
|
14
|
+
* `tts:` or `s2s:`, so `@alexkroman1/aai/stt` and `/s2s` were 100% unexercised
|
|
15
|
+
* while carrying a semver promise. That is either an API nobody needs or an API
|
|
16
|
+
* nobody has run, and neither is a good place to leave a published surface.)
|
|
17
|
+
*
|
|
18
|
+
* `modes.test.ts` beside it is the other half — which stages a mode even HAS.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { ProviderCredentialOptions, ProviderDescriptor } from "@alexkroman1/aai";
|
|
22
|
+
import { agent } from "@alexkroman1/aai";
|
|
23
|
+
import {
|
|
24
|
+
ASSEMBLYAI_LLM_DEFAULT_MODEL,
|
|
25
|
+
type AssemblyAIGatewayModel,
|
|
26
|
+
type AssemblyAILlmProviderOptions,
|
|
27
|
+
type AssemblyAIReasoningEffort,
|
|
28
|
+
type LlmOptions,
|
|
29
|
+
type LlmProvider,
|
|
30
|
+
llm,
|
|
31
|
+
} from "@alexkroman1/aai/llm";
|
|
32
|
+
import { toAgentConfig } from "@alexkroman1/aai/manifest";
|
|
33
|
+
import {
|
|
34
|
+
type AssemblyAIS2sOptions,
|
|
35
|
+
assemblyAIS2s,
|
|
36
|
+
type OpenAIS2sOptions,
|
|
37
|
+
type OpenAIS2sVoice,
|
|
38
|
+
openAIS2s,
|
|
39
|
+
type S2sProvider,
|
|
40
|
+
} from "@alexkroman1/aai/s2s";
|
|
41
|
+
import {
|
|
42
|
+
ASSEMBLYAI_STT_EU_URL,
|
|
43
|
+
type AssemblyAISttOptions,
|
|
44
|
+
assemblyAIStt,
|
|
45
|
+
DEEPGRAM_DEFAULT_ENDPOINTING_MS,
|
|
46
|
+
type DeepgramSttOptions,
|
|
47
|
+
deepgramStt,
|
|
48
|
+
type ElevenLabsSttOptions,
|
|
49
|
+
elevenLabsStt,
|
|
50
|
+
type SonioxSttOptions,
|
|
51
|
+
type SttProvider,
|
|
52
|
+
sonioxStt,
|
|
53
|
+
} from "@alexkroman1/aai/stt";
|
|
54
|
+
import {
|
|
55
|
+
ASSEMBLYAI_TTS_DEFAULT_VOICE,
|
|
56
|
+
ASSEMBLYAI_TTS_LANGUAGES,
|
|
57
|
+
ASSEMBLYAI_TTS_VOICES,
|
|
58
|
+
type AssemblyAITtsLanguage,
|
|
59
|
+
type AssemblyAITtsOptions,
|
|
60
|
+
type AssemblyAITtsVoice,
|
|
61
|
+
type AssemblyAITtsVoiceInfo,
|
|
62
|
+
assemblyAITts,
|
|
63
|
+
CARTESIA_DEFAULT_VOICE,
|
|
64
|
+
type CartesiaTtsOptions,
|
|
65
|
+
cartesiaTts,
|
|
66
|
+
RIME_DEFAULT_VOICE,
|
|
67
|
+
type RimeTtsOptions,
|
|
68
|
+
rimeTts,
|
|
69
|
+
type TtsProvider,
|
|
70
|
+
ttsVoiceIds,
|
|
71
|
+
ttsVoiceInfo,
|
|
72
|
+
} from "@alexkroman1/aai/tts";
|
|
73
|
+
import { describe, expect, test } from "vitest";
|
|
74
|
+
|
|
75
|
+
/** The name is not the subject here — every case declares a throwaway agent. */
|
|
76
|
+
const NAME = "Line";
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Read any stage the same way, because every stage descriptor is one shape.
|
|
80
|
+
*
|
|
81
|
+
* `ProviderDescriptor<Kind, Options>` is the base all four of `SttProvider`,
|
|
82
|
+
* `LlmProvider`, `TtsProvider` and `S2sProvider` narrow, which is why it is the
|
|
83
|
+
* one provider type published on the ROOT barrel rather than on a stage
|
|
84
|
+
* subpath: one interface with four reference pages is a worse deal than one.
|
|
85
|
+
* A descriptor is also pure DATA — no key, no client, nothing to close — which
|
|
86
|
+
* is what lets `aai build` serialize it into the bundle.
|
|
87
|
+
*/
|
|
88
|
+
function shape(stage: ProviderDescriptor<string, Record<string, unknown>>): string {
|
|
89
|
+
return `${stage.kind}(${Object.keys(stage.options).sort().join(", ")})`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
describe("the LLM stage: one factory, the provider is data", () => {
|
|
93
|
+
test("`llm({ provider })` returns a descriptor whose `kind` IS the provider", () => {
|
|
94
|
+
// Keyed BY the provider, so the table is its own assertion: a descriptor
|
|
95
|
+
// with the wrong kind fails on its own row rather than in an aggregate.
|
|
96
|
+
// The ten built-in providers are `LlmProviderName`'s autocomplete; the
|
|
97
|
+
// field itself is open, so any other name compiles too (see below).
|
|
98
|
+
const byProvider: Record<string, LlmProvider> = {
|
|
99
|
+
anthropic: llm({ provider: "anthropic", model: "claude-haiku-4-5" }),
|
|
100
|
+
assemblyai: llm({ provider: "assemblyai", model: ASSEMBLYAI_LLM_DEFAULT_MODEL }),
|
|
101
|
+
cerebras: llm({ provider: "cerebras", model: "qwen-3.8-27b" }),
|
|
102
|
+
gateway: llm({ provider: "gateway", model: "zai/glm-4.6" }),
|
|
103
|
+
google: llm({ provider: "google", model: "gemini-2.5-flash" }),
|
|
104
|
+
groq: llm({ provider: "groq", model: "llama-3.3-70b-versatile" }),
|
|
105
|
+
mistral: llm({ provider: "mistral", model: "mistral-large-latest" }),
|
|
106
|
+
openai: llm({ provider: "openai", model: "gpt-5-mini" }),
|
|
107
|
+
openrouter: llm({ provider: "openrouter", model: "meta-llama/llama-3.3-70b-instruct" }),
|
|
108
|
+
xai: llm({ provider: "xai", model: "grok-4" }),
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
for (const [kind, stage] of Object.entries(byProvider)) {
|
|
112
|
+
expect(stage.kind, kind).toBe(kind);
|
|
113
|
+
// And it survives the conversion a deploy runs, which is the claim that
|
|
114
|
+
// matters: a descriptor the config drops is a stage that silently isn't.
|
|
115
|
+
expect(toAgentConfig(agent({ name: NAME, llm: stage })).llm?.kind, kind).toBe(kind);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test("swapping vendors is a one-word edit: every provider takes the same options", () => {
|
|
120
|
+
// One options type for all of them — a model id, plus the optional
|
|
121
|
+
// `baseUrl`, `apiKeyEnv` and `providerOptions` — which is why there is no
|
|
122
|
+
// per-vendor factory to learn.
|
|
123
|
+
const options: LlmOptions<"openai"> = { provider: "openai", model: "gpt-5-mini" };
|
|
124
|
+
expect(shape(llm(options))).toBe("openai(model)");
|
|
125
|
+
expect(shape(llm({ ...options, provider: "google", model: "gemini-2.5-flash" }))).toBe(
|
|
126
|
+
"google(model)",
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test("an unlisted provider is reached by naming its OpenAI-compatible endpoint", () => {
|
|
131
|
+
// `provider` is open (`"assemblyai" | … | (string & {})`): a vendor this
|
|
132
|
+
// release has not heard of compiles, and `baseUrl` is what the host
|
|
133
|
+
// resolver dials it through. `aai build` warns about one with neither.
|
|
134
|
+
const stage = llm({
|
|
135
|
+
provider: "my-inference-host",
|
|
136
|
+
model: "my-model",
|
|
137
|
+
baseUrl: "https://inference.example.com/v1",
|
|
138
|
+
apiKeyEnv: "MY_INFERENCE_KEY",
|
|
139
|
+
});
|
|
140
|
+
expect(shape(stage)).toBe("my-inference-host(apiKeyEnv, baseUrl, model)");
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
test("`apiKeyEnv` renames the variable the platform reads for this stage", () => {
|
|
144
|
+
// `ProviderCredentialOptions` is the other base — every provider options
|
|
145
|
+
// interface on all four stages extends it, which is why it too sits on the
|
|
146
|
+
// root rather than in one stage's subpath. There is no factory-time key
|
|
147
|
+
// parameter anywhere in this file: a descriptor stays free of secrets, and
|
|
148
|
+
// the host resolves the value from the agent's env at session start. This
|
|
149
|
+
// field only changes WHICH variable it reads, for an agent that keeps two
|
|
150
|
+
// OpenAI keys, or names the vendor's key something of its own.
|
|
151
|
+
const credential: ProviderCredentialOptions = { apiKeyEnv: "TEAM_OPENAI_KEY" };
|
|
152
|
+
const stage = llm({ provider: "openai", model: "gpt-5-mini", ...credential });
|
|
153
|
+
expect(stage.options.apiKeyEnv).toBe("TEAM_OPENAI_KEY");
|
|
154
|
+
// Not a secret and not a value — the NAME of an env var, so it is safe in
|
|
155
|
+
// the bundle. Nothing here reads `process.env`.
|
|
156
|
+
expect(stage.options.model).toBe("gpt-5-mini");
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test("the AssemblyAI gateway is the one with a published default model", () => {
|
|
160
|
+
// The stage `agent.ts` leaves unset. It bills to `ASSEMBLYAI_API_KEY` — the
|
|
161
|
+
// one key a published agent is guaranteed to have — so its default model is
|
|
162
|
+
// published rather than implied.
|
|
163
|
+
expect(typeof ASSEMBLYAI_LLM_DEFAULT_MODEL).toBe("string");
|
|
164
|
+
// A gateway id is a free-form string the service rejects with a 400 at the
|
|
165
|
+
// first session, so an invented one ships. `AssemblyAIGatewayModel`
|
|
166
|
+
// autocompletes the ids this release knows, and stays open so a model
|
|
167
|
+
// shipped after it still compiles.
|
|
168
|
+
const model: AssemblyAIGatewayModel = "claude-sonnet-4-6";
|
|
169
|
+
// On a voice line, time-to-first-token IS the quality: the measured cost of
|
|
170
|
+
// leaving a reasoning model on its server-side default was 1786ms p50
|
|
171
|
+
// against 999ms with reasoning off.
|
|
172
|
+
const reasoningEffort: AssemblyAIReasoningEffort = "none";
|
|
173
|
+
const providerOptions: AssemblyAILlmProviderOptions = { reasoningEffort };
|
|
174
|
+
expect(llm({ provider: "assemblyai", model, providerOptions }).options).toMatchObject({
|
|
175
|
+
model,
|
|
176
|
+
providerOptions: { reasoningEffort },
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe("EU residency: a shorthand, and the URL it is short for", () => {
|
|
182
|
+
test("`region` sets STT and the LLM gateway; TTS has a single endpoint", () => {
|
|
183
|
+
expect(assemblyAIStt({ region: "eu" }).options.region).toBe("eu");
|
|
184
|
+
const stage = llm({
|
|
185
|
+
provider: "assemblyai",
|
|
186
|
+
model: "claude-sonnet-4-6",
|
|
187
|
+
providerOptions: { region: "eu" },
|
|
188
|
+
});
|
|
189
|
+
expect(stage.options.providerOptions).toEqual({ region: "eu" });
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
test("an explicit endpoint is the long form, and it WINS over `region`", () => {
|
|
193
|
+
// Naming a URL is deliberate, so the residency shorthand must not silently
|
|
194
|
+
// overwrite it — and an EU agent must also pick a model the EU gateway
|
|
195
|
+
// carries (Claude and most Gemini ids), which is the half a bare
|
|
196
|
+
// `region: "eu"` cannot do for you.
|
|
197
|
+
const stt = assemblyAIStt({
|
|
198
|
+
streamingUrl: ASSEMBLYAI_STT_EU_URL,
|
|
199
|
+
} satisfies AssemblyAISttOptions);
|
|
200
|
+
const stage = llm({
|
|
201
|
+
provider: "assemblyai",
|
|
202
|
+
model: "claude-sonnet-4-6",
|
|
203
|
+
baseUrl: "https://llm-gateway.eu.assemblyai.com/v1",
|
|
204
|
+
});
|
|
205
|
+
expect(stt.options.streamingUrl).toBe(ASSEMBLYAI_STT_EU_URL);
|
|
206
|
+
// An OpenAI-compatible base carries the version path; the client appends
|
|
207
|
+
// `/chat/completions`. The streaming one is a WebSocket URL.
|
|
208
|
+
expect(stage.options.baseUrl?.toString().endsWith("/v1")).toBe(true);
|
|
209
|
+
expect(new URL(ASSEMBLYAI_STT_EU_URL).protocol).toBe("wss:");
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
describe("the STT stage", () => {
|
|
214
|
+
test("four providers, each one field on `agent()`", () => {
|
|
215
|
+
for (const [stt, kind] of [
|
|
216
|
+
[assemblyAIStt({ region: "eu" } satisfies AssemblyAISttOptions), "assemblyai"],
|
|
217
|
+
[deepgramStt({ language: "en" } satisfies DeepgramSttOptions), "deepgram"],
|
|
218
|
+
[elevenLabsStt({} satisfies ElevenLabsSttOptions), "elevenlabs"],
|
|
219
|
+
[sonioxStt({ languages: ["en", "es"] } satisfies SonioxSttOptions), "soniox"],
|
|
220
|
+
] as const satisfies readonly (readonly [SttProvider, string])[]) {
|
|
221
|
+
const config = toAgentConfig(agent({ name: NAME, stt }));
|
|
222
|
+
expect(config.stt?.kind).toBe(kind);
|
|
223
|
+
// Whatever the STT stage is, the two it does not touch still default.
|
|
224
|
+
expect(config.llm?.kind).toBe("assemblyai");
|
|
225
|
+
expect(config.tts?.kind).toBe("assemblyai");
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
test("Deepgram's endpointing window is a published default, not a hidden one", () => {
|
|
230
|
+
// The descriptor carries only what you set — the host fills the rest — so
|
|
231
|
+
// the number is published rather than buried in the opener. It is worth
|
|
232
|
+
// knowing before you move it: 1500ms is matched to the AssemblyAI opener's
|
|
233
|
+
// 1600ms `min_turn_silence`, and Deepgram exposes no pause-tolerance
|
|
234
|
+
// counterpart, so this one window is the whole end-of-turn policy there.
|
|
235
|
+
expect(deepgramStt().options.endpointing).toBeUndefined();
|
|
236
|
+
expect(deepgramStt({ endpointing: DEEPGRAM_DEFAULT_ENDPOINTING_MS }).options.endpointing).toBe(
|
|
237
|
+
DEEPGRAM_DEFAULT_ENDPOINTING_MS,
|
|
238
|
+
);
|
|
239
|
+
// Deepgram is also the one STT here that does NOT auto-detect: it defaults
|
|
240
|
+
// to English, so an agent moved to it silently loses non-English
|
|
241
|
+
// transcription unless it names a code.
|
|
242
|
+
expect(shape(deepgramStt({ language: "es" }))).toBe("deepgram(language)");
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
describe("the TTS stage", () => {
|
|
247
|
+
test("three providers, and a bare call is not an empty descriptor", () => {
|
|
248
|
+
for (const [tts, kind, voice] of [
|
|
249
|
+
[
|
|
250
|
+
assemblyAITts({} satisfies AssemblyAITtsOptions),
|
|
251
|
+
"assemblyai",
|
|
252
|
+
ASSEMBLYAI_TTS_DEFAULT_VOICE,
|
|
253
|
+
],
|
|
254
|
+
[cartesiaTts({} satisfies CartesiaTtsOptions), "cartesia", CARTESIA_DEFAULT_VOICE],
|
|
255
|
+
[rimeTts({} satisfies RimeTtsOptions), "rime", RIME_DEFAULT_VOICE],
|
|
256
|
+
] as const satisfies readonly (readonly [TtsProvider, string, string])[]) {
|
|
257
|
+
expect(toAgentConfig(agent({ name: NAME, tts })).tts?.kind).toBe(kind);
|
|
258
|
+
// Each factory names its vendor's default voice rather than leaving the
|
|
259
|
+
// field out, which is what makes `cartesiaTts()` work out of the box.
|
|
260
|
+
expect(tts.options.voice, kind).toBe(voice);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
test("a voice speaks exactly ONE language, and a pair that disagrees is refused", () => {
|
|
265
|
+
// The catalog is `voice id -> { language, accent }`, and every language the
|
|
266
|
+
// stage supports has at least one speaker. Pick from it rather than pairing
|
|
267
|
+
// by hand: `{ language: "fr" }` alone fills in the default voice, which
|
|
268
|
+
// speaks English, so asking for French and nothing else used to produce an
|
|
269
|
+
// agent that connected, reported ready, and never spoke.
|
|
270
|
+
// `ttsVoiceInfo` is the lookup by an OPEN voice id — `undefined` for one
|
|
271
|
+
// this release's catalog does not list — so it needs no cast.
|
|
272
|
+
const info: AssemblyAITtsVoiceInfo | undefined = ttsVoiceInfo(ASSEMBLYAI_TTS_DEFAULT_VOICE);
|
|
273
|
+
expect(info?.language).toBe("en");
|
|
274
|
+
expect(ttsVoiceInfo("a-voice-shipped-next-week")).toBeUndefined();
|
|
275
|
+
// With no language, `ttsVoiceIds()` is the whole catalog, in its order.
|
|
276
|
+
expect(ttsVoiceIds()).toEqual(Object.keys(ASSEMBLYAI_TTS_VOICES));
|
|
277
|
+
|
|
278
|
+
for (const language of Object.keys(ASSEMBLYAI_TTS_LANGUAGES) as AssemblyAITtsLanguage[]) {
|
|
279
|
+
// `ttsVoiceIds(language)` is the catalog filtered to its speakers.
|
|
280
|
+
const [voice] = ttsVoiceIds(language);
|
|
281
|
+
expect(voice, language).toBeDefined();
|
|
282
|
+
if (!voice) continue;
|
|
283
|
+
const speaking = agent({ name: NAME, tts: assemblyAITts({ language, voice }) });
|
|
284
|
+
expect(() => toAgentConfig(speaking), language).not.toThrow();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// `toAgentConfig` is the last layer that sees the mismatch while somebody
|
|
288
|
+
// is still authoring — after it, the refusal is in-band, after the socket
|
|
289
|
+
// opens, with the agent ready and mute.
|
|
290
|
+
const mismatched = agent({ name: NAME, tts: assemblyAITts({ language: "fr" }) });
|
|
291
|
+
expect(() => toAgentConfig(mismatched)).toThrow(/speaks en/);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test("the catalog is not an allow-list: a voice shipped later still compiles", () => {
|
|
295
|
+
// `AssemblyAITtsVoice` is the open union — the listed ids plus any string —
|
|
296
|
+
// deliberately, because refusing an unlisted voice would refuse one
|
|
297
|
+
// AssemblyAI ships after this release. `aai build` prints a warning for a
|
|
298
|
+
// name it does not recognise, which is what catches the typo half.
|
|
299
|
+
const unreleased: AssemblyAITtsVoice = "voice-shipped-after-this-release";
|
|
300
|
+
const later = agent({ name: NAME, tts: assemblyAITts({ voice: unreleased }) });
|
|
301
|
+
expect(toAgentConfig(later).tts?.options.voice).toBe(unreleased);
|
|
302
|
+
});
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
describe("the S2S stage: an opt-in that REPLACES the pipeline", () => {
|
|
306
|
+
test("two providers, and neither leaves an STT or TTS stage behind", () => {
|
|
307
|
+
const voice: OpenAIS2sVoice = "alloy";
|
|
308
|
+
for (const [s2s, kind] of [
|
|
309
|
+
[assemblyAIS2s({ keyterms: ["AssemblyAI"] } satisfies AssemblyAIS2sOptions), "assemblyai"],
|
|
310
|
+
[openAIS2s({ voice } satisfies OpenAIS2sOptions), "openai-realtime"],
|
|
311
|
+
] as const satisfies readonly (readonly [S2sProvider, string])[]) {
|
|
312
|
+
const config = toAgentConfig(agent({ name: NAME, mode: "s2s", s2s }));
|
|
313
|
+
expect(config.s2s?.kind).toBe(kind);
|
|
314
|
+
expect(config.mode).toBe("s2s");
|
|
315
|
+
// No cascade is filled in: speech-to-speech has no separate STT or TTS,
|
|
316
|
+
// which is the whole difference and the reason `s2s` is never a default.
|
|
317
|
+
expect(config.stt).toBeUndefined();
|
|
318
|
+
expect(config.tts).toBeUndefined();
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
test("mixing S2S with a pipeline stage is refused, by the type AND by the config", () => {
|
|
323
|
+
// The type refuses it outright: `agent({ s2s, tts })` does not compile, which
|
|
324
|
+
// is why this reaches the runtime rule by spreading instead. Both halves
|
|
325
|
+
// matter — the second is what catches a raw `export default {...}` that
|
|
326
|
+
// never went through `agent()`.
|
|
327
|
+
const s2sAgent = agent({ name: NAME, mode: "s2s", s2s: assemblyAIS2s() });
|
|
328
|
+
expect(() => toAgentConfig({ ...s2sAgent, tts: cartesiaTts() })).toThrow();
|
|
329
|
+
});
|
|
330
|
+
});
|