@ai-matrx/agents 0.17.4 → 0.17.5

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../mandates/keys.generated.ts","../../mandates/index.ts"],"sourcesContent":["/**\n * GENERATED — DO NOT EDIT. Regenerate with:\n * uv run python scripts/mandates_generate.py (aidream repo; --dry-run also writes this file)\n *\n * THE ONE GENERATOR (`aidream/scripts/mandates_generate.py`, stage (h)) emits this\n * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the\n * boot sync writes to the database from. There is no hand list anywhere.\n *\n * aidream revision: f893e15bbe3a30ac38d895d47388bc24036b2b98\n * generator version: 1.0.0\n * package version: 0.17.4\n * active keys: 543\n * retiring keys: 0\n *\n * THE IDENTIFIER RULE: every `.` in a key becomes `__`, any character outside\n * [A-Za-z0-9_] becomes `_`, a leading digit gets an `_` prefix. So\n * `seo.keyword_classifier` is `MANDATE_KEYS.seo__keyword_classifier`. Collisions are a\n * fatal generator error, never a silently dropped key.\n */\n\n/** Where this module came from — surfaced so a report can name the exact build. */\nexport const MANDATE_KEYS_META = {\n aidreamRevision: \"f893e15bbe3a30ac38d895d47388bc24036b2b98\",\n generatorVersion: \"1.0.0\",\n packageVersion: \"0.17.4\",\n retireWindow: 3,\n} as const;\n\n/** Every declared mandate key, by THE IDENTIFIER RULE. */\nexport const MANDATE_KEYS = {\n agent_apps__auto_create: \"agent_apps.auto_create\",\n agent_apps__auto_create_lightning: \"agent_apps.auto_create_lightning\",\n agent_apps__metadata: \"agent_apps.metadata\",\n agent_apps__prompt_app_dev: \"agent_apps.prompt_app_dev\",\n agent_factory__structure_builder: \"agent_factory.structure_builder\",\n alchemy__prepare_content: \"alchemy.prepare_content\",\n ambient__page_guidance: \"ambient.page_guidance\",\n ambient__spoken_summary: \"ambient.spoken_summary\",\n audio__live_music: \"audio.live_music\",\n audio__speech: \"audio.speech\",\n brand__voice_rewrite: \"brand.voice_rewrite\",\n chat__cx_default: \"chat.cx_default\",\n chat__default_new_chat: \"chat.default_new_chat\",\n chat__quick_audio_plan: \"chat.quick_audio_plan\",\n chat__quick_fair_news: \"chat.quick_fair_news\",\n chat__quick_flashcards: \"chat.quick_flashcards\",\n chat__quick_image: \"chat.quick_image\",\n chat__quick_org_chart: \"chat.quick_org_chart\",\n chat__quick_research: \"chat.quick_research\",\n chat__quick_showcase: \"chat.quick_showcase\",\n chat__quick_writing_partner: \"chat.quick_writing_partner\",\n chat__response_mode_brainstorm: \"chat.response_mode_brainstorm\",\n chat__response_mode_data: \"chat.response_mode_data\",\n chat__response_mode_research: \"chat.response_mode_research\",\n chat__response_mode_video: \"chat.response_mode_video\",\n checks__cleanup_bakeoff__answer: \"checks.cleanup_bakeoff.answer\",\n checks__cleanup_bakeoff__judge: \"checks.cleanup_bakeoff.judge\",\n checks__finding_disposition: \"checks.finding_disposition\",\n checks__finding_disposition_review: \"checks.finding_disposition_review\",\n cms__content_writing: \"cms.content_writing\",\n cms__publish_review: \"cms.publish_review\",\n cms__seo_metadata: \"cms.seo_metadata\",\n cms__site_editing: \"cms.site_editing\",\n cms__theme_design: \"cms.theme_design\",\n code_editor__code_edit: \"code_editor.code_edit\",\n code_editor__dynamic_context_edit: \"code_editor.dynamic_context_edit\",\n code_editor__prompt_app_ui_edit: \"code_editor.prompt_app_ui_edit\",\n coding_session__conversation_responder: \"coding_session.conversation_responder\",\n coding_session__managed_translation_reference: \"coding_session.managed_translation_reference\",\n commerce_intake__assess_value: \"commerce_intake.assess_value\",\n commerce_intake__extract_vision: \"commerce_intake.extract_vision\",\n commerce_intake__grading: \"commerce_intake.grading\",\n commerce_intake__instant_analysis: \"commerce_intake.instant_analysis\",\n commerce_intake__refute_no_value: \"commerce_intake.refute_no_value\",\n commerce_intake__research_product: \"commerce_intake.research_product\",\n commerce_intake__segment_photos: \"commerce_intake.segment_photos\",\n commerce_intake__verify_enrichment: \"commerce_intake.verify_enrichment\",\n content_gate__section_relevance_decision: \"content_gate.section_relevance_decision\",\n content_ir__component_artisan: \"content_ir.component_artisan\",\n content_ir__kind_architect: \"content_ir.kind_architect\",\n content_ir__kind_component_builder: \"content_ir.kind_component_builder\",\n content_ir__kind_creator: \"content_ir.kind_creator\",\n content_plan__branch_purpose: \"content_plan.branch_purpose\",\n content_plan__brief_writer: \"content_plan.brief_writer\",\n content_plan__deepen_page: \"content_plan.deepen_page\",\n content_plan__entity_attacher: \"content_plan.entity_attacher\",\n content_plan__entity_curator: \"content_plan.entity_curator\",\n content_plan__family_namer: \"content_plan.family_namer\",\n content_plan__keyword_strategist: \"content_plan.keyword_strategist\",\n content_plan__merge_wave: \"content_plan.merge_wave\",\n content_plan__p3_family: \"content_plan.p3_family\",\n content_plan__p4_write: \"content_plan.p4_write\",\n content_plan__p5_review: \"content_plan.p5_review\",\n content_plan__p6_build: \"content_plan.p6_build\",\n content_plan__p6_build__about: \"content_plan.p6_build.about\",\n content_plan__p6_build__blog: \"content_plan.p6_build.blog\",\n content_plan__p6_build__comparison: \"content_plan.p6_build.comparison\",\n content_plan__p6_build__contact: \"content_plan.p6_build.contact\",\n content_plan__p6_build__faq: \"content_plan.p6_build.faq\",\n content_plan__p6_build__guide: \"content_plan.p6_build.guide\",\n content_plan__p6_build__home: \"content_plan.p6_build.home\",\n content_plan__p6_build__index: \"content_plan.p6_build.index\",\n content_plan__p6_build__location: \"content_plan.p6_build.location\",\n content_plan__p6_build__pillar: \"content_plan.p6_build.pillar\",\n content_plan__p6_build__pricing: \"content_plan.p6_build.pricing\",\n content_plan__p6_build__service: \"content_plan.p6_build.service\",\n content_plan__plan_reviewer: \"content_plan.plan_reviewer\",\n content_plan__research_wave__audience_journey: \"content_plan.research_wave.audience_journey\",\n content_plan__research_wave__competitor_coverage: \"content_plan.research_wave.competitor_coverage\",\n content_plan__research_wave__keyword_value: \"content_plan.research_wave.keyword_value\",\n content_plan__route_picker: \"content_plan.route_picker\",\n content_plan__shape_planner: \"content_plan.shape_planner\",\n conversation__action_auditor: \"conversation.action_auditor\",\n conversation__decision_ledger: \"conversation.decision_ledger\",\n conversation__drift_auditor: \"conversation.drift_auditor\",\n conversation__label_agent_run: \"conversation.label_agent_run\",\n conversation__label_chat: \"conversation.label_chat\",\n conversation__outcome_summarizer: \"conversation.outcome_summarizer\",\n conversation__vision_extractor: \"conversation.vision_extractor\",\n conversation__vision_interviewer: \"conversation.vision_interviewer\",\n crm__journalist_beat_analyst: \"crm.journalist_beat_analyst\",\n crm__media_list_ranker: \"crm.media_list_ranker\",\n crm__outreach_draft_reviewer: \"crm.outreach_draft_reviewer\",\n crm__outreach_fact_check: \"crm.outreach_fact_check\",\n crm__outreach_personalization_coach: \"crm.outreach_personalization_coach\",\n crm__outreach_personalization_writer: \"crm.outreach_personalization_writer\",\n crm__outreach_pitch_writer: \"crm.outreach_pitch_writer\",\n crm__outreach_recipient_shortlister: \"crm.outreach_recipient_shortlister\",\n crm__outreach_reply_drafter: \"crm.outreach_reply_drafter\",\n crm__outreach_strategy: \"crm.outreach_strategy\",\n crm__party_kind_judge: \"crm.party_kind_judge\",\n crm__save_contact: \"crm.save_contact\",\n data__formula_writing: \"data.formula_writing\",\n data__page_guidance: \"data.page_guidance\",\n data__row_action: \"data.row_action\",\n dictionary__workspace_guide: \"dictionary.workspace_guide\",\n distillation__timeline_distiller: \"distillation.timeline_distiller\",\n distillation__timeline_unfolder: \"distillation.timeline_unfolder\",\n docproc__content_structure: \"docproc.content_structure\",\n education__admin_guidance: \"education.admin_guidance\",\n education__analytics_narrate: \"education.analytics_narrate\",\n education__audio_study_guidance: \"education.audio_study_guidance\",\n education__card_image_generator: \"education.card_image_generator\",\n education__card_image_prompt_writer: \"education.card_image_prompt_writer\",\n education__card_image_qc_judge: \"education.card_image_qc_judge\",\n education__card_image_web_source: \"education.card_image_web_source\",\n education__classes_guidance: \"education.classes_guidance\",\n education__creator_guidance: \"education.creator_guidance\",\n education__data_guidance: \"education.data_guidance\",\n education__exam_prep_guidance: \"education.exam_prep_guidance\",\n education__family_guidance: \"education.family_guidance\",\n education__fastfire_guidance: \"education.fastfire_guidance\",\n education__features_guidance: \"education.features_guidance\",\n education__flashcards_guidance: \"education.flashcards_guidance\",\n education__game_guidance: \"education.game_guidance\",\n education__grade_handwritten: \"education.grade_handwritten\",\n education__grade_work_guidance: \"education.grade_work_guidance\",\n education__kit_title: \"education.kit_title\",\n education__learn_guidance: \"education.learn_guidance\",\n education__levels_guidance: \"education.levels_guidance\",\n education__library_guidance: \"education.library_guidance\",\n education__media_guidance: \"education.media_guidance\",\n education__memory_generate: \"education.memory_generate\",\n education__memory_guidance: \"education.memory_guidance\",\n education__memory_hint: \"education.memory_hint\",\n education__mind_maps_guidance: \"education.mind_maps_guidance\",\n education__mindmap_generate: \"education.mindmap_generate\",\n education__notes_generate: \"education.notes_generate\",\n education__notes_guidance: \"education.notes_guidance\",\n education__offline_guidance: \"education.offline_guidance\",\n education__page_guidance: \"education.page_guidance\",\n education__plan_generate: \"education.plan_generate\",\n education__planner_guidance: \"education.planner_guidance\",\n education__practice_oral_guidance: \"education.practice_oral_guidance\",\n education__practice_tests_guidance: \"education.practice_tests_guidance\",\n education__progress_guidance: \"education.progress_guidance\",\n education__quiz_deepen_item: \"education.quiz_deepen_item\",\n education__quiz_generate: \"education.quiz_generate\",\n education__quiz_generate_from_source: \"education.quiz_generate_from_source\",\n education__quizzes_guidance: \"education.quizzes_guidance\",\n education__spoken_practice_design: \"education.spoken_practice_design\",\n education__spoken_practice_design_language: \"education.spoken_practice_design_language\",\n education__spoken_practice_grade: \"education.spoken_practice_grade\",\n education__spoken_practice_grade_pronunciation: \"education.spoken_practice_grade_pronunciation\",\n education__spoken_practice_review: \"education.spoken_practice_review\",\n education__start_guidance: \"education.start_guidance\",\n education__study_aids_guidance: \"education.study_aids_guidance\",\n education__study_pack_flashcards: \"education.study_pack_flashcards\",\n education__study_pack_lessons: \"education.study_pack_lessons\",\n education__study_pack_notes: \"education.study_pack_notes\",\n education__study_pack_quiz: \"education.study_pack_quiz\",\n education__study_pack_v2_flashcards: \"education.study_pack_v2_flashcards\",\n education__study_pack_v2_lessons: \"education.study_pack_v2_lessons\",\n education__study_pack_v2_notes: \"education.study_pack_v2_notes\",\n education__study_pack_v2_quiz: \"education.study_pack_v2_quiz\",\n education__subjects_guidance: \"education.subjects_guidance\",\n education__summaries_guidance: \"education.summaries_guidance\",\n education__summarize: \"education.summarize\",\n education__tutor_guidance: \"education.tutor_guidance\",\n education__tutor_message: \"education.tutor_message\",\n education__voice_tutor: \"education.voice_tutor\",\n evaluators__comparative_judge: \"evaluators.comparative_judge\",\n evaluators__rubric_judge: \"evaluators.rubric_judge\",\n extend__browser_chat: \"extend.browser_chat\",\n extend__pattern_from_data: \"extend.pattern_from_data\",\n extend__structured_extractor: \"extend.structured_extractor\",\n feedback__item_triage_decision: \"feedback.item_triage_decision\",\n flashcards__enrich_card: \"flashcards.enrich_card\",\n flashcards__expand_card: \"flashcards.expand_card\",\n flashcards__generate_cards: \"flashcards.generate_cards\",\n flashcards__generate_from_source: \"flashcards.generate_from_source\",\n flashcards__grade_spoken: \"flashcards.grade_spoken\",\n flashcards__grade_typed_answer: \"flashcards.grade_typed_answer\",\n flashcards__help_live: \"flashcards.help_live\",\n flashcards__helper_tts: \"flashcards.helper_tts\",\n flashcards__make_quiz_items: \"flashcards.make_quiz_items\",\n flashcards__micro_coach: \"flashcards.micro_coach\",\n flashcards__review_batch: \"flashcards.review_batch\",\n flashcards__spoken_front_tts: \"flashcards.spoken_front_tts\",\n flashcards__verify_against_source: \"flashcards.verify_against_source\",\n foundry__planner: \"foundry.planner\",\n google__channel_video_plan: \"google.channel_video_plan\",\n google__desk_work: \"google.desk_work\",\n google__traffic_change_explanation: \"google.traffic_change_explanation\",\n growth_loop__quality_analyze: \"growth_loop.quality_analyze\",\n growth_loop__quality_brief: \"growth_loop.quality_brief\",\n growth_loop__quality_crawl: \"growth_loop.quality_crawl\",\n growth_loop__quality_fill: \"growth_loop.quality_fill\",\n growth_loop__quality_measure: \"growth_loop.quality_measure\",\n growth_loop__quality_plan: \"growth_loop.quality_plan\",\n growth_loop__quality_publish: \"growth_loop.quality_publish\",\n growth_loop__quality_realize: \"growth_loop.quality_realize\",\n growth_loop__quality_research: \"growth_loop.quality_research\",\n growth_loop__quality_serve: \"growth_loop.quality_serve\",\n growth_loop__quality_suggest: \"growth_loop.quality_suggest\",\n growth_loop__quality_writeback: \"growth_loop.quality_writeback\",\n growth_loop__supervisor: \"growth_loop.supervisor\",\n hindsight__crystallizer: \"hindsight.crystallizer\",\n hindsight__replay_judge: \"hindsight.replay_judge\",\n hindsight__reviewer: \"hindsight.reviewer\",\n human_decisions__fallback_decider: \"human_decisions.fallback_decider\",\n image__generate: \"image.generate\",\n image_pipeline__concept: \"image_pipeline.concept\",\n image_pipeline__prompt_write: \"image_pipeline.prompt_write\",\n image_pipeline__qc_judge: \"image_pipeline.qc_judge\",\n iteration__architect: \"iteration.architect\",\n iteration__diagnostic: \"iteration.diagnostic\",\n iteration__root_cause: \"iteration.root_cause\",\n iteration__thinking_display: \"iteration.thinking_display\",\n kg__cluster_namer: \"kg.cluster_namer\",\n kg__ner_extractor: \"kg.ner_extractor\",\n knowledge__document_verifier: \"knowledge.document_verifier\",\n knowledge__qa_generator: \"knowledge.qa_generator\",\n knowledge__section_summarizer: \"knowledge.section_summarizer\",\n local__answer_question: \"local.answer_question\",\n local__chat_persona_brainstorm: \"local.chat_persona_brainstorm\",\n local__chat_persona_code_review: \"local.chat_persona_code_review\",\n local__chat_persona_explain_simply: \"local.chat_persona_explain_simply\",\n local__chat_persona_helpful: \"local.chat_persona_helpful\",\n local__chat_persona_spoken_replies: \"local.chat_persona_spoken_replies\",\n local__chat_persona_summarize: \"local.chat_persona_summarize\",\n local__chat_persona_transcript_polish: \"local.chat_persona_transcript_polish\",\n local__cloud_chat: \"local.cloud_chat\",\n local__cloud_chat_reply: \"local.cloud_chat_reply\",\n local__confidential_chat: \"local.confidential_chat\",\n local__explain_code: \"local.explain_code\",\n local__extract_action_items: \"local.extract_action_items\",\n local__improve_writing: \"local.improve_writing\",\n local__polish_style_action_items: \"local.polish_style_action_items\",\n local__polish_style_bullets: \"local.polish_style_bullets\",\n local__polish_style_custom: \"local.polish_style_custom\",\n local__polish_style_formal: \"local.polish_style_formal\",\n local__polish_style_light_cleanup: \"local.polish_style_light_cleanup\",\n local__polish_style_meeting_notes: \"local.polish_style_meeting_notes\",\n local__polish_style_standard: \"local.polish_style_standard\",\n local__polish_transcript: \"local.polish_transcript\",\n local__raw_completion: \"local.raw_completion\",\n local__summarize_text: \"local.summarize_text\",\n local__tool_calling_chat: \"local.tool_calling_chat\",\n mandate_outcome__goal_clause_extraction: \"mandate_outcome.goal_clause_extraction\",\n mandate_outcome__goal_fitness_decision: \"mandate_outcome.goal_fitness_decision\",\n mandates__holder_draft: \"mandates.holder_draft\",\n marketing__endowment_analysis: \"marketing.endowment_analysis\",\n marketing__endowment_portfolio: \"marketing.endowment_portfolio\",\n marketing__image_prompt: \"marketing.image_prompt\",\n marketing__page_image: \"marketing.page_image\",\n marketing__page_image_all_in_one: \"marketing.page_image_all_in_one\",\n marketing__video_metadata: \"marketing.video_metadata\",\n masterwork__approach_selector: \"masterwork.approach_selector\",\n masterwork__audition_judge: \"masterwork.audition_judge\",\n masterwork__bad_draft: \"masterwork.bad_draft\",\n masterwork__bad_example_probe: \"masterwork.bad_example_probe\",\n masterwork__case_oracle: \"masterwork.case_oracle\",\n masterwork__checkup_auditor: \"masterwork.checkup_auditor\",\n masterwork__coherence_partner: \"masterwork.coherence_partner\",\n masterwork__conductor: \"masterwork.conductor\",\n masterwork__corpus_cleaner: \"masterwork.corpus_cleaner\",\n masterwork__corpus_synthesizer: \"masterwork.corpus_synthesizer\",\n masterwork__counterparty: \"masterwork.counterparty\",\n masterwork__critique_distiller: \"masterwork.critique_distiller\",\n masterwork__draft_triage: \"masterwork.draft_triage\",\n masterwork__drip_distiller: \"masterwork.drip_distiller\",\n masterwork__drip_question: \"masterwork.drip_question\",\n masterwork__elicitation_judge: \"masterwork.elicitation_judge\",\n masterwork__exception_hunter: \"masterwork.exception_hunter\",\n masterwork__exemplar_distiller: \"masterwork.exemplar_distiller\",\n masterwork__faithfulness_judge: \"masterwork.faithfulness_judge\",\n masterwork__intake_designer: \"masterwork.intake_designer\",\n masterwork__markup_distiller: \"masterwork.markup_distiller\",\n masterwork__meeting_scavenger: \"masterwork.meeting_scavenger\",\n masterwork__monologue_distiller: \"masterwork.monologue_distiller\",\n masterwork__outcome_judge: \"masterwork.outcome_judge\",\n masterwork__pairwise_judge: \"masterwork.pairwise_judge\",\n masterwork__prediction_boundary: \"masterwork.prediction_boundary\",\n masterwork__prediction_distiller: \"masterwork.prediction_distiller\",\n masterwork__relationship_auditor: \"masterwork.relationship_auditor\",\n masterwork__rule_improver: \"masterwork.rule_improver\",\n masterwork__rulebook_auditor: \"masterwork.rulebook_auditor\",\n masterwork__scout: \"masterwork.scout\",\n masterwork__sealed_case_oracle: \"masterwork.sealed_case_oracle\",\n masterwork__sort_case_writer: \"masterwork.sort_case_writer\",\n masterwork__sort_distiller: \"masterwork.sort_distiller\",\n masterwork__source_distiller: \"masterwork.source_distiller\",\n masterwork__teach_back_distiller: \"masterwork.teach_back_distiller\",\n masterwork__teach_back_explainer: \"masterwork.teach_back_explainer\",\n masterwork__template__chief_edit: \"masterwork.template.chief_edit\",\n masterwork__template__chief_generate: \"masterwork.template.chief_generate\",\n masterwork__template__editor: \"masterwork.template.editor\",\n masterwork__template__maker: \"masterwork.template.maker\",\n masterwork__timeline_distiller: \"masterwork.timeline_distiller\",\n masterwork__timeline_segmenter: \"masterwork.timeline_segmenter\",\n masterwork__transcript_distiller: \"masterwork.transcript_distiller\",\n masterwork__transcript_shortlister: \"masterwork.transcript_shortlister\",\n masterwork__triad_distiller: \"masterwork.triad_distiller\",\n masterwork__triad_generator: \"masterwork.triad_generator\",\n masterwork__understudy: \"masterwork.understudy\",\n masterwork__unfolding_judge: \"masterwork.unfolding_judge\",\n masterworks__bench__a2_loop: \"masterworks.bench.a2_loop\",\n masterworks__bench__calibration_decoy: \"masterworks.bench.calibration_decoy\",\n masterworks__bench__consensus: \"masterworks.bench.consensus\",\n masterworks__bench__extract: \"masterworks.bench.extract\",\n masterworks__bench__judge: \"masterworks.bench.judge\",\n masterworks__bench__panel: \"masterworks.bench.panel\",\n masterworks__bench__raw_arm: \"masterworks.bench.raw_arm\",\n masterworks__vanilla_arm__answer_from_facts: \"masterworks.vanilla_arm.answer_from_facts\",\n masterworks__vanilla_arm__best_work: \"masterworks.vanilla_arm.best_work\",\n masterworks__vanilla_arm__outcome_case: \"masterworks.vanilla_arm.outcome_case\",\n masterworks__vanilla_arm__professional_help: \"masterworks.vanilla_arm.professional_help\",\n media__youtube_analyzer: \"media.youtube_analyzer\",\n media_catalog__item_vetting_decision: \"media_catalog.item_vetting_decision\",\n meet__agenda_draft: \"meet.agenda_draft\",\n meet__live_intelligence: \"meet.live_intelligence\",\n meet__live_notes: \"meet.live_notes\",\n meet__pre_meeting_brief: \"meet.pre_meeting_brief\",\n meet__transcription: \"meet.transcription\",\n meet__wrap_up: \"meet.wrap_up\",\n memory__observer: \"memory.observer\",\n memory__reflector: \"memory.reflector\",\n mermaid__diagram_editing: \"mermaid.diagram_editing\",\n messaging__action_item_extraction: \"messaging.action_item_extraction\",\n messaging__conversation_catch_up: \"messaging.conversation_catch_up\",\n messaging__conversation_summary: \"messaging.conversation_summary\",\n messaging__reply_drafting: \"messaging.reply_drafting\",\n ner__deep_chunk_extractor: \"ner.deep_chunk_extractor\",\n ner__document_orienter: \"ner.document_orienter\",\n ner__entity_canonicalizer: \"ner.entity_canonicalizer\",\n ner__finisher: \"ner.finisher\",\n ner__item_proposer: \"ner.item_proposer\",\n ner__magic_moment_detector: \"ner.magic_moment_detector\",\n ner__scope_proposer: \"ner.scope_proposer\",\n ner__scope_slot_filler: \"ner.scope_slot_filler\",\n ner__suggestion_reviewer: \"ner.suggestion_reviewer\",\n ner__sweep_scope_discoverer: \"ner.sweep_scope_discoverer\",\n ner__sweep_scope_reference_finder: \"ner.sweep_scope_reference_finder\",\n ner__sweep_value_miner: \"ner.sweep_value_miner\",\n news__angles: \"news.angles\",\n news__coarse_relevance: \"news.coarse_relevance\",\n news__monitor_setup_proposer: \"news.monitor_setup_proposer\",\n news__report: \"news.report\",\n news__story_origin: \"news.story_origin\",\n news__triage: \"news.triage\",\n notes__organizer: \"notes.organizer\",\n notes__page_guidance: \"notes.page_guidance\",\n observability__tool_trace_pattern_detection: \"observability.tool_trace_pattern_detection\",\n observability__tool_trace_triage: \"observability.tool_trace_triage\",\n orchestras__role_describer: \"orchestras.role_describer\",\n orchestration__tool_failure_standoff_decision: \"orchestration.tool_failure_standoff_decision\",\n pdf__chunk_clean_ocr_text: \"pdf.chunk_clean_ocr_text\",\n pdf__chunk_flashcards_json: \"pdf.chunk_flashcards_json\",\n pdf__chunk_flashcards_typescript: \"pdf.chunk_flashcards_typescript\",\n pdf__content_cleaner: \"pdf.content_cleaner\",\n personal_staff__escalation: \"personal_staff.escalation\",\n personal_staff__front_line: \"personal_staff.front_line\",\n podcast__audience_adapter: \"podcast.audience_adapter\",\n podcast__audio_dialogue: \"podcast.audio_dialogue\",\n podcast__audio_english: \"podcast.audio_english\",\n podcast__audio_persian: \"podcast.audio_persian\",\n podcast__chapter_marker: \"podcast.chapter_marker\",\n podcast__content_extractor: \"podcast.content_extractor\",\n podcast__deep_research: \"podcast.deep_research\",\n podcast__image_v1: \"podcast.image_v1\",\n podcast__image_v2: \"podcast.image_v2\",\n podcast__image_v3: \"podcast.image_v3\",\n podcast__image_v4: \"podcast.image_v4\",\n podcast__image_v5: \"podcast.image_v5\",\n podcast__image_v6_feature: \"podcast.image_v6_feature\",\n podcast__image_v6_feature_prompt: \"podcast.image_v6_feature_prompt\",\n podcast__live_rewrite: \"podcast.live_rewrite\",\n podcast__metadata: \"podcast.metadata\",\n podcast__multihost_script: \"podcast.multihost_script\",\n podcast__post_prep_expansion: \"podcast.post_prep_expansion\",\n podcast__post_prep_fact_checking: \"podcast.post_prep_fact_checking\",\n podcast__post_prep_summarization: \"podcast.post_prep_summarization\",\n podcast__post_prep_translation: \"podcast.post_prep_translation\",\n podcast__race_frontier: \"podcast.race_frontier\",\n podcast__relevance_gate: \"podcast.relevance_gate\",\n podcast__roundtable_script: \"podcast.roundtable_script\",\n podcast__script_educational: \"podcast.script_educational\",\n podcast__script_news: \"podcast.script_news\",\n podcast__script_persian: \"podcast.script_persian\",\n podcast__solo_script: \"podcast.solo_script\",\n podcast__title_optimizer: \"podcast.title_optimizer\",\n podcast__video_v1: \"podcast.video_v1\",\n podcast__video_v2: \"podcast.video_v2\",\n podcast_client__blog_writer: \"podcast_client.blog_writer\",\n podcast_client__show_notes: \"podcast_client.show_notes\",\n podcast_client__topic_ideas: \"podcast_client.topic_ideas\",\n podcast_client__web_content_extractor: \"podcast_client.web_content_extractor\",\n podcast_client__youtube_research: \"podcast_client.youtube_research\",\n product_capture__instant_analysis: \"product_capture.instant_analysis\",\n projects__creation_guide: \"projects.creation_guide\",\n proof_runs__judge: \"proof_runs.judge\",\n purpose__writer: \"purpose.writer\",\n rag__chunk_contextualizer: \"rag.chunk_contextualizer\",\n rag__grounded_synthesis: \"rag.grounded_synthesis\",\n rag__grounding_claim_extract: \"rag.grounding_claim_extract\",\n rag__grounding_judge: \"rag.grounding_judge\",\n rag__hyde_generator: \"rag.hyde_generator\",\n rag__image_caption: \"rag.image_caption\",\n rag__pdf_page_cleaner: \"rag.pdf_page_cleaner\",\n rag__query_expander: \"rag.query_expander\",\n rag_kinds__grounded_synthesis: \"rag_kinds.grounded_synthesis\",\n records__enrichment: \"records.enrichment\",\n research__auto_tagger: \"research.auto_tagger\",\n research__condenser_1: \"research.condenser_1\",\n research__condenser_2: \"research.condenser_2\",\n research__coverage_audit: \"research.coverage_audit\",\n research__cross_cutting_tags: \"research.cross_cutting_tags\",\n research__document_assembly: \"research.document_assembly\",\n research__keyword_synthesis: \"research.keyword_synthesis\",\n research__report: \"research.report\",\n research__report_updater: \"research.report_updater\",\n research__source_authority: \"research.source_authority\",\n research__source_triage_decision: \"research.source_triage_decision\",\n research__structured_page_summary: \"research.structured_page_summary\",\n research__suggest_setup: \"research.suggest_setup\",\n research__tag_consolidation: \"research.tag_consolidation\",\n research__topic_deep_research: \"research.topic_deep_research\",\n research_client__output_blog: \"research_client.output_blog\",\n research_client__output_brand_profile: \"research_client.output_brand_profile\",\n research_client__output_competitive_landscape: \"research_client.output_competitive_landscape\",\n research_client__output_gap_analysis: \"research_client.output_gap_analysis\",\n research_client__output_literature_review: \"research_client.output_literature_review\",\n research_client__output_reputation_business: \"research_client.output_reputation_business\",\n research_client__output_reputation_personal: \"research_client.output_reputation_personal\",\n research_client__output_seo: \"research_client.output_seo\",\n research_client__output_slides: \"research_client.output_slides\",\n scraper__fact_check: \"scraper.fact_check\",\n scraper__keyword_analysis: \"scraper.keyword_analysis\",\n scraper__page_fetch_verdict: \"scraper.page_fetch_verdict\",\n seo__ai_visibility_blind_question_writer: \"seo.ai_visibility_blind_question_writer\",\n seo__ai_visibility_buyer_jobs: \"seo.ai_visibility_buyer_jobs\",\n seo__ai_visibility_decision_analyst: \"seo.ai_visibility_decision_analyst\",\n seo__ai_visibility_evidence_icp: \"seo.ai_visibility_evidence_icp\",\n seo__ai_visibility_panel_designer: \"seo.ai_visibility_panel_designer\",\n seo__ai_visibility_panel_report: \"seo.ai_visibility_panel_report\",\n seo__ai_visibility_question_architect: \"seo.ai_visibility_question_architect\",\n seo__ai_visibility_question_qa: \"seo.ai_visibility_question_qa\",\n seo__ai_visibility_writing_audit: \"seo.ai_visibility_writing_audit\",\n seo__backlink_analysis: \"seo.backlink_analysis\",\n seo__backlink_context_assessor: \"seo.backlink_context_assessor\",\n seo__backlink_work_planner: \"seo.backlink_work_planner\",\n seo__business_model_verdict: \"seo.business_model_verdict\",\n seo__competitor_classifier: \"seo.competitor_classifier\",\n seo__competitor_opportunity_autopsy: \"seo.competitor_opportunity_autopsy\",\n seo__competitor_page_autopsy: \"seo.competitor_page_autopsy\",\n seo__coverage_analyst: \"seo.coverage_analyst\",\n seo__digital_pr_reputation_adjudicator: \"seo.digital_pr_reputation_adjudicator\",\n seo__evidence_workbench: \"seo.evidence_workbench\",\n seo__finding_fixer: \"seo.finding_fixer\",\n seo__guidelines_drafter: \"seo.guidelines_drafter\",\n seo__ideal_customer_profile: \"seo.ideal_customer_profile\",\n seo__keyword_classifier: \"seo.keyword_classifier\",\n seo__keyword_expander: \"seo.keyword_expander\",\n seo__keyword_researcher: \"seo.keyword_researcher\",\n seo__keyword_serp_intent_analyst: \"seo.keyword_serp_intent_analyst\",\n seo__landscape_brief: \"seo.landscape_brief\",\n seo__map_author: \"seo.map_author\",\n seo__map_curation: \"seo.map_curation\",\n seo__money_map: \"seo.money_map\",\n seo__offering_extraction: \"seo.offering_extraction\",\n seo__offering_valuation: \"seo.offering_valuation\",\n seo__page_analyzer: \"seo.page_analyzer\",\n seo__page_intent_proposer: \"seo.page_intent_proposer\",\n seo__page_keyword_mapper: \"seo.page_keyword_mapper\",\n seo__page_mapper: \"seo.page_mapper\",\n seo__press_calendar_planner: \"seo.press_calendar_planner\",\n seo__press_clip_reviewer: \"seo.press_clip_reviewer\",\n seo__press_headlines: \"seo.press_headlines\",\n seo__press_moment_researcher: \"seo.press_moment_researcher\",\n seo__press_newsworthiness_check: \"seo.press_newsworthiness_check\",\n seo__press_source_request_responder: \"seo.press_source_request_responder\",\n seo__press_story_analyst: \"seo.press_story_analyst\",\n seo__press_strategist: \"seo.press_strategist\",\n seo__reputation_crisis_holding: \"seo.reputation_crisis_holding\",\n seo__session_rule_writer: \"seo.session_rule_writer\",\n seo__session_stamp_proposer: \"seo.session_stamp_proposer\",\n seo__site_intake: \"seo.site_intake\",\n seo__site_link_authority_router: \"seo.site_link_authority_router\",\n seo__site_strategist: \"seo.site_strategist\",\n seo__starter_pack_proposer: \"seo.starter_pack_proposer\",\n seo__strategy__site_brief__generate: \"seo.strategy.site_brief.generate\",\n seo__topic_assigner: \"seo.topic_assigner\",\n seo__topic_curation: \"seo.topic_curation\",\n sms__owner_beta: \"sms.owner_beta\",\n surfaces_client__binding_mapper: \"surfaces_client.binding_mapper\",\n tasks__triage: \"tasks.triage\",\n tool_viz__component_generator: \"tool_viz.component_generator\",\n tools__summarize_content: \"tools.summarize_content\",\n transcript_studio__document_edit: \"transcript_studio.document_edit\",\n transcript_studio__scribe_live: \"transcript_studio.scribe_live\",\n transcripts__clean_with_context: \"transcripts.clean_with_context\",\n transcripts__clean_with_context_variable: \"transcripts.clean_with_context_variable\",\n transcripts__clean_without_context: \"transcripts.clean_without_context\",\n vision_interview__adversary: \"vision_interview.adversary\",\n vision_interview__amplifier: \"vision_interview.amplifier\",\n vision_interview__answer_tracker: \"vision_interview.answer_tracker\",\n vision_interview__archaeologist: \"vision_interview.archaeologist\",\n vision_interview__architect: \"vision_interview.architect\",\n vision_interview__cartographer: \"vision_interview.cartographer\",\n vision_interview__requirements_author: \"vision_interview.requirements_author\",\n vision_interview__scribe: \"vision_interview.scribe\",\n vision_interview__sounding_board: \"vision_interview.sounding_board\",\n vision_interview__transcript_cleaner: \"vision_interview.transcript_cleaner\",\n vision_interview__vision_author: \"vision_interview.vision_author\",\n voice__communicator: \"voice.communicator\",\n voice__gemini_live: \"voice.gemini_live\",\n voice__intro: \"voice.intro\",\n voice__owner_beta: \"voice.owner_beta\",\n war_room__master: \"war_room.master\",\n war_room__room: \"war_room.room\",\n war_room__thread: \"war_room.thread\",\n web__endpoint_family_judge: \"web.endpoint_family_judge\",\n workflow__complex_research__keyword_synthesis: \"workflow.complex_research.keyword_synthesis\",\n workflow__complex_research__page_summary: \"workflow.complex_research.page_summary\",\n workflow__complex_research__report: \"workflow.complex_research.report\",\n workflow__conductor: \"workflow.conductor\",\n workflow__deep_research__keyword_synthesis: \"workflow.deep_research.keyword_synthesis\",\n workflow__extract_namer: \"workflow.extract_namer\",\n workflow__plan_design: \"workflow.plan_design\",\n workflow__plan_input_kind_authoring: \"workflow.plan_input_kind_authoring\",\n workflow__plan_node_type_recommender: \"workflow.plan_node_type_recommender\",\n workflow__plan_notes_writer: \"workflow.plan_notes_writer\",\n workflow__plan_output_kind_authoring: \"workflow.plan_output_kind_authoring\",\n workflow__recovery_advisor: \"workflow.recovery_advisor\",\n workflow__run_assist_suggester: \"workflow.run_assist_suggester\",\n workflow__step_intelligence: \"workflow.step_intelligence\",\n workflow__steward: \"workflow.steward\",\n workflow__steward__agent_run: \"workflow.steward.agent_run\",\n workflow__steward__data: \"workflow.steward.data\",\n workflow__steward__decision: \"workflow.steward.decision\",\n workflow__steward__user_input: \"workflow.steward.user_input\",\n workflow__wizard__agent_run: \"workflow.wizard.agent_run\",\n} as const;\n\n/** Every key this package version accepts — active plus retiring. */\nexport type MandateKey = (typeof MANDATE_KEYS)[keyof typeof MANDATE_KEYS];\n\n/** The key set as a runtime array, in generated order. */\nexport const ALL_MANDATE_KEYS: readonly MandateKey[] = Object.values(MANDATE_KEYS) as readonly MandateKey[];\n\n/** Keys still in the union but no longer declared (two-phase retire, phase 1). */\nexport const RETIRING_MANDATE_KEYS = {\n} as const;\n\n/**\n * Declared FAMILIES — a prefix the feature's own roster owns, and its members.\n * Emitted from `declared_families()` (aidream `services/mandates/carriers.py`).\n */\nexport const MANDATE_FAMILIES = {\n \"ambient.page_guidance_overrides\": [\n \"data.page_guidance\",\n \"education.admin_guidance\",\n \"education.audio_study_guidance\",\n \"education.classes_guidance\",\n \"education.creator_guidance\",\n \"education.data_guidance\",\n \"education.exam_prep_guidance\",\n \"education.family_guidance\",\n \"education.fastfire_guidance\",\n \"education.features_guidance\",\n \"education.flashcards_guidance\",\n \"education.game_guidance\",\n \"education.grade_work_guidance\",\n \"education.learn_guidance\",\n \"education.levels_guidance\",\n \"education.library_guidance\",\n \"education.media_guidance\",\n \"education.memory_guidance\",\n \"education.mind_maps_guidance\",\n \"education.notes_guidance\",\n \"education.offline_guidance\",\n \"education.page_guidance\",\n \"education.planner_guidance\",\n \"education.practice_oral_guidance\",\n \"education.practice_tests_guidance\",\n \"education.progress_guidance\",\n \"education.quizzes_guidance\",\n \"education.start_guidance\",\n \"education.study_aids_guidance\",\n \"education.subjects_guidance\",\n \"education.summaries_guidance\",\n \"education.tutor_guidance\",\n \"notes.page_guidance\",\n ],\n \"checks.cleanup_bakeoff\": [\n \"checks.cleanup_bakeoff.answer\",\n \"checks.cleanup_bakeoff.judge\",\n ],\n \"content_plan.p6_build\": [\n \"content_plan.p6_build.about\",\n \"content_plan.p6_build.blog\",\n \"content_plan.p6_build.comparison\",\n \"content_plan.p6_build.contact\",\n \"content_plan.p6_build.faq\",\n \"content_plan.p6_build.guide\",\n \"content_plan.p6_build.home\",\n \"content_plan.p6_build.index\",\n \"content_plan.p6_build.location\",\n \"content_plan.p6_build.pillar\",\n \"content_plan.p6_build.pricing\",\n \"content_plan.p6_build.service\",\n ],\n \"content_plan.research_wave\": [\n \"content_plan.research_wave.audience_journey\",\n \"content_plan.research_wave.competitor_coverage\",\n \"content_plan.research_wave.keyword_value\",\n ],\n \"conversation\": [\n \"conversation.action_auditor\",\n \"conversation.decision_ledger\",\n \"conversation.drift_auditor\",\n \"conversation.outcome_summarizer\",\n \"conversation.vision_extractor\",\n \"conversation.vision_interviewer\",\n ],\n \"masterworks.bench\": [\n \"masterworks.bench.a2_loop\",\n \"masterworks.bench.calibration_decoy\",\n \"masterworks.bench.consensus\",\n \"masterworks.bench.extract\",\n \"masterworks.bench.judge\",\n \"masterworks.bench.panel\",\n \"masterworks.bench.raw_arm\",\n ],\n \"masterworks.vanilla_arm\": [\n \"masterworks.vanilla_arm.answer_from_facts\",\n \"masterworks.vanilla_arm.best_work\",\n \"masterworks.vanilla_arm.outcome_case\",\n \"masterworks.vanilla_arm.professional_help\",\n ],\n \"vision_interview\": [\n \"vision_interview.adversary\",\n \"vision_interview.amplifier\",\n \"vision_interview.answer_tracker\",\n \"vision_interview.archaeologist\",\n \"vision_interview.architect\",\n \"vision_interview.cartographer\",\n \"vision_interview.requirements_author\",\n \"vision_interview.scribe\",\n \"vision_interview.sounding_board\",\n \"vision_interview.transcript_cleaner\",\n \"vision_interview.vision_author\",\n ],\n} as const;\n\nexport type MandateFamilyPrefix = keyof typeof MANDATE_FAMILIES;\n\n/** Members of a declared family, typed as real keys. */\nexport type MandateFamilyMember<P extends MandateFamilyPrefix> =\n (typeof MANDATE_FAMILIES)[P][number];\n\n/**\n * THE DYNAMIC FAMILIES — DB-authored (`mandate.definition` origin='user'). No\n * generated union can contain them, so their accessors return a BRANDED\n * `DynamicMandateKey`, deliberately NOT assignable to `MandateKey`: a carrier that\n * demands a declared key still refuses one, and a carrier that accepts either\n * says so in its own signature (`MandateKey | DynamicMandateKey`).\n */\ndeclare const dynamicMandateKeyBrand: unique symbol;\n\nexport type DynamicMandateKey = string & {\n readonly [dynamicMandateKeyBrand]: true;\n};\n\nexport const DYNAMIC_MANDATE_FAMILIES = {\n \"app\": { prefix: \"app\", note: \"One mandate per user-built app (`mandate.definition` origin='user').\" },\n \"shortcut\": { prefix: \"shortcut\", note: \"One mandate per user-authored shortcut (origin='user').\" },\n} as const;\n\nexport type DynamicMandateFamilyPrefix = keyof typeof DYNAMIC_MANDATE_FAMILIES;\n\nconst DYNAMIC_SLUG = /^[a-z0-9]+(?:_[a-z0-9]+)*$/;\n\nfunction dynamicKey(\n prefix: DynamicMandateFamilyPrefix,\n ...slugs: readonly (string | undefined)[]\n): DynamicMandateKey {\n const parts = slugs.filter((slug): slug is string => slug !== undefined);\n if (parts.length === 0) {\n throw new Error(\n `mandate family \"${prefix}\" needs at least a member slug — it was given none.`,\n );\n }\n for (const slug of parts) {\n if (!DYNAMIC_SLUG.test(slug)) {\n throw new Error(\n `mandate family \"${prefix}\" cannot name a member from ` +\n `${JSON.stringify(slug)}: a segment is lowercase words joined by single ` +\n \"underscores. Pass the slug the row carries, never a display name.\",\n );\n }\n }\n return [prefix, ...parts].join(\".\") as DynamicMandateKey;\n}\n\n/**\n * The mandate key of a user-built app. DB-authored — never a declared key.\n * `surfaceSlug` names the per-surface row a few apps carry\n * (`app.<app>.<surface>`); omit it for the app's own mandate.\n */\nexport function mandateKeyOfApp(\n appSlug: string,\n surfaceSlug?: string,\n): DynamicMandateKey {\n return dynamicKey(\"app\", appSlug, surfaceSlug);\n}\n\n/**\n * The mandate key of a user-authored shortcut. DB-authored. `surfaceSlug` names\n * the per-surface row (`shortcut.<shortcut>.<surface>`), which is how most live\n * shortcut rows are keyed; omit it for the shortcut's own mandate.\n */\nexport function mandateKeyOfShortcut(\n shortcutSlug: string,\n surfaceSlug?: string,\n): DynamicMandateKey {\n return dynamicKey(\"shortcut\", shortcutSlug, surfaceSlug);\n}\n","/**\n * `@ai-matrx/agents/mandates` — the ONE place a TypeScript client learns a\n * mandate key.\n *\n * 🚨 **Clients never declare a mandate.** aidream's `declare_mandate` is the\n * only declaration path in the system; this subpath publishes the key set that\n * declaration produced, so a hand-typed `\"seo.keyword_cluster\"` literal, a local\n * `mandates.ts` mirror, or an `as MandateKey` cast is a defect with a real\n * replacement — not a style preference. Every carrier that takes a key should\n * type it `MandateKey` (or `MandateKey | DynamicMandateKey` when it genuinely\n * accepts a DB-authored one) so a wrong key fails type-check instead of failing\n * at run time as a 404 nobody sees.\n *\n * The key data lives in `keys.generated.ts`, emitted by THE ONE GENERATOR\n * (`aidream/scripts/mandates_generate.py`, stage (h)) from the in-process\n * declarations — never edit it. The per-version key set that shipped with each\n * published version is committed beside it under `snapshots/`, so a scan can\n * resolve a client's references against the key set of the version it actually\n * ships (Mandate Declaration & Usage Reporting, DESIGN § 4.5 step 2).\n */\n\nexport {\n ALL_MANDATE_KEYS,\n DYNAMIC_MANDATE_FAMILIES,\n MANDATE_FAMILIES,\n MANDATE_KEYS,\n MANDATE_KEYS_META,\n RETIRING_MANDATE_KEYS,\n mandateKeyOfApp,\n mandateKeyOfShortcut,\n type DynamicMandateFamilyPrefix,\n type DynamicMandateKey,\n type MandateFamilyMember,\n type MandateFamilyPrefix,\n type MandateKey,\n} from \"./keys.generated\";\n\nimport {\n ALL_MANDATE_KEYS,\n MANDATE_KEYS_META,\n type MandateKey,\n} from \"./keys.generated\";\n\nconst KEY_SET: ReadonlySet<string> = new Set<string>(ALL_MANDATE_KEYS);\n\n/**\n * Narrow an unknown string to a declared `MandateKey`.\n *\n * Use it on anything that crossed a wire — a URL segment, a stored preference,\n * a row's `mandate_key` column. It answers only for the key set THIS package\n * version ships; a key declared after this version was published is correctly\n * `false` here, which is the point of the per-version snapshots.\n */\nexport function isMandateKey(value: unknown): value is MandateKey {\n return typeof value === \"string\" && KEY_SET.has(value);\n}\n\n/**\n * Assert an unknown value is a declared `MandateKey`, or throw with a remedy.\n *\n * Nothing fails silently: the message names the value, the package version its\n * key set came from, and what to do — never a bare \"invalid key\".\n */\nexport function assertMandateKey(\n value: unknown,\n context?: string,\n): asserts value is MandateKey {\n if (isMandateKey(value)) return;\n const where = context ? ` at ${context}` : \"\";\n throw new Error(\n `${JSON.stringify(value)} is not a declared mandate key${where}. ` +\n `@ai-matrx/agents@${MANDATE_KEYS_META.packageVersion} ships ` +\n `${ALL_MANDATE_KEYS.length} keys (aidream ${MANDATE_KEYS_META.aidreamRevision.slice(0, 12)}). ` +\n \"If the key is real, this package is behind — take `latest` and re-check. \" +\n \"If it is a user-built app or shortcut, it is DB-authored: build it with \" +\n \"mandateKeyOfApp() / mandateKeyOfShortcut(), which return DynamicMandateKey.\",\n );\n}\n"],"mappings":";AAqBO,IAAM,oBAAoB;AAAA,EAC/B,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAGO,IAAM,eAAe;AAAA,EAC1B,yBAAyB;AAAA,EACzB,mCAAmC;AAAA,EACnC,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,0BAA0B;AAAA,EAC1B,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,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ourcesContent":["/**\n * GENERATED — DO NOT EDIT. Regenerate with:\n * uv run python scripts/mandates_generate.py (aidream repo; --dry-run also writes this file)\n *\n * THE ONE GENERATOR (`aidream/scripts/mandates_generate.py`, stage (h)) emits this\n * from the IN-PROCESS mandate declarations — the same `declared_mandates()` the\n * boot sync writes to the database from. There is no hand list anywhere.\n *\n * aidream revision: 33949e0fad5025808c9048ac19e11101870136d1\n * generator version: 1.0.0\n * package version: 0.17.5\n * active keys: 543\n * retiring keys: 0\n *\n * THE IDENTIFIER RULE: every `.` in a key becomes `__`, any character outside\n * [A-Za-z0-9_] becomes `_`, a leading digit gets an `_` prefix. So\n * `seo.keyword_classifier` is `MANDATE_KEYS.seo__keyword_classifier`. Collisions are a\n * fatal generator error, never a silently dropped key.\n */\n\n/** Where this module came from — surfaced so a report can name the exact build. */\nexport const MANDATE_KEYS_META = {\n aidreamRevision: \"33949e0fad5025808c9048ac19e11101870136d1\",\n generatorVersion: \"1.0.0\",\n packageVersion: \"0.17.5\",\n retireWindow: 3,\n} as const;\n\n/** Every declared mandate key, by THE IDENTIFIER RULE. */\nexport const MANDATE_KEYS = {\n agent_apps__auto_create: \"agent_apps.auto_create\",\n agent_apps__auto_create_lightning: \"agent_apps.auto_create_lightning\",\n agent_apps__metadata: \"agent_apps.metadata\",\n agent_apps__prompt_app_dev: \"agent_apps.prompt_app_dev\",\n agent_factory__structure_builder: \"agent_factory.structure_builder\",\n alchemy__prepare_content: \"alchemy.prepare_content\",\n ambient__page_guidance: \"ambient.page_guidance\",\n ambient__spoken_summary: \"ambient.spoken_summary\",\n audio__live_music: \"audio.live_music\",\n audio__speech: \"audio.speech\",\n brand__voice_rewrite: \"brand.voice_rewrite\",\n chat__cx_default: \"chat.cx_default\",\n chat__default_new_chat: \"chat.default_new_chat\",\n chat__quick_audio_plan: \"chat.quick_audio_plan\",\n chat__quick_fair_news: \"chat.quick_fair_news\",\n chat__quick_flashcards: \"chat.quick_flashcards\",\n chat__quick_image: \"chat.quick_image\",\n chat__quick_org_chart: \"chat.quick_org_chart\",\n chat__quick_research: \"chat.quick_research\",\n chat__quick_showcase: \"chat.quick_showcase\",\n chat__quick_writing_partner: \"chat.quick_writing_partner\",\n chat__response_mode_brainstorm: \"chat.response_mode_brainstorm\",\n chat__response_mode_data: \"chat.response_mode_data\",\n chat__response_mode_research: \"chat.response_mode_research\",\n chat__response_mode_video: \"chat.response_mode_video\",\n checks__cleanup_bakeoff__answer: \"checks.cleanup_bakeoff.answer\",\n checks__cleanup_bakeoff__judge: \"checks.cleanup_bakeoff.judge\",\n checks__finding_disposition: \"checks.finding_disposition\",\n checks__finding_disposition_review: \"checks.finding_disposition_review\",\n cms__content_writing: \"cms.content_writing\",\n cms__publish_review: \"cms.publish_review\",\n cms__seo_metadata: \"cms.seo_metadata\",\n cms__site_editing: \"cms.site_editing\",\n cms__theme_design: \"cms.theme_design\",\n code_editor__code_edit: \"code_editor.code_edit\",\n code_editor__dynamic_context_edit: \"code_editor.dynamic_context_edit\",\n code_editor__prompt_app_ui_edit: \"code_editor.prompt_app_ui_edit\",\n coding_session__conversation_responder: \"coding_session.conversation_responder\",\n coding_session__managed_translation_reference: \"coding_session.managed_translation_reference\",\n commerce_intake__assess_value: \"commerce_intake.assess_value\",\n commerce_intake__extract_vision: \"commerce_intake.extract_vision\",\n commerce_intake__grading: \"commerce_intake.grading\",\n commerce_intake__instant_analysis: \"commerce_intake.instant_analysis\",\n commerce_intake__refute_no_value: \"commerce_intake.refute_no_value\",\n commerce_intake__research_product: \"commerce_intake.research_product\",\n commerce_intake__segment_photos: \"commerce_intake.segment_photos\",\n commerce_intake__verify_enrichment: \"commerce_intake.verify_enrichment\",\n content_gate__section_relevance_decision: \"content_gate.section_relevance_decision\",\n content_ir__component_artisan: \"content_ir.component_artisan\",\n content_ir__kind_architect: \"content_ir.kind_architect\",\n content_ir__kind_component_builder: \"content_ir.kind_component_builder\",\n content_ir__kind_creator: \"content_ir.kind_creator\",\n content_plan__branch_purpose: \"content_plan.branch_purpose\",\n content_plan__brief_writer: \"content_plan.brief_writer\",\n content_plan__deepen_page: \"content_plan.deepen_page\",\n content_plan__entity_attacher: \"content_plan.entity_attacher\",\n content_plan__entity_curator: \"content_plan.entity_curator\",\n content_plan__family_namer: \"content_plan.family_namer\",\n content_plan__keyword_strategist: \"content_plan.keyword_strategist\",\n content_plan__merge_wave: \"content_plan.merge_wave\",\n content_plan__p3_family: \"content_plan.p3_family\",\n content_plan__p4_write: \"content_plan.p4_write\",\n content_plan__p5_review: \"content_plan.p5_review\",\n content_plan__p6_build: \"content_plan.p6_build\",\n content_plan__p6_build__about: \"content_plan.p6_build.about\",\n content_plan__p6_build__blog: \"content_plan.p6_build.blog\",\n content_plan__p6_build__comparison: \"content_plan.p6_build.comparison\",\n content_plan__p6_build__contact: \"content_plan.p6_build.contact\",\n content_plan__p6_build__faq: \"content_plan.p6_build.faq\",\n content_plan__p6_build__guide: \"content_plan.p6_build.guide\",\n content_plan__p6_build__home: \"content_plan.p6_build.home\",\n content_plan__p6_build__index: \"content_plan.p6_build.index\",\n content_plan__p6_build__location: \"content_plan.p6_build.location\",\n content_plan__p6_build__pillar: \"content_plan.p6_build.pillar\",\n content_plan__p6_build__pricing: \"content_plan.p6_build.pricing\",\n content_plan__p6_build__service: \"content_plan.p6_build.service\",\n content_plan__plan_reviewer: \"content_plan.plan_reviewer\",\n content_plan__research_wave__audience_journey: \"content_plan.research_wave.audience_journey\",\n content_plan__research_wave__competitor_coverage: \"content_plan.research_wave.competitor_coverage\",\n content_plan__research_wave__keyword_value: \"content_plan.research_wave.keyword_value\",\n content_plan__route_picker: \"content_plan.route_picker\",\n content_plan__shape_planner: \"content_plan.shape_planner\",\n conversation__action_auditor: \"conversation.action_auditor\",\n conversation__decision_ledger: \"conversation.decision_ledger\",\n conversation__drift_auditor: \"conversation.drift_auditor\",\n conversation__label_agent_run: \"conversation.label_agent_run\",\n conversation__label_chat: \"conversation.label_chat\",\n conversation__outcome_summarizer: \"conversation.outcome_summarizer\",\n conversation__vision_extractor: \"conversation.vision_extractor\",\n conversation__vision_interviewer: \"conversation.vision_interviewer\",\n crm__journalist_beat_analyst: \"crm.journalist_beat_analyst\",\n crm__media_list_ranker: \"crm.media_list_ranker\",\n crm__outreach_draft_reviewer: \"crm.outreach_draft_reviewer\",\n crm__outreach_fact_check: \"crm.outreach_fact_check\",\n crm__outreach_personalization_coach: \"crm.outreach_personalization_coach\",\n crm__outreach_personalization_writer: \"crm.outreach_personalization_writer\",\n crm__outreach_pitch_writer: \"crm.outreach_pitch_writer\",\n crm__outreach_recipient_shortlister: \"crm.outreach_recipient_shortlister\",\n crm__outreach_reply_drafter: \"crm.outreach_reply_drafter\",\n crm__outreach_strategy: \"crm.outreach_strategy\",\n crm__party_kind_judge: \"crm.party_kind_judge\",\n crm__save_contact: \"crm.save_contact\",\n data__formula_writing: \"data.formula_writing\",\n data__page_guidance: \"data.page_guidance\",\n data__row_action: \"data.row_action\",\n dictionary__workspace_guide: \"dictionary.workspace_guide\",\n distillation__timeline_distiller: \"distillation.timeline_distiller\",\n distillation__timeline_unfolder: \"distillation.timeline_unfolder\",\n docproc__content_structure: \"docproc.content_structure\",\n education__admin_guidance: \"education.admin_guidance\",\n education__analytics_narrate: \"education.analytics_narrate\",\n education__audio_study_guidance: \"education.audio_study_guidance\",\n education__card_image_generator: \"education.card_image_generator\",\n education__card_image_prompt_writer: \"education.card_image_prompt_writer\",\n education__card_image_qc_judge: \"education.card_image_qc_judge\",\n education__card_image_web_source: \"education.card_image_web_source\",\n education__classes_guidance: \"education.classes_guidance\",\n education__creator_guidance: \"education.creator_guidance\",\n education__data_guidance: \"education.data_guidance\",\n education__exam_prep_guidance: \"education.exam_prep_guidance\",\n education__family_guidance: \"education.family_guidance\",\n education__fastfire_guidance: \"education.fastfire_guidance\",\n education__features_guidance: \"education.features_guidance\",\n education__flashcards_guidance: \"education.flashcards_guidance\",\n education__game_guidance: \"education.game_guidance\",\n education__grade_handwritten: \"education.grade_handwritten\",\n education__grade_work_guidance: \"education.grade_work_guidance\",\n education__kit_title: \"education.kit_title\",\n education__learn_guidance: \"education.learn_guidance\",\n education__levels_guidance: \"education.levels_guidance\",\n education__library_guidance: \"education.library_guidance\",\n education__media_guidance: \"education.media_guidance\",\n education__memory_generate: \"education.memory_generate\",\n education__memory_guidance: \"education.memory_guidance\",\n education__memory_hint: \"education.memory_hint\",\n education__mind_maps_guidance: \"education.mind_maps_guidance\",\n education__mindmap_generate: \"education.mindmap_generate\",\n education__notes_generate: \"education.notes_generate\",\n education__notes_guidance: \"education.notes_guidance\",\n education__offline_guidance: \"education.offline_guidance\",\n education__page_guidance: \"education.page_guidance\",\n education__plan_generate: \"education.plan_generate\",\n education__planner_guidance: \"education.planner_guidance\",\n education__practice_oral_guidance: \"education.practice_oral_guidance\",\n education__practice_tests_guidance: \"education.practice_tests_guidance\",\n education__progress_guidance: \"education.progress_guidance\",\n education__quiz_deepen_item: \"education.quiz_deepen_item\",\n education__quiz_generate: \"education.quiz_generate\",\n education__quiz_generate_from_source: \"education.quiz_generate_from_source\",\n education__quizzes_guidance: \"education.quizzes_guidance\",\n education__spoken_practice_design: \"education.spoken_practice_design\",\n education__spoken_practice_design_language: \"education.spoken_practice_design_language\",\n education__spoken_practice_grade: \"education.spoken_practice_grade\",\n education__spoken_practice_grade_pronunciation: \"education.spoken_practice_grade_pronunciation\",\n education__spoken_practice_review: \"education.spoken_practice_review\",\n education__start_guidance: \"education.start_guidance\",\n education__study_aids_guidance: \"education.study_aids_guidance\",\n education__study_pack_flashcards: \"education.study_pack_flashcards\",\n education__study_pack_lessons: \"education.study_pack_lessons\",\n education__study_pack_notes: \"education.study_pack_notes\",\n education__study_pack_quiz: \"education.study_pack_quiz\",\n education__study_pack_v2_flashcards: \"education.study_pack_v2_flashcards\",\n education__study_pack_v2_lessons: \"education.study_pack_v2_lessons\",\n education__study_pack_v2_notes: \"education.study_pack_v2_notes\",\n education__study_pack_v2_quiz: \"education.study_pack_v2_quiz\",\n education__subjects_guidance: \"education.subjects_guidance\",\n education__summaries_guidance: \"education.summaries_guidance\",\n education__summarize: \"education.summarize\",\n education__tutor_guidance: \"education.tutor_guidance\",\n education__tutor_message: \"education.tutor_message\",\n education__voice_tutor: \"education.voice_tutor\",\n evaluators__comparative_judge: \"evaluators.comparative_judge\",\n evaluators__rubric_judge: \"evaluators.rubric_judge\",\n extend__browser_chat: \"extend.browser_chat\",\n extend__pattern_from_data: \"extend.pattern_from_data\",\n extend__structured_extractor: \"extend.structured_extractor\",\n feedback__item_triage_decision: \"feedback.item_triage_decision\",\n flashcards__enrich_card: \"flashcards.enrich_card\",\n flashcards__expand_card: \"flashcards.expand_card\",\n flashcards__generate_cards: \"flashcards.generate_cards\",\n flashcards__generate_from_source: \"flashcards.generate_from_source\",\n flashcards__grade_spoken: \"flashcards.grade_spoken\",\n flashcards__grade_typed_answer: \"flashcards.grade_typed_answer\",\n flashcards__help_live: \"flashcards.help_live\",\n flashcards__helper_tts: \"flashcards.helper_tts\",\n flashcards__make_quiz_items: \"flashcards.make_quiz_items\",\n flashcards__micro_coach: \"flashcards.micro_coach\",\n flashcards__review_batch: \"flashcards.review_batch\",\n flashcards__spoken_front_tts: \"flashcards.spoken_front_tts\",\n flashcards__verify_against_source: \"flashcards.verify_against_source\",\n foundry__planner: \"foundry.planner\",\n google__channel_video_plan: \"google.channel_video_plan\",\n google__desk_work: \"google.desk_work\",\n google__traffic_change_explanation: \"google.traffic_change_explanation\",\n growth_loop__quality_analyze: \"growth_loop.quality_analyze\",\n growth_loop__quality_brief: \"growth_loop.quality_brief\",\n growth_loop__quality_crawl: \"growth_loop.quality_crawl\",\n growth_loop__quality_fill: \"growth_loop.quality_fill\",\n growth_loop__quality_measure: \"growth_loop.quality_measure\",\n growth_loop__quality_plan: \"growth_loop.quality_plan\",\n growth_loop__quality_publish: \"growth_loop.quality_publish\",\n growth_loop__quality_realize: \"growth_loop.quality_realize\",\n growth_loop__quality_research: \"growth_loop.quality_research\",\n growth_loop__quality_serve: \"growth_loop.quality_serve\",\n growth_loop__quality_suggest: \"growth_loop.quality_suggest\",\n growth_loop__quality_writeback: \"growth_loop.quality_writeback\",\n growth_loop__supervisor: \"growth_loop.supervisor\",\n hindsight__crystallizer: \"hindsight.crystallizer\",\n hindsight__replay_judge: \"hindsight.replay_judge\",\n hindsight__reviewer: \"hindsight.reviewer\",\n human_decisions__fallback_decider: \"human_decisions.fallback_decider\",\n image__generate: \"image.generate\",\n image_pipeline__concept: \"image_pipeline.concept\",\n image_pipeline__prompt_write: \"image_pipeline.prompt_write\",\n image_pipeline__qc_judge: \"image_pipeline.qc_judge\",\n iteration__architect: \"iteration.architect\",\n iteration__diagnostic: \"iteration.diagnostic\",\n iteration__root_cause: \"iteration.root_cause\",\n iteration__thinking_display: \"iteration.thinking_display\",\n kg__cluster_namer: \"kg.cluster_namer\",\n kg__ner_extractor: \"kg.ner_extractor\",\n knowledge__document_verifier: \"knowledge.document_verifier\",\n knowledge__qa_generator: \"knowledge.qa_generator\",\n knowledge__section_summarizer: \"knowledge.section_summarizer\",\n local__answer_question: \"local.answer_question\",\n local__chat_persona_brainstorm: \"local.chat_persona_brainstorm\",\n local__chat_persona_code_review: \"local.chat_persona_code_review\",\n local__chat_persona_explain_simply: \"local.chat_persona_explain_simply\",\n local__chat_persona_helpful: \"local.chat_persona_helpful\",\n local__chat_persona_spoken_replies: \"local.chat_persona_spoken_replies\",\n local__chat_persona_summarize: \"local.chat_persona_summarize\",\n local__chat_persona_transcript_polish: \"local.chat_persona_transcript_polish\",\n local__cloud_chat: \"local.cloud_chat\",\n local__cloud_chat_reply: \"local.cloud_chat_reply\",\n local__confidential_chat: \"local.confidential_chat\",\n local__explain_code: \"local.explain_code\",\n local__extract_action_items: \"local.extract_action_items\",\n local__improve_writing: \"local.improve_writing\",\n local__polish_style_action_items: \"local.polish_style_action_items\",\n local__polish_style_bullets: \"local.polish_style_bullets\",\n local__polish_style_custom: \"local.polish_style_custom\",\n local__polish_style_formal: \"local.polish_style_formal\",\n local__polish_style_light_cleanup: \"local.polish_style_light_cleanup\",\n local__polish_style_meeting_notes: \"local.polish_style_meeting_notes\",\n local__polish_style_standard: \"local.polish_style_standard\",\n local__polish_transcript: \"local.polish_transcript\",\n local__raw_completion: \"local.raw_completion\",\n local__summarize_text: \"local.summarize_text\",\n local__tool_calling_chat: \"local.tool_calling_chat\",\n mandate_outcome__goal_clause_extraction: \"mandate_outcome.goal_clause_extraction\",\n mandate_outcome__goal_fitness_decision: \"mandate_outcome.goal_fitness_decision\",\n mandates__holder_draft: \"mandates.holder_draft\",\n marketing__endowment_analysis: \"marketing.endowment_analysis\",\n marketing__endowment_portfolio: \"marketing.endowment_portfolio\",\n marketing__image_prompt: \"marketing.image_prompt\",\n marketing__page_image: \"marketing.page_image\",\n marketing__page_image_all_in_one: \"marketing.page_image_all_in_one\",\n marketing__video_metadata: \"marketing.video_metadata\",\n masterwork__approach_selector: \"masterwork.approach_selector\",\n masterwork__audition_judge: \"masterwork.audition_judge\",\n masterwork__bad_draft: \"masterwork.bad_draft\",\n masterwork__bad_example_probe: \"masterwork.bad_example_probe\",\n masterwork__case_oracle: \"masterwork.case_oracle\",\n masterwork__checkup_auditor: \"masterwork.checkup_auditor\",\n masterwork__coherence_partner: \"masterwork.coherence_partner\",\n masterwork__conductor: \"masterwork.conductor\",\n masterwork__corpus_cleaner: \"masterwork.corpus_cleaner\",\n masterwork__corpus_synthesizer: \"masterwork.corpus_synthesizer\",\n masterwork__counterparty: \"masterwork.counterparty\",\n masterwork__critique_distiller: \"masterwork.critique_distiller\",\n masterwork__draft_triage: \"masterwork.draft_triage\",\n masterwork__drip_distiller: \"masterwork.drip_distiller\",\n masterwork__drip_question: \"masterwork.drip_question\",\n masterwork__elicitation_judge: \"masterwork.elicitation_judge\",\n masterwork__exception_hunter: \"masterwork.exception_hunter\",\n masterwork__exemplar_distiller: \"masterwork.exemplar_distiller\",\n masterwork__faithfulness_judge: \"masterwork.faithfulness_judge\",\n masterwork__intake_designer: \"masterwork.intake_designer\",\n masterwork__markup_distiller: \"masterwork.markup_distiller\",\n masterwork__meeting_scavenger: \"masterwork.meeting_scavenger\",\n masterwork__monologue_distiller: \"masterwork.monologue_distiller\",\n masterwork__outcome_judge: \"masterwork.outcome_judge\",\n masterwork__pairwise_judge: \"masterwork.pairwise_judge\",\n masterwork__prediction_boundary: \"masterwork.prediction_boundary\",\n masterwork__prediction_distiller: \"masterwork.prediction_distiller\",\n masterwork__relationship_auditor: \"masterwork.relationship_auditor\",\n masterwork__rule_improver: \"masterwork.rule_improver\",\n masterwork__rulebook_auditor: \"masterwork.rulebook_auditor\",\n masterwork__scout: \"masterwork.scout\",\n masterwork__sealed_case_oracle: \"masterwork.sealed_case_oracle\",\n masterwork__sort_case_writer: \"masterwork.sort_case_writer\",\n masterwork__sort_distiller: \"masterwork.sort_distiller\",\n masterwork__source_distiller: \"masterwork.source_distiller\",\n masterwork__teach_back_distiller: \"masterwork.teach_back_distiller\",\n masterwork__teach_back_explainer: \"masterwork.teach_back_explainer\",\n masterwork__template__chief_edit: \"masterwork.template.chief_edit\",\n masterwork__template__chief_generate: \"masterwork.template.chief_generate\",\n masterwork__template__editor: \"masterwork.template.editor\",\n masterwork__template__maker: \"masterwork.template.maker\",\n masterwork__timeline_distiller: \"masterwork.timeline_distiller\",\n masterwork__timeline_segmenter: \"masterwork.timeline_segmenter\",\n masterwork__transcript_distiller: \"masterwork.transcript_distiller\",\n masterwork__transcript_shortlister: \"masterwork.transcript_shortlister\",\n masterwork__triad_distiller: \"masterwork.triad_distiller\",\n masterwork__triad_generator: \"masterwork.triad_generator\",\n masterwork__understudy: \"masterwork.understudy\",\n masterwork__unfolding_judge: \"masterwork.unfolding_judge\",\n masterworks__bench__a2_loop: \"masterworks.bench.a2_loop\",\n masterworks__bench__calibration_decoy: \"masterworks.bench.calibration_decoy\",\n masterworks__bench__consensus: \"masterworks.bench.consensus\",\n masterworks__bench__extract: \"masterworks.bench.extract\",\n masterworks__bench__judge: \"masterworks.bench.judge\",\n masterworks__bench__panel: \"masterworks.bench.panel\",\n masterworks__bench__raw_arm: \"masterworks.bench.raw_arm\",\n masterworks__vanilla_arm__answer_from_facts: \"masterworks.vanilla_arm.answer_from_facts\",\n masterworks__vanilla_arm__best_work: \"masterworks.vanilla_arm.best_work\",\n masterworks__vanilla_arm__outcome_case: \"masterworks.vanilla_arm.outcome_case\",\n masterworks__vanilla_arm__professional_help: \"masterworks.vanilla_arm.professional_help\",\n media__youtube_analyzer: \"media.youtube_analyzer\",\n media_catalog__item_vetting_decision: \"media_catalog.item_vetting_decision\",\n meet__agenda_draft: \"meet.agenda_draft\",\n meet__live_intelligence: \"meet.live_intelligence\",\n meet__live_notes: \"meet.live_notes\",\n meet__pre_meeting_brief: \"meet.pre_meeting_brief\",\n meet__transcription: \"meet.transcription\",\n meet__wrap_up: \"meet.wrap_up\",\n memory__observer: \"memory.observer\",\n memory__reflector: \"memory.reflector\",\n mermaid__diagram_editing: \"mermaid.diagram_editing\",\n messaging__action_item_extraction: \"messaging.action_item_extraction\",\n messaging__conversation_catch_up: \"messaging.conversation_catch_up\",\n messaging__conversation_summary: \"messaging.conversation_summary\",\n messaging__reply_drafting: \"messaging.reply_drafting\",\n ner__deep_chunk_extractor: \"ner.deep_chunk_extractor\",\n ner__document_orienter: \"ner.document_orienter\",\n ner__entity_canonicalizer: \"ner.entity_canonicalizer\",\n ner__finisher: \"ner.finisher\",\n ner__item_proposer: \"ner.item_proposer\",\n ner__magic_moment_detector: \"ner.magic_moment_detector\",\n ner__scope_proposer: \"ner.scope_proposer\",\n ner__scope_slot_filler: \"ner.scope_slot_filler\",\n ner__suggestion_reviewer: \"ner.suggestion_reviewer\",\n ner__sweep_scope_discoverer: \"ner.sweep_scope_discoverer\",\n ner__sweep_scope_reference_finder: \"ner.sweep_scope_reference_finder\",\n ner__sweep_value_miner: \"ner.sweep_value_miner\",\n news__angles: \"news.angles\",\n news__coarse_relevance: \"news.coarse_relevance\",\n news__monitor_setup_proposer: \"news.monitor_setup_proposer\",\n news__report: \"news.report\",\n news__story_origin: \"news.story_origin\",\n news__triage: \"news.triage\",\n notes__organizer: \"notes.organizer\",\n notes__page_guidance: \"notes.page_guidance\",\n observability__tool_trace_pattern_detection: \"observability.tool_trace_pattern_detection\",\n observability__tool_trace_triage: \"observability.tool_trace_triage\",\n orchestras__role_describer: \"orchestras.role_describer\",\n orchestration__tool_failure_standoff_decision: \"orchestration.tool_failure_standoff_decision\",\n pdf__chunk_clean_ocr_text: \"pdf.chunk_clean_ocr_text\",\n pdf__chunk_flashcards_json: \"pdf.chunk_flashcards_json\",\n pdf__chunk_flashcards_typescript: \"pdf.chunk_flashcards_typescript\",\n pdf__content_cleaner: \"pdf.content_cleaner\",\n personal_staff__escalation: \"personal_staff.escalation\",\n personal_staff__front_line: \"personal_staff.front_line\",\n podcast__audience_adapter: \"podcast.audience_adapter\",\n podcast__audio_dialogue: \"podcast.audio_dialogue\",\n podcast__audio_english: \"podcast.audio_english\",\n podcast__audio_persian: \"podcast.audio_persian\",\n podcast__chapter_marker: \"podcast.chapter_marker\",\n podcast__content_extractor: \"podcast.content_extractor\",\n podcast__deep_research: \"podcast.deep_research\",\n podcast__image_v1: \"podcast.image_v1\",\n podcast__image_v2: \"podcast.image_v2\",\n podcast__image_v3: \"podcast.image_v3\",\n podcast__image_v4: \"podcast.image_v4\",\n podcast__image_v5: \"podcast.image_v5\",\n podcast__image_v6_feature: \"podcast.image_v6_feature\",\n podcast__image_v6_feature_prompt: \"podcast.image_v6_feature_prompt\",\n podcast__live_rewrite: \"podcast.live_rewrite\",\n podcast__metadata: \"podcast.metadata\",\n podcast__multihost_script: \"podcast.multihost_script\",\n podcast__post_prep_expansion: \"podcast.post_prep_expansion\",\n podcast__post_prep_fact_checking: \"podcast.post_prep_fact_checking\",\n podcast__post_prep_summarization: \"podcast.post_prep_summarization\",\n podcast__post_prep_translation: \"podcast.post_prep_translation\",\n podcast__race_frontier: \"podcast.race_frontier\",\n podcast__relevance_gate: \"podcast.relevance_gate\",\n podcast__roundtable_script: \"podcast.roundtable_script\",\n podcast__script_educational: \"podcast.script_educational\",\n podcast__script_news: \"podcast.script_news\",\n podcast__script_persian: \"podcast.script_persian\",\n podcast__solo_script: \"podcast.solo_script\",\n podcast__title_optimizer: \"podcast.title_optimizer\",\n podcast__video_v1: \"podcast.video_v1\",\n podcast__video_v2: \"podcast.video_v2\",\n podcast_client__blog_writer: \"podcast_client.blog_writer\",\n podcast_client__show_notes: \"podcast_client.show_notes\",\n podcast_client__topic_ideas: \"podcast_client.topic_ideas\",\n podcast_client__web_content_extractor: \"podcast_client.web_content_extractor\",\n podcast_client__youtube_research: \"podcast_client.youtube_research\",\n product_capture__instant_analysis: \"product_capture.instant_analysis\",\n projects__creation_guide: \"projects.creation_guide\",\n proof_runs__judge: \"proof_runs.judge\",\n purpose__writer: \"purpose.writer\",\n rag__chunk_contextualizer: \"rag.chunk_contextualizer\",\n rag__grounded_synthesis: \"rag.grounded_synthesis\",\n rag__grounding_claim_extract: \"rag.grounding_claim_extract\",\n rag__grounding_judge: \"rag.grounding_judge\",\n rag__hyde_generator: \"rag.hyde_generator\",\n rag__image_caption: \"rag.image_caption\",\n rag__pdf_page_cleaner: \"rag.pdf_page_cleaner\",\n rag__query_expander: \"rag.query_expander\",\n rag_kinds__grounded_synthesis: \"rag_kinds.grounded_synthesis\",\n records__enrichment: \"records.enrichment\",\n research__auto_tagger: \"research.auto_tagger\",\n research__condenser_1: \"research.condenser_1\",\n research__condenser_2: \"research.condenser_2\",\n research__coverage_audit: \"research.coverage_audit\",\n research__cross_cutting_tags: \"research.cross_cutting_tags\",\n research__document_assembly: \"research.document_assembly\",\n research__keyword_synthesis: \"research.keyword_synthesis\",\n research__report: \"research.report\",\n research__report_updater: \"research.report_updater\",\n research__source_authority: \"research.source_authority\",\n research__source_triage_decision: \"research.source_triage_decision\",\n research__structured_page_summary: \"research.structured_page_summary\",\n research__suggest_setup: \"research.suggest_setup\",\n research__tag_consolidation: \"research.tag_consolidation\",\n research__topic_deep_research: \"research.topic_deep_research\",\n research_client__output_blog: \"research_client.output_blog\",\n research_client__output_brand_profile: \"research_client.output_brand_profile\",\n research_client__output_competitive_landscape: \"research_client.output_competitive_landscape\",\n research_client__output_gap_analysis: \"research_client.output_gap_analysis\",\n research_client__output_literature_review: \"research_client.output_literature_review\",\n research_client__output_reputation_business: \"research_client.output_reputation_business\",\n research_client__output_reputation_personal: \"research_client.output_reputation_personal\",\n research_client__output_seo: \"research_client.output_seo\",\n research_client__output_slides: \"research_client.output_slides\",\n scraper__fact_check: \"scraper.fact_check\",\n scraper__keyword_analysis: \"scraper.keyword_analysis\",\n scraper__page_fetch_verdict: \"scraper.page_fetch_verdict\",\n seo__ai_visibility_blind_question_writer: \"seo.ai_visibility_blind_question_writer\",\n seo__ai_visibility_buyer_jobs: \"seo.ai_visibility_buyer_jobs\",\n seo__ai_visibility_decision_analyst: \"seo.ai_visibility_decision_analyst\",\n seo__ai_visibility_evidence_icp: \"seo.ai_visibility_evidence_icp\",\n seo__ai_visibility_panel_designer: \"seo.ai_visibility_panel_designer\",\n seo__ai_visibility_panel_report: \"seo.ai_visibility_panel_report\",\n seo__ai_visibility_question_architect: \"seo.ai_visibility_question_architect\",\n seo__ai_visibility_question_qa: \"seo.ai_visibility_question_qa\",\n seo__ai_visibility_writing_audit: \"seo.ai_visibility_writing_audit\",\n seo__backlink_analysis: \"seo.backlink_analysis\",\n seo__backlink_context_assessor: \"seo.backlink_context_assessor\",\n seo__backlink_work_planner: \"seo.backlink_work_planner\",\n seo__business_model_verdict: \"seo.business_model_verdict\",\n seo__competitor_classifier: \"seo.competitor_classifier\",\n seo__competitor_opportunity_autopsy: \"seo.competitor_opportunity_autopsy\",\n seo__competitor_page_autopsy: \"seo.competitor_page_autopsy\",\n seo__coverage_analyst: \"seo.coverage_analyst\",\n seo__digital_pr_reputation_adjudicator: \"seo.digital_pr_reputation_adjudicator\",\n seo__evidence_workbench: \"seo.evidence_workbench\",\n seo__finding_fixer: \"seo.finding_fixer\",\n seo__guidelines_drafter: \"seo.guidelines_drafter\",\n seo__ideal_customer_profile: \"seo.ideal_customer_profile\",\n seo__keyword_classifier: \"seo.keyword_classifier\",\n seo__keyword_expander: \"seo.keyword_expander\",\n seo__keyword_researcher: \"seo.keyword_researcher\",\n seo__keyword_serp_intent_analyst: \"seo.keyword_serp_intent_analyst\",\n seo__landscape_brief: \"seo.landscape_brief\",\n seo__map_author: \"seo.map_author\",\n seo__map_curation: \"seo.map_curation\",\n seo__money_map: \"seo.money_map\",\n seo__offering_extraction: \"seo.offering_extraction\",\n seo__offering_valuation: \"seo.offering_valuation\",\n seo__page_analyzer: \"seo.page_analyzer\",\n seo__page_intent_proposer: \"seo.page_intent_proposer\",\n seo__page_keyword_mapper: \"seo.page_keyword_mapper\",\n seo__page_mapper: \"seo.page_mapper\",\n seo__press_calendar_planner: \"seo.press_calendar_planner\",\n seo__press_clip_reviewer: \"seo.press_clip_reviewer\",\n seo__press_headlines: \"seo.press_headlines\",\n seo__press_moment_researcher: \"seo.press_moment_researcher\",\n seo__press_newsworthiness_check: \"seo.press_newsworthiness_check\",\n seo__press_source_request_responder: \"seo.press_source_request_responder\",\n seo__press_story_analyst: \"seo.press_story_analyst\",\n seo__press_strategist: \"seo.press_strategist\",\n seo__reputation_crisis_holding: \"seo.reputation_crisis_holding\",\n seo__session_rule_writer: \"seo.session_rule_writer\",\n seo__session_stamp_proposer: \"seo.session_stamp_proposer\",\n seo__site_intake: \"seo.site_intake\",\n seo__site_link_authority_router: \"seo.site_link_authority_router\",\n seo__site_strategist: \"seo.site_strategist\",\n seo__starter_pack_proposer: \"seo.starter_pack_proposer\",\n seo__strategy__site_brief__generate: \"seo.strategy.site_brief.generate\",\n seo__topic_assigner: \"seo.topic_assigner\",\n seo__topic_curation: \"seo.topic_curation\",\n sms__owner_beta: \"sms.owner_beta\",\n surfaces_client__binding_mapper: \"surfaces_client.binding_mapper\",\n tasks__triage: \"tasks.triage\",\n tool_viz__component_generator: \"tool_viz.component_generator\",\n tools__summarize_content: \"tools.summarize_content\",\n transcript_studio__document_edit: \"transcript_studio.document_edit\",\n transcript_studio__scribe_live: \"transcript_studio.scribe_live\",\n transcripts__clean_with_context: \"transcripts.clean_with_context\",\n transcripts__clean_with_context_variable: \"transcripts.clean_with_context_variable\",\n transcripts__clean_without_context: \"transcripts.clean_without_context\",\n vision_interview__adversary: \"vision_interview.adversary\",\n vision_interview__amplifier: \"vision_interview.amplifier\",\n vision_interview__answer_tracker: \"vision_interview.answer_tracker\",\n vision_interview__archaeologist: \"vision_interview.archaeologist\",\n vision_interview__architect: \"vision_interview.architect\",\n vision_interview__cartographer: \"vision_interview.cartographer\",\n vision_interview__requirements_author: \"vision_interview.requirements_author\",\n vision_interview__scribe: \"vision_interview.scribe\",\n vision_interview__sounding_board: \"vision_interview.sounding_board\",\n vision_interview__transcript_cleaner: \"vision_interview.transcript_cleaner\",\n vision_interview__vision_author: \"vision_interview.vision_author\",\n voice__communicator: \"voice.communicator\",\n voice__gemini_live: \"voice.gemini_live\",\n voice__intro: \"voice.intro\",\n voice__owner_beta: \"voice.owner_beta\",\n war_room__master: \"war_room.master\",\n war_room__room: \"war_room.room\",\n war_room__thread: \"war_room.thread\",\n web__endpoint_family_judge: \"web.endpoint_family_judge\",\n workflow__complex_research__keyword_synthesis: \"workflow.complex_research.keyword_synthesis\",\n workflow__complex_research__page_summary: \"workflow.complex_research.page_summary\",\n workflow__complex_research__report: \"workflow.complex_research.report\",\n workflow__conductor: \"workflow.conductor\",\n workflow__deep_research__keyword_synthesis: \"workflow.deep_research.keyword_synthesis\",\n workflow__extract_namer: \"workflow.extract_namer\",\n workflow__plan_design: \"workflow.plan_design\",\n workflow__plan_input_kind_authoring: \"workflow.plan_input_kind_authoring\",\n workflow__plan_node_type_recommender: \"workflow.plan_node_type_recommender\",\n workflow__plan_notes_writer: \"workflow.plan_notes_writer\",\n workflow__plan_output_kind_authoring: \"workflow.plan_output_kind_authoring\",\n workflow__recovery_advisor: \"workflow.recovery_advisor\",\n workflow__run_assist_suggester: \"workflow.run_assist_suggester\",\n workflow__step_intelligence: \"workflow.step_intelligence\",\n workflow__steward: \"workflow.steward\",\n workflow__steward__agent_run: \"workflow.steward.agent_run\",\n workflow__steward__data: \"workflow.steward.data\",\n workflow__steward__decision: \"workflow.steward.decision\",\n workflow__steward__user_input: \"workflow.steward.user_input\",\n workflow__wizard__agent_run: \"workflow.wizard.agent_run\",\n} as const;\n\n/** Every key this package version accepts — active plus retiring. */\nexport type MandateKey = (typeof MANDATE_KEYS)[keyof typeof MANDATE_KEYS];\n\n/** The key set as a runtime array, in generated order. */\nexport const ALL_MANDATE_KEYS: readonly MandateKey[] = Object.values(MANDATE_KEYS) as readonly MandateKey[];\n\n/** Keys still in the union but no longer declared (two-phase retire, phase 1). */\nexport const RETIRING_MANDATE_KEYS = {\n} as const;\n\n/**\n * Declared FAMILIES — a prefix the feature's own roster owns, and its members.\n * Emitted from `declared_families()` (aidream `services/mandates/carriers.py`).\n */\nexport const MANDATE_FAMILIES = {\n \"ambient.page_guidance_overrides\": [\n \"data.page_guidance\",\n \"education.admin_guidance\",\n \"education.audio_study_guidance\",\n \"education.classes_guidance\",\n \"education.creator_guidance\",\n \"education.data_guidance\",\n \"education.exam_prep_guidance\",\n \"education.family_guidance\",\n \"education.fastfire_guidance\",\n \"education.features_guidance\",\n \"education.flashcards_guidance\",\n \"education.game_guidance\",\n \"education.grade_work_guidance\",\n \"education.learn_guidance\",\n \"education.levels_guidance\",\n \"education.library_guidance\",\n \"education.media_guidance\",\n \"education.memory_guidance\",\n \"education.mind_maps_guidance\",\n \"education.notes_guidance\",\n \"education.offline_guidance\",\n \"education.page_guidance\",\n \"education.planner_guidance\",\n \"education.practice_oral_guidance\",\n \"education.practice_tests_guidance\",\n \"education.progress_guidance\",\n \"education.quizzes_guidance\",\n \"education.start_guidance\",\n \"education.study_aids_guidance\",\n \"education.subjects_guidance\",\n \"education.summaries_guidance\",\n \"education.tutor_guidance\",\n \"notes.page_guidance\",\n ],\n \"checks.cleanup_bakeoff\": [\n \"checks.cleanup_bakeoff.answer\",\n \"checks.cleanup_bakeoff.judge\",\n ],\n \"content_plan.p6_build\": [\n \"content_plan.p6_build.about\",\n \"content_plan.p6_build.blog\",\n \"content_plan.p6_build.comparison\",\n \"content_plan.p6_build.contact\",\n \"content_plan.p6_build.faq\",\n \"content_plan.p6_build.guide\",\n \"content_plan.p6_build.home\",\n \"content_plan.p6_build.index\",\n \"content_plan.p6_build.location\",\n \"content_plan.p6_build.pillar\",\n \"content_plan.p6_build.pricing\",\n \"content_plan.p6_build.service\",\n ],\n \"content_plan.research_wave\": [\n \"content_plan.research_wave.audience_journey\",\n \"content_plan.research_wave.competitor_coverage\",\n \"content_plan.research_wave.keyword_value\",\n ],\n \"conversation\": [\n \"conversation.action_auditor\",\n \"conversation.decision_ledger\",\n \"conversation.drift_auditor\",\n \"conversation.outcome_summarizer\",\n \"conversation.vision_extractor\",\n \"conversation.vision_interviewer\",\n ],\n \"masterworks.bench\": [\n \"masterworks.bench.a2_loop\",\n \"masterworks.bench.calibration_decoy\",\n \"masterworks.bench.consensus\",\n \"masterworks.bench.extract\",\n \"masterworks.bench.judge\",\n \"masterworks.bench.panel\",\n \"masterworks.bench.raw_arm\",\n ],\n \"masterworks.vanilla_arm\": [\n \"masterworks.vanilla_arm.answer_from_facts\",\n \"masterworks.vanilla_arm.best_work\",\n \"masterworks.vanilla_arm.outcome_case\",\n \"masterworks.vanilla_arm.professional_help\",\n ],\n \"vision_interview\": [\n \"vision_interview.adversary\",\n \"vision_interview.amplifier\",\n \"vision_interview.answer_tracker\",\n \"vision_interview.archaeologist\",\n \"vision_interview.architect\",\n \"vision_interview.cartographer\",\n \"vision_interview.requirements_author\",\n \"vision_interview.scribe\",\n \"vision_interview.sounding_board\",\n \"vision_interview.transcript_cleaner\",\n \"vision_interview.vision_author\",\n ],\n} as const;\n\nexport type MandateFamilyPrefix = keyof typeof MANDATE_FAMILIES;\n\n/** Members of a declared family, typed as real keys. */\nexport type MandateFamilyMember<P extends MandateFamilyPrefix> =\n (typeof MANDATE_FAMILIES)[P][number];\n\n/**\n * THE DYNAMIC FAMILIES — DB-authored (`mandate.definition` origin='user'). No\n * generated union can contain them, so their accessors return a BRANDED\n * `DynamicMandateKey`, deliberately NOT assignable to `MandateKey`: a carrier that\n * demands a declared key still refuses one, and a carrier that accepts either\n * says so in its own signature (`MandateKey | DynamicMandateKey`).\n */\ndeclare const dynamicMandateKeyBrand: unique symbol;\n\nexport type DynamicMandateKey = string & {\n readonly [dynamicMandateKeyBrand]: true;\n};\n\nexport const DYNAMIC_MANDATE_FAMILIES = {\n \"app\": { prefix: \"app\", note: \"One mandate per user-built app (`mandate.definition` origin='user').\" },\n \"shortcut\": { prefix: \"shortcut\", note: \"One mandate per user-authored shortcut (origin='user').\" },\n} as const;\n\nexport type DynamicMandateFamilyPrefix = keyof typeof DYNAMIC_MANDATE_FAMILIES;\n\nconst DYNAMIC_SLUG = /^[a-z0-9]+(?:_[a-z0-9]+)*$/;\n\nfunction dynamicKey(\n prefix: DynamicMandateFamilyPrefix,\n ...slugs: readonly (string | undefined)[]\n): DynamicMandateKey {\n const parts = slugs.filter((slug): slug is string => slug !== undefined);\n if (parts.length === 0) {\n throw new Error(\n `mandate family \"${prefix}\" needs at least a member slug — it was given none.`,\n );\n }\n for (const slug of parts) {\n if (!DYNAMIC_SLUG.test(slug)) {\n throw new Error(\n `mandate family \"${prefix}\" cannot name a member from ` +\n `${JSON.stringify(slug)}: a segment is lowercase words joined by single ` +\n \"underscores. Pass the slug the row carries, never a display name.\",\n );\n }\n }\n return [prefix, ...parts].join(\".\") as DynamicMandateKey;\n}\n\n/**\n * The mandate key of a user-built app. DB-authored — never a declared key.\n * `surfaceSlug` names the per-surface row a few apps carry\n * (`app.<app>.<surface>`); omit it for the app's own mandate.\n */\nexport function mandateKeyOfApp(\n appSlug: string,\n surfaceSlug?: string,\n): DynamicMandateKey {\n return dynamicKey(\"app\", appSlug, surfaceSlug);\n}\n\n/**\n * The mandate key of a user-authored shortcut. DB-authored. `surfaceSlug` names\n * the per-surface row (`shortcut.<shortcut>.<surface>`), which is how most live\n * shortcut rows are keyed; omit it for the shortcut's own mandate.\n */\nexport function mandateKeyOfShortcut(\n shortcutSlug: string,\n surfaceSlug?: string,\n): DynamicMandateKey {\n return dynamicKey(\"shortcut\", shortcutSlug, surfaceSlug);\n}\n","/**\n * `@ai-matrx/agents/mandates` — the ONE place a TypeScript client learns a\n * mandate key.\n *\n * 🚨 **Clients never declare a mandate.** aidream's `declare_mandate` is the\n * only declaration path in the system; this subpath publishes the key set that\n * declaration produced, so a hand-typed `\"seo.keyword_cluster\"` literal, a local\n * `mandates.ts` mirror, or an `as MandateKey` cast is a defect with a real\n * replacement — not a style preference. Every carrier that takes a key should\n * type it `MandateKey` (or `MandateKey | DynamicMandateKey` when it genuinely\n * accepts a DB-authored one) so a wrong key fails type-check instead of failing\n * at run time as a 404 nobody sees.\n *\n * The key data lives in `keys.generated.ts`, emitted by THE ONE GENERATOR\n * (`aidream/scripts/mandates_generate.py`, stage (h)) from the in-process\n * declarations — never edit it. The per-version key set that shipped with each\n * published version is committed beside it under `snapshots/`, so a scan can\n * resolve a client's references against the key set of the version it actually\n * ships (Mandate Declaration & Usage Reporting, DESIGN § 4.5 step 2).\n */\n\nexport {\n ALL_MANDATE_KEYS,\n DYNAMIC_MANDATE_FAMILIES,\n MANDATE_FAMILIES,\n MANDATE_KEYS,\n MANDATE_KEYS_META,\n RETIRING_MANDATE_KEYS,\n mandateKeyOfApp,\n mandateKeyOfShortcut,\n type DynamicMandateFamilyPrefix,\n type DynamicMandateKey,\n type MandateFamilyMember,\n type MandateFamilyPrefix,\n type MandateKey,\n} from \"./keys.generated\";\n\nimport {\n ALL_MANDATE_KEYS,\n MANDATE_KEYS_META,\n type MandateKey,\n} from \"./keys.generated\";\n\nconst KEY_SET: ReadonlySet<string> = new Set<string>(ALL_MANDATE_KEYS);\n\n/**\n * Narrow an unknown string to a declared `MandateKey`.\n *\n * Use it on anything that crossed a wire — a URL segment, a stored preference,\n * a row's `mandate_key` column. It answers only for the key set THIS package\n * version ships; a key declared after this version was published is correctly\n * `false` here, which is the point of the per-version snapshots.\n */\nexport function isMandateKey(value: unknown): value is MandateKey {\n return typeof value === \"string\" && KEY_SET.has(value);\n}\n\n/**\n * Assert an unknown value is a declared `MandateKey`, or throw with a remedy.\n *\n * Nothing fails silently: the message names the value, the package version its\n * key set came from, and what to do — never a bare \"invalid key\".\n */\nexport function assertMandateKey(\n value: unknown,\n context?: string,\n): asserts value is MandateKey {\n if (isMandateKey(value)) return;\n const where = context ? ` at ${context}` : \"\";\n throw new Error(\n `${JSON.stringify(value)} is not a declared mandate key${where}. ` +\n `@ai-matrx/agents@${MANDATE_KEYS_META.packageVersion} ships ` +\n `${ALL_MANDATE_KEYS.length} keys (aidream ${MANDATE_KEYS_META.aidreamRevision.slice(0, 12)}). ` +\n \"If the key is real, this package is behind — take `latest` and re-check. \" +\n \"If it is a user-built app or shortcut, it is DB-authored: build it with \" +\n \"mandateKeyOfApp() / mandateKeyOfShortcut(), which return DynamicMandateKey.\",\n );\n}\n"],"mappings":";AAqBO,IAAM,oBAAoB;AAAA,EAC/B,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAChB;AAGO,IAAM,eAAe;AAAA,EAC1B,yBAAyB;AAAA,EACzB,mCAAmC;AAAA,EACnC,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,kCAAkC;AAAA,EAClC,0BAA0B;AAAA,EAC1B,wBAAwB;AAAA,EACxB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,s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eAAe;AAErB,SAAS,WACP,WACG,OACgB;AACnB,QAAM,QAAQ,MAAM,OAAO,CAAC,SAAyB,SAAS,MAAS;AACvE,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,IAAI;AAAA,MACR,mBAAmB,MAAM;AAAA,IAC3B;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,QAAI,CAAC,aAAa,KAAK,IAAI,GAAG;AAC5B,YAAM,IAAI;AAAA,QACR,mBAAmB,MAAM,+BACpB,KAAK,UAAU,IAAI,CAAC;AAAA,MAE3B;AAAA,IACF;AAAA,EACF;AACA,SAAO,CAAC,QAAQ,GAAG,KAAK,EAAE,KAAK,GAAG;AACpC;AAOO,SAAS,gBACd,SACA,aACmB;AACnB,SAAO,WAAW,OAAO,SAAS,WAAW;AAC/C;AAOO,SAAS,qBACd,cACA,aACmB;AACnB,SAAO,WAAW,YAAY,cAAc,WAAW;AACzD;;;AC3sBA,IAAM,UAA+B,IAAI,IAAY,gBAAgB;AAU9D,SAAS,aAAa,OAAqC;AAChE,SAAO,OAAO,UAAU,YAAY,QAAQ,IAAI,KAAK;AACvD;AAQO,SAAS,iBACd,OACA,SAC6B;AAC7B,MAAI,aAAa,KAAK,EAAG;AACzB,QAAM,QAAQ,UAAU,OAAO,OAAO,KAAK;AAC3C,QAAM,IAAI;AAAA,IACR,GAAG,KAAK,UAAU,KAAK,CAAC,iCAAiC,KAAK,sBACxC,kBAAkB,cAAc,UACjD,iBAAiB,MAAM,kBAAkB,kBAAkB,gBAAgB,MAAM,GAAG,EAAE,CAAC;AAAA,EAI9F;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../sources/index.ts"],"sourcesContent":["/**\n * `@ai-matrx/agents/sources` — THE ONE SOURCE PAYLOAD (contract v1, frozen 2026-09-27).\n *\n * Every request that is built from a person's Sources carries them as a\n * `SourceSet`: a list of `SourceRef` pointers (never blobs) plus how the model\n * should be grounded in them. The server answers with a `SourceManifest`\n * (sizes and states, never bodies — POST /sources/manifest) or a\n * `ResolvedSourceSet` (grounded text for generators — POST /sources/resolve).\n *\n * Contract of record: common-docs `projects/unified-source-input/DESIGN.md`\n * § \"Contract v1 — FROZEN\". A shape change here is an AMENDMENT there first,\n * with its Pydantic twin beside aidream's `parse_resource_reference`.\n *\n * `SourceRef` IS the existing `resource_ref` pointer already on the wire\n * (aidream `services/conversation_context/resource_context.py`), extended with\n * optional fields only — never coin a second pointer type.\n *\n * Pure module: no React, no I/O, no \"use client\".\n */\n\nexport const RESOURCE_REF_KIND = \"resource_ref\" as const;\nexport const SOURCE_SET_KIND = \"source_set\" as const;\nexport const SOURCE_MANIFEST_KIND = \"source_manifest\" as const;\nexport const RESOLVED_SOURCE_SET_KIND = \"resolved_source_set\" as const;\n\n/** The wire version every `SourceSet` carries. */\nexport const SOURCE_SET_VERSION = 1 as const;\n\n/** A bounded preview of one representation promoted into the prompt. */\nexport interface ResourcePromotion {\n representation: string;\n max_chars?: number;\n}\n\nexport type SourceDelivery = \"direct\" | \"context\";\nexport type SourceGrounding = \"whole\" | \"selected\" | \"retrieve\";\n\n/** The pointer — the existing `resource_ref` envelope, extended (all new fields optional). */\nexport interface SourceRef {\n __kind: typeof RESOURCE_REF_KIND;\n /** Server resource token: \"file\" (A2; \"cld_file\" is a server alias) | \"processed_document\" | \"note\" | \"fc_set\" | … */\n resource_type: string;\n resource_id: string;\n /** \"clean\" | \"raw\" | \"pdf\" | a family representation key. Omitted = server's Clean → Raw → original fallback. */\n representation?: string;\n /** Hand-picked Segment ids (rag.kg_chunks ids or \"<resource_id>:<n>\"). */\n include_segments?: string[];\n /** Include the text (default \"direct\") | the AI fetches it on demand (\"context\"). */\n delivery?: SourceDelivery;\n /** Per-Source cap chosen on the review page. */\n max_chars?: number;\n promote?: ResourcePromotion | ResourcePromotion[];\n exclude?: string[];\n}\n\nexport interface SourceSet {\n __kind: typeof SOURCE_SET_KIND;\n version: typeof SOURCE_SET_VERSION;\n sources: SourceRef[];\n /** Only for \"Just a topic\". */\n topic?: string;\n /** Default \"whole\". */\n grounding?: SourceGrounding;\n /** Required in spirit when grounding = \"retrieve\". */\n retrieve_query?: string;\n /** The model whose context window sets the budget. */\n target_model_id?: string;\n}\n\nexport type SourceState = \"ready\" | \"processing\" | \"failed\" | \"unavailable\";\n\nexport interface SourceManifestForm {\n form: string;\n label: string;\n chars: number;\n available: boolean;\n}\n\nexport interface SourceManifestSegment {\n id: string;\n label: string;\n page?: number;\n chars: number;\n}\n\nexport interface SourceManifestEntry {\n ref: SourceRef;\n label: string;\n resource_type: string;\n state: SourceState;\n state_detail?: string;\n forms: SourceManifestForm[];\n default_form: string;\n segments?: SourceManifestSegment[];\n}\n\n/** POST /sources/manifest { source_set } → sizes and states, never bodies. */\nexport interface SourceManifest {\n __kind: typeof SOURCE_MANIFEST_KIND;\n sources: SourceManifestEntry[];\n total_chars: number;\n estimated_tokens: number;\n /** null = unknown model; the UI says so. */\n model_context_tokens: number | null;\n}\n\nexport interface ResolvedSourceSegment {\n id: string;\n page?: number;\n chars: number;\n}\n\nexport interface ResolvedSource {\n ref: SourceRef;\n label: string;\n form_used: string;\n /** Grounded: \"### Chunk <id> (page N)\" blocks; never re-chunked. */\n text: string;\n segments: ResolvedSourceSegment[];\n file_id?: string;\n processed_document_id?: string;\n /** \"processing\" = the raw fallback was used. */\n state: \"ready\" | \"processing\";\n truncated: boolean;\n /** Every stand-in announces itself. */\n notes: string[];\n}\n\n/** A1 (2026-09-27): \"not_ready\" = a file not yet read. */\nexport type DroppedSourceReason =\n | \"no_access\"\n | \"missing\"\n | \"failed\"\n | \"over_budget\"\n | \"not_ready\";\n\nexport interface DroppedSource {\n ref: SourceRef;\n reason: DroppedSourceReason;\n /** A1: what happened and what to do. */\n detail?: string;\n}\n\n/** POST /sources/resolve { source_set } → grounded text for generators. */\nexport interface ResolvedSourceSet {\n __kind: typeof RESOLVED_SOURCE_SET_KIND;\n sources: ResolvedSource[];\n dropped: DroppedSource[];\n total_chars: number;\n}\n\n// ---------------------------------------------------------------------------\n// Pure helpers\n// ---------------------------------------------------------------------------\n\n/** Builder options. `undefined` is accepted everywhere so callers can forward an existing ref's optional fields. */\nexport interface SourceRefOptions {\n representation?: string | undefined;\n include_segments?: readonly string[] | undefined;\n delivery?: SourceDelivery | undefined;\n max_chars?: number | undefined;\n promote?: ResourcePromotion | ResourcePromotion[] | undefined;\n exclude?: readonly string[] | undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Build one pointer. Empty optional fields are omitted (so the wire stays\n * minimal and equal pointers serialise equally); `exclude` is trimmed,\n * lower-cased and de-duplicated exactly as the server normalises it;\n * `include_segments` is de-duplicated in order. Throws on an empty type or id —\n * a pointer to nothing is never built silently.\n */\nexport function createSourceRef(\n resourceType: string,\n resourceId: string,\n options: SourceRefOptions = {},\n): SourceRef {\n const resource_type = resourceType.trim();\n const resource_id = resourceId.trim();\n if (!resource_type) throw new Error(\"createSourceRef: resource_type is required\");\n if (!resource_id) throw new Error(\"createSourceRef: resource_id is required\");\n if (\n options.max_chars !== undefined &&\n (!Number.isInteger(options.max_chars) || options.max_chars <= 0)\n ) {\n throw new Error(\"createSourceRef: max_chars must be a positive integer\");\n }\n const exclude = Array.from(\n new Set(\n (options.exclude ?? [])\n .map((value) => value.trim().toLowerCase())\n .filter(Boolean),\n ),\n );\n const include_segments = Array.from(\n new Set((options.include_segments ?? []).map((id) => id.trim()).filter(Boolean)),\n );\n return {\n __kind: RESOURCE_REF_KIND,\n resource_type,\n resource_id,\n ...(options.representation ? { representation: options.representation } : {}),\n ...(include_segments.length ? { include_segments } : {}),\n ...(options.delivery ? { delivery: options.delivery } : {}),\n ...(options.max_chars !== undefined ? { max_chars: options.max_chars } : {}),\n ...(options.promote ? { promote: options.promote } : {}),\n ...(exclude.length ? { exclude } : {}),\n };\n}\n\nexport function isSourceRef(value: unknown): value is SourceRef {\n return (\n isRecord(value) &&\n value.__kind === RESOURCE_REF_KIND &&\n typeof value.resource_type === \"string\" &&\n value.resource_type.length > 0 &&\n typeof value.resource_id === \"string\" &&\n value.resource_id.length > 0\n );\n}\n\nexport interface SourceSetOptions {\n topic?: string | undefined;\n grounding?: SourceGrounding | undefined;\n retrieve_query?: string | undefined;\n target_model_id?: string | undefined;\n}\n\n/**\n * Build one envelope. Duplicate pointers (same type + id + representation) are\n * collapsed, keeping the first. `grounding: \"retrieve\"` without a query and\n * `grounding: \"selected\"` with no Source carrying `include_segments` throw —\n * both would otherwise resolve to something the person never asked for.\n */\nexport function createSourceSet(\n sources: readonly SourceRef[],\n options: SourceSetOptions = {},\n): SourceSet {\n const seen = new Set<string>();\n const unique: SourceRef[] = [];\n for (const ref of sources) {\n if (!isSourceRef(ref)) throw new Error(\"createSourceSet: every source must be a resource_ref\");\n const key = `${ref.resource_type}\\u0000${ref.resource_id}\\u0000${ref.representation ?? \"\"}`;\n if (seen.has(key)) continue;\n seen.add(key);\n unique.push(ref);\n }\n const topic = options.topic?.trim();\n const retrieve_query = options.retrieve_query?.trim();\n if (options.grounding === \"retrieve\" && !retrieve_query) {\n throw new Error('createSourceSet: grounding \"retrieve\" needs a retrieve_query');\n }\n if (\n options.grounding === \"selected\" &&\n !unique.some((ref) => (ref.include_segments?.length ?? 0) > 0)\n ) {\n throw new Error('createSourceSet: grounding \"selected\" needs at least one Source with include_segments');\n }\n return {\n __kind: SOURCE_SET_KIND,\n version: SOURCE_SET_VERSION,\n sources: unique,\n ...(topic ? { topic } : {}),\n ...(options.grounding ? { grounding: options.grounding } : {}),\n ...(retrieve_query ? { retrieve_query } : {}),\n ...(options.target_model_id ? { target_model_id: options.target_model_id } : {}),\n };\n}\n\n/** Structural guard for a wire value claiming to be a v1 `SourceSet`. */\nexport function isSourceSet(value: unknown): value is SourceSet {\n return (\n isRecord(value) &&\n value.__kind === SOURCE_SET_KIND &&\n value.version === SOURCE_SET_VERSION &&\n Array.isArray(value.sources) &&\n value.sources.every(isSourceRef)\n );\n}\n\nfunction manifestEntryChars(entry: SourceManifestEntry): number {\n const selected = entry.ref.include_segments;\n let chars: number;\n if (selected?.length && entry.segments?.length) {\n const wanted = new Set(selected);\n chars = entry.segments\n .filter((segment) => wanted.has(segment.id))\n .reduce((sum, segment) => sum + segment.chars, 0);\n } else {\n const formKey = entry.ref.representation ?? entry.default_form;\n const form =\n entry.forms.find((candidate) => candidate.form === formKey) ??\n entry.forms.find((candidate) => candidate.form === entry.default_form);\n chars = form?.chars ?? 0;\n }\n return entry.ref.max_chars !== undefined ? Math.min(chars, entry.ref.max_chars) : chars;\n}\n\n/**\n * Characters that will actually go in, computed from the Sources themselves\n * (never trusting a stale `total_chars`):\n * - `ResolvedSourceSet`: the sum of every resolved text's length.\n * - `SourceManifest`: per Source, the chosen form's size (the ref's\n * `representation`, else `default_form`), or the picked Segments' sizes when\n * `include_segments` is set, capped by the ref's `max_chars`. Sources whose\n * state is \"failed\" or \"unavailable\" contribute nothing — they cannot go in.\n */\nexport function totalChars(value: SourceManifest | ResolvedSourceSet): number {\n if (value.__kind === RESOLVED_SOURCE_SET_KIND) {\n return value.sources.reduce((sum, source) => sum + source.text.length, 0);\n }\n return value.sources\n .filter((entry) => entry.state === \"ready\" || entry.state === \"processing\")\n .reduce((sum, entry) => sum + manifestEntryChars(entry), 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AAGjC,IAAM,qBAAqB;AA2IlC,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AASO,SAAS,gBACd,cACA,YACA,UAA4B,CAAC,GAClB;AACX,QAAM,gBAAgB,aAAa,KAAK;AACxC,QAAM,c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,UAAU,MAAM,UAAU,QAAQ;AAC9C,UAAM,SAAS,IAAI,IAAI,QAAQ;AAC/B,YAAQ,MAAM,SACX,OAAO,CAAC,YAAY,OAAO,IAAI,QAAQ,EAAE,CAAC,EAC1C,OAAO,CAAC,KAAK,YAAY,MAAM,QAAQ,OAAO,CAAC;AAAA,EACpD,OAAO;AACL,UAAM,UAAU,MAAM,IAAI,kBAAkB,MAAM;AAClD,UAAM,OACJ,MAAM,MAAM,KAAK,CAAC,cAAc,UAAU,SAAS,OAAO,KAC1D,MAAM,MAAM,KAAK,CAAC,cAAc,UAAU,SAAS,MAAM,YAAY;AACvE,YAAQ,MAAM,SAAS;AAAA,EACzB;AACA,SAAO,MAAM,IAAI,cAAc,SAAY,KAAK,IAAI,OAAO,MAAM,IAAI,SAAS,IAAI;AACpF;AAWO,SAAS,WAAW,OAAmD;AAC5E,MAAI,MAAM,WAAW,0BAA0B;AAC7C,WAAO,MAAM,QAAQ,OAAO,CAAC,KAAK,WAAW,MAAM,OAAO,KAAK,QAAQ,CAAC;AAAA,EAC1E;AACA,SAAO,MAAM,QACV,OAAO,CAAC,UAAU,MAAM,UAAU,WAAW,MAAM,UAAU,YAAY,EACzE,OAAO,CAAC,KAAK,UAAU,MAAM,mBAAmB,KAAK,GAAG,CAAC;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../sources/index.ts"],"sourcesContent":["/**\n * `@ai-matrx/agents/sources` — THE ONE SOURCE PAYLOAD (contract v1, frozen 2026-09-27).\n *\n * Every request that is built from a person's Sources carries them as a\n * `SourceSet`: a list of `SourceRef` pointers (never blobs) plus how the model\n * should be grounded in them. The server answers with a `SourceManifest`\n * (sizes and states, never bodies — POST /sources/manifest) or a\n * `ResolvedSourceSet` (grounded text for generators — POST /sources/resolve).\n *\n * Contract of record: common-docs `projects/unified-source-input/DESIGN.md`\n * § \"Contract v1 — FROZEN\". A shape change here is an AMENDMENT there first,\n * with its Pydantic twin beside aidream's `parse_resource_reference`.\n *\n * `SourceRef` IS the existing `resource_ref` pointer already on the wire\n * (aidream `services/conversation_context/resource_context.py`), extended with\n * optional fields only — never coin a second pointer type.\n *\n * Pure module: no React, no I/O, no \"use client\".\n */\n\nexport const RESOURCE_REF_KIND = \"resource_ref\" as const;\nexport const SOURCE_SET_KIND = \"source_set\" as const;\nexport const SOURCE_MANIFEST_KIND = \"source_manifest\" as const;\nexport const RESOLVED_SOURCE_SET_KIND = \"resolved_source_set\" as const;\n\n/** The wire version every `SourceSet` carries. */\nexport const SOURCE_SET_VERSION = 1 as const;\n\n/** A bounded preview of one representation promoted into the prompt. */\nexport interface ResourcePromotion {\n representation: string;\n max_chars?: number;\n}\n\nexport type SourceDelivery = \"direct\" | \"context\";\nexport type SourceGrounding = \"whole\" | \"selected\" | \"retrieve\";\n\n/** The pointer — the existing `resource_ref` envelope, extended (all new fields optional). */\nexport interface SourceRef {\n __kind: typeof RESOURCE_REF_KIND;\n /** Server resource token: \"file\" (A2; \"cld_file\" is a server alias) | \"processed_document\" | \"note\" | \"fc_set\" | … */\n resource_type: string;\n resource_id: string;\n /** \"clean\" | \"raw\" | \"pdf\" | a family representation key. Omitted = server's Clean → Raw → original fallback. */\n representation?: string;\n /** Hand-picked Segment ids (rag.kg_chunks ids or \"<resource_id>:<n>\"). */\n include_segments?: string[];\n /** Include the text (default \"direct\") | the AI fetches it on demand (\"context\"). */\n delivery?: SourceDelivery;\n /** Per-Source cap chosen on the review page. */\n max_chars?: number;\n promote?: ResourcePromotion | ResourcePromotion[];\n exclude?: string[];\n}\n\nexport interface SourceSet {\n __kind: typeof SOURCE_SET_KIND;\n version: typeof SOURCE_SET_VERSION;\n sources: SourceRef[];\n /** Only for \"Just a topic\". */\n topic?: string;\n /** Default \"whole\". */\n grounding?: SourceGrounding;\n /** Required in spirit when grounding = \"retrieve\". */\n retrieve_query?: string;\n /** The model whose context window sets the budget. */\n target_model_id?: string;\n}\n\nexport type SourceState = \"ready\" | \"processing\" | \"failed\" | \"unavailable\";\n\nexport interface SourceManifestForm {\n form: string;\n label: string;\n chars: number;\n available: boolean;\n}\n\nexport interface SourceManifestSegment {\n id: string;\n /** \"Page 7\", \"Pages 22–24\" (a part spanning pages), \"0:04–2:31\", a heading path, \"Part 3\". */\n label: string;\n page?: number;\n chars: number;\n /**\n * Amendment A5: the part's opening words (about 160 characters, whitespace\n * collapsed) — never its body. Lets a person see what a part says and find\n * a part by its words.\n */\n preview?: string;\n}\n\nexport interface SourceManifestEntry {\n ref: SourceRef;\n label: string;\n resource_type: string;\n state: SourceState;\n state_detail?: string;\n forms: SourceManifestForm[];\n default_form: string;\n segments?: SourceManifestSegment[];\n}\n\n/** POST /sources/manifest { source_set } → sizes and states, never bodies. */\nexport interface SourceManifest {\n __kind: typeof SOURCE_MANIFEST_KIND;\n sources: SourceManifestEntry[];\n total_chars: number;\n estimated_tokens: number;\n /** null = unknown model; the UI says so. */\n model_context_tokens: number | null;\n}\n\nexport interface ResolvedSourceSegment {\n id: string;\n page?: number;\n chars: number;\n}\n\nexport interface ResolvedSource {\n ref: SourceRef;\n label: string;\n form_used: string;\n /** Grounded: \"### Chunk <id> (page N)\" blocks; never re-chunked. */\n text: string;\n segments: ResolvedSourceSegment[];\n file_id?: string;\n processed_document_id?: string;\n /** \"processing\" = the raw fallback was used. */\n state: \"ready\" | \"processing\";\n truncated: boolean;\n /** Every stand-in announces itself. */\n notes: string[];\n}\n\n/** A1 (2026-09-27): \"not_ready\" = a file not yet read. */\nexport type DroppedSourceReason =\n | \"no_access\"\n | \"missing\"\n | \"failed\"\n | \"over_budget\"\n | \"not_ready\";\n\nexport interface DroppedSource {\n ref: SourceRef;\n reason: DroppedSourceReason;\n /** A1: what happened and what to do. */\n detail?: string;\n}\n\n/** POST /sources/resolve { source_set } → grounded text for generators. */\nexport interface ResolvedSourceSet {\n __kind: typeof RESOLVED_SOURCE_SET_KIND;\n sources: ResolvedSource[];\n dropped: DroppedSource[];\n total_chars: number;\n}\n\n// ---------------------------------------------------------------------------\n// Pure helpers\n// ---------------------------------------------------------------------------\n\n/** Builder options. `undefined` is accepted everywhere so callers can forward an existing ref's optional fields. */\nexport interface SourceRefOptions {\n representation?: string | undefined;\n include_segments?: readonly string[] | undefined;\n delivery?: SourceDelivery | undefined;\n max_chars?: number | undefined;\n promote?: ResourcePromotion | ResourcePromotion[] | undefined;\n exclude?: readonly string[] | undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Build one pointer. Empty optional fields are omitted (so the wire stays\n * minimal and equal pointers serialise equally); `exclude` is trimmed,\n * lower-cased and de-duplicated exactly as the server normalises it;\n * `include_segments` is de-duplicated in order. Throws on an empty type or id —\n * a pointer to nothing is never built silently.\n */\nexport function createSourceRef(\n resourceType: string,\n resourceId: string,\n options: SourceRefOptions = {},\n): SourceRef {\n const resource_type = resourceType.trim();\n const resource_id = resourceId.trim();\n if (!resource_type) throw new Error(\"createSourceRef: resource_type is required\");\n if (!resource_id) throw new Error(\"createSourceRef: resource_id is required\");\n if (\n options.max_chars !== undefined &&\n (!Number.isInteger(options.max_chars) || options.max_chars <= 0)\n ) {\n throw new Error(\"createSourceRef: max_chars must be a positive integer\");\n }\n const exclude = Array.from(\n new Set(\n (options.exclude ?? [])\n .map((value) => value.trim().toLowerCase())\n .filter(Boolean),\n ),\n );\n const include_segments = Array.from(\n new Set((options.include_segments ?? []).map((id) => id.trim()).filter(Boolean)),\n );\n return {\n __kind: RESOURCE_REF_KIND,\n resource_type,\n resource_id,\n ...(options.representation ? { representation: options.representation } : {}),\n ...(include_segments.length ? { include_segments } : {}),\n ...(options.delivery ? { delivery: options.delivery } : {}),\n ...(options.max_chars !== undefined ? { max_chars: options.max_chars } : {}),\n ...(options.promote ? { promote: options.promote } : {}),\n ...(exclude.length ? { exclude } : {}),\n };\n}\n\nexport function isSourceRef(value: unknown): value is SourceRef {\n return (\n isRecord(value) &&\n value.__kind === RESOURCE_REF_KIND &&\n typeof value.resource_type === \"string\" &&\n value.resource_type.length > 0 &&\n typeof value.resource_id === \"string\" &&\n value.resource_id.length > 0\n );\n}\n\nexport interface SourceSetOptions {\n topic?: string | undefined;\n grounding?: SourceGrounding | undefined;\n retrieve_query?: string | undefined;\n target_model_id?: string | undefined;\n}\n\n/**\n * Build one envelope. Duplicate pointers (same type + id + representation) are\n * collapsed, keeping the first. `grounding: \"retrieve\"` without a query and\n * `grounding: \"selected\"` with no Source carrying `include_segments` throw —\n * both would otherwise resolve to something the person never asked for.\n */\nexport function createSourceSet(\n sources: readonly SourceRef[],\n options: SourceSetOptions = {},\n): SourceSet {\n const seen = new Set<string>();\n const unique: SourceRef[] = [];\n for (const ref of sources) {\n if (!isSourceRef(ref)) throw new Error(\"createSourceSet: every source must be a resource_ref\");\n const key = `${ref.resource_type}\\u0000${ref.resource_id}\\u0000${ref.representation ?? \"\"}`;\n if (seen.has(key)) continue;\n seen.add(key);\n unique.push(ref);\n }\n const topic = options.topic?.trim();\n const retrieve_query = options.retrieve_query?.trim();\n if (options.grounding === \"retrieve\" && !retrieve_query) {\n throw new Error('createSourceSet: grounding \"retrieve\" needs a retrieve_query');\n }\n if (\n options.grounding === \"selected\" &&\n !unique.some((ref) => (ref.include_segments?.length ?? 0) > 0)\n ) {\n throw new Error('createSourceSet: grounding \"selected\" needs at least one Source with include_segments');\n }\n return {\n __kind: SOURCE_SET_KIND,\n version: SOURCE_SET_VERSION,\n sources: unique,\n ...(topic ? { topic } : {}),\n ...(options.grounding ? { grounding: options.grounding } : {}),\n ...(retrieve_query ? { retrieve_query } : {}),\n ...(options.target_model_id ? { target_model_id: options.target_model_id } : {}),\n };\n}\n\n/** Structural guard for a wire value claiming to be a v1 `SourceSet`. */\nexport function isSourceSet(value: unknown): value is SourceSet {\n return (\n isRecord(value) &&\n value.__kind === SOURCE_SET_KIND &&\n value.version === SOURCE_SET_VERSION &&\n Array.isArray(value.sources) &&\n value.sources.every(isSourceRef)\n );\n}\n\nfunction manifestEntryChars(entry: SourceManifestEntry): number {\n const selected = entry.ref.include_segments;\n let chars: number;\n if (selected?.length && entry.segments?.length) {\n const wanted = new Set(selected);\n chars = entry.segments\n .filter((segment) => wanted.has(segment.id))\n .reduce((sum, segment) => sum + segment.chars, 0);\n } else {\n const formKey = entry.ref.representation ?? entry.default_form;\n const form =\n entry.forms.find((candidate) => candidate.form === formKey) ??\n entry.forms.find((candidate) => candidate.form === entry.default_form);\n chars = form?.chars ?? 0;\n }\n return entry.ref.max_chars !== undefined ? Math.min(chars, entry.ref.max_chars) : chars;\n}\n\n/**\n * Characters that will actually go in, computed from the Sources themselves\n * (never trusting a stale `total_chars`):\n * - `ResolvedSourceSet`: the sum of every resolved text's length.\n * - `SourceManifest`: per Source, the chosen form's size (the ref's\n * `representation`, else `default_form`), or the picked Segments' sizes when\n * `include_segments` is set, capped by the ref's `max_chars`. Sources whose\n * state is \"failed\" or \"unavailable\" contribute nothing — they cannot go in.\n */\nexport function totalChars(value: SourceManifest | ResolvedSourceSet): number {\n if (value.__kind === RESOLVED_SOURCE_SET_KIND) {\n return value.sources.reduce((sum, source) => sum + source.text.length, 0);\n }\n return value.sources\n .filter((entry) => entry.state === \"ready\" || entry.state === \"processing\")\n .reduce((sum, entry) => sum + manifestEntryChars(entry), 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AAGjC,IAAM,qBAAqB;AAkJlC,SAAS,SAAS,OAAkD;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AASO,SAAS,gBACd,cACA,YACA,UAA4B,CAAC,GAClB;AACX,QAAM,gBAAgB,aAAa,KAAK;AACxC,QAAM,cAAc,WAAW,KAAK;AACpC,MAAI,C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9C,UAAM,SAAS,IAAI,IAAI,QAAQ;AAC/B,YAAQ,MAAM,SACX,OAAO,CAAC,YAAY,OAAO,IAAI,QAAQ,EAAE,CAAC,EAC1C,OAAO,CAAC,KAAK,YAAY,MAAM,QAAQ,OAAO,CAAC;AAAA,EACpD,OAAO;AACL,UAAM,UAAU,MAAM,IAAI,kBAAkB,MAAM;AAClD,UAAM,OACJ,MAAM,MAAM,KAAK,CAAC,cAAc,UAAU,SAAS,OAAO,KAC1D,MAAM,MAAM,KAAK,CAAC,cAAc,UAAU,SAAS,MAAM,YAAY;AACvE,YAAQ,MAAM,SAAS;AAAA,EACzB;AACA,SAAO,MAAM,IAAI,cAAc,SAAY,KAAK,IAAI,OAAO,MAAM,IAAI,SAAS,IAAI;AACpF;AAWO,SAAS,WAAW,OAAmD;AAC5E,MAAI,MAAM,WAAW,0BAA0B;AAC7C,WAAO,MAAM,QAAQ,OAAO,CAAC,KAAK,WAAW,MAAM,OAAO,KAAK,QAAQ,CAAC;AAAA,EAC1E;AACA,SAAO,MAAM,QACV,OAAO,CAAC,UAAU,MAAM,UAAU,WAAW,MAAM,UAAU,YAAY,EACzE,OAAO,CAAC,KAAK,UAAU,MAAM,mBAAmB,KAAK,GAAG,CAAC;AAC9D;","names":[]}
@@ -69,9 +69,16 @@ interface SourceManifestForm {
69
69
  }
70
70
  interface SourceManifestSegment {
71
71
  id: string;
72
+ /** "Page 7", "Pages 22–24" (a part spanning pages), "0:04–2:31", a heading path, "Part 3". */
72
73
  label: string;
73
74
  page?: number;
74
75
  chars: number;
76
+ /**
77
+ * Amendment A5: the part's opening words (about 160 characters, whitespace
78
+ * collapsed) — never its body. Lets a person see what a part says and find
79
+ * a part by its words.
80
+ */
81
+ preview?: string;
75
82
  }
76
83
  interface SourceManifestEntry {
77
84
  ref: SourceRef;
@@ -69,9 +69,16 @@ interface SourceManifestForm {
69
69
  }
70
70
  interface SourceManifestSegment {
71
71
  id: string;
72
+ /** "Page 7", "Pages 22–24" (a part spanning pages), "0:04–2:31", a heading path, "Part 3". */
72
73
  label: string;
73
74
  page?: number;
74
75
  chars: number;
76
+ /**
77
+ * Amendment A5: the part's opening words (about 160 characters, whitespace
78
+ * collapsed) — never its body. Lets a person see what a part says and find
79
+ * a part by its words.
80
+ */
81
+ preview?: string;
75
82
  }
76
83
  interface SourceManifestEntry {
77
84
  ref: SourceRef;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../sources/index.ts"],"sourcesContent":["/**\n * `@ai-matrx/agents/sources` — THE ONE SOURCE PAYLOAD (contract v1, frozen 2026-09-27).\n *\n * Every request that is built from a person's Sources carries them as a\n * `SourceSet`: a list of `SourceRef` pointers (never blobs) plus how the model\n * should be grounded in them. The server answers with a `SourceManifest`\n * (sizes and states, never bodies — POST /sources/manifest) or a\n * `ResolvedSourceSet` (grounded text for generators — POST /sources/resolve).\n *\n * Contract of record: common-docs `projects/unified-source-input/DESIGN.md`\n * § \"Contract v1 — FROZEN\". A shape change here is an AMENDMENT there first,\n * with its Pydantic twin beside aidream's `parse_resource_reference`.\n *\n * `SourceRef` IS the existing `resource_ref` pointer already on the wire\n * (aidream `services/conversation_context/resource_context.py`), extended with\n * optional fields only — never coin a second pointer type.\n *\n * Pure module: no React, no I/O, no \"use client\".\n */\n\nexport const RESOURCE_REF_KIND = \"resource_ref\" as const;\nexport const SOURCE_SET_KIND = \"source_set\" as const;\nexport const SOURCE_MANIFEST_KIND = \"source_manifest\" as const;\nexport const RESOLVED_SOURCE_SET_KIND = \"resolved_source_set\" as const;\n\n/** The wire version every `SourceSet` carries. */\nexport const SOURCE_SET_VERSION = 1 as const;\n\n/** A bounded preview of one representation promoted into the prompt. */\nexport interface ResourcePromotion {\n representation: string;\n max_chars?: number;\n}\n\nexport type SourceDelivery = \"direct\" | \"context\";\nexport type SourceGrounding = \"whole\" | \"selected\" | \"retrieve\";\n\n/** The pointer — the existing `resource_ref` envelope, extended (all new fields optional). */\nexport interface SourceRef {\n __kind: typeof RESOURCE_REF_KIND;\n /** Server resource token: \"file\" (A2; \"cld_file\" is a server alias) | \"processed_document\" | \"note\" | \"fc_set\" | … */\n resource_type: string;\n resource_id: string;\n /** \"clean\" | \"raw\" | \"pdf\" | a family representation key. Omitted = server's Clean → Raw → original fallback. */\n representation?: string;\n /** Hand-picked Segment ids (rag.kg_chunks ids or \"<resource_id>:<n>\"). */\n include_segments?: string[];\n /** Include the text (default \"direct\") | the AI fetches it on demand (\"context\"). */\n delivery?: SourceDelivery;\n /** Per-Source cap chosen on the review page. */\n max_chars?: number;\n promote?: ResourcePromotion | ResourcePromotion[];\n exclude?: string[];\n}\n\nexport interface SourceSet {\n __kind: typeof SOURCE_SET_KIND;\n version: typeof SOURCE_SET_VERSION;\n sources: SourceRef[];\n /** Only for \"Just a topic\". */\n topic?: string;\n /** Default \"whole\". */\n grounding?: SourceGrounding;\n /** Required in spirit when grounding = \"retrieve\". */\n retrieve_query?: string;\n /** The model whose context window sets the budget. */\n target_model_id?: string;\n}\n\nexport type SourceState = \"ready\" | \"processing\" | \"failed\" | \"unavailable\";\n\nexport interface SourceManifestForm {\n form: string;\n label: string;\n chars: number;\n available: boolean;\n}\n\nexport interface SourceManifestSegment {\n id: string;\n label: string;\n page?: number;\n chars: number;\n}\n\nexport interface SourceManifestEntry {\n ref: SourceRef;\n label: string;\n resource_type: string;\n state: SourceState;\n state_detail?: string;\n forms: SourceManifestForm[];\n default_form: string;\n segments?: SourceManifestSegment[];\n}\n\n/** POST /sources/manifest { source_set } → sizes and states, never bodies. */\nexport interface SourceManifest {\n __kind: typeof SOURCE_MANIFEST_KIND;\n sources: SourceManifestEntry[];\n total_chars: number;\n estimated_tokens: number;\n /** null = unknown model; the UI says so. */\n model_context_tokens: number | null;\n}\n\nexport interface ResolvedSourceSegment {\n id: string;\n page?: number;\n chars: number;\n}\n\nexport interface ResolvedSource {\n ref: SourceRef;\n label: string;\n form_used: string;\n /** Grounded: \"### Chunk <id> (page N)\" blocks; never re-chunked. */\n text: string;\n segments: ResolvedSourceSegment[];\n file_id?: string;\n processed_document_id?: string;\n /** \"processing\" = the raw fallback was used. */\n state: \"ready\" | \"processing\";\n truncated: boolean;\n /** Every stand-in announces itself. */\n notes: string[];\n}\n\n/** A1 (2026-09-27): \"not_ready\" = a file not yet read. */\nexport type DroppedSourceReason =\n | \"no_access\"\n | \"missing\"\n | \"failed\"\n | \"over_budget\"\n | \"not_ready\";\n\nexport interface DroppedSource {\n ref: SourceRef;\n reason: DroppedSourceReason;\n /** A1: what happened and what to do. */\n detail?: string;\n}\n\n/** POST /sources/resolve { source_set } → grounded text for generators. */\nexport interface ResolvedSourceSet {\n __kind: typeof RESOLVED_SOURCE_SET_KIND;\n sources: ResolvedSource[];\n dropped: DroppedSource[];\n total_chars: number;\n}\n\n// ---------------------------------------------------------------------------\n// Pure helpers\n// ---------------------------------------------------------------------------\n\n/** Builder options. `undefined` is accepted everywhere so callers can forward an existing ref's optional fields. */\nexport interface SourceRefOptions {\n representation?: string | undefined;\n include_segments?: readonly string[] | undefined;\n delivery?: SourceDelivery | undefined;\n max_chars?: number | undefined;\n promote?: ResourcePromotion | ResourcePromotion[] | undefined;\n exclude?: readonly string[] | undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Build one pointer. Empty optional fields are omitted (so the wire stays\n * minimal and equal pointers serialise equally); `exclude` is trimmed,\n * lower-cased and de-duplicated exactly as the server normalises it;\n * `include_segments` is de-duplicated in order. Throws on an empty type or id —\n * a pointer to nothing is never built silently.\n */\nexport function createSourceRef(\n resourceType: string,\n resourceId: string,\n options: SourceRefOptions = {},\n): SourceRef {\n const resource_type = resourceType.trim();\n const resource_id = resourceId.trim();\n if (!resource_type) throw new Error(\"createSourceRef: resource_type is required\");\n if (!resource_id) throw new Error(\"createSourceRef: resource_id is required\");\n if (\n options.max_chars !== undefined &&\n (!Number.isInteger(options.max_chars) || options.max_chars <= 0)\n ) {\n throw new Error(\"createSourceRef: max_chars must be a positive integer\");\n }\n const exclude = Array.from(\n new Set(\n (options.exclude ?? [])\n .map((value) => value.trim().toLowerCase())\n .filter(Boolean),\n ),\n );\n const include_segments = Array.from(\n new Set((options.include_segments ?? []).map((id) => id.trim()).filter(Boolean)),\n );\n return {\n __kind: RESOURCE_REF_KIND,\n resource_type,\n resource_id,\n ...(options.representation ? { representation: options.representation } : {}),\n ...(include_segments.length ? { include_segments } : {}),\n ...(options.delivery ? { delivery: options.delivery } : {}),\n ...(options.max_chars !== undefined ? { max_chars: options.max_chars } : {}),\n ...(options.promote ? { promote: options.promote } : {}),\n ...(exclude.length ? { exclude } : {}),\n };\n}\n\nexport function isSourceRef(value: unknown): value is SourceRef {\n return (\n isRecord(value) &&\n value.__kind === RESOURCE_REF_KIND &&\n typeof value.resource_type === \"string\" &&\n value.resource_type.length > 0 &&\n typeof value.resource_id === \"string\" &&\n value.resource_id.length > 0\n );\n}\n\nexport interface SourceSetOptions {\n topic?: string | undefined;\n grounding?: SourceGrounding | undefined;\n retrieve_query?: string | undefined;\n target_model_id?: string | undefined;\n}\n\n/**\n * Build one envelope. Duplicate pointers (same type + id + representation) are\n * collapsed, keeping the first. `grounding: \"retrieve\"` without a query and\n * `grounding: \"selected\"` with no Source carrying `include_segments` throw —\n * both would otherwise resolve to something the person never asked for.\n */\nexport function createSourceSet(\n sources: readonly SourceRef[],\n options: SourceSetOptions = {},\n): SourceSet {\n const seen = new Set<string>();\n const unique: SourceRef[] = [];\n for (const ref of sources) {\n if (!isSourceRef(ref)) throw new Error(\"createSourceSet: every source must be a resource_ref\");\n const key = `${ref.resource_type}\\u0000${ref.resource_id}\\u0000${ref.representation ?? \"\"}`;\n if (seen.has(key)) continue;\n seen.add(key);\n unique.push(ref);\n }\n const topic = options.topic?.trim();\n const retrieve_query = options.retrieve_query?.trim();\n if (options.grounding === \"retrieve\" && !retrieve_query) {\n throw new Error('createSourceSet: grounding \"retrieve\" needs a retrieve_query');\n }\n if (\n options.grounding === \"selected\" &&\n !unique.some((ref) => (ref.include_segments?.length ?? 0) > 0)\n ) {\n throw new Error('createSourceSet: grounding \"selected\" needs at least one Source with include_segments');\n }\n return {\n __kind: SOURCE_SET_KIND,\n version: SOURCE_SET_VERSION,\n sources: unique,\n ...(topic ? { topic } : {}),\n ...(options.grounding ? { grounding: options.grounding } : {}),\n ...(retrieve_query ? { retrieve_query } : {}),\n ...(options.target_model_id ? { target_model_id: options.target_model_id } : {}),\n };\n}\n\n/** Structural guard for a wire value claiming to be a v1 `SourceSet`. */\nexport function isSourceSet(value: unknown): value is SourceSet {\n return (\n isRecord(value) &&\n value.__kind === SOURCE_SET_KIND &&\n value.version === SOURCE_SET_VERSION &&\n Array.isArray(value.sources) &&\n value.sources.every(isSourceRef)\n );\n}\n\nfunction manifestEntryChars(entry: SourceManifestEntry): number {\n const selected = entry.ref.include_segments;\n let chars: number;\n if (selected?.length && entry.segments?.length) {\n const wanted = new Set(selected);\n chars = entry.segments\n .filter((segment) => wanted.has(segment.id))\n .reduce((sum, segment) => sum + segment.chars, 0);\n } else {\n const formKey = entry.ref.representation ?? entry.default_form;\n const form =\n entry.forms.find((candidate) => candidate.form === formKey) ??\n entry.forms.find((candidate) => candidate.form === entry.default_form);\n chars = form?.chars ?? 0;\n }\n return entry.ref.max_chars !== undefined ? Math.min(chars, entry.ref.max_chars) : chars;\n}\n\n/**\n * Characters that will actually go in, computed from the Sources themselves\n * (never trusting a stale `total_chars`):\n * - `ResolvedSourceSet`: the sum of every resolved text's length.\n * - `SourceManifest`: per Source, the chosen form's size (the ref's\n * `representation`, else `default_form`), or the picked Segments' sizes when\n * `include_segments` is set, capped by the ref's `max_chars`. Sources whose\n * state is \"failed\" or \"unavailable\" contribute nothing — they cannot go in.\n */\nexport function totalChars(value: SourceManifest | ResolvedSourceSet): number {\n if (value.__kind === RESOLVED_SOURCE_SET_KIND) {\n return value.sources.reduce((sum, source) => sum + source.text.length, 0);\n }\n return value.sources\n .filter((entry) => entry.state === \"ready\" || entry.state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rx/agents/sources` — THE ONE SOURCE PAYLOAD (contract v1, frozen 2026-09-27).\n *\n * Every request that is built from a person's Sources carries them as a\n * `SourceSet`: a list of `SourceRef` pointers (never blobs) plus how the model\n * should be grounded in them. The server answers with a `SourceManifest`\n * (sizes and states, never bodies — POST /sources/manifest) or a\n * `ResolvedSourceSet` (grounded text for generators — POST /sources/resolve).\n *\n * Contract of record: common-docs `projects/unified-source-input/DESIGN.md`\n * § \"Contract v1 — FROZEN\". A shape change here is an AMENDMENT there first,\n * with its Pydantic twin beside aidream's `parse_resource_reference`.\n *\n * `SourceRef` IS the existing `resource_ref` pointer already on the wire\n * (aidream `services/conversation_context/resource_context.py`), extended with\n * optional fields only — never coin a second pointer type.\n *\n * Pure module: no React, no I/O, no \"use client\".\n */\n\nexport const RESOURCE_REF_KIND = \"resource_ref\" as const;\nexport const SOURCE_SET_KIND = \"source_set\" as const;\nexport const SOURCE_MANIFEST_KIND = \"source_manifest\" as const;\nexport const RESOLVED_SOURCE_SET_KIND = \"resolved_source_set\" as const;\n\n/** The wire version every `SourceSet` carries. */\nexport const SOURCE_SET_VERSION = 1 as const;\n\n/** A bounded preview of one representation promoted into the prompt. */\nexport interface ResourcePromotion {\n representation: string;\n max_chars?: number;\n}\n\nexport type SourceDelivery = \"direct\" | \"context\";\nexport type SourceGrounding = \"whole\" | \"selected\" | \"retrieve\";\n\n/** The pointer — the existing `resource_ref` envelope, extended (all new fields optional). */\nexport interface SourceRef {\n __kind: typeof RESOURCE_REF_KIND;\n /** Server resource token: \"file\" (A2; \"cld_file\" is a server alias) | \"processed_document\" | \"note\" | \"fc_set\" | … */\n resource_type: string;\n resource_id: string;\n /** \"clean\" | \"raw\" | \"pdf\" | a family representation key. Omitted = server's Clean → Raw → original fallback. */\n representation?: string;\n /** Hand-picked Segment ids (rag.kg_chunks ids or \"<resource_id>:<n>\"). */\n include_segments?: string[];\n /** Include the text (default \"direct\") | the AI fetches it on demand (\"context\"). */\n delivery?: SourceDelivery;\n /** Per-Source cap chosen on the review page. */\n max_chars?: number;\n promote?: ResourcePromotion | ResourcePromotion[];\n exclude?: string[];\n}\n\nexport interface SourceSet {\n __kind: typeof SOURCE_SET_KIND;\n version: typeof SOURCE_SET_VERSION;\n sources: SourceRef[];\n /** Only for \"Just a topic\". */\n topic?: string;\n /** Default \"whole\". */\n grounding?: SourceGrounding;\n /** Required in spirit when grounding = \"retrieve\". */\n retrieve_query?: string;\n /** The model whose context window sets the budget. */\n target_model_id?: string;\n}\n\nexport type SourceState = \"ready\" | \"processing\" | \"failed\" | \"unavailable\";\n\nexport interface SourceManifestForm {\n form: string;\n label: string;\n chars: number;\n available: boolean;\n}\n\nexport interface SourceManifestSegment {\n id: string;\n /** \"Page 7\", \"Pages 22–24\" (a part spanning pages), \"0:04–2:31\", a heading path, \"Part 3\". */\n label: string;\n page?: number;\n chars: number;\n /**\n * Amendment A5: the part's opening words (about 160 characters, whitespace\n * collapsed) — never its body. Lets a person see what a part says and find\n * a part by its words.\n */\n preview?: string;\n}\n\nexport interface SourceManifestEntry {\n ref: SourceRef;\n label: string;\n resource_type: string;\n state: SourceState;\n state_detail?: string;\n forms: SourceManifestForm[];\n default_form: string;\n segments?: SourceManifestSegment[];\n}\n\n/** POST /sources/manifest { source_set } → sizes and states, never bodies. */\nexport interface SourceManifest {\n __kind: typeof SOURCE_MANIFEST_KIND;\n sources: SourceManifestEntry[];\n total_chars: number;\n estimated_tokens: number;\n /** null = unknown model; the UI says so. */\n model_context_tokens: number | null;\n}\n\nexport interface ResolvedSourceSegment {\n id: string;\n page?: number;\n chars: number;\n}\n\nexport interface ResolvedSource {\n ref: SourceRef;\n label: string;\n form_used: string;\n /** Grounded: \"### Chunk <id> (page N)\" blocks; never re-chunked. */\n text: string;\n segments: ResolvedSourceSegment[];\n file_id?: string;\n processed_document_id?: string;\n /** \"processing\" = the raw fallback was used. */\n state: \"ready\" | \"processing\";\n truncated: boolean;\n /** Every stand-in announces itself. */\n notes: string[];\n}\n\n/** A1 (2026-09-27): \"not_ready\" = a file not yet read. */\nexport type DroppedSourceReason =\n | \"no_access\"\n | \"missing\"\n | \"failed\"\n | \"over_budget\"\n | \"not_ready\";\n\nexport interface DroppedSource {\n ref: SourceRef;\n reason: DroppedSourceReason;\n /** A1: what happened and what to do. */\n detail?: string;\n}\n\n/** POST /sources/resolve { source_set } → grounded text for generators. */\nexport interface ResolvedSourceSet {\n __kind: typeof RESOLVED_SOURCE_SET_KIND;\n sources: ResolvedSource[];\n dropped: DroppedSource[];\n total_chars: number;\n}\n\n// ---------------------------------------------------------------------------\n// Pure helpers\n// ---------------------------------------------------------------------------\n\n/** Builder options. `undefined` is accepted everywhere so callers can forward an existing ref's optional fields. */\nexport interface SourceRefOptions {\n representation?: string | undefined;\n include_segments?: readonly string[] | undefined;\n delivery?: SourceDelivery | undefined;\n max_chars?: number | undefined;\n promote?: ResourcePromotion | ResourcePromotion[] | undefined;\n exclude?: readonly string[] | undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Build one pointer. Empty optional fields are omitted (so the wire stays\n * minimal and equal pointers serialise equally); `exclude` is trimmed,\n * lower-cased and de-duplicated exactly as the server normalises it;\n * `include_segments` is de-duplicated in order. Throws on an empty type or id —\n * a pointer to nothing is never built silently.\n */\nexport function createSourceRef(\n resourceType: string,\n resourceId: string,\n options: SourceRefOptions = {},\n): SourceRef {\n const resource_type = resourceType.trim();\n const resource_id = resourceId.trim();\n if (!resource_type) throw new Error(\"createSourceRef: resource_type is required\");\n if (!resource_id) throw new Error(\"createSourceRef: resource_id is required\");\n if (\n options.max_chars !== undefined &&\n (!Number.isInteger(options.max_chars) || options.max_chars <= 0)\n ) {\n throw new Error(\"createSourceRef: max_chars must be a positive integer\");\n }\n const exclude = Array.from(\n new Set(\n (options.exclude ?? [])\n .map((value) => value.trim().toLowerCase())\n .filter(Boolean),\n ),\n );\n const include_segments = Array.from(\n new Set((options.include_segments ?? []).map((id) => id.trim()).filter(Boolean)),\n );\n return {\n __kind: RESOURCE_REF_KIND,\n resource_type,\n resource_id,\n ...(options.representation ? { representation: options.representation } : {}),\n ...(include_segments.length ? { include_segments } : {}),\n ...(options.delivery ? { delivery: options.delivery } : {}),\n ...(options.max_chars !== undefined ? { max_chars: options.max_chars } : {}),\n ...(options.promote ? { promote: options.promote } : {}),\n ...(exclude.length ? { exclude } : {}),\n };\n}\n\nexport function isSourceRef(value: unknown): value is SourceRef {\n return (\n isRecord(value) &&\n value.__kind === RESOURCE_REF_KIND &&\n typeof value.resource_type === \"string\" &&\n value.resource_type.length > 0 &&\n typeof value.resource_id === \"string\" &&\n value.resource_id.length > 0\n );\n}\n\nexport interface SourceSetOptions {\n topic?: string | undefined;\n grounding?: SourceGrounding | undefined;\n retrieve_query?: string | undefined;\n target_model_id?: string | undefined;\n}\n\n/**\n * Build one envelope. Duplicate pointers (same type + id + representation) are\n * collapsed, keeping the first. `grounding: \"retrieve\"` without a query and\n * `grounding: \"selected\"` with no Source carrying `include_segments` throw —\n * both would otherwise resolve to something the person never asked for.\n */\nexport function createSourceSet(\n sources: readonly SourceRef[],\n options: SourceSetOptions = {},\n): SourceSet {\n const seen = new Set<string>();\n const unique: SourceRef[] = [];\n for (const ref of sources) {\n if (!isSourceRef(ref)) throw new Error(\"createSourceSet: every source must be a resource_ref\");\n const key = `${ref.resource_type}\\u0000${ref.resource_id}\\u0000${ref.representation ?? \"\"}`;\n if (seen.has(key)) continue;\n seen.add(key);\n unique.push(ref);\n }\n const topic = options.topic?.trim();\n const retrieve_query = options.retrieve_query?.trim();\n if (options.grounding === \"retrieve\" && !retrieve_query) {\n throw new Error('createSourceSet: grounding \"retrieve\" needs a retrieve_query');\n }\n if (\n options.grounding === \"selected\" &&\n !unique.some((ref) => (ref.include_segments?.length ?? 0) > 0)\n ) {\n throw new Error('createSourceSet: grounding \"selected\" needs at least one Source with include_segments');\n }\n return {\n __kind: SOURCE_SET_KIND,\n version: SOURCE_SET_VERSION,\n sources: unique,\n ...(topic ? { topic } : {}),\n ...(options.grounding ? { grounding: options.grounding } : {}),\n ...(retrieve_query ? { retrieve_query } : {}),\n ...(options.target_model_id ? { target_model_id: options.target_model_id } : {}),\n };\n}\n\n/** Structural guard for a wire value claiming to be a v1 `SourceSet`. */\nexport function isSourceSet(value: unknown): value is SourceSet {\n return (\n isRecord(value) &&\n value.__kind === SOURCE_SET_KIND &&\n value.version === SOURCE_SET_VERSION &&\n Array.isArray(value.sources) &&\n value.sources.every(isSourceRef)\n );\n}\n\nfunction manifestEntryChars(entry: SourceManifestEntry): number {\n const selected = entry.ref.include_segments;\n let chars: number;\n if (selected?.length && entry.segments?.length) {\n const wanted = new Set(selected);\n chars = entry.segments\n .filter((segment) => wanted.has(segment.id))\n .reduce((sum, segment) => sum + segment.chars, 0);\n } else {\n const formKey = entry.ref.representation ?? entry.default_form;\n const form =\n entry.forms.find((candidate) => candidate.form === formKey) ??\n entry.forms.find((candidate) => candidate.form === entry.default_form);\n chars = form?.chars ?? 0;\n }\n return entry.ref.max_chars !== undefined ? Math.min(chars, entry.ref.max_chars) : chars;\n}\n\n/**\n * Characters that will actually go in, computed from the Sources themselves\n * (never trusting a stale `total_chars`):\n * - `ResolvedSourceSet`: the sum of every resolved text's length.\n * - `SourceManifest`: per Source, the chosen form's size (the ref's\n * `representation`, else `default_form`), or the picked Segments' sizes when\n * `include_segments` is set, capped by the ref's `max_chars`. Sources whose\n * state is \"failed\" or \"unavailable\" contribute nothing — they cannot go in.\n */\nexport function totalChars(value: SourceManifest | ResolvedSourceSet): number {\n if (value.__kind === RESOLVED_SOURCE_SET_KIND) {\n return value.sources.reduce((sum, source) => sum + source.text.length, 0);\n }\n return value.sources\n .filter((entry) => entry.state === \"ready\" || entry.state === \"processing\")\n .reduce((sum, entry) => sum + manifestEntryChars(entry), 0);\n}\n"],"mappings":";AAoBO,IAAM,oBAAoB;AAC1B,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;AAC7B,IAA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