anymous 1.2.7 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/anymous.cjs +1 -1
- package/package.json +1 -1
- package/script/postinstall.mjs +214 -0
- package/skills/algorithmic-art/LICENSE.txt +202 -0
- package/skills/algorithmic-art/SKILL.md +405 -0
- package/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/skills/algorithmic-art/templates/viewer.html +599 -0
- package/skills/artifacts-builder/LICENSE.txt +202 -0
- package/skills/artifacts-builder/SKILL.md +74 -0
- package/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/brainstorming/SKILL.md +151 -0
- package/skills/brainstorming/scripts/frame-template.html +213 -0
- package/skills/brainstorming/scripts/helper.js +167 -0
- package/skills/brainstorming/scripts/server.cjs +723 -0
- package/skills/brainstorming/scripts/start-server.sh +209 -0
- package/skills/brainstorming/scripts/stop-server.sh +120 -0
- package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/skills/brainstorming/visual-companion.md +298 -0
- package/skills/brand-guidelines/LICENSE.txt +202 -0
- package/skills/brand-guidelines/SKILL.md +73 -0
- package/skills/canvas-design/LICENSE.txt +202 -0
- package/skills/canvas-design/SKILL.md +130 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/skills/changelog-generator/SKILL.md +110 -0
- package/skills/claude-api/LICENSE.txt +202 -0
- package/skills/claude-api/SKILL.md +546 -0
- package/skills/claude-api/csharp/claude-api/README.md +362 -0
- package/skills/claude-api/csharp/claude-api/batches.md +14 -0
- package/skills/claude-api/csharp/claude-api/files-api.md +23 -0
- package/skills/claude-api/csharp/claude-api/streaming.md +28 -0
- package/skills/claude-api/csharp/claude-api/tool-use.md +164 -0
- package/skills/claude-api/curl/examples.md +256 -0
- package/skills/claude-api/curl/managed-agents.md +340 -0
- package/skills/claude-api/go/claude-api/README.md +188 -0
- package/skills/claude-api/go/claude-api/files-api.md +21 -0
- package/skills/claude-api/go/claude-api/streaming.md +43 -0
- package/skills/claude-api/go/claude-api/tool-use.md +220 -0
- package/skills/claude-api/go/managed-agents/README.md +564 -0
- package/skills/claude-api/java/claude-api/README.md +238 -0
- package/skills/claude-api/java/claude-api/files-api.md +25 -0
- package/skills/claude-api/java/claude-api/streaming.md +24 -0
- package/skills/claude-api/java/claude-api/tool-use.md +228 -0
- package/skills/claude-api/java/managed-agents/README.md +443 -0
- package/skills/claude-api/php/claude-api/README.md +174 -0
- package/skills/claude-api/php/claude-api/batches.md +15 -0
- package/skills/claude-api/php/claude-api/files-api.md +11 -0
- package/skills/claude-api/php/claude-api/streaming.md +27 -0
- package/skills/claude-api/php/claude-api/tool-use.md +253 -0
- package/skills/claude-api/php/managed-agents/README.md +443 -0
- package/skills/claude-api/python/claude-api/README.md +565 -0
- package/skills/claude-api/python/claude-api/batches.md +198 -0
- package/skills/claude-api/python/claude-api/files-api.md +170 -0
- package/skills/claude-api/python/claude-api/streaming.md +179 -0
- package/skills/claude-api/python/claude-api/tool-use.md +629 -0
- package/skills/claude-api/python/managed-agents/README.md +335 -0
- package/skills/claude-api/ruby/claude-api/README.md +134 -0
- package/skills/claude-api/ruby/claude-api/streaming.md +16 -0
- package/skills/claude-api/ruby/claude-api/tool-use.md +41 -0
- package/skills/claude-api/ruby/managed-agents/README.md +394 -0
- package/skills/claude-api/shared/agent-design.md +101 -0
- package/skills/claude-api/shared/anthropic-cli.md +246 -0
- package/skills/claude-api/shared/claude-platform-on-aws.md +59 -0
- package/skills/claude-api/shared/error-codes.md +257 -0
- package/skills/claude-api/shared/live-sources.md +143 -0
- package/skills/claude-api/shared/managed-agents-api-reference.md +448 -0
- package/skills/claude-api/shared/managed-agents-client-patterns.md +217 -0
- package/skills/claude-api/shared/managed-agents-core.md +319 -0
- package/skills/claude-api/shared/managed-agents-environments.md +219 -0
- package/skills/claude-api/shared/managed-agents-events.md +270 -0
- package/skills/claude-api/shared/managed-agents-memory.md +199 -0
- package/skills/claude-api/shared/managed-agents-multiagent.md +125 -0
- package/skills/claude-api/shared/managed-agents-onboarding.md +82 -0
- package/skills/claude-api/shared/managed-agents-outcomes.md +108 -0
- package/skills/claude-api/shared/managed-agents-overview.md +71 -0
- package/skills/claude-api/shared/managed-agents-scheduled-deployments.md +146 -0
- package/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +174 -0
- package/skills/claude-api/shared/managed-agents-tools.md +371 -0
- package/skills/claude-api/shared/managed-agents-webhooks.md +143 -0
- package/skills/claude-api/shared/model-migration.md +1548 -0
- package/skills/claude-api/shared/models.md +138 -0
- package/skills/claude-api/shared/platform-availability.md +97 -0
- package/skills/claude-api/shared/prompt-caching.md +235 -0
- package/skills/claude-api/shared/token-counting.md +56 -0
- package/skills/claude-api/shared/tool-use-concepts.md +514 -0
- package/skills/claude-api/typescript/claude-api/README.md +405 -0
- package/skills/claude-api/typescript/claude-api/batches.md +106 -0
- package/skills/claude-api/typescript/claude-api/files-api.md +98 -0
- package/skills/claude-api/typescript/claude-api/streaming.md +178 -0
- package/skills/claude-api/typescript/claude-api/tool-use.md +589 -0
- package/skills/claude-api/typescript/managed-agents/README.md +358 -0
- package/skills/code-security-auditor/SKILL.md +164 -0
- package/skills/code-security-auditor/references/package_checks.md +59 -0
- package/skills/competitive-ads-extractor/SKILL.md +298 -0
- package/skills/content-research-writer/SKILL.md +538 -0
- package/skills/developer-growth-analysis/SKILL.md +322 -0
- package/skills/dispatching-parallel-agents/SKILL.md +167 -0
- package/skills/doc-coauthoring/SKILL.md +375 -0
- package/skills/docx/LICENSE.txt +30 -0
- package/skills/docx/SKILL.md +91 -0
- package/skills/docx/scripts/__init__.py +1 -0
- package/skills/docx/scripts/accept_changes.py +135 -0
- package/skills/docx/scripts/comment.py +368 -0
- package/skills/docx/scripts/merge_runs.py +310 -0
- package/skills/docx/scripts/office/helpers/__init__.py +111 -0
- package/skills/docx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/docx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/docx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/docx/scripts/office/soffice.py +192 -0
- package/skills/docx/scripts/office/validate.py +173 -0
- package/skills/docx/scripts/office/validators/__init__.py +15 -0
- package/skills/docx/scripts/office/validators/base.py +875 -0
- package/skills/docx/scripts/office/validators/docx.py +466 -0
- package/skills/docx/scripts/office/validators/pptx.py +441 -0
- package/skills/docx/scripts/office/validators/redlining.py +299 -0
- package/skills/docx/scripts/templates/comments.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/skills/docx/scripts/templates/people.xml +3 -0
- package/skills/domain-name-brainstormer/SKILL.md +217 -0
- package/skills/executing-plans/SKILL.md +64 -0
- package/skills/file-organizer/SKILL.md +433 -0
- package/skills/finishing-a-development-branch/SKILL.md +201 -0
- package/skills/frontend-design/LICENSE.txt +177 -0
- package/skills/frontend-design/SKILL.md +55 -0
- package/skills/image-enhancer/SKILL.md +106 -0
- package/skills/internal-comms/LICENSE.txt +202 -0
- package/skills/internal-comms/SKILL.md +32 -0
- package/skills/internal-comms/examples/3p-updates.md +47 -0
- package/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/skills/internal-comms/examples/faq-answers.md +30 -0
- package/skills/internal-comms/examples/general-comms.md +16 -0
- package/skills/invoice-organizer/SKILL.md +452 -0
- package/skills/lead-research-assistant/SKILL.md +205 -0
- package/skills/mcp-builder/LICENSE.txt +202 -0
- package/skills/mcp-builder/SKILL.md +236 -0
- package/skills/mcp-builder/reference/evaluation.md +602 -0
- package/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/skills/mcp-builder/reference/node_mcp_server.md +970 -0
- package/skills/mcp-builder/reference/python_mcp_server.md +719 -0
- package/skills/mcp-builder/scripts/connections.py +151 -0
- package/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/skills/meeting-insights-analyzer/SKILL.md +327 -0
- package/skills/pdf/LICENSE.txt +30 -0
- package/skills/pdf/SKILL.md +314 -0
- package/skills/pdf/forms.md +294 -0
- package/skills/pdf/reference.md +612 -0
- package/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/skills/pdf/scripts/create_validation_image.py +37 -0
- package/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/skills/pptx/LICENSE.txt +30 -0
- package/skills/pptx/SKILL.md +238 -0
- package/skills/pptx/scripts/__init__.py +0 -0
- package/skills/pptx/scripts/add_slide.py +367 -0
- package/skills/pptx/scripts/clean.py +309 -0
- package/skills/pptx/scripts/office/helpers/__init__.py +111 -0
- package/skills/pptx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/pptx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/pptx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/pptx/scripts/office/soffice.py +192 -0
- package/skills/pptx/scripts/office/validate.py +173 -0
- package/skills/pptx/scripts/office/validators/__init__.py +15 -0
- package/skills/pptx/scripts/office/validators/base.py +875 -0
- package/skills/pptx/scripts/office/validators/docx.py +466 -0
- package/skills/pptx/scripts/office/validators/pptx.py +441 -0
- package/skills/pptx/scripts/office/validators/redlining.py +299 -0
- package/skills/pptx/scripts/thumbnail.py +311 -0
- package/skills/raffle-winner-picker/SKILL.md +165 -0
- package/skills/receiving-code-review/SKILL.md +205 -0
- package/skills/requesting-code-review/SKILL.md +95 -0
- package/skills/requesting-code-review/code-reviewer.md +172 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +485 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +328 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/skills/skill-share/SKILL.md +80 -0
- package/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/skills/slack-gif-creator/SKILL.md +254 -0
- package/skills/slack-gif-creator/core/easing.py +234 -0
- package/skills/slack-gif-creator/core/frame_composer.py +176 -0
- package/skills/slack-gif-creator/core/gif_builder.py +269 -0
- package/skills/slack-gif-creator/core/validators.py +136 -0
- package/skills/slack-gif-creator/requirements.txt +4 -0
- package/skills/staff-engineer-review/SKILL.md +172 -0
- package/skills/subagent-driven-development/SKILL.md +503 -0
- package/skills/subagent-driven-development/implementer-prompt.md +142 -0
- package/skills/subagent-driven-development/re-review-prompt.md +106 -0
- package/skills/subagent-driven-development/scripts/review-package +46 -0
- package/skills/subagent-driven-development/scripts/sdd-workspace +40 -0
- package/skills/subagent-driven-development/scripts/task-brief +41 -0
- package/skills/subagent-driven-development/task-reviewer-prompt.md +185 -0
- package/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/systematic-debugging/SKILL.md +283 -0
- package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/systematic-debugging/find-polluter.sh +72 -0
- package/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/systematic-debugging/test-academic.md +14 -0
- package/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/test-driven-development/SKILL.md +320 -0
- package/skills/test-driven-development/writing-good-tests.md +198 -0
- package/skills/theme-factory/LICENSE.txt +202 -0
- package/skills/theme-factory/SKILL.md +59 -0
- package/skills/theme-factory/theme-showcase.pdf +0 -0
- package/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/skills/theme-factory/themes/desert-rose.md +19 -0
- package/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/skills/theme-factory/themes/golden-hour.md +19 -0
- package/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/skills/using-git-worktrees/SKILL.md +167 -0
- package/skills/using-superpowers/SKILL.md +62 -0
- package/skills/using-superpowers/references/antigravity-tools.md +23 -0
- package/skills/using-superpowers/references/codex-tools.md +39 -0
- package/skills/using-superpowers/references/gemini-tools.md +63 -0
- package/skills/using-superpowers/references/pi-tools.md +16 -0
- package/skills/verification-before-completion/SKILL.md +120 -0
- package/skills/video-downloader/SKILL.md +112 -0
- package/skills/web-artifacts-builder/LICENSE.txt +202 -0
- package/skills/web-artifacts-builder/SKILL.md +74 -0
- package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/skills/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/webapp-testing/LICENSE.txt +202 -0
- package/skills/webapp-testing/SKILL.md +96 -0
- package/skills/webapp-testing/examples/console_logging.py +35 -0
- package/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/skills/webapp-testing/scripts/with_server.py +106 -0
- package/skills/writing-plans/SKILL.md +168 -0
- package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/skills/writing-skills/SKILL.md +679 -0
- package/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/writing-skills/persuasion-principles.md +187 -0
- package/skills/writing-skills/render-graphs.js +168 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/skills/xlsx/LICENSE.txt +30 -0
- package/skills/xlsx/SKILL.md +99 -0
- package/skills/xlsx/scripts/office/helpers/__init__.py +111 -0
- package/skills/xlsx/scripts/office/helpers/pptx_chart.py +170 -0
- package/skills/xlsx/scripts/office/helpers/pptx_slide.py +60 -0
- package/skills/xlsx/scripts/office/helpers/pptx_theme.py +114 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/skills/xlsx/scripts/office/soffice.py +192 -0
- package/skills/xlsx/scripts/office/validate.py +173 -0
- package/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/skills/xlsx/scripts/office/validators/base.py +875 -0
- package/skills/xlsx/scripts/office/validators/docx.py +466 -0
- package/skills/xlsx/scripts/office/validators/pptx.py +441 -0
- package/skills/xlsx/scripts/office/validators/redlining.py +299 -0
- package/skills/xlsx/scripts/recalc.py +308 -0
- package/src/account/account.ts +1 -2
- package/src/account/repo.ts +2 -1
- package/src/acp/content.ts +1 -1
- package/src/acp/directory.ts +2 -2
- package/src/acp/event.ts +1 -1
- package/src/acp/session.ts +2 -2
- package/src/agent/agent.ts +62 -31
- package/src/agent/subagent-permissions.ts +1 -1
- package/src/cli/cmd/account.ts +2 -1
- package/src/cli/cmd/debug/agent.handler.ts +1 -1
- package/src/cli/cmd/export.ts +1 -1
- package/src/cli/cmd/github.handler.ts +4 -2
- package/src/cli/cmd/mcp.ts +2 -2
- package/src/cli/cmd/run/footer.prompt.tsx +7 -2
- package/src/cli/cmd/stats.ts +1 -1
- package/src/cli/network.ts +1 -1
- package/src/config/config.ts +3 -5
- package/src/config/plugin.ts +1 -1
- package/src/control-plane/workspace.ts +3 -2
- package/src/effect/app-node-builder-v1.ts +1 -1
- package/src/effect/instance-state.ts +2 -1
- package/src/effect/runner.ts +2 -1
- package/src/effect/runtime-flags.ts +2 -1
- package/src/image/image.ts +1 -1
- package/src/installation/index.ts +4 -8
- package/src/lsp/diagnostic.ts +1 -1
- package/src/mcp/catalog.ts +1 -1
- package/src/mcp/index.ts +2 -2
- package/src/mcp/oauth-provider.ts +1 -1
- package/src/permission/index.ts +7 -3
- package/src/plugin/index.ts +7 -3
- package/src/plugin/loader.ts +1 -1
- package/src/plugin/tui/runtime.ts +1 -1
- package/src/project/bootstrap-service.ts +2 -1
- package/src/project/project.ts +3 -2
- package/src/project/vcs.ts +1 -1
- package/src/provider/error.ts +1 -1
- package/src/provider/provider.ts +3 -2
- package/src/question/index.ts +1 -1
- package/src/server/auth.ts +2 -1
- package/src/server/routes/instance/httpapi/groups/metadata.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/control-plane.ts +2 -1
- package/src/server/routes/instance/httpapi/handlers/control.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/experimental.ts +2 -1
- package/src/server/routes/instance/httpapi/handlers/global.ts +2 -1
- package/src/server/routes/instance/httpapi/handlers/mcp.ts +2 -1
- package/src/server/routes/instance/httpapi/handlers/permission.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/project-copy.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/provider.ts +3 -2
- package/src/server/routes/instance/httpapi/handlers/pty.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/question.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/session.ts +5 -5
- package/src/server/routes/instance/httpapi/handlers/sync.ts +2 -2
- package/src/server/routes/instance/httpapi/handlers/tui.ts +1 -1
- package/src/server/routes/instance/httpapi/handlers/workspace.ts +2 -1
- package/src/server/routes/instance/httpapi/lifecycle.ts +2 -1
- package/src/server/routes/instance/httpapi/middleware/instance-context.ts +1 -1
- package/src/server/routes/instance/httpapi/middleware/proxy.ts +2 -1
- package/src/server/routes/instance/httpapi/server.ts +2 -1
- package/src/server/shared/fence.ts +1 -1
- package/src/server/shared/ui.ts +2 -1
- package/src/session/compaction.ts +5 -4
- package/src/session/instruction.ts +1 -1
- package/src/session/llm/native-runtime.ts +2 -1
- package/src/session/llm/request.ts +2 -2
- package/src/session/llm.ts +2 -2
- package/src/session/message-v2.ts +5 -16
- package/src/session/overflow.ts +2 -2
- package/src/session/prompt.ts +4 -3
- package/src/session/reminders.ts +2 -2
- package/src/session/revert.ts +1 -1
- package/src/session/run-state.ts +4 -3
- package/src/session/session.ts +2 -1
- package/src/session/status.ts +1 -1
- package/src/session/summary.ts +1 -1
- package/src/session/system.ts +1 -1
- package/src/session/todo.ts +1 -1
- package/src/session/tools.ts +6 -6
- package/src/share/session.ts +1 -1
- package/src/share/share-next.ts +1 -1
- package/src/tool/computer.ts +195 -136
- package/src/tool/edit.ts +1 -1
- package/src/tool/mcp-websearch.ts +2 -1
- package/src/tool/plan.ts +1 -1
- package/src/tool/registry.ts +2 -2
- package/src/tool/task.ts +1 -1
- package/src/tool/tool.ts +2 -2
- package/src/util/bom.ts +1 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Validator for tracked changes in Word documents.
|
|
3
|
+
|
|
4
|
+
Detects untracked edits in word/document.xml: text that differs from the
|
|
5
|
+
original without a <w:ins>/<w:del> wrapper recording it. The tracked changes
|
|
6
|
+
that are new relative to the original are undone, and the result is compared
|
|
7
|
+
against the original; whatever text still differs was edited without being
|
|
8
|
+
tracked.
|
|
9
|
+
|
|
10
|
+
Only the document body is compared. Headers, footers, footnotes and endnotes
|
|
11
|
+
are separate parts and are not checked.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import subprocess
|
|
15
|
+
import tempfile
|
|
16
|
+
import zipfile
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
import defusedxml.ElementTree as ET
|
|
20
|
+
from defusedxml.common import DefusedXmlException
|
|
21
|
+
|
|
22
|
+
from helpers import rendered_text, safe_extract
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RedliningValidator:
|
|
26
|
+
|
|
27
|
+
def __init__(self, unpacked_dir, original_docx, verbose=False):
|
|
28
|
+
self.unpacked_dir = Path(unpacked_dir)
|
|
29
|
+
self.original_docx = Path(original_docx)
|
|
30
|
+
self.verbose = verbose
|
|
31
|
+
self.namespaces = {
|
|
32
|
+
"w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
def repair(self) -> int:
|
|
36
|
+
return 0
|
|
37
|
+
|
|
38
|
+
def validate(self):
|
|
39
|
+
modified_file = self.unpacked_dir / "word" / "document.xml"
|
|
40
|
+
if not modified_file.exists():
|
|
41
|
+
print(f"FAILED - Modified document.xml not found at {modified_file}")
|
|
42
|
+
return False
|
|
43
|
+
|
|
44
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
45
|
+
temp_path = Path(temp_dir)
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
with zipfile.ZipFile(self.original_docx, "r") as zip_ref:
|
|
49
|
+
safe_extract(zip_ref, temp_path)
|
|
50
|
+
except Exception as e:
|
|
51
|
+
print(f"FAILED - Error unpacking original docx: {e}")
|
|
52
|
+
return False
|
|
53
|
+
|
|
54
|
+
original_file = temp_path / "word" / "document.xml"
|
|
55
|
+
if not original_file.exists():
|
|
56
|
+
print(
|
|
57
|
+
f"FAILED - Original document.xml not found in {self.original_docx}"
|
|
58
|
+
)
|
|
59
|
+
return False
|
|
60
|
+
|
|
61
|
+
try:
|
|
62
|
+
modified_tree = ET.parse(modified_file)
|
|
63
|
+
modified_root = modified_tree.getroot()
|
|
64
|
+
original_tree = ET.parse(original_file)
|
|
65
|
+
original_root = original_tree.getroot()
|
|
66
|
+
except (ET.ParseError, DefusedXmlException) as e:
|
|
67
|
+
print(f"FAILED - Error parsing XML files: {e}")
|
|
68
|
+
return False
|
|
69
|
+
|
|
70
|
+
new_changes = self._new_tracked_changes(original_root, modified_root)
|
|
71
|
+
self._remove_tracked_changes(modified_root, new_changes)
|
|
72
|
+
|
|
73
|
+
modified_text = self._extract_text_content(modified_root)
|
|
74
|
+
original_text = self._extract_text_content(original_root)
|
|
75
|
+
|
|
76
|
+
if modified_text != original_text:
|
|
77
|
+
error_message = self._generate_detailed_diff(
|
|
78
|
+
original_text, modified_text
|
|
79
|
+
)
|
|
80
|
+
print(error_message)
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
if self.verbose:
|
|
84
|
+
print(
|
|
85
|
+
f"PASSED - All {len(new_changes)} change(s) against the original "
|
|
86
|
+
"are properly tracked"
|
|
87
|
+
)
|
|
88
|
+
return True
|
|
89
|
+
|
|
90
|
+
def _tracked_change_elements(self, root):
|
|
91
|
+
ins_tag = f"{{{self.namespaces['w']}}}ins"
|
|
92
|
+
del_tag = f"{{{self.namespaces['w']}}}del"
|
|
93
|
+
return [elem for elem in root.iter() if elem.tag in (ins_tag, del_tag)]
|
|
94
|
+
|
|
95
|
+
def _rendered_text(self, elem):
|
|
96
|
+
preserve = elem.get("{http://www.w3.org/XML/1998/namespace}space") == "preserve"
|
|
97
|
+
return rendered_text(elem.text or "", preserve)
|
|
98
|
+
|
|
99
|
+
def _text_elements(self, elem):
|
|
100
|
+
w = self.namespaces["w"]
|
|
101
|
+
return [
|
|
102
|
+
node
|
|
103
|
+
for node in elem.iter()
|
|
104
|
+
if node.tag in (f"{{{w}}}t", f"{{{w}}}delText")
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
def _tracked_change_key(self, elem):
|
|
108
|
+
w = self.namespaces["w"]
|
|
109
|
+
text = "".join(self._rendered_text(node) for node in self._text_elements(elem))
|
|
110
|
+
return (elem.tag, elem.get(f"{{{w}}}author"), elem.get(f"{{{w}}}date"), text)
|
|
111
|
+
|
|
112
|
+
def _new_tracked_changes(self, original_root, modified_root):
|
|
113
|
+
original = self._tracked_change_elements(original_root)
|
|
114
|
+
modified = self._tracked_change_elements(modified_root)
|
|
115
|
+
|
|
116
|
+
pool = {}
|
|
117
|
+
for elem in original:
|
|
118
|
+
pool.setdefault(self._tracked_change_key(elem), []).append(elem)
|
|
119
|
+
|
|
120
|
+
matched, leftover = set(), []
|
|
121
|
+
for elem in modified:
|
|
122
|
+
bucket = pool.get(self._tracked_change_key(elem))
|
|
123
|
+
if bucket:
|
|
124
|
+
matched.add(bucket.pop())
|
|
125
|
+
else:
|
|
126
|
+
leftover.append(elem)
|
|
127
|
+
|
|
128
|
+
def group(elem):
|
|
129
|
+
return self._tracked_change_key(elem)[:3]
|
|
130
|
+
|
|
131
|
+
def text_of(elems):
|
|
132
|
+
return "".join(self._tracked_change_key(e)[3] for e in elems)
|
|
133
|
+
|
|
134
|
+
unmatched_original = {}
|
|
135
|
+
for elem in original:
|
|
136
|
+
if elem not in matched:
|
|
137
|
+
unmatched_original.setdefault(group(elem), []).append(elem)
|
|
138
|
+
|
|
139
|
+
by_group = {}
|
|
140
|
+
for elem in leftover:
|
|
141
|
+
by_group.setdefault(group(elem), []).append(elem)
|
|
142
|
+
|
|
143
|
+
new = set()
|
|
144
|
+
for key, elems in by_group.items():
|
|
145
|
+
rebuilt = text_of(elems)
|
|
146
|
+
if rebuilt and rebuilt == text_of(unmatched_original.get(key, [])):
|
|
147
|
+
continue
|
|
148
|
+
new.update(elems)
|
|
149
|
+
return new
|
|
150
|
+
|
|
151
|
+
def _generate_detailed_diff(self, original_text, modified_text):
|
|
152
|
+
error_parts = [
|
|
153
|
+
"FAILED - Document text doesn't match after removing the tracked changes",
|
|
154
|
+
"",
|
|
155
|
+
"Likely causes:",
|
|
156
|
+
" 1. Modified text inside another author's <w:ins> or <w:del> tags",
|
|
157
|
+
" 2. Made edits without proper tracked changes",
|
|
158
|
+
" 3. Didn't nest <w:del> inside <w:ins> when deleting another's insertion",
|
|
159
|
+
" 4. Rewrote another author's <w:ins>/<w:del> and changed its text on",
|
|
160
|
+
" the way. A tracked change from the original is recognised by its",
|
|
161
|
+
" author, date and text; anything that doesn't reproduce one exactly",
|
|
162
|
+
" reads as new, and the text it carried is reported missing.",
|
|
163
|
+
"",
|
|
164
|
+
"For pre-redlined documents, use correct patterns:",
|
|
165
|
+
" - To reject another's INSERTION: Nest <w:del> inside their <w:ins>",
|
|
166
|
+
" - To reject PART of one: nest <w:del> around only the runs you reject.",
|
|
167
|
+
" Their <w:ins> may be split around it, so long as the pieces keep",
|
|
168
|
+
" their author and date and still spell out the same text.",
|
|
169
|
+
" - To restore another's DELETION: Add new <w:ins> AFTER their <w:del>",
|
|
170
|
+
"",
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
git_diff = self._get_git_word_diff(original_text, modified_text)
|
|
174
|
+
if git_diff:
|
|
175
|
+
error_parts.extend(["Differences:", "============", git_diff])
|
|
176
|
+
else:
|
|
177
|
+
error_parts.append("Unable to generate word diff (git not available)")
|
|
178
|
+
|
|
179
|
+
return "\n".join(error_parts)
|
|
180
|
+
|
|
181
|
+
def _get_git_word_diff(self, original_text, modified_text):
|
|
182
|
+
try:
|
|
183
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
184
|
+
temp_path = Path(temp_dir)
|
|
185
|
+
|
|
186
|
+
original_file = temp_path / "original.txt"
|
|
187
|
+
modified_file = temp_path / "modified.txt"
|
|
188
|
+
|
|
189
|
+
original_file.write_text(original_text, encoding="utf-8")
|
|
190
|
+
modified_file.write_text(modified_text, encoding="utf-8")
|
|
191
|
+
|
|
192
|
+
result = subprocess.run(
|
|
193
|
+
[
|
|
194
|
+
"git",
|
|
195
|
+
"diff",
|
|
196
|
+
"--word-diff=plain",
|
|
197
|
+
"--word-diff-regex=.",
|
|
198
|
+
"-U0",
|
|
199
|
+
"--no-index",
|
|
200
|
+
str(original_file),
|
|
201
|
+
str(modified_file),
|
|
202
|
+
],
|
|
203
|
+
capture_output=True,
|
|
204
|
+
text=True,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
if result.stdout.strip():
|
|
208
|
+
lines = result.stdout.split("\n")
|
|
209
|
+
content_lines = []
|
|
210
|
+
in_content = False
|
|
211
|
+
for line in lines:
|
|
212
|
+
if line.startswith("@@"):
|
|
213
|
+
in_content = True
|
|
214
|
+
continue
|
|
215
|
+
if in_content and line.strip():
|
|
216
|
+
content_lines.append(line)
|
|
217
|
+
|
|
218
|
+
if content_lines:
|
|
219
|
+
return "\n".join(content_lines)
|
|
220
|
+
|
|
221
|
+
result = subprocess.run(
|
|
222
|
+
[
|
|
223
|
+
"git",
|
|
224
|
+
"diff",
|
|
225
|
+
"--word-diff=plain",
|
|
226
|
+
"-U0",
|
|
227
|
+
"--no-index",
|
|
228
|
+
str(original_file),
|
|
229
|
+
str(modified_file),
|
|
230
|
+
],
|
|
231
|
+
capture_output=True,
|
|
232
|
+
text=True,
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
if result.stdout.strip():
|
|
236
|
+
lines = result.stdout.split("\n")
|
|
237
|
+
content_lines = []
|
|
238
|
+
in_content = False
|
|
239
|
+
for line in lines:
|
|
240
|
+
if line.startswith("@@"):
|
|
241
|
+
in_content = True
|
|
242
|
+
continue
|
|
243
|
+
if in_content and line.strip():
|
|
244
|
+
content_lines.append(line)
|
|
245
|
+
return "\n".join(content_lines)
|
|
246
|
+
|
|
247
|
+
except (subprocess.CalledProcessError, FileNotFoundError, Exception):
|
|
248
|
+
pass
|
|
249
|
+
|
|
250
|
+
return None
|
|
251
|
+
|
|
252
|
+
def _remove_tracked_changes(self, root, targets):
|
|
253
|
+
ins_tag = f"{{{self.namespaces['w']}}}ins"
|
|
254
|
+
del_tag = f"{{{self.namespaces['w']}}}del"
|
|
255
|
+
|
|
256
|
+
for parent in root.iter():
|
|
257
|
+
to_remove = []
|
|
258
|
+
for child in parent:
|
|
259
|
+
if child.tag == ins_tag and child in targets:
|
|
260
|
+
to_remove.append(child)
|
|
261
|
+
for elem in to_remove:
|
|
262
|
+
parent.remove(elem)
|
|
263
|
+
|
|
264
|
+
deltext_tag = f"{{{self.namespaces['w']}}}delText"
|
|
265
|
+
t_tag = f"{{{self.namespaces['w']}}}t"
|
|
266
|
+
|
|
267
|
+
for parent in root.iter():
|
|
268
|
+
to_process = []
|
|
269
|
+
for child in parent:
|
|
270
|
+
if child.tag == del_tag and child in targets:
|
|
271
|
+
to_process.append((child, list(parent).index(child)))
|
|
272
|
+
|
|
273
|
+
for del_elem, del_index in reversed(to_process):
|
|
274
|
+
for elem in del_elem.iter():
|
|
275
|
+
if elem.tag == deltext_tag:
|
|
276
|
+
elem.tag = t_tag
|
|
277
|
+
|
|
278
|
+
for child in reversed(list(del_elem)):
|
|
279
|
+
parent.insert(del_index, child)
|
|
280
|
+
parent.remove(del_elem)
|
|
281
|
+
|
|
282
|
+
def _extract_text_content(self, root):
|
|
283
|
+
p_tag = f"{{{self.namespaces['w']}}}p"
|
|
284
|
+
t_tag = f"{{{self.namespaces['w']}}}t"
|
|
285
|
+
|
|
286
|
+
paragraphs = []
|
|
287
|
+
for p_elem in root.findall(f".//{p_tag}"):
|
|
288
|
+
text_parts = []
|
|
289
|
+
for t_elem in p_elem.findall(f".//{t_tag}"):
|
|
290
|
+
text_parts.append(self._rendered_text(t_elem))
|
|
291
|
+
paragraph_text = "".join(text_parts)
|
|
292
|
+
if paragraph_text:
|
|
293
|
+
paragraphs.append(paragraph_text)
|
|
294
|
+
|
|
295
|
+
return "\n".join(paragraphs)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
if __name__ == "__main__":
|
|
299
|
+
raise RuntimeError("This module should not be run directly.")
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Excel Formula Recalculation Script
|
|
3
|
+
Recalculates all formulas in an Excel file using LibreOffice
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import contextlib
|
|
7
|
+
import json
|
|
8
|
+
import os
|
|
9
|
+
import platform
|
|
10
|
+
import re
|
|
11
|
+
import shutil
|
|
12
|
+
import subprocess
|
|
13
|
+
import sys
|
|
14
|
+
import tempfile
|
|
15
|
+
import time
|
|
16
|
+
import zipfile
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from office.soffice import get_soffice_env, run_soffice
|
|
20
|
+
|
|
21
|
+
from openpyxl import load_workbook
|
|
22
|
+
|
|
23
|
+
MACRO_FILENAME = "Module1.xba"
|
|
24
|
+
SOFFICE_MISSING = "soffice not found on PATH; LibreOffice is required to recalculate"
|
|
25
|
+
|
|
26
|
+
MAX_LOCATIONS = 100
|
|
27
|
+
|
|
28
|
+
EXTERNAL_REF_RE = re.compile(r"""(?<![\w"\[])'?\[\d+\][^!"\[\]]*'?!""")
|
|
29
|
+
|
|
30
|
+
RECALCULATE_MACRO = """<?xml version="1.0" encoding="UTF-8"?>
|
|
31
|
+
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
|
32
|
+
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module1" script:language="StarBasic">
|
|
33
|
+
Sub RecalculateAndSave()
|
|
34
|
+
ThisComponent.calculateAll()
|
|
35
|
+
ThisComponent.store()
|
|
36
|
+
ThisComponent.close(True)
|
|
37
|
+
End Sub
|
|
38
|
+
</script:module>"""
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def has_gtimeout():
|
|
42
|
+
try:
|
|
43
|
+
subprocess.run(
|
|
44
|
+
["gtimeout", "--version"], capture_output=True, timeout=1, check=False
|
|
45
|
+
)
|
|
46
|
+
return True
|
|
47
|
+
except (FileNotFoundError, subprocess.TimeoutExpired):
|
|
48
|
+
return False
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _stamp(path):
|
|
52
|
+
st = os.stat(path)
|
|
53
|
+
return st.st_mtime_ns, st.st_size
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def setup_libreoffice_macro(profile_dir: Path, timeout=30):
|
|
57
|
+
url = profile_dir.as_uri()
|
|
58
|
+
try:
|
|
59
|
+
run_soffice(
|
|
60
|
+
["--headless", "--terminate_after_init", f"-env:UserInstallation={url}"],
|
|
61
|
+
capture_output=True,
|
|
62
|
+
timeout=timeout,
|
|
63
|
+
)
|
|
64
|
+
except FileNotFoundError:
|
|
65
|
+
return None, SOFFICE_MISSING
|
|
66
|
+
except subprocess.TimeoutExpired:
|
|
67
|
+
return None, "LibreOffice timed out creating its profile; formulas were NOT recalculated"
|
|
68
|
+
|
|
69
|
+
macro_dir = profile_dir / "user" / "basic" / "Standard"
|
|
70
|
+
if not macro_dir.exists():
|
|
71
|
+
return None, "LibreOffice did not create a usable profile; formulas were NOT recalculated"
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
(macro_dir / MACRO_FILENAME).write_text(RECALCULATE_MACRO)
|
|
75
|
+
except OSError as e:
|
|
76
|
+
return None, f"Could not install the recalculation macro: {e}"
|
|
77
|
+
|
|
78
|
+
return url, None
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def external_links_at_risk(filename):
|
|
82
|
+
try:
|
|
83
|
+
with zipfile.ZipFile(filename) as archive:
|
|
84
|
+
names = archive.namelist()
|
|
85
|
+
except (zipfile.BadZipFile, OSError):
|
|
86
|
+
return []
|
|
87
|
+
if not any(n.startswith("xl/externalLinks/") for n in names):
|
|
88
|
+
return []
|
|
89
|
+
|
|
90
|
+
with contextlib.ExitStack() as stack:
|
|
91
|
+
formulas = load_workbook(filename, data_only=False)
|
|
92
|
+
stack.callback(formulas.close)
|
|
93
|
+
values = load_workbook(filename, data_only=True)
|
|
94
|
+
stack.callback(values.close)
|
|
95
|
+
|
|
96
|
+
external_names = [
|
|
97
|
+
name
|
|
98
|
+
for name, dn in formulas.defined_names.items()
|
|
99
|
+
if isinstance(getattr(dn, "value", None), str) and EXTERNAL_REF_RE.search(dn.value)
|
|
100
|
+
]
|
|
101
|
+
name_re = (
|
|
102
|
+
re.compile(r"\b(" + "|".join(re.escape(n) for n in external_names) + r")\b")
|
|
103
|
+
if external_names
|
|
104
|
+
else None
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
at_risk = []
|
|
108
|
+
for sheet in formulas.sheetnames:
|
|
109
|
+
ws = formulas[sheet]
|
|
110
|
+
if not hasattr(ws, "iter_rows"):
|
|
111
|
+
continue
|
|
112
|
+
cached = values[sheet]
|
|
113
|
+
for row in ws.iter_rows():
|
|
114
|
+
for cell in row:
|
|
115
|
+
v = cell.value
|
|
116
|
+
if not (isinstance(v, str) and v.startswith("=")):
|
|
117
|
+
continue
|
|
118
|
+
reaches_out = EXTERNAL_REF_RE.search(v) or (name_re and name_re.search(v))
|
|
119
|
+
if reaches_out and cached[cell.coordinate].value is None:
|
|
120
|
+
at_risk.append(f"{sheet}!{cell.coordinate}")
|
|
121
|
+
return at_risk
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def recalc(filename, timeout=30, force=False):
|
|
125
|
+
if not Path(filename).exists():
|
|
126
|
+
return {"error": f"File {filename} does not exist"}
|
|
127
|
+
|
|
128
|
+
abs_path = str(Path(filename).absolute())
|
|
129
|
+
|
|
130
|
+
if not os.access(abs_path, os.W_OK):
|
|
131
|
+
return {"error": f"{filename} is not writable; recalculation rewrites the file in place"}
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
get_soffice_env()
|
|
135
|
+
except Exception as e:
|
|
136
|
+
return {"error": f"Could not prepare the LibreOffice environment: {e}"}
|
|
137
|
+
|
|
138
|
+
if not force:
|
|
139
|
+
try:
|
|
140
|
+
at_risk = external_links_at_risk(filename)
|
|
141
|
+
except Exception as e:
|
|
142
|
+
return {"error": f"Could not inspect {filename} for external links: {e}"}
|
|
143
|
+
if at_risk:
|
|
144
|
+
shown = at_risk[:MAX_LOCATIONS]
|
|
145
|
+
return {
|
|
146
|
+
"error": (
|
|
147
|
+
"Refusing to recalculate: this workbook links to another workbook, and "
|
|
148
|
+
f"{len(at_risk)} linked cell(s) have lost their cached value (openpyxl strips "
|
|
149
|
+
"these on save). Recalculating would resolve them to #NAME? and delete the "
|
|
150
|
+
"external links for good. Copy those cells' values from the original file "
|
|
151
|
+
"before saving, or pass --force to accept the loss. Charts and conditional "
|
|
152
|
+
"formats can hold external references too, so this list may not be exhaustive."
|
|
153
|
+
),
|
|
154
|
+
"external_link_cells": shown,
|
|
155
|
+
"external_link_cells_truncated": max(0, len(at_risk) - len(shown)),
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
with tempfile.TemporaryDirectory(
|
|
159
|
+
prefix="recalc-lo-profile-", ignore_cleanup_errors=True
|
|
160
|
+
) as profile_dir:
|
|
161
|
+
return _recalc_with_profile(filename, abs_path, timeout, Path(profile_dir))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def _recalc_with_profile(filename, abs_path, timeout, profile_dir: Path):
|
|
165
|
+
started = time.monotonic()
|
|
166
|
+
profile_url, err = setup_libreoffice_macro(profile_dir, timeout=timeout)
|
|
167
|
+
if err:
|
|
168
|
+
return {"error": err}
|
|
169
|
+
|
|
170
|
+
timeout = max(5, int(timeout - (time.monotonic() - started)))
|
|
171
|
+
|
|
172
|
+
before = _stamp(abs_path)
|
|
173
|
+
|
|
174
|
+
cmd = [
|
|
175
|
+
"soffice",
|
|
176
|
+
"--headless",
|
|
177
|
+
"--norestore",
|
|
178
|
+
f"-env:UserInstallation={profile_url}",
|
|
179
|
+
"vnd.sun.star.script:Standard.Module1.RecalculateAndSave?language=Basic&location=application",
|
|
180
|
+
abs_path,
|
|
181
|
+
]
|
|
182
|
+
|
|
183
|
+
if platform.system() == "Linux" and shutil.which("timeout"):
|
|
184
|
+
cmd = ["timeout", str(timeout)] + cmd
|
|
185
|
+
elif platform.system() == "Darwin" and has_gtimeout():
|
|
186
|
+
cmd = ["gtimeout", str(timeout)] + cmd
|
|
187
|
+
|
|
188
|
+
timed_out = f"LibreOffice timed out after {timeout}s; formulas were NOT recalculated. Re-run with a longer timeout."
|
|
189
|
+
|
|
190
|
+
try:
|
|
191
|
+
result = subprocess.run(
|
|
192
|
+
cmd, capture_output=True, text=True, env=get_soffice_env(), timeout=timeout + 15
|
|
193
|
+
)
|
|
194
|
+
except subprocess.TimeoutExpired:
|
|
195
|
+
return {"error": timed_out}
|
|
196
|
+
except FileNotFoundError:
|
|
197
|
+
return {"error": SOFFICE_MISSING}
|
|
198
|
+
|
|
199
|
+
if result.returncode == 124:
|
|
200
|
+
return {"error": timed_out}
|
|
201
|
+
|
|
202
|
+
if result.returncode != 0:
|
|
203
|
+
detail = (result.stderr or "").strip() or f"soffice exited {result.returncode}"
|
|
204
|
+
return {"error": f"LibreOffice failed to recalculate: {detail}"}
|
|
205
|
+
|
|
206
|
+
if _stamp(abs_path) == before:
|
|
207
|
+
return {
|
|
208
|
+
"error": (
|
|
209
|
+
"LibreOffice exited cleanly but never rewrote the file, so nothing was "
|
|
210
|
+
"recalculated. Check that no other LibreOffice instance is running, then retry."
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
try:
|
|
215
|
+
wb = load_workbook(filename, data_only=True)
|
|
216
|
+
|
|
217
|
+
excel_errors = [
|
|
218
|
+
"#VALUE!",
|
|
219
|
+
"#DIV/0!",
|
|
220
|
+
"#REF!",
|
|
221
|
+
"#NAME?",
|
|
222
|
+
"#NULL!",
|
|
223
|
+
"#NUM!",
|
|
224
|
+
"#N/A",
|
|
225
|
+
]
|
|
226
|
+
error_details = {err: [] for err in excel_errors}
|
|
227
|
+
total_errors = 0
|
|
228
|
+
|
|
229
|
+
for sheet_name in wb.sheetnames:
|
|
230
|
+
ws = wb[sheet_name]
|
|
231
|
+
if not hasattr(ws, "iter_rows"):
|
|
232
|
+
continue
|
|
233
|
+
for row in ws.iter_rows():
|
|
234
|
+
for cell in row:
|
|
235
|
+
if cell.value is not None and isinstance(cell.value, str):
|
|
236
|
+
for err in excel_errors:
|
|
237
|
+
if err in cell.value:
|
|
238
|
+
location = f"{sheet_name}!{cell.coordinate}"
|
|
239
|
+
error_details[err].append(location)
|
|
240
|
+
total_errors += 1
|
|
241
|
+
break
|
|
242
|
+
|
|
243
|
+
result = {
|
|
244
|
+
"status": "success" if total_errors == 0 else "errors_found",
|
|
245
|
+
"total_errors": total_errors,
|
|
246
|
+
"error_summary": {},
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
for err_type, locations in error_details.items():
|
|
250
|
+
if locations:
|
|
251
|
+
entry = {"count": len(locations), "locations": locations[:MAX_LOCATIONS]}
|
|
252
|
+
if len(locations) > MAX_LOCATIONS:
|
|
253
|
+
entry["locations_truncated"] = len(locations) - MAX_LOCATIONS
|
|
254
|
+
result["error_summary"][err_type] = entry
|
|
255
|
+
|
|
256
|
+
wb.close()
|
|
257
|
+
|
|
258
|
+
wb_formulas = load_workbook(filename, data_only=False)
|
|
259
|
+
formula_count = 0
|
|
260
|
+
for sheet_name in wb_formulas.sheetnames:
|
|
261
|
+
ws = wb_formulas[sheet_name]
|
|
262
|
+
if not hasattr(ws, "iter_rows"):
|
|
263
|
+
continue
|
|
264
|
+
for row in ws.iter_rows():
|
|
265
|
+
for cell in row:
|
|
266
|
+
if (
|
|
267
|
+
cell.value
|
|
268
|
+
and isinstance(cell.value, str)
|
|
269
|
+
and cell.value.startswith("=")
|
|
270
|
+
):
|
|
271
|
+
formula_count += 1
|
|
272
|
+
wb_formulas.close()
|
|
273
|
+
|
|
274
|
+
result["total_formulas"] = formula_count
|
|
275
|
+
|
|
276
|
+
return result
|
|
277
|
+
|
|
278
|
+
except Exception as e:
|
|
279
|
+
return {"error": str(e)}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def main():
|
|
283
|
+
args = [a for a in sys.argv[1:] if a != "--force"]
|
|
284
|
+
force = "--force" in sys.argv[1:]
|
|
285
|
+
|
|
286
|
+
if not args:
|
|
287
|
+
print("Usage: python recalc.py <excel_file> [timeout_seconds] [--force]")
|
|
288
|
+
print("\nRecalculates all formulas in an Excel file using LibreOffice")
|
|
289
|
+
print("\nReturns JSON with error details:")
|
|
290
|
+
print(" - status: 'success' or 'errors_found'")
|
|
291
|
+
print(" - total_errors: Total number of Excel errors found")
|
|
292
|
+
print(" - total_formulas: Number of formulas in the file")
|
|
293
|
+
print(" - error_summary: Breakdown by error type with locations")
|
|
294
|
+
print(" - #VALUE!, #DIV/0!, #REF!, #NAME?, #NULL!, #NUM!, #N/A")
|
|
295
|
+
print("\nOn any failure the JSON has an 'error' key and no 'status'.")
|
|
296
|
+
print("--force recalculates even when it would destroy external links.")
|
|
297
|
+
sys.exit(1)
|
|
298
|
+
|
|
299
|
+
filename = args[0]
|
|
300
|
+
timeout = int(args[1]) if len(args) > 1 else 30
|
|
301
|
+
|
|
302
|
+
result = recalc(filename, timeout, force=force)
|
|
303
|
+
print(json.dumps(result, indent=2))
|
|
304
|
+
sys.exit(1 if "error" in result else 0)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
if __name__ == "__main__":
|
|
308
|
+
main()
|
package/src/account/account.ts
CHANGED
|
@@ -13,18 +13,17 @@ import {
|
|
|
13
13
|
import { withTransientReadRetry } from "@/util/effect-http-client"
|
|
14
14
|
import { AccountRepo, type AccountRow } from "./repo"
|
|
15
15
|
import { normalizeServerUrl } from "./url"
|
|
16
|
+
import type { Info, OrgID } from "./schema"
|
|
16
17
|
import {
|
|
17
18
|
type AccountError,
|
|
18
19
|
AccessToken,
|
|
19
20
|
AccountID,
|
|
20
21
|
DeviceCode,
|
|
21
|
-
Info,
|
|
22
22
|
RefreshToken,
|
|
23
23
|
AccountServiceError,
|
|
24
24
|
AccountTransportError,
|
|
25
25
|
Login,
|
|
26
26
|
Org,
|
|
27
|
-
OrgID,
|
|
28
27
|
PollDenied,
|
|
29
28
|
PollError,
|
|
30
29
|
PollExpired,
|
package/src/account/repo.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { Effect, Layer, Option, Schema, Context } from "effect"
|
|
|
5
5
|
|
|
6
6
|
import { Database } from "@anymous-ai/core/database/database"
|
|
7
7
|
import { AccountStateTable, AccountTable } from "@anymous-ai/core/account/sql"
|
|
8
|
-
import { AccessToken, AccountID,
|
|
8
|
+
import type { AccessToken, AccountID, OrgID, RefreshToken } from "./schema"
|
|
9
|
+
import { AccountRepoError, Info } from "./schema"
|
|
9
10
|
import { normalizeServerUrl } from "./url"
|
|
10
11
|
|
|
11
12
|
export type AccountRow = (typeof AccountTable)["$inferSelect"]
|
package/src/acp/content.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ContentBlock, ContentChunk, ResourceLink, Role } from "@agentclientprotocol/sdk"
|
|
2
2
|
import path from "node:path"
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url"
|
|
4
|
-
import { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
4
|
+
import type { SessionV1 } from "@anymous-ai/core/v1/session"
|
|
5
5
|
|
|
6
6
|
export type PromptPart = SessionV1.TextPartInput | SessionV1.FilePartInput
|
|
7
7
|
|
package/src/acp/directory.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { InstanceRef } from "@/effect/instance-ref"
|
|
|
4
4
|
import { InstanceBootstrap } from "@/project/bootstrap"
|
|
5
5
|
import { InstanceStore } from "@/project/instance-store"
|
|
6
6
|
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
7
|
-
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
8
|
-
import { ModelV2 } from "@anymous-ai/core/model"
|
|
7
|
+
import type { ProviderV2 } from "@anymous-ai/core/provider"
|
|
8
|
+
import type { ModelV2 } from "@anymous-ai/core/model"
|
|
9
9
|
import { Provider } from "@/provider/provider"
|
|
10
10
|
import { Context, Effect, Layer, SynchronizedRef } from "effect"
|
|
11
11
|
import type * as ACPError from "./error"
|
package/src/acp/event.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ToolPart,
|
|
10
10
|
} from "@anymous-ai/sdk/v2"
|
|
11
11
|
import { Effect } from "effect"
|
|
12
|
-
import { ACPSession } from "./session"
|
|
12
|
+
import type { ACPSession } from "./session"
|
|
13
13
|
import { ACPPermission } from "./permission"
|
|
14
14
|
import { partsToContentChunks, type ReplayPart } from "./content"
|
|
15
15
|
import {
|
package/src/acp/session.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { McpServer } from "@agentclientprotocol/sdk"
|
|
2
2
|
import type { Message, Part } from "@anymous-ai/sdk/v2"
|
|
3
3
|
import { LayerNode } from "@anymous-ai/core/effect/layer-node"
|
|
4
|
-
import { ProviderV2 } from "@anymous-ai/core/provider"
|
|
5
|
-
import { ModelV2 } from "@anymous-ai/core/model"
|
|
4
|
+
import type { ProviderV2 } from "@anymous-ai/core/provider"
|
|
5
|
+
import type { ModelV2 } from "@anymous-ai/core/model"
|
|
6
6
|
import { Context, Effect, Layer, Ref } from "effect"
|
|
7
7
|
import * as ACPError from "./error"
|
|
8
8
|
|