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,128 @@
|
|
|
1
|
+
"""Clipboard utilities for docagent-cli."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import base64
|
|
6
|
+
import logging
|
|
7
|
+
import os
|
|
8
|
+
import pathlib
|
|
9
|
+
from typing import TYPE_CHECKING
|
|
10
|
+
|
|
11
|
+
from docagent_cli.config import get_glyphs
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from textual.app import App
|
|
17
|
+
|
|
18
|
+
_PREVIEW_MAX_LENGTH = 40
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _copy_osc52(text: str) -> None:
|
|
22
|
+
"""Copy text using OSC 52 escape sequence (works over SSH/tmux)."""
|
|
23
|
+
encoded = base64.b64encode(text.encode("utf-8")).decode("ascii")
|
|
24
|
+
osc52_seq = f"\033]52;c;{encoded}\a"
|
|
25
|
+
if os.environ.get("TMUX"):
|
|
26
|
+
osc52_seq = f"\033Ptmux;\033{osc52_seq}\033\\"
|
|
27
|
+
|
|
28
|
+
with pathlib.Path("/dev/tty").open("w", encoding="utf-8") as tty:
|
|
29
|
+
tty.write(osc52_seq)
|
|
30
|
+
tty.flush()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _shorten_preview(texts: list[str]) -> str:
|
|
34
|
+
"""Shorten text for notification preview.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Shortened preview text suitable for notification display.
|
|
38
|
+
"""
|
|
39
|
+
glyphs = get_glyphs()
|
|
40
|
+
dense_text = glyphs.newline.join(texts).replace("\n", glyphs.newline)
|
|
41
|
+
if len(dense_text) > _PREVIEW_MAX_LENGTH:
|
|
42
|
+
return f"{dense_text[: _PREVIEW_MAX_LENGTH - 1]}{glyphs.ellipsis}"
|
|
43
|
+
return dense_text
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def copy_selection_to_clipboard(app: App) -> None:
|
|
47
|
+
"""Copy selected text from app widgets to clipboard.
|
|
48
|
+
|
|
49
|
+
This queries all widgets for their text_selection and copies
|
|
50
|
+
any selected text to the system clipboard.
|
|
51
|
+
"""
|
|
52
|
+
selected_texts = []
|
|
53
|
+
|
|
54
|
+
for widget in app.query("*"):
|
|
55
|
+
if not hasattr(widget, "text_selection") or not widget.text_selection:
|
|
56
|
+
continue
|
|
57
|
+
|
|
58
|
+
selection = widget.text_selection
|
|
59
|
+
|
|
60
|
+
if selection.end is None:
|
|
61
|
+
continue
|
|
62
|
+
|
|
63
|
+
try:
|
|
64
|
+
result = widget.get_selection(selection)
|
|
65
|
+
except (AttributeError, TypeError, ValueError, IndexError) as e:
|
|
66
|
+
logger.debug(
|
|
67
|
+
"Failed to get selection from widget %s: %s",
|
|
68
|
+
type(widget).__name__,
|
|
69
|
+
e,
|
|
70
|
+
exc_info=True,
|
|
71
|
+
)
|
|
72
|
+
continue
|
|
73
|
+
|
|
74
|
+
if not result:
|
|
75
|
+
continue
|
|
76
|
+
|
|
77
|
+
selected_text, _ = result
|
|
78
|
+
if selected_text.strip():
|
|
79
|
+
selected_texts.append(selected_text)
|
|
80
|
+
|
|
81
|
+
if not selected_texts:
|
|
82
|
+
return
|
|
83
|
+
|
|
84
|
+
combined_text = "\n".join(selected_texts)
|
|
85
|
+
|
|
86
|
+
# Try multiple clipboard methods
|
|
87
|
+
# Prefer pyperclip/app clipboard first (works reliably on local machines)
|
|
88
|
+
# OSC 52 is last resort (for SSH/remote where native clipboard unavailable)
|
|
89
|
+
copy_methods = [app.copy_to_clipboard]
|
|
90
|
+
|
|
91
|
+
# Try pyperclip if available (preferred - uses pbcopy on macOS)
|
|
92
|
+
try:
|
|
93
|
+
import pyperclip
|
|
94
|
+
|
|
95
|
+
copy_methods.insert(0, pyperclip.copy)
|
|
96
|
+
except ImportError:
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
# OSC 52 as fallback for remote/SSH sessions
|
|
100
|
+
copy_methods.append(_copy_osc52)
|
|
101
|
+
|
|
102
|
+
for copy_fn in copy_methods:
|
|
103
|
+
try:
|
|
104
|
+
copy_fn(combined_text)
|
|
105
|
+
# Use markup=False to prevent copied text from being parsed as Rich markup
|
|
106
|
+
app.notify(
|
|
107
|
+
f'"{_shorten_preview(selected_texts)}" copied',
|
|
108
|
+
severity="information",
|
|
109
|
+
timeout=2,
|
|
110
|
+
markup=False,
|
|
111
|
+
)
|
|
112
|
+
except (OSError, RuntimeError, TypeError) as e:
|
|
113
|
+
logger.debug(
|
|
114
|
+
"Clipboard copy method %s failed: %s",
|
|
115
|
+
getattr(copy_fn, "__name__", repr(copy_fn)),
|
|
116
|
+
e,
|
|
117
|
+
exc_info=True,
|
|
118
|
+
)
|
|
119
|
+
continue
|
|
120
|
+
else:
|
|
121
|
+
return
|
|
122
|
+
|
|
123
|
+
# If all methods fail, still notify but warn
|
|
124
|
+
app.notify(
|
|
125
|
+
"Failed to copy - no clipboard method available",
|
|
126
|
+
severity="warning",
|
|
127
|
+
timeout=3,
|
|
128
|
+
)
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"""Unified slash-command registry.
|
|
2
|
+
|
|
3
|
+
Every slash command is declared once as a `SlashCommand` entry in `COMMANDS`.
|
|
4
|
+
Bypass-tier frozensets and autocomplete tuples are derived automatically — no
|
|
5
|
+
other file should hard-code command metadata.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from enum import StrEnum
|
|
12
|
+
from typing import TYPE_CHECKING
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from docagent_cli.skills.load import ExtendedSkillMetadata
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BypassTier(StrEnum):
|
|
19
|
+
"""Classification that controls whether a command can skip the message queue."""
|
|
20
|
+
|
|
21
|
+
ALWAYS = "always"
|
|
22
|
+
"""Execute regardless of any busy state, including mid-thread-switch."""
|
|
23
|
+
|
|
24
|
+
CONNECTING = "connecting"
|
|
25
|
+
"""Bypass only during initial server connection, not during agent/shell."""
|
|
26
|
+
|
|
27
|
+
IMMEDIATE_UI = "immediate_ui"
|
|
28
|
+
"""Open modal UI immediately; real work deferred via `_defer_action` callback."""
|
|
29
|
+
|
|
30
|
+
SIDE_EFFECT_FREE = "side_effect_free"
|
|
31
|
+
"""Execute the side effect immediately; defer chat output until idle."""
|
|
32
|
+
|
|
33
|
+
QUEUED = "queued"
|
|
34
|
+
"""Must wait in the queue when the app is busy."""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True, slots=True, kw_only=True)
|
|
38
|
+
class SlashCommand:
|
|
39
|
+
"""A single slash-command definition."""
|
|
40
|
+
|
|
41
|
+
name: str
|
|
42
|
+
"""Canonical command name (e.g. `/quit`)."""
|
|
43
|
+
|
|
44
|
+
description: str
|
|
45
|
+
"""Short user-facing description."""
|
|
46
|
+
|
|
47
|
+
bypass_tier: BypassTier
|
|
48
|
+
"""Queue-bypass classification."""
|
|
49
|
+
|
|
50
|
+
hidden_keywords: str = ""
|
|
51
|
+
"""Space-separated terms for fuzzy matching (never displayed)."""
|
|
52
|
+
|
|
53
|
+
aliases: tuple[str, ...] = ()
|
|
54
|
+
"""Alternative names (e.g. `("/q",)` for `/quit`)."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
COMMANDS: tuple[SlashCommand, ...] = (
|
|
58
|
+
SlashCommand(
|
|
59
|
+
name="/clear",
|
|
60
|
+
description="Clear chat and start new thread",
|
|
61
|
+
bypass_tier=BypassTier.QUEUED,
|
|
62
|
+
hidden_keywords="reset",
|
|
63
|
+
),
|
|
64
|
+
SlashCommand(
|
|
65
|
+
name="/editor",
|
|
66
|
+
description="Open prompt in external editor ($EDITOR)",
|
|
67
|
+
bypass_tier=BypassTier.QUEUED,
|
|
68
|
+
),
|
|
69
|
+
SlashCommand(
|
|
70
|
+
name="/mcp",
|
|
71
|
+
description="Show active MCP servers and tools",
|
|
72
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
73
|
+
hidden_keywords="servers",
|
|
74
|
+
),
|
|
75
|
+
SlashCommand(
|
|
76
|
+
name="/model",
|
|
77
|
+
description="Switch or configure model (--model-params, --default)",
|
|
78
|
+
bypass_tier=BypassTier.IMMEDIATE_UI,
|
|
79
|
+
),
|
|
80
|
+
SlashCommand(
|
|
81
|
+
name="/offload",
|
|
82
|
+
description="Free up context window space by offloading older messages",
|
|
83
|
+
bypass_tier=BypassTier.QUEUED,
|
|
84
|
+
hidden_keywords="compact",
|
|
85
|
+
aliases=("/compact",),
|
|
86
|
+
),
|
|
87
|
+
SlashCommand( # Static alias; not auto-generated from skill discovery
|
|
88
|
+
name="/remember",
|
|
89
|
+
description="Update memory and skills from conversation",
|
|
90
|
+
bypass_tier=BypassTier.QUEUED,
|
|
91
|
+
),
|
|
92
|
+
SlashCommand( # Static alias; not auto-generated from skill discovery
|
|
93
|
+
name="/skill-creator",
|
|
94
|
+
description="Guide for creating effective agent skills",
|
|
95
|
+
bypass_tier=BypassTier.QUEUED,
|
|
96
|
+
),
|
|
97
|
+
SlashCommand(
|
|
98
|
+
name="/threads",
|
|
99
|
+
description="Browse and resume previous threads",
|
|
100
|
+
bypass_tier=BypassTier.IMMEDIATE_UI,
|
|
101
|
+
hidden_keywords="continue history sessions",
|
|
102
|
+
),
|
|
103
|
+
SlashCommand(
|
|
104
|
+
name="/trace",
|
|
105
|
+
description="Open current thread in LangSmith",
|
|
106
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
107
|
+
),
|
|
108
|
+
SlashCommand(
|
|
109
|
+
name="/tokens",
|
|
110
|
+
description="Token usage",
|
|
111
|
+
bypass_tier=BypassTier.QUEUED,
|
|
112
|
+
hidden_keywords="cost",
|
|
113
|
+
),
|
|
114
|
+
SlashCommand(
|
|
115
|
+
name="/reload",
|
|
116
|
+
description="Reload config from environment variables and .env",
|
|
117
|
+
bypass_tier=BypassTier.QUEUED,
|
|
118
|
+
hidden_keywords="refresh",
|
|
119
|
+
),
|
|
120
|
+
SlashCommand(
|
|
121
|
+
name="/theme",
|
|
122
|
+
description="Switch color theme",
|
|
123
|
+
bypass_tier=BypassTier.IMMEDIATE_UI,
|
|
124
|
+
hidden_keywords="dark light color appearance",
|
|
125
|
+
),
|
|
126
|
+
SlashCommand(
|
|
127
|
+
name="/update",
|
|
128
|
+
description="Check for and install updates",
|
|
129
|
+
bypass_tier=BypassTier.QUEUED,
|
|
130
|
+
hidden_keywords="upgrade",
|
|
131
|
+
),
|
|
132
|
+
SlashCommand(
|
|
133
|
+
name="/auto-update",
|
|
134
|
+
description="Toggle automatic updates on or off",
|
|
135
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
136
|
+
),
|
|
137
|
+
SlashCommand(
|
|
138
|
+
name="/changelog",
|
|
139
|
+
description="Open changelog in browser",
|
|
140
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
141
|
+
),
|
|
142
|
+
SlashCommand(
|
|
143
|
+
name="/version",
|
|
144
|
+
description="Show version",
|
|
145
|
+
bypass_tier=BypassTier.CONNECTING,
|
|
146
|
+
),
|
|
147
|
+
SlashCommand(
|
|
148
|
+
name="/feedback",
|
|
149
|
+
description="Submit a bug report or feature request",
|
|
150
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
151
|
+
),
|
|
152
|
+
SlashCommand(
|
|
153
|
+
name="/docs",
|
|
154
|
+
description="Open documentation in browser",
|
|
155
|
+
bypass_tier=BypassTier.SIDE_EFFECT_FREE,
|
|
156
|
+
),
|
|
157
|
+
SlashCommand(
|
|
158
|
+
name="/help",
|
|
159
|
+
description="Show help",
|
|
160
|
+
bypass_tier=BypassTier.QUEUED,
|
|
161
|
+
),
|
|
162
|
+
SlashCommand(
|
|
163
|
+
name="/quit",
|
|
164
|
+
description="Exit app",
|
|
165
|
+
bypass_tier=BypassTier.ALWAYS,
|
|
166
|
+
hidden_keywords="close leave",
|
|
167
|
+
aliases=("/q",),
|
|
168
|
+
),
|
|
169
|
+
)
|
|
170
|
+
"""All slash commands."""
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# ---------------------------------------------------------------------------
|
|
174
|
+
# Derived bypass-tier frozensets
|
|
175
|
+
# ---------------------------------------------------------------------------
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _build_bypass_set(tier: BypassTier) -> frozenset[str]:
|
|
179
|
+
"""Build a frozenset of command names (including aliases) for a tier.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
tier: The bypass tier to collect.
|
|
183
|
+
|
|
184
|
+
Returns:
|
|
185
|
+
Frozenset of all names and aliases that belong to `tier`.
|
|
186
|
+
"""
|
|
187
|
+
names: set[str] = set()
|
|
188
|
+
for cmd in COMMANDS:
|
|
189
|
+
if cmd.bypass_tier == tier:
|
|
190
|
+
names.add(cmd.name)
|
|
191
|
+
names.update(cmd.aliases)
|
|
192
|
+
return frozenset(names)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
ALWAYS_IMMEDIATE: frozenset[str] = _build_bypass_set(BypassTier.ALWAYS)
|
|
196
|
+
"""Commands that execute regardless of any busy state."""
|
|
197
|
+
|
|
198
|
+
BYPASS_WHEN_CONNECTING: frozenset[str] = _build_bypass_set(BypassTier.CONNECTING)
|
|
199
|
+
"""Commands that bypass only during initial server connection."""
|
|
200
|
+
|
|
201
|
+
IMMEDIATE_UI: frozenset[str] = _build_bypass_set(BypassTier.IMMEDIATE_UI)
|
|
202
|
+
"""Commands that open modal UI immediately, deferring real work."""
|
|
203
|
+
|
|
204
|
+
SIDE_EFFECT_FREE: frozenset[str] = _build_bypass_set(BypassTier.SIDE_EFFECT_FREE)
|
|
205
|
+
"""Commands whose side effect fires immediately; chat output deferred until idle."""
|
|
206
|
+
|
|
207
|
+
QUEUE_BOUND: frozenset[str] = _build_bypass_set(BypassTier.QUEUED)
|
|
208
|
+
"""Commands that must wait in the queue when the app is busy."""
|
|
209
|
+
|
|
210
|
+
ALL_CLASSIFIED: frozenset[str] = (
|
|
211
|
+
ALWAYS_IMMEDIATE
|
|
212
|
+
| BYPASS_WHEN_CONNECTING
|
|
213
|
+
| IMMEDIATE_UI
|
|
214
|
+
| SIDE_EFFECT_FREE
|
|
215
|
+
| QUEUE_BOUND
|
|
216
|
+
)
|
|
217
|
+
"""Union of all five tiers — used by drift tests."""
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
# ---------------------------------------------------------------------------
|
|
221
|
+
# Autocomplete tuples
|
|
222
|
+
# ---------------------------------------------------------------------------
|
|
223
|
+
|
|
224
|
+
SLASH_COMMANDS: list[tuple[str, str, str]] = [
|
|
225
|
+
(cmd.name, cmd.description, cmd.hidden_keywords) for cmd in COMMANDS
|
|
226
|
+
]
|
|
227
|
+
"""`(name, description, hidden_keywords)` tuples for `SlashCommandController`."""
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def parse_skill_command(command: str) -> tuple[str, str]:
|
|
231
|
+
"""Extract skill name and args from a `/skill:<name>` command.
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
command: The full command string (e.g., `/skill:web-research find X`).
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
Tuple of `(skill_name, args)`.
|
|
238
|
+
|
|
239
|
+
The skill name is normalized to lowercase. Both are empty strings
|
|
240
|
+
when the command has no skill name after the prefix.
|
|
241
|
+
"""
|
|
242
|
+
after_prefix = command[len("/skill:") :].strip()
|
|
243
|
+
parts = after_prefix.split(maxsplit=1)
|
|
244
|
+
if not parts or not parts[0]:
|
|
245
|
+
return "", ""
|
|
246
|
+
skill_name = parts[0].lower()
|
|
247
|
+
args = parts[1] if len(parts) > 1 else ""
|
|
248
|
+
return skill_name, args
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
_STATIC_SKILL_ALIASES: frozenset[str] = frozenset({"remember", "skill-creator"})
|
|
252
|
+
"""Built-in skill names that have a dedicated top-level slash command.
|
|
253
|
+
|
|
254
|
+
Only list skills whose `/skill:<name>` form is redundant because a `/<name>`
|
|
255
|
+
convenience alias exists in `COMMANDS`. Do **not** add every command name
|
|
256
|
+
here — that would silently suppress unrelated user skills that happen to share a
|
|
257
|
+
name with a slash command (e.g., a user skill called `model` should still
|
|
258
|
+
appear as `/skill:model`).
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def build_skill_commands(
|
|
263
|
+
skills: list[ExtendedSkillMetadata],
|
|
264
|
+
) -> list[tuple[str, str, str]]:
|
|
265
|
+
"""Build autocomplete tuples for discovered skills.
|
|
266
|
+
|
|
267
|
+
Each skill becomes a `/skill:<name>` entry with its description
|
|
268
|
+
and the skill name as a hidden keyword for fuzzy matching.
|
|
269
|
+
|
|
270
|
+
Skills that already have a dedicated slash command in `COMMANDS`
|
|
271
|
+
(e.g., `remember` → `/remember`) are excluded to avoid duplicate
|
|
272
|
+
autocomplete entries.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
skills: List of discovered skill metadata.
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
List of `(name, description, hidden_keywords)` tuples.
|
|
279
|
+
"""
|
|
280
|
+
return [
|
|
281
|
+
(f"/skill:{skill['name']}", skill["description"], skill["name"])
|
|
282
|
+
for skill in skills
|
|
283
|
+
if skill["name"] not in _STATIC_SKILL_ALIASES
|
|
284
|
+
]
|