@alexkroman1/aai-cli 0.12.3 → 0.14.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-B6v31ROV.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 +35 -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-GoEXEVpA.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 +54 -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-BnmTHtjd.mjs +68 -0
- package/dist/_slug-api.d.ts +61 -0
- package/dist/_stop-server.d.ts +17 -0
- package/dist/_studio-B5m4jBTD.mjs +256 -0
- package/dist/_studio-commands.d.ts +73 -0
- package/dist/_studio.d.ts +92 -0
- package/dist/_target-bundle.d.ts +141 -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-BVMVsQh0.mjs +139 -0
- package/dist/_templates.d.ts +89 -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-CKhanHVv.mjs +588 -0
- package/dist/build.d.ts +146 -0
- package/dist/cli-workflow.d.ts +17 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +1092 -195
- package/dist/client-bundler-DZ_Zoznn.mjs +241 -0
- package/dist/client-bundler.d.ts +38 -0
- package/dist/client-bundler.mjs +3 -0
- package/dist/console-Dxq26Adz.mjs +447 -0
- package/dist/console.d.ts +70 -0
- package/dist/delete-DwXCHzTl.mjs +55 -0
- package/dist/delete.d.ts +26 -0
- package/dist/deploy-CbA8Ibiu.mjs +97 -0
- package/dist/deploy.d.ts +25 -0
- package/dist/dev-BWBDbUEb.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-CidslZZz.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-CnPK-Prw.mjs +102 -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 +139 -0
- package/dist/scaffold/agent-guide/PIPELINE-TUNING.md +232 -0
- package/dist/scaffold/agent-guide/PROVIDERS.md +140 -0
- package/dist/scaffold/agent-guide/TESTING-EVALS.md +158 -0
- package/dist/scaffold/agent-guide/TOOLS.md +627 -0
- package/dist/scaffold/agent-guide/UI.md +292 -0
- package/dist/scaffold/agent-guide/WORKFLOWS.md +803 -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-DPdPEet2.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-COjK25Rl.mjs +208 -0
- package/dist/studio.d.ts +56 -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 +251 -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 +512 -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 +646 -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 +329 -0
- package/dist/templates/medication-safety-agent/agent.ts +62 -0
- package/dist/templates/medication-safety-agent/fda.test.ts +129 -0
- package/dist/templates/medication-safety-agent/fda.ts +166 -0
- package/dist/templates/medication-safety-agent/system-prompt.md +26 -0
- package/dist/templates/medication-safety-agent/tools/check_drug_interaction.ts +70 -0
- package/dist/templates/medication-safety-agent/tools/medication_lookup.ts +46 -0
- package/dist/templates/meeting-recap-agent/agent.eval.test.ts +459 -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 +348 -0
- package/dist/templates/research-handoff-agent/agent.test.ts +818 -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 +640 -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 +356 -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 +2033 -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 +219 -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 +182 -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 +490 -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,354 @@
|
|
|
1
|
+
// Copyright 2026 the AAI authors. MIT license.
|
|
2
|
+
// An EVAL for a WORKFLOW APP: does the run actually do the work? Run it with
|
|
3
|
+
// `aai eval`.
|
|
4
|
+
//
|
|
5
|
+
// `agent.test.ts` asserts about the declaration and drives the four legs one at
|
|
6
|
+
// a time. This drives the WHOLE BODY — `spokenSummaryFlow` from the top — and
|
|
7
|
+
// what it is here to check is the thing that is this template's whole reason to
|
|
8
|
+
// exist and that no per-step spec can see: the AUDIO ROUND TRIP. A recording
|
|
9
|
+
// goes in, and what comes out is a run whose OUTPUT NAMES A FILE that is really
|
|
10
|
+
// in the store, put there by the same step that spoke it.
|
|
11
|
+
//
|
|
12
|
+
// `describeWorkflowEval` picks the providers for you and says which it picked:
|
|
13
|
+
//
|
|
14
|
+
// * with `ASSEMBLYAI_API_KEY` — a LIVE run. The `{ live: true }` case below
|
|
15
|
+
// downloads a real four-minute news clip, really transcribes it and really
|
|
16
|
+
// summarizes it. That spends money and about a minute.
|
|
17
|
+
// * without one — a SCRIPTED run: the same body, the same four legs, with the
|
|
18
|
+
// provider answered in memory.
|
|
19
|
+
//
|
|
20
|
+
// Three of the four cases are SCRIPTED IN BOTH MODES, deliberately. Their claims
|
|
21
|
+
// are about WIRING — that the id in the output is the id of the file that was
|
|
22
|
+
// written, that the voice was handed the script and not the bullet list, that
|
|
23
|
+
// the poll loop asks for its wait — and a live provider can neither confirm nor
|
|
24
|
+
// deny any of them: it can only be asked and then have its answer accepted,
|
|
25
|
+
// which is not evidence. The live case is the one that answers "is the summary
|
|
26
|
+
// really of this recording".
|
|
27
|
+
//
|
|
28
|
+
// The UPLOAD STORE is faked in both modes, and that is not a mode question: it
|
|
29
|
+
// is this app's own storage (a database row and a blob), not a provider, and an
|
|
30
|
+
// eval has neither. `{ writable: true }` is what lets the store accept the
|
|
31
|
+
// write — opt-in precisely so a step that stored a file nobody meant it to
|
|
32
|
+
// still fails.
|
|
33
|
+
//
|
|
34
|
+
// TWO PROVIDER LEGS ARE NOT REACHABLE LIVE from an eval today, and both are
|
|
35
|
+
// named where they are worked around rather than left as a surprise:
|
|
36
|
+
//
|
|
37
|
+
// * the streaming UPLOAD leg needs a `stepFetch` — see `liveStepFetch` below.
|
|
38
|
+
// * `stepSpeak` needs a synthesizer, and the engine publishes none by default
|
|
39
|
+
// while `@alexkroman1/aai-runtime` exports no real one to pass. So the VOICE
|
|
40
|
+
// is faked in every case here, live included, and the live case's claim is
|
|
41
|
+
// about the transcript and the summary rather than about audible audio.
|
|
42
|
+
//
|
|
43
|
+
// WHAT NO EVAL HERE COVERS: durability. Imported through vitest with no bundler
|
|
44
|
+
// in the path, a workflow body is an ordinary async function — no
|
|
45
|
+
// journal, no replay, and no per-step retry, so a rate-limited live run FAILS
|
|
46
|
+
// where a deployed one would have ridden it out, and the resume-replays-the-id
|
|
47
|
+
// property that makes speak-and-store ONE step is argued here rather than
|
|
48
|
+
// exercised. `run.slept` below is the other half of that admission written as
|
|
49
|
+
// an assertion. `aai-cli`'s `dev-workflow.scenario.test.ts` is the tier that
|
|
50
|
+
// really suspends and resumes a run.
|
|
51
|
+
import {
|
|
52
|
+
describeWorkflowEval,
|
|
53
|
+
installStubSpeech,
|
|
54
|
+
installStubTranscribe,
|
|
55
|
+
installStubUploads,
|
|
56
|
+
stubGatewayRoute,
|
|
57
|
+
} from "@alexkroman1/aai-runtime/testing/vitest";
|
|
58
|
+
import { assert, expect } from "vitest";
|
|
59
|
+
import agentDef, { spokenSummary } from "./agent.ts";
|
|
60
|
+
import { POLL_INTERVAL_MS } from "./workflows/transcribe.ts";
|
|
61
|
+
|
|
62
|
+
/** The id every case uploads the recording under. */
|
|
63
|
+
const UPLOAD_ID = "upl_eval";
|
|
64
|
+
|
|
65
|
+
/** The public sample recording — four and a half minutes of real speech. */
|
|
66
|
+
const LIVE_RECORDING = "https://assembly.ai/wildfires.mp3";
|
|
67
|
+
|
|
68
|
+
/** What a scripted transcript says, so a summary of it is checkable. */
|
|
69
|
+
const TRANSCRIPT =
|
|
70
|
+
"Right, standup. The launch is on for Tuesday the fourth. Two bugs are left in " +
|
|
71
|
+
"checkout, both assigned to Priya, and neither is a blocker. Marketing wants the " +
|
|
72
|
+
"blog post by Monday. If the second bug slips we ship anyway and patch on Wednesday.";
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The reply the model is scripted to give.
|
|
76
|
+
*
|
|
77
|
+
* The `spoken` script deliberately shares NO wording with `points`, which is
|
|
78
|
+
* what makes "the voice was handed the script" an assertion rather than a
|
|
79
|
+
* coincidence — see the second case.
|
|
80
|
+
*/
|
|
81
|
+
const REPLY = {
|
|
82
|
+
headline: "Launch is on for Tuesday",
|
|
83
|
+
points: ["Ship Tuesday the fourth", "Two checkout bugs, neither blocking", "Blog post by Monday"],
|
|
84
|
+
spoken:
|
|
85
|
+
"Everything is lined up for the fourth. A couple of small things are still open " +
|
|
86
|
+
"in checkout and Priya has both of them; nothing there is holding the release. " +
|
|
87
|
+
"Marketing needs the write-up at the start of the week.",
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A `stepFetch` for the LIVE legs, and it exists to work around a gap rather
|
|
92
|
+
* than to add anything.
|
|
93
|
+
*
|
|
94
|
+
* The eval engine publishes no `stepFetch`, so a step's HTTP falls back to
|
|
95
|
+
* `globalThis.fetch` — which cannot send this app's UPLOAD leg at all.
|
|
96
|
+
* `stepTranscribeUpload` streams a stored recording window by window, and an
|
|
97
|
+
* iterable body requires `duplex: "half"`; the published fetch adds it (see
|
|
98
|
+
* `sdk/step-fetch.ts`, which says so) and the fallback does not, so a live run
|
|
99
|
+
* dies on `RequestInit: duplex option is required when sending a body` before
|
|
100
|
+
* the provider is ever reached. `EvalWorkflowsOptions.stepFetch` is the
|
|
101
|
+
* documented seam for a host to supply its own, and this is the smallest one
|
|
102
|
+
* that works. Every scripted case below REPLACES it, publishing being a
|
|
103
|
+
* replacement.
|
|
104
|
+
*/
|
|
105
|
+
const liveStepFetch = (url: string, init: Record<string, unknown> = {}): Promise<Response> =>
|
|
106
|
+
globalThis.fetch(url, { ...init, duplex: "half" } as RequestInit);
|
|
107
|
+
|
|
108
|
+
/** Publish this app's own store, writable because the last step writes to it. */
|
|
109
|
+
function publish(bytes: Uint8Array, name: string, type: string) {
|
|
110
|
+
return installStubUploads({ [UPLOAD_ID]: { bytes, name, type } }, { writable: true });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Answer every leg of the run in memory: the three transcription calls, and the
|
|
115
|
+
* model.
|
|
116
|
+
*
|
|
117
|
+
* ONE fake, because publishing a `stepFetch` REPLACES — a flow that transcribes
|
|
118
|
+
* AND calls a model cannot install two, which is exactly what `otherwise` is
|
|
119
|
+
* for. BOTH halves are the SDK's own fakes rather than this file's hand-typed
|
|
120
|
+
* wire, and it is the same argument twice: each routes off the SDK's own
|
|
121
|
+
* endpoint constant, so a case cannot pass because the fake and the step agree
|
|
122
|
+
* on a typo. The predicate here used to be `url.includes("llm-gateway")` — a
|
|
123
|
+
* HOST, which the default gateway happens to carry and a `gatewayUrl` pointed
|
|
124
|
+
* anywhere else does not, so the fake would have gone on answering the
|
|
125
|
+
* transcription 404 to a model call it no longer recognised.
|
|
126
|
+
*
|
|
127
|
+
* The reader also hands back DECODED calls, which is why the case below asks
|
|
128
|
+
* `model.calls[0].prompt` what the model was SHOWN: off a raw request body that
|
|
129
|
+
* is the whole serialized request, `model` and `reasoning_effort` included.
|
|
130
|
+
*/
|
|
131
|
+
function scriptProvider(options: { text?: string; pendingPolls?: number } = {}) {
|
|
132
|
+
const model = stubGatewayRoute(JSON.stringify(REPLY));
|
|
133
|
+
const provider = installStubTranscribe({
|
|
134
|
+
text: options.text ?? TRANSCRIPT,
|
|
135
|
+
durationSec: 42,
|
|
136
|
+
// Passed straight through rather than conditionally spread: the option
|
|
137
|
+
// already admits `undefined`, and `guard-invariants` rule 2 counts the
|
|
138
|
+
// spread.
|
|
139
|
+
pendingPolls: options.pendingPolls,
|
|
140
|
+
otherwise: (request) => model.route(request),
|
|
141
|
+
});
|
|
142
|
+
return { provider, model };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
describeWorkflowEval(
|
|
146
|
+
agentDef,
|
|
147
|
+
(test) => {
|
|
148
|
+
test("the run's output NAMES a file that one step spoke and stored", async ({ app }) => {
|
|
149
|
+
// Scripted in both modes: the claim is that the id in the output is the id
|
|
150
|
+
// of the file in the store, and no provider can be asked to make that true.
|
|
151
|
+
// This is the case that catches speak-and-store coming apart — a run that
|
|
152
|
+
// returned bytes, or an id nothing wrote, or two ids because the synthesis
|
|
153
|
+
// and the store became two steps.
|
|
154
|
+
const uploads = publish(new Uint8Array(64), "standup.wav", "audio/wav");
|
|
155
|
+
const { provider } = scriptProvider();
|
|
156
|
+
const speech = installStubSpeech({ pcmBytes: 96_000 });
|
|
157
|
+
|
|
158
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID });
|
|
159
|
+
|
|
160
|
+
// The error FIRST, so a failed run names its own reason instead of
|
|
161
|
+
// reporting "expected 'failed' to be 'completed'".
|
|
162
|
+
expect(run.error).toBeUndefined();
|
|
163
|
+
expect(run.status).toBe("completed");
|
|
164
|
+
const output = run.output;
|
|
165
|
+
assert(output !== undefined, "a completed run must carry an output");
|
|
166
|
+
|
|
167
|
+
// EXACTLY one write. Two would mean the synthesis and the store had come
|
|
168
|
+
// apart into two steps, which is the mistake this template exists to argue
|
|
169
|
+
// against — a step is journaled by its return value, so an id replays and
|
|
170
|
+
// bytes do not.
|
|
171
|
+
expect(uploads.writes).toHaveLength(1);
|
|
172
|
+
const written = uploads.writes[0];
|
|
173
|
+
assert(written !== undefined, "the speaking step must have stored a file");
|
|
174
|
+
// The output carries the ID of that write, and an id is a string — not the
|
|
175
|
+
// audio. A run's output is read back as JSON.
|
|
176
|
+
expect(output.audio).toBe(written.id);
|
|
177
|
+
expect(typeof output.audio).toBe("string");
|
|
178
|
+
|
|
179
|
+
// And the bytes are really there, and are really a WAV: named and typed for
|
|
180
|
+
// a browser, because the byte route serves what it was given and nothing
|
|
181
|
+
// plays a file handed to it as octet-stream.
|
|
182
|
+
expect(written.name).toBe("summary.wav");
|
|
183
|
+
expect(written.type).toBe("audio/wav");
|
|
184
|
+
expect(written.bytes.byteLength).toBe(44 + 96_000);
|
|
185
|
+
expect(String.fromCharCode(...written.bytes.subarray(0, 4))).toBe("RIFF");
|
|
186
|
+
expect(String.fromCharCode(...written.bytes.subarray(8, 12))).toBe("WAVE");
|
|
187
|
+
// 96,000 bytes at 24 kHz mono 16-bit is two seconds, which is what the
|
|
188
|
+
// page prints next to the player.
|
|
189
|
+
expect(output.audioDurationMs).toBe(2000);
|
|
190
|
+
|
|
191
|
+
// The rest of the round trip, so a run that stored audio for the wrong text
|
|
192
|
+
// is not mistaken for a working one.
|
|
193
|
+
expect(output.source).toBe("standup.wav");
|
|
194
|
+
expect(output.durationMs).toBe(42_000);
|
|
195
|
+
expect(output.transcript).toBe(TRANSCRIPT);
|
|
196
|
+
expect(output.points).toHaveLength(3);
|
|
197
|
+
expect(speech.calls).toHaveLength(1);
|
|
198
|
+
|
|
199
|
+
// Four legs, four narrated lines, in order — which is what a page watching
|
|
200
|
+
// the run renders.
|
|
201
|
+
expect(run.reported[0]).toMatch(/^Uploading standup\.wav /);
|
|
202
|
+
expect(run.reported).toContain("Summarizing the transcript.");
|
|
203
|
+
expect(run.reported.at(-1)).toMatch(/^Recorded a 2s summary in \w+'s voice\.$/);
|
|
204
|
+
// The job finished on its first poll, so no durable wait was asked for.
|
|
205
|
+
expect(run.slept).toEqual([]);
|
|
206
|
+
// One upload of the recording, and one submit — the split that exists so a
|
|
207
|
+
// fault in the submit does not re-upload the file.
|
|
208
|
+
expect(provider.calls.filter((call) => call.leg === "upload")).toHaveLength(1);
|
|
209
|
+
expect(provider.calls.filter((call) => call.leg === "submit")).toHaveLength(1);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test("the voice reads the SCRIPT the model was asked for, not the points", async ({ app }) => {
|
|
213
|
+
// Scripted in both modes: what a live voice says is not evidence about
|
|
214
|
+
// which string it was handed. This is the case that catches the template's
|
|
215
|
+
// central prompt decision regressing — synthesize the bullet list and you
|
|
216
|
+
// get a voice reading "one. two. three." with no connective tissue.
|
|
217
|
+
publish(new Uint8Array(64), "standup.wav", "audio/wav");
|
|
218
|
+
const { model } = scriptProvider();
|
|
219
|
+
const speech = installStubSpeech();
|
|
220
|
+
|
|
221
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID, voice: "michael" });
|
|
222
|
+
|
|
223
|
+
expect(run.error).toBeUndefined();
|
|
224
|
+
const spokenText = speech.calls[0]?.text;
|
|
225
|
+
expect(spokenText).toBe(REPLY.spoken);
|
|
226
|
+
// The script and the points share no wording, so this is the assertion:
|
|
227
|
+
// whatever was spoken, it was not the list.
|
|
228
|
+
for (const point of REPLY.points) expect(spokenText).not.toContain(point);
|
|
229
|
+
// The form's choice really reaches the synthesizer.
|
|
230
|
+
expect(speech.calls[0]?.voice).toBe("michael");
|
|
231
|
+
// Both shapes survive to the output — one to read, one that was heard.
|
|
232
|
+
expect(run.output?.points).toEqual(REPLY.points);
|
|
233
|
+
expect(run.output?.spoken).toBe(REPLY.spoken);
|
|
234
|
+
|
|
235
|
+
// And the model was ASKED for both, over the transcript it was given. A
|
|
236
|
+
// prompt that stopped asking for a script is how the field goes missing.
|
|
237
|
+
const asked = model.calls[0];
|
|
238
|
+
assert(asked !== undefined, "the run must have asked the model for a summary");
|
|
239
|
+
expect(asked.prompt).toContain("READ ALOUD");
|
|
240
|
+
expect(asked.prompt).toContain("The launch is on for Tuesday the fourth");
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
test("a recording with no speech stops before the model and the voice", async ({ app }) => {
|
|
244
|
+
// Scripted in both modes, and it costs nothing live either way: silence
|
|
245
|
+
// transcribes SUCCESSFULLY to nothing, so without a terminal failure here
|
|
246
|
+
// the run would go on to summarize no words and store half a second of
|
|
247
|
+
// audio — a green run with an empty product.
|
|
248
|
+
const uploads = publish(new Uint8Array(64), "silence.wav", "audio/wav");
|
|
249
|
+
const { model } = scriptProvider({ text: " " });
|
|
250
|
+
const speech = installStubSpeech();
|
|
251
|
+
|
|
252
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID });
|
|
253
|
+
|
|
254
|
+
expect(run.status).toBe("failed");
|
|
255
|
+
expect(run.error).toMatch(/no speech in that recording/i);
|
|
256
|
+
expect(run.output).toBeUndefined();
|
|
257
|
+
// Nothing was summarized and nothing was spoken, which is the half that
|
|
258
|
+
// makes this more than an error-message assertion.
|
|
259
|
+
expect(model.calls).toEqual([]);
|
|
260
|
+
expect(speech.calls).toEqual([]);
|
|
261
|
+
expect(uploads.writes).toEqual([]);
|
|
262
|
+
expect(run.reported).not.toContain("Summarizing the transcript.");
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
test("an unfinished job is waited out with a DURABLE sleep, not a busy loop", async ({
|
|
266
|
+
app,
|
|
267
|
+
}) => {
|
|
268
|
+
// Scripted in both modes: a live job cannot be asked to stay queued for
|
|
269
|
+
// exactly two polls, and this is the one place the poll loop's shape is
|
|
270
|
+
// visible — one submit, one poll per round, and a recorded wait between
|
|
271
|
+
// them. A loop that re-submitted, or one that spun with no wait, both
|
|
272
|
+
// produce a correct transcript and a wrong bill.
|
|
273
|
+
publish(new Uint8Array(64), "standup.wav", "audio/wav");
|
|
274
|
+
const { provider } = scriptProvider({ pendingPolls: 2 });
|
|
275
|
+
installStubSpeech();
|
|
276
|
+
|
|
277
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID });
|
|
278
|
+
|
|
279
|
+
expect(run.error).toBeUndefined();
|
|
280
|
+
expect(run.output?.transcript).toBe(TRANSCRIPT);
|
|
281
|
+
// Two waits for three polls: asked for and — this being an eval rather
|
|
282
|
+
// than a deployment — recorded rather than taken.
|
|
283
|
+
expect(run.slept).toEqual([
|
|
284
|
+
{ label: "poll", duration: POLL_INTERVAL_MS },
|
|
285
|
+
{ label: "poll", duration: POLL_INTERVAL_MS },
|
|
286
|
+
]);
|
|
287
|
+
expect(provider.calls.filter((call) => call.leg === "poll")).toHaveLength(3);
|
|
288
|
+
// The expensive half happened ONCE, which is the whole reason the upload
|
|
289
|
+
// and the submit are separate steps.
|
|
290
|
+
expect(provider.calls.filter((call) => call.leg === "upload")).toHaveLength(1);
|
|
291
|
+
expect(provider.calls.filter((call) => call.leg === "submit")).toHaveLength(1);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
test(
|
|
295
|
+
"really transcribes and summarizes a real recording",
|
|
296
|
+
async ({ app }) => {
|
|
297
|
+
// LIVE ONLY, and the one case here that measures rather than checks
|
|
298
|
+
// wiring. Three things have to be real for it to pass: the file has to
|
|
299
|
+
// stream to the provider, the transcript has to be of THAT recording, and
|
|
300
|
+
// the model has to write a script from that transcript.
|
|
301
|
+
//
|
|
302
|
+
// The VOICE is faked even here, and that is a harness limit rather than a
|
|
303
|
+
// choice — `stepSpeak` reads a published synthesizer, the eval engine
|
|
304
|
+
// publishes none, and no real one is exported to pass it. So what this
|
|
305
|
+
// case does NOT claim is that the audio is audible; the round trip's
|
|
306
|
+
// structure (one write, an id in the output, real WAV framing) is what
|
|
307
|
+
// the first case pins, in memory, where it is a fact rather than a hope.
|
|
308
|
+
const speech = installStubSpeech({ pcmBytes: 48_000 });
|
|
309
|
+
const response = await fetch(LIVE_RECORDING);
|
|
310
|
+
expect(response.ok).toBe(true);
|
|
311
|
+
const mp3 = new Uint8Array(await response.arrayBuffer());
|
|
312
|
+
const uploads = publish(mp3, "wildfires.mp3", "audio/mpeg");
|
|
313
|
+
|
|
314
|
+
const run = await app.run(spokenSummary, { recording: UPLOAD_ID });
|
|
315
|
+
|
|
316
|
+
expect(run.error).toBeUndefined();
|
|
317
|
+
expect(run.status).toBe("completed");
|
|
318
|
+
const output = run.output;
|
|
319
|
+
assert(output !== undefined, "a completed run must carry an output");
|
|
320
|
+
|
|
321
|
+
// The transcript is of THIS recording — a news segment about smoke from
|
|
322
|
+
// Canadian wildfires reaching the US east coast.
|
|
323
|
+
expect(output.transcript).toMatch(/wildfire/i);
|
|
324
|
+
expect(output.transcript).toMatch(/canada/i);
|
|
325
|
+
expect(output.words).toBeGreaterThan(400);
|
|
326
|
+
// The FILENAME a reader sees is the one they uploaded, not the opaque id.
|
|
327
|
+
expect(output.source).toBe("wildfires.mp3");
|
|
328
|
+
expect(output.durationMs).toBeGreaterThan(250_000);
|
|
329
|
+
|
|
330
|
+
// The summary is of the transcript, not of summarizing in general.
|
|
331
|
+
const written = `${output.headline} ${output.points.join(" ")} ${output.spoken}`;
|
|
332
|
+
expect(written).toMatch(/smoke|wildfire|air/i);
|
|
333
|
+
expect(output.points.length).toBeGreaterThan(0);
|
|
334
|
+
expect(output.points.length).toBeLessThanOrEqual(4);
|
|
335
|
+
// A SCRIPT rather than a list: sentences, no bullet markers, and long
|
|
336
|
+
// enough that a voice reading it has something to say. This is the
|
|
337
|
+
// template's central prompt decision, measured against a real model.
|
|
338
|
+
expect(output.spoken).toMatch(/[.!?]/);
|
|
339
|
+
expect(output.spoken).not.toMatch(/^\s*[-*\u2022]/m);
|
|
340
|
+
expect(output.spoken.length).toBeGreaterThan(80);
|
|
341
|
+
// And it is the SCRIPT that was spoken, not the points a page renders.
|
|
342
|
+
expect(speech.calls[0]?.text).toBe(output.spoken);
|
|
343
|
+
|
|
344
|
+
// The store really holds what the output names.
|
|
345
|
+
expect(uploads.writes).toHaveLength(1);
|
|
346
|
+
const stored = uploads.read(output.audio);
|
|
347
|
+
assert(stored !== undefined, "the run's `audio` id must name a stored file");
|
|
348
|
+
expect(String.fromCharCode(...stored.bytes.subarray(0, 4))).toBe("RIFF");
|
|
349
|
+
},
|
|
350
|
+
{ live: true },
|
|
351
|
+
);
|
|
352
|
+
},
|
|
353
|
+
{ stepFetch: liveStepFetch },
|
|
354
|
+
);
|