docagent-cli 0.0.35__py3-none-any.whl
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.
- docagent_cli/__init__.py +36 -0
- docagent_cli/__main__.py +6 -0
- docagent_cli/_ask_user_types.py +90 -0
- docagent_cli/_cli_context.py +27 -0
- docagent_cli/_debug.py +52 -0
- docagent_cli/_env_vars.py +56 -0
- docagent_cli/_server_config.py +352 -0
- docagent_cli/_session_stats.py +114 -0
- docagent_cli/_testing_models.py +144 -0
- docagent_cli/_version.py +17 -0
- docagent_cli/agent.py +1193 -0
- docagent_cli/app.py +4979 -0
- docagent_cli/app.tcss +283 -0
- docagent_cli/ask_user.py +301 -0
- docagent_cli/built_in_skills/__init__.py +5 -0
- docagent_cli/built_in_skills/doc-coauthoring/SKILL.md +375 -0
- docagent_cli/built_in_skills/docx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/docx/SKILL.md +590 -0
- docagent_cli/built_in_skills/docx/scripts/__init__.py +1 -0
- docagent_cli/built_in_skills/docx/scripts/accept_changes.py +135 -0
- docagent_cli/built_in_skills/docx/scripts/comment.py +318 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/docx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/docx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/docx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/docx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/docx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/docx/scripts/templates/comments.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsExtended.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/commentsIds.xml +3 -0
- docagent_cli/built_in_skills/docx/scripts/templates/people.xml +3 -0
- docagent_cli/built_in_skills/pdf/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/pdf/SKILL.md +314 -0
- docagent_cli/built_in_skills/pdf/forms.md +294 -0
- docagent_cli/built_in_skills/pdf/reference.md +612 -0
- docagent_cli/built_in_skills/pdf/scripts/check_bounding_boxes.py +65 -0
- docagent_cli/built_in_skills/pdf/scripts/check_fillable_fields.py +11 -0
- docagent_cli/built_in_skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- docagent_cli/built_in_skills/pdf/scripts/create_validation_image.py +37 -0
- docagent_cli/built_in_skills/pdf/scripts/extract_form_field_info.py +122 -0
- docagent_cli/built_in_skills/pdf/scripts/extract_form_structure.py +115 -0
- docagent_cli/built_in_skills/pdf/scripts/fill_fillable_fields.py +98 -0
- docagent_cli/built_in_skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- docagent_cli/built_in_skills/pptx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/pptx/SKILL.md +232 -0
- docagent_cli/built_in_skills/pptx/editing.md +205 -0
- docagent_cli/built_in_skills/pptx/pptxgenjs.md +420 -0
- docagent_cli/built_in_skills/pptx/scripts/__init__.py +0 -0
- docagent_cli/built_in_skills/pptx/scripts/add_slide.py +195 -0
- docagent_cli/built_in_skills/pptx/scripts/clean.py +286 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/pptx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/pptx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/pptx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/pptx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/pptx/scripts/thumbnail.py +289 -0
- docagent_cli/built_in_skills/remember/SKILL.md +118 -0
- docagent_cli/built_in_skills/skill-creator/LICENSE.txt +202 -0
- docagent_cli/built_in_skills/skill-creator/SKILL.md +485 -0
- docagent_cli/built_in_skills/skill-creator/agents/analyzer.md +274 -0
- docagent_cli/built_in_skills/skill-creator/agents/comparator.md +202 -0
- docagent_cli/built_in_skills/skill-creator/agents/grader.md +223 -0
- docagent_cli/built_in_skills/skill-creator/assets/eval_review.html +146 -0
- docagent_cli/built_in_skills/skill-creator/eval-viewer/generate_review.py +471 -0
- docagent_cli/built_in_skills/skill-creator/eval-viewer/viewer.html +1325 -0
- docagent_cli/built_in_skills/skill-creator/references/schemas.md +430 -0
- docagent_cli/built_in_skills/skill-creator/scripts/__init__.py +0 -0
- docagent_cli/built_in_skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- docagent_cli/built_in_skills/skill-creator/scripts/generate_report.py +326 -0
- docagent_cli/built_in_skills/skill-creator/scripts/improve_description.py +247 -0
- docagent_cli/built_in_skills/skill-creator/scripts/package_skill.py +136 -0
- docagent_cli/built_in_skills/skill-creator/scripts/quick_validate.py +103 -0
- docagent_cli/built_in_skills/skill-creator/scripts/run_eval.py +310 -0
- docagent_cli/built_in_skills/skill-creator/scripts/run_loop.py +328 -0
- docagent_cli/built_in_skills/skill-creator/scripts/utils.py +47 -0
- docagent_cli/built_in_skills/theme-factory/LICENSE.txt +202 -0
- docagent_cli/built_in_skills/theme-factory/SKILL.md +59 -0
- docagent_cli/built_in_skills/theme-factory/theme-showcase.pdf +0 -0
- docagent_cli/built_in_skills/theme-factory/themes/arctic-frost.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/botanical-garden.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/desert-rose.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/forest-canopy.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/golden-hour.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/midnight-galaxy.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/modern-minimalist.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/ocean-depths.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/sunset-boulevard.md +19 -0
- docagent_cli/built_in_skills/theme-factory/themes/tech-innovation.md +19 -0
- docagent_cli/built_in_skills/xlsx/LICENSE.txt +30 -0
- docagent_cli/built_in_skills/xlsx/SKILL.md +292 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/pack.py +159 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/soffice.py +183 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/unpack.py +132 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validate.py +111 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/__init__.py +15 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/base.py +847 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/docx.py +446 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/pptx.py +275 -0
- docagent_cli/built_in_skills/xlsx/scripts/office/validators/redlining.py +247 -0
- docagent_cli/built_in_skills/xlsx/scripts/recalc.py +184 -0
- docagent_cli/clipboard.py +128 -0
- docagent_cli/command_registry.py +284 -0
- docagent_cli/config.py +2418 -0
- docagent_cli/configurable_model.py +162 -0
- docagent_cli/default_agent_prompt.md +12 -0
- docagent_cli/editor.py +142 -0
- docagent_cli/file_ops.py +473 -0
- docagent_cli/formatting.py +28 -0
- docagent_cli/hooks.py +206 -0
- docagent_cli/input.py +787 -0
- docagent_cli/integrations/__init__.py +1 -0
- docagent_cli/integrations/sandbox_factory.py +873 -0
- docagent_cli/integrations/sandbox_provider.py +71 -0
- docagent_cli/local_context.py +718 -0
- docagent_cli/main.py +1641 -0
- docagent_cli/mcp_tools.py +707 -0
- docagent_cli/mcp_trust.py +168 -0
- docagent_cli/media_utils.py +478 -0
- docagent_cli/model_config.py +1620 -0
- docagent_cli/non_interactive.py +948 -0
- docagent_cli/offload.py +371 -0
- docagent_cli/output.py +69 -0
- docagent_cli/project_utils.py +188 -0
- docagent_cli/py.typed +0 -0
- docagent_cli/remote_client.py +515 -0
- docagent_cli/server.py +520 -0
- docagent_cli/server_graph.py +196 -0
- docagent_cli/server_manager.py +365 -0
- docagent_cli/sessions.py +1262 -0
- docagent_cli/skills/__init__.py +18 -0
- docagent_cli/skills/commands.py +1090 -0
- docagent_cli/skills/load.py +192 -0
- docagent_cli/subagents.py +173 -0
- docagent_cli/system_prompt.md +247 -0
- docagent_cli/textual_adapter.py +1352 -0
- docagent_cli/theme.py +842 -0
- docagent_cli/token_state.py +31 -0
- docagent_cli/tool_display.py +298 -0
- docagent_cli/tools.py +236 -0
- docagent_cli/ui.py +420 -0
- docagent_cli/unicode_security.py +516 -0
- docagent_cli/update_check.py +454 -0
- docagent_cli/widgets/__init__.py +9 -0
- docagent_cli/widgets/_links.py +63 -0
- docagent_cli/widgets/approval.py +442 -0
- docagent_cli/widgets/ask_user.py +398 -0
- docagent_cli/widgets/autocomplete.py +691 -0
- docagent_cli/widgets/chat_input.py +1827 -0
- docagent_cli/widgets/diff.py +248 -0
- docagent_cli/widgets/history.py +188 -0
- docagent_cli/widgets/loading.py +177 -0
- docagent_cli/widgets/mcp_viewer.py +362 -0
- docagent_cli/widgets/message_store.py +675 -0
- docagent_cli/widgets/messages.py +1751 -0
- docagent_cli/widgets/model_selector.py +964 -0
- docagent_cli/widgets/status.py +372 -0
- docagent_cli/widgets/theme_selector.py +164 -0
- docagent_cli/widgets/thread_selector.py +1905 -0
- docagent_cli/widgets/tool_renderers.py +148 -0
- docagent_cli/widgets/tool_widgets.py +274 -0
- docagent_cli/widgets/welcome.py +339 -0
- docagent_cli-0.0.35.data/data/docagent_cli/default_agent_prompt.md +12 -0
- docagent_cli-0.0.35.dist-info/METADATA +200 -0
- docagent_cli-0.0.35.dist-info/RECORD +300 -0
- docagent_cli-0.0.35.dist-info/WHEEL +4 -0
- docagent_cli-0.0.35.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"""Ask user widget for interactive questions during agent execution."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Literal
|
|
7
|
+
|
|
8
|
+
from textual.binding import Binding, BindingType
|
|
9
|
+
from textual.containers import Container, Vertical
|
|
10
|
+
from textual.content import Content
|
|
11
|
+
from textual.message import Message
|
|
12
|
+
from textual.widgets import Input, Markdown, Static
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
import asyncio
|
|
16
|
+
|
|
17
|
+
from textual import events
|
|
18
|
+
from textual.app import ComposeResult
|
|
19
|
+
|
|
20
|
+
from docagent_cli._ask_user_types import (
|
|
21
|
+
AskUserWidgetResult,
|
|
22
|
+
Choice,
|
|
23
|
+
Question,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
from docagent_cli import theme
|
|
27
|
+
from docagent_cli.config import (
|
|
28
|
+
get_glyphs,
|
|
29
|
+
is_ascii_mode,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
OTHER_CHOICE_LABEL = "Other (type your answer)"
|
|
33
|
+
logger = logging.getLogger(__name__)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class AskUserMenu(Container):
|
|
37
|
+
"""Interactive widget for asking the user questions.
|
|
38
|
+
|
|
39
|
+
Supports text input and multiple choice questions. Multiple choice
|
|
40
|
+
questions always include an "Other" option for free-form input.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
can_focus = True
|
|
44
|
+
can_focus_children = True
|
|
45
|
+
|
|
46
|
+
BINDINGS: ClassVar[list[BindingType]] = [
|
|
47
|
+
Binding("escape", "cancel", "Cancel", show=False),
|
|
48
|
+
Binding("tab", "next_question", "Next question", show=False, priority=True),
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
class Answered(Message):
|
|
52
|
+
"""Message sent when user submits all answers."""
|
|
53
|
+
|
|
54
|
+
def __init__(self, answers: list[str]) -> None: # noqa: D107
|
|
55
|
+
super().__init__()
|
|
56
|
+
self.answers = answers
|
|
57
|
+
|
|
58
|
+
class Cancelled(Message):
|
|
59
|
+
"""Message sent when user cancels the ask_user prompt."""
|
|
60
|
+
|
|
61
|
+
def __init__(self) -> None: # noqa: D107
|
|
62
|
+
super().__init__()
|
|
63
|
+
|
|
64
|
+
def __init__( # noqa: D107
|
|
65
|
+
self,
|
|
66
|
+
questions: list[Question],
|
|
67
|
+
id: str | None = None, # noqa: A002
|
|
68
|
+
**kwargs: Any,
|
|
69
|
+
) -> None:
|
|
70
|
+
super().__init__(id=id or "ask-user-menu", classes="ask-user-menu", **kwargs)
|
|
71
|
+
self._questions = questions
|
|
72
|
+
self._answers: list[str] = [""] * len(questions)
|
|
73
|
+
self._current_question = 0
|
|
74
|
+
self._confirmed: list[bool] = [False] * len(questions)
|
|
75
|
+
self._future: asyncio.Future[AskUserWidgetResult] | None = None
|
|
76
|
+
self._question_widgets: list[_QuestionWidget] = []
|
|
77
|
+
self._submitted = False
|
|
78
|
+
|
|
79
|
+
def set_future(self, future: asyncio.Future[AskUserWidgetResult]) -> None:
|
|
80
|
+
"""Set the future to resolve when user answers."""
|
|
81
|
+
self._future = future
|
|
82
|
+
|
|
83
|
+
def compose(self) -> ComposeResult: # noqa: D102
|
|
84
|
+
glyphs = get_glyphs()
|
|
85
|
+
count = len(self._questions)
|
|
86
|
+
label = "Question" if count == 1 else "Questions"
|
|
87
|
+
yield Static(
|
|
88
|
+
f"{glyphs.cursor} Agent has {count} {label} for you",
|
|
89
|
+
classes="ask-user-title",
|
|
90
|
+
)
|
|
91
|
+
yield Static("")
|
|
92
|
+
|
|
93
|
+
with Vertical(classes="ask-user-questions"):
|
|
94
|
+
for i, q in enumerate(self._questions):
|
|
95
|
+
qw = _QuestionWidget(q, index=i)
|
|
96
|
+
self._question_widgets.append(qw)
|
|
97
|
+
yield qw
|
|
98
|
+
|
|
99
|
+
yield Static("")
|
|
100
|
+
parts = [
|
|
101
|
+
f"{glyphs.arrow_up}/{glyphs.arrow_down} Select",
|
|
102
|
+
"Enter to continue",
|
|
103
|
+
]
|
|
104
|
+
if len(self._questions) > 1:
|
|
105
|
+
parts.append("Tab/Shift+Tab switch question")
|
|
106
|
+
parts.append("Esc to cancel")
|
|
107
|
+
yield Static(
|
|
108
|
+
f" {glyphs.bullet} ".join(parts),
|
|
109
|
+
classes="ask-user-help",
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
async def on_mount(self) -> None: # noqa: D102
|
|
113
|
+
if is_ascii_mode():
|
|
114
|
+
colors = theme.get_theme_colors(self)
|
|
115
|
+
self.styles.border = ("ascii", colors.success)
|
|
116
|
+
self._set_active_question(0)
|
|
117
|
+
|
|
118
|
+
def focus_active(self) -> None:
|
|
119
|
+
"""Focus the current active question's input."""
|
|
120
|
+
self._set_active_question(self._current_question)
|
|
121
|
+
|
|
122
|
+
def on_input_submitted(self, event: Input.Submitted) -> None: # noqa: D102
|
|
123
|
+
event.stop()
|
|
124
|
+
# Find which question owns this Input and confirm it.
|
|
125
|
+
for qw in self._question_widgets:
|
|
126
|
+
if (qw._text_input and qw._text_input is event.input) or (
|
|
127
|
+
qw._other_input and qw._other_input is event.input
|
|
128
|
+
):
|
|
129
|
+
answer = qw.get_answer()
|
|
130
|
+
if answer.strip() or not qw._required:
|
|
131
|
+
self.confirm_and_advance(qw._index)
|
|
132
|
+
return
|
|
133
|
+
|
|
134
|
+
def confirm_and_advance(self, index: int) -> None:
|
|
135
|
+
"""Confirm the answer at `index` and advance to the next question."""
|
|
136
|
+
self._answers[index] = self._question_widgets[index].get_answer()
|
|
137
|
+
self._confirmed[index] = True
|
|
138
|
+
|
|
139
|
+
# Find next unconfirmed question.
|
|
140
|
+
for i in range(index + 1, len(self._question_widgets)):
|
|
141
|
+
if not self._confirmed[i]:
|
|
142
|
+
self._set_active_question(i)
|
|
143
|
+
return
|
|
144
|
+
|
|
145
|
+
# All confirmed — collect final answers and submit.
|
|
146
|
+
for i, qw in enumerate(self._question_widgets):
|
|
147
|
+
self._answers[i] = qw.get_answer()
|
|
148
|
+
if all(
|
|
149
|
+
a.strip() or not self._question_widgets[i]._required
|
|
150
|
+
for i, a in enumerate(self._answers)
|
|
151
|
+
):
|
|
152
|
+
self._submit()
|
|
153
|
+
return
|
|
154
|
+
|
|
155
|
+
# Edge case: a confirmed required text field was left empty
|
|
156
|
+
# (shouldn't happen normally). Re-open it.
|
|
157
|
+
for i, a in enumerate(self._answers):
|
|
158
|
+
if not a.strip() and self._question_widgets[i]._required:
|
|
159
|
+
self._confirmed[i] = False
|
|
160
|
+
self._set_active_question(i)
|
|
161
|
+
return
|
|
162
|
+
|
|
163
|
+
def _set_active_question(self, index: int) -> None:
|
|
164
|
+
"""Update the visual indicator and focus for the active question."""
|
|
165
|
+
self._current_question = index
|
|
166
|
+
for i, qw in enumerate(self._question_widgets):
|
|
167
|
+
if i == index:
|
|
168
|
+
qw.add_class("ask-user-question-active")
|
|
169
|
+
qw.remove_class("ask-user-question-inactive")
|
|
170
|
+
qw.focus_input()
|
|
171
|
+
else:
|
|
172
|
+
qw.remove_class("ask-user-question-active")
|
|
173
|
+
qw.add_class("ask-user-question-inactive")
|
|
174
|
+
|
|
175
|
+
def _submit(self) -> None:
|
|
176
|
+
if self._submitted:
|
|
177
|
+
return
|
|
178
|
+
self._submitted = True
|
|
179
|
+
if self._future and not self._future.done():
|
|
180
|
+
self._future.set_result({"type": "answered", "answers": self._answers})
|
|
181
|
+
self.post_message(self.Answered(self._answers))
|
|
182
|
+
|
|
183
|
+
def action_next_question(self) -> None:
|
|
184
|
+
"""Navigate to the next question without confirming."""
|
|
185
|
+
if self._current_question < len(self._question_widgets) - 1:
|
|
186
|
+
self._set_active_question(self._current_question + 1)
|
|
187
|
+
|
|
188
|
+
def action_previous_question(self) -> None:
|
|
189
|
+
"""Navigate to the previous question without confirming."""
|
|
190
|
+
if self._current_question > 0:
|
|
191
|
+
self._set_active_question(self._current_question - 1)
|
|
192
|
+
|
|
193
|
+
def action_cancel(self) -> None: # noqa: D102
|
|
194
|
+
if self._submitted:
|
|
195
|
+
return
|
|
196
|
+
self._submitted = True
|
|
197
|
+
if self._future and not self._future.done():
|
|
198
|
+
self._future.set_result({"type": "cancelled"})
|
|
199
|
+
self.post_message(self.Cancelled())
|
|
200
|
+
|
|
201
|
+
def on_blur(self, event: events.Blur) -> None: # noqa: PLR6301 # Textual event handler
|
|
202
|
+
"""Prevent blur from propagating and dismissing the menu."""
|
|
203
|
+
event.stop()
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class _ChoiceOption(Static):
|
|
207
|
+
"""A single selectable choice option."""
|
|
208
|
+
|
|
209
|
+
def __init__(
|
|
210
|
+
self, text: str, index: int, *, selected: bool = False, **kwargs: Any
|
|
211
|
+
) -> None:
|
|
212
|
+
self.choice_index: int = index
|
|
213
|
+
self.selected: bool = selected
|
|
214
|
+
self._text: str = text
|
|
215
|
+
super().__init__(self._render(), classes="ask-user-choice", **kwargs)
|
|
216
|
+
|
|
217
|
+
def toggle(self) -> None:
|
|
218
|
+
"""Toggle the selected state."""
|
|
219
|
+
self.selected = not self.selected
|
|
220
|
+
self.update(self._render())
|
|
221
|
+
|
|
222
|
+
def select(self) -> None:
|
|
223
|
+
"""Mark this choice as selected."""
|
|
224
|
+
self.selected = True
|
|
225
|
+
self.update(self._render())
|
|
226
|
+
|
|
227
|
+
def deselect(self) -> None:
|
|
228
|
+
"""Mark this choice as deselected."""
|
|
229
|
+
self.selected = False
|
|
230
|
+
self.update(self._render())
|
|
231
|
+
|
|
232
|
+
def _render(self) -> Content:
|
|
233
|
+
"""Build display content with cursor prefix.
|
|
234
|
+
|
|
235
|
+
Returns:
|
|
236
|
+
Styled Content with selection cursor and label text.
|
|
237
|
+
"""
|
|
238
|
+
glyphs = get_glyphs()
|
|
239
|
+
prefix = f"{glyphs.cursor} " if self.selected else " "
|
|
240
|
+
return Content.from_markup("$prefix$text", prefix=prefix, text=self._text)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class _QuestionWidget(Vertical):
|
|
244
|
+
"""Widget for a single question (text or multiple choice)."""
|
|
245
|
+
|
|
246
|
+
BINDINGS: ClassVar[list[BindingType]] = [
|
|
247
|
+
Binding("up", "move_up", "Up", show=False),
|
|
248
|
+
Binding("k", "move_up", "Up", show=False),
|
|
249
|
+
Binding("down", "move_down", "Down", show=False),
|
|
250
|
+
Binding("j", "move_down", "Down", show=False),
|
|
251
|
+
Binding("enter", "select_or_submit", "Select", show=False),
|
|
252
|
+
]
|
|
253
|
+
|
|
254
|
+
can_focus = True
|
|
255
|
+
can_focus_children = True
|
|
256
|
+
|
|
257
|
+
def __init__(self, question: Question, index: int, **kwargs: Any) -> None:
|
|
258
|
+
super().__init__(classes="ask-user-question", **kwargs)
|
|
259
|
+
question_type = question.get("type", "text")
|
|
260
|
+
self._question: Question = question
|
|
261
|
+
self._index: int = index
|
|
262
|
+
self._q_type: Literal["text", "multiple_choice"] = (
|
|
263
|
+
"multiple_choice" if question_type == "multiple_choice" else "text"
|
|
264
|
+
)
|
|
265
|
+
self._choices: list[Choice] = question.get("choices", [])
|
|
266
|
+
self._required: bool = question.get("required", True)
|
|
267
|
+
self._choice_widgets: list[_ChoiceOption] = []
|
|
268
|
+
self._selected_choice: int = 0
|
|
269
|
+
self._text_input: Input | None = None
|
|
270
|
+
self._other_input: Input | None = None
|
|
271
|
+
self._is_other_selected: bool = False
|
|
272
|
+
|
|
273
|
+
def compose(self) -> ComposeResult:
|
|
274
|
+
q_text = self._question.get("question", "")
|
|
275
|
+
num = self._index + 1
|
|
276
|
+
suffix = " *(required)*" if self._required else ""
|
|
277
|
+
# q_text is agent-authored; rendered as markdown intentionally so
|
|
278
|
+
# agents can use inline formatting, links, and code spans in questions.
|
|
279
|
+
yield Markdown(f"**{num}.** {q_text}{suffix}", classes="ask-user-question-text")
|
|
280
|
+
|
|
281
|
+
if self._q_type == "multiple_choice" and self._choices:
|
|
282
|
+
for i, choice in enumerate(self._choices):
|
|
283
|
+
label = choice.get("value", str(choice))
|
|
284
|
+
cw = _ChoiceOption(label, index=i, selected=(i == 0))
|
|
285
|
+
self._choice_widgets.append(cw)
|
|
286
|
+
yield cw
|
|
287
|
+
|
|
288
|
+
other_cw = _ChoiceOption(OTHER_CHOICE_LABEL, index=len(self._choices))
|
|
289
|
+
self._choice_widgets.append(other_cw)
|
|
290
|
+
yield other_cw
|
|
291
|
+
|
|
292
|
+
self._other_input = Input(
|
|
293
|
+
placeholder="Type your answer...",
|
|
294
|
+
classes="ask-user-other-input",
|
|
295
|
+
)
|
|
296
|
+
self._other_input.display = False
|
|
297
|
+
yield self._other_input
|
|
298
|
+
else:
|
|
299
|
+
self._text_input = Input(
|
|
300
|
+
placeholder="Type your answer...",
|
|
301
|
+
classes="ask-user-text-input",
|
|
302
|
+
)
|
|
303
|
+
yield self._text_input
|
|
304
|
+
|
|
305
|
+
def focus_input(self) -> None:
|
|
306
|
+
"""Focus the appropriate input for this question."""
|
|
307
|
+
if self._text_input:
|
|
308
|
+
self._text_input.focus()
|
|
309
|
+
elif self._is_other_selected and self._other_input:
|
|
310
|
+
self._other_input.focus()
|
|
311
|
+
elif self._choice_widgets:
|
|
312
|
+
self.focus()
|
|
313
|
+
|
|
314
|
+
def get_answer(self) -> str:
|
|
315
|
+
"""Return the current answer text for this question."""
|
|
316
|
+
if self._q_type == "text" or not self._choices:
|
|
317
|
+
return self._text_input.value if self._text_input else ""
|
|
318
|
+
|
|
319
|
+
if self._is_other_selected and self._other_input:
|
|
320
|
+
return self._other_input.value
|
|
321
|
+
|
|
322
|
+
if self._choice_widgets and self._selected_choice < len(self._choices):
|
|
323
|
+
return self._choices[self._selected_choice].get("value", "")
|
|
324
|
+
|
|
325
|
+
return ""
|
|
326
|
+
|
|
327
|
+
def action_move_up(self) -> None:
|
|
328
|
+
"""Move selection up in the choice list."""
|
|
329
|
+
if self._q_type != "multiple_choice" or not self._choice_widgets:
|
|
330
|
+
return
|
|
331
|
+
if (
|
|
332
|
+
self._is_other_selected
|
|
333
|
+
and self._other_input
|
|
334
|
+
and self._other_input.has_focus
|
|
335
|
+
):
|
|
336
|
+
# Jump directly to the last real choice instead of requiring
|
|
337
|
+
# two presses (one to defocus, one to navigate).
|
|
338
|
+
self._selected_choice = max(0, len(self._choices) - 1)
|
|
339
|
+
self._update_choice_selection()
|
|
340
|
+
self.focus()
|
|
341
|
+
return
|
|
342
|
+
old = self._selected_choice
|
|
343
|
+
self._selected_choice = max(0, self._selected_choice - 1)
|
|
344
|
+
if old != self._selected_choice:
|
|
345
|
+
self._update_choice_selection()
|
|
346
|
+
|
|
347
|
+
def action_move_down(self) -> None:
|
|
348
|
+
"""Move selection down in the choice list."""
|
|
349
|
+
if self._q_type != "multiple_choice" or not self._choice_widgets:
|
|
350
|
+
return
|
|
351
|
+
max_idx = len(self._choice_widgets) - 1
|
|
352
|
+
old = self._selected_choice
|
|
353
|
+
self._selected_choice = min(max_idx, self._selected_choice + 1)
|
|
354
|
+
if old != self._selected_choice:
|
|
355
|
+
self._update_choice_selection()
|
|
356
|
+
|
|
357
|
+
def action_select_or_submit(self) -> None:
|
|
358
|
+
"""Confirm current choice or open the Other input."""
|
|
359
|
+
if self._q_type == "multiple_choice" and self._choice_widgets:
|
|
360
|
+
is_other = self._selected_choice == len(self._choices)
|
|
361
|
+
if is_other:
|
|
362
|
+
self._is_other_selected = True
|
|
363
|
+
if self._other_input:
|
|
364
|
+
self._other_input.display = True
|
|
365
|
+
self._other_input.focus()
|
|
366
|
+
else:
|
|
367
|
+
self._is_other_selected = False
|
|
368
|
+
if self._other_input:
|
|
369
|
+
self._other_input.display = False
|
|
370
|
+
menu = self._find_menu()
|
|
371
|
+
if menu is not None:
|
|
372
|
+
menu.confirm_and_advance(self._index)
|
|
373
|
+
|
|
374
|
+
def _find_menu(self) -> AskUserMenu | None:
|
|
375
|
+
node: Any = self.parent
|
|
376
|
+
while node is not None:
|
|
377
|
+
if isinstance(node, AskUserMenu):
|
|
378
|
+
return node
|
|
379
|
+
node = node.parent
|
|
380
|
+
logger.warning(
|
|
381
|
+
"Failed to find AskUserMenu ancestor for question index %d",
|
|
382
|
+
self._index,
|
|
383
|
+
)
|
|
384
|
+
return None
|
|
385
|
+
|
|
386
|
+
def _update_choice_selection(self) -> None:
|
|
387
|
+
for i, cw in enumerate(self._choice_widgets):
|
|
388
|
+
if i == self._selected_choice:
|
|
389
|
+
cw.select()
|
|
390
|
+
else:
|
|
391
|
+
cw.deselect()
|
|
392
|
+
|
|
393
|
+
is_other = self._selected_choice == len(self._choices)
|
|
394
|
+
self._is_other_selected = is_other
|
|
395
|
+
if self._other_input:
|
|
396
|
+
self._other_input.display = is_other
|
|
397
|
+
if is_other:
|
|
398
|
+
self._other_input.focus()
|