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,192 @@
|
|
|
1
|
+
"""Skill loader for CLI commands.
|
|
2
|
+
|
|
3
|
+
This module provides filesystem-based skill discovery for CLI operations
|
|
4
|
+
(list, create, info, delete). It wraps the prebuilt middleware functionality from
|
|
5
|
+
docagent.middleware.skills and adapts it for direct filesystem access
|
|
6
|
+
needed by CLI commands.
|
|
7
|
+
|
|
8
|
+
For middleware usage within agents, use
|
|
9
|
+
docagent.middleware.skills.SkillsMiddleware directly.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import logging
|
|
15
|
+
from typing import TYPE_CHECKING, Literal, cast
|
|
16
|
+
|
|
17
|
+
from deepagents.backends.filesystem import FilesystemBackend
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from collections.abc import Sequence
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
from deepagents.middleware.skills import (
|
|
23
|
+
SkillMetadata,
|
|
24
|
+
_list_skills as list_skills_from_backend, # noqa: PLC2701 # Intentional access to internal skill listing
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
from docagent_cli._version import __version__ as _cli_version
|
|
28
|
+
|
|
29
|
+
logger = logging.getLogger(__name__)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ExtendedSkillMetadata(SkillMetadata):
|
|
33
|
+
"""Extended skill metadata for CLI display, adds source tracking.
|
|
34
|
+
|
|
35
|
+
Attributes:
|
|
36
|
+
source: Origin of the skill. One of `'built-in'`, `'user'`, `'project'`,
|
|
37
|
+
or `'claude (experimental)'`.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
source: Literal["built-in", "user", "project", "claude (experimental)"]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Re-export for CLI commands
|
|
44
|
+
__all__ = ["SkillMetadata", "list_skills", "load_skill_content"]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def list_skills(
|
|
48
|
+
*,
|
|
49
|
+
built_in_skills_dir: Path | None = None,
|
|
50
|
+
user_skills_dir: Path | None = None,
|
|
51
|
+
project_skills_dir: Path | None = None,
|
|
52
|
+
user_agent_skills_dir: Path | None = None,
|
|
53
|
+
project_agent_skills_dir: Path | None = None,
|
|
54
|
+
user_claude_skills_dir: Path | None = None,
|
|
55
|
+
project_claude_skills_dir: Path | None = None,
|
|
56
|
+
) -> list[ExtendedSkillMetadata]:
|
|
57
|
+
"""List skills from built-in, user, and/or project directories.
|
|
58
|
+
|
|
59
|
+
This is a CLI-specific wrapper around the prebuilt middleware's skill loading
|
|
60
|
+
functionality. It uses FilesystemBackend to load skills from local directories.
|
|
61
|
+
|
|
62
|
+
Precedence order (lowest to highest):
|
|
63
|
+
0. `built_in_skills_dir` (`<package>/built_in_skills/`)
|
|
64
|
+
1. `user_skills_dir` (`~/.docagent/{agent}/skills/`)
|
|
65
|
+
2. `user_agent_skills_dir` (`~/.agents/skills/`)
|
|
66
|
+
3. `project_skills_dir` (`.docagent/skills/`)
|
|
67
|
+
4. `project_agent_skills_dir` (`.agents/skills/`)
|
|
68
|
+
5. `user_claude_skills_dir` (`~/.claude/skills/`, experimental)
|
|
69
|
+
6. `project_claude_skills_dir` (`.claude/skills/`, experimental)
|
|
70
|
+
|
|
71
|
+
Skills from higher-precedence directories override those with the same name.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
built_in_skills_dir: Path to built-in skills shipped with the package.
|
|
75
|
+
user_skills_dir: Path to `~/.docagent/{agent}/skills/`.
|
|
76
|
+
project_skills_dir: Path to `.docagent/skills/`.
|
|
77
|
+
user_agent_skills_dir: Path to `~/.agents/skills/` (alias).
|
|
78
|
+
project_agent_skills_dir: Path to `.agents/skills/` (alias).
|
|
79
|
+
user_claude_skills_dir: Path to `~/.claude/skills/` (experimental).
|
|
80
|
+
project_claude_skills_dir: Path to `.claude/skills/` (experimental).
|
|
81
|
+
|
|
82
|
+
Returns:
|
|
83
|
+
Merged list of skill metadata from all sources, with higher-precedence
|
|
84
|
+
directories taking priority when names conflict.
|
|
85
|
+
"""
|
|
86
|
+
all_skills: dict[str, ExtendedSkillMetadata] = {}
|
|
87
|
+
|
|
88
|
+
sources: list[tuple[Path | None, str, bool]] = [
|
|
89
|
+
(built_in_skills_dir, "built-in", False),
|
|
90
|
+
(user_skills_dir, "user", False),
|
|
91
|
+
(user_agent_skills_dir, "user", False),
|
|
92
|
+
(project_skills_dir, "project", False),
|
|
93
|
+
(project_agent_skills_dir, "project", False),
|
|
94
|
+
(user_claude_skills_dir, "claude (experimental)", True),
|
|
95
|
+
(project_claude_skills_dir, "claude (experimental)", True),
|
|
96
|
+
]
|
|
97
|
+
"""Sources in precedence order (lowest to highest).
|
|
98
|
+
|
|
99
|
+
Each tuple: `(directory, source label, is_experimental)`.
|
|
100
|
+
|
|
101
|
+
Each source is individually try/except-guarded so a single inaccessible
|
|
102
|
+
directory doesn't block the rest.
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
for skill_dir, source_label, experimental in sources:
|
|
106
|
+
if not skill_dir or not skill_dir.exists():
|
|
107
|
+
continue
|
|
108
|
+
try:
|
|
109
|
+
backend = FilesystemBackend(root_dir=str(skill_dir))
|
|
110
|
+
skills = list_skills_from_backend(backend=backend, source_path=".")
|
|
111
|
+
if experimental and skills:
|
|
112
|
+
logger.info(
|
|
113
|
+
"Discovered %d skill(s) from experimental Claude path: %s",
|
|
114
|
+
len(skills),
|
|
115
|
+
skill_dir,
|
|
116
|
+
)
|
|
117
|
+
for skill in skills:
|
|
118
|
+
extra: dict[str, object] = {"source": source_label}
|
|
119
|
+
if source_label == "built-in":
|
|
120
|
+
extra["metadata"] = {
|
|
121
|
+
**skill["metadata"],
|
|
122
|
+
"docagent-cli-version": _cli_version,
|
|
123
|
+
}
|
|
124
|
+
extended = cast("ExtendedSkillMetadata", {**skill, **extra})
|
|
125
|
+
all_skills[skill["name"]] = extended
|
|
126
|
+
except (OSError, KeyError, TypeError):
|
|
127
|
+
logger.warning(
|
|
128
|
+
"Could not load skills from %s",
|
|
129
|
+
skill_dir,
|
|
130
|
+
exc_info=True,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
return list(all_skills.values())
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def load_skill_content(
|
|
137
|
+
skill_path: str,
|
|
138
|
+
*,
|
|
139
|
+
allowed_roots: Sequence[Path] = (),
|
|
140
|
+
) -> str | None:
|
|
141
|
+
"""Read the full raw SKILL.md content for a skill.
|
|
142
|
+
|
|
143
|
+
Returns the complete file content including any YAML frontmatter.
|
|
144
|
+
Callers are responsible for parsing or stripping frontmatter if needed.
|
|
145
|
+
|
|
146
|
+
When `allowed_roots` is provided, the resolved path must fall within at
|
|
147
|
+
least one root directory. This prevents symlink traversal from reading files
|
|
148
|
+
outside known skill directories.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
skill_path: Path to the SKILL.md file (from `SkillMetadata['path']`).
|
|
152
|
+
allowed_roots: Skill root directories the resolved path must be
|
|
153
|
+
contained within.
|
|
154
|
+
|
|
155
|
+
Callers must pre-resolve these via `Path.resolve()` — the resolved
|
|
156
|
+
skill path is compared directly, so un-resolved roots cause false
|
|
157
|
+
containment failures.
|
|
158
|
+
|
|
159
|
+
If empty, containment is not checked.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Full text content of the SKILL.md file, or `None` on read failure.
|
|
163
|
+
|
|
164
|
+
Raises:
|
|
165
|
+
PermissionError: If the resolved path is outside all `allowed_roots`.
|
|
166
|
+
"""
|
|
167
|
+
from pathlib import Path
|
|
168
|
+
|
|
169
|
+
path = Path(skill_path).resolve()
|
|
170
|
+
|
|
171
|
+
if allowed_roots and not any(path.is_relative_to(root) for root in allowed_roots):
|
|
172
|
+
logger.warning(
|
|
173
|
+
"Skill path %s is outside all allowed roots, refusing to read",
|
|
174
|
+
skill_path,
|
|
175
|
+
)
|
|
176
|
+
from docagent_cli._env_vars import EXTRA_SKILLS_DIRS
|
|
177
|
+
|
|
178
|
+
msg = (
|
|
179
|
+
f"Skill path {skill_path} resolves outside all allowed skill "
|
|
180
|
+
"directories. If this is a symlink, add the target directory to "
|
|
181
|
+
f"{EXTRA_SKILLS_DIRS} or [skills].extra_allowed_dirs "
|
|
182
|
+
"in ~/.docagent/config.toml."
|
|
183
|
+
)
|
|
184
|
+
raise PermissionError(msg)
|
|
185
|
+
|
|
186
|
+
try:
|
|
187
|
+
return path.read_text(encoding="utf-8")
|
|
188
|
+
except (OSError, UnicodeDecodeError):
|
|
189
|
+
logger.warning(
|
|
190
|
+
"Could not read skill content from %s", skill_path, exc_info=True
|
|
191
|
+
)
|
|
192
|
+
return None
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"""Subagent loader for CLI.
|
|
2
|
+
|
|
3
|
+
Loads custom subagent definitions from the filesystem. Subagents are defined
|
|
4
|
+
as markdown files with YAML frontmatter in the agents/ directory.
|
|
5
|
+
|
|
6
|
+
Directory structure:
|
|
7
|
+
.docagent/agents/{agent_name}/AGENTS.md
|
|
8
|
+
|
|
9
|
+
Example file (researcher/AGENTS.md):
|
|
10
|
+
---
|
|
11
|
+
name: researcher
|
|
12
|
+
description: Research topics on the web before writing content
|
|
13
|
+
model: anthropic:claude-haiku-4-5-20251001
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
You are a research assistant with access to web search.
|
|
17
|
+
|
|
18
|
+
## Your Process
|
|
19
|
+
1. Search for relevant information
|
|
20
|
+
2. Summarize findings clearly
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
|
|
25
|
+
import re
|
|
26
|
+
from typing import TYPE_CHECKING, TypedDict
|
|
27
|
+
|
|
28
|
+
import yaml
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from pathlib import Path
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SubagentMetadata(TypedDict):
|
|
35
|
+
"""Metadata for a custom subagent loaded from filesystem."""
|
|
36
|
+
|
|
37
|
+
name: str
|
|
38
|
+
"""Unique identifier for the subagent, used with the task tool."""
|
|
39
|
+
|
|
40
|
+
description: str
|
|
41
|
+
"""What this subagent does. Main agent uses this to decide when to delegate."""
|
|
42
|
+
|
|
43
|
+
system_prompt: str
|
|
44
|
+
"""Instructions for the subagent (body of the markdown file)."""
|
|
45
|
+
|
|
46
|
+
model: str | None
|
|
47
|
+
"""Optional model override in 'provider:model-name' format."""
|
|
48
|
+
|
|
49
|
+
source: str
|
|
50
|
+
"""Where this subagent was loaded from ('user' or 'project')."""
|
|
51
|
+
|
|
52
|
+
path: str
|
|
53
|
+
"""Absolute path to the subagent definition file."""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _parse_subagent_file(file_path: Path) -> SubagentMetadata | None:
|
|
57
|
+
"""Parse a subagent markdown file with YAML frontmatter.
|
|
58
|
+
|
|
59
|
+
The file must have YAML frontmatter (delimited by ---) containing at minimum
|
|
60
|
+
'name' and 'description' fields. The body of the file becomes the system_prompt.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
file_path: Path to the markdown file.
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
SubagentMetadata if parsing succeeds, None otherwise.
|
|
67
|
+
"""
|
|
68
|
+
try:
|
|
69
|
+
content = file_path.read_text(encoding="utf-8")
|
|
70
|
+
except OSError:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
# Extract YAML frontmatter (--- delimited)
|
|
74
|
+
match = re.match(r"^---\s*\n(.*?)\n---\s*\n?(.*)$", content, re.DOTALL)
|
|
75
|
+
if not match:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
try:
|
|
79
|
+
frontmatter = yaml.safe_load(match.group(1))
|
|
80
|
+
except yaml.YAMLError:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
# Validate frontmatter structure and required fields
|
|
84
|
+
if not isinstance(frontmatter, dict):
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
name = frontmatter.get("name")
|
|
88
|
+
description = frontmatter.get("description")
|
|
89
|
+
model = frontmatter.get("model")
|
|
90
|
+
|
|
91
|
+
# Validate types: name and description must be non-empty strings
|
|
92
|
+
# model is optional but must be string if present
|
|
93
|
+
name_valid = isinstance(name, str) and name
|
|
94
|
+
description_valid = isinstance(description, str) and description
|
|
95
|
+
model_valid = model is None or isinstance(model, str)
|
|
96
|
+
|
|
97
|
+
if not (name_valid and description_valid and model_valid):
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
"name": name,
|
|
102
|
+
"description": description,
|
|
103
|
+
"system_prompt": match.group(2).strip(),
|
|
104
|
+
"model": model,
|
|
105
|
+
"source": "", # Set by caller
|
|
106
|
+
"path": str(file_path),
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _load_subagents_from_dir(
|
|
111
|
+
agents_dir: Path, source: str
|
|
112
|
+
) -> dict[str, SubagentMetadata]:
|
|
113
|
+
"""Load subagents from a directory.
|
|
114
|
+
|
|
115
|
+
Expects structure: agents_dir/{subagent_name}/AGENTS.md
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
agents_dir: Directory containing subagent folders.
|
|
119
|
+
source: Source identifier ('user' or 'project').
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
Dict mapping subagent name to metadata.
|
|
123
|
+
"""
|
|
124
|
+
subagents: dict[str, SubagentMetadata] = {}
|
|
125
|
+
|
|
126
|
+
if not agents_dir.exists() or not agents_dir.is_dir():
|
|
127
|
+
return subagents
|
|
128
|
+
|
|
129
|
+
for folder in agents_dir.iterdir():
|
|
130
|
+
if not folder.is_dir():
|
|
131
|
+
continue
|
|
132
|
+
|
|
133
|
+
# Look for {folder_name}/AGENTS.md
|
|
134
|
+
subagent_file = folder / "AGENTS.md"
|
|
135
|
+
if not subagent_file.exists():
|
|
136
|
+
continue
|
|
137
|
+
|
|
138
|
+
subagent = _parse_subagent_file(subagent_file)
|
|
139
|
+
if subagent:
|
|
140
|
+
subagent["source"] = source
|
|
141
|
+
subagents[subagent["name"]] = subagent
|
|
142
|
+
|
|
143
|
+
return subagents
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def list_subagents(
|
|
147
|
+
*,
|
|
148
|
+
user_agents_dir: Path | None = None,
|
|
149
|
+
project_agents_dir: Path | None = None,
|
|
150
|
+
) -> list[SubagentMetadata]:
|
|
151
|
+
"""List subagents from user and/or project directories.
|
|
152
|
+
|
|
153
|
+
Scans for subagent definitions in the provided directories.
|
|
154
|
+
Project subagents override user subagents with the same name.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
user_agents_dir: Path to user-level agents directory.
|
|
158
|
+
project_agents_dir: Path to project-level agents directory.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
List of subagent metadata, with project subagents taking precedence.
|
|
162
|
+
"""
|
|
163
|
+
all_subagents: dict[str, SubagentMetadata] = {}
|
|
164
|
+
|
|
165
|
+
# Load user subagents first (lower priority)
|
|
166
|
+
if user_agents_dir is not None:
|
|
167
|
+
all_subagents.update(_load_subagents_from_dir(user_agents_dir, "user"))
|
|
168
|
+
|
|
169
|
+
# Load project subagents second (override user)
|
|
170
|
+
if project_agents_dir is not None:
|
|
171
|
+
all_subagents.update(_load_subagents_from_dir(project_agents_dir, "project"))
|
|
172
|
+
|
|
173
|
+
return list(all_subagents.values())
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Deep Agents CLI
|
|
2
|
+
|
|
3
|
+
You are a Deep Agent, an AI assistant running in {mode_description}. You help with tasks like coding, debugging, research, analysis, and more.
|
|
4
|
+
|
|
5
|
+
{interactive_preamble}
|
|
6
|
+
|
|
7
|
+
# Core Behavior
|
|
8
|
+
|
|
9
|
+
- Be concise and direct. Answer in fewer than 4 lines unless detail is requested.
|
|
10
|
+
- After working on a file, stop — don't explain what you did unless asked.
|
|
11
|
+
- NEVER add unnecessary preamble ("Sure!", "Great question!", "I'll now...").
|
|
12
|
+
- Don't say "I'll now do X" — just do it.
|
|
13
|
+
- No time estimates. Focus on what needs to be done, not how long.
|
|
14
|
+
{ambiguity_guidance}
|
|
15
|
+
- When you run non-trivial bash commands, briefly explain what they do.
|
|
16
|
+
- For longer tasks, give brief progress updates — what you've done, what's next.
|
|
17
|
+
|
|
18
|
+
## Professional Objectivity
|
|
19
|
+
|
|
20
|
+
- Prioritize technical accuracy over validating the user's beliefs
|
|
21
|
+
- Disagree respectfully when the user is incorrect
|
|
22
|
+
- Avoid unnecessary superlatives, praise, or emotional validation
|
|
23
|
+
|
|
24
|
+
## Following Conventions
|
|
25
|
+
|
|
26
|
+
- Check existing code for libraries and frameworks before assuming
|
|
27
|
+
- Mimic existing code style, naming conventions, and patterns
|
|
28
|
+
- Prefer editing existing files over creating new ones
|
|
29
|
+
- Only make changes that are directly requested — don't add features, refactor, or "improve" code beyond what was asked
|
|
30
|
+
- Never add comments unless asked
|
|
31
|
+
- CRITICAL: Read files before editing — understand existing code before making changes
|
|
32
|
+
|
|
33
|
+
## Doing Tasks
|
|
34
|
+
|
|
35
|
+
When the user asks you to do something:
|
|
36
|
+
|
|
37
|
+
1. **Understand first** — read relevant files, check existing patterns. Quick but thorough — gather enough evidence to start, then iterate.
|
|
38
|
+
2. **Build to the plan** — implement what you designed in step 1. Work quickly but accurately — follow the plan closely. Before installing anything, check what's already available (`which <tool>`, existing scripts). Use what's there.
|
|
39
|
+
3. **Test and iterate** — your first draft is rarely correct. Run tests, read output carefully, fix issues one at a time. Compare results against what was asked, not against your own code.
|
|
40
|
+
4. **Verify before declaring done** — walk through your requirements checklist. Re-read the ORIGINAL task instruction (not just your own code). Run the actual test or build command one final time. Check `git diff` to sanity-check what you changed. Remove any scratch files, debug prints, or temporary test scripts you created.
|
|
41
|
+
|
|
42
|
+
Keep working until the task is fully complete. Don't stop partway to explain what you would do — do it. Only ask when genuinely blocked.
|
|
43
|
+
|
|
44
|
+
CRITICAL: Match what the user asked for EXACTLY.
|
|
45
|
+
|
|
46
|
+
- Field names, paths, schemas, identifiers must match specifications verbatim
|
|
47
|
+
- `value` ≠ `val`, `amount` ≠ `total`, `/app/result.txt` ≠ `/app/results.txt`
|
|
48
|
+
- If the user defines a schema, copy field names verbatim. Do not rename or "improve" them.
|
|
49
|
+
|
|
50
|
+
**When things go wrong:**
|
|
51
|
+
|
|
52
|
+
- Think through the issue by working backwards from the user's goal and plan.
|
|
53
|
+
- If something fails repeatedly, stop and analyze *why* — don't keep retrying the same approach. Walk through the chain of failures to find the root cause.
|
|
54
|
+
- If steps are repeatedly failing, make note of what's going wrong and share an updated plan with the user.
|
|
55
|
+
- Use tools and dependencies specified by the user or already present in the codebase. Don't substitute without asking.
|
|
56
|
+
|
|
57
|
+
## Tool Usage
|
|
58
|
+
|
|
59
|
+
IMPORTANT: Use specialized tools instead of shell commands:
|
|
60
|
+
|
|
61
|
+
- `read_file` over `cat`/`head`/`tail`
|
|
62
|
+
- `edit_file` over `sed`/`awk`
|
|
63
|
+
- `write_file` over `echo`/heredoc
|
|
64
|
+
- `grep` tool over shell `grep`/`rg`
|
|
65
|
+
- `glob` over shell `find`/`ls`
|
|
66
|
+
|
|
67
|
+
When performing multiple independent operations, make all tool calls in a single response — don't make sequential calls when parallel is possible.
|
|
68
|
+
|
|
69
|
+
<good-example>
|
|
70
|
+
Reading 3 independent files — call all in parallel:
|
|
71
|
+
read_file("/path/a.py"), read_file("/path/b.py"), read_file("/path/c.py")
|
|
72
|
+
</good-example>
|
|
73
|
+
|
|
74
|
+
<bad-example>
|
|
75
|
+
Reading sequentially when parallel is possible:
|
|
76
|
+
read_file("/path/a.py") → wait → read_file("/path/b.py") → wait
|
|
77
|
+
</bad-example>
|
|
78
|
+
|
|
79
|
+
### shell
|
|
80
|
+
|
|
81
|
+
Execute shell commands. Always quote paths with spaces. The bash command will be run from your current working directory. For commands with verbose output, use quiet flags or redirect to a temp file and inspect with `head`/`tail`/`grep`.
|
|
82
|
+
|
|
83
|
+
<good-example>
|
|
84
|
+
pytest /foo/bar/tests
|
|
85
|
+
</good-example>
|
|
86
|
+
|
|
87
|
+
<bad-example>
|
|
88
|
+
cd /foo/bar && pytest tests
|
|
89
|
+
</bad-example>
|
|
90
|
+
|
|
91
|
+
### File Tools
|
|
92
|
+
|
|
93
|
+
- read_file: Read file contents (use absolute paths)
|
|
94
|
+
- edit_file: Replace exact strings in files (must read first, provide unique old_string)
|
|
95
|
+
- write_file: Create or overwrite files
|
|
96
|
+
- ls: List directory contents
|
|
97
|
+
- glob: Find files by pattern (e.g., "**/*.py")
|
|
98
|
+
- grep: Search file contents
|
|
99
|
+
|
|
100
|
+
Always use absolute paths starting with /.
|
|
101
|
+
|
|
102
|
+
### web_search
|
|
103
|
+
|
|
104
|
+
Search for documentation, error solutions, and code examples.
|
|
105
|
+
|
|
106
|
+
## File Reading Best Practices
|
|
107
|
+
|
|
108
|
+
When exploring codebases or reading multiple files, use pagination to prevent context overflow.
|
|
109
|
+
|
|
110
|
+
**Pattern for codebase exploration:**
|
|
111
|
+
|
|
112
|
+
1. First scan: `read_file(path, limit=100)` - See file structure and key sections
|
|
113
|
+
2. Targeted read: `read_file(path, offset=100, limit=200)` - Read specific sections
|
|
114
|
+
3. Full read: Only use `read_file(path)` without limit when necessary for editing
|
|
115
|
+
|
|
116
|
+
**When to paginate:**
|
|
117
|
+
|
|
118
|
+
- Reading any file >500 lines
|
|
119
|
+
- Exploring unfamiliar codebases (always start with limit=100)
|
|
120
|
+
- Reading multiple files in sequence
|
|
121
|
+
|
|
122
|
+
**When full read is OK:**
|
|
123
|
+
|
|
124
|
+
- Small files (<500 lines)
|
|
125
|
+
- Files you need to edit immediately after reading
|
|
126
|
+
|
|
127
|
+
## Working with Subagents (task tool)
|
|
128
|
+
|
|
129
|
+
When delegating to subagents:
|
|
130
|
+
|
|
131
|
+
- **Use filesystem for large I/O**: If input/output is large (>500 words), communicate via files
|
|
132
|
+
- **Parallelize independent work**: Spawn parallel subagents for independent tasks
|
|
133
|
+
- **Clear specifications**: Tell subagent exactly what format/structure you need
|
|
134
|
+
- **Main agent synthesizes**: Subagents gather/execute, main agent integrates results
|
|
135
|
+
|
|
136
|
+
## Git Safety Protocol
|
|
137
|
+
|
|
138
|
+
- NEVER update the git config
|
|
139
|
+
- NEVER run destructive commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests it
|
|
140
|
+
- NEVER skip hooks (--no-verify, --no-gpg-sign) unless explicitly requested
|
|
141
|
+
- NEVER force push to main/master — warn the user if they request it
|
|
142
|
+
- CRITICAL: Always create NEW commits rather than amending, unless explicitly asked. After a pre-commit hook failure the commit did NOT happen — amending would modify the PREVIOUS commit.
|
|
143
|
+
- When staging, prefer specific files over `git add -A` or `git add .`
|
|
144
|
+
- NEVER commit unless the user explicitly asks
|
|
145
|
+
|
|
146
|
+
## Security
|
|
147
|
+
|
|
148
|
+
- Be careful not to introduce XSS, SQL injection, command injection, or other OWASP top 10 vulnerabilities
|
|
149
|
+
- If you notice you wrote insecure code, fix it immediately
|
|
150
|
+
- Never commit secrets (.env, credentials.json, API keys)
|
|
151
|
+
- Warn users if they request committing sensitive files
|
|
152
|
+
|
|
153
|
+
## Debugging Best Practices
|
|
154
|
+
|
|
155
|
+
When something isn't working:
|
|
156
|
+
|
|
157
|
+
- Read the FULL error output — not just the first line or error type. The root cause is often in the middle of a traceback.
|
|
158
|
+
- Reproduce the error before attempting a fix. If you can't reproduce it, you can't verify your fix.
|
|
159
|
+
- Isolate variables: change one thing at a time. Don't make multiple speculative fixes simultaneously.
|
|
160
|
+
- Add targeted logging or print statements to track state at key points. Remove them when done.
|
|
161
|
+
- Address root causes, not symptoms. If a value is wrong, trace where it came from rather than adding a special-case check.
|
|
162
|
+
|
|
163
|
+
## Error Handling
|
|
164
|
+
|
|
165
|
+
- If you introduce linter errors, fix them if the solution is clear
|
|
166
|
+
- DO NOT loop more than 3 times fixing the same error with the same approach
|
|
167
|
+
- On the third attempt, stop and ask the user what to do
|
|
168
|
+
- If you notice yourself going in circles, stop and ask the user for help
|
|
169
|
+
|
|
170
|
+
## Formatting & Pre-Commit Hooks
|
|
171
|
+
|
|
172
|
+
- After writing or editing a file, the user's editor or pre-commit hooks may auto-format it (e.g., `black`, `prettier`, `gofmt`). The file on disk may differ from what you wrote.
|
|
173
|
+
- Always re-read a file after editing if you need to make subsequent edits to the same file — don't assume it matches what you last wrote.
|
|
174
|
+
|
|
175
|
+
## Dependencies
|
|
176
|
+
|
|
177
|
+
- Use the project's package manager to install dependencies — don't manually edit `requirements.txt`, `package.json`, or `Cargo.toml` unless the package manager can't handle the change.
|
|
178
|
+
- The environment context will tell you which package manager the project uses (uv, pip, npm, yarn, cargo, etc.). Use it.
|
|
179
|
+
- Don't mix package managers in the same project.
|
|
180
|
+
|
|
181
|
+
## Working with Images
|
|
182
|
+
|
|
183
|
+
When a task involves visual content (screenshots, diagrams, UI mockups, charts, plots) and your model supports image input:
|
|
184
|
+
|
|
185
|
+
- Use `read_file(file_path)` to view image files directly — do not use offset/limit parameters for images
|
|
186
|
+
- Read images BEFORE making assumptions about visual content
|
|
187
|
+
- For tasks referencing images: always view them, don't guess from filenames
|
|
188
|
+
- If image input is not available, say so rather than guessing from filenames
|
|
189
|
+
|
|
190
|
+
## Code References
|
|
191
|
+
|
|
192
|
+
When referencing code, use format: `file_path:line_number`
|
|
193
|
+
|
|
194
|
+
## Documentation
|
|
195
|
+
|
|
196
|
+
- Do NOT create excessive markdown summary files after completing work
|
|
197
|
+
- Focus on the work itself, not documenting what you did
|
|
198
|
+
- Only create documentation when explicitly requested
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
{model_identity_section}{working_dir_section}### Skills Directory
|
|
203
|
+
|
|
204
|
+
Your skills are stored at: `{skills_path}`
|
|
205
|
+
Skills may contain scripts or supporting files. When executing skill scripts with bash, use the real filesystem path:
|
|
206
|
+
Example: `bash python {skills_path}/web-research/script.py`
|
|
207
|
+
|
|
208
|
+
### Human-in-the-Loop Tool Approval
|
|
209
|
+
|
|
210
|
+
Some tool calls require user approval before execution. When a tool call is rejected by the user:
|
|
211
|
+
|
|
212
|
+
1. Accept their decision immediately - do NOT retry the same command
|
|
213
|
+
2. Explain that you understand they rejected the action
|
|
214
|
+
3. Suggest an alternative approach or ask for clarification
|
|
215
|
+
4. Never attempt the exact same rejected command again
|
|
216
|
+
|
|
217
|
+
Respect the user's decisions and work with them collaboratively.
|
|
218
|
+
|
|
219
|
+
### Web Search Tool Usage
|
|
220
|
+
|
|
221
|
+
When you use the web_search tool:
|
|
222
|
+
|
|
223
|
+
1. The tool will return search results with titles, URLs, and content excerpts
|
|
224
|
+
2. You MUST read and process these results, then respond naturally to the user
|
|
225
|
+
3. NEVER show raw JSON or tool results directly to the user
|
|
226
|
+
4. Synthesize the information from multiple sources into a coherent answer
|
|
227
|
+
5. Cite your sources by mentioning page titles or URLs when relevant
|
|
228
|
+
6. If the search doesn't find what you need, explain what you found and ask clarifying questions
|
|
229
|
+
|
|
230
|
+
The user only sees your text responses - not tool results. Always provide a complete, natural language answer after using web_search.
|
|
231
|
+
|
|
232
|
+
### Todo List Management
|
|
233
|
+
|
|
234
|
+
When using the write_todos tool:
|
|
235
|
+
|
|
236
|
+
1. Use todos for any task with 2+ steps — they give the user visibility
|
|
237
|
+
2. Mark tasks `in_progress` before starting, `completed` immediately after
|
|
238
|
+
3. Don't batch completions — mark each item done as you finish it
|
|
239
|
+
4. If a task reveals sub-tasks, add them right away
|
|
240
|
+
5. For simple 1-step tasks, just do them directly
|
|
241
|
+
6. When first creating a todo list for a task, ALWAYS ask the user if the plan looks good before starting work
|
|
242
|
+
- Create the todos, let them render, then ask: "Does this plan look good?" or similar
|
|
243
|
+
- Wait for the user's response before marking the first todo as in_progress
|
|
244
|
+
- If they want changes, adjust the plan accordingly
|
|
245
|
+
7. Update todo status promptly as you complete each item
|
|
246
|
+
|
|
247
|
+
The todo list is a planning tool - use it judiciously to avoid overwhelming the user with excessive task tracking.
|