@alexkroman1/aai-cli 16.0.1 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/{_build-target-55dJisQ-.mjs → _build-target-C08aM-Es.mjs} +511 -41
- package/dist/_build-target.d.ts +109 -2
- package/dist/_deno-target.d.ts +15 -14
- package/dist/_dev-env.d.ts +19 -13
- package/dist/{_dev-server-BzWB6-4y.mjs → _dev-server-CLU9xjH5.mjs} +27 -19
- package/dist/_dev-server.d.ts +4 -3
- package/dist/_dev-vite-config.d.ts +1 -1
- package/dist/_init.d.ts +39 -0
- package/dist/_modal-target.d.ts +11 -6
- package/dist/_preflight-CnW9QiE7.mjs +116 -0
- package/dist/_preflight.d.ts +110 -5
- package/dist/{_server-common-De0haHr9.mjs → _server-common-DAcv1nC5.mjs} +46 -2
- package/dist/_server-common.d.ts +39 -0
- package/dist/_target-bundle.d.ts +112 -0
- package/dist/_target-entry.d.ts +81 -0
- package/dist/{_templates-CuP74F8D.mjs → _templates-IMeKMVIj.mjs} +1 -1
- package/dist/{_vitest-runner-AVR9VtXh.mjs → _vitest-runner-CZNGj0ZC.mjs} +22 -17
- package/dist/_vitest-runner.d.ts +36 -24
- package/dist/{_workflow-determinism-CvpqMpdh.mjs → _workflow-determinism-CLxFQ5ox.mjs} +1 -1
- package/dist/_workflow-determinism.d.ts +1 -1
- package/dist/{build-ButI2IKc.mjs → build-DrQTSc2R.mjs} +187 -289
- package/dist/build.d.ts +88 -2
- package/dist/cli.mjs +20 -16
- package/dist/{deploy-CGqPU5U-.mjs → deploy-B68-x7xM.mjs} +14 -6
- package/dist/deploy.d.ts +9 -0
- package/dist/{dev-kodAY23K.mjs → dev-ChsrNHpK.mjs} +1 -1
- package/dist/dev.d.ts +1 -1
- package/dist/{eval-DvoSz7SZ.mjs → eval-DB07kTxO.mjs} +2 -2
- package/dist/init-W-4k-lCF.mjs +559 -0
- package/dist/init.d.ts +43 -3
- package/dist/scaffold/CLAUDE.md +87 -100
- package/dist/scaffold/package.json +6 -6
- package/dist/scaffold/vite.config.ts +29 -1
- package/dist/start.mjs +1 -1
- package/dist/{studio-CtRBVVFR.mjs → studio-DEAJGBXa.mjs} +20 -10
- package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.eval.test.ts +20 -6
- package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.ts +28 -0
- package/dist/templates/{hiring-desk → applicant-screening-agent}/crews.ts +1 -1
- package/dist/templates/{hiring-desk → applicant-screening-agent}/shared.ts +11 -11
- package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screening_status.ts +1 -1
- package/dist/templates/{call-audit → call-audit-workflow}/agent.ts +4 -2
- package/dist/templates/{call-audit → call-audit-workflow}/client.tsx +3 -3
- package/dist/templates/{call-audit → call-audit-workflow}/guards.test.ts +2 -2
- package/dist/templates/{call-audit → call-audit-workflow}/workflows/summarize.ts +1 -1
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.eval.test.ts +3 -2
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.test.ts +1 -1
- package/dist/templates/{code-interpreter → code-interpreter-agent}/agent.ts +1 -0
- package/dist/templates/coding-agent/agent.eval.test.ts +136 -0
- package/dist/templates/coding-agent/agent.test.ts +109 -0
- package/dist/templates/coding-agent/agent.ts +45 -0
- package/dist/templates/coding-agent/chat.ts +63 -0
- package/dist/templates/coding-agent/shared.ts +46 -0
- package/dist/templates/coding-agent/system-prompt.md +32 -0
- package/dist/templates/coding-agent/tools/bash.ts +6 -0
- package/dist/templates/coding-agent/tools/delete_file.ts +6 -0
- package/dist/templates/coding-agent/tools/edit_file.ts +6 -0
- package/dist/templates/coding-agent/tools/glob.ts +6 -0
- package/dist/templates/coding-agent/tools/grep.ts +6 -0
- package/dist/templates/coding-agent/tools/list_files.ts +6 -0
- package/dist/templates/coding-agent/tools/read_file.ts +6 -0
- package/dist/templates/coding-agent/tools/todo_write.ts +6 -0
- package/dist/templates/coding-agent/tools/write_file.ts +6 -0
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.test.ts +2 -2
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.ts +2 -1
- package/dist/templates/{pipeline-simple → custom-pipeline-agent}/modes.test.ts +1 -1
- package/dist/templates/{redline → document-redline-workflow}/agent.ts +4 -2
- package/dist/templates/{redline → document-redline-workflow}/client.tsx +1 -1
- package/dist/templates/{redline → document-redline-workflow}/workflows/redline.ts +1 -1
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.test.ts +104 -1
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.ts +15 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/events.ts +1 -1
- package/dist/templates/emergency-dispatch-agent/guardrails.ts +105 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/system-prompt.md +1 -0
- package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_create.ts +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.eval.test.ts +8 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.test.ts +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/agent.ts +1 -0
- package/dist/templates/{night-owl → entertainment-picks-agent}/client.tsx +1 -1
- package/dist/templates/{night-owl → entertainment-picks-agent}/system-prompt.md +6 -0
- package/dist/templates/{night-owl → entertainment-picks-agent}/tools/revisit.ts +7 -0
- package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.eval.test.ts +84 -23
- package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.ts +1 -0
- package/dist/templates/{executive-assistant → executive-inbox-agent}/meeting.ts +2 -2
- package/dist/templates/{executive-assistant → executive-inbox-agent}/prompts.ts +3 -1
- package/dist/templates/{executive-assistant → executive-inbox-agent}/shared.ts +2 -2
- package/dist/templates/{executive-assistant → executive-inbox-agent}/system-prompt.md +3 -3
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/meeting_assistant.ts +3 -3
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/open_email.ts +8 -16
- package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/send_calendar_invite.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.eval.test.ts +85 -21
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.test.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/agent.ts +6 -3
- package/dist/templates/{hotel-desk → hotel-reception-agent}/client.tsx +14 -2
- package/dist/templates/{hotel-desk → hotel-reception-agent}/concierge.ts +3 -2
- package/dist/templates/{hotel-desk → hotel-reception-agent}/desk-seams.test.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/disputes.ts +9 -11
- package/dist/templates/{hotel-desk → hotel-reception-agent}/events.ts +2 -1
- package/dist/templates/hotel-reception-agent/session.ts +56 -0
- package/dist/templates/{hotel-desk → hotel-reception-agent}/shared.ts +21 -22
- package/dist/templates/{hotel-desk → hotel-reception-agent}/system-prompt.md +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/abandon_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/add_to_waitlist.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_airport_car.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_restaurant_reservation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_room_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_restaurant_availability.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_room_availability.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/choose_room.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/confirm_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispatch_emergency.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/dispute_charge.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/flag_late_arrival.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_guest_history.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_invoice.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_restaurant_reservation.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/modify_restaurant_reservation.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_card.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_followup.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_group_inquiry.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/record_guest_details.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reinstate_booking.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/request_flight_reconfirmation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resend_confirmation.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/reserve_table.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/resolve_room_conflict.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/schedule_wakeup_call.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_do_not_disturb.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_extras.ts +1 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/set_stay.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_booking_modification.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_room_booking.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/take_guest_message.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/transfer_call.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/update_card.ts +2 -1
- package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/verify_booking.ts +2 -1
- package/dist/templates/{link-digest → link-digest-workflow}/agent.eval.test.ts +16 -1
- package/dist/templates/{link-digest → link-digest-workflow}/agent.test.ts +2 -2
- package/dist/templates/{link-digest → link-digest-workflow}/agent.ts +8 -3
- package/dist/templates/{link-digest → link-digest-workflow}/client.tsx +2 -2
- package/dist/templates/{link-digest → link-digest-workflow}/workflows/digest.ts +1 -1
- package/dist/templates/{health-assistant → medication-safety-agent}/agent.test.ts +55 -1
- package/dist/templates/medication-safety-agent/agent.ts +62 -0
- package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.test.ts +4 -4
- package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.ts +5 -1
- package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/recap.ts +3 -3
- package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.ts +3 -0
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.eval.test.ts +1 -1
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.test.ts +1 -1
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/agent.ts +6 -2
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/client.tsx +3 -3
- package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/digest.ts +1 -1
- package/dist/templates/{simple → quickstart-agent}/agent.eval.test.ts +39 -3
- package/dist/templates/{simple → quickstart-agent}/agent.test.ts +25 -3
- package/dist/templates/quickstart-agent/agent.ts +24 -0
- package/dist/templates/quickstart-agent/system-prompt.md +8 -0
- package/dist/templates/quickstart-agent/tools/get_weather.ts +59 -0
- package/dist/templates/{research-workflow → research-handoff-agent}/agent.test.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/agent.ts +5 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/filing.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/research.ts +1 -1
- package/dist/templates/{research-workflow → research-handoff-agent}/workflows/review.ts +1 -1
- package/dist/templates/{plan-and-execute → research-planner-agent}/agent.eval.test.ts +24 -2
- package/dist/templates/{plan-and-execute → research-planner-agent}/agent.ts +3 -0
- package/dist/templates/{plan-and-execute → research-planner-agent}/shared.ts +1 -1
- package/dist/templates/{plan-and-execute → research-planner-agent}/system-prompt.md +1 -1
- package/dist/templates/{retail → retail-orders-agent}/agent.ts +32 -3
- package/dist/templates/retail-orders-agent/keyterms.ts +154 -0
- package/dist/templates/{retail → retail-orders-agent}/pending.ts +2 -2
- package/dist/templates/{retail → retail-orders-agent}/resolve.ts +18 -3
- package/dist/templates/{retail → retail-orders-agent}/shared.ts +1 -1
- package/dist/templates/{retail → retail-orders-agent}/store.ts +3 -3
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.eval.test.ts +37 -5
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.test.ts +38 -6
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/agent.ts +5 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/call.ts +1 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/shared.ts +15 -3
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/acknowledge_disclosure.ts +14 -0
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/dispatch_truck.ts +1 -1
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/lookup_coverage.ts +11 -0
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/service_disclosure.ts +17 -11
- package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.test.ts +4 -0
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.test.ts +1 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.ts +5 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/client.tsx +1 -1
- package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/summarize.ts +1 -1
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.eval.test.ts +6 -0
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/agent.test.ts +125 -1
- package/dist/templates/tabletop-rpg-agent/agent.ts +58 -0
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/shared.ts +84 -3
- package/dist/templates/{solo-rpg → tabletop-rpg-agent}/system-prompt.md +1 -1
- package/dist/templates/tabletop-rpg-agent/tools/check_state.ts +37 -0
- package/dist/templates/{support-line → technical-support-agent}/agent.test.ts +3 -3
- package/dist/templates/{support-line → technical-support-agent}/agent.ts +5 -1
- package/dist/templates/technical-support-agent/knowledge.ts +165 -0
- package/dist/templates/{support-line → technical-support-agent}/nodes.ts +3 -2
- package/dist/templates/{support-line → technical-support-agent}/procedure.ts +4 -3
- package/dist/templates/technical-support-agent/shared.ts +145 -0
- package/dist/templates/{support-line → technical-support-agent}/tools/list_topics.ts +2 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.eval.test.ts +39 -6
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.test.ts +79 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/agent.ts +30 -1
- package/dist/templates/{infocom-adventure → text-adventure-agent}/client.tsx +2 -2
- package/dist/templates/{infocom-adventure → text-adventure-agent}/shared.ts +37 -0
- package/dist/templates/{infocom-adventure → text-adventure-agent}/system-prompt.md +9 -2
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.eval.test.ts +21 -7
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.test.ts +23 -11
- package/dist/templates/{briefing-desk → topic-briefing-agent}/agent.ts +5 -2
- package/dist/templates/{briefing-desk → topic-briefing-agent}/shared.ts +11 -11
- package/dist/templates/{briefing-desk → topic-briefing-agent}/slack.ts +1 -1
- package/dist/templates/{briefing-desk → topic-briefing-agent}/system-prompt.md +13 -8
- package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/send_briefing.ts +43 -5
- package/dist/templates/transcription-workflow/agent.test.ts +1 -1
- package/dist/templates/transcription-workflow/agent.ts +4 -1
- package/dist/templates/transcription-workflow/client.tsx +1 -1
- package/dist/templates/transcription-workflow/workflows/batch.ts +2 -2
- package/dist/templates/transcription-workflow/workflows/transcribe.ts +1 -1
- package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.ts +4 -0
- package/dist/templates/{travel-concierge → travel-concierge-agent}/shared.ts +1 -1
- package/dist/templates/{web-researcher → web-research-agent}/agent.eval.test.ts +32 -6
- package/dist/templates/{web-researcher → web-research-agent}/agent.test.ts +17 -1
- package/dist/templates/{web-researcher → web-research-agent}/agent.ts +31 -1
- package/dist/templates/{web-researcher → web-research-agent}/system-prompt.md +8 -2
- package/dist/templates/{word-wrangler → word-game-agent}/agent.eval.test.ts +79 -18
- package/dist/templates/{word-wrangler → word-game-agent}/agent.ts +20 -0
- package/dist/templates/{word-wrangler → word-game-agent}/game.ts +1 -1
- package/dist/templates/{word-wrangler → word-game-agent}/shared.ts +1 -1
- package/dist/test-CjKPQ9_B.mjs +102 -0
- package/dist/test.d.ts +37 -12
- package/package.json +5 -5
- package/dist/_init-BzQbV8Zh.mjs +0 -199
- package/dist/_preflight-CcAR577V.mjs +0 -46
- package/dist/init-D363Ls5u.mjs +0 -183
- package/dist/templates/health-assistant/agent.ts +0 -15
- package/dist/templates/simple/agent.ts +0 -8
- package/dist/templates/solo-rpg/agent.ts +0 -29
- package/dist/templates/solo-rpg/tools/check_state.ts +0 -28
- package/dist/templates/support-line/shared.ts +0 -281
- package/dist/test-Cllnx81G.mjs +0 -83
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/agent.test.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/client.tsx +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/leads.json +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.test.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/screening-lock.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/system-prompt.md +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/candidate_details.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/proceed_to_emails.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/read_email.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/rescore_with_feedback.ts +0 -0
- /package/dist/templates/{hiring-desk → applicant-screening-agent}/tools/screen_candidates.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/agent.test.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/audit.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/ingest.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/media.ts +0 -0
- /package/dist/templates/{call-audit → call-audit-workflow}/workflows/sync-api.ts +0 -0
- /package/dist/templates/{code-interpreter → code-interpreter-agent}/system-prompt.md +0 -0
- /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{pipeline-simple → custom-pipeline-agent}/stages.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/agent.test.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/form.ts +0 -0
- /package/dist/templates/{redline → document-redline-workflow}/workflows/prompts.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/client.tsx +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/shared.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_add_note.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_escalate.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_get.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_triage.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/incident_update_status.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_dashboard.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_protocols.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/ops_run_scenario.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_dispatch.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_get_available.ts +0 -0
- /package/dist/templates/{dispatch-center → emergency-dispatch-agent}/tools/resources_update_status.ts +0 -0
- /package/dist/templates/{night-owl → entertainment-picks-agent}/shared.ts +0 -0
- /package/dist/templates/{night-owl → entertainment-picks-agent}/tools/recommend.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/agent.test.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/calendar.test.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/client.tsx +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/inbox.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/nodes.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/review.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/accept.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ask_question.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/draft_reply.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/edit.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/ignore.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/inbox_status.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/new_email.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/respond.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/review_memory.ts +0 -0
- /package/dist/templates/{executive-assistant → executive-inbox-agent}/tools/triage_inbox.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/booking.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/card.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/catalogs.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/desk.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/hotel.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/policies.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/records.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/restaurant.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/seed.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_business_center.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_spa_appointment.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/book_tour.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_policy.ts +0 -0
- /package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/order_flowers.ts +0 -0
- /package/dist/templates/{link-digest → link-digest-workflow}/api-client.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/fda.test.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/fda.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/system-prompt.md +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/tools/check_drug_interaction.ts +0 -0
- /package/dist/templates/{health-assistant → medication-safety-agent}/tools/medication_lookup.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/shared.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/cancel_recap.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/keep_transcript.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_progress.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/recap_status.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/tools/request_recap.ts +0 -0
- /package/dist/templates/{recap-workflow → meeting-recap-agent}/workflows/tokens.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/agent.test.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/client.tsx +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/shared.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/system-prompt.md +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/add_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/place_order.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/remove_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/set_customer_name.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/update_pizza.ts +0 -0
- /package/dist/templates/{pizza-ordering → pizza-ordering-agent}/tools/view_order.ts +0 -0
- /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/feeds.ts +0 -0
- /package/dist/templates/{podcast-digest → podcast-digest-workflow}/workflows/slack.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/shared.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/file_it_now.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/request_research.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_progress.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/tools/research_status.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/notes.ts +0 -0
- /package/dist/templates/{research-workflow → research-handoff-agent}/workflows/prompts.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/agent.test.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/client.tsx +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/procedure.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/prompts.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/plan_status.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/revise_plan.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/start_plan.ts +0 -0
- /package/dist/templates/{plan-and-execute → research-planner-agent}/tools/work_next_step.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/agent.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/authenticate.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/cancel.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/client.tsx +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/payment.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/pending.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/refund.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/registry.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/resolve.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/returns.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/seed.json +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/seed.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/shared.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/store.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/swap.test.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/swap.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/system-prompt.md +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_change.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/cancel_pending_order.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/confirm_change.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/exchange_delivered_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_email.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/find_user_id_by_name_zip.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_item_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_order_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_product_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/get_user_details.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/list_all_product_types.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_pending_order_payment.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/modify_user_address.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/return_delivered_order_items.ts +0 -0
- /package/dist/templates/{retail → retail-orders-agent}/tools/transfer_to_human_agents.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/events.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/system-prompt.md +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/job_status.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/tools/report_location.ts +0 -0
- /package/dist/templates/{roadside-assist → roadside-assistance-agent}/yard.ts +0 -0
- /package/dist/templates/{spoken-summary → spoken-summary-workflow}/agent.eval.test.ts +0 -0
- /package/dist/templates/{spoken-summary → spoken-summary-workflow}/workflows/transcribe.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/client.tsx +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/action_roll.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/burn_momentum.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/oracle.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/setup_character.ts +0 -0
- /package/dist/templates/{solo-rpg → tabletop-rpg-agent}/tools/update_state.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/client.tsx +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/knowledge.json +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/prompts.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/system-prompt.md +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/tools/answer_question.ts +0 -0
- /package/dist/templates/{support-line → technical-support-agent}/tools/log_ticket.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_drop.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_flag.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_get.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_move.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_restart.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_score.ts +0 -0
- /package/dist/templates/{infocom-adventure → text-adventure-agent}/tools/game_state_take.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/briefing_so_far.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/research_topic.ts +0 -0
- /package/dist/templates/{briefing-desk → topic-briefing-agent}/tools/verify_claim.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.eval.test.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/agent.test.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/call-events.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/client.tsx +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/routing.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/system-prompt.md +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_car_rental.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_excursion.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/book_hotel.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_action.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/cancel_ticket.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/complete_or_escalate.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/confirm_action.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/lookup_booking.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_car_rentals.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_excursions.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_flights.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/search_hotels.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_car_rental_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_excursion_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_flight_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/to_hotel_assistant.ts +0 -0
- /package/dist/templates/{travel-concierge → travel-concierge-agent}/tools/update_ticket.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/agent.test.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/client.tsx +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/guess.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/player.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/system-prompt.md +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/final_score.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/relay_description.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/repeat_word.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/skip_word.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/tools/start_game.ts +0 -0
- /package/dist/templates/{word-wrangler → word-game-agent}/words.ts +0 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* re-arm the two minutes on every sentence and the round would never end. The
|
|
16
16
|
* tools that run during a round (`relay_description`, `skip_word`, `repeat_word`)
|
|
17
17
|
* therefore send NOTHING; they read and write the slot and leave the position
|
|
18
|
-
* alone. That is the opposite of `roadside-
|
|
18
|
+
* alone. That is the opposite of `roadside-assistance-agent`'s silence ladder, and the
|
|
19
19
|
* same rule read the other way.
|
|
20
20
|
*
|
|
21
21
|
* **Time's up is announced a turn late, and that is a property of deadlines.** A
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* disconnect-and-reconnect of the player on every new word so it never carries
|
|
16
16
|
* a previous word's context.
|
|
17
17
|
*
|
|
18
|
-
* | word-
|
|
18
|
+
* | word-game-agent phone game | here |
|
|
19
19
|
* | --- | --- |
|
|
20
20
|
* | the host `GeminiLiveLLMService` (text modality) | the voice agent — its model and its TTS |
|
|
21
21
|
* | the player `ResettablePlayerLLM` (its own Gemini Live session) | `askPlayer` in `player.ts`: one `ctx.generate` per description, on the player's own system prompt |
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as ok, n as fail } from "./_output-DBP9Op_d.mjs";
|
|
3
|
+
import { n as log } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
+
import { l as formatCappedList } from "./_utils-D5JGcjiW.mjs";
|
|
5
|
+
import { i as unrunSpecFiles, n as classifyVitestError, r as runVitest, t as WIDEN_HINT } from "./_vitest-runner-CZNGj0ZC.mjs";
|
|
6
|
+
//#region src/test.ts
|
|
7
|
+
/**
|
|
8
|
+
* `aai test` — run agent tests via vitest.
|
|
9
|
+
*
|
|
10
|
+
* The launcher is `_vitest-runner.ts`, shared with `aai eval` and `aai build`'s
|
|
11
|
+
* pre-build gate. What is here is the COMMAND: which files the test tier runs,
|
|
12
|
+
* and the verdict over the ones a run did not cover.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The files a NARROWED `aai test` runs, in preference order.
|
|
16
|
+
*
|
|
17
|
+
* The tier's filenames belong to the command, not to the runner — `aai eval`
|
|
18
|
+
* declares `EVAL_FILES` the same way one module over, and neither names the
|
|
19
|
+
* other's. `aai build` imports this one because its pre-build gate runs the
|
|
20
|
+
* TEST tier.
|
|
21
|
+
*
|
|
22
|
+
* They are no longer what a BARE `aai test` runs — see {@link executeTest} for
|
|
23
|
+
* why the default is the whole project — so this list is now reached only by
|
|
24
|
+
* `--only`.
|
|
25
|
+
*/
|
|
26
|
+
const TEST_FILES = ["agent.test.ts", "agent.test.js"];
|
|
27
|
+
/**
|
|
28
|
+
* Execute agent tests and return structured result.
|
|
29
|
+
*
|
|
30
|
+
* **The default is the whole project, and it used to be one file.**
|
|
31
|
+
* `aai test` ran `agent.test.ts` alone and then FAILED (`incomplete_run`) over
|
|
32
|
+
* every other spec it had skipped — so on any project with a second spec file
|
|
33
|
+
* the default invocation could never be green, and the scaffold routed around
|
|
34
|
+
* the command it was supposed to wire into CI (`"test": "vitest run --exclude
|
|
35
|
+
* …"`, with `aai test` demoted to `test:agent`). Nine shipped templates carry
|
|
36
|
+
* two or more non-eval specs, so that was the normal case rather than the edge:
|
|
37
|
+
* the command's own remedy was "do not run this command".
|
|
38
|
+
*
|
|
39
|
+
* The narrow default was defensible when it was written — running a project's
|
|
40
|
+
* other specs could reach ones that are slow or want credentials — but the
|
|
41
|
+
* verdict is what made it unusable, and `aai build`'s pre-build gate had
|
|
42
|
+
* already gone the other way (`all: true`) for the same reason a build is run
|
|
43
|
+
* deliberately. So the widening is the default here too and `--only` is the
|
|
44
|
+
* inner loop, which leaves the two halves of the original defect closed: a
|
|
45
|
+
* complete run is a green run, and a narrowed one is honest about what it
|
|
46
|
+
* skipped instead of failing over it.
|
|
47
|
+
*
|
|
48
|
+
* **An incomplete run is still not a pass.** For as long as this command
|
|
49
|
+
* answered `{"ok":true,"data":{"passed":true}}` with exit 0 over specs it had
|
|
50
|
+
* not run, adding one tool could break `registry.test.ts` in 17 assertions with
|
|
51
|
+
* `pnpm test` and `pnpm build` both staying green throughout. What carries that
|
|
52
|
+
* now is the RESULT (`unrun`, `complete: false`) plus the runner's own warning,
|
|
53
|
+
* because the reader of a deliberate `--only` asked for the narrowing.
|
|
54
|
+
*/
|
|
55
|
+
async function executeTest(cwd, opts = {}) {
|
|
56
|
+
const narrowed = opts.only === true;
|
|
57
|
+
log.step(narrowed ? "Running agent tests" : "Running project tests");
|
|
58
|
+
try {
|
|
59
|
+
const ran = runVitest(cwd, {
|
|
60
|
+
candidates: TEST_FILES,
|
|
61
|
+
all: !narrowed
|
|
62
|
+
});
|
|
63
|
+
const unrun = unrunSpecFiles(cwd, ran);
|
|
64
|
+
if (ran === false) {
|
|
65
|
+
if (unrun.length > 0) return noNarrowTarget(unrun);
|
|
66
|
+
log.info("No test file found. Create agent.test.ts to add tests.");
|
|
67
|
+
return ok({
|
|
68
|
+
passed: true,
|
|
69
|
+
skipped: true,
|
|
70
|
+
ran: [],
|
|
71
|
+
unrun: [],
|
|
72
|
+
complete: true
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
log.success(`Tests passed (${ran.length} spec file(s))`);
|
|
76
|
+
return ok({
|
|
77
|
+
passed: true,
|
|
78
|
+
ran,
|
|
79
|
+
unrun,
|
|
80
|
+
complete: unrun.length === 0
|
|
81
|
+
});
|
|
82
|
+
} catch (err) {
|
|
83
|
+
const { code, message } = classifyVitestError(err);
|
|
84
|
+
return fail(code, message);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The verdict for `--only` in a project with no `agent.test.ts`.
|
|
89
|
+
*
|
|
90
|
+
* This is the arm that had misled longest, and it is the one place the
|
|
91
|
+
* `incomplete_run` failure is still right: `aai test` printed "No test file
|
|
92
|
+
* found" while the project's specs sat right there unrun, which reads as "this
|
|
93
|
+
* project has no tests". Measured on a project whose only spec was
|
|
94
|
+
* `tools/echo_back.test.ts` — `{"passed":true,"skipped":true}`, exit 0, and not
|
|
95
|
+
* a word about it. Bare `aai test` runs those specs now; `--only` asked for a
|
|
96
|
+
* file that is not there, and the honest answer is neither a pass nor silence.
|
|
97
|
+
*/
|
|
98
|
+
function noNarrowTarget(unrun) {
|
|
99
|
+
return fail("incomplete_run", `\`aai test --only\` found no ${TEST_FILES[0]}, so it ran nothing, but ${unrun.length} spec file(s) exist: ${formatCappedList(unrun)}. An unrun spec is not a passing one, so this is not a green result.`, WIDEN_HINT);
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { TEST_FILES, executeTest };
|
package/dist/test.d.ts
CHANGED
|
@@ -25,31 +25,56 @@ type TestData = {
|
|
|
25
25
|
complete: boolean;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
-
* The files `aai test` runs, in preference order.
|
|
28
|
+
* The files a NARROWED `aai test` runs, in preference order.
|
|
29
29
|
*
|
|
30
30
|
* The tier's filenames belong to the command, not to the runner — `aai eval`
|
|
31
31
|
* declares `EVAL_FILES` the same way one module over, and neither names the
|
|
32
32
|
* other's. `aai build` imports this one because its pre-build gate runs the
|
|
33
33
|
* TEST tier.
|
|
34
|
+
*
|
|
35
|
+
* They are no longer what a BARE `aai test` runs — see {@link executeTest} for
|
|
36
|
+
* why the default is the whole project — so this list is now reached only by
|
|
37
|
+
* `--only`.
|
|
34
38
|
*/
|
|
35
39
|
export declare const TEST_FILES: readonly ["agent.test.ts", "agent.test.js"];
|
|
36
40
|
/** What `aai test` was asked to cover. */
|
|
37
41
|
export type TestOptions = {
|
|
38
|
-
/**
|
|
39
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Narrow the run to {@link TEST_FILES} rather than every non-eval spec.
|
|
44
|
+
*
|
|
45
|
+
* The fast inner loop, and the OPT-IN half of the pair: it is what the old
|
|
46
|
+
* default did, minus the false verdict — a narrowed run reports the specs it
|
|
47
|
+
* skipped through `warnUnrunSpecs` and says `complete: false`.
|
|
48
|
+
*/
|
|
49
|
+
readonly only?: boolean | undefined;
|
|
40
50
|
};
|
|
41
51
|
/**
|
|
42
52
|
* Execute agent tests and return structured result.
|
|
43
53
|
*
|
|
44
|
-
* **
|
|
45
|
-
* `
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
54
|
+
* **The default is the whole project, and it used to be one file.**
|
|
55
|
+
* `aai test` ran `agent.test.ts` alone and then FAILED (`incomplete_run`) over
|
|
56
|
+
* every other spec it had skipped — so on any project with a second spec file
|
|
57
|
+
* the default invocation could never be green, and the scaffold routed around
|
|
58
|
+
* the command it was supposed to wire into CI (`"test": "vitest run --exclude
|
|
59
|
+
* …"`, with `aai test` demoted to `test:agent`). Nine shipped templates carry
|
|
60
|
+
* two or more non-eval specs, so that was the normal case rather than the edge:
|
|
61
|
+
* the command's own remedy was "do not run this command".
|
|
62
|
+
*
|
|
63
|
+
* The narrow default was defensible when it was written — running a project's
|
|
64
|
+
* other specs could reach ones that are slow or want credentials — but the
|
|
65
|
+
* verdict is what made it unusable, and `aai build`'s pre-build gate had
|
|
66
|
+
* already gone the other way (`all: true`) for the same reason a build is run
|
|
67
|
+
* deliberately. So the widening is the default here too and `--only` is the
|
|
68
|
+
* inner loop, which leaves the two halves of the original defect closed: a
|
|
69
|
+
* complete run is a green run, and a narrowed one is honest about what it
|
|
70
|
+
* skipped instead of failing over it.
|
|
71
|
+
*
|
|
72
|
+
* **An incomplete run is still not a pass.** For as long as this command
|
|
73
|
+
* answered `{"ok":true,"data":{"passed":true}}` with exit 0 over specs it had
|
|
74
|
+
* not run, adding one tool could break `registry.test.ts` in 17 assertions with
|
|
75
|
+
* `pnpm test` and `pnpm build` both staying green throughout. What carries that
|
|
76
|
+
* now is the RESULT (`unrun`, `complete: false`) plus the runner's own warning,
|
|
77
|
+
* because the reader of a deliberate `--only` asked for the narrowing.
|
|
53
78
|
*/
|
|
54
79
|
export declare function executeTest(cwd: string, opts?: TestOptions): Promise<CommandResult<TestData>>;
|
|
55
80
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexkroman1/aai-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"p-timeout": "^7.0.1",
|
|
58
58
|
"vite": "^8.2.2",
|
|
59
59
|
"zod": "^4.5.4",
|
|
60
|
-
"@alexkroman1/aai": "
|
|
61
|
-
"@alexkroman1/aai-
|
|
62
|
-
"@alexkroman1/aai-
|
|
60
|
+
"@alexkroman1/aai": "17.0.0",
|
|
61
|
+
"@alexkroman1/aai-runtime": "17.0.0",
|
|
62
|
+
"@alexkroman1/aai-ui": "17.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"playwright": "^1.62.1",
|
|
66
66
|
"tsdown": "^0.22.14",
|
|
67
67
|
"verdaccio": "^6.10.1",
|
|
68
68
|
"vitest": "^4.1.11",
|
|
69
|
-
"aai-templates": "0.
|
|
69
|
+
"aai-templates": "0.5.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"vitest": "^4.1.10"
|
package/dist/_init-BzQbV8Zh.mjs
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { d as readJson, g as writeJson, i as compareCodeUnits, u as isEexist } from "./_utils-D5JGcjiW.mjs";
|
|
3
|
-
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BzUeqOdj.mjs";
|
|
4
|
-
import { REPO_URL, downloadAndMergeTemplate } from "./_templates-CuP74F8D.mjs";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import fs from "node:fs/promises";
|
|
7
|
-
//#region src/_init.ts
|
|
8
|
-
/**
|
|
9
|
-
* The README every scaffolded project gets, and the first thing a new author
|
|
10
|
-
* reads. Three things in it are corrections rather than prose:
|
|
11
|
-
*
|
|
12
|
-
* - **`npm run dev`, never a bare `aai dev`.** The CLI is a devDependency, so
|
|
13
|
-
* after `npm install` the binary is in `node_modules/.bin` and NOT on
|
|
14
|
-
* `PATH`. The old quickstart said `aai dev`, which fails with
|
|
15
|
-
* `command not found` for everyone who has not installed the CLI globally.
|
|
16
|
-
* - **The key `aai dev` needs is named, with the two LOCAL ways first.** No
|
|
17
|
-
* step of local development needs a platform account; a twenty-persona DX
|
|
18
|
-
* audit read the account-shaped failure it used to get and concluded the
|
|
19
|
-
* opposite, then stopped using the loop this file documents.
|
|
20
|
-
* - **`aai login` appears where it is actually required.** It was in no
|
|
21
|
-
* user-facing doc at all, while the quickstart's own publish step needs it.
|
|
22
|
-
*/
|
|
23
|
-
function readmeContent(slug) {
|
|
24
|
-
return `# ${slug}
|
|
25
|
-
|
|
26
|
-
A voice agent built with [aai](${REPO_URL}).
|
|
27
|
-
|
|
28
|
-
## Getting started
|
|
29
|
-
|
|
30
|
-
\`\`\`sh
|
|
31
|
-
npm install # Install dependencies
|
|
32
|
-
npm run dev # Run locally on http://localhost:3000 (opens browser)
|
|
33
|
-
\`\`\`
|
|
34
|
-
|
|
35
|
-
The \`aai\` CLI is a devDependency of this project, so it lives in
|
|
36
|
-
\`node_modules/.bin\` rather than on your \`PATH\`. Run it through npm
|
|
37
|
-
(\`npm run dev\`, \`npm test\`, \`npm run build\`) or with \`npx aai <command>\`.
|
|
38
|
-
Installing it globally (\`npm i -g @alexkroman1/aai-cli\`) also works, and is
|
|
39
|
-
what the project docs assume.
|
|
40
|
-
|
|
41
|
-
### The one key local development needs
|
|
42
|
-
|
|
43
|
-
The default pipeline (speech-to-text → LLM → text-to-speech) runs on a single
|
|
44
|
-
AssemblyAI key. **Any one of these is enough, and the first two need no aai
|
|
45
|
-
account** — nothing about running this agent locally is gated on one:
|
|
46
|
-
|
|
47
|
-
1. Put \`ASSEMBLYAI_API_KEY=<your key>\` in \`.env\` (this project's \`.env.example\`
|
|
48
|
-
documents it, and it is the same file \`aai publish\` uploads as secrets).
|
|
49
|
-
2. Or export it in your shell: \`export ASSEMBLYAI_API_KEY=<your key>\`.
|
|
50
|
-
3. Or run \`npx aai login\`, and \`aai dev\` will use your account's key.
|
|
51
|
-
|
|
52
|
-
Get a key at <https://www.assemblyai.com/dashboard>.
|
|
53
|
-
|
|
54
|
-
## Publishing
|
|
55
|
-
|
|
56
|
-
Publishing (and the studio it syncs to) is the one part that does need an
|
|
57
|
-
account:
|
|
58
|
-
|
|
59
|
-
\`\`\`sh
|
|
60
|
-
npx aai login # Link your account — once per machine
|
|
61
|
-
npm run publish:agent # Publish to production (and sync to the studio)
|
|
62
|
-
\`\`\`
|
|
63
|
-
|
|
64
|
-
You can also run this agent as a plain Node server, with no aai account and
|
|
65
|
-
nothing managed:
|
|
66
|
-
|
|
67
|
-
\`\`\`sh
|
|
68
|
-
npm start # Builds, then serves on http://127.0.0.1:3000
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
## Secrets
|
|
72
|
-
|
|
73
|
-
Access secrets in your agent via \`ctx.env.MY_KEY\`.
|
|
74
|
-
|
|
75
|
-
**Local development** — add secrets to \`.env\` (auto-loaded by \`aai dev\`):
|
|
76
|
-
|
|
77
|
-
\`\`\`sh
|
|
78
|
-
ALPHA_VANTAGE_KEY=sk-abc123
|
|
79
|
-
MY_API_KEY=secret-value
|
|
80
|
-
\`\`\`
|
|
81
|
-
|
|
82
|
-
**Production** — set secrets on the server:
|
|
83
|
-
|
|
84
|
-
\`\`\`sh
|
|
85
|
-
npx aai secret put MY_KEY # Set a secret (prompts for value)
|
|
86
|
-
npx aai secret list # List secret names
|
|
87
|
-
npx aai secret delete MY_KEY # Remove a secret
|
|
88
|
-
\`\`\`
|
|
89
|
-
|
|
90
|
-
`;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Map from npm package name to directory name under packages/.
|
|
94
|
-
* Used to rewrite published version ranges to link: paths in dev mode.
|
|
95
|
-
*/
|
|
96
|
-
const WORKSPACE_PKG_DIRS = {
|
|
97
|
-
"@alexkroman1/aai": "aai",
|
|
98
|
-
"@alexkroman1/aai-cli": "aai-cli",
|
|
99
|
-
"@alexkroman1/aai-runtime": "aai-runtime",
|
|
100
|
-
"@alexkroman1/aai-ui": "aai-ui"
|
|
101
|
-
};
|
|
102
|
-
/** Rewrite workspace deps to link: paths so pnpm links to local source. */
|
|
103
|
-
async function patchPackageJsonForWorkspace(targetDir) {
|
|
104
|
-
const pkgPath = path.join(targetDir, "package.json");
|
|
105
|
-
const pkgJson = await readJson(pkgPath);
|
|
106
|
-
if (!pkgJson) return;
|
|
107
|
-
pkgJson.name = path.basename(targetDir);
|
|
108
|
-
delete pkgJson.packageManager;
|
|
109
|
-
const root = getMonorepoRoot();
|
|
110
|
-
if (!root) return;
|
|
111
|
-
const packagesDir = path.join(root, "packages");
|
|
112
|
-
for (const field of ["dependencies", "devDependencies"]) {
|
|
113
|
-
const deps = pkgJson[field];
|
|
114
|
-
if (!deps) continue;
|
|
115
|
-
for (const key of Object.keys(deps)) {
|
|
116
|
-
const dir = WORKSPACE_PKG_DIRS[key];
|
|
117
|
-
if (dir) deps[key] = `link:${path.relative(targetDir, path.join(packagesDir, dir))}`;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
await writeJson(pkgPath, pkgJson);
|
|
121
|
-
await pinSharedDeps(targetDir, packagesDir, pkgJson);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Pin every THIRD-PARTY dependency this project shares with a linked workspace
|
|
125
|
-
* package to the copy that workspace package resolved.
|
|
126
|
-
*
|
|
127
|
-
* Linking is what makes this necessary, and it only bites in dev mode. The
|
|
128
|
-
* project's `@alexkroman1/*` deps become `link:` paths, so the SDK's types come
|
|
129
|
-
* out of the WORKSPACE's `node_modules` — while the project installs its own
|
|
130
|
-
* copy of anything it also declares. Two copies of a structurally identical
|
|
131
|
-
* library are two NOMINALLY different types to TypeScript, and the error runs to
|
|
132
|
-
* a hundred lines of `Type 'AnyActorLogic' is not assignable to type
|
|
133
|
-
* 'AnyActorLogic'` with two absolute paths in it.
|
|
134
|
-
*
|
|
135
|
-
* Measured: `aai init --template support-line` produced exactly that. The
|
|
136
|
-
* workspace lockfile pinned `xstate@5.32.5`, the fresh project resolved
|
|
137
|
-
* `^5.32.5` to `5.32.6`, the CLI's typecheck gate failed, and the deploy was
|
|
138
|
-
* REFUSED — `"deployed": false` with the whole error as a warning. One
|
|
139
|
-
* `overrides` entry fixes it; verified end to end.
|
|
140
|
-
*
|
|
141
|
-
* A published install has no such problem, which is why this is dev-mode only:
|
|
142
|
-
* a user's project and the published SDK both ask for `^5.32.5` and pnpm
|
|
143
|
-
* resolves ONE copy. Nothing here changes what a user gets.
|
|
144
|
-
*
|
|
145
|
-
* Written to `pnpm-workspace.yaml` rather than `pnpm.overrides` in the manifest:
|
|
146
|
-
* the scaffold ships that file, which makes the project its own workspace root,
|
|
147
|
-
* and pnpm 10+ reads overrides from there. Verified both ways — the manifest
|
|
148
|
-
* spelling installed `5.32.6` anyway.
|
|
149
|
-
*/
|
|
150
|
-
async function pinSharedDeps(targetDir, packagesDir, pkgJson) {
|
|
151
|
-
const declared = {
|
|
152
|
-
...pkgJson.dependencies,
|
|
153
|
-
...pkgJson.devDependencies
|
|
154
|
-
};
|
|
155
|
-
const linked = Object.entries(WORKSPACE_PKG_DIRS).filter(([name]) => name in declared).map(([, dir]) => dir);
|
|
156
|
-
const resolved = await Promise.all(Object.keys(declared).filter((name) => !(name in WORKSPACE_PKG_DIRS)).map(async (name) => {
|
|
157
|
-
for (const dir of linked) {
|
|
158
|
-
const manifest = await readJson(path.join(packagesDir, dir, "node_modules", name, "package.json"));
|
|
159
|
-
if (typeof manifest?.version === "string") return [name, manifest.version];
|
|
160
|
-
}
|
|
161
|
-
return null;
|
|
162
|
-
}));
|
|
163
|
-
const pins = new Map(resolved.filter((entry) => entry !== null));
|
|
164
|
-
if (pins.size === 0) return;
|
|
165
|
-
const file = path.join(targetDir, "pnpm-workspace.yaml");
|
|
166
|
-
let existing;
|
|
167
|
-
try {
|
|
168
|
-
existing = await fs.readFile(file, "utf-8");
|
|
169
|
-
} catch {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
const block = [...pins].sort(([a], [b]) => compareCodeUnits(a, b)).map(([name, version]) => ` "${name}": "${version}"`).join("\n");
|
|
173
|
-
await fs.writeFile(file, `${existing.trimEnd()}\n\n# Added by \`aai init\` in DEV MODE only — see pinSharedDeps in\n# packages/aai-cli/src/_init.ts. The @alexkroman1/* packages above are LINKED to
|
|
174
|
-
# this checkout, so anything they and this project both depend on has to be
|
|
175
|
-
# ONE copy: two copies of xstate are two incompatible sets of types, and the
|
|
176
|
-
# typecheck gate refuses the deploy.\noverrides:\n${block}\n`);
|
|
177
|
-
}
|
|
178
|
-
async function runInit(opts) {
|
|
179
|
-
const { targetDir, template } = opts;
|
|
180
|
-
await downloadAndMergeTemplate(template, targetDir);
|
|
181
|
-
if (isDevMode()) {
|
|
182
|
-
await patchPackageJsonForWorkspace(targetDir);
|
|
183
|
-
try {
|
|
184
|
-
await fs.unlink(path.join(targetDir, ".npmrc"));
|
|
185
|
-
} catch {}
|
|
186
|
-
}
|
|
187
|
-
try {
|
|
188
|
-
await fs.copyFile(path.join(targetDir, ".env.example"), path.join(targetDir, ".env"), fs.constants.COPYFILE_EXCL);
|
|
189
|
-
} catch {}
|
|
190
|
-
const readmePath = path.join(targetDir, "README.md");
|
|
191
|
-
const slug = path.basename(path.resolve(targetDir));
|
|
192
|
-
try {
|
|
193
|
-
await fs.writeFile(readmePath, readmeContent(slug), { flag: "wx" });
|
|
194
|
-
} catch (err) {
|
|
195
|
-
if (!isEexist(err)) throw err;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
199
|
-
export { runInit };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { plural } from "@alexkroman1/aai/utils";
|
|
3
|
-
import { requiredProviderEnvVars } from "@alexkroman1/aai-runtime";
|
|
4
|
-
//#region src/_preflight.ts
|
|
5
|
-
/**
|
|
6
|
-
* The deploy-time credential preflight — the classic dev/prod failure, caught
|
|
7
|
-
* before the upload instead of at the deployed agent's first session.
|
|
8
|
-
*
|
|
9
|
-
* An agent that ran locally on shell-exported provider keys dies after deploy
|
|
10
|
-
* with what looks like a provider outage: `aai dev` falls back to the shell
|
|
11
|
-
* (`withHostCredentialFallback`), and the platform never will. Naming the key
|
|
12
|
-
* here turns that into one line of output while the developer is still in the
|
|
13
|
-
* directory that owns the `.env`.
|
|
14
|
-
*
|
|
15
|
-
* **This lives in the CLI because the agent's config does.** The platform
|
|
16
|
-
* stores no description of a bundle and never evaluates one (see "The
|
|
17
|
-
* platform stores no agent config" in packages/aai-server/CLAUDE.md), so the
|
|
18
|
-
* only place that knows an agent needs `CARTESIA_API_KEY` is the process that
|
|
19
|
-
* just built it.
|
|
20
|
-
*
|
|
21
|
-
* **It WARNS, and must not be turned into a hard failure.** The CLI sees the
|
|
22
|
-
* env it is about to upload; it cannot see what is already stored against the
|
|
23
|
-
* slug from an earlier `aai secret put`, so a key the platform holds looks
|
|
24
|
-
* missing from here. The server-side check this replaced could see both and
|
|
25
|
-
* so could reject — moving the config to where it is authored costs that
|
|
26
|
-
* accuracy, and a false rejection is worse than a false warning: it blocks a
|
|
27
|
-
* deploy that would have worked.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* Env var names the agent needs that the env being uploaded doesn't supply.
|
|
31
|
-
* Empty values count as missing — an empty credential authenticates nothing.
|
|
32
|
-
*
|
|
33
|
-
* Two sources: provider credentials derived from the stt/llm/tts/s2s
|
|
34
|
-
* descriptors (the same registry-backed derivation the runtime resolves keys
|
|
35
|
-
* with), and the agent's own declared `requiredEnv` — an `agent()` field for
|
|
36
|
-
* custom keys tools read from `ctx.env`, which no static derivation can see.
|
|
37
|
-
*/
|
|
38
|
-
function missingCredentials(config, env) {
|
|
39
|
-
return [.../* @__PURE__ */ new Set([...requiredProviderEnvVars(config), ...config.requiredEnv ?? []])].filter((name) => !env[name]);
|
|
40
|
-
}
|
|
41
|
-
/** One line naming the missing keys and what to do about them. */
|
|
42
|
-
function missingCredentialMessage(missing) {
|
|
43
|
-
return `Missing ${plural(missing.length, "credential")} the agent needs to start: ${missing.join(", ")}. Declare ${plural(missing.length, "it", "them")} in .env and redeploy (already set on the platform with \`aai secret put\`? then this is already handled).`;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
export { missingCredentialMessage, missingCredentials };
|
package/dist/init-D363Ls5u.mjs
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { a as ok } from "./_output-DBP9Op_d.mjs";
|
|
3
|
-
import { n as log, s as unwrapCancel } from "./_ui-DCt4qZrk.mjs";
|
|
4
|
-
import { c as fileExists, d as readJson, p as resolveCwd, s as errorMessage, t as AGENT_ENTRY } from "./_utils-D5JGcjiW.mjs";
|
|
5
|
-
import { r as isDevMode, t as getMonorepoRoot } from "./_agent-BzUeqOdj.mjs";
|
|
6
|
-
import { listTemplates } from "./_templates-CuP74F8D.mjs";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
import { styleText } from "node:util";
|
|
9
|
-
import * as p from "@clack/prompts";
|
|
10
|
-
import { execa } from "execa";
|
|
11
|
-
//#region src/init.ts
|
|
12
|
-
/**
|
|
13
|
-
* Run `fn` behind a clack spinner, stopping it in EVERY outcome.
|
|
14
|
-
*
|
|
15
|
-
* The naked form (`s?.start(); await work(); s?.stop()`) leaks the spinner on a
|
|
16
|
-
* failure: clack keeps its interval and its raw-mode stdin hook, so a throw
|
|
17
|
-
* left a spinner ticking under the error message with the cursor hidden. The
|
|
18
|
-
* `catch` label is what the terminal is left showing, so it names the step.
|
|
19
|
-
*/
|
|
20
|
-
async function withSpinner(silent, labels, fn) {
|
|
21
|
-
const s = silent ? void 0 : p.spinner();
|
|
22
|
-
s?.start(labels.start);
|
|
23
|
-
let succeeded = false;
|
|
24
|
-
try {
|
|
25
|
-
const value = await fn();
|
|
26
|
-
succeeded = true;
|
|
27
|
-
return value;
|
|
28
|
-
} finally {
|
|
29
|
-
s?.stop(succeeded ? labels.done : labels.failed);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const DEFAULT_PROJECT_NAME = "my-voice-agent";
|
|
33
|
-
/** Prompt for project name or return default when --yes is set. */
|
|
34
|
-
async function promptProjectName(yes) {
|
|
35
|
-
if (yes) return DEFAULT_PROJECT_NAME;
|
|
36
|
-
return unwrapCancel(await p.text({
|
|
37
|
-
message: "What is your project named?",
|
|
38
|
-
placeholder: DEFAULT_PROJECT_NAME,
|
|
39
|
-
defaultValue: DEFAULT_PROJECT_NAME
|
|
40
|
-
}), "Setup cancelled") || DEFAULT_PROJECT_NAME;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* The template a non-interactive `init` gets, and the entry the selector opens
|
|
44
|
-
* on — so an author who just presses Enter lands where they used to.
|
|
45
|
-
*/
|
|
46
|
-
const DEFAULT_TEMPLATE = "simple";
|
|
47
|
-
/**
|
|
48
|
-
* Ask which template to scaffold, listing what this CLI actually ships.
|
|
49
|
-
*
|
|
50
|
-
* The options are derived from {@link listTemplates} rather than a roster kept
|
|
51
|
-
* here: that function already backs `aai templates` AND the unknown-template
|
|
52
|
-
* error, so a template added to the package shows up in the picker with no
|
|
53
|
-
* second list to update. {@link DEFAULT_TEMPLATE} is hoisted to the top and
|
|
54
|
-
* pre-selected, which is what keeps a bare `aai init` a single Enter away from
|
|
55
|
-
* the project it produced before there was a picker.
|
|
56
|
-
*
|
|
57
|
-
* Callers must not reach here when there is nobody to answer — `--yes` and
|
|
58
|
-
* JSON mode (auto-detected on a pipe) resolve the default without prompting.
|
|
59
|
-
*/
|
|
60
|
-
async function promptTemplate(list = listTemplates) {
|
|
61
|
-
const [first, ...rest] = await list();
|
|
62
|
-
if (first === void 0) return DEFAULT_TEMPLATE;
|
|
63
|
-
if (rest.length === 0) return first;
|
|
64
|
-
const names = [first, ...rest];
|
|
65
|
-
const hasDefault = names.includes(DEFAULT_TEMPLATE);
|
|
66
|
-
const ordered = hasDefault ? [DEFAULT_TEMPLATE, ...names.filter((name) => name !== DEFAULT_TEMPLATE)] : names;
|
|
67
|
-
return unwrapCancel(await p.select({
|
|
68
|
-
message: "Which template?",
|
|
69
|
-
maxItems: 12,
|
|
70
|
-
initialValue: hasDefault ? DEFAULT_TEMPLATE : first,
|
|
71
|
-
options: ordered.map((name) => name === DEFAULT_TEMPLATE ? {
|
|
72
|
-
value: name,
|
|
73
|
-
hint: "the default starting point"
|
|
74
|
-
} : { value: name })
|
|
75
|
-
}), "Setup cancelled");
|
|
76
|
-
}
|
|
77
|
-
/** Best-effort corepack enable so pnpm is available (scaffold declares packageManager: pnpm). */
|
|
78
|
-
async function ensurePnpm() {
|
|
79
|
-
await execa("corepack", ["enable"], { reject: false });
|
|
80
|
-
}
|
|
81
|
-
/** Check if the project has any dependencies to install. */
|
|
82
|
-
async function hasDeps(cwd) {
|
|
83
|
-
if (await fileExists(path.join(cwd, "node_modules"))) return false;
|
|
84
|
-
const pkgJson = await readJson(path.join(cwd, "package.json")) ?? {};
|
|
85
|
-
const deps = Object.keys(pkgJson.dependencies ?? {});
|
|
86
|
-
const devDeps = Object.keys(pkgJson.devDependencies ?? {});
|
|
87
|
-
return deps.length > 0 || devDeps.length > 0;
|
|
88
|
-
}
|
|
89
|
-
/** Check whether the safe-chain binary is on PATH. */
|
|
90
|
-
async function hasSafeChain() {
|
|
91
|
-
const { failed } = await execa("safe-chain", ["--version"], { reject: false });
|
|
92
|
-
return !failed;
|
|
93
|
-
}
|
|
94
|
-
/** Build the command + args for running pnpm, routing through safe-chain when available. */
|
|
95
|
-
async function resolvePnpmCommand(checkSafeChain = hasSafeChain) {
|
|
96
|
-
if (await checkSafeChain()) return {
|
|
97
|
-
cmd: "safe-chain",
|
|
98
|
-
args: ["pnpm", "--safe-chain-skip-minimum-package-age"]
|
|
99
|
-
};
|
|
100
|
-
return {
|
|
101
|
-
cmd: "pnpm",
|
|
102
|
-
args: []
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
/** Run pnpm install and warn on failure. */
|
|
106
|
-
async function runPnpmInstall(cwd) {
|
|
107
|
-
const { cmd, args } = await resolvePnpmCommand();
|
|
108
|
-
const pnpmArgs = isDevMode() ? ["install"] : ["install", "--ignore-workspace"];
|
|
109
|
-
await execa(cmd, [...args, ...pnpmArgs], { cwd });
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Install deps with pnpm, reporting a failure through `warn` rather than
|
|
113
|
-
* throwing: the project is scaffolded either way, and the two warnings say how
|
|
114
|
-
* to finish the install by hand. Nothing downstream branches on the outcome —
|
|
115
|
-
* `init` stops here — so it returns nothing.
|
|
116
|
-
*/
|
|
117
|
-
async function installDeps(cwd, warn, silent) {
|
|
118
|
-
if (!await hasDeps(cwd)) return;
|
|
119
|
-
await ensurePnpm();
|
|
120
|
-
try {
|
|
121
|
-
await withSpinner(silent, {
|
|
122
|
-
start: "Installing dependencies with pnpm",
|
|
123
|
-
done: "Dependencies installed",
|
|
124
|
-
failed: "Dependency install failed"
|
|
125
|
-
}, () => runPnpmInstall(cwd));
|
|
126
|
-
} catch (err) {
|
|
127
|
-
warn(`pnpm install failed: ${errorMessage(err)}`);
|
|
128
|
-
warn("Install pnpm (`npm install -g pnpm`), then run `pnpm install` in the project.");
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
/** Resolve target directory relative to the user's current directory. */
|
|
132
|
-
function resolveTargetDir(dir) {
|
|
133
|
-
return path.resolve(resolveCwd(), dir);
|
|
134
|
-
}
|
|
135
|
-
function collectWarnings() {
|
|
136
|
-
const warnings = [];
|
|
137
|
-
return {
|
|
138
|
-
warnings,
|
|
139
|
-
warn: (message) => {
|
|
140
|
-
warnings.push(message);
|
|
141
|
-
log.warn(message);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
/** Scaffold the project, optionally showing a spinner. */
|
|
146
|
-
async function scaffoldProject(dir, cwd, template, silent) {
|
|
147
|
-
const { runInit } = await import("./_init-BzQbV8Zh.mjs");
|
|
148
|
-
await withSpinner(silent, {
|
|
149
|
-
start: `Creating ${dir}`,
|
|
150
|
-
done: "Project created",
|
|
151
|
-
failed: `Could not create ${dir}`
|
|
152
|
-
}, () => runInit({
|
|
153
|
-
targetDir: cwd,
|
|
154
|
-
template
|
|
155
|
-
}));
|
|
156
|
-
}
|
|
157
|
-
/** Print post-init instructions. */
|
|
158
|
-
function printPostInitInfo(cwd, monorepoRoot) {
|
|
159
|
-
log.success(`Created ${cwd}`);
|
|
160
|
-
if (monorepoRoot) log.info("Dev mode: project linked to workspace packages");
|
|
161
|
-
log.info(`Next: cd ${cwd} && aai dev`);
|
|
162
|
-
}
|
|
163
|
-
async function executeInit(opts, extra) {
|
|
164
|
-
const suppressUi = extra?.silent;
|
|
165
|
-
if (!suppressUi) p.intro(styleText("cyanBright", "Create a new voice agent"));
|
|
166
|
-
const dir = opts.dir ?? await promptProjectName(opts.yes);
|
|
167
|
-
const monorepoRoot = getMonorepoRoot();
|
|
168
|
-
const cwd = resolveTargetDir(dir);
|
|
169
|
-
if (!opts.force && await fileExists(path.join(cwd, "agent.ts"))) throw new Error(`${AGENT_ENTRY} already exists in this directory. Use ${styleText("cyanBright", "--force")} to overwrite.`);
|
|
170
|
-
const template = opts.template ?? (opts.yes || suppressUi ? DEFAULT_TEMPLATE : await promptTemplate());
|
|
171
|
-
const { warn, warnings } = collectWarnings();
|
|
172
|
-
await scaffoldProject(dir, cwd, template, suppressUi);
|
|
173
|
-
await installDeps(cwd, warn, suppressUi);
|
|
174
|
-
if (!suppressUi) printPostInitInfo(cwd, monorepoRoot);
|
|
175
|
-
const data = {
|
|
176
|
-
dir: cwd,
|
|
177
|
-
template
|
|
178
|
-
};
|
|
179
|
-
if (warnings.length > 0) data.warnings = warnings;
|
|
180
|
-
return ok(data);
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
|
-
export { executeInit };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { agent } from "@alexkroman1/aai";
|
|
2
|
-
|
|
3
|
-
export default agent({
|
|
4
|
-
name: "Dr. Sage",
|
|
5
|
-
greeting:
|
|
6
|
-
"Hey, I'm Dr. Sage. Try asking me something like, what are the side effects of ibuprofen, can I take aspirin and warfarin together, or calculate my BMI. Just remember, I'm not a real doctor, so always check with your healthcare provider.",
|
|
7
|
-
// Three builtins, and `fetch_json` is the one worth explaining: `fda.ts`
|
|
8
|
-
// already reaches openFDA's LABEL endpoint in tool code, and a label is the
|
|
9
|
-
// manufacturer's text. What the two tools cannot answer is what people
|
|
10
|
-
// actually REPORT, which lives in a different dataset (`/drug/event.json`)
|
|
11
|
-
// and is a counting query rather than a lookup — so it is the model's to
|
|
12
|
-
// compose, not a fixed tool's. `system-prompt.md` holds the endpoint and the
|
|
13
|
-
// caveat that a report count is not an incidence rate.
|
|
14
|
-
builtinTools: ["web_search", "run_code", "fetch_json"],
|
|
15
|
-
});
|