@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { deskFlow, IN_BOOKING } from "../desk.ts";
|
|
3
|
-
import { hotelSlot
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { note } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Their `give_up`, on every task: end the flow without making the booking, or
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { isoDate, MAX_PARTY_SIZE, speakCode, spokenDate } from "../records.ts";
|
|
4
|
-
import {
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { addTicket } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/** Their `add_to_waitlist`: for dates the hotel is sold out on. Holds nothing. */
|
|
7
8
|
export default hotelSlot.updateTool({
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
spokenTime,
|
|
12
12
|
TODAY,
|
|
13
13
|
} from "../records.ts";
|
|
14
|
-
import {
|
|
14
|
+
import { hotelSlot } from "../session.ts";
|
|
15
|
+
import { addTicket } from "../shared.ts";
|
|
15
16
|
|
|
16
17
|
/** Their `book_airport_car`: the hotel car, hotel-to-airport only, charged to the room. */
|
|
17
18
|
export default hotelSlot.updateTool({
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/cancel_restaurant_reservation.ts
RENAMED
|
@@ -2,7 +2,8 @@ import { toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { spokenDate, spokenTime } from "../records.ts";
|
|
4
4
|
import { findReservation } from "../restaurant.ts";
|
|
5
|
-
import { hotelSlot
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { note } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/** Their `cancel_restaurant_reservation`: last name + RES code, no card, no email. */
|
|
8
9
|
export default hotelSlot.updateTool({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { cancelBooking } from "../hotel.ts";
|
|
3
3
|
import { daysBetween, PRICING, speakUsd, TODAY } from "../records.ts";
|
|
4
|
-
import {
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { callerTurns, requireVerified } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Cancel the verified booking and say what comes back — their
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_restaurant_availability.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { isoDate, MAX_PARTY_SIZE, spokenDate, spokenTime } from "../records.ts";
|
|
3
3
|
import { openDinnerSlots } from "../restaurant.ts";
|
|
4
|
-
import { hotelSlot } from "../
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
5
|
|
|
6
6
|
/** Their `check_restaurant_availability`: the open slots for a date and party. */
|
|
7
7
|
export default hotelSlot.tool({
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/check_room_availability.ts
RENAMED
|
@@ -2,7 +2,7 @@ import { toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { describeRoomOptions, listRoomOptions } from "../hotel.ts";
|
|
4
4
|
import { isoDate, MAX_PARTY_SIZE, ROOM_TYPES, spokenDate } from "../records.ts";
|
|
5
|
-
import { hotelSlot } from "../
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
6
|
|
|
7
7
|
/** Their `check_room_availability`: read-only browsing, never a booking. */
|
|
8
8
|
export default hotelSlot.tool({
|
|
@@ -4,7 +4,7 @@ import { bookingStatus, nextStep, requote } from "../booking.ts";
|
|
|
4
4
|
import { AFTER_STAY, deskFlow } from "../desk.ts";
|
|
5
5
|
import { describeRoomOptions, listRoomOptions } from "../hotel.ts";
|
|
6
6
|
import { daysBetween, describeExtras, ROOM_TYPES, ROOM_VIEWS, speakUsd } from "../records.ts";
|
|
7
|
-
import { hotelSlot } from "../
|
|
7
|
+
import { hotelSlot } from "../session.ts";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Record the room type (and view) the caller picked from the options `set_stay`
|
|
@@ -4,7 +4,8 @@ import { bookingStatus, changedFields, nextStep } from "../booking.ts";
|
|
|
4
4
|
import { deskFlow } from "../desk.ts";
|
|
5
5
|
import { bookRoom, updateBooking } from "../hotel.ts";
|
|
6
6
|
import { speakCode, speakUsd } from "../records.ts";
|
|
7
|
-
import {
|
|
7
|
+
import { hotelSlot } from "../session.ts";
|
|
8
|
+
import { bookingByCode, callerTurns, note } from "../shared.ts";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Finalize the booking — their `confirm_booking` and `confirm_changes`, one
|
|
@@ -2,7 +2,8 @@ import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { requireRoom } from "../hotel.ts";
|
|
4
4
|
import { EMERGENCY_KINDS, type EmergencyKind } from "../records.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { addTicket } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/** What the caller is told to do THEMSELVES, per kind — never a substitute for sending hotel people. */
|
|
8
9
|
const DIRECTION: Record<EmergencyKind, string> = {
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
} from "../disputes.ts";
|
|
9
9
|
import { invoiceFor } from "../hotel.ts";
|
|
10
10
|
import { DISPUTE_CATEGORIES, mintCode } from "../records.ts";
|
|
11
|
-
import { hotelSlot
|
|
11
|
+
import { hotelSlot } from "../session.ts";
|
|
12
|
+
import { note, requireVerified, takenCodes } from "../shared.ts";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Handle a dispute on a line item — their `dispute_charge`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { hotelSlot
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { note, requireVerified } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/** Their `flag_late_arrival`: a note on the booking so the desk holds the room. */
|
|
6
7
|
export default hotelSlot.updateTool({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isToolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { roomConflict } from "../hotel.ts";
|
|
3
3
|
import { daysBetween, speakUsd, spokenDate } from "../records.ts";
|
|
4
|
-
import { hotelSlot
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { requireVerified } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Read-only lookup of the verified booking — their `lookup_booking`, including
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { invoiceFor } from "../hotel.ts";
|
|
3
3
|
import { speakUsd } from "../records.ts";
|
|
4
|
-
import { hotelSlot
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { requireVerified } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/** Their `lookup_invoice`: the verified booking's line items, read back. */
|
|
7
8
|
export default hotelSlot.tool({
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/lookup_restaurant_reservation.ts
RENAMED
|
@@ -2,7 +2,7 @@ import { toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { spokenDate, spokenTime } from "../records.ts";
|
|
4
4
|
import { findReservation } from "../restaurant.ts";
|
|
5
|
-
import { hotelSlot } from "../
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
6
|
|
|
7
7
|
/** Their `lookup_restaurant_reservation`: restaurants verify with last name + RES code. */
|
|
8
8
|
export default hotelSlot.tool({
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/modify_restaurant_reservation.ts
RENAMED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TODAY,
|
|
13
13
|
} from "../records.ts";
|
|
14
14
|
import { findReservation, modifyReservation, openDinnerSlots } from "../restaurant.ts";
|
|
15
|
-
import { hotelSlot } from "../
|
|
15
|
+
import { hotelSlot } from "../session.ts";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Move a reservation — their `modify_restaurant_reservation`, one step, same
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { bookingStatus, nextStep } from "../booking.ts";
|
|
4
4
|
import { validateCard } from "../card.ts";
|
|
5
5
|
import { AFTER_DETAILS, deskFlow } from "../desk.ts";
|
|
6
|
-
import { hotelSlot } from "../
|
|
6
|
+
import { hotelSlot } from "../session.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Take the card for a new booking — their `GetCardTask`, whose four recording
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { digitsOf, FOLLOWUP_KINDS, speakCode } from "../records.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { addTicket } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Capture something for a human to follow up on — their `record_followup`, the
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { digitsOf, isoDate, speakCode } from "../records.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { addTicket } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/** Their `record_group_inquiry`: fifteen or more guests is a block, never a booking. */
|
|
6
7
|
export default hotelSlot.updateTool({
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { bookingStatus, nextStep } from "../booking.ts";
|
|
4
4
|
import { AFTER_EXTRAS, deskFlow } from "../desk.ts";
|
|
5
5
|
import { digitsOf } from "../records.ts";
|
|
6
|
-
import { hotelSlot } from "../
|
|
6
|
+
import { hotelSlot } from "../session.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Record the guest's name, email and phone — their three `beta.workflows`
|
|
@@ -2,7 +2,7 @@ import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { reinstateBooking } from "../hotel.ts";
|
|
4
4
|
import { normalizeCode, speakCode, speakUsd, spokenDate, TODAY } from "../records.ts";
|
|
5
|
-
import { hotelSlot } from "../
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Bring back a cancelled booking — their `reinstate_booking`, the one flow that
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/request_flight_reconfirmation.ts
RENAMED
|
@@ -2,7 +2,8 @@ import { isToolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { requireRoom } from "../hotel.ts";
|
|
4
4
|
import { isoDate, speakCode } from "../records.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { addTicket } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/** Their `request_flight_reconfirmation`: the concierge calls the carrier and rings the room. */
|
|
8
9
|
export default hotelSlot.updateTool({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isToolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { addTicket, requireVerified } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Re-send a document to the email ON FILE — their `resend_confirmation` over
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TODAY,
|
|
12
12
|
} from "../records.ts";
|
|
13
13
|
import { openDinnerSlots, reserveTable } from "../restaurant.ts";
|
|
14
|
-
import { hotelSlot } from "../
|
|
14
|
+
import { hotelSlot } from "../session.ts";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Book a table — their `BookRestaurantTask`, collapsed to one call.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isToolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { resolveRoomConflict } from "../hotel.ts";
|
|
3
3
|
import { spokenDate } from "../records.ts";
|
|
4
|
-
import { hotelSlot
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { requireVerified } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Fix a double-booked room on the verified booking — their
|
|
@@ -2,7 +2,8 @@ import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { requireRoom } from "../hotel.ts";
|
|
4
4
|
import { clockTime, isoDate, speakCode, spokenDate, spokenTime, TODAY } from "../records.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { addTicket } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/** Their `schedule_wakeup_call`: it actually sets the call — never a followup note instead. */
|
|
8
9
|
export default hotelSlot.updateTool({
|
|
@@ -2,7 +2,8 @@ import { isToolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { requireRoom } from "../hotel.ts";
|
|
4
4
|
import { speakCode } from "../records.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { addTicket } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/** Their `set_do_not_disturb`: a standing hold on a room's calls and messages. */
|
|
8
9
|
export default hotelSlot.updateTool({
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { bookingStatus, nextStep, requote } from "../booking.ts";
|
|
4
4
|
import { AFTER_ROOM, deskFlow } from "../desk.ts";
|
|
5
5
|
import { type RoomExtra, speakUsd } from "../records.ts";
|
|
6
|
-
import { hotelSlot } from "../
|
|
6
|
+
import { hotelSlot } from "../session.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Record the caller's answer on each extra — their `set_extras`.
|
|
@@ -4,7 +4,8 @@ import { bookingStatus, nextStep, requote } from "../booking.ts";
|
|
|
4
4
|
import { deskFlow, IN_BOOKING } from "../desk.ts";
|
|
5
5
|
import { describeRoomOptions, listRoomOptions } from "../hotel.ts";
|
|
6
6
|
import { daysBetween, isoDate, MAX_PARTY_SIZE, spokenDate, TODAY } from "../records.ts";
|
|
7
|
-
import {
|
|
7
|
+
import { hotelSlot } from "../session.ts";
|
|
8
|
+
import { bookingByCode } from "../shared.ts";
|
|
8
9
|
|
|
9
10
|
const MAX_NIGHTS = 30;
|
|
10
11
|
|
package/dist/templates/{hotel-desk → hotel-reception-agent}/tools/start_booking_modification.ts
RENAMED
|
@@ -4,7 +4,8 @@ import { draftForModification } from "../booking.ts";
|
|
|
4
4
|
import { deskFlow } from "../desk.ts";
|
|
5
5
|
import { requireFloorPlanRoom } from "../hotel.ts";
|
|
6
6
|
import { speakUsd, spokenDate, TODAY } from "../records.ts";
|
|
7
|
-
import { hotelSlot
|
|
7
|
+
import { hotelSlot } from "../session.ts";
|
|
8
|
+
import { requireVerified } from "../shared.ts";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Open the modification flow on the verified booking — their
|
|
@@ -3,7 +3,8 @@ import { z } from "zod";
|
|
|
3
3
|
import { bookingStatus, draftForNewBooking } from "../booking.ts";
|
|
4
4
|
import { deskFlow } from "../desk.ts";
|
|
5
5
|
import { speakCode } from "../records.ts";
|
|
6
|
-
import {
|
|
6
|
+
import { hotelSlot } from "../session.ts";
|
|
7
|
+
import { callerTurns } from "../shared.ts";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Open the room-booking flow — their `start_room_booking`, which `await`ed a
|
|
@@ -2,7 +2,8 @@ import { toolFailure } from "@alexkroman1/aai";
|
|
|
2
2
|
import { countWords } from "@alexkroman1/aai/utils";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { digitsOf, speakCode, TODAY } from "../records.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { hotelSlot } from "../session.ts";
|
|
6
|
+
import { addTicket } from "../shared.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Take a message for someone who may be a guest — their `take_guest_message`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TRANSFER_DESTINATIONS } from "../records.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { hotelSlot } from "../session.ts";
|
|
4
|
+
import { addTicket } from "../shared.ts";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Transfer the caller to a DEPARTMENT — their `transfer_call`, a stub that
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isToolFailure, toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { validateCard } from "../card.ts";
|
|
4
|
-
import { hotelSlot
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { note, requireVerified } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Replace the card on file — their `start_card_update`, which verified and then
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { toolFailure } from "@alexkroman1/aai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { digitsOf, normalizeCode, speakCode, spokenDate } from "../records.ts";
|
|
4
|
-
import { hotelSlot
|
|
4
|
+
import { hotelSlot } from "../session.ts";
|
|
5
|
+
import { note } from "../shared.ts";
|
|
5
6
|
|
|
6
7
|
/** Failed lookups before a human takes over — their `_attempts >= 3`. */
|
|
7
8
|
export const MAX_VERIFY_ATTEMPTS = 3;
|
|
@@ -135,7 +135,22 @@ describeWorkflowEval(agentDef, (test) => {
|
|
|
135
135
|
const url = mode === "live" ? await servePage(ARTICLE_HTML) : "https://example.test/otters";
|
|
136
136
|
if (mode === "stub") scriptBothLegs(ARTICLE_HTML);
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
// Run TWICE at most, and only for a reply that came back the wrong SHAPE.
|
|
139
|
+
//
|
|
140
|
+
// The digest step asks its call site for six attempts precisely because a
|
|
141
|
+
// model that answers with prose, or with JSON it truncated, may well obey
|
|
142
|
+
// the next time — `stepGenerateJsonOrFail` throws retryably for exactly
|
|
143
|
+
// that. This harness has no retry to give it (`maxAttempts: 1`, and the eval
|
|
144
|
+
// engine says so in as many words), so a live run here spends the step's
|
|
145
|
+
// whole reliability budget on one draw and a single malformed reply failed
|
|
146
|
+
// the case: "Expected JSON from the model, got: {"headline"…". That is the
|
|
147
|
+
// harness being thinner than production, not the flow being wrong, so the
|
|
148
|
+
// retry is restored HERE — narrowly, on the one error the deployed run
|
|
149
|
+
// would ride out, and never on a `FatalError`, which must still fail once.
|
|
150
|
+
let run = await app.run(digest, { url });
|
|
151
|
+
if (mode === "live" && /Expected JSON from the model/.test(run.error ?? "")) {
|
|
152
|
+
run = await app.run(digest, { url });
|
|
153
|
+
}
|
|
139
154
|
|
|
140
155
|
// The error FIRST, so a failed run names its own reason instead of reporting
|
|
141
156
|
// "expected 'failed' to be 'completed'".
|
|
@@ -505,7 +505,7 @@ describe("the run is DURABLE", () => {
|
|
|
505
505
|
* agent really serves and a typo in either half fails rather than matching
|
|
506
506
|
* whatever came next.
|
|
507
507
|
*/
|
|
508
|
-
const BASE = "https://agents.example/link-digest";
|
|
508
|
+
const BASE = "https://agents.example/link-digest-workflow";
|
|
509
509
|
const RUN_ID = "wrun_otters";
|
|
510
510
|
|
|
511
511
|
/** A completed run as the API serves it — the shape `WorkflowRunOf` describes. */
|
|
@@ -582,7 +582,7 @@ test("connect refuses a base URL pointing at a VOICE agent, naming it", async ()
|
|
|
582
582
|
// calls later as a 404 from a route that was never going to exist.
|
|
583
583
|
stubAgent({ page: "voice" });
|
|
584
584
|
await expect(connect({ baseUrl: `${BASE}/` })).rejects.toThrow(
|
|
585
|
-
/agents\.example\/link-digest answers as a voice agent/,
|
|
585
|
+
/agents\.example\/link-digest-workflow answers as a voice agent/,
|
|
586
586
|
);
|
|
587
587
|
});
|
|
588
588
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* WebSocket, and no voice pipeline: the page (`client.tsx`) starts a run over
|
|
7
7
|
* the workflow HTTP API and watches it, and the run outlives the tab.
|
|
8
8
|
*
|
|
9
|
-
* ## What makes this a different KIND of agent from `research-
|
|
9
|
+
* ## What makes this a different KIND of agent from `research-handoff-agent`
|
|
10
10
|
*
|
|
11
|
-
* `research-
|
|
11
|
+
* `research-handoff-agent` is a voice agent that HANDS OFF to a workflow — a caller is on
|
|
12
12
|
* the line, so a tool starts a run and answers the turn. Here the workflow is
|
|
13
13
|
* the entire product, and the declaration says so:
|
|
14
14
|
*
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* declares no providers, so nothing else in its config names a credential.
|
|
50
50
|
*
|
|
51
51
|
* A step is handed no `ToolContext`, so it reads that key with `requireStepEnv`
|
|
52
|
-
* rather than `ctx.env`; see `workflows/digest.ts` and `research-
|
|
52
|
+
* rather than `ctx.env`; see `workflows/digest.ts` and `research-handoff-agent`'s module
|
|
53
53
|
* doc for the one thing that changes under `aai dev` (the key has to be in
|
|
54
54
|
* `.env`, not just your shell).
|
|
55
55
|
*
|
|
@@ -87,6 +87,11 @@ export const digest = workflow({
|
|
|
87
87
|
|
|
88
88
|
export default workflowApp({
|
|
89
89
|
name: "Link Digest",
|
|
90
|
+
// TWO descriptions, two readers, and they are deliberately not one sentence.
|
|
91
|
+
// This one says what the APP is, for a registry page or the studio's picker.
|
|
92
|
+
// The one on `digest` above says what a RUN does and is served as JSON Schema
|
|
93
|
+
// on `GET /workflows`, which is what lets a page render a form for it.
|
|
94
|
+
description: "Turns a pasted link into a headline and three points",
|
|
90
95
|
// The whole product. A workflow app is an agent whose work happens here.
|
|
91
96
|
workflows: { digest },
|
|
92
97
|
// Checked at deploy time. A workflow app declares no providers, so this is the
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* what made it the default.
|
|
28
28
|
*
|
|
29
29
|
* What the page can still say is which key: `useRunKey({ storage: "local" })`
|
|
30
|
-
* for a run meant to outlive the tab (`podcast-digest`), an ACCOUNT's own id
|
|
30
|
+
* for a run meant to outlive the tab (`podcast-digest-workflow`), an ACCOUNT's own id
|
|
31
31
|
* for an app with logins, `recover: false` for a form that must always open
|
|
32
32
|
* empty. `use-run-key.ts` argues what a key may not be — derived from the URL
|
|
33
33
|
* being digested, or carried in a `?key=` parameter.
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
*
|
|
39
39
|
* ## The FORM here is still written by hand, deliberately
|
|
40
40
|
*
|
|
41
|
-
* This is the template that shows the primitives raw. `redline` and
|
|
41
|
+
* This is the template that shows the primitives raw. `document-redline-workflow` and
|
|
42
42
|
* `transcription-workflow` declare their forms — `<Form>` + `<WorkflowFields>`
|
|
43
43
|
* renders one control per scalar the schema declares — and that is what most
|
|
44
44
|
* pages should do. This one writes its single `<input>` itself, so a reader can
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The durable half of the link digest: a workflow body and its steps, and the
|
|
4
4
|
* steps really read the page and really call a model.
|
|
5
5
|
*
|
|
6
|
-
* The rules are the same ones `research-
|
|
6
|
+
* The rules are the same ones `research-handoff-agent/workflows/research.ts` spells out
|
|
7
7
|
* — the body is replayed from the top on every resume, so it holds no live
|
|
8
8
|
* handle and makes no undurable decision, and a step's arguments and return
|
|
9
9
|
* value cross a queue and so must be JSON-shaped and small. Read that file for
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type ToolFailure,
|
|
6
6
|
} from "@alexkroman1/aai";
|
|
7
7
|
import {
|
|
8
|
+
createToolContext,
|
|
8
9
|
expectDeployable,
|
|
9
10
|
expectPromptBuiltinsDeclared,
|
|
10
11
|
toolInputIssues,
|
|
@@ -96,7 +97,7 @@ beforeEach(() => {
|
|
|
96
97
|
label.mockReset();
|
|
97
98
|
});
|
|
98
99
|
|
|
99
|
-
describe("
|
|
100
|
+
describe("medication-safety-agent template", () => {
|
|
100
101
|
test("both tools are discovered from tools/", () => {
|
|
101
102
|
// `agent()` takes no `tools` field: a file in `tools/` IS the tool. A
|
|
102
103
|
// template whose tools are never resolved ships a model with none.
|
|
@@ -297,3 +298,56 @@ describe("fda.ts helpers", () => {
|
|
|
297
298
|
expect(excerptAround("warfarin", "warfarin")).toBe("warfarin");
|
|
298
299
|
});
|
|
299
300
|
});
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* The output guardrail, driven the way the runtime drives it.
|
|
304
|
+
*
|
|
305
|
+
* It is a plain function of the reply text, so a spec can run it with no model,
|
|
306
|
+
* no session and no network — which is most of the reason to write this rule as
|
|
307
|
+
* a declaration rather than as another line in `system-prompt.md`. A prompt rule
|
|
308
|
+
* can only be tested by asking a model and hoping; this one has an answer.
|
|
309
|
+
*
|
|
310
|
+
* `createToolContext()` stands in for the `AgentSessionContext` the runtime
|
|
311
|
+
* passes second. This check reads only the text, but a guardrail that counted
|
|
312
|
+
* strikes in `ctx.slots` would be driven exactly the same way.
|
|
313
|
+
*
|
|
314
|
+
* Asserted on the DEF and not on `expectDeployable`'s config: a guardrail is a
|
|
315
|
+
* function, so nothing about it goes on the wire.
|
|
316
|
+
*/
|
|
317
|
+
describe("the dose guardrail", () => {
|
|
318
|
+
const judge = async (text: string) => {
|
|
319
|
+
const [check] = agentDef.outputGuardrails ?? [];
|
|
320
|
+
// Not a fallback to `true`: a spec whose subject is that a check EXISTS has
|
|
321
|
+
// to fail when it has gone, rather than pass by default.
|
|
322
|
+
if (!check) throw new Error("Dr. Sage declares no output guardrail.");
|
|
323
|
+
return await check(text, createToolContext());
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
test("a reply carrying a dose is never spoken — the caller hears the refusal instead", async () => {
|
|
327
|
+
// A string verdict IS what is said, in place of the reply; there is no
|
|
328
|
+
// rewrite and no second turn. So the claim is about the sentence a caller
|
|
329
|
+
// hears, not about a flag.
|
|
330
|
+
expect(await judge("Take 200 mg of ibuprofen every six hours.")).toContain("pharmacist");
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
test("an answer with no amount in it passes through untouched", async () => {
|
|
334
|
+
expect(await judge("Ibuprofen can upset your stomach — take it with food.")).toBe(true);
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
test("a label QUOTE is refused too, which is the over-block this agent accepts", async () => {
|
|
338
|
+
// `medication_lookup` hands back label text verbatim and label text is full
|
|
339
|
+
// of "200 mg tablets", so this is not a corner case — it is the common one.
|
|
340
|
+
// Over-blocking is the safe direction here: the caller is told to ask a
|
|
341
|
+
// pharmacist, which is the answer the brief wanted anyway.
|
|
342
|
+
expect(await judge("The label says it comes in 200 mg tablets.")).toContain("pharmacist");
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
test("every unit an openFDA label writes doses in is covered", async () => {
|
|
346
|
+
// The pattern is not a dose parser and does not try to be. What it owes is
|
|
347
|
+
// the units that actually appear on a label — a gap here is a dose spoken
|
|
348
|
+
// out loud, which is the one thing this agent must not do.
|
|
349
|
+
const doses = ["500mg", "1.5 mL", "50 mcg", "2 g", "400 IU", "10 units"];
|
|
350
|
+
const verdicts = await Promise.all(doses.map((dose) => judge(`Take ${dose}.`)));
|
|
351
|
+
expect(verdicts.map((verdict) => verdict === true)).toEqual(doses.map(() => false));
|
|
352
|
+
});
|
|
353
|
+
});
|