@sentry/junior 0.313.0 → 0.315.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/dist/{channel-access-mt7K6dPh.js → adapter-context-BlSGE44V.js} +46 -7
- package/dist/{admin-Cyhb4TwZ.js → admin-5jUYY46p.js} +1 -1
- package/dist/agent-runner-C7GNLRB6.js +23438 -0
- package/dist/agent-update-delivery-BNEYQsAf.js +149 -0
- package/dist/api/schema.d.ts +9500 -2
- package/dist/api/schema.js +5 -7
- package/dist/api.d.ts +2 -3
- package/dist/api.js +1172 -371
- package/dist/{app-DA8-hCMj.d.ts → app-D_bAXRDe.d.ts} +312 -48
- package/dist/app.d.ts +2 -2
- package/dist/app.js +305 -184
- package/dist/change-record-Bqsa5ZXE.d.ts +175 -0
- package/dist/chat-core-engine-CxkwRpn9.js +123 -0
- package/dist/child-message--2G3Ft26.js +19 -0
- package/dist/cli/chat.d.ts +4 -1
- package/dist/cli/chat.js +40 -25
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -5
- package/dist/cli/run.d.ts +1 -1
- package/dist/cli/run.js +1 -1
- package/dist/cli/snapshot-create.js +2 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +68 -97
- package/dist/{continue-in-slack-CxyFzdlF.js → continue-in-slack-BGKjIdFp.js} +3 -7
- package/dist/{conversation-feed-BEXLD3Me.js → conversation-feed-Sl8lKKmR.js} +22 -2
- package/dist/{conversation-turn-B35eu0uz.js → conversation-turn-BoLK9i6g.js} +514 -83
- package/dist/create-BOycVH9h.js +213 -0
- package/dist/{credential-sync-DWTOEQrm.js → credential-sync-Mn4OdkEh.js} +10 -18
- package/dist/db-BpxcYXfD.d.ts +2 -0
- package/dist/{credentialed-Dyv8b-lu.js → db-DXTOYRzR.js} +22220 -9334
- package/dist/deployment-CG3TchWh.js +51 -0
- package/dist/direct-url-BYgYfuIy.js +22 -0
- package/dist/engine-context-dyWlfNdD.js +1817 -0
- package/dist/{html-DidUcRhI.js → html-CfXEwl_h.js} +2 -7
- package/dist/instrumentation.js +3 -3
- package/dist/job-runner-CySgpi9v.js +1131 -0
- package/dist/{lineage-BXplQAVH.js → lineage-tRTOcrsL.js} +1 -2
- package/dist/{list-DyIyReSV.js → list-DXBz8SYL.js} +610 -173
- package/dist/local-server-CpnGhYml.js +276 -0
- package/dist/{logging-DNt-qOIO.js → logging-czs0nqLC.js} +2 -45
- package/dist/{turn-membership-DTR3SaKD.js → mailbox-turn-79Nv1JXv.js} +4153 -559
- package/dist/markers-CE0HMXWT.js +67 -0
- package/dist/{media-B0pZJ0bG.js → media-Cr9pGkzr.js} +701 -41
- package/dist/{message-Z5YKC-Af.js → message-BTox2Cmb.js} +25 -36
- package/dist/{model-input-BhPJYdSV.js → model-input-IRGa98V7.js} +3 -3
- package/dist/nitro.d.ts +8 -4
- package/dist/nitro.js +106 -24
- package/dist/{oauth-callback-server-ByvDdcdY.js → oauth-callback-server-NXK7AlBp.js} +2 -2
- package/dist/{oauth-relay-D-kK0yoN.js → oauth-relay-6NBPSpFE.js} +1 -1
- package/dist/{package-discovery-DD9vencX.js → package-discovery-BI6T_RkD.js} +50 -1
- package/dist/parent-result-Dg6P6roR.js +323 -0
- package/dist/people-Cegp1Iwq.js +81 -0
- package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
- package/dist/{conversation-privacy-BrMiDN61.js → proxy-path-Dc-0jXGi.js} +16 -2
- package/dist/{resolve-CWtBNSKP.js → resolve-BUFkmxkT.js} +229 -4
- package/dist/result-DfATzX77.js +337 -0
- package/dist/{runner-CsZ_VRxp.js → runner-CmKP3inb.js} +7 -8
- package/dist/{sandbox-egress-signals-FbCk1FkN.js → sandbox-egress-signals-DYo5BsM7.js} +1 -1
- package/dist/{schema-DojR2uCL.js → schema-DrBMdPmv.js} +197 -20
- package/dist/{service-account-CDYb9hfX.js → service-account-CxTX7nnR.js} +4 -5
- package/dist/{skills-B0jP4whm.js → skills-BlHUDj7k.js} +4 -4
- package/dist/{slack-conversation-unfurl-D26t9kBC.js → slack-conversation-unfurl-Dhe3lB1U.js} +6 -10
- package/dist/{spawn-BjljgExZ.js → spawn-CfvlFdfz.js} +8 -17
- package/dist/start-conversation-Uh8Sk1EF.js +162 -0
- package/dist/system-prompt-table-CDCYVwqN.js +1169 -0
- package/dist/{task-runner--Ke8KSMf.js → task-runner-DcdQJd9e.js} +163 -55
- package/dist/{thread-context-B8exINEe.js → thread-context-DF5uDcWN.js} +7 -9
- package/dist/topic-CRYYBYp-.js +7 -0
- package/dist/transcript-BHhJVY0P.js +410 -0
- package/dist/turn-session-routing-GtetHsdO.js +1309 -0
- package/dist/turn-wake-um5Ubd4m.js +152 -0
- package/dist/user-customization-B27StpVQ.js +9 -0
- package/dist/{validation-Ce0qbMlT.js → validation-CJyuOPD2.js} +1 -1
- package/dist/{version-DFh4n9nr.js → version-Bhe7RPIe.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/virtual-module-BeKA_EII.js +12 -0
- package/dist/{worker-CDg9Lbpg.js → worker-D8PRgUqr.js} +3 -6
- package/migrations/20260711145847_initial/snapshot.json +2103 -0
- package/migrations/20260711145900_conversation_metrics/snapshot.json +135 -0
- package/migrations/20260712153649_conversation_message_search/snapshot.json +50 -0
- package/migrations/20260713040256_peaceful_scalphunter/snapshot.json +42 -0
- package/migrations/20260715174202_useful_magus/snapshot.json +42 -0
- package/migrations/20260715174203_conversation_events/snapshot.json +539 -0
- package/migrations/20260723042835_drop_legacy_conversation_messages/snapshot.json +9 -0
- package/migrations/20260723050612_thick_sugar_man/snapshot.json +120 -0
- package/migrations/20260727223822_sticky_rage/snapshot.json +274 -0
- package/migrations/20260728033158_slippery_harrier/snapshot.json +191 -0
- package/migrations/20260728040836_native_conversation_history/snapshot.json +9 -0
- package/migrations/20260728204900_sour_golden_guardian/snapshot.json +124 -0
- package/migrations/20260730233332_structured_conversation_events/snapshot.json +9 -0
- package/migrations/20260731164038_conversation_session_source/snapshot.json +42 -0
- package/migrations/20260801230336_source_visibility/snapshot.json +9 -0
- package/migrations/20260802023731_magical_ezekiel_stane/snapshot.json +266 -0
- package/migrations/20260804015843_neat_the_anarchist/snapshot.json +714 -0
- package/migrations/20260804165952_drop_paused_scheduled_tasks/snapshot.json +9 -0
- package/migrations/20260804225613_curvy_excalibur/snapshot.json +223 -0
- package/migrations/20260805174033_lowly_valkyrie/snapshot.json +344 -0
- package/migrations/20260805200301_restrict_task_execution_kinds/snapshot.json +36 -0
- package/migrations/20260806030729_first_warhawk/snapshot.json +690 -0
- package/migrations/20260807185200_task_execution_status/snapshot.json +92 -0
- package/migrations/20260808014743_task_title_columns/snapshot.json +68 -0
- package/migrations/20260809220421_misty_typhoid_mary/snapshot.json +191 -0
- package/migrations/20260811193709_mcp_credential_subject/snapshot.json +9 -0
- package/migrations/20260812032924_conversation_event_actor_and_participants/snapshot.json +393 -0
- package/migrations/20260812172418_attachment_storage/snapshot.json +341 -0
- package/migrations/20260813230732_artifacts/snapshot.json +349 -0
- package/migrations/20260814062905_dizzy_barracuda/snapshot.json +342 -0
- package/migrations/20260814231353_drop_workspace_repo_primary/snapshot.json +55 -0
- package/migrations/20260815030100_wild_phantom_reporter/snapshot.json +135 -0
- package/migrations/20260817082233_workspace_snapshots_table/snapshot.json +625 -0
- package/migrations/20260818160339_workspace_snapshot_active_build/snapshot.json +62 -0
- package/migrations/20260821180755_strong_randall/snapshot.json +42 -0
- package/migrations/20260823030308_workspace_snapshot_size_bytes/snapshot.json +62 -0
- package/migrations/20260824190313_complex_rage/snapshot.json +690 -0
- package/migrations/20260827233711_conversation_location/snapshot.json +42 -0
- package/migrations/20260901224306_event_task_status/snapshot.json +100 -0
- package/migrations/20260904153232_attachment_provider/snapshot.json +234 -0
- package/migrations/20260909111415_conversation_briefs/snapshot.json +364 -0
- package/migrations/20260910144928_automation_outcomes_backfill/snapshot.json +9 -0
- package/migrations/20260911184346_conversation_metrics/snapshot.json +226 -0
- package/migrations/20260921140842_scheduled_automation_channel_destinations/snapshot.json +9 -0
- package/migrations/20260922221709_event_automation_channel_destinations/snapshot.json +9 -0
- package/migrations/20261001113455_conversation_forks/snapshot.json +120 -0
- package/migrations/20261005161844_automation_versions/snapshot.json +150 -0
- package/migrations/20261006152043_user_timezone/snapshot.json +37 -0
- package/migrations/20261008200858_user_admin/snapshot.json +37 -0
- package/migrations/20261009145407_event_automation_status_reason/snapshot.json +42 -0
- package/migrations/20261013160816_agent_invocation_parent_mailbox/snapshot.json +93 -0
- package/migrations/20261013215020_agent_invocation_parent_tool_call/snapshot.json +42 -0
- package/migrations/20261014011138_agent_invocation_title/snapshot.json +42 -0
- package/migrations/20261014211942_conversation_stopped_at/snapshot.json +42 -0
- package/migrations/20261015012820_flowery_rage/snapshot.json +42 -0
- package/migrations/20261017000924_automations/snapshot.json +790 -0
- package/migrations/20261017134736_automation_runs/snapshot.json +474 -0
- package/migrations/20261017170250_drop_legacy_automation_tables/snapshot.json +397 -0
- package/migrations/20261018134754_automation_creator_identity/snapshot.json +130 -0
- package/migrations/20261023071954_automation_run_version/snapshot.json +79 -0
- package/migrations/20261025233137_identity_signed_in_at/snapshot.json +42 -0
- package/migrations/20261027234315_workspace_vcpus/snapshot.json +37 -0
- package/migrations/20261028124242_plugin_report_index/snapshot.json +68 -0
- package/migrations/20261028154230_agent_invocation_type/snapshot.json +42 -0
- package/migrations/20261030021803_any_resource_event_triggers/snapshot.json +42 -0
- package/migrations/20261030234309_user_customization/snapshot.json +37 -0
- package/migrations/20261031020656_review_items/snapshot.json +1078 -0
- package/migrations/20261031024151_review_item_dedupe_tenant/snapshot.json +62 -0
- package/migrations/20261031024246_review_item_slack_cards/snapshot.json +159 -0
- package/migrations/20261031155308_system_identity/snapshot.json +9 -0
- package/migrations/20261101193952_review_item_foreign_keys/snapshot.json +108 -0
- package/migrations/20261102172751_review_item_turn/snapshot.json +42 -0
- package/migrations/20261102221411_conversation_read_positions/snapshot.json +190 -0
- package/migrations/20261104085028_conversation_quick_question/snapshot.json +42 -0
- package/migrations/20261104145136_conversation_participant_pins/snapshot.json +42 -0
- package/migrations/20261104164429_conversation_detail_version/snapshot.json +42 -0
- package/migrations/20261104172055_conversation_auto_archive/snapshot.json +206 -0
- package/migrations/20261105005443_drop_agent_invocation_model_profile/snapshot.json +30 -0
- package/migrations/20261105043807_plugin_conversation_index/snapshot.json +76 -0
- package/migrations/20261105051837_conversation_event_author_index/snapshot.json +70 -0
- package/migrations/20261105182854_conversation_event_latest_message_indexes/snapshot.json +136 -0
- package/migrations/20261106011443_conversation_pin_position/snapshot.json +42 -0
- package/migrations/20261106095004_push_notifications/snapshot.json +308 -0
- package/migrations/20261106162740_conversation_kind/snapshot.json +88 -0
- package/migrations/20261107002001_read_position_backfill/snapshot.json +9 -0
- package/migrations/20261107025209_child_archived_at/snapshot.json +42 -0
- package/migrations/20261107035735_shared_archive/snapshot.json +67 -0
- package/migrations/20261107215055_child_location/snapshot.json +9 -0
- package/migrations/20261108191927_conversation_unsubscribe/snapshot.json +42 -0
- package/migrations/20261109021618_conversation_paused_status/snapshot.json +9 -0
- package/migrations/20261109111553_guardian_review_time_index/snapshot.json +54 -0
- package/migrations/20261109173130_conversation_participant_unsubscribed_index/snapshot.json +62 -0
- package/migrations/20261109182006_turn_metric_actor/snapshot.json +128 -0
- package/migrations/20261109202836_participant_root_actor_backfill/snapshot.json +9 -0
- package/migrations/20261109232640_conversation_delivery_paused_at/snapshot.json +42 -0
- package/migrations/20261110120937_web_linked_slack_identity_repair/snapshot.json +9 -0
- package/migrations/20261110175824_automation_task_kind/snapshot.json +145 -0
- package/migrations/20261110210242_conversation_kind_automation/snapshot.json +55 -0
- package/migrations/20261110222632_review_item_plugin_actions/snapshot.json +37 -0
- package/migrations/20261110225157_conversation_last_message_at/snapshot.json +42 -0
- package/migrations/20261111013351_automation_task_kind_repair/snapshot.json +9 -0
- package/migrations/20261111163126_drop_legacy_columns/snapshot.json +9 -0
- package/migrations/20261111170150_code_change_last_activity/snapshot.json +42 -0
- package/migrations/20261111191441_agent_invocation_fork/snapshot.json +42 -0
- package/migrations/20261112142841_code_change_draft/snapshot.json +37 -0
- package/migrations/20261112202901_attachment_uploads/snapshot.json +255 -0
- package/migrations/20261112220407_conversation_agent_config/snapshot.json +42 -0
- package/migrations/20261113081247_attachment_deferred_download/snapshot.json +52 -0
- package/migrations/20261113225551_conversation_embeddings/snapshot.json +203 -0
- package/migrations/20261114213238_user_preferences/snapshot.json +37 -0
- package/migrations/20261114222527_code_change_repository_state_index/snapshot.json +70 -0
- package/migrations/20261115172605_attachment_kinds/snapshot.json +244 -0
- package/migrations/20261115173004_attachment_url_fill/snapshot.json +9 -0
- package/migrations/20261115180216_attachment_url_index/snapshot.json +62 -0
- package/migrations/20261116103700_plan_items/snapshot.json +420 -0
- package/migrations/20261117100100_automation_creator_slack_index/snapshot.json +62 -0
- package/migrations/20261117132522_conversation_event_search/snapshot.json +396 -0
- package/migrations/20261117164007_automation_last_run/snapshot.json +108 -0
- package/migrations/20261117164047_automation_last_run_index/snapshot.json +54 -0
- package/migrations/20261117210444_money_micro_usd/snapshot.json +68 -0
- package/migrations/20261117210505_conversation_cost_micro_usd/snapshot.json +9 -0
- package/migrations/20261118081416_people_list_metric_index/snapshot.json +86 -0
- package/migrations/20261118095216_automation_rollout_repair/snapshot.json +9 -0
- package/migrations/20261118143948_cache_warming_history_reset/snapshot.json +9 -0
- package/migrations/20261119040651_artifact_visibility/snapshot.json +132 -0
- package/migrations/20261119040715_artifact_public_sha_index/snapshot.json +9 -0
- package/migrations/20261119052706_artifact_drop_public/snapshot.json +71 -0
- package/migrations/20261119053831_artifact_path/snapshot.json +114 -0
- package/migrations/20261119053844_artifact_path_index/snapshot.json +9 -0
- package/migrations/20261119091949_review_item_answered_index/snapshot.json +70 -0
- package/migrations/20261119100029_review_item_status_index/snapshot.json +54 -0
- package/migrations/20261119165607_brief_outcome_status/snapshot.json +42 -0
- package/migrations/20261119165622_brief_outcome_status_backfill/snapshot.json +9 -0
- package/migrations/20261119213716_brief_created_at_index/snapshot.json +62 -0
- package/migrations/20261119222456_slack_person_search_index/snapshot.json +50 -0
- package/migrations/20261119225522_code_change_size/snapshot.json +104 -0
- package/migrations/20261119232253_merge_conflict_notice_dismiss/snapshot.json +9 -0
- package/migrations/20261119235649_inbox_snoozes/snapshot.json +605 -0
- package/migrations/20261120093118_code_change_search_index/snapshot.json +89 -0
- package/migrations/20261120093452_review_item_owner/snapshot.json +314 -0
- package/migrations/20261120185654_review_item_owner_index/snapshot.json +62 -0
- package/migrations/20261120185754_memory_core_adoption/snapshot.json +1184 -0
- package/migrations/20261120185854_memory_core_indexes/snapshot.json +70 -0
- package/migrations/20261120235226_todos/snapshot.json +473 -0
- package/migrations/20261121082316_inbox_items/snapshot.json +2026 -0
- package/migrations/20261121175651_todo_changed_by_agent/snapshot.json +42 -0
- package/migrations/20261121183527_inbox_item_subject_title_parts/snapshot.json +42 -0
- package/migrations/20261121194143_inbox_snooze_wake_reason/snapshot.json +42 -0
- package/migrations/20261121222400_authorization_request_index/snapshot.json +62 -0
- package/migrations/20261121225908_conversation_metadata/snapshot.json +184 -0
- package/migrations/20261121225910_conversation_metadata_fill/snapshot.json +9 -0
- package/migrations/20261121225913_conversation_search_index/snapshot.json +50 -0
- package/migrations/20261122022900_inbox_item_legacy_automation_keys/snapshot.json +9 -0
- package/migrations/20261122024454_artifact_expiry/snapshot.json +37 -0
- package/migrations/20261122024455_artifact_permanent_sha_index/snapshot.json +62 -0
- package/migrations/20261122024457_artifact_drop_public_sha_index/snapshot.json +37 -0
- package/migrations/20261122024458_conversation_kind_lead/snapshot.json +55 -0
- package/migrations/20261122024459_conversation_lead_actor_index/snapshot.json +54 -0
- package/migrations/20261122071549_keep_legacy_archive_columns/snapshot.json +49 -0
- package/migrations/20261122191400_conversation_embeddings_fk_validate/snapshot.json +9 -0
- package/migrations/20261122204325_money_micro_usd_repair/migration.sql +99 -0
- package/migrations/20261122204325_money_micro_usd_repair/snapshot.json +9 -0
- package/migrations/20261122204326_agent_config_backfill/migration.sql +34 -0
- package/migrations/20261122204326_agent_config_backfill/snapshot.json +143 -0
- package/migrations/20261122221456_inbox_item_deliveries/migration.sql +15 -0
- package/migrations/20261122221456_inbox_item_deliveries/snapshot.json +301 -0
- package/migrations/20261123155735_pg_trgm/migration.sql +2 -0
- package/migrations/20261123155735_pg_trgm/snapshot.json +9 -0
- package/migrations/20261123155739_search_indexes/migration.sql +4 -0
- package/migrations/20261123155739_search_indexes/snapshot.json +167 -0
- package/migrations/20261123172647_drop_legacy_archive_columns/migration.sql +4 -0
- package/migrations/20261123172647_drop_legacy_archive_columns/snapshot.json +9 -0
- package/migrations/20261123192506_memory_prefix_index/migration.sql +1 -0
- package/migrations/20261123192506_memory_prefix_index/snapshot.json +69 -0
- package/migrations/20261123201740_todo_search_indexes/migration.sql +2 -0
- package/migrations/20261123201740_todo_search_indexes/snapshot.json +89 -0
- package/migrations/20261123211505_todo_inbox_items/migration.sql +4 -0
- package/migrations/20261123211505_todo_inbox_items/snapshot.json +38 -0
- package/migrations/20261123214917_drop_code_urls/migration.sql +2 -0
- package/migrations/20261123214917_drop_code_urls/snapshot.json +44 -0
- package/migrations/20261123224000_code_change_conversations_index/migration.sql +1 -0
- package/migrations/20261123224000_code_change_conversations_index/snapshot.json +54 -0
- package/migrations/20261124122023_drop_code_change_sizes/migration.sql +4 -0
- package/migrations/20261124122023_drop_code_change_sizes/snapshot.json +82 -0
- package/migrations/20261124142958_conversation_root_lookup_index/migration.sql +1 -0
- package/migrations/20261124142958_conversation_root_lookup_index/snapshot.json +62 -0
- package/migrations/20261124183352_legacy_brief_metadata_fill/migration.sql +26 -0
- package/migrations/20261124183352_legacy_brief_metadata_fill/snapshot.json +114 -0
- package/migrations/20261124202143_drizzle_v1_baseline/migration.sql +5 -0
- package/migrations/20261124202143_drizzle_v1_baseline/snapshot.json +2012 -0
- package/migrations/20261124221751_spaces/migration.sql +22 -0
- package/migrations/20261124221751_spaces/snapshot.json +436 -0
- package/migrations/20261124230319_conversation_metrics_utc_day_stats/migration.sql +11 -0
- package/migrations/20261124230319_conversation_metrics_utc_day_stats/snapshot.json +9 -0
- package/migrations/20261124234024_space_conversations/migration.sql +5 -0
- package/migrations/20261124234024_space_conversations/snapshot.json +103 -0
- package/migrations/20261124234026_space_conversations_index/migration.sql +1 -0
- package/migrations/20261124234026_space_conversations_index/snapshot.json +62 -0
- package/migrations/20261125012448_drop_lead_actor_index/migration.sql +3 -0
- package/migrations/20261125012448_drop_lead_actor_index/snapshot.json +36 -0
- package/migrations/20261125012452_space_lead_index/migration.sql +1 -0
- package/migrations/20261125012452_space_lead_index/snapshot.json +54 -0
- package/migrations/20261125043821_space_configurations/migration.sql +11 -0
- package/migrations/20261125043821_space_configurations/snapshot.json +194 -0
- package/migrations/20261125064854_agent_update_done_status/migration.sql +9 -0
- package/migrations/20261125064854_agent_update_done_status/snapshot.json +9 -0
- package/migrations/20261125073321_turn_engine_tables/migration.sql +75 -0
- package/migrations/20261125073321_turn_engine_tables/snapshot.json +1497 -0
- package/migrations/20261125073339_turn_inbox_one_source/migration.sql +5 -0
- package/migrations/20261125073339_turn_inbox_one_source/snapshot.json +9 -0
- package/migrations/20261125124506_versions_notify/migration.sql +27 -0
- package/migrations/20261125124506_versions_notify/snapshot.json +9 -0
- package/migrations/20261125140339_turn_group_key/migration.sql +14 -0
- package/migrations/20261125140339_turn_group_key/snapshot.json +75 -0
- package/migrations/20261125140343_turn_group_key_not_null/migration.sql +4 -0
- package/migrations/20261125140343_turn_group_key_not_null/snapshot.json +29 -0
- package/migrations/20261125142845_code_change_requesters/migration.sql +1 -0
- package/migrations/20261125142845_code_change_requesters/snapshot.json +42 -0
- package/migrations/20261125142846_code_change_requesters_index/migration.sql +1 -0
- package/migrations/20261125142846_code_change_requesters_index/snapshot.json +54 -0
- package/migrations/20261125143903_space_visibility/migration.sql +1 -0
- package/migrations/20261125143903_space_visibility/snapshot.json +37 -0
- package/migrations/20261125154848_merge_leaves/migration.sql +2 -0
- package/migrations/20261125154848_merge_leaves/snapshot.json +14 -0
- package/package.json +17 -25
- package/skills/design-automation-skill/SKILL.md +3 -4
- package/dist/actor-BsBdxDXQ.js +0 -208
- package/dist/adapter-CYAvJzZS.js +0 -259
- package/dist/adapter-context-CVsHoVSf.js +0 -43
- package/dist/agent-runner-B5y9MsT-.js +0 -11295
- package/dist/background-compaction-queue-iZXadLV3.js +0 -206
- package/dist/catalog-runtime-kkE3hvCX.js +0 -6
- package/dist/config-CWbwKj0j.js +0 -2331
- package/dist/db-DYGcXYl3.d.ts +0 -274
- package/dist/db-PwSRzWWn.js +0 -3607
- package/dist/executor-CgWyWfYz.js +0 -1858
- package/dist/fan-out-Cod-yEHG.js +0 -10
- package/dist/history-CYstOMKX.js +0 -577
- package/dist/ingest-B0AggUEC.js +0 -7931
- package/dist/install-2urLLXNt.js +0 -228
- package/dist/proxy-path-BHYoKZdq.js +0 -15
- package/dist/registry-POH4bZC4.js +0 -1686
- package/dist/request-deadline-BUiRYQYj.js +0 -24
- package/dist/rule-DAxQY-1h.js +0 -20
- package/dist/schema-DBf18QPS.d.ts +0 -9339
- package/dist/service-account-o15pZWcJ.js +0 -931
- package/dist/start-conversation-DbVujrwO.js +0 -755
- package/dist/state-BTawTCme.js +0 -161
- package/dist/statuses-BKwqCPhj.js +0 -69
- package/dist/store-CjXrp-Up.js +0 -492
- package/dist/task-queue-Cwlatjz3.js +0 -90
- package/dist/vercel-queue-q4z8w5QO.js +0 -349
- package/dist/warmup-D5hzqTcp.js +0 -12257
- package/migrations/meta/0000_snapshot.json +0 -946
- package/migrations/meta/0001_snapshot.json +0 -972
- package/migrations/meta/0002_snapshot.json +0 -987
- package/migrations/meta/0003_snapshot.json +0 -1035
- package/migrations/meta/0004_snapshot.json +0 -1041
- package/migrations/meta/0005_snapshot.json +0 -948
- package/migrations/meta/0006_snapshot.json +0 -948
- package/migrations/meta/0007_snapshot.json +0 -1013
- package/migrations/meta/0008_snapshot.json +0 -1076
- package/migrations/meta/0009_snapshot.json +0 -1146
- package/migrations/meta/0010_snapshot.json +0 -1190
- package/migrations/meta/0011_snapshot.json +0 -1195
- package/migrations/meta/0012_snapshot.json +0 -1244
- package/migrations/meta/0013_snapshot.json +0 -1250
- package/migrations/meta/0014_snapshot.json +0 -1201
- package/migrations/meta/0015_snapshot.json +0 -1360
- package/migrations/meta/0016_snapshot.json +0 -1617
- package/migrations/meta/0017_snapshot.json +0 -1666
- package/migrations/meta/0018_snapshot.json +0 -1756
- package/migrations/meta/0019_snapshot.json +0 -1904
- package/migrations/meta/0020_snapshot.json +0 -1848
- package/migrations/meta/0021_snapshot.json +0 -2176
- package/migrations/meta/0022_snapshot.json +0 -2186
- package/migrations/meta/0023_snapshot.json +0 -2198
- package/migrations/meta/0024_snapshot.json +0 -2275
- package/migrations/meta/0025_snapshot.json +0 -2275
- package/migrations/meta/0026_snapshot.json +0 -2424
- package/migrations/meta/0027_snapshot.json +0 -2554
- package/migrations/meta/0028_snapshot.json +0 -2685
- package/migrations/meta/0029_snapshot.json +0 -2709
- package/migrations/meta/0030_snapshot.json +0 -2799
- package/migrations/meta/0031_snapshot.json +0 -2823
- package/migrations/meta/0032_snapshot.json +0 -2892
- package/migrations/meta/0033_snapshot.json +0 -2914
- package/migrations/meta/0034_snapshot.json +0 -3038
- package/migrations/meta/0035_snapshot.json +0 -3048
- package/migrations/meta/0036_snapshot.json +0 -3186
- package/migrations/meta/0037_snapshot.json +0 -3192
- package/migrations/meta/0038_snapshot.json +0 -3323
- package/migrations/meta/0039_snapshot.json +0 -3368
- package/migrations/meta/0040_snapshot.json +0 -3516
- package/migrations/meta/0041_snapshot.json +0 -3516
- package/migrations/meta/0042_snapshot.json +0 -3610
- package/migrations/meta/0043_snapshot.json +0 -3610
- package/migrations/meta/0044_snapshot.json +0 -3473
- package/migrations/meta/0045_snapshot.json +0 -3503
- package/migrations/meta/0046_snapshot.json +0 -3707
- package/migrations/meta/0047_snapshot.json +0 -3713
- package/migrations/meta/0048_snapshot.json +0 -3720
- package/migrations/meta/0049_snapshot.json +0 -3581
- package/migrations/meta/0050_snapshot.json +0 -3753
- package/migrations/meta/0051_snapshot.json +0 -3759
- package/migrations/meta/0052_snapshot.json +0 -3765
- package/migrations/meta/0053_snapshot.json +0 -3771
- package/migrations/meta/0054_snapshot.json +0 -3777
- package/migrations/meta/0055_snapshot.json +0 -3948
- package/migrations/meta/0056_snapshot.json +0 -4280
- package/migrations/meta/0057_snapshot.json +0 -3618
- package/migrations/meta/0058_snapshot.json +0 -3598
- package/migrations/meta/0059_snapshot.json +0 -3619
- package/migrations/meta/0060_snapshot.json +0 -3465
- package/migrations/meta/0061_snapshot.json +0 -3471
- package/migrations/meta/0062_snapshot.json +0 -3499
- package/migrations/meta/0063_snapshot.json +0 -3505
- package/migrations/meta/0064_snapshot.json +0 -3505
- package/migrations/meta/0065_snapshot.json +0 -3511
- package/migrations/meta/0066_snapshot.json +0 -4099
- package/migrations/meta/0067_snapshot.json +0 -3921
- package/migrations/meta/0068_snapshot.json +0 -4176
- package/migrations/meta/0069_snapshot.json +0 -3979
- package/migrations/meta/0070_snapshot.json +0 -3997
- package/migrations/meta/0071_snapshot.json +0 -4003
- package/migrations/meta/0072_snapshot.json +0 -4064
- package/migrations/meta/0073_snapshot.json +0 -4070
- package/migrations/meta/0074_snapshot.json +0 -4076
- package/migrations/meta/0075_snapshot.json +0 -4083
- package/migrations/meta/0076_snapshot.json +0 -4147
- package/migrations/meta/0077_snapshot.json +0 -4141
- package/migrations/meta/0078_snapshot.json +0 -4175
- package/migrations/meta/0079_snapshot.json +0 -4203
- package/migrations/meta/0080_snapshot.json +0 -4265
- package/migrations/meta/0081_snapshot.json +0 -4271
- package/migrations/meta/0082_snapshot.json +0 -4373
- package/migrations/meta/0083_snapshot.json +0 -4388
- package/migrations/meta/0084_snapshot.json +0 -4388
- package/migrations/meta/0085_snapshot.json +0 -4394
- package/migrations/meta/0086_snapshot.json +0 -4366
- package/migrations/meta/0087_snapshot.json +0 -4366
- package/migrations/meta/0088_snapshot.json +0 -4372
- package/migrations/meta/0089_snapshot.json +0 -4372
- package/migrations/meta/0090_snapshot.json +0 -4388
- package/migrations/meta/0091_snapshot.json +0 -4410
- package/migrations/meta/0092_snapshot.json +0 -4446
- package/migrations/meta/0093_snapshot.json +0 -4446
- package/migrations/meta/0094_snapshot.json +0 -4452
- package/migrations/meta/0095_snapshot.json +0 -4452
- package/migrations/meta/0096_snapshot.json +0 -4490
- package/migrations/meta/0097_snapshot.json +0 -4490
- package/migrations/meta/0098_snapshot.json +0 -4490
- package/migrations/meta/0099_snapshot.json +0 -4496
- package/migrations/meta/0100_snapshot.json +0 -4496
- package/migrations/meta/0101_snapshot.json +0 -4496
- package/migrations/meta/0102_snapshot.json +0 -4502
- package/migrations/meta/0103_snapshot.json +0 -4509
- package/migrations/meta/0104_snapshot.json +0 -4516
- package/migrations/meta/0105_snapshot.json +0 -4611
- package/migrations/meta/0106_snapshot.json +0 -4617
- package/migrations/meta/0107_snapshot.json +0 -4617
- package/migrations/meta/0108_snapshot.json +0 -4688
- package/migrations/meta/0109_snapshot.json +0 -4925
- package/migrations/meta/0110_snapshot.json +0 -4952
- package/migrations/meta/0111_snapshot.json +0 -5011
- package/migrations/meta/0112_snapshot.json +0 -5011
- package/migrations/meta/0113_snapshot.json +0 -5033
- package/migrations/meta/0114_snapshot.json +0 -5203
- package/migrations/meta/0115_snapshot.json +0 -5225
- package/migrations/meta/0116_snapshot.json +0 -5388
- package/migrations/meta/0117_snapshot.json +0 -5413
- package/migrations/meta/0118_snapshot.json +0 -5428
- package/migrations/meta/0119_snapshot.json +0 -5441
- package/migrations/meta/0120_snapshot.json +0 -5441
- package/migrations/meta/0121_snapshot.json +0 -5481
- package/migrations/meta/0122_snapshot.json +0 -5481
- package/migrations/meta/0123_snapshot.json +0 -5481
- package/migrations/meta/0124_snapshot.json +0 -5516
- package/migrations/meta/0125_snapshot.json +0 -5516
- package/migrations/meta/0126_snapshot.json +0 -5488
- package/migrations/meta/0127_snapshot.json +0 -5519
- package/migrations/meta/0128_snapshot.json +0 -5519
- package/migrations/meta/0129_snapshot.json +0 -5547
- package/migrations/meta/0130_snapshot.json +0 -5563
- package/migrations/meta/0131_snapshot.json +0 -5569
- package/migrations/meta/0132_snapshot.json +0 -5569
- package/migrations/meta/0133_snapshot.json +0 -5590
- package/migrations/meta/0134_snapshot.json +0 -5606
- package/migrations/meta/0135_snapshot.json +0 -5624
- package/migrations/meta/0136_snapshot.json +0 -5624
- package/migrations/meta/0137_snapshot.json +0 -5864
- package/migrations/meta/0138_snapshot.json +0 -5894
- package/migrations/meta/0139_snapshot.json +0 -5898
- package/migrations/meta/0140_snapshot.json +0 -5919
- package/migrations/meta/0141_snapshot.json +0 -6429
- package/migrations/meta/0142_snapshot.json +0 -6457
- package/migrations/meta/0143_snapshot.json +0 -6434
- package/migrations/meta/0144_snapshot.json +0 -6434
- package/migrations/meta/0145_snapshot.json +0 -6440
- package/migrations/meta/0146_snapshot.json +0 -6446
- package/migrations/meta/0147_snapshot.json +0 -6452
- package/migrations/meta/0148_snapshot.json +0 -6474
- package/migrations/meta/0149_snapshot.json +0 -6490
- package/migrations/meta/0150_snapshot.json +0 -6490
- package/migrations/meta/0151_snapshot.json +0 -6505
- package/migrations/meta/0152_snapshot.json +0 -6505
- package/migrations/meta/0153_snapshot.json +0 -6511
- package/migrations/meta/0154_snapshot.json +0 -6533
- package/migrations/meta/0155_snapshot.json +0 -6511
- package/migrations/meta/0156_snapshot.json +0 -6511
- package/migrations/meta/0157_snapshot.json +0 -6527
- package/migrations/meta/0158_snapshot.json +0 -6515
- package/migrations/meta/0159_snapshot.json +0 -6515
- package/migrations/meta/_journal.json +0 -1126
- /package/migrations/{0000_initial.sql → 20260711145847_initial/migration.sql} +0 -0
- /package/migrations/{0001_conversation_metrics.sql → 20260711145900_conversation_metrics/migration.sql} +0 -0
- /package/migrations/{0002_conversation_message_search.sql → 20260712153649_conversation_message_search/migration.sql} +0 -0
- /package/migrations/{0003_peaceful_scalphunter.sql → 20260713040256_peaceful_scalphunter/migration.sql} +0 -0
- /package/migrations/{0004_useful_magus.sql → 20260715174202_useful_magus/migration.sql} +0 -0
- /package/migrations/{0005_conversation_events.sql → 20260715174203_conversation_events/migration.sql} +0 -0
- /package/migrations/{0006_drop_legacy_conversation_messages.sql → 20260723042835_drop_legacy_conversation_messages/migration.sql} +0 -0
- /package/migrations/{0007_thick_sugar_man.sql → 20260723050612_thick_sugar_man/migration.sql} +0 -0
- /package/migrations/{0008_sticky_rage.sql → 20260727223822_sticky_rage/migration.sql} +0 -0
- /package/migrations/{0009_slippery_harrier.sql → 20260728033158_slippery_harrier/migration.sql} +0 -0
- /package/migrations/{0010_native_conversation_history.sql → 20260728040836_native_conversation_history/migration.sql} +0 -0
- /package/migrations/{0011_sour_golden_guardian.sql → 20260728204900_sour_golden_guardian/migration.sql} +0 -0
- /package/migrations/{0012_structured_conversation_events.sql → 20260730233332_structured_conversation_events/migration.sql} +0 -0
- /package/migrations/{0013_conversation_session_source.sql → 20260731164038_conversation_session_source/migration.sql} +0 -0
- /package/migrations/{0014_source_visibility.sql → 20260801230336_source_visibility/migration.sql} +0 -0
- /package/migrations/{0015_magical_ezekiel_stane.sql → 20260802023731_magical_ezekiel_stane/migration.sql} +0 -0
- /package/migrations/{0016_neat_the_anarchist.sql → 20260804015843_neat_the_anarchist/migration.sql} +0 -0
- /package/migrations/{0017_drop_paused_scheduled_tasks.sql → 20260804165952_drop_paused_scheduled_tasks/migration.sql} +0 -0
- /package/migrations/{0018_curvy_excalibur.sql → 20260804225613_curvy_excalibur/migration.sql} +0 -0
- /package/migrations/{0019_lowly_valkyrie.sql → 20260805174033_lowly_valkyrie/migration.sql} +0 -0
- /package/migrations/{0020_restrict_task_execution_kinds.sql → 20260805200301_restrict_task_execution_kinds/migration.sql} +0 -0
- /package/migrations/{0021_first_warhawk.sql → 20260806030729_first_warhawk/migration.sql} +0 -0
- /package/migrations/{0022_task_execution_status.sql → 20260807185200_task_execution_status/migration.sql} +0 -0
- /package/migrations/{0023_task_title_columns.sql → 20260808014743_task_title_columns/migration.sql} +0 -0
- /package/migrations/{0024_misty_typhoid_mary.sql → 20260809220421_misty_typhoid_mary/migration.sql} +0 -0
- /package/migrations/{0025_mcp_credential_subject.sql → 20260811193709_mcp_credential_subject/migration.sql} +0 -0
- /package/migrations/{0026_conversation_event_actor_and_participants.sql → 20260812032924_conversation_event_actor_and_participants/migration.sql} +0 -0
- /package/migrations/{0027_attachment_storage.sql → 20260812172418_attachment_storage/migration.sql} +0 -0
- /package/migrations/{0028_artifacts.sql → 20260813230732_artifacts/migration.sql} +0 -0
- /package/migrations/{0029_dizzy_barracuda.sql → 20260814062905_dizzy_barracuda/migration.sql} +0 -0
- /package/migrations/{0030_drop_workspace_repo_primary.sql → 20260814231353_drop_workspace_repo_primary/migration.sql} +0 -0
- /package/migrations/{0031_wild_phantom_reporter.sql → 20260815030100_wild_phantom_reporter/migration.sql} +0 -0
- /package/migrations/{0032_workspace_snapshots_table.sql → 20260817082233_workspace_snapshots_table/migration.sql} +0 -0
- /package/migrations/{0033_workspace_snapshot_active_build.sql → 20260818160339_workspace_snapshot_active_build/migration.sql} +0 -0
- /package/migrations/{0034_strong_randall.sql → 20260821180755_strong_randall/migration.sql} +0 -0
- /package/migrations/{0035_workspace_snapshot_size_bytes.sql → 20260823030308_workspace_snapshot_size_bytes/migration.sql} +0 -0
- /package/migrations/{0036_complex_rage.sql → 20260824190313_complex_rage/migration.sql} +0 -0
- /package/migrations/{0037_conversation_location.sql → 20260827233711_conversation_location/migration.sql} +0 -0
- /package/migrations/{0038_event_task_status.sql → 20260901224306_event_task_status/migration.sql} +0 -0
- /package/migrations/{0039_attachment_provider.sql → 20260904153232_attachment_provider/migration.sql} +0 -0
- /package/migrations/{0040_conversation_briefs.sql → 20260909111415_conversation_briefs/migration.sql} +0 -0
- /package/migrations/{0041_automation_outcomes_backfill.sql → 20260910144928_automation_outcomes_backfill/migration.sql} +0 -0
- /package/migrations/{0042_conversation_metrics.sql → 20260911184346_conversation_metrics/migration.sql} +0 -0
- /package/migrations/{0043_scheduled_automation_channel_destinations.sql → 20260921140842_scheduled_automation_channel_destinations/migration.sql} +0 -0
- /package/migrations/{0044_event_automation_channel_destinations.sql → 20260922221709_event_automation_channel_destinations/migration.sql} +0 -0
- /package/migrations/{0045_conversation_forks.sql → 20261001113455_conversation_forks/migration.sql} +0 -0
- /package/migrations/{0046_automation_versions.sql → 20261005161844_automation_versions/migration.sql} +0 -0
- /package/migrations/{0047_user_timezone.sql → 20261006152043_user_timezone/migration.sql} +0 -0
- /package/migrations/{0048_user_admin.sql → 20261008200858_user_admin/migration.sql} +0 -0
- /package/migrations/{0049_event_automation_status_reason.sql → 20261009145407_event_automation_status_reason/migration.sql} +0 -0
- /package/migrations/{0050_agent_invocation_parent_mailbox.sql → 20261013160816_agent_invocation_parent_mailbox/migration.sql} +0 -0
- /package/migrations/{0051_agent_invocation_parent_tool_call.sql → 20261013215020_agent_invocation_parent_tool_call/migration.sql} +0 -0
- /package/migrations/{0052_agent_invocation_title.sql → 20261014011138_agent_invocation_title/migration.sql} +0 -0
- /package/migrations/{0053_conversation_stopped_at.sql → 20261014211942_conversation_stopped_at/migration.sql} +0 -0
- /package/migrations/{0054_flowery_rage.sql → 20261015012820_flowery_rage/migration.sql} +0 -0
- /package/migrations/{0055_automations.sql → 20261017000924_automations/migration.sql} +0 -0
- /package/migrations/{0056_automation_runs.sql → 20261017134736_automation_runs/migration.sql} +0 -0
- /package/migrations/{0057_drop_legacy_automation_tables.sql → 20261017170250_drop_legacy_automation_tables/migration.sql} +0 -0
- /package/migrations/{0058_automation_creator_identity.sql → 20261018134754_automation_creator_identity/migration.sql} +0 -0
- /package/migrations/{0059_automation_run_version.sql → 20261023071954_automation_run_version/migration.sql} +0 -0
- /package/migrations/{0060_identity_signed_in_at.sql → 20261025233137_identity_signed_in_at/migration.sql} +0 -0
- /package/migrations/{0061_workspace_vcpus.sql → 20261027234315_workspace_vcpus/migration.sql} +0 -0
- /package/migrations/{0062_plugin_report_index.sql → 20261028124242_plugin_report_index/migration.sql} +0 -0
- /package/migrations/{0063_agent_invocation_type.sql → 20261028154230_agent_invocation_type/migration.sql} +0 -0
- /package/migrations/{0064_any_resource_event_triggers.sql → 20261030021803_any_resource_event_triggers/migration.sql} +0 -0
- /package/migrations/{0065_user_customization.sql → 20261030234309_user_customization/migration.sql} +0 -0
- /package/migrations/{0066_review_items.sql → 20261031020656_review_items/migration.sql} +0 -0
- /package/migrations/{0067_review_item_dedupe_tenant.sql → 20261031024151_review_item_dedupe_tenant/migration.sql} +0 -0
- /package/migrations/{0068_review_item_slack_cards.sql → 20261031024246_review_item_slack_cards/migration.sql} +0 -0
- /package/migrations/{0069_system_identity.sql → 20261031155308_system_identity/migration.sql} +0 -0
- /package/migrations/{0070_review_item_foreign_keys.sql → 20261101193952_review_item_foreign_keys/migration.sql} +0 -0
- /package/migrations/{0071_review_item_turn.sql → 20261102172751_review_item_turn/migration.sql} +0 -0
- /package/migrations/{0072_conversation_read_positions.sql → 20261102221411_conversation_read_positions/migration.sql} +0 -0
- /package/migrations/{0073_conversation_quick_question.sql → 20261104085028_conversation_quick_question/migration.sql} +0 -0
- /package/migrations/{0074_conversation_participant_pins.sql → 20261104145136_conversation_participant_pins/migration.sql} +0 -0
- /package/migrations/{0075_conversation_detail_version.sql → 20261104164429_conversation_detail_version/migration.sql} +0 -0
- /package/migrations/{0076_conversation_auto_archive.sql → 20261104172055_conversation_auto_archive/migration.sql} +0 -0
- /package/migrations/{0077_drop_agent_invocation_model_profile.sql → 20261105005443_drop_agent_invocation_model_profile/migration.sql} +0 -0
- /package/migrations/{0078_plugin_conversation_index.sql → 20261105043807_plugin_conversation_index/migration.sql} +0 -0
- /package/migrations/{0079_conversation_event_author_index.sql → 20261105051837_conversation_event_author_index/migration.sql} +0 -0
- /package/migrations/{0080_conversation_event_latest_message_indexes.sql → 20261105182854_conversation_event_latest_message_indexes/migration.sql} +0 -0
- /package/migrations/{0081_conversation_pin_position.sql → 20261106011443_conversation_pin_position/migration.sql} +0 -0
- /package/migrations/{0082_push_notifications.sql → 20261106095004_push_notifications/migration.sql} +0 -0
- /package/migrations/{0083_conversation_kind.sql → 20261106162740_conversation_kind/migration.sql} +0 -0
- /package/migrations/{0084_read_position_backfill.sql → 20261107002001_read_position_backfill/migration.sql} +0 -0
- /package/migrations/{0085_child_archived_at.sql → 20261107025209_child_archived_at/migration.sql} +0 -0
- /package/migrations/{0086_shared_archive.sql → 20261107035735_shared_archive/migration.sql} +0 -0
- /package/migrations/{0087_child_location.sql → 20261107215055_child_location/migration.sql} +0 -0
- /package/migrations/{0088_conversation_unsubscribe.sql → 20261108191927_conversation_unsubscribe/migration.sql} +0 -0
- /package/migrations/{0089_conversation_paused_status.sql → 20261109021618_conversation_paused_status/migration.sql} +0 -0
- /package/migrations/{0090_guardian_review_time_index.sql → 20261109111553_guardian_review_time_index/migration.sql} +0 -0
- /package/migrations/{0091_conversation_participant_unsubscribed_index.sql → 20261109173130_conversation_participant_unsubscribed_index/migration.sql} +0 -0
- /package/migrations/{0092_turn_metric_actor.sql → 20261109182006_turn_metric_actor/migration.sql} +0 -0
- /package/migrations/{0093_participant_root_actor_backfill.sql → 20261109202836_participant_root_actor_backfill/migration.sql} +0 -0
- /package/migrations/{0094_conversation_delivery_paused_at.sql → 20261109232640_conversation_delivery_paused_at/migration.sql} +0 -0
- /package/migrations/{0095_web_linked_slack_identity_repair.sql → 20261110120937_web_linked_slack_identity_repair/migration.sql} +0 -0
- /package/migrations/{0096_automation_task_kind.sql → 20261110175824_automation_task_kind/migration.sql} +0 -0
- /package/migrations/{0097_conversation_kind_automation.sql → 20261110210242_conversation_kind_automation/migration.sql} +0 -0
- /package/migrations/{0098_review_item_plugin_actions.sql → 20261110222632_review_item_plugin_actions/migration.sql} +0 -0
- /package/migrations/{0099_conversation_last_message_at.sql → 20261110225157_conversation_last_message_at/migration.sql} +0 -0
- /package/migrations/{0100_automation_task_kind_repair.sql → 20261111013351_automation_task_kind_repair/migration.sql} +0 -0
- /package/migrations/{0101_drop_legacy_columns.sql → 20261111163126_drop_legacy_columns/migration.sql} +0 -0
- /package/migrations/{0102_code_change_last_activity.sql → 20261111170150_code_change_last_activity/migration.sql} +0 -0
- /package/migrations/{0103_agent_invocation_fork.sql → 20261111191441_agent_invocation_fork/migration.sql} +0 -0
- /package/migrations/{0104_code_change_draft.sql → 20261112142841_code_change_draft/migration.sql} +0 -0
- /package/migrations/{0105_attachment_uploads.sql → 20261112202901_attachment_uploads/migration.sql} +0 -0
- /package/migrations/{0106_conversation_agent_config.sql → 20261112220407_conversation_agent_config/migration.sql} +0 -0
- /package/migrations/{0107_attachment_deferred_download.sql → 20261113081247_attachment_deferred_download/migration.sql} +0 -0
- /package/migrations/{0108_conversation_embeddings.sql → 20261113225551_conversation_embeddings/migration.sql} +0 -0
- /package/migrations/{0109_user_preferences.sql → 20261114213238_user_preferences/migration.sql} +0 -0
- /package/migrations/{0110_code_change_repository_state_index.sql → 20261114222527_code_change_repository_state_index/migration.sql} +0 -0
- /package/migrations/{0111_attachment_kinds.sql → 20261115172605_attachment_kinds/migration.sql} +0 -0
- /package/migrations/{0112_attachment_url_fill.sql → 20261115173004_attachment_url_fill/migration.sql} +0 -0
- /package/migrations/{0113_attachment_url_index.sql → 20261115180216_attachment_url_index/migration.sql} +0 -0
- /package/migrations/{0114_plan_items.sql → 20261116103700_plan_items/migration.sql} +0 -0
- /package/migrations/{0115_automation_creator_slack_index.sql → 20261117100100_automation_creator_slack_index/migration.sql} +0 -0
- /package/migrations/{0116_conversation_event_search.sql → 20261117132522_conversation_event_search/migration.sql} +0 -0
- /package/migrations/{0117_automation_last_run.sql → 20261117164007_automation_last_run/migration.sql} +0 -0
- /package/migrations/{0118_automation_last_run_index.sql → 20261117164047_automation_last_run_index/migration.sql} +0 -0
- /package/migrations/{0119_money_micro_usd.sql → 20261117210444_money_micro_usd/migration.sql} +0 -0
- /package/migrations/{0120_conversation_cost_micro_usd.sql → 20261117210505_conversation_cost_micro_usd/migration.sql} +0 -0
- /package/migrations/{0121_people_list_metric_index.sql → 20261118081416_people_list_metric_index/migration.sql} +0 -0
- /package/migrations/{0122_automation_rollout_repair.sql → 20261118095216_automation_rollout_repair/migration.sql} +0 -0
- /package/migrations/{0123_cache_warming_history_reset.sql → 20261118143948_cache_warming_history_reset/migration.sql} +0 -0
- /package/migrations/{0124_artifact_visibility.sql → 20261119040651_artifact_visibility/migration.sql} +0 -0
- /package/migrations/{0125_artifact_public_sha_index.sql → 20261119040715_artifact_public_sha_index/migration.sql} +0 -0
- /package/migrations/{0126_artifact_drop_public.sql → 20261119052706_artifact_drop_public/migration.sql} +0 -0
- /package/migrations/{0127_artifact_path.sql → 20261119053831_artifact_path/migration.sql} +0 -0
- /package/migrations/{0128_artifact_path_index.sql → 20261119053844_artifact_path_index/migration.sql} +0 -0
- /package/migrations/{0129_review_item_answered_index.sql → 20261119091949_review_item_answered_index/migration.sql} +0 -0
- /package/migrations/{0130_review_item_status_index.sql → 20261119100029_review_item_status_index/migration.sql} +0 -0
- /package/migrations/{0131_brief_outcome_status.sql → 20261119165607_brief_outcome_status/migration.sql} +0 -0
- /package/migrations/{0132_brief_outcome_status_backfill.sql → 20261119165622_brief_outcome_status_backfill/migration.sql} +0 -0
- /package/migrations/{0133_brief_created_at_index.sql → 20261119213716_brief_created_at_index/migration.sql} +0 -0
- /package/migrations/{0134_slack_person_search_index.sql → 20261119222456_slack_person_search_index/migration.sql} +0 -0
- /package/migrations/{0135_code_change_size.sql → 20261119225522_code_change_size/migration.sql} +0 -0
- /package/migrations/{0136_merge_conflict_notice_dismiss.sql → 20261119232253_merge_conflict_notice_dismiss/migration.sql} +0 -0
- /package/migrations/{0137_inbox_snoozes.sql → 20261119235649_inbox_snoozes/migration.sql} +0 -0
- /package/migrations/{0138_code_change_search_index.sql → 20261120093118_code_change_search_index/migration.sql} +0 -0
- /package/migrations/{0139_review_item_owner.sql → 20261120093452_review_item_owner/migration.sql} +0 -0
- /package/migrations/{0140_review_item_owner_index.sql → 20261120185654_review_item_owner_index/migration.sql} +0 -0
- /package/migrations/{0141_memory_core_adoption.sql → 20261120185754_memory_core_adoption/migration.sql} +0 -0
- /package/migrations/{0142_memory_core_indexes.sql → 20261120185854_memory_core_indexes/migration.sql} +0 -0
- /package/migrations/{0143_todos.sql → 20261120235226_todos/migration.sql} +0 -0
- /package/migrations/{0144_inbox_items.sql → 20261121082316_inbox_items/migration.sql} +0 -0
- /package/migrations/{0145_todo_changed_by_agent.sql → 20261121175651_todo_changed_by_agent/migration.sql} +0 -0
- /package/migrations/{0146_inbox_item_subject_title_parts.sql → 20261121183527_inbox_item_subject_title_parts/migration.sql} +0 -0
- /package/migrations/{0147_inbox_snooze_wake_reason.sql → 20261121194143_inbox_snooze_wake_reason/migration.sql} +0 -0
- /package/migrations/{0148_authorization_request_index.sql → 20261121222400_authorization_request_index/migration.sql} +0 -0
- /package/migrations/{0149_conversation_metadata.sql → 20261121225908_conversation_metadata/migration.sql} +0 -0
- /package/migrations/{0150_conversation_metadata_fill.sql → 20261121225910_conversation_metadata_fill/migration.sql} +0 -0
- /package/migrations/{0151_conversation_search_index.sql → 20261121225913_conversation_search_index/migration.sql} +0 -0
- /package/migrations/{0152_inbox_item_legacy_automation_keys.sql → 20261122022900_inbox_item_legacy_automation_keys/migration.sql} +0 -0
- /package/migrations/{0153_artifact_expiry.sql → 20261122024454_artifact_expiry/migration.sql} +0 -0
- /package/migrations/{0154_artifact_permanent_sha_index.sql → 20261122024455_artifact_permanent_sha_index/migration.sql} +0 -0
- /package/migrations/{0155_artifact_drop_public_sha_index.sql → 20261122024457_artifact_drop_public_sha_index/migration.sql} +0 -0
- /package/migrations/{0156_conversation_kind_lead.sql → 20261122024458_conversation_kind_lead/migration.sql} +0 -0
- /package/migrations/{0157_conversation_lead_actor_index.sql → 20261122024459_conversation_lead_actor_index/migration.sql} +0 -0
- /package/migrations/{0158_keep_legacy_archive_columns.sql → 20261122071549_keep_legacy_archive_columns/migration.sql} +0 -0
- /package/migrations/{0159_conversation_embeddings_fk_validate.sql → 20261122191400_conversation_embeddings_fk_validate/migration.sql} +0 -0
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Cn as readParentMessage, Ct as recordDeliveredAssistantMessage, Et as upsertConversationMessage, In as finalizeFailedTurnReplyWithEvent, K as buildDeterministicTurnId, Mt as isEventConversationMessage, Qt as saveTurnCheckpoint, St as normalizeConversationText, X as loadConversationProjection, bt as latestConversationMessageSeq, d as getPersistedThreadState, dr as persistWithRetry, ft as persistConversationMessages, m as coerceThreadConversationState, p as persistThreadStateById, q as commitAcceptedReply, rn as getTurnRecord, tn as failTurnRecord, tr as getAssistantReplyText, u as getPersistedSandboxState, ut as hydrateConversationMessages, wn as getTurnLifecycle, xt as markConversationMessage } from "./turn-membership-DTR3SaKD.js";
|
|
10
|
-
import { p as credentialContextForActor } from "./registry-POH4bZC4.js";
|
|
2
|
+
import { Af as botConfig, Gt as isTopLevel, La as getDispatchIdForConversation, Mo as blockEventAutomation, Qd as getStateAdapter, Wt as isPersonInput, Ya as notifyAutomationBlocked, Yd as JUNIOR_THREAD_STATE_TTL_MS, Yt as turnBehavior, a as getDb, en as indexEndedTurnEvents, i as getConversationStore, ja as readConversationAutomationRun, n as getConversationEventStore, nf as credentialContextForActor, pd as verifyTimerWatchCredentialSubject, uo as blockScheduledAutomation } from "./db-DXTOYRzR.js";
|
|
3
|
+
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-czs0nqLC.js";
|
|
4
|
+
import { Kt as readMessageAttachments, bt as instructionProvenanceFor } from "./media-Cr9pGkzr.js";
|
|
5
|
+
import { C as resolveSlackReplyTarget, X as measureTurnCompactionWait, et as cancelWaitingParentMessages, k as isConversationDeliveryPaused, nt as reportPersonStopToParent, rt as stopChildAgentsBelow, tt as dropOwnUnreadLoopReplies, w as sendSlackReply } from "./agent-runner-C7GNLRB6.js";
|
|
6
|
+
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-DF5uDcWN.js";
|
|
7
|
+
import { $i as persistWithRetry, $r as saveTurnCheckpoint, At as instructionForInputs, Ci as readParentMessage, Cr as latestConversationMessageSeq, Ct as eventInboxItemInputs, Er as recordDeliveredAssistantMessage, F as renderEventBatchInputs, I as timerWatchCredentialSubject, Ii as finalizeFailedTurnReplyWithEvent, M as eventBatchMessageMeta, Mn as buildDeterministicTurnId, Mt as turnRequestText, N as isEventMailboxMetadata, Nr as isEventConversationMessage, Nt as withoutSavedSteeringMessages, Ot as buildSteeringPiMessage, Q as getTurnUserMessage, Ti as getTurnLifecycle, Tr as normalizeConversationText, X as stopConversationTree, Z as completeCancelledConversationTurn, Zn as commitAcceptedReply, bt as createWebAuthorization, c as legacyWebMailboxMetadataSchema, ct as isTurnInputCommitLostError, d as childAgentTurnOptions, dn as getConversationWorkState, ei as abandonTurnRecord, er as loadConversationProjection, f as commitParentMessageFork, ft as markTurnFailed, gi as releaseInboundMessage, gr as persistConversationMessages, gt as getPersistedThreadState, ht as getPersistedSandboxState, i as listActiveMailboxTurns, it as TurnInputCommitLostError, kr as upsertConversationMessage, kt as instructionActorFor, ln as ensureConversationWake, m as isParentMessageAuthor, mr as hydrateConversationMessages, n as getEventBatchDelayMs, ni as failTurnRecord, o as sourceFromTurnInput, ot as getConversationTurnBoundaryError, pt as startActiveTurn, ri as getTurnRecord, s as turnInputFactsFromConversationMessage, tn as claimInboundMessage, ut as markTurnClosed, vt as persistThreadStateById, wi as ConversationTurnLifecycleService, wr as markConversationMessage, wt as loadInboxItemInput, xt as deleteWebAuthorization, yi as canJoinTurn, yt as coerceThreadConversationState } from "./mailbox-turn-79Nv1JXv.js";
|
|
8
|
+
import { t as parentResultActor, v as isChildAgentEvent } from "./parent-result-Dg6P6roR.js";
|
|
11
9
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
12
|
-
import {
|
|
13
|
-
import { n as
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
10
|
+
import { p as getAssistantReplyText } from "./system-prompt-table-CDCYVwqN.js";
|
|
11
|
+
import { i as CONVERSATION_METADATA_TASK, n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DcdQJd9e.js";
|
|
12
|
+
import { n as getPausedTurnRequest } from "./turn-wake-um5Ubd4m.js";
|
|
13
|
+
import { G as mapBounded } from "./transcript-BHhJVY0P.js";
|
|
14
|
+
import { g as resolveConversationDestination } from "./turn-session-routing-GtetHsdO.js";
|
|
15
|
+
import { t as readConversationLineage } from "./lineage-tRTOcrsL.js";
|
|
16
|
+
import * as z from "zod";
|
|
19
17
|
import { isDeepStrictEqual } from "node:util";
|
|
20
18
|
import { createHash } from "node:crypto";
|
|
21
19
|
// src/chat/task-execution/turn-telemetry.ts
|
|
@@ -75,6 +73,379 @@ function getTurnInputSpanAttributes(input, turnStartedAtMs) {
|
|
|
75
73
|
if (waitMs >= 0) attributes["app.turn.wait_ms"] = Math.round(waitMs);
|
|
76
74
|
return attributes;
|
|
77
75
|
}
|
|
76
|
+
// src/chat/runtime/turn-execution.ts
|
|
77
|
+
/** An error thrown while the agent advances a Run. */
|
|
78
|
+
var AgentRunError = class extends Error {
|
|
79
|
+
constructor(cause) {
|
|
80
|
+
super(cause instanceof Error ? cause.message : "Agent Run failed", { cause });
|
|
81
|
+
this.name = "AgentRunError";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Run the agent and finish the Turn after the caller saves its result.
|
|
86
|
+
*
|
|
87
|
+
* A paused Run, or a Run waiting for authorization, leaves the Turn open. A
|
|
88
|
+
* save error also leaves the Turn open so the worker can retry or recover it.
|
|
89
|
+
* `lifecycle` records the end and sends its agent update.
|
|
90
|
+
*/
|
|
91
|
+
async function executeTurn(agentRunner, run, saveResult, lifecycle = getTurnLifecycle()) {
|
|
92
|
+
let outcome;
|
|
93
|
+
try {
|
|
94
|
+
outcome = await agentRunner.run(run);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
throw new AgentRunError(error);
|
|
97
|
+
}
|
|
98
|
+
if (outcome.status !== "completed") return outcome;
|
|
99
|
+
await finishTurn(lifecycle, run, await saveResult(outcome.result));
|
|
100
|
+
return { status: "completed" };
|
|
101
|
+
}
|
|
102
|
+
async function finishTurn(lifecycle, run, saved) {
|
|
103
|
+
const common = {
|
|
104
|
+
conversationId: run.conversationId,
|
|
105
|
+
createdAtMs: saved.finishedAtMs ?? Date.now(),
|
|
106
|
+
...run.actor ? { reportAs: parentResultActor(run.actor, run.source.kind) } : void 0,
|
|
107
|
+
turnId: run.turnId
|
|
108
|
+
};
|
|
109
|
+
if (saved.outcome === "failed") await lifecycle.fail({
|
|
110
|
+
...common,
|
|
111
|
+
...saved.eventId ? { eventId: saved.eventId } : void 0,
|
|
112
|
+
failureCode: saved.failureCode,
|
|
113
|
+
...saved.failureReason ? { failureReason: saved.failureReason } : void 0,
|
|
114
|
+
...saved.failureText ? { failureText: saved.failureText } : void 0
|
|
115
|
+
});
|
|
116
|
+
else await lifecycle.complete({
|
|
117
|
+
...common,
|
|
118
|
+
...saved.answer ? { answer: saved.answer } : void 0,
|
|
119
|
+
outcome: saved.outcome
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
// src/chat/services/automated-turn-limit.ts
|
|
123
|
+
const AUTOMATED_TURN_LIMIT_PREFIX = "junior:automated_turn_limit:v1";
|
|
124
|
+
const AUTOMATED_TURN_LIMIT_LOCK_TTL_MS = 5e3;
|
|
125
|
+
const AUTOMATED_TURN_LIMIT_LOCK_WAIT_MS = 2e3;
|
|
126
|
+
const AUTOMATED_TURN_LIMIT_LOCK_RETRY_MS = 25;
|
|
127
|
+
/**
|
|
128
|
+
* Stored consecutive automated-turn count for one Conversation. Parsing
|
|
129
|
+
* strips the fields of the old pause, so its count still applies.
|
|
130
|
+
*/
|
|
131
|
+
const automatedTurnLimitStateSchema = z.object({
|
|
132
|
+
consecutiveAutomatedTurns: z.number().int().nonnegative(),
|
|
133
|
+
updatedAtMs: z.number().finite().nonnegative()
|
|
134
|
+
});
|
|
135
|
+
function sleep(ms) {
|
|
136
|
+
return new Promise((resolve) => {
|
|
137
|
+
setTimeout(resolve, ms).unref?.();
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function conversationKey(conversationId) {
|
|
141
|
+
return `${AUTOMATED_TURN_LIMIT_PREFIX}:conversation:${conversationId}`;
|
|
142
|
+
}
|
|
143
|
+
function lockKey(key) {
|
|
144
|
+
return `${key}:lock`;
|
|
145
|
+
}
|
|
146
|
+
function parseState(value) {
|
|
147
|
+
const parsed = automatedTurnLimitStateSchema.safeParse(value);
|
|
148
|
+
return parsed.success ? parsed.data : void 0;
|
|
149
|
+
}
|
|
150
|
+
async function acquireConversationLock(state, key, waitDeadlineMs = Date.now() + AUTOMATED_TURN_LIMIT_LOCK_WAIT_MS) {
|
|
151
|
+
while (true) {
|
|
152
|
+
const lock = await state.acquireLock(lockKey(key), AUTOMATED_TURN_LIMIT_LOCK_TTL_MS);
|
|
153
|
+
if (lock) return lock;
|
|
154
|
+
if (Date.now() >= waitDeadlineMs) throw new Error(`Could not acquire automated turn limit lock for ${key}`);
|
|
155
|
+
await sleep(AUTOMATED_TURN_LIMIT_LOCK_RETRY_MS);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async function withConversationLock(state, key, callback) {
|
|
159
|
+
const lock = await acquireConversationLock(state, key);
|
|
160
|
+
try {
|
|
161
|
+
return await callback();
|
|
162
|
+
} finally {
|
|
163
|
+
await state.releaseLock(lock);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function emptyState(nowMs) {
|
|
167
|
+
return {
|
|
168
|
+
consecutiveAutomatedTurns: 0,
|
|
169
|
+
updatedAtMs: nowMs
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** True when this Source starts an automated Turn rather than a user Turn. */
|
|
173
|
+
function isAutomatedTurnSource(source) {
|
|
174
|
+
if (!source) return false;
|
|
175
|
+
return source.kind === "event" || source.kind === "event_automation" || source.kind === "scheduled_automation" || source.kind === "plugin_dispatch" || source.kind === "parent_message";
|
|
176
|
+
}
|
|
177
|
+
/** Plain notice when automatic updates stop until the user replies. */
|
|
178
|
+
function buildAutomatedTurnLimitResponse(args) {
|
|
179
|
+
return `I stopped automatic updates after ${args.maxTurns} automated turns without a new message from you. Turns with no reply also count. Send a message or @mention me in this thread to continue.`;
|
|
180
|
+
}
|
|
181
|
+
/** Count one finished automated Turn toward the consecutive-turn limit. */
|
|
182
|
+
async function countAutomatedTurn(args) {
|
|
183
|
+
if (args.maxTurns < 1) throw new Error("Automated turn limit must be at least 1");
|
|
184
|
+
const state = args.state ?? getStateAdapter();
|
|
185
|
+
await state.connect();
|
|
186
|
+
const nowMs = args.nowMs ?? Date.now();
|
|
187
|
+
const key = conversationKey(args.conversationId);
|
|
188
|
+
return await withConversationLock(state, key, async () => {
|
|
189
|
+
const consecutiveAutomatedTurns = (parseState(await state.get(key)) ?? emptyState(nowMs)).consecutiveAutomatedTurns + 1;
|
|
190
|
+
await state.set(key, {
|
|
191
|
+
consecutiveAutomatedTurns,
|
|
192
|
+
updatedAtMs: nowMs
|
|
193
|
+
}, JUNIOR_THREAD_STATE_TTL_MS);
|
|
194
|
+
return {
|
|
195
|
+
consecutiveAutomatedTurns,
|
|
196
|
+
reached: consecutiveAutomatedTurns >= args.maxTurns
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/** Clear the consecutive automated-turn count after a user-owned Turn. */
|
|
201
|
+
async function resetAutomatedTurnLimit(args) {
|
|
202
|
+
const state = args.state ?? getStateAdapter();
|
|
203
|
+
await state.connect();
|
|
204
|
+
const key = conversationKey(args.conversationId);
|
|
205
|
+
await withConversationLock(state, key, async () => {
|
|
206
|
+
await state.delete(key);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Update consecutive automated-turn counts after one finished Turn.
|
|
211
|
+
*
|
|
212
|
+
* Automated Turns count on the Conversation. User Turns clear that count.
|
|
213
|
+
*/
|
|
214
|
+
async function recordFinishedTurnForAutomatedLimit(args) {
|
|
215
|
+
const nowMs = args.nowMs ?? Date.now();
|
|
216
|
+
if (isAutomatedTurnSource(args.source)) return await countAutomatedTurn({
|
|
217
|
+
conversationId: args.conversationId,
|
|
218
|
+
maxTurns: args.maxTurns,
|
|
219
|
+
nowMs,
|
|
220
|
+
state: args.state
|
|
221
|
+
});
|
|
222
|
+
await resetAutomatedTurnLimit({
|
|
223
|
+
conversationId: args.conversationId,
|
|
224
|
+
nowMs,
|
|
225
|
+
state: args.state
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
// src/chat/conversations/stop.ts
|
|
229
|
+
/**
|
|
230
|
+
* Stop a Conversation for a person, on every stop path. Every child agent
|
|
231
|
+
* below it stops, then it and they are stopped Conversations until a person
|
|
232
|
+
* sends input, and then its Turn stops. A Turn that waits for sign-in ends
|
|
233
|
+
* too, so a later sign-in does not resume it. Their automated input is held.
|
|
234
|
+
* Nothing above it changes: this reports the stop of a Task to its parent.
|
|
235
|
+
*
|
|
236
|
+
* A stop that comes from a message or a button press, such as the Slack
|
|
237
|
+
* `stop` keyword or stop button, passes it. Its id is claimed in the mailbox
|
|
238
|
+
* first, so a redelivery returns `duplicate` and stops nothing, not even
|
|
239
|
+
* newer work. A stop that fails before its stop request is saved releases
|
|
240
|
+
* its claim, so a redelivery can stop again. A failed claim check keeps a
|
|
241
|
+
* claim that an earlier delivery saved. A failure after the stop request is
|
|
242
|
+
* saved keeps the claim, as does a failed reply: the work is already
|
|
243
|
+
* stopped, and a redelivery must not stop newer work. Its send time
|
|
244
|
+
* is the stop time, and only person input sent at or before it is dropped.
|
|
245
|
+
* So a retry writes the same stop and keeps input that the person sent after
|
|
246
|
+
* it.
|
|
247
|
+
*
|
|
248
|
+
* The child agents and sessions stop first, so a failure leaves the Turn
|
|
249
|
+
* running and the stop can be retried. A child agent can outlive the parent
|
|
250
|
+
* Turn, so this runs even when no Turn runs.
|
|
251
|
+
*/
|
|
252
|
+
async function stopConversation(args) {
|
|
253
|
+
if (args.message && (await claimInboundMessage({
|
|
254
|
+
conversationStore: args.conversationStore,
|
|
255
|
+
message: args.message,
|
|
256
|
+
state: args.state
|
|
257
|
+
})).status === "duplicate") return { status: "duplicate" };
|
|
258
|
+
let stopSaved = false;
|
|
259
|
+
try {
|
|
260
|
+
const nowMs = Date.now();
|
|
261
|
+
const stoppedAtMs = args.message?.createdAtMs ?? nowMs;
|
|
262
|
+
await reportPersonStopToParent(args.conversationId, {
|
|
263
|
+
queue: args.queue,
|
|
264
|
+
state: args.state,
|
|
265
|
+
stoppedAtMs
|
|
266
|
+
});
|
|
267
|
+
const result = await stopConversationAndChildAgents({
|
|
268
|
+
conversationId: args.conversationId,
|
|
269
|
+
conversationStore: args.conversationStore,
|
|
270
|
+
nowMs,
|
|
271
|
+
onStopSaved: () => {
|
|
272
|
+
stopSaved = true;
|
|
273
|
+
},
|
|
274
|
+
queue: args.queue,
|
|
275
|
+
sentAtOrBeforeMs: args.message ? stoppedAtMs : void 0,
|
|
276
|
+
state: args.state,
|
|
277
|
+
stoppedAtMs
|
|
278
|
+
});
|
|
279
|
+
if (result.status === "requested") await ensureConversationWake({
|
|
280
|
+
conversationId: args.conversationId,
|
|
281
|
+
conversationStore: args.conversationStore,
|
|
282
|
+
idempotencyKey: `conversation-stop:${args.conversationId}:${result.runId}`,
|
|
283
|
+
nowMs,
|
|
284
|
+
queue: args.queue,
|
|
285
|
+
replaceExistingWake: true,
|
|
286
|
+
state: args.state
|
|
287
|
+
});
|
|
288
|
+
return result;
|
|
289
|
+
} catch (error) {
|
|
290
|
+
if (args.message && !stopSaved) await releaseInboundMessage({
|
|
291
|
+
message: args.message,
|
|
292
|
+
state: args.state
|
|
293
|
+
});
|
|
294
|
+
throw error;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Stop a Conversation and every child agent below it, through
|
|
299
|
+
* `stopConversationTree`. A person's stop and the automated-turn limit call
|
|
300
|
+
* this. The child agents stop first, so a failure leaves the Conversation
|
|
301
|
+
* running and the stop can be retried. Its waiting parent messages are
|
|
302
|
+
* dropped before its stop request is saved, so no stop request outlives
|
|
303
|
+
* the stop.
|
|
304
|
+
*/
|
|
305
|
+
async function stopConversationAndChildAgents(args) {
|
|
306
|
+
const { conversationId, ...options } = args;
|
|
307
|
+
await stopChildAgentsBelow(conversationId, {
|
|
308
|
+
nowMs: options.nowMs,
|
|
309
|
+
queue: options.queue,
|
|
310
|
+
stoppedAtMs: options.stoppedAtMs,
|
|
311
|
+
state: options.state
|
|
312
|
+
});
|
|
313
|
+
await cancelWaitingParentMessages(conversationId, {
|
|
314
|
+
nowMs: options.stoppedAtMs,
|
|
315
|
+
state: options.state
|
|
316
|
+
});
|
|
317
|
+
const [result] = await stopConversationTree([conversationId], options);
|
|
318
|
+
if (!result) throw new Error("Stop returned no result");
|
|
319
|
+
await dropOwnUnreadLoopReplies(conversationId, options.state);
|
|
320
|
+
return result;
|
|
321
|
+
}
|
|
322
|
+
// src/chat/slack/automated-turn-limit-notice.ts
|
|
323
|
+
/**
|
|
324
|
+
* Stop and notice for the consecutive automated-turn limit.
|
|
325
|
+
*
|
|
326
|
+
* The notice is best-effort: a failed post must not fail the Turn or undo the
|
|
327
|
+
* stop.
|
|
328
|
+
*/
|
|
329
|
+
/**
|
|
330
|
+
* Post the stop notice to the Conversation Location when known. A child
|
|
331
|
+
* agent posts none: its parent sees it as stopped in `listAgents`.
|
|
332
|
+
*/
|
|
333
|
+
async function postAutomatedTurnLimitNotice(args) {
|
|
334
|
+
try {
|
|
335
|
+
const conversation = await getConversationStore().get({ conversationId: args.conversationId });
|
|
336
|
+
const location = conversation?.parentConversationId ? void 0 : conversation?.location;
|
|
337
|
+
if (!location || location.provider !== "slack" || conversation?.deliveryPausedAtMs !== void 0) {
|
|
338
|
+
logWarn("automated_turn_limit.notice.skipped", {
|
|
339
|
+
conversationId: args.conversationId,
|
|
340
|
+
"app.automated_turn_limit.reason": !location ? "missing_location" : location.provider !== "slack" ? "unsupported_location" : "delivery_paused"
|
|
341
|
+
});
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
await sendSlackReply({
|
|
345
|
+
...resolveSlackReplyTarget({
|
|
346
|
+
destination: location,
|
|
347
|
+
location,
|
|
348
|
+
source: args.source
|
|
349
|
+
}),
|
|
350
|
+
conversationId: args.conversationId,
|
|
351
|
+
text: buildAutomatedTurnLimitResponse({ maxTurns: args.maxTurns })
|
|
352
|
+
});
|
|
353
|
+
} catch (error) {
|
|
354
|
+
logException(error, "automated_turn_limit.notice.failed", { conversationId: args.conversationId });
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Stop the Conversation tree after a finished Turn reaches the automated-turn
|
|
359
|
+
* limit, then post the notice. Person input that already waits ends the loop
|
|
360
|
+
* by itself, so then nothing stops.
|
|
361
|
+
*/
|
|
362
|
+
async function stopAtAutomatedTurnLimit(args) {
|
|
363
|
+
if (!args.update?.reached) return;
|
|
364
|
+
if (((await getConversationWorkState({ conversationId: args.conversationId }))?.messages ?? []).some((message) => isPersonInput(message.source))) return;
|
|
365
|
+
const nowMs = Date.now();
|
|
366
|
+
await stopConversationAndChildAgents({
|
|
367
|
+
conversationId: args.conversationId,
|
|
368
|
+
finishedRunOf: args.conversationId,
|
|
369
|
+
nowMs,
|
|
370
|
+
stoppedAtMs: nowMs
|
|
371
|
+
});
|
|
372
|
+
await postAutomatedTurnLimitNotice({
|
|
373
|
+
conversationId: args.conversationId,
|
|
374
|
+
maxTurns: args.maxTurns,
|
|
375
|
+
source: args.source
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
// src/chat/task-execution/supersede-turns.ts
|
|
379
|
+
/**
|
|
380
|
+
* End every open mailbox Turn other than `keepTurnId`, so new input runs in
|
|
381
|
+
* the only open Turn. New input starts only when no yielded Turn waits, so an
|
|
382
|
+
* open Turn here waits for OAuth or was left open by a failed or stopped Run.
|
|
383
|
+
* The caller persists `conversation`. Returns false when `isStopped` turns
|
|
384
|
+
* true first.
|
|
385
|
+
*/
|
|
386
|
+
async function supersedeOpenMailboxTurns(args) {
|
|
387
|
+
return await supersedeTurns({
|
|
388
|
+
...args,
|
|
389
|
+
turns: (await listActiveMailboxTurns(args.conversationId)).filter((record) => record.turnId !== args.keepTurnId)
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* End open Turns that new input replaces. A late resume or OAuth callback
|
|
394
|
+
* for an ended Turn is a no-op. The caller persists `conversation`. Returns
|
|
395
|
+
* false when `isStopped` turns true first.
|
|
396
|
+
*/
|
|
397
|
+
async function supersedeTurns(args) {
|
|
398
|
+
const pendingAuthorizationActorId = args.conversation.processing.pendingAuth?.actorId;
|
|
399
|
+
for (const stale of args.turns) {
|
|
400
|
+
if (args.isStopped?.()) return false;
|
|
401
|
+
await abandonTurnRecord({
|
|
402
|
+
conversationId: args.conversationId,
|
|
403
|
+
turnId: stale.turnId,
|
|
404
|
+
errorMessage: "Turn superseded by new input"
|
|
405
|
+
});
|
|
406
|
+
await getTurnLifecycle().complete({
|
|
407
|
+
conversationId: args.conversationId,
|
|
408
|
+
createdAtMs: Date.now(),
|
|
409
|
+
outcome: "cancelled",
|
|
410
|
+
turnId: stale.turnId
|
|
411
|
+
});
|
|
412
|
+
markTurnClosed({
|
|
413
|
+
conversation: args.conversation,
|
|
414
|
+
nowMs: Date.now(),
|
|
415
|
+
sessionId: stale.turnId
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (args.turns.some((record) => record.state === "paused" && record.resumeReason === "auth") && pendingAuthorizationActorId) await deleteWebAuthorization({
|
|
419
|
+
actorId: pendingAuthorizationActorId,
|
|
420
|
+
conversationId: args.conversationId
|
|
421
|
+
});
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* End the Turn that waits for its next Run when `message` cannot join it, so
|
|
426
|
+
* the message starts its own Turn instead of running with that Turn's Actor.
|
|
427
|
+
* A stored legacy Turn without an Actor keeps taking the input.
|
|
428
|
+
*/
|
|
429
|
+
async function supersedeTurnForInput(args) {
|
|
430
|
+
const conversation = coerceThreadConversationState(await getPersistedThreadState(args.conversationId));
|
|
431
|
+
const turnId = conversation.processing.activeTurnId;
|
|
432
|
+
if (!turnId || !await getPausedTurnRequest({
|
|
433
|
+
conversationId: args.conversationId,
|
|
434
|
+
turnId
|
|
435
|
+
})) return;
|
|
436
|
+
const turn = await getTurnRecord(args.conversationId, turnId);
|
|
437
|
+
if (!turn?.actor || canJoinTurn(turn, args.message)) return;
|
|
438
|
+
await hydrateConversationMessages({
|
|
439
|
+
conversation,
|
|
440
|
+
conversationId: args.conversationId
|
|
441
|
+
});
|
|
442
|
+
await supersedeTurns({
|
|
443
|
+
conversation,
|
|
444
|
+
conversationId: args.conversationId,
|
|
445
|
+
turns: [turn]
|
|
446
|
+
});
|
|
447
|
+
await persistThreadStateById(args.conversationId, { conversation });
|
|
448
|
+
}
|
|
78
449
|
// src/chat/automations/block-run.ts
|
|
79
450
|
/**
|
|
80
451
|
* Block the Automation of a run from a later Turn of the run, such as a Watch
|
|
@@ -120,6 +491,58 @@ async function commitAssistantMessage(args) {
|
|
|
120
491
|
logException(error, "conversation.assistant.message_persist.failed");
|
|
121
492
|
}
|
|
122
493
|
}
|
|
494
|
+
// src/chat/task-execution/turn-end-tasks.ts
|
|
495
|
+
/**
|
|
496
|
+
* The background work after a Turn ends: plugin session tasks, event search,
|
|
497
|
+
* and Conversation metadata. A failure is logged, so this work never changes
|
|
498
|
+
* the Turn's outcome.
|
|
499
|
+
*/
|
|
500
|
+
async function runTask(message, conversationId, turnId) {
|
|
501
|
+
try {
|
|
502
|
+
await processPluginTask(message);
|
|
503
|
+
} catch (error) {
|
|
504
|
+
logException(error, "conversation.plugin.session_completion_task.failed", {
|
|
505
|
+
conversationId,
|
|
506
|
+
pluginName: message.plugin,
|
|
507
|
+
taskName: message.name,
|
|
508
|
+
turnId
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Run the work after one ended Turn. A completed Turn with session tasks
|
|
514
|
+
* runs every session task, which includes event search and metadata. Any
|
|
515
|
+
* other Turn indexes its events, and a completed one also updates its
|
|
516
|
+
* metadata when its behavior asks for it, as a Thread's does.
|
|
517
|
+
*/
|
|
518
|
+
async function runTurnEndTasks(args) {
|
|
519
|
+
const { behavior, conversationId, turnId } = args;
|
|
520
|
+
const params = {
|
|
521
|
+
conversationId,
|
|
522
|
+
sessionId: turnId
|
|
523
|
+
};
|
|
524
|
+
if (args.completed && behavior.sessionTasks) {
|
|
525
|
+
try {
|
|
526
|
+
await scheduleSessionCompletedPluginTasks(params, async (message) => {
|
|
527
|
+
await runTask(message, conversationId, turnId);
|
|
528
|
+
});
|
|
529
|
+
} catch (error) {
|
|
530
|
+
logException(error, "conversation.plugin.session_completion_task.failed", {
|
|
531
|
+
conversationId,
|
|
532
|
+
turnId
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
await indexEndedTurnEvents({
|
|
538
|
+
conversationId,
|
|
539
|
+
turnId
|
|
540
|
+
});
|
|
541
|
+
if (args.completed && behavior.conversationMetadata) await runTask({
|
|
542
|
+
...CONVERSATION_METADATA_TASK,
|
|
543
|
+
params
|
|
544
|
+
}, conversationId, turnId);
|
|
545
|
+
}
|
|
123
546
|
// src/chat/task-execution/mailbox-input.ts
|
|
124
547
|
/**
|
|
125
548
|
* Return the Turn inputs of web Messages, one per non-empty Message, in
|
|
@@ -166,6 +589,22 @@ function webConversationMessage(message, author) {
|
|
|
166
589
|
};
|
|
167
590
|
}
|
|
168
591
|
/**
|
|
592
|
+
* Build the transcript Messages of a new web Turn, in input order. The Turn
|
|
593
|
+
* saves its first input unreplied. `message_handled` records the reply.
|
|
594
|
+
*/
|
|
595
|
+
function webTurnInputMessages(batch) {
|
|
596
|
+
return batch.map((entry, index) => {
|
|
597
|
+
const message = webConversationMessage(entry.message, entry.author);
|
|
598
|
+
return index === 0 ? {
|
|
599
|
+
...message,
|
|
600
|
+
meta: {
|
|
601
|
+
...message.meta,
|
|
602
|
+
replied: false
|
|
603
|
+
}
|
|
604
|
+
} : message;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
169
608
|
* Return the saved input Messages of a resumed Turn in input order. A web
|
|
170
609
|
* batch saves each Message apart. An older Turn saved one joined Message, so
|
|
171
610
|
* its other input ids have no saved Message.
|
|
@@ -176,7 +615,7 @@ function savedTurnInputMessages(conversation, turnMessage, inputMessageIds) {
|
|
|
176
615
|
}
|
|
177
616
|
/**
|
|
178
617
|
* Render the Turn inputs of one new mailbox batch. A parent batch is the
|
|
179
|
-
* parent's task
|
|
618
|
+
* parent's task. An Event batch also returns the
|
|
180
619
|
* meta of its one saved Message. A web batch returns one transcript Message
|
|
181
620
|
* per input.
|
|
182
621
|
*/
|
|
@@ -199,7 +638,7 @@ async function mailboxTurnInputs(batch, fromParent) {
|
|
|
199
638
|
return {
|
|
200
639
|
eventMeta: {},
|
|
201
640
|
inputs: await webTurnInputs(messages.map((message) => message.input)),
|
|
202
|
-
webInputMessages: batch
|
|
641
|
+
webInputMessages: webTurnInputMessages(batch)
|
|
203
642
|
};
|
|
204
643
|
}
|
|
205
644
|
// src/chat/task-execution/web-steering.ts
|
|
@@ -294,12 +733,33 @@ function sharedAuthorIdentityId(messages) {
|
|
|
294
733
|
const ids = new Set(messages.map((message) => message.input.authorIdentityId));
|
|
295
734
|
return ids.size === 1 ? [...ids][0] : void 0;
|
|
296
735
|
}
|
|
736
|
+
function turnAnswerText(reply) {
|
|
737
|
+
if (reply.reply) return void 0;
|
|
738
|
+
if (reply.blocked) return {
|
|
739
|
+
kind: "note",
|
|
740
|
+
text: reply.blocked.missing
|
|
741
|
+
};
|
|
742
|
+
if (reply.noReply) return {
|
|
743
|
+
kind: "note",
|
|
744
|
+
text: reply.noReply.note ?? ""
|
|
745
|
+
};
|
|
746
|
+
const text = reply.text.trim();
|
|
747
|
+
return text ? {
|
|
748
|
+
kind: "final_text",
|
|
749
|
+
text
|
|
750
|
+
} : void 0;
|
|
751
|
+
}
|
|
297
752
|
/**
|
|
298
753
|
* Create the shared mailbox worker for web and event Turns of every
|
|
299
|
-
* Conversation kind. `deliverMessage` posts to a Location
|
|
300
|
-
*
|
|
754
|
+
* Conversation kind. `deliverMessage` posts to a Location. `updates` is
|
|
755
|
+
* where each Turn's agent update goes, to the starter of a child agent and
|
|
756
|
+
* to the Watches of any Conversation, by default the production queue.
|
|
301
757
|
*/
|
|
302
|
-
function createConversationTurnWorker(agentRunner, deliverMessage,
|
|
758
|
+
function createConversationTurnWorker(agentRunner, deliverMessage, updates) {
|
|
759
|
+
const lifecycle = updates ? new ConversationTurnLifecycleService(getConversationEventStore(), {
|
|
760
|
+
state: updates.state,
|
|
761
|
+
watchQueue: () => updates.queue
|
|
762
|
+
}) : getTurnLifecycle();
|
|
303
763
|
return async (context, resolved) => {
|
|
304
764
|
if (resolved.kind === "mailbox") {
|
|
305
765
|
const delayMs = getEventBatchDelayMs(resolved.batch.map((entry) => entry.message));
|
|
@@ -308,7 +768,6 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
308
768
|
delayMs
|
|
309
769
|
};
|
|
310
770
|
}
|
|
311
|
-
const lifecycle = getTurnLifecycle();
|
|
312
771
|
const isResume = resolved.kind === "resume";
|
|
313
772
|
let turnInputFacts;
|
|
314
773
|
let inputs = [];
|
|
@@ -319,11 +778,12 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
319
778
|
let inputMessageIds = [];
|
|
320
779
|
let eventMeta = {};
|
|
321
780
|
let fromParent = resolved.kind === "mailbox" && resolved.batch.every((entry) => readParentMessage(entry.message));
|
|
781
|
+
let fromChildAgent = false;
|
|
322
782
|
let authorIdentityId;
|
|
323
783
|
let webInputMessages = [];
|
|
324
784
|
const storedConversation = await getConversationStore().get({ conversationId: context.conversationId });
|
|
325
785
|
const kind = storedConversation?.kind ?? "root";
|
|
326
|
-
const visibility =
|
|
786
|
+
const visibility = isTopLevel({ parentConversationId: storedConversation?.parentConversationId }) ? storedConversation?.visibility : storedConversation?.visibility ?? "private";
|
|
327
787
|
const mailboxDestination = resolved.kind === "mailbox" ? resolved.batch[0]?.message.destination : void 0;
|
|
328
788
|
const destination = resolveConversationDestination({
|
|
329
789
|
conversationId: context.conversationId,
|
|
@@ -333,6 +793,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
333
793
|
const first = resolved.batch[0];
|
|
334
794
|
const messages = resolved.batch.map((entry) => entry.message);
|
|
335
795
|
({eventMeta, inputs, webInputMessages} = await mailboxTurnInputs(resolved.batch, fromParent));
|
|
796
|
+
fromChildAgent = isChildAgentEvent(eventMeta);
|
|
336
797
|
attachments = resolved.batch.flatMap((entry) => readMessageAttachments(entry.message.input.attachments));
|
|
337
798
|
startedAtMs = first.message.createdAtMs;
|
|
338
799
|
userMessageId = first.message.inboundMessageId;
|
|
@@ -354,6 +815,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
354
815
|
if (!userMessage) throw new Error(`Unable to locate the persisted user message for Turn "${turnId}"`);
|
|
355
816
|
savedMessageIsEvent = isEventConversationMessage(userMessage);
|
|
356
817
|
fromParent = isParentMessageAuthor(userMessage.author);
|
|
818
|
+
fromChildAgent = isChildAgentEvent(userMessage.meta);
|
|
357
819
|
turnInputFacts = turnInputFactsFromConversationMessage(userMessage, {
|
|
358
820
|
conversationId: context.conversationId,
|
|
359
821
|
location: storedConversation?.location,
|
|
@@ -398,15 +860,6 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
398
860
|
const signInActor = behavior.waitsForSignIn ? webActor : void 0;
|
|
399
861
|
const disabledFeatures = signInActor ? [] : ["interactive-auth"];
|
|
400
862
|
const deliverToProvider = postsToProvider && behavior.delivery === "location";
|
|
401
|
-
const sendToParent = async (result) => {
|
|
402
|
-
if (!deliverToParent) throw new Error(`Conversation ${context.conversationId} cannot reach its parent agent`);
|
|
403
|
-
await deliverToParent({
|
|
404
|
-
actor,
|
|
405
|
-
result,
|
|
406
|
-
conversationId: context.conversationId,
|
|
407
|
-
turnId
|
|
408
|
-
});
|
|
409
|
-
};
|
|
410
863
|
const surface = postsToProvider ? "slack" : "api";
|
|
411
864
|
const inputTelemetry = resolved.kind === "mailbox" ? turnInputTelemetry(resolved.batch.map((entry) => entry.message)) : void 0;
|
|
412
865
|
const turnTrace = inputTelemetry ?? (savedTurn?.traceContext ? { traceContexts: [savedTurn.traceContext] } : void 0);
|
|
@@ -446,18 +899,16 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
446
899
|
if (hasLostTurnInputCommit(error)) return { status: "lost_lease" };
|
|
447
900
|
throw error;
|
|
448
901
|
}
|
|
902
|
+
await indexEndedTurnEvents({
|
|
903
|
+
conversationId: context.conversationId,
|
|
904
|
+
turnId
|
|
905
|
+
});
|
|
449
906
|
return { status: "completed" };
|
|
450
907
|
};
|
|
451
908
|
if (isResume) {
|
|
452
909
|
if (stopSignal?.aborted) return await completeCancelledTurn();
|
|
453
910
|
} else {
|
|
454
|
-
for (const
|
|
455
|
-
...message,
|
|
456
|
-
meta: {
|
|
457
|
-
...message.meta,
|
|
458
|
-
replied: false
|
|
459
|
-
}
|
|
460
|
-
} : message);
|
|
911
|
+
for (const message of webInputMessages) upsertConversationMessage(conversation, message);
|
|
461
912
|
if (webInputMessages.length === 0) {
|
|
462
913
|
const requestText = turnRequestText({ instruction: instructionInputs });
|
|
463
914
|
upsertConversationMessage(conversation, {
|
|
@@ -545,7 +996,9 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
545
996
|
await persistThreadStateById(context.conversationId, { conversation });
|
|
546
997
|
if (stopSignal?.aborted) return await completeCancelledTurn();
|
|
547
998
|
const childTurn = await childAgentTurnOptions({
|
|
999
|
+
actor,
|
|
548
1000
|
conversationId: context.conversationId,
|
|
1001
|
+
fromChildAgent,
|
|
549
1002
|
fromParent
|
|
550
1003
|
});
|
|
551
1004
|
const history = await loadConversationProjection({ conversationId: context.conversationId });
|
|
@@ -623,22 +1076,9 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
623
1076
|
const modelFailureReason = finalized.failureReason;
|
|
624
1077
|
const reply = finalized.reply;
|
|
625
1078
|
modelFailureEventId = finalized.eventId;
|
|
626
|
-
if (reply.diagnostics.outcome !== "success")
|
|
627
|
-
await deliverAssistantMessage(reply.text);
|
|
628
|
-
if (behavior.failureNotice === "parent") await sendToParent({
|
|
629
|
-
kind: "failed",
|
|
630
|
-
text: reply.diagnostics.errorMessage ?? reply.text
|
|
631
|
-
});
|
|
632
|
-
} else if (reply.reply && behavior.tools.reply === "parent") await sendToParent({
|
|
633
|
-
kind: "reply",
|
|
634
|
-
reply: reply.reply
|
|
635
|
-
});
|
|
1079
|
+
if (reply.diagnostics.outcome !== "success") await deliverAssistantMessage(reply.text);
|
|
636
1080
|
else if (reply.reply) await deliverAssistantMessage(reply.reply.text, { reply: true });
|
|
637
|
-
else if (reply.blocked && behavior.tools.reportBlocked === "
|
|
638
|
-
kind: "blocked",
|
|
639
|
-
text: reply.blocked.missing
|
|
640
|
-
});
|
|
641
|
-
else if (reply.blocked) await blockRunAutomation(context.conversationId, reply.blocked);
|
|
1081
|
+
else if (reply.blocked && behavior.tools.reportBlocked === "automation") await blockRunAutomation(context.conversationId, reply.blocked);
|
|
642
1082
|
const completedState = buildDeliveredTurnStatePatch({
|
|
643
1083
|
conversation,
|
|
644
1084
|
reply,
|
|
@@ -680,13 +1120,19 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
680
1120
|
});
|
|
681
1121
|
}
|
|
682
1122
|
completedSuccessfully = reply.diagnostics.outcome === "success";
|
|
683
|
-
|
|
1123
|
+
const delivered = assistantMessageDelivered ? "success" : "no_reply";
|
|
1124
|
+
const answer = turnAnswerText(reply);
|
|
1125
|
+
return completedSuccessfully ? {
|
|
1126
|
+
...answer ? { answer } : void 0,
|
|
1127
|
+
outcome: reply.blocked ? "blocked" : delivered
|
|
1128
|
+
} : {
|
|
684
1129
|
...modelFailureEventId ? { eventId: modelFailureEventId } : void 0,
|
|
685
1130
|
failureCode: "model_execution_failed",
|
|
686
1131
|
...modelFailureReason ? { failureReason: modelFailureReason } : void 0,
|
|
1132
|
+
failureText: reply.diagnostics.errorMessage ?? reply.text,
|
|
687
1133
|
outcome: "failed"
|
|
688
1134
|
};
|
|
689
|
-
});
|
|
1135
|
+
}, lifecycle);
|
|
690
1136
|
if (outcome.status !== "completed" && stopSignal?.aborted) return await completeCancelledTurn();
|
|
691
1137
|
if (outcome.status === "suspended") return { status: "yielded" };
|
|
692
1138
|
if (outcome.status === "awaiting_auth") {
|
|
@@ -701,28 +1147,12 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
701
1147
|
await acknowledge();
|
|
702
1148
|
return { status: "paused" };
|
|
703
1149
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
await processPluginTask(message);
|
|
711
|
-
} catch (error) {
|
|
712
|
-
logException(error, "conversation.plugin.session_completion_task.failed", {
|
|
713
|
-
conversationId: context.conversationId,
|
|
714
|
-
pluginName: message.plugin,
|
|
715
|
-
taskName: message.name,
|
|
716
|
-
turnId
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
});
|
|
720
|
-
} catch (error) {
|
|
721
|
-
logException(error, "conversation.plugin.session_completion_task.failed", {
|
|
722
|
-
conversationId: context.conversationId,
|
|
723
|
-
turnId
|
|
724
|
-
});
|
|
725
|
-
}
|
|
1150
|
+
await runTurnEndTasks({
|
|
1151
|
+
behavior,
|
|
1152
|
+
completed: completedSuccessfully,
|
|
1153
|
+
conversationId: context.conversationId,
|
|
1154
|
+
turnId
|
|
1155
|
+
});
|
|
726
1156
|
await acknowledge();
|
|
727
1157
|
return { status: "completed" };
|
|
728
1158
|
} catch (error) {
|
|
@@ -780,17 +1210,18 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
780
1210
|
createdAtMs: Date.now(),
|
|
781
1211
|
...failureEventId ? { eventId: failureEventId } : void 0,
|
|
782
1212
|
failureCode,
|
|
1213
|
+
failureText: failure instanceof Error ? failure.message : String(failure),
|
|
1214
|
+
reportAs: parentResultActor(actor, source.kind),
|
|
783
1215
|
turnId
|
|
784
1216
|
});
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
1217
|
+
await indexEndedTurnEvents({
|
|
1218
|
+
conversationId: context.conversationId,
|
|
1219
|
+
turnId
|
|
788
1220
|
});
|
|
789
|
-
else await recordChildAgentEnded(context.conversationId, "error");
|
|
790
1221
|
await acknowledge();
|
|
791
1222
|
return { status: "completed" };
|
|
792
1223
|
}
|
|
793
1224
|
});
|
|
794
1225
|
};
|
|
795
1226
|
}
|
|
796
|
-
export {
|
|
1227
|
+
export { stopConversation as a, executeTurn as c, withTurnSpan as d, stopAtAutomatedTurnLimit as i, getTurnInputSpanAttributes as l, createConversationTurnWorker as n, recordFinishedTurnForAutomatedLimit as o, supersedeTurnForInput as r, AgentRunError as s, conversation_turn_exports as t, turnInputTelemetry as u };
|