@sentry/junior 0.314.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-BOL29BG3.js → adapter-context-BlSGE44V.js} +42 -3
- package/dist/{admin-BXGAySz0.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 +4 -6
- package/dist/api.d.ts +2 -3
- package/dist/api.js +850 -283
- package/dist/{app-D7tKnw9a.d.ts → app-D_bAXRDe.d.ts} +310 -29
- package/dist/app.d.ts +1 -1
- package/dist/app.js +260 -50
- package/dist/change-record-Bqsa5ZXE.d.ts +175 -0
- package/dist/chat-core-engine-CxkwRpn9.js +123 -0
- package/dist/cli/chat.d.ts +4 -1
- package/dist/cli/chat.js +39 -21
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +3 -4
- 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 +48 -96
- package/dist/{continue-in-slack-fnmD2Ifb.js → continue-in-slack-BGKjIdFp.js} +3 -5
- package/dist/{conversation-feed-DdFQuQDR.js → conversation-feed-Sl8lKKmR.js} +22 -2
- package/dist/{conversation-turn-DScuDYmN.js → conversation-turn-BoLK9i6g.js} +149 -103
- package/dist/{create-CrNt4Ewu.js → create-BOycVH9h.js} +5 -4
- package/dist/{credential-sync-CtqsGjj1.js → credential-sync-Mn4OdkEh.js} +10 -15
- package/dist/db-BpxcYXfD.d.ts +2 -0
- package/dist/{credentialed-dWRA3-oJ.js → db-DXTOYRzR.js} +21687 -9285
- 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-B8rBt7F4.js → html-CfXEwl_h.js} +2 -5
- package/dist/instrumentation.js +2 -2
- package/dist/job-runner-CySgpi9v.js +1131 -0
- package/dist/{lineage-EULJkGO1.js → lineage-tRTOcrsL.js} +1 -1
- package/dist/{list-C5400AlJ.js → list-DXBz8SYL.js} +411 -132
- package/dist/local-server-CpnGhYml.js +276 -0
- package/dist/{conversation-privacy-DtZhI91r.js → logging-czs0nqLC.js} +2 -231
- package/dist/{mailbox-turn-DL3Lvsm0.js → mailbox-turn-79Nv1JXv.js} +1922 -2439
- package/dist/markers-CE0HMXWT.js +67 -0
- package/dist/{media-FYM-Bl3H.js → media-Cr9pGkzr.js} +670 -35
- package/dist/{message-DuDelZFr.js → message-BTox2Cmb.js} +18 -16
- package/dist/{model-input-0osF3pBS.js → model-input-IRGa98V7.js} +3 -3
- package/dist/nitro.d.ts +7 -1
- package/dist/nitro.js +48 -293
- package/dist/{oauth-callback-server-DX2fQ7Nq.js → oauth-callback-server-NXK7AlBp.js} +2 -2
- package/dist/{oauth-relay-PwPMdZJv.js → oauth-relay-6NBPSpFE.js} +1 -1
- package/dist/{package-discovery-DD9vencX.js → package-discovery-BI6T_RkD.js} +50 -1
- package/dist/{markers-DUP8aBOp.js → parent-result-Dg6P6roR.js} +71 -71
- package/dist/people-Cegp1Iwq.js +81 -0
- package/dist/proxy-path-Dc-0jXGi.js +203 -0
- package/dist/{resolve-D8CPJcNK.js → resolve-BUFkmxkT.js} +229 -4
- package/dist/{result-D090hxr5.js → result-DfATzX77.js} +79 -144
- package/dist/{runner-BU7fgrm-.js → runner-CmKP3inb.js} +7 -7
- package/dist/{sandbox-egress-signals-BUmVrsoG.js → sandbox-egress-signals-DYo5BsM7.js} +1 -1
- package/dist/{schema-7gW9vBpJ.js → schema-DrBMdPmv.js} +111 -15
- package/dist/{service-account-plA-uzIB.js → service-account-CxTX7nnR.js} +1 -3
- package/dist/{skills-CIosT6bS.js → skills-BlHUDj7k.js} +4 -4
- package/dist/{slack-conversation-unfurl-CBgZqth6.js → slack-conversation-unfurl-Dhe3lB1U.js} +6 -8
- package/dist/{spawn-DRjdzh3R.js → spawn-CfvlFdfz.js} +4 -5
- package/dist/start-conversation-Uh8Sk1EF.js +162 -0
- package/dist/system-prompt-table-CDCYVwqN.js +1169 -0
- package/dist/{task-runner-C-pXsgHM.js → task-runner-DcdQJd9e.js} +71 -17
- package/dist/{thread-context-CDX4dSZd.js → thread-context-DF5uDcWN.js} +5 -6
- 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-Bzq1Efrm.js → turn-wake-um5Ubd4m.js} +5 -7
- package/dist/{validation-bTq88sya.js → validation-CJyuOPD2.js} +1 -1
- package/dist/{version-DGUa1dZK.js → version-Bhe7RPIe.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/virtual-module-BeKA_EII.js +12 -0
- package/dist/{worker-AkZg7Dg1.js → worker-D8PRgUqr.js} +3 -5
- 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/snapshot.json +9 -0
- package/migrations/20261122204326_agent_config_backfill/snapshot.json +143 -0
- package/migrations/20261122221456_inbox_item_deliveries/snapshot.json +301 -0
- package/migrations/20261123155735_pg_trgm/snapshot.json +9 -0
- package/migrations/20261123155739_search_indexes/snapshot.json +167 -0
- package/migrations/20261123172647_drop_legacy_archive_columns/snapshot.json +9 -0
- package/migrations/20261123192506_memory_prefix_index/snapshot.json +69 -0
- package/migrations/20261123201740_todo_search_indexes/snapshot.json +89 -0
- package/migrations/20261123211505_todo_inbox_items/snapshot.json +38 -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 +13 -12
- package/skills/design-automation-skill/SKILL.md +1 -1
- package/dist/adapter-JARQvoLw.js +0 -258
- package/dist/adapter-context-B4BrJZuS.js +0 -43
- package/dist/agent-runner-qZU5TR8i.js +0 -11974
- package/dist/agent-update-cS7Z9mnG.js +0 -26
- package/dist/agent-update-delivery-CZ5M8RDa.js +0 -85
- package/dist/background-compaction-queue-C_uIBUvS.js +0 -145
- package/dist/callback-C8SdXCwr.js +0 -68
- package/dist/catalog-runtime-BLKtnUL3.js +0 -6
- package/dist/config-BIfHKNXN.js +0 -2336
- package/dist/db-BTmLKZrp.js +0 -5804
- package/dist/db-DcmzbA55.d.ts +0 -274
- package/dist/history-CneKY7_V.js +0 -595
- package/dist/install-OtFboxOM.js +0 -228
- package/dist/proxy-path-BHYoKZdq.js +0 -15
- package/dist/registry-D6kS6xYH.js +0 -3024
- package/dist/rule-DAxQY-1h.js +0 -20
- package/dist/schema-BB6E0wyV.d.ts +0 -9472
- package/dist/start-conversation-a4NXH4X9.js +0 -752
- package/dist/store-BuhF1QDm.js +0 -490
- package/dist/task-queue-CrRjFzOh.js +0 -79
- package/dist/turn-session-routing-CZTRU8IY.js +0 -116
- package/dist/vercel-queue-nL0Hq3hr.js +0 -234
- package/dist/warmup-CCOuIwAS.js +0 -12759
- 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/0160_snapshot.json +0 -6515
- package/migrations/meta/0161_snapshot.json +0 -6278
- package/migrations/meta/0162_snapshot.json +0 -6404
- package/migrations/meta/0163_snapshot.json +0 -6404
- package/migrations/meta/0164_snapshot.json +0 -6466
- package/migrations/meta/0165_snapshot.json +0 -6466
- package/migrations/meta/0166_snapshot.json +0 -6494
- package/migrations/meta/0167_snapshot.json +0 -6525
- package/migrations/meta/0168_snapshot.json +0 -6525
- package/migrations/meta/0169_snapshot.json +0 -6513
- package/migrations/meta/_journal.json +0 -1196
- /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
- /package/migrations/{0160_money_micro_usd_repair.sql → 20261122204325_money_micro_usd_repair/migration.sql} +0 -0
- /package/migrations/{0161_agent_config_backfill.sql → 20261122204326_agent_config_backfill/migration.sql} +0 -0
- /package/migrations/{0162_inbox_item_deliveries.sql → 20261122221456_inbox_item_deliveries/migration.sql} +0 -0
- /package/migrations/{0163_pg_trgm.sql → 20261123155735_pg_trgm/migration.sql} +0 -0
- /package/migrations/{0164_search_indexes.sql → 20261123155739_search_indexes/migration.sql} +0 -0
- /package/migrations/{0165_drop_legacy_archive_columns.sql → 20261123172647_drop_legacy_archive_columns/migration.sql} +0 -0
- /package/migrations/{0166_memory_prefix_index.sql → 20261123192506_memory_prefix_index/migration.sql} +0 -0
- /package/migrations/{0167_todo_search_indexes.sql → 20261123201740_todo_search_indexes/migration.sql} +0 -0
- /package/migrations/{0168_todo_inbox_items.sql → 20261123211505_todo_inbox_items/migration.sql} +0 -0
- /package/migrations/{0169_drop_code_urls.sql → 20261123214917_drop_code_urls/migration.sql} +0 -0
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import { a as conversationTurnFailureReasonSchema, b as usageSchema, i as conversationTurnFailureCodeSchema } from "./history-CneKY7_V.js";
|
|
2
1
|
import * as z from "zod";
|
|
3
|
-
import { actorUserIdSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, objectFactFields, objectTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
2
|
+
import { actorSchema, actorUserIdSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, objectFactFields, objectTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
3
|
+
// src/chat/gateway-providers/rule.ts
|
|
4
|
+
/**
|
|
5
|
+
* The routing rule of the "Enabled providers" admin setting.
|
|
6
|
+
*
|
|
7
|
+
* This module imports nothing, so the dashboard client bundle can use it.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Return the AI Gateway `only` list for one model, or undefined to send none.
|
|
11
|
+
*
|
|
12
|
+
* `enabled` is null when every provider is enabled. `served` lists the
|
|
13
|
+
* providers that serve the model. A model that no enabled provider serves
|
|
14
|
+
* stays unfiltered, so unchecking its providers can never break it. A filter
|
|
15
|
+
* that keeps every provider of the model changes nothing, so it is not sent.
|
|
16
|
+
*/
|
|
17
|
+
function gatewayOnlyProviders(enabled, served) {
|
|
18
|
+
if (enabled === null) return void 0;
|
|
19
|
+
const only = served.filter((provider) => enabled.includes(provider));
|
|
20
|
+
return only.length > 0 && only.length < served.length ? only : void 0;
|
|
21
|
+
}
|
|
4
22
|
// src/chat/automations/task.ts
|
|
5
23
|
/**
|
|
6
24
|
* The work of an Automation run. An Automation runs either a written
|
|
@@ -271,6 +289,41 @@ const eventAutomationSchema = z.object({
|
|
|
271
289
|
task: automationTaskSchema,
|
|
272
290
|
trigger: eventAutomationTriggerSchema
|
|
273
291
|
}).strict();
|
|
292
|
+
// src/chat/todos/types.ts
|
|
293
|
+
/** Statuses of a To-do. `done` and `dropped` close it. */
|
|
294
|
+
const TODO_STATUSES = [
|
|
295
|
+
"open",
|
|
296
|
+
"in_progress",
|
|
297
|
+
"done",
|
|
298
|
+
"dropped"
|
|
299
|
+
];
|
|
300
|
+
/** Statuses of a To-do that is still work to do. */
|
|
301
|
+
const OPEN_TODO_STATUSES = ["open", "in_progress"];
|
|
302
|
+
/** Whether a To-do with this status is still work to do. */
|
|
303
|
+
function isOpenTodoStatus(status) {
|
|
304
|
+
return status === "open" || status === "in_progress";
|
|
305
|
+
}
|
|
306
|
+
/** Model-facing tool that changes the To-dos. */
|
|
307
|
+
const UPDATE_TODOS_TOOL_NAME = "updateTodos";
|
|
308
|
+
/** Assignee text for the list's own agent, in tool results and blocks. */
|
|
309
|
+
const SELF_TODO_ASSIGNEE = "self";
|
|
310
|
+
// src/usage-schema.ts
|
|
311
|
+
const usageCostSchema = z.object({
|
|
312
|
+
input: z.number().finite().nonnegative().optional(),
|
|
313
|
+
output: z.number().finite().nonnegative().optional(),
|
|
314
|
+
cacheRead: z.number().finite().nonnegative().optional(),
|
|
315
|
+
cacheWrite: z.number().finite().nonnegative().optional(),
|
|
316
|
+
total: z.number().finite().nonnegative().optional()
|
|
317
|
+
}).strict();
|
|
318
|
+
const usageSchema = z.object({
|
|
319
|
+
inputTokens: z.number().int().nonnegative().optional(),
|
|
320
|
+
outputTokens: z.number().int().nonnegative().optional(),
|
|
321
|
+
cachedInputTokens: z.number().int().nonnegative().optional(),
|
|
322
|
+
cacheCreationTokens: z.number().int().nonnegative().optional(),
|
|
323
|
+
reasoningTokens: z.number().int().nonnegative().optional(),
|
|
324
|
+
totalTokens: z.number().int().nonnegative().optional(),
|
|
325
|
+
cost: usageCostSchema.optional()
|
|
326
|
+
}).strict();
|
|
274
327
|
// src/chat/scheduled-automations/cadence.ts
|
|
275
328
|
const FORMATTERS = /* @__PURE__ */ new Map();
|
|
276
329
|
function getFormatter(timezone) {
|
|
@@ -1058,15 +1111,6 @@ const conversationKindSchema = z.enum([
|
|
|
1058
1111
|
"thread",
|
|
1059
1112
|
"task"
|
|
1060
1113
|
]);
|
|
1061
|
-
// src/api/schema/conversation-title.ts
|
|
1062
|
-
/** Longest Conversation title that a rename can save. */
|
|
1063
|
-
const CONVERSATION_TITLE_MAX_LENGTH = 200;
|
|
1064
|
-
/** A Conversation title that a caller chooses, at creation or on rename. */
|
|
1065
|
-
const conversationTitleSchema = z.string().trim().min(1).max(200);
|
|
1066
|
-
/** A participant's new title for one Conversation. Every viewer sees it. */
|
|
1067
|
-
const renameConversationBodySchema = z.object({ title: conversationTitleSchema }).strict();
|
|
1068
|
-
/** The stored title after the rename. */
|
|
1069
|
-
const renameConversationResponseSchema = z.object({ title: z.string().min(1) }).strict();
|
|
1070
1114
|
// src/api/schema/conversation-tree-state.ts
|
|
1071
1115
|
/**
|
|
1072
1116
|
* What a Conversation and its child Conversations need, for one viewer.
|
|
@@ -1077,6 +1121,611 @@ const conversationTreeStateSchema = z.enum([
|
|
|
1077
1121
|
"working",
|
|
1078
1122
|
"done"
|
|
1079
1123
|
]);
|
|
1124
|
+
// src/api/schema/space.ts
|
|
1125
|
+
/** The longest Space name, so a form can stop at it. */
|
|
1126
|
+
const SPACE_NAME_MAX_CHARS = 80;
|
|
1127
|
+
/** The longest Space description, so a form can stop at it. */
|
|
1128
|
+
const SPACE_DESCRIPTION_MAX_CHARS = 500;
|
|
1129
|
+
const spaceNameSchema = z.string().trim().min(1).max(80);
|
|
1130
|
+
const spaceDescriptionSchema = z.string().trim().max(500).transform((value) => value || null).nullable();
|
|
1131
|
+
/** Who can read a Space. Only members read a private Space. */
|
|
1132
|
+
const spaceVisibilitySchema = z.enum(["public", "private"]);
|
|
1133
|
+
const spaceParamsSchema = z.object({ spaceId: z.string().uuid() }).strict();
|
|
1134
|
+
const spaceListQuerySchema = z.object({
|
|
1135
|
+
/** `member`, the default, returns only the viewer's Spaces. */
|
|
1136
|
+
membership: z.enum(["member", "all"]).default("member"),
|
|
1137
|
+
archived: z.enum(["true", "false"]).default("false").transform((value) => value === "true")
|
|
1138
|
+
}).strict();
|
|
1139
|
+
const createSpaceBodySchema = z.object({
|
|
1140
|
+
name: spaceNameSchema,
|
|
1141
|
+
description: spaceDescriptionSchema.optional(),
|
|
1142
|
+
visibility: spaceVisibilitySchema.default("public")
|
|
1143
|
+
}).strict();
|
|
1144
|
+
const updateSpaceBodySchema = z.object({
|
|
1145
|
+
name: spaceNameSchema.optional(),
|
|
1146
|
+
description: spaceDescriptionSchema.optional(),
|
|
1147
|
+
visibility: spaceVisibilitySchema.optional()
|
|
1148
|
+
}).strict().refine((body) => body.name !== void 0 || body.description !== void 0 || body.visibility !== void 0, "Change the name or the description.");
|
|
1149
|
+
const archiveSpaceBodySchema = z.object({ archived: z.boolean() }).strict();
|
|
1150
|
+
/** The id and name that label the Space of a Conversation. */
|
|
1151
|
+
const spaceRefSchema = z.object({
|
|
1152
|
+
id: z.string().uuid(),
|
|
1153
|
+
name: z.string().min(1)
|
|
1154
|
+
}).strict();
|
|
1155
|
+
/**
|
|
1156
|
+
* One Space, as the viewer sees it. A viewer sees a private Space only while
|
|
1157
|
+
* they are a member.
|
|
1158
|
+
*/
|
|
1159
|
+
const spaceSchema = z.object({
|
|
1160
|
+
id: z.string().uuid(),
|
|
1161
|
+
name: z.string().min(1),
|
|
1162
|
+
description: z.string().nullable(),
|
|
1163
|
+
visibility: spaceVisibilitySchema,
|
|
1164
|
+
createdAt: z.iso.datetime(),
|
|
1165
|
+
updatedAt: z.iso.datetime(),
|
|
1166
|
+
archivedAt: z.iso.datetime().nullable(),
|
|
1167
|
+
memberCount: z.number().int().nonnegative(),
|
|
1168
|
+
viewerIsMember: z.boolean()
|
|
1169
|
+
}).strict();
|
|
1170
|
+
const spaceListSchema = z.object({ spaces: z.array(spaceSchema) }).strict();
|
|
1171
|
+
// src/chat/conversations/provenance.ts
|
|
1172
|
+
/**
|
|
1173
|
+
* Durable message attribution shared by storage and projections.
|
|
1174
|
+
* Attribution never grants credential authority.
|
|
1175
|
+
*/
|
|
1176
|
+
const conversationMessageAuthoritySchema = z.union([z.literal("instruction"), z.literal("context")]);
|
|
1177
|
+
/** Canonical authority and actor metadata for one durable message event. */
|
|
1178
|
+
const conversationMessageProvenanceSchema = z.object({
|
|
1179
|
+
authority: conversationMessageAuthoritySchema,
|
|
1180
|
+
actor: actorSchema.optional()
|
|
1181
|
+
}).strict();
|
|
1182
|
+
/** Build instruction provenance for an optional actor. */
|
|
1183
|
+
function instructionProvenanceFor(actor) {
|
|
1184
|
+
return actor ? {
|
|
1185
|
+
authority: "instruction",
|
|
1186
|
+
actor
|
|
1187
|
+
} : { authority: "instruction" };
|
|
1188
|
+
}
|
|
1189
|
+
/**
|
|
1190
|
+
* Provenance of an instruction that an agent wrote, such as a parent agent
|
|
1191
|
+
* task in a child Conversation. It has no Actor: it is user intent only for a
|
|
1192
|
+
* Run whose instructions an agent writes.
|
|
1193
|
+
*/
|
|
1194
|
+
const agentInstructionProvenance = { authority: "instruction" };
|
|
1195
|
+
/** Unattributed ambient-context provenance for non-instruction messages. */
|
|
1196
|
+
const contextProvenance = { authority: "context" };
|
|
1197
|
+
function actorIdentityKey(actor) {
|
|
1198
|
+
if (actor.platform === "system") return `system ${actor.name}`;
|
|
1199
|
+
return actor.platform === "slack" ? `slack\u0000${actor.teamId}\u0000${actor.userId}` : `${actor.platform}\u0000${actor.userId}`;
|
|
1200
|
+
}
|
|
1201
|
+
/** Compare two actors by runtime identity only, never by display metadata. */
|
|
1202
|
+
function sameActorIdentity(left, right) {
|
|
1203
|
+
return Boolean(left && right && actorIdentityKey(left) === actorIdentityKey(right));
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* Return distinct instruction actors in first-seen order for attribution only.
|
|
1207
|
+
* Never use this list as credential authority.
|
|
1208
|
+
*/
|
|
1209
|
+
function instructionActors(provenance) {
|
|
1210
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1211
|
+
const actors = [];
|
|
1212
|
+
for (const entry of provenance) {
|
|
1213
|
+
if (entry.authority !== "instruction" || !entry.actor) continue;
|
|
1214
|
+
const identity = actorIdentityKey(entry.actor);
|
|
1215
|
+
if (seen.has(identity)) continue;
|
|
1216
|
+
seen.add(identity);
|
|
1217
|
+
actors.push(entry.actor);
|
|
1218
|
+
}
|
|
1219
|
+
return actors;
|
|
1220
|
+
}
|
|
1221
|
+
// src/chat/conversations/history-payload.ts
|
|
1222
|
+
const messageFieldsSchema = z.record(z.string(), z.unknown());
|
|
1223
|
+
const replacementEntrySchema = z.object({ item: z.string() }).passthrough();
|
|
1224
|
+
/** Identify history events that store message fields as JSON strings. */
|
|
1225
|
+
function isEncodedHistoryType(type) {
|
|
1226
|
+
return type === "user_message" || type === "assistant_message" || type === "tool_result" || type === "system_message" || type === "handoff" || type === "compaction";
|
|
1227
|
+
}
|
|
1228
|
+
/** Encode agent history before SQL can change keys or string contents. */
|
|
1229
|
+
function encodeHistoryPayload(data) {
|
|
1230
|
+
const { type, ...payload } = data;
|
|
1231
|
+
if (!isEncodedHistoryType(type)) return {
|
|
1232
|
+
schemaVersion: 1,
|
|
1233
|
+
payload
|
|
1234
|
+
};
|
|
1235
|
+
if (data.type === "handoff" || data.type === "compaction") return {
|
|
1236
|
+
schemaVersion: 2,
|
|
1237
|
+
payload: {
|
|
1238
|
+
...payload,
|
|
1239
|
+
replacementHistory: data.replacementHistory.map(({ item, ...entry }) => ({
|
|
1240
|
+
...entry,
|
|
1241
|
+
item: JSON.stringify(item)
|
|
1242
|
+
}))
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
const { provenance, ...message } = payload;
|
|
1246
|
+
return {
|
|
1247
|
+
schemaVersion: 2,
|
|
1248
|
+
payload: {
|
|
1249
|
+
message: JSON.stringify(message),
|
|
1250
|
+
provenance,
|
|
1251
|
+
model: message["model"],
|
|
1252
|
+
provider: message["provider"],
|
|
1253
|
+
usage: message["usage"],
|
|
1254
|
+
toolCallId: message["toolCallId"],
|
|
1255
|
+
stopReason: message["stopReason"],
|
|
1256
|
+
timestamp: message["timestamp"],
|
|
1257
|
+
toolName: message["toolName"],
|
|
1258
|
+
isError: message["isError"]
|
|
1259
|
+
}
|
|
1260
|
+
};
|
|
1261
|
+
}
|
|
1262
|
+
/** Decode stored history for validation by the conversation event schema. */
|
|
1263
|
+
function decodeHistoryPayload(type, payload) {
|
|
1264
|
+
const fields = messageFieldsSchema.parse(payload);
|
|
1265
|
+
if (type === "handoff" || type === "compaction") return {
|
|
1266
|
+
...fields,
|
|
1267
|
+
replacementHistory: z.array(replacementEntrySchema).parse(fields["replacementHistory"]).map(({ item, ...entry }) => {
|
|
1268
|
+
const parsedItem = JSON.parse(item);
|
|
1269
|
+
return {
|
|
1270
|
+
...entry,
|
|
1271
|
+
item: parsedItem
|
|
1272
|
+
};
|
|
1273
|
+
})
|
|
1274
|
+
};
|
|
1275
|
+
const message = messageFieldsSchema.parse(JSON.parse(z.string().parse(fields["message"])));
|
|
1276
|
+
if (fields["provenance"] !== void 0) message["provenance"] = fields["provenance"];
|
|
1277
|
+
return message;
|
|
1278
|
+
}
|
|
1279
|
+
// src/chat/conversations/history.ts
|
|
1280
|
+
/**
|
|
1281
|
+
* Durable conversation event history port.
|
|
1282
|
+
*
|
|
1283
|
+
* Events append under the conversation lease in stable sequence order.
|
|
1284
|
+
* Compaction replaces the active model history without rewriting prior
|
|
1285
|
+
* events. Unsupported stored events remain readable as opaque facts,
|
|
1286
|
+
* while malformed known events fail loudly. Provider-specific message fields
|
|
1287
|
+
* are validated by the Pi adapter when it restores model context.
|
|
1288
|
+
*/
|
|
1289
|
+
const userMessageEventDataSchema = z.object({
|
|
1290
|
+
type: z.literal("user_message"),
|
|
1291
|
+
role: z.never().optional(),
|
|
1292
|
+
provenance: conversationMessageProvenanceSchema
|
|
1293
|
+
}).passthrough();
|
|
1294
|
+
const assistantMessageEventDataSchema = z.object({
|
|
1295
|
+
type: z.literal("assistant_message"),
|
|
1296
|
+
role: z.never().optional()
|
|
1297
|
+
}).passthrough();
|
|
1298
|
+
const toolResultEventDataSchema = z.object({
|
|
1299
|
+
type: z.literal("tool_result"),
|
|
1300
|
+
role: z.never().optional()
|
|
1301
|
+
}).passthrough();
|
|
1302
|
+
const systemMessageEventDataSchema = z.object({
|
|
1303
|
+
type: z.literal("system_message"),
|
|
1304
|
+
role: z.never().optional()
|
|
1305
|
+
}).passthrough();
|
|
1306
|
+
/**
|
|
1307
|
+
* One replayable agent-history item. Junior owns `type` and user provenance,
|
|
1308
|
+
* forbids the provider `role` discriminator, and leaves preserved message
|
|
1309
|
+
* fields for the Pi adapter to validate when restoring model context.
|
|
1310
|
+
*/
|
|
1311
|
+
const agentHistoryItemSchema = z.discriminatedUnion("type", [
|
|
1312
|
+
userMessageEventDataSchema,
|
|
1313
|
+
assistantMessageEventDataSchema,
|
|
1314
|
+
toolResultEventDataSchema,
|
|
1315
|
+
systemMessageEventDataSchema
|
|
1316
|
+
]);
|
|
1317
|
+
const nativeReplacementHistoryItemSchema = z.object({
|
|
1318
|
+
item: agentHistoryItemSchema,
|
|
1319
|
+
sourceEventSeq: z.number().int().nonnegative().optional()
|
|
1320
|
+
}).strict();
|
|
1321
|
+
/**
|
|
1322
|
+
* The complete agent history used immediately after a replacement. Later
|
|
1323
|
+
* native history events append to it. Replacement entries are replayed model
|
|
1324
|
+
* history, not new conversation activity.
|
|
1325
|
+
*/
|
|
1326
|
+
const replacementHistorySchema = z.array(nativeReplacementHistoryItemSchema);
|
|
1327
|
+
const compactionDetailsSchema = z.object({
|
|
1328
|
+
reason: z.literal("capacity"),
|
|
1329
|
+
estimatedInputTokens: z.number().int().nonnegative(),
|
|
1330
|
+
replacementInputTokens: z.number().int().nonnegative().optional(),
|
|
1331
|
+
triggerTokens: z.number().int().nonnegative(),
|
|
1332
|
+
inputLimitTokens: z.number().int().positive(),
|
|
1333
|
+
inputMessageCount: z.number().int().nonnegative(),
|
|
1334
|
+
retainedMessageCount: z.number().int().nonnegative(),
|
|
1335
|
+
summaryChars: z.number().int().nonnegative()
|
|
1336
|
+
}).strict();
|
|
1337
|
+
const legacyModelProfileSchema = z.string().min(1).optional();
|
|
1338
|
+
const historyReplacementEventDataSchema = z.object({
|
|
1339
|
+
type: z.literal("compaction"),
|
|
1340
|
+
modelProfile: legacyModelProfileSchema,
|
|
1341
|
+
modelId: z.string().min(1),
|
|
1342
|
+
details: compactionDetailsSchema.optional(),
|
|
1343
|
+
costUsd: z.number().finite().nonnegative().optional(),
|
|
1344
|
+
summary: z.string().min(1).optional(),
|
|
1345
|
+
replacementHistory: replacementHistorySchema
|
|
1346
|
+
}).strict();
|
|
1347
|
+
const legacyHandoffEventDataSchema = z.object({
|
|
1348
|
+
type: z.literal("handoff"),
|
|
1349
|
+
modelProfile: legacyModelProfileSchema,
|
|
1350
|
+
modelId: z.string().min(1),
|
|
1351
|
+
reasoningLevel: z.string().min(1).optional(),
|
|
1352
|
+
triggeringToolCallId: z.string().min(1).optional(),
|
|
1353
|
+
summary: z.string().min(1).optional(),
|
|
1354
|
+
replacementHistory: replacementHistorySchema
|
|
1355
|
+
}).strict();
|
|
1356
|
+
/** Validate an event that intentionally replaces active model history. */
|
|
1357
|
+
const historyReplacementSchema = z.object({
|
|
1358
|
+
data: historyReplacementEventDataSchema,
|
|
1359
|
+
createdAtMs: z.number().finite()
|
|
1360
|
+
}).strict();
|
|
1361
|
+
const mcpProviderConnectedEventDataSchema = z.object({
|
|
1362
|
+
type: z.literal("mcp_provider_connected"),
|
|
1363
|
+
provider: z.string().min(1),
|
|
1364
|
+
credentialSubjectId: z.string().min(1)
|
|
1365
|
+
}).strict();
|
|
1366
|
+
const skillLoadedEventDataSchema = z.object({
|
|
1367
|
+
type: z.literal("skill_loaded"),
|
|
1368
|
+
skillName: z.string().min(1)
|
|
1369
|
+
}).strict();
|
|
1370
|
+
const unownedMcpProviderConnectedEventDataSchema = z.object({
|
|
1371
|
+
type: z.literal("mcp_provider_connected_unowned"),
|
|
1372
|
+
provider: z.string().min(1)
|
|
1373
|
+
}).strict();
|
|
1374
|
+
const authorizationKindSchema = z.union([z.literal("plugin"), z.literal("mcp")]);
|
|
1375
|
+
const authorizationRequestedEventDataSchema = z.object({
|
|
1376
|
+
type: z.literal("authorization_requested"),
|
|
1377
|
+
kind: authorizationKindSchema,
|
|
1378
|
+
provider: z.string().min(1),
|
|
1379
|
+
actorId: z.string().min(1),
|
|
1380
|
+
authorizationId: z.string().min(1),
|
|
1381
|
+
delivery: z.union([z.literal("private_link_sent"), z.literal("private_link_reused")])
|
|
1382
|
+
}).strict();
|
|
1383
|
+
const authorizationCompletedEventDataSchema = z.object({
|
|
1384
|
+
type: z.literal("authorization_completed"),
|
|
1385
|
+
kind: authorizationKindSchema,
|
|
1386
|
+
provider: z.string().min(1),
|
|
1387
|
+
actorId: z.string().min(1),
|
|
1388
|
+
authorizationId: z.string().min(1)
|
|
1389
|
+
}).strict();
|
|
1390
|
+
const toolExecutionStartedEventDataSchema = z.object({
|
|
1391
|
+
type: z.literal("tool_execution_started"),
|
|
1392
|
+
toolCallId: z.string().min(1),
|
|
1393
|
+
toolName: z.string().min(1)
|
|
1394
|
+
}).strict();
|
|
1395
|
+
const guardianActionReviewedEventDataSchema = z.object({
|
|
1396
|
+
type: z.literal("guardian_action_reviewed"),
|
|
1397
|
+
turnId: z.string().min(1),
|
|
1398
|
+
toolCallId: z.string().min(1),
|
|
1399
|
+
toolName: z.string().min(1),
|
|
1400
|
+
costUsd: z.number().finite().nonnegative().optional(),
|
|
1401
|
+
decision: z.enum([
|
|
1402
|
+
"allow",
|
|
1403
|
+
"ask",
|
|
1404
|
+
"deny"
|
|
1405
|
+
]),
|
|
1406
|
+
riskLevel: z.enum([
|
|
1407
|
+
"low",
|
|
1408
|
+
"medium",
|
|
1409
|
+
"high",
|
|
1410
|
+
"critical"
|
|
1411
|
+
]),
|
|
1412
|
+
userAuthorization: z.enum([
|
|
1413
|
+
"high",
|
|
1414
|
+
"medium",
|
|
1415
|
+
"low",
|
|
1416
|
+
"unknown"
|
|
1417
|
+
])
|
|
1418
|
+
}).strict();
|
|
1419
|
+
const conversationMessageRoleSchema = z.union([
|
|
1420
|
+
z.literal("user"),
|
|
1421
|
+
z.literal("assistant"),
|
|
1422
|
+
z.literal("system")
|
|
1423
|
+
]);
|
|
1424
|
+
const messageEventDataSchema = z.object({
|
|
1425
|
+
type: z.literal("message"),
|
|
1426
|
+
messageId: z.string().min(1),
|
|
1427
|
+
role: conversationMessageRoleSchema,
|
|
1428
|
+
text: z.string(),
|
|
1429
|
+
authorIdentityId: z.string().min(1).optional(),
|
|
1430
|
+
meta: z.record(z.string(), z.unknown()).optional()
|
|
1431
|
+
}).strict();
|
|
1432
|
+
const messageUpdatedEventDataSchema = messageEventDataSchema.extend({ type: z.literal("message_updated") });
|
|
1433
|
+
const messageHandledEventDataSchema = z.object({
|
|
1434
|
+
type: z.literal("message_handled"),
|
|
1435
|
+
messageId: z.string().min(1)
|
|
1436
|
+
}).strict();
|
|
1437
|
+
const messagesSummarizedEventDataSchema = z.object({
|
|
1438
|
+
type: z.literal("messages_summarized"),
|
|
1439
|
+
historyFromSeq: z.number().int().nonnegative(),
|
|
1440
|
+
compactions: z.array(z.object({
|
|
1441
|
+
coveredMessageCount: z.number().int().nonnegative(),
|
|
1442
|
+
createdAtMs: z.number(),
|
|
1443
|
+
id: z.string().min(1),
|
|
1444
|
+
summary: z.string()
|
|
1445
|
+
}).strict()).optional()
|
|
1446
|
+
}).strict();
|
|
1447
|
+
/** Product surface that owns a durable conversation turn. */
|
|
1448
|
+
const conversationTurnSurfaceSchema = z.enum([
|
|
1449
|
+
"slack",
|
|
1450
|
+
"api",
|
|
1451
|
+
"scheduler",
|
|
1452
|
+
"internal"
|
|
1453
|
+
]);
|
|
1454
|
+
/** Where a failed turn stopped. */
|
|
1455
|
+
const conversationTurnFailureCodeSchema = z.enum([
|
|
1456
|
+
"agent_run_failed",
|
|
1457
|
+
"delivery_failed",
|
|
1458
|
+
"model_execution_failed",
|
|
1459
|
+
"persistence_failed"
|
|
1460
|
+
]);
|
|
1461
|
+
/**
|
|
1462
|
+
* Why a failed turn stopped.
|
|
1463
|
+
* Values are fixed labels only. Do not store raw exception text.
|
|
1464
|
+
*/
|
|
1465
|
+
const conversationTurnFailureReasonSchema = z.enum([
|
|
1466
|
+
"auth",
|
|
1467
|
+
"permission",
|
|
1468
|
+
"rate_limit",
|
|
1469
|
+
"capacity",
|
|
1470
|
+
"timeout",
|
|
1471
|
+
"network",
|
|
1472
|
+
"server",
|
|
1473
|
+
"invalid_request",
|
|
1474
|
+
"invalid_response",
|
|
1475
|
+
"quota",
|
|
1476
|
+
"content_policy",
|
|
1477
|
+
"unknown",
|
|
1478
|
+
"empty_output",
|
|
1479
|
+
"tool_errors",
|
|
1480
|
+
"suppressed_output",
|
|
1481
|
+
"cut_off_output"
|
|
1482
|
+
]);
|
|
1483
|
+
const turnStartedEventDataSchema = z.object({
|
|
1484
|
+
type: z.literal("turn_started"),
|
|
1485
|
+
turnId: z.string().min(1),
|
|
1486
|
+
inputMessageIds: z.array(z.string().min(1)).min(1),
|
|
1487
|
+
surface: conversationTurnSurfaceSchema,
|
|
1488
|
+
/** Highest Message seq known when the Turn built its thread context. */
|
|
1489
|
+
threadContextThroughSeq: z.number().int().nonnegative().optional()
|
|
1490
|
+
}).strict().refine((data) => new Set(data.inputMessageIds).size === data.inputMessageIds.length, "turn input message ids must be unique");
|
|
1491
|
+
const legacyTurnRoutedEventDataSchema = z.object({
|
|
1492
|
+
type: z.literal("turn_routed"),
|
|
1493
|
+
turnId: z.string().min(1),
|
|
1494
|
+
modelProfile: z.string().min(1),
|
|
1495
|
+
modelId: z.string().min(1),
|
|
1496
|
+
costUsd: z.number().finite().nonnegative().optional(),
|
|
1497
|
+
reasoningLevel: z.string().min(1),
|
|
1498
|
+
confidence: z.number().min(0).max(1).optional(),
|
|
1499
|
+
source: z.string().min(1)
|
|
1500
|
+
}).strict();
|
|
1501
|
+
const turnContextEventDataSchema = z.object({
|
|
1502
|
+
type: z.literal("turn_context"),
|
|
1503
|
+
turnId: z.string().min(1),
|
|
1504
|
+
pluginName: z.string().min(1),
|
|
1505
|
+
kind: z.string().min(1).max(64),
|
|
1506
|
+
version: z.number().int().positive(),
|
|
1507
|
+
content: z.record(z.string(), z.unknown())
|
|
1508
|
+
}).strict();
|
|
1509
|
+
const structuredConversationEventDataSchema = z.object({
|
|
1510
|
+
type: z.literal("structured_event"),
|
|
1511
|
+
namespace: z.string().regex(/^[a-z][a-z0-9-]*$/),
|
|
1512
|
+
name: z.string().regex(/^[a-z][a-z0-9_]*$/),
|
|
1513
|
+
version: z.number().int().positive(),
|
|
1514
|
+
turnId: z.string().min(1).optional(),
|
|
1515
|
+
content: z.record(z.string(), z.unknown())
|
|
1516
|
+
}).strict();
|
|
1517
|
+
/** Durable attachment metadata on host-owned delivery events. */
|
|
1518
|
+
const deliveredAttachmentSchema = z.object({
|
|
1519
|
+
id: z.string().min(1),
|
|
1520
|
+
filename: z.string().min(1),
|
|
1521
|
+
contentType: z.string().min(1),
|
|
1522
|
+
bytes: z.number().int().nonnegative()
|
|
1523
|
+
}).strict();
|
|
1524
|
+
/** Host-owned transcript item for files delivered to humans this turn. */
|
|
1525
|
+
const attachmentsDeliveredEventDataSchema = z.object({
|
|
1526
|
+
type: z.literal("attachments_delivered"),
|
|
1527
|
+
attachments: z.array(deliveredAttachmentSchema).min(1),
|
|
1528
|
+
toolCallId: z.string().min(1).optional(),
|
|
1529
|
+
turnId: z.string().min(1).optional()
|
|
1530
|
+
}).strict();
|
|
1531
|
+
/** Host-owned transcript item for a reply that a plugin tool posted. */
|
|
1532
|
+
const replyPostedEventDataSchema = z.object({
|
|
1533
|
+
type: z.literal("reply_posted"),
|
|
1534
|
+
plugin: z.string().min(1),
|
|
1535
|
+
text: z.string().min(1),
|
|
1536
|
+
url: z.string().url().optional(),
|
|
1537
|
+
toolCallId: z.string().min(1)
|
|
1538
|
+
}).strict();
|
|
1539
|
+
const turnCompletedEventDataSchema = z.object({
|
|
1540
|
+
type: z.literal("turn_completed"),
|
|
1541
|
+
turnId: z.string().min(1),
|
|
1542
|
+
outcome: z.enum([
|
|
1543
|
+
"success",
|
|
1544
|
+
"no_reply",
|
|
1545
|
+
"cancelled",
|
|
1546
|
+
"blocked"
|
|
1547
|
+
])
|
|
1548
|
+
}).strict();
|
|
1549
|
+
const turnFailedEventDataSchema = z.object({
|
|
1550
|
+
type: z.literal("turn_failed"),
|
|
1551
|
+
turnId: z.string().min(1),
|
|
1552
|
+
failureCode: conversationTurnFailureCodeSchema,
|
|
1553
|
+
failureReason: conversationTurnFailureReasonSchema.optional(),
|
|
1554
|
+
eventId: z.string().regex(/^[a-f0-9]{32}$/i).optional()
|
|
1555
|
+
}).strict();
|
|
1556
|
+
const subagentStartedEventDataSchema = z.object({
|
|
1557
|
+
type: z.literal("subagent_started"),
|
|
1558
|
+
subagentInvocationId: z.string().min(1),
|
|
1559
|
+
subagentKind: z.string().min(1),
|
|
1560
|
+
agentName: z.string().min(1).optional(),
|
|
1561
|
+
task: z.string().min(1).optional(),
|
|
1562
|
+
title: z.string().min(1).optional(),
|
|
1563
|
+
modelId: z.string().min(1).optional(),
|
|
1564
|
+
parentToolCallId: z.string().min(1).optional(),
|
|
1565
|
+
reasoningLevel: z.string().min(1).optional(),
|
|
1566
|
+
childConversationId: z.string().min(1)
|
|
1567
|
+
}).strict();
|
|
1568
|
+
const subagentEndedEventDataSchema = z.object({
|
|
1569
|
+
type: z.literal("subagent_ended"),
|
|
1570
|
+
subagentInvocationId: z.string().min(1),
|
|
1571
|
+
outcome: z.union([
|
|
1572
|
+
z.literal("success"),
|
|
1573
|
+
z.literal("blocked"),
|
|
1574
|
+
z.literal("error"),
|
|
1575
|
+
z.literal("aborted")
|
|
1576
|
+
]),
|
|
1577
|
+
errorCode: z.string().min(1).optional()
|
|
1578
|
+
}).strict();
|
|
1579
|
+
const compactionRequestedEventDataSchema = z.object({
|
|
1580
|
+
type: z.literal("compaction_requested"),
|
|
1581
|
+
markSeq: z.number().int().nonnegative(),
|
|
1582
|
+
historyVersion: z.number().int().nonnegative(),
|
|
1583
|
+
modelProfile: legacyModelProfileSchema,
|
|
1584
|
+
modelId: z.string().min(1)
|
|
1585
|
+
}).strict();
|
|
1586
|
+
const compactionPreparedFields = compactionRequestedEventDataSchema.extend({
|
|
1587
|
+
type: z.literal("compaction_prepared"),
|
|
1588
|
+
costUsd: z.number().finite().nonnegative().optional()
|
|
1589
|
+
});
|
|
1590
|
+
const compactionPreparedEventDataSchema = z.discriminatedUnion("outcome", [compactionPreparedFields.extend({
|
|
1591
|
+
outcome: z.literal("ready"),
|
|
1592
|
+
summary: z.string().min(1)
|
|
1593
|
+
}), compactionPreparedFields.extend({
|
|
1594
|
+
outcome: z.literal("failed"),
|
|
1595
|
+
errorType: z.string().min(1).max(64)
|
|
1596
|
+
})]);
|
|
1597
|
+
/** Prevent ordinary appends from bypassing history-replacement validation. */
|
|
1598
|
+
const appendableConversationEventDataSchema = z.union([
|
|
1599
|
+
messageEventDataSchema,
|
|
1600
|
+
messageUpdatedEventDataSchema,
|
|
1601
|
+
agentHistoryItemSchema,
|
|
1602
|
+
mcpProviderConnectedEventDataSchema,
|
|
1603
|
+
skillLoadedEventDataSchema,
|
|
1604
|
+
authorizationRequestedEventDataSchema,
|
|
1605
|
+
authorizationCompletedEventDataSchema,
|
|
1606
|
+
toolExecutionStartedEventDataSchema,
|
|
1607
|
+
guardianActionReviewedEventDataSchema,
|
|
1608
|
+
messageHandledEventDataSchema,
|
|
1609
|
+
messagesSummarizedEventDataSchema,
|
|
1610
|
+
turnStartedEventDataSchema,
|
|
1611
|
+
turnContextEventDataSchema,
|
|
1612
|
+
structuredConversationEventDataSchema,
|
|
1613
|
+
attachmentsDeliveredEventDataSchema,
|
|
1614
|
+
replyPostedEventDataSchema,
|
|
1615
|
+
turnCompletedEventDataSchema,
|
|
1616
|
+
turnFailedEventDataSchema,
|
|
1617
|
+
subagentStartedEventDataSchema,
|
|
1618
|
+
subagentEndedEventDataSchema,
|
|
1619
|
+
compactionRequestedEventDataSchema,
|
|
1620
|
+
compactionPreparedEventDataSchema
|
|
1621
|
+
]);
|
|
1622
|
+
/** Strict event-data contract reused by the SQL row codec. */
|
|
1623
|
+
const conversationEventDataSchema = z.union([
|
|
1624
|
+
appendableConversationEventDataSchema,
|
|
1625
|
+
historyReplacementEventDataSchema,
|
|
1626
|
+
legacyHandoffEventDataSchema,
|
|
1627
|
+
legacyTurnRoutedEventDataSchema,
|
|
1628
|
+
unownedMcpProviderConnectedEventDataSchema
|
|
1629
|
+
]);
|
|
1630
|
+
/** Event type names recognized by current readers and observational queries. */
|
|
1631
|
+
const KNOWN_CONVERSATION_EVENT_TYPES = [
|
|
1632
|
+
"message",
|
|
1633
|
+
"message_updated",
|
|
1634
|
+
"user_message",
|
|
1635
|
+
"assistant_message",
|
|
1636
|
+
"tool_result",
|
|
1637
|
+
"system_message",
|
|
1638
|
+
"mcp_provider_connected",
|
|
1639
|
+
"mcp_provider_connected_unowned",
|
|
1640
|
+
"skill_loaded",
|
|
1641
|
+
"authorization_requested",
|
|
1642
|
+
"authorization_completed",
|
|
1643
|
+
"tool_execution_started",
|
|
1644
|
+
"guardian_action_reviewed",
|
|
1645
|
+
"message_handled",
|
|
1646
|
+
"messages_summarized",
|
|
1647
|
+
"turn_started",
|
|
1648
|
+
"turn_context",
|
|
1649
|
+
"structured_event",
|
|
1650
|
+
"attachments_delivered",
|
|
1651
|
+
"reply_posted",
|
|
1652
|
+
"turn_routed",
|
|
1653
|
+
"turn_completed",
|
|
1654
|
+
"turn_failed",
|
|
1655
|
+
"subagent_started",
|
|
1656
|
+
"subagent_ended",
|
|
1657
|
+
"handoff",
|
|
1658
|
+
"compaction",
|
|
1659
|
+
"compaction_requested",
|
|
1660
|
+
"compaction_prepared"
|
|
1661
|
+
];
|
|
1662
|
+
const knownConversationEventTypeSchema = z.enum(KNOWN_CONVERSATION_EVENT_TYPES);
|
|
1663
|
+
const unknownConversationEventDataSchema = z.object({
|
|
1664
|
+
type: z.literal("unknown"),
|
|
1665
|
+
originalType: z.string().min(1),
|
|
1666
|
+
payload: z.unknown()
|
|
1667
|
+
}).strict();
|
|
1668
|
+
const conversationEventEnvelopeSchema = z.object({
|
|
1669
|
+
schemaVersion: z.number().int().nonnegative(),
|
|
1670
|
+
seq: z.number().int().nonnegative(),
|
|
1671
|
+
historyVersion: z.number().int().nonnegative(),
|
|
1672
|
+
idempotencyKey: z.string().min(1).optional(),
|
|
1673
|
+
createdAtMs: z.number().finite()
|
|
1674
|
+
}).strict();
|
|
1675
|
+
/**
|
|
1676
|
+
* Canonical ordered envelope for the durable conversation log.
|
|
1677
|
+
* `schemaVersion` is persisted with every physical event row.
|
|
1678
|
+
*/
|
|
1679
|
+
const conversationEventSchema = z.union([conversationEventEnvelopeSchema.extend({
|
|
1680
|
+
schemaVersion: z.union([z.literal(1), z.literal(2)]),
|
|
1681
|
+
data: conversationEventDataSchema
|
|
1682
|
+
}).refine((event) => event.schemaVersion === 1 || isEncodedHistoryType(event.data.type)), conversationEventEnvelopeSchema.extend({ data: unknownConversationEventDataSchema })]);
|
|
1683
|
+
const storedConversationEventSchema = conversationEventEnvelopeSchema.extend({
|
|
1684
|
+
type: z.string().min(1),
|
|
1685
|
+
payload: z.unknown()
|
|
1686
|
+
});
|
|
1687
|
+
/**
|
|
1688
|
+
* Decode a physical event row without making old or future event types
|
|
1689
|
+
* unreadable. Unsupported rows stay opaque until an upgrade migration defines
|
|
1690
|
+
* their semantics; supported events remain strict so corrupt canonical
|
|
1691
|
+
* data cannot be mistaken for compatibility data.
|
|
1692
|
+
*/
|
|
1693
|
+
function decodeStoredConversationEvent(value) {
|
|
1694
|
+
const stored = storedConversationEventSchema.parse(value);
|
|
1695
|
+
const { type, payload, ...envelope } = stored;
|
|
1696
|
+
const knownType = knownConversationEventTypeSchema.safeParse(type).success;
|
|
1697
|
+
if (stored.schemaVersion === 2 && isEncodedHistoryType(type)) return conversationEventSchema.parse({
|
|
1698
|
+
...envelope,
|
|
1699
|
+
data: {
|
|
1700
|
+
...decodeHistoryPayload(type, payload),
|
|
1701
|
+
type
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
if (stored.schemaVersion === 1 && knownType) {
|
|
1705
|
+
const data = typeof payload === "object" && payload !== null && !Array.isArray(payload) ? {
|
|
1706
|
+
...payload,
|
|
1707
|
+
type
|
|
1708
|
+
} : { type };
|
|
1709
|
+
return conversationEventSchema.parse({
|
|
1710
|
+
...envelope,
|
|
1711
|
+
data
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
return conversationEventSchema.parse({
|
|
1715
|
+
...envelope,
|
|
1716
|
+
data: {
|
|
1717
|
+
type: "unknown",
|
|
1718
|
+
originalType: type,
|
|
1719
|
+
payload
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
}
|
|
1723
|
+
/** Validate an append without permitting model-history replacement events. */
|
|
1724
|
+
const newConversationEventSchema = z.object({
|
|
1725
|
+
data: appendableConversationEventDataSchema,
|
|
1726
|
+
idempotencyKey: z.string().min(1).optional(),
|
|
1727
|
+
createdAtMs: z.number().finite()
|
|
1728
|
+
}).strict();
|
|
1080
1729
|
// src/chat/agent-invocations/agent-types.ts
|
|
1081
1730
|
/**
|
|
1082
1731
|
* Child agent types. A type is plain data: when to pick it and what the child
|
|
@@ -1096,20 +1745,20 @@ const AGENT_TYPES = ["explore", "reviewer"];
|
|
|
1096
1745
|
const agentTypeSchema = z.string().regex(/^[a-z][a-z0-9_-]*$/);
|
|
1097
1746
|
const AGENT_TYPE_DEFINITIONS = {
|
|
1098
1747
|
explore: {
|
|
1099
|
-
whenToUse: "
|
|
1748
|
+
whenToUse: "investigation across code, docs, logs, telemetry, or the web; returns the conclusion.",
|
|
1100
1749
|
instructions: "You are an explore agent. Investigate, and do not change anything outside your sandbox unless the task asks for it. Back your answer with exact evidence, such as paths, lines, links, and ids."
|
|
1101
1750
|
},
|
|
1102
1751
|
reviewer: {
|
|
1103
|
-
whenToUse: "
|
|
1752
|
+
whenToUse: "an independent second opinion on a change, plan, or claim; give it the evidence, not your conclusion.",
|
|
1104
1753
|
instructions: "You are a reviewer agent. Give an independent assessment. Do not assume that the parent's framing is correct: verify each claim against the evidence. Do not change anything outside your own sandbox. Report concrete problems ranked by severity, each with its evidence, and say clearly when you found none."
|
|
1105
1754
|
}
|
|
1106
1755
|
};
|
|
1107
1756
|
function agentTypeDefinition(type) {
|
|
1108
1757
|
return type && Object.hasOwn(AGENT_TYPE_DEFINITIONS, type) ? AGENT_TYPE_DEFINITIONS[type] : void 0;
|
|
1109
1758
|
}
|
|
1110
|
-
/** Model-facing list of child agent types. */
|
|
1759
|
+
/** Model-facing list of child agent types, short enough for a param. */
|
|
1111
1760
|
function formatAgentTypes() {
|
|
1112
|
-
return AGENT_TYPES.map((type) =>
|
|
1761
|
+
return AGENT_TYPES.map((type) => `${type}: ${AGENT_TYPE_DEFINITIONS[type].whenToUse}`).join(" ");
|
|
1113
1762
|
}
|
|
1114
1763
|
/** Return the instructions that a child of this type reads with its task. */
|
|
1115
1764
|
function agentTypeInstructions(type) {
|
|
@@ -1229,25 +1878,6 @@ const conversationEventsQuerySchema = z.union([
|
|
|
1229
1878
|
limit: conversationEventsLimitSchema
|
|
1230
1879
|
}).strict()
|
|
1231
1880
|
]);
|
|
1232
|
-
/** Client key that makes a retried send the same Message. */
|
|
1233
|
-
const idempotencyKeySchema = z.string().trim().min(1).max(200);
|
|
1234
|
-
const createConversationMessageBodySchema = z.object({
|
|
1235
|
-
idempotencyKey: idempotencyKeySchema,
|
|
1236
|
-
message: z.string().trim().max(32e3),
|
|
1237
|
-
/** Uploads from `POST /api/conversations/attachment-uploads`. */
|
|
1238
|
-
uploadIds: z.array(z.string().min(1).max(64)).max(10).optional()
|
|
1239
|
-
}).strict().refine((body) => Boolean(body.message || body.uploadIds?.length), "Add a message or a file.");
|
|
1240
|
-
const createConversationBodySchema = createConversationMessageBodySchema.safeExtend({
|
|
1241
|
-
/** Saved title. Title generation runs only when it is omitted. */
|
|
1242
|
-
title: conversationTitleSchema.optional(),
|
|
1243
|
-
/** New roots default public. Private roots stay participant-only. */
|
|
1244
|
-
visibility: z.enum(["private", "public"]).optional()
|
|
1245
|
-
});
|
|
1246
|
-
const acceptedConversationMessageSchema = z.object({
|
|
1247
|
-
conversationId: z.string().min(1),
|
|
1248
|
-
messageId: z.string().min(1),
|
|
1249
|
-
status: z.enum(["accepted", "duplicate"])
|
|
1250
|
-
}).strict();
|
|
1251
1881
|
const actorIdentitySchema = z.object({
|
|
1252
1882
|
/**
|
|
1253
1883
|
* Junior API path of the profile photo: the person's Slack photo, then
|
|
@@ -1318,6 +1948,11 @@ const conversationSummaryReportSchema = z.object({
|
|
|
1318
1948
|
parentConversationId: z.string().min(1).optional(),
|
|
1319
1949
|
isParticipant: z.boolean(),
|
|
1320
1950
|
visibility: z.enum(["private", "public"]).optional(),
|
|
1951
|
+
/**
|
|
1952
|
+
* The Space of the root, or null for a one-off. A child is in the Space
|
|
1953
|
+
* of its root. Feed rows and the detail only.
|
|
1954
|
+
*/
|
|
1955
|
+
space: spaceRefSchema.nullable().optional(),
|
|
1321
1956
|
status: conversationReportStatusSchema,
|
|
1322
1957
|
/** Feed rows and the detail only. */
|
|
1323
1958
|
treeState: conversationTreeStateSchema.optional(),
|
|
@@ -2381,4 +3016,4 @@ function isVisionImageMediaType(mediaType) {
|
|
|
2381
3016
|
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
2382
3017
|
return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
|
|
2383
3018
|
}
|
|
2384
|
-
export {
|
|
3019
|
+
export { conversationSummaryReportSchema as $, scheduledRunSchema as $t, automationVersionActivateSchema as A, isAgentUpdateEventType as An, spaceSchema as At, conversationAttachmentParamsSchema as B, removedCardSchema as Bt, automationRunListSchema as C, isEmptyUserInputAnswer as Cn, SPACE_NAME_MAX_CHARS as Ct, automationSchedulePreviewSchema as D, AGENT_MESSAGE_EVENT_TYPE as Dn, spaceListSchema as Dt, automationScheduleIntentSchema as E, AGENT_INVOCATION_EVENT_NAMESPACE as En, spaceListQuerySchema as Et, scheduledAutomationSummarySchema as F, automationTaskText as Fn, inboxItemChangeRecordSchema as Ft, conversationEventHistorySchema as G, messageAttachmentSchema as Gt, conversationAuxiliaryCostsSchema as H, MAX_ATTACHMENT_BYTES as Ht, CONVERSATION_DETAIL_VERSION_HEADER as I, gatewayOnlyProviders as In, annotationCard as It, conversationParamsSchema as J, automationInstructionToolSchema as Jt, conversationEventPageSchema as K, readMessageAttachments as Kt, CONVERSATION_VERSION_HEADER as L, messageCardRef as Lt, automationVersionParamsSchema as M, automationTaskColumns as Mn, updateSpaceBodySchema as Mt, automationVersionSchema as N, automationTaskDescription as Nn, conversationTreeStateSchema as Nt, automationSummarySchema as O, AGENT_UPDATE_EVENT_TYPE as On, spaceParamsSchema as Ot, eventAutomationSummarySchema as P, automationTaskSchema as Pn, conversationReadPositionSchema as Pt, conversationReportStatusSchema as Q, scheduledAutomationSchema as Qt, actorIdentitySchema as R, messageCardText as Rt, automationParamsSchema as S, formatUserInputAnswer as Sn, SPACE_DESCRIPTION_MAX_CHARS as St, automationRunWindowsSchema as T, userInputRequestSchema as Tn, createSpaceBodySchema as Tt, conversationDetailQuerySchema as U, MAX_INPUT_ATTACHMENTS as Ut, conversationAttachmentQuerySchema as V, resolveMessageCards as Vt, conversationDetailReportSchema as W, inputFileSchema as Wt, conversationReportEventSchema as X, taskOutcomeInputSchema as Xt, conversationReportEventDataSchema as Y, automationTitleSchema as Yt, conversationReportMessageEventSchema as Z, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as Zt, automationLifecycleSchema as _, inboxItemRequestSchema as _n, agentInstructionProvenance as _t, DEFAULT_NOTIFICATION_SCHEDULE as a, getFirstRunAtMs as an, agentTypeInstructions as at, automationListQuerySchema as b, answeredChoices as bn, instructionProvenanceFor as bt, CONTENT_VERSION_HEADER as c, isValidTimeZone as cn, KNOWN_CONVERSATION_EVENT_TYPES as ct, automationEditSchema as d, SELF_TODO_ASSIGNEE as dn, conversationTurnFailureCodeSchema as dt, ScheduleIntentError as en, conversationSurfaceSchema as et, automationEventCatalogSchema as f, TODO_STATUSES as fn, conversationTurnFailureReasonSchema as ft, automationExecutionStatusSchema as g, eventAutomationTriggerSchema as gn, encodeHistoryPayload as gt, automationExecutionStatusDaySchema as h, eventAutomationSchema as hn, newConversationEventSchema as ht, isVisionImageMediaType as i, weekdaySchema as in, AGENT_TYPES as it, automationVersionListSchema as j, automationSkillNameSchema as jn, spaceVisibilitySchema as jt, automationUpdateSchema as k, isAgentInvocationResultEventType as kn, spaceRefSchema as kt, apiErrorSchema as l, usageSchema as ln, agentHistoryItemSchema as lt, automationExecutionSchema as m, isOpenTodoStatus as mn, historyReplacementSchema as mt, INPUT_IMAGE_TYPES as n, scheduleIntentFromTool as nn, activityPreviewText as nt, isWithinNotificationSchedule as o, getNextRunAtMs as on, agentTypeSchema as ot, automationExecutionListSchema as p, UPDATE_TODOS_TOOL_NAME as pn, decodeStoredConversationEvent as pt, conversationEventsQuerySchema as q, automationContextToolSchema as qt, detectImageMediaType as r, toolScheduleIntentSchema as rn, conversationChildAgentTotalsSchema as rt, notificationScheduleSchema as s, getZonedDateTimeParts as sn, formatAgentTypes as st, INLINE_VIDEO_TYPES as t, compileScheduleIntent as tn, conversationUsageSchema as tt, automationEditErrorSchema as u, OPEN_TODO_STATUSES as un, conversationEventDataSchema as ut, automationListItemSchema as v, USER_INPUT_LIMITS as vn, contextProvenance as vt, automationRunSchema as w, normalizeUserInputAnswer as wn, archiveSpaceBodySchema as wt, automationListSchema as x, buttonUserInputField as xn, sameActorIdentity as xt, automationListPageSchema as y, USER_INPUT_NOTE as yn, instructionActors as yt, conversationActivityPreviewSchema as z, readMessageCardRefs as zt };
|