open-agreements 0.7.7 → 0.8.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/LICENSE +201 -21
- package/README.de.md +16 -29
- package/README.es.md +16 -29
- package/README.md +45 -54
- package/README.pt-br.md +16 -29
- package/README.template.md +19 -25
- package/README.zh.md +16 -29
- package/content/recipes/nvca-certificate-of-incorporation/fields/acquisition_exception_shares.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/adjustment_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/common_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/company_name.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/conversion_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_formula_alt.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_per_share.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/dividend_rate_percent.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/effective_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/number_of_classes.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/original_issue_price.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/par_value.json +36 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_director_seats.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_authorized.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_designated_portion.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/preferred_shares_outstanding_threshold.json +29 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/qualified_financing_notice_days.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_interest_rate.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/redemption_start_date.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_address.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/registered_agent_name.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/series_designation.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/signature_page_marker.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/specify_percentage.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/strategic_partnership_exception_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/time_zone.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/fields/total_authorized_shares.json +22 -0
- package/content/recipes/nvca-certificate-of-incorporation/template-manifest.json +77 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_date_month_day.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/agreement_year_two_digits.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/company_name.json +25 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/investor_counsel.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/minimum_shares_initial_closing.json +39 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/optional_plural_suffix.json +27 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/par_value_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/purchase_price_per_share.json +28 -0
- package/content/recipes/nvca-stock-purchase-agreement/fields/series_designation.json +159 -0
- package/content/recipes/nvca-stock-purchase-agreement/metadata.yaml +1 -1
- package/content/recipes/nvca-stock-purchase-agreement/template-manifest.json +24 -0
- package/content/templates/bonterms-mutual-nda/template.docx +0 -0
- package/content/templates/openagreements-board-consent-safe/.template.generated.json +0 -1
- package/content/templates/openagreements-employee-ip-inventions-assignment/.template.generated.json +9 -5
- package/content/templates/openagreements-employee-ip-inventions-assignment/README.md +2 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/metadata.yaml +8 -9
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.docx +0 -0
- package/content/templates/openagreements-employee-ip-inventions-assignment/template.md +3 -4
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/metadata.yaml +0 -9
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.docx +0 -0
- package/content/templates/openagreements-employment-confidentiality-acknowledgement/template.json +0 -1
- package/content/templates/openagreements-employment-offer-letter/.template.generated.json +9 -5
- package/content/templates/openagreements-employment-offer-letter/README.md +17 -5
- package/content/templates/openagreements-employment-offer-letter/metadata.yaml +8 -9
- package/content/templates/openagreements-employment-offer-letter/template.docx +0 -0
- package/content/templates/openagreements-employment-offer-letter/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-florida/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-florida/README.md +2 -2
- package/content/templates/openagreements-restrictive-covenant-florida/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-florida/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-florida/template.md +3 -4
- package/content/templates/openagreements-restrictive-covenant-wyoming/.template.generated.json +9 -5
- package/content/templates/openagreements-restrictive-covenant-wyoming/metadata.yaml +10 -12
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.docx +0 -0
- package/content/templates/openagreements-restrictive-covenant-wyoming/template.md +3 -4
- package/content/templates/openagreements-stockholder-consent-safe/.template.generated.json +0 -1
- package/dist/core/checklist/format-checklist-docx.d.ts.map +1 -1
- package/dist/core/checklist/format-checklist-docx.js +4 -1
- package/dist/core/checklist/format-checklist-docx.js.map +1 -1
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +2 -40
- package/dist/core/engine.js.map +1 -1
- package/dist/core/fill-pipeline.d.ts +0 -8
- package/dist/core/fill-pipeline.d.ts.map +1 -1
- package/dist/core/fill-pipeline.js +54 -30
- package/dist/core/fill-pipeline.js.map +1 -1
- package/dist/core/humanize-docx.d.ts.map +1 -1
- package/dist/core/humanize-docx.js +16 -6
- package/dist/core/humanize-docx.js.map +1 -1
- package/dist/core/recipe/bracket-normalizer.d.ts.map +1 -1
- package/dist/core/recipe/bracket-normalizer.js +3 -7
- package/dist/core/recipe/bracket-normalizer.js.map +1 -1
- package/dist/core/recipe/cleaner.js +5 -5
- package/dist/core/recipe/cleaner.js.map +1 -1
- package/dist/core/recipe/index.d.ts +1 -1
- package/dist/core/recipe/index.d.ts.map +1 -1
- package/dist/core/recipe/index.js +57 -4
- package/dist/core/recipe/index.js.map +1 -1
- package/dist/core/recipe/ooxml-parts.d.ts +11 -0
- package/dist/core/recipe/ooxml-parts.d.ts.map +1 -1
- package/dist/core/recipe/ooxml-parts.js +22 -0
- package/dist/core/recipe/ooxml-parts.js.map +1 -1
- package/dist/core/recipe/patcher.d.ts.map +1 -1
- package/dist/core/recipe/patcher.js +2 -5
- package/dist/core/recipe/patcher.js.map +1 -1
- package/dist/core/recipe/source-drift.d.ts +19 -0
- package/dist/core/recipe/source-drift.d.ts.map +1 -1
- package/dist/core/recipe/source-drift.js +32 -2
- package/dist/core/recipe/source-drift.js.map +1 -1
- package/dist/core/selector.d.ts.map +1 -1
- package/dist/core/selector.js +49 -4
- package/dist/core/selector.js.map +1 -1
- package/dist/core/selectors/index.d.ts +40 -0
- package/dist/core/selectors/index.d.ts.map +1 -0
- package/dist/core/selectors/index.js +64 -0
- package/dist/core/selectors/index.js.map +1 -0
- package/dist/core/selectors/loader.d.ts +16 -0
- package/dist/core/selectors/loader.d.ts.map +1 -0
- package/dist/core/selectors/loader.js +80 -0
- package/dist/core/selectors/loader.js.map +1 -0
- package/dist/core/selectors/manifest-schema.d.ts +123 -0
- package/dist/core/selectors/manifest-schema.d.ts.map +1 -0
- package/dist/core/selectors/manifest-schema.js +93 -0
- package/dist/core/selectors/manifest-schema.js.map +1 -0
- package/dist/core/selectors/patch.d.ts +24 -0
- package/dist/core/selectors/patch.d.ts.map +1 -0
- package/dist/core/selectors/patch.js +68 -0
- package/dist/core/selectors/patch.js.map +1 -0
- package/dist/core/selectors/postconditions.d.ts +24 -0
- package/dist/core/selectors/postconditions.d.ts.map +1 -0
- package/dist/core/selectors/postconditions.js +50 -0
- package/dist/core/selectors/postconditions.js.map +1 -0
- package/dist/core/selectors/resolve.d.ts +32 -0
- package/dist/core/selectors/resolve.d.ts.map +1 -0
- package/dist/core/selectors/resolve.js +36 -0
- package/dist/core/selectors/resolve.js.map +1 -0
- package/dist/core/unified-pipeline.d.ts +3 -1
- package/dist/core/unified-pipeline.d.ts.map +1 -1
- package/dist/core/unified-pipeline.js +19 -5
- package/dist/core/unified-pipeline.js.map +1 -1
- package/gemini-extension.json +1 -1
- package/node_modules/@usejunior/docx-core/LICENSE +202 -21
- package/node_modules/@usejunior/docx-core/NOTICE +2 -0
- package/node_modules/@usejunior/docx-core/README.md +2 -2
- package/node_modules/@usejunior/docx-core/dist/.tsbuildinfo +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts +55 -0
- package/node_modules/@usejunior/docx-core/dist/atomizer.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/atomizer.js +139 -14
- package/node_modules/@usejunior/docx-core/dist/atomizer.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js +415 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/auxiliaryIdCollision.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js +403 -113
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/documentReconstructor.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts +99 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js +449 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/formattingFidelity.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-bookmarks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts +74 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js +171 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-containers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts +88 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js +326 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-deletion.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts +85 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js +402 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-postprocess.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts +39 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js +265 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-presplit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts +62 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js +139 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-shared.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts +198 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js +475 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier-wrappers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts +6 -290
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js +23 -1828
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/inPlaceModifier.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts +36 -2
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js +456 -224
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/pipeline.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js +199 -173
- package/node_modules/@usejunior/docx-core/dist/baselines/atomizer/trackChangesAcceptorAst.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js +7 -0
- package/node_modules/@usejunior/docx-core/dist/baselines/wmlcomparer/DotnetCli.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js +3 -1
- package/node_modules/@usejunior/docx-core/dist/cli/compare-two.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts +3 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js +93 -0
- package/node_modules/@usejunior/docx-core/dist/cli/conformance-adapter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/cli/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/cli/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts +197 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/compare-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js +5 -1
- package/node_modules/@usejunior/docx-core/dist/core-types.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/footnotes.js +8 -3
- package/node_modules/@usejunior/docx-core/dist/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js +58 -0
- package/node_modules/@usejunior/docx-core/dist/generation/compile.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts +42 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js +65 -0
- package/node_modules/@usejunior/docx-core/dist/generation/context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js +116 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/comments-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js +60 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/document-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts +28 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/emit-context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js +74 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/font-table-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts +23 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js +57 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/header-footer-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js +102 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/numbering-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js +121 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/package-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/paragraph.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts +36 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js +157 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/properties.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js +71 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/run.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js +117 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/section.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js +68 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js +82 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/styles-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts +26 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js +209 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/table.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts +21 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js +151 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/theme-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js +19 -0
- package/node_modules/@usejunior/docx-core/dist/generation/emit/web-settings-part.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts +22 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/generation/errors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts +13 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js +12 -0
- package/node_modules/@usejunior/docx-core/dist/generation/index.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts +46 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js +119 -0
- package/node_modules/@usejunior/docx-core/dist/generation/ordering.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts +87 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js +232 -0
- package/node_modules/@usejunior/docx-core/dist/generation/recipes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts +24 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js +318 -0
- package/node_modules/@usejunior/docx-core/dist/generation/structural-checks.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts +4 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js +18 -0
- package/node_modules/@usejunior/docx-core/dist/generation/theme-colors.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts +266 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/generation/types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts +27 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js +363 -0
- package/node_modules/@usejunior/docx-core/dist/generation/validate-spec.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/index.d.ts +9 -150
- package/node_modules/@usejunior/docx-core/dist/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/index.js +14 -0
- package/node_modules/@usejunior/docx-core/dist/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js +84 -0
- package/node_modules/@usejunior/docx-core/dist/integration/generation-probes.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts +49 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js +290 -0
- package/node_modules/@usejunior/docx-core/dist/integration/libreoffice-oracle.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts +134 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js +298 -0
- package/node_modules/@usejunior/docx-core/dist/integration/synthetic-docx-fixture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js +163 -77
- package/node_modules/@usejunior/docx-core/dist/primitives/accept_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts +12 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js +374 -97
- package/node_modules/@usejunior/docx-core/dist/primitives/comments.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js +63 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/content_fingerprint.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts +94 -15
- package/node_modules/@usejunior/docx-core/dist/primitives/document.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js +377 -234
- package/node_modules/@usejunior/docx-core/dist/primitives/document.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts +18 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js +160 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-comments.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts +45 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js +247 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-headings.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js +104 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-styles.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js +199 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-toon.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js +2 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view-types.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts +50 -101
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js +287 -326
- package/node_modules/@usejunior/docx-core/dist/primitives/document_view.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts +9 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js +10 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/dom-helpers.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js +232 -44
- package/node_modules/@usejunior/docx-core/dist/primitives/footnotes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js +22 -11
- package/node_modules/@usejunior/docx-core/dist/primitives/formatting_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts +12 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js +11 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/index.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts +4 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js +45 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/layout.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts +76 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js +223 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/locator.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js +32 -10
- package/node_modules/@usejunior/docx-core/dist/primitives/merge_runs.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts +38 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/minimal_save.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts +53 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js +59 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts +6 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js +187 -91
- package/node_modules/@usejunior/docx-core/dist/primitives/reject_changes.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js +27 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-parts.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js +39 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/revision-vocabulary.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/schema-corpus-capture.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js +165 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/sectPrAudit.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts +7 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js +23 -4
- package/node_modules/@usejunior/docx-core/dist/primitives/semantic_tags.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts +37 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js +395 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_html.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts +16 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js +300 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_markdown.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js +154 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/serialize_plaintext.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts +15 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js +33 -22
- package/node_modules/@usejunior/docx-core/dist/primitives/styles.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts +19 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js +189 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/table_context.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js +13 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/tables.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts +2 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js +116 -12
- package/node_modules/@usejunior/docx-core/dist/primitives/text.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts +148 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js +291 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/track-changes-emitter.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js +323 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/validate_ai_revisions.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts +29 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js +35 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml-helpers.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js +5 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/xml.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts +1 -0
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js +21 -3
- package/node_modules/@usejunior/docx-core/dist/primitives/zip.js.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts +14 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.d.ts.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js +166 -0
- package/node_modules/@usejunior/docx-core/dist/shared/field-structure.js.map +1 -0
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.d.ts.map +1 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js +4 -1
- package/node_modules/@usejunior/docx-core/dist/shared/ooxml/namespaces.js.map +1 -1
- package/node_modules/@usejunior/docx-core/package.json +13 -9
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +186 -70
- package/node_modules/@xmldom/xmldom/index.d.ts +144 -19
- package/node_modules/@xmldom/xmldom/lib/dom.js +705 -343
- package/node_modules/@xmldom/xmldom/lib/grammar.js +14 -0
- package/node_modules/@xmldom/xmldom/package.json +13 -10
- package/package.json +7 -7
- package/server.json +3 -3
- package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/SKILL.md +2 -2
- package/skills/{nda → agreements/cloud-service-agreement}/template-filling-execution.md +2 -2
- package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/SKILL.md +15 -4
- package/skills/{safe → agreements/data-privacy-agreement}/template-filling-execution.md +12 -6
- package/skills/{employment-contract → agreements/employment-contract}/SKILL.md +3 -3
- package/skills/{cloud-service-agreement → agreements/employment-contract}/template-filling-execution.md +12 -6
- package/skills/{nda → agreements/nda}/SKILL.md +2 -2
- package/skills/{open-agreements → agreements/nda}/template-filling-execution.md +12 -6
- package/skills/{open-agreements → agreements/open-agreements}/SKILL.md +13 -30
- package/skills/agreements/open-agreements/template-filling-execution.md +98 -0
- package/skills/{safe → agreements/safe}/SKILL.md +2 -2
- package/skills/agreements/safe/template-filling-execution.md +98 -0
- package/skills/{services-agreement → agreements/services-agreement}/SKILL.md +3 -3
- package/skills/agreements/services-agreement/template-filling-execution.md +98 -0
- package/skills/{venture-financing → agreements/venture-financing}/SKILL.md +3 -3
- package/skills/agreements/venture-financing/template-filling-execution.md +98 -0
- package/skills/{client-email → client-workflows/client-email}/SKILL.md +1 -1
- package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/SKILL.md +1 -1
- package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/SKILL.md +1 -1
- package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/SKILL.md +1 -1
- package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/SKILL.md +1 -1
- package/skills/{soc2-readiness → compliance/soc2-readiness}/SKILL.md +1 -1
- package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/SKILL.md +2 -3
- package/skills/{recipe-quality-audit → internal/recipe-quality-audit}/SKILL.md +2 -1
- package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/SKILL.md +2 -0
- package/skills/legal-explainers/data-privacy-law-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/LICENSE +269 -0
- package/skills/legal-explainers/data-privacy-law-explainer/NOTICE +7 -0
- package/skills/legal-explainers/data-privacy-law-explainer/SKILL.md +113 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alabama.md +211 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/alaska.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arizona.md +181 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/arkansas.md +219 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/california.md +107 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/colorado.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/connecticut.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/delaware.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/district-of-columbia.md +153 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/florida.md +234 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/georgia.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/hawaii.md +167 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/idaho.md +149 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/illinois.md +238 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/indiana.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/iowa.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kansas.md +155 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/kentucky.md +87 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/louisiana.md +209 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maine.md +163 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/maryland.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/massachusetts.md +260 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/michigan.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/minnesota.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/mississippi.md +132 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/missouri.md +179 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/montana.md +105 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nebraska.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/nevada.md +212 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-hampshire.md +91 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-jersey.md +95 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-mexico.md +174 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/new-york.md +195 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-carolina.md +205 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/north-dakota.md +169 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/ohio.md +171 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oklahoma.md +168 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/oregon.md +103 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/pennsylvania.md +99 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/rhode-island.md +93 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-carolina.md +175 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/south-dakota.md +176 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/tennessee.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/texas.md +89 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/utah.md +83 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/vermont.md +267 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/virginia.md +85 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/washington.md +247 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/west-virginia.md +141 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wisconsin.md +156 -0
- package/skills/legal-explainers/data-privacy-law-explainer/content/wyoming.md +185 -0
- package/skills/legal-explainers/data-privacy-law-explainer/manifest.json +519 -0
- package/skills/legal-explainers/non-compete-contract-explainer/CONTRIBUTING.md +7 -0
- package/skills/legal-explainers/non-compete-contract-explainer/LICENSE +269 -0
- package/skills/legal-explainers/non-compete-contract-explainer/NOTICE +7 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/SKILL.md +1 -1
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alabama.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/alaska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/american-samoa.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arizona.md +6 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/arkansas.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/au.md +208 -0
- package/skills/legal-explainers/non-compete-contract-explainer/content/australian-capital-territory.md +220 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/california.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/cnmi.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/colorado.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/connecticut.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/delaware.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/district-of-columbia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/florida.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/georgia.md +7 -7
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/guam.md +4 -4
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/hawaii.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/idaho.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/illinois.md +5 -5
- package/skills/{non-compete-contract-explainer/content/india.md → legal-explainers/non-compete-contract-explainer/content/in.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/indiana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/iowa.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kansas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/kentucky.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/louisiana.md +9 -9
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maine.md +6 -6
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/maryland.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/massachusetts.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/michigan.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/minnesota.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/mississippi.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/missouri.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/montana.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nebraska.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/nevada.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-hampshire.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-jersey.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-mexico.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/new-south-wales.md +218 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/new-york.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/north-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/northern-territory.md +214 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/ohio.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oklahoma.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/oregon.md +12 -12
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/pennsylvania.md +5 -5
- package/skills/{non-compete-contract-explainer/content/philippines.md → legal-explainers/non-compete-contract-explainer/content/ph.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/puerto-rico.md +4 -4
- package/skills/legal-explainers/non-compete-contract-explainer/content/queensland.md +206 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/rhode-island.md +5 -5
- package/skills/{non-compete-contract-explainer/content/singapore.md → legal-explainers/non-compete-contract-explainer/content/sg.md} +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/south-australia.md +236 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-carolina.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/south-dakota.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/tasmania.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/tennessee.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/texas.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/utah.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/vermont.md +29 -11
- package/skills/legal-explainers/non-compete-contract-explainer/content/victoria.md +218 -0
- package/skills/{non-compete-contract-explainer/content/us-virgin-islands.md → legal-explainers/non-compete-contract-explainer/content/virgin-islands.md} +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/virginia.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/washington.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/west-virginia.md +5 -5
- package/skills/legal-explainers/non-compete-contract-explainer/content/western-australia.md +224 -0
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wisconsin.md +5 -5
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/content/wyoming.md +19 -15
- package/skills/{non-compete-contract-explainer → legal-explainers/non-compete-contract-explainer}/manifest.json +225 -76
- package/content/templates/bonterms-mutual-nda/signing.yaml +0 -35
- package/dist/core/signing-config.d.ts +0 -46
- package/dist/core/signing-config.d.ts.map +0 -1
- package/dist/core/signing-config.js +0 -67
- package/dist/core/signing-config.js.map +0 -1
- package/skills/services-agreement/template-filling-execution.md +0 -81
- package/skills/shared/template-filling-execution.md +0 -92
- /package/skills/{cloud-service-agreement → agreements/cloud-service-agreement}/CONNECTORS.md +0 -0
- /package/skills/{data-privacy-agreement → agreements/data-privacy-agreement}/CONNECTORS.md +0 -0
- /package/skills/{employment-contract → agreements/employment-contract}/CONNECTORS.md +0 -0
- /package/skills/{nda → agreements/nda}/CONNECTORS.md +0 -0
- /package/skills/{open-agreements → agreements/open-agreements}/CONNECTORS.md +0 -0
- /package/skills/{safe → agreements/safe}/CONNECTORS.md +0 -0
- /package/skills/{services-agreement → agreements/services-agreement}/CONNECTORS.md +0 -0
- /package/skills/{venture-financing → agreements/venture-financing}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/CONNECTORS.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/ecorp-portal-playwright-notes.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/faq.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/filing-instructions.md +0 -0
- /package/skills/{delaware-franchise-tax → client-workflows/delaware-franchise-tax}/reference/tax-calculation.md +0 -0
- /package/skills/{edit-docx-agreement → client-workflows/edit-docx-agreement}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/api-exports.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/evidence-types.md +0 -0
- /package/skills/{iso-27001-evidence-collection → compliance/iso-27001-evidence-collection}/rules/screenshot-guide.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/CONNECTORS.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/access-control.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/business-continuity.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/change-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/encryption.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/incident-response.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/isms-management.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/logging-monitoring.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/people-controls.md +0 -0
- /package/skills/{iso-27001-internal-audit → compliance/iso-27001-internal-audit}/rules/supplier-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/CONNECTORS.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/change-vendor-management.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/communication-info.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/control-environment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/logical-access.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/monitoring-activities.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/optional-categories.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/privacy-criteria.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/risk-assessment.md +0 -0
- /package/skills/{soc2-readiness → compliance/soc2-readiness}/rules/system-operations.md +0 -0
- /package/skills/{canonical-markdown-authoring → internal/canonical-markdown-authoring}/CONNECTORS.md +0 -0
- /package/skills/{unit-test-philosophy → internal/unit-test-philosophy}/references/allure-test-spec-writing-guide.md +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { parseXml, serializeXml } from './xml.js';
|
|
2
|
+
import { childElements, createWmlElement, renameElement } from './dom-helpers.js';
|
|
3
|
+
import { OOXML } from './namespaces.js';
|
|
4
|
+
const SYNTHETIC_DOC = parseXml('<root xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>');
|
|
5
|
+
const EXCLUDED_PPR_CHANGE_CHILDREN = new Set(['w:rPr', 'w:rPrChange', 'w:pPrChange', 'w:sectPr']);
|
|
6
|
+
const EXCLUDED_TRPR_CHANGE_CHILDREN = new Set(['w:trPrChange', 'w:ins', 'w:del']);
|
|
7
|
+
// CT_TcPrInner (the inner pPr under <w:tcPrChange>) preserves cell-topology
|
|
8
|
+
// revision children (w:cellIns, w:cellDel, w:cellMerge). Only the
|
|
9
|
+
// change-of-a-change marker w:tcPrChange itself is excluded. See:
|
|
10
|
+
// https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.previoustablecellproperties
|
|
11
|
+
const EXCLUDED_TCPR_CHANGE_CHILDREN = new Set(['w:tcPrChange']);
|
|
12
|
+
const EXCLUDED_RPR_CHANGE_CHILDREN = new Set(['w:rPrChange']);
|
|
13
|
+
/**
|
|
14
|
+
* Create a revision ID allocator.
|
|
15
|
+
*
|
|
16
|
+
* @param startId - First ID to allocate. Defaults to `1`.
|
|
17
|
+
*/
|
|
18
|
+
export function createRevisionIdState(startId = 1) {
|
|
19
|
+
return {
|
|
20
|
+
nextId: startId,
|
|
21
|
+
moveRangeIds: new Map(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Allocate the next revision ID from a shared state object.
|
|
26
|
+
*/
|
|
27
|
+
export function allocateRevisionId(state) {
|
|
28
|
+
return state.nextId++;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Format a revision timestamp as OOXML-friendly ISO 8601.
|
|
32
|
+
*/
|
|
33
|
+
export function formatDate(date) {
|
|
34
|
+
return date.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Escape XML attribute text used in serialized revision markup.
|
|
38
|
+
*/
|
|
39
|
+
export function escapeXmlAttr(text) {
|
|
40
|
+
return text
|
|
41
|
+
.replace(/&/g, '&')
|
|
42
|
+
.replace(/</g, '<')
|
|
43
|
+
.replace(/>/g, '>')
|
|
44
|
+
.replace(/"/g, '"');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a reusable revision context for tracked-change emission.
|
|
48
|
+
*/
|
|
49
|
+
export function createRevisionContext(options) {
|
|
50
|
+
const { author, date, idState = createRevisionIdState() } = options;
|
|
51
|
+
return {
|
|
52
|
+
author,
|
|
53
|
+
date: typeof date === 'string' ? date : formatDate(date ?? new Date()),
|
|
54
|
+
idState,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a fresh tracked-change container (`<w:ins>` or `<w:del>`) into which
|
|
59
|
+
* the caller appends owned child nodes.
|
|
60
|
+
*
|
|
61
|
+
* Use this when wrapping multiple sibling elements under one revision marker.
|
|
62
|
+
* For single-element wrapping, prefer `wrapElementWithIns` / `wrapElementWithDel`.
|
|
63
|
+
*/
|
|
64
|
+
export function createRevisionContainer(doc, kind, ctx) {
|
|
65
|
+
return createRevisionWrapperElement(doc, kind, ctx);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Rewrite `<w:t>` → `<w:delText>` and `<w:instrText>` → `<w:delInstrText>`
|
|
69
|
+
* on the given element and all its descendants, for use inside a `<w:del>`
|
|
70
|
+
* container.
|
|
71
|
+
*
|
|
72
|
+
* **CALLERS MUST USE THE RETURN VALUE.** When the input element itself is a
|
|
73
|
+
* root `<w:t>` or `<w:instrText>`, this helper creates a renamed replacement
|
|
74
|
+
* node (you cannot rename a DOM element in place); the input element is
|
|
75
|
+
* detached from the tree and the new node is returned. Pattern:
|
|
76
|
+
*
|
|
77
|
+
* const ready = prepareElementForDeletion(detachedElement);
|
|
78
|
+
* wrapper.appendChild(ready);
|
|
79
|
+
*
|
|
80
|
+
* The element MUST already be detached from any parent. Calling on an
|
|
81
|
+
* attached element will leave the original tree in an inconsistent state.
|
|
82
|
+
*/
|
|
83
|
+
export function prepareElementForDeletion(element) {
|
|
84
|
+
return normalizeDeletionElement(element);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Wrap an xmldom element in `<w:ins>`.
|
|
88
|
+
*
|
|
89
|
+
* The source element is cloned; the original DOM node is left untouched.
|
|
90
|
+
*/
|
|
91
|
+
export function wrapElementWithIns(element, ctx) {
|
|
92
|
+
const wrapper = createRevisionContainer(getOwnerDocument(element), 'ins', ctx);
|
|
93
|
+
wrapper.appendChild(element.cloneNode(true));
|
|
94
|
+
return wrapper;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Wrap an xmldom element in `<w:del>`.
|
|
98
|
+
*
|
|
99
|
+
* Any descendant `<w:t>` and `<w:instrText>` nodes are converted to the OOXML
|
|
100
|
+
* deletion equivalents before the cloned element is appended.
|
|
101
|
+
*/
|
|
102
|
+
export function wrapElementWithDel(element, ctx) {
|
|
103
|
+
const wrapper = createRevisionContainer(getOwnerDocument(element), 'del', ctx);
|
|
104
|
+
const cloned = prepareElementForDeletion(element.cloneNode(true));
|
|
105
|
+
wrapper.appendChild(cloned);
|
|
106
|
+
return wrapper;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Build a `<w:pPrChange>` wrapper containing the previous paragraph properties.
|
|
110
|
+
*
|
|
111
|
+
* The nested snapshot excludes children that are not valid in `CT_PPrBase`.
|
|
112
|
+
*/
|
|
113
|
+
export function buildPPrChangeElement(oldPPr, ctx) {
|
|
114
|
+
const pPrChange = createWmlElement(getOwnerDocument(oldPPr), 'pPrChange', revisionAttributes(ctx));
|
|
115
|
+
const previousPPr = createWmlElement(getOwnerDocument(oldPPr), 'pPr');
|
|
116
|
+
if (oldPPr) {
|
|
117
|
+
for (const child of childElements(oldPPr)) {
|
|
118
|
+
if (!EXCLUDED_PPR_CHANGE_CHILDREN.has(child.tagName)) {
|
|
119
|
+
previousPPr.appendChild(child.cloneNode(true));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
pPrChange.appendChild(previousPPr);
|
|
124
|
+
return pPrChange;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Build a `<w:trPrChange>` wrapper containing the previous row properties.
|
|
128
|
+
*
|
|
129
|
+
* The nested snapshot excludes children that are not valid in `CT_TrPrBase`.
|
|
130
|
+
*/
|
|
131
|
+
export function buildTrPrChangeElement(oldTrPr, ctx) {
|
|
132
|
+
const trPrChange = createWmlElement(getOwnerDocument(oldTrPr), 'trPrChange', revisionAttributes(ctx));
|
|
133
|
+
const previousTrPr = createWmlElement(getOwnerDocument(oldTrPr), 'trPr');
|
|
134
|
+
if (oldTrPr) {
|
|
135
|
+
for (const child of childElements(oldTrPr)) {
|
|
136
|
+
if (!EXCLUDED_TRPR_CHANGE_CHILDREN.has(child.tagName)) {
|
|
137
|
+
previousTrPr.appendChild(child.cloneNode(true));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
trPrChange.appendChild(previousTrPr);
|
|
142
|
+
return trPrChange;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build a `<w:tcPrChange>` wrapper containing the previous cell properties.
|
|
146
|
+
*
|
|
147
|
+
* The nested snapshot excludes children that are not valid in `CT_TcPrBase`.
|
|
148
|
+
*/
|
|
149
|
+
export function buildTcPrChangeElement(oldTcPr, ctx) {
|
|
150
|
+
const tcPrChange = createWmlElement(getOwnerDocument(oldTcPr), 'tcPrChange', revisionAttributes(ctx));
|
|
151
|
+
const previousTcPr = createWmlElement(getOwnerDocument(oldTcPr), 'tcPr');
|
|
152
|
+
if (oldTcPr) {
|
|
153
|
+
for (const child of childElements(oldTcPr)) {
|
|
154
|
+
if (!EXCLUDED_TCPR_CHANGE_CHILDREN.has(child.tagName)) {
|
|
155
|
+
previousTcPr.appendChild(child.cloneNode(true));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
tcPrChange.appendChild(previousTcPr);
|
|
160
|
+
return tcPrChange;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Build a `<w:rPrChange>` wrapper containing the previous run properties.
|
|
164
|
+
*
|
|
165
|
+
* The nested snapshot excludes any existing `w:rPrChange` child. This filtering
|
|
166
|
+
* is intentional: OOXML does not permit recursively nested `w:rPrChange` (a
|
|
167
|
+
* change-of-a-change is undefined), so the helper drops it. Note this is a
|
|
168
|
+
* stricter contract than the legacy reconstructor's per-child loop, which
|
|
169
|
+
* would have passed a nested `w:rPrChange` through verbatim. The reconstructor
|
|
170
|
+
* still uses its own per-child path; this helper is for new primitive code
|
|
171
|
+
* (#136 onward).
|
|
172
|
+
*/
|
|
173
|
+
export function buildRPrChangeElement(oldRPr, ctx) {
|
|
174
|
+
const rPrChange = createWmlElement(getOwnerDocument(oldRPr), 'rPrChange', revisionAttributes(ctx));
|
|
175
|
+
const previousRPr = createWmlElement(getOwnerDocument(oldRPr), 'rPr');
|
|
176
|
+
if (oldRPr) {
|
|
177
|
+
for (const child of childElements(oldRPr)) {
|
|
178
|
+
if (!EXCLUDED_RPR_CHANGE_CHILDREN.has(child.tagName)) {
|
|
179
|
+
previousRPr.appendChild(child.cloneNode(true));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
rPrChange.appendChild(previousRPr);
|
|
184
|
+
return rPrChange;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Wrap serialized OOXML content in a `<w:ins>` element.
|
|
188
|
+
*
|
|
189
|
+
* This keeps the reconstructor on its string-based emission path while sharing
|
|
190
|
+
* revision metadata handling with the DOM-aware helpers above.
|
|
191
|
+
*/
|
|
192
|
+
export function wrapSerializedContentWithIns(content, ctx) {
|
|
193
|
+
return `${createSerializedRevisionOpenTag('w:ins', ctx)}${content}</w:ins>`;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Wrap serialized OOXML content in a `<w:del>` element.
|
|
197
|
+
*
|
|
198
|
+
* Visible text nodes are rewritten to their deletion-tag equivalents before
|
|
199
|
+
* the wrapper is serialized.
|
|
200
|
+
*/
|
|
201
|
+
export function wrapSerializedContentWithDel(content, ctx) {
|
|
202
|
+
return `${createSerializedRevisionOpenTag('w:del', ctx)}${convertSerializedDeletionContent(content)}</w:del>`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Matches a `<w:t>` or `<w:instrText>` open tag (including the self-closing
|
|
206
|
+
* form). Used as a fast path: content with no convertible tags is returned
|
|
207
|
+
* byte-for-byte unchanged, skipping the parse/serialize round-trip.
|
|
208
|
+
*/
|
|
209
|
+
const CONVERTIBLE_TEXT_TAG = /<w:(?:t|instrText)[\s/>]/;
|
|
210
|
+
/**
|
|
211
|
+
* Convert serialized run content from insertion-style text tags to deletion
|
|
212
|
+
* equivalents (`w:t` -> `w:delText`, `w:instrText` -> `w:delInstrText`).
|
|
213
|
+
*
|
|
214
|
+
* The fragment is parsed into a DOM and renamed via the same traversal as
|
|
215
|
+
* `prepareElementForDeletion`, so attribute order is preserved and shapes a
|
|
216
|
+
* regex sweep mishandles (self-closing `<w:t/>`, attribute values containing
|
|
217
|
+
* `>`) convert correctly. Namespace prefixes the fragment uses without an
|
|
218
|
+
* inline declaration are bound on a temporary wrapper root that is stripped
|
|
219
|
+
* from the returned serialization.
|
|
220
|
+
*
|
|
221
|
+
* @see https://github.com/UseJunior/safe-docx/issues/102
|
|
222
|
+
*/
|
|
223
|
+
export function convertSerializedDeletionContent(content) {
|
|
224
|
+
if (!CONVERTIBLE_TEXT_TAG.test(content)) {
|
|
225
|
+
return content;
|
|
226
|
+
}
|
|
227
|
+
const doc = parseXml(`<root${declareContentPrefixes(content)}>${content}</root>`);
|
|
228
|
+
for (const child of childElements(doc.documentElement)) {
|
|
229
|
+
normalizeDeletionElement(child);
|
|
230
|
+
}
|
|
231
|
+
// Strip the wrapper root: everything between the end of its open tag and
|
|
232
|
+
// the start of its close tag. Safe because the declared URIs contain no '>'.
|
|
233
|
+
const serialized = serializeXml(doc);
|
|
234
|
+
return serialized.slice(serialized.indexOf('>') + 1, serialized.lastIndexOf('<'));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Matches a `prefix:` occurrence in markup context — after `<`, `</`, or
|
|
238
|
+
* whitespace (attribute position). May over-match inside text content, which
|
|
239
|
+
* is harmless: it only yields an unused declaration on the wrapper root.
|
|
240
|
+
*/
|
|
241
|
+
const PREFIX_SCAN = /[<\s]\/?([A-Za-z_][A-Za-z0-9_.-]*):/g;
|
|
242
|
+
/**
|
|
243
|
+
* Build `xmlns` declarations for every namespace prefix a serialized fragment
|
|
244
|
+
* uses, so the fragment parses under a wrapper root (xmldom rejects
|
|
245
|
+
* undeclared prefixes). `w` binds to the real WordprocessingML namespace —
|
|
246
|
+
* the deletion rename produces elements in that namespace — while unknown
|
|
247
|
+
* prefixes get placeholder URIs. The wrapper root carrying these declarations
|
|
248
|
+
* is stripped after serialization, so placeholders never reach the output;
|
|
249
|
+
* fragments serialized from a real document carry their own inline
|
|
250
|
+
* declarations, which take precedence over the wrapper's.
|
|
251
|
+
*/
|
|
252
|
+
function declareContentPrefixes(content) {
|
|
253
|
+
const declarations = new Map([['w', OOXML.W_NS]]);
|
|
254
|
+
for (const match of content.matchAll(PREFIX_SCAN)) {
|
|
255
|
+
const prefix = match[1];
|
|
256
|
+
if (prefix !== 'xml' && prefix !== 'xmlns' && !declarations.has(prefix)) {
|
|
257
|
+
declarations.set(prefix, `urn:safe-docx:undeclared-prefix:${prefix}`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return [...declarations].map(([prefix, uri]) => ` xmlns:${prefix}="${uri}"`).join('');
|
|
261
|
+
}
|
|
262
|
+
function getOwnerDocument(element) {
|
|
263
|
+
return element?.ownerDocument ?? SYNTHETIC_DOC;
|
|
264
|
+
}
|
|
265
|
+
function revisionAttributes(ctx) {
|
|
266
|
+
return {
|
|
267
|
+
'w:id': String(allocateRevisionId(ctx.idState)),
|
|
268
|
+
'w:author': ctx.author,
|
|
269
|
+
'w:date': ctx.date,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function createRevisionWrapperElement(doc, tag, ctx) {
|
|
273
|
+
return createWmlElement(doc, tag, revisionAttributes(ctx));
|
|
274
|
+
}
|
|
275
|
+
function createSerializedRevisionOpenTag(tagName, ctx) {
|
|
276
|
+
const id = allocateRevisionId(ctx.idState);
|
|
277
|
+
return `<${tagName} w:id="${id}" w:author="${escapeXmlAttr(ctx.author)}" w:date="${ctx.date}">`;
|
|
278
|
+
}
|
|
279
|
+
function normalizeDeletionElement(element) {
|
|
280
|
+
for (const child of childElements(element)) {
|
|
281
|
+
normalizeDeletionElement(child);
|
|
282
|
+
}
|
|
283
|
+
if (element.tagName === 'w:t') {
|
|
284
|
+
return renameElement(element, 'w:delText');
|
|
285
|
+
}
|
|
286
|
+
if (element.tagName === 'w:instrText') {
|
|
287
|
+
return renameElement(element, 'w:delInstrText');
|
|
288
|
+
}
|
|
289
|
+
return element;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=track-changes-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track-changes-emitter.js","sourceRoot":"","sources":["../../src/primitives/track-changes-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,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3C,OAAO,IAAI,OAAO,UAAU,EAAE,eAAe,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,GAAG,CAAC,IAAI,IAAI,CAAC;AAClG,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAgB;IAChD,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC9B,OAAO,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;QACtC,OAAO,aAAa,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DocxZip } from './zip.js';
|
|
2
|
+
export type AiRevisionSeverity = 'error' | 'warning';
|
|
3
|
+
export type AiRevisionDiagnostic = {
|
|
4
|
+
severity: AiRevisionSeverity;
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
part?: string;
|
|
8
|
+
element?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
author?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type ValidateAiRevisionsResult = {
|
|
13
|
+
valid: boolean;
|
|
14
|
+
errors: AiRevisionDiagnostic[];
|
|
15
|
+
warnings: AiRevisionDiagnostic[];
|
|
16
|
+
};
|
|
17
|
+
export type AiRevisionValidationTouchedContext = {
|
|
18
|
+
revisionIds?: Iterable<string | number>;
|
|
19
|
+
rangeIds?: Iterable<string | number>;
|
|
20
|
+
relationshipParts?: Iterable<string>;
|
|
21
|
+
sideParts?: Iterable<string>;
|
|
22
|
+
};
|
|
23
|
+
export type AiRevisionStoryInput = {
|
|
24
|
+
part: string;
|
|
25
|
+
doc: Document;
|
|
26
|
+
};
|
|
27
|
+
export type ValidateAiRevisionsOptions = {
|
|
28
|
+
aiAuthor: string;
|
|
29
|
+
stories: AiRevisionStoryInput[];
|
|
30
|
+
packageZip?: DocxZip;
|
|
31
|
+
touched?: AiRevisionValidationTouchedContext;
|
|
32
|
+
};
|
|
33
|
+
export declare function validateAiRevisions(options: ValidateAiRevisionsOptions): Promise<ValidateAiRevisionsResult>;
|
|
34
|
+
export declare const AI_REVISION_VALIDATION_STORY_PARTS: readonly ["word/footnotes.xml", "word/endnotes.xml", "word/comments.xml", "word/glossary/document.xml"];
|
|
35
|
+
//# sourceMappingURL=validate_ai_revisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate_ai_revisions.d.ts","sourceRoot":"","sources":["../../src/primitives/validate_ai_revisions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAcnC,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,QAAQ,EAAE,oBAAoB,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,kCAAkC,CAAC;CAC9C,CAAC;AAoVF,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,yBAAyB,CAAC,CAgCpC;AAED,eAAO,MAAM,kCAAkC,yGAA4B,CAAC"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { parseXml, serializeXml } from './xml.js';
|
|
3
|
+
import { OOXML } from './namespaces.js';
|
|
4
|
+
import { REVISION_SIDE_PART_PATHS, REVISION_STORY_PART_PATHS, } from './revision-parts.js';
|
|
5
|
+
import { REVISION_RANGE_ELEMENT_NAMES, TRACKED_CHANGE_ELEMENT_NAMES, } from './revision-vocabulary.js';
|
|
6
|
+
import { collectFieldStructureIssues, } from '../shared/field-structure.js';
|
|
7
|
+
const W_NS = OOXML.W_NS;
|
|
8
|
+
const REL_NS = OOXML.REL_NS;
|
|
9
|
+
const CT_NS = OOXML.CT_NS;
|
|
10
|
+
const FULL_REVISION_ATTRS = ['id', 'author', 'date'];
|
|
11
|
+
const ID_ONLY_REVISION_ATTRS = ['id'];
|
|
12
|
+
/**
|
|
13
|
+
* Range-end milestones (OOXML CT_MarkupRange / CT_Markup) carry only w:id —
|
|
14
|
+
* unlike their *RangeStart counterparts (OOXML CT_TrackChange / CT_Bookmark),
|
|
15
|
+
* they have no w:author or w:date attribute.
|
|
16
|
+
*/
|
|
17
|
+
const ID_ONLY_REVISION_ELEMENT_NAMES = new Set(REVISION_RANGE_ELEMENT_NAMES.filter((name) => name.endsWith('RangeEnd')));
|
|
18
|
+
const RANGE_PAIRS = [
|
|
19
|
+
{ start: 'moveFromRangeStart', end: 'moveFromRangeEnd' },
|
|
20
|
+
{ start: 'moveToRangeStart', end: 'moveToRangeEnd' },
|
|
21
|
+
{ start: 'commentRangeStart', end: 'commentRangeEnd' },
|
|
22
|
+
{ start: 'permStart', end: 'permEnd' },
|
|
23
|
+
{ start: 'customXmlInsRangeStart', end: 'customXmlInsRangeEnd' },
|
|
24
|
+
{ start: 'customXmlDelRangeStart', end: 'customXmlDelRangeEnd' },
|
|
25
|
+
{ start: 'customXmlMoveFromRangeStart', end: 'customXmlMoveFromRangeEnd' },
|
|
26
|
+
{ start: 'customXmlMoveToRangeStart', end: 'customXmlMoveToRangeEnd' },
|
|
27
|
+
{ start: 'bookmarkStart', end: 'bookmarkEnd' },
|
|
28
|
+
];
|
|
29
|
+
const TRACKED_CHANGE_PLACEMENTS = {
|
|
30
|
+
cellIns: ['tcPr'],
|
|
31
|
+
cellDel: ['tcPr'],
|
|
32
|
+
cellMerge: ['tcPr'],
|
|
33
|
+
tblGridChange: ['tblGrid'],
|
|
34
|
+
sectPrChange: ['sectPr'],
|
|
35
|
+
numberingChange: ['pPr', 'rPr'],
|
|
36
|
+
};
|
|
37
|
+
function toStringSet(values) {
|
|
38
|
+
const set = new Set();
|
|
39
|
+
if (!values)
|
|
40
|
+
return set;
|
|
41
|
+
for (const value of values)
|
|
42
|
+
set.add(String(value));
|
|
43
|
+
return set;
|
|
44
|
+
}
|
|
45
|
+
function getWAttr(el, localName) {
|
|
46
|
+
return el.getAttributeNS(W_NS, localName) ?? el.getAttribute(`w:${localName}`) ?? el.getAttribute(localName);
|
|
47
|
+
}
|
|
48
|
+
function allW(doc, localName) {
|
|
49
|
+
return Array.from(doc.getElementsByTagNameNS(W_NS, localName));
|
|
50
|
+
}
|
|
51
|
+
function parentLocalName(el) {
|
|
52
|
+
let node = el.parentNode;
|
|
53
|
+
while (node) {
|
|
54
|
+
if (node.nodeType === 1)
|
|
55
|
+
return node.localName;
|
|
56
|
+
node = node.parentNode;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
function classifyRevision(el, aiAuthor, touchedRevisionIds) {
|
|
61
|
+
const author = getWAttr(el, 'author');
|
|
62
|
+
const id = getWAttr(el, 'id');
|
|
63
|
+
const isAi = author === aiAuthor || (id !== null && touchedRevisionIds.has(id));
|
|
64
|
+
return { severity: isAi ? 'error' : 'warning', author, id };
|
|
65
|
+
}
|
|
66
|
+
function push(out, diagnostic) {
|
|
67
|
+
out.push(diagnostic);
|
|
68
|
+
}
|
|
69
|
+
function isIntegerString(value) {
|
|
70
|
+
return value !== null && /^(?:0|[1-9]\d*)$/.test(value);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* OOXML ST_DateTime is xsd:dateTime — full date-time with optional fractional
|
|
74
|
+
* seconds and timezone. Date.parse alone is too lax (it accepts "2026" and
|
|
75
|
+
* RFC 1123 dates, which Word rejects).
|
|
76
|
+
*/
|
|
77
|
+
const XSD_DATETIME_PATTERN = /^-?\d{4,}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/;
|
|
78
|
+
function isValidDate(value) {
|
|
79
|
+
if (!value)
|
|
80
|
+
return false;
|
|
81
|
+
return XSD_DATETIME_PATTERN.test(value) && Number.isFinite(Date.parse(value));
|
|
82
|
+
}
|
|
83
|
+
function checkRevisionMetadata(story, aiAuthor, touchedRevisionIds, diagnostics, aiIds) {
|
|
84
|
+
const names = [...TRACKED_CHANGE_ELEMENT_NAMES, ...REVISION_RANGE_ELEMENT_NAMES];
|
|
85
|
+
for (const localName of names) {
|
|
86
|
+
const idOnly = ID_ONLY_REVISION_ELEMENT_NAMES.has(localName);
|
|
87
|
+
const requiredAttrs = idOnly ? ID_ONLY_REVISION_ATTRS : FULL_REVISION_ATTRS;
|
|
88
|
+
for (const el of allW(story.doc, localName)) {
|
|
89
|
+
const classified = classifyRevision(el, aiAuthor, touchedRevisionIds);
|
|
90
|
+
for (const attr of requiredAttrs) {
|
|
91
|
+
const value = getWAttr(el, attr);
|
|
92
|
+
if (!value) {
|
|
93
|
+
push(diagnostics, {
|
|
94
|
+
severity: classified.severity,
|
|
95
|
+
code: 'REVISION_METADATA_MISSING',
|
|
96
|
+
message: `<w:${localName}> missing required w:${attr}`,
|
|
97
|
+
part: story.part,
|
|
98
|
+
element: `w:${localName}`,
|
|
99
|
+
id: classified.id ?? undefined,
|
|
100
|
+
author: classified.author,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const id = getWAttr(el, 'id');
|
|
105
|
+
if (!isIntegerString(id)) {
|
|
106
|
+
push(diagnostics, {
|
|
107
|
+
severity: classified.severity,
|
|
108
|
+
code: 'REVISION_ID_INVALID',
|
|
109
|
+
message: `<w:${localName}> has non-integer w:id`,
|
|
110
|
+
part: story.part,
|
|
111
|
+
element: `w:${localName}`,
|
|
112
|
+
id: id ?? undefined,
|
|
113
|
+
author: classified.author,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
const date = getWAttr(el, 'date');
|
|
117
|
+
if (!idOnly && !isValidDate(date)) {
|
|
118
|
+
push(diagnostics, {
|
|
119
|
+
severity: classified.severity,
|
|
120
|
+
code: 'REVISION_DATE_INVALID',
|
|
121
|
+
message: `<w:${localName}> has invalid w:date`,
|
|
122
|
+
part: story.part,
|
|
123
|
+
element: `w:${localName}`,
|
|
124
|
+
id: id ?? undefined,
|
|
125
|
+
author: classified.author,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (classified.severity === 'error' && id) {
|
|
129
|
+
const previousPart = aiIds.get(id);
|
|
130
|
+
if (previousPart && previousPart !== story.part) {
|
|
131
|
+
push(diagnostics, {
|
|
132
|
+
severity: 'error',
|
|
133
|
+
code: 'AI_REVISION_ID_DUPLICATE',
|
|
134
|
+
message: `AI revision w:id="${id}" appears in both ${previousPart} and ${story.part}`,
|
|
135
|
+
part: story.part,
|
|
136
|
+
element: `w:${localName}`,
|
|
137
|
+
id,
|
|
138
|
+
author: classified.author,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
aiIds.set(id, story.part);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function checkRangePairs(story, aiAuthor, touchedRangeIds, diagnostics) {
|
|
149
|
+
const collect = (localName, into) => {
|
|
150
|
+
for (const el of allW(story.doc, localName)) {
|
|
151
|
+
const id = getWAttr(el, 'id');
|
|
152
|
+
if (!id || !isIntegerString(id)) {
|
|
153
|
+
const author = getWAttr(el, 'author');
|
|
154
|
+
push(diagnostics, {
|
|
155
|
+
severity: author === aiAuthor || (id !== null && touchedRangeIds.has(id)) ? 'error' : 'warning',
|
|
156
|
+
code: id === null ? 'RANGE_MARKER_ID_MISSING' : 'RANGE_MARKER_ID_INVALID',
|
|
157
|
+
message: id === null
|
|
158
|
+
? `<w:${localName}> missing required w:id`
|
|
159
|
+
: `<w:${localName}> has non-integer w:id`,
|
|
160
|
+
part: story.part,
|
|
161
|
+
element: `w:${localName}`,
|
|
162
|
+
id: id ?? undefined,
|
|
163
|
+
author,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (!id)
|
|
167
|
+
continue;
|
|
168
|
+
const list = into.get(id) ?? [];
|
|
169
|
+
list.push(el);
|
|
170
|
+
into.set(id, list);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
for (const pair of RANGE_PAIRS) {
|
|
174
|
+
const starts = new Map();
|
|
175
|
+
const ends = new Map();
|
|
176
|
+
collect(pair.start, starts);
|
|
177
|
+
collect(pair.end, ends);
|
|
178
|
+
const ids = new Set([...starts.keys(), ...ends.keys()]);
|
|
179
|
+
for (const id of ids) {
|
|
180
|
+
const startCount = starts.get(id)?.length ?? 0;
|
|
181
|
+
const endCount = ends.get(id)?.length ?? 0;
|
|
182
|
+
if (startCount === endCount)
|
|
183
|
+
continue;
|
|
184
|
+
const representative = starts.get(id)?.[0] ?? ends.get(id)?.[0];
|
|
185
|
+
const author = representative ? getWAttr(representative, 'author') : null;
|
|
186
|
+
const severity = author === aiAuthor || touchedRangeIds.has(id) ? 'error' : 'warning';
|
|
187
|
+
push(diagnostics, {
|
|
188
|
+
severity,
|
|
189
|
+
code: 'RANGE_PAIR_UNBALANCED',
|
|
190
|
+
message: `<w:${pair.start}>/<w:${pair.end}> pair id="${id}" is unbalanced`,
|
|
191
|
+
part: story.part,
|
|
192
|
+
element: `w:${pair.start}`,
|
|
193
|
+
id,
|
|
194
|
+
author,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function checkFieldStructure(story, diagnostics) {
|
|
200
|
+
const fieldStory = { label: story.part, xml: serializeXml(story.doc) };
|
|
201
|
+
for (const issue of collectFieldStructureIssues([fieldStory])) {
|
|
202
|
+
push(diagnostics, {
|
|
203
|
+
severity: 'error',
|
|
204
|
+
code: issue.code,
|
|
205
|
+
message: issue.message,
|
|
206
|
+
part: story.part,
|
|
207
|
+
element: issue.element,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function checkPlacement(story, aiAuthor, touchedRevisionIds, diagnostics) {
|
|
212
|
+
for (const [localName, allowedParents] of Object.entries(TRACKED_CHANGE_PLACEMENTS)) {
|
|
213
|
+
for (const el of allW(story.doc, localName)) {
|
|
214
|
+
const parent = parentLocalName(el);
|
|
215
|
+
if (parent && allowedParents.includes(parent))
|
|
216
|
+
continue;
|
|
217
|
+
const classified = classifyRevision(el, aiAuthor, touchedRevisionIds);
|
|
218
|
+
push(diagnostics, {
|
|
219
|
+
severity: classified.severity,
|
|
220
|
+
code: 'REVISION_PLACEMENT_INVALID',
|
|
221
|
+
message: `<w:${localName}> must appear under ${allowedParents.map((x) => `w:${x}`).join(' or ')}`,
|
|
222
|
+
part: story.part,
|
|
223
|
+
element: `w:${localName}`,
|
|
224
|
+
id: classified.id ?? undefined,
|
|
225
|
+
author: classified.author,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function relsSourceBase(relsPath) {
|
|
231
|
+
if (relsPath === '_rels/.rels')
|
|
232
|
+
return '';
|
|
233
|
+
const marker = '/_rels/';
|
|
234
|
+
const idx = relsPath.indexOf(marker);
|
|
235
|
+
if (idx < 0)
|
|
236
|
+
return path.posix.dirname(relsPath);
|
|
237
|
+
return relsPath.slice(0, idx);
|
|
238
|
+
}
|
|
239
|
+
function resolveRelationshipTarget(relsPath, target) {
|
|
240
|
+
const base = relsSourceBase(relsPath);
|
|
241
|
+
return path.posix.normalize(path.posix.join(base, target)).replace(/^\.\//, '');
|
|
242
|
+
}
|
|
243
|
+
async function checkPackageInvariants(zip, touchedRelationshipParts, touchedSideParts, diagnostics) {
|
|
244
|
+
for (const fileName of zip.listFiles()) {
|
|
245
|
+
if (!fileName.endsWith('.rels'))
|
|
246
|
+
continue;
|
|
247
|
+
if (touchedRelationshipParts.size > 0 && !touchedRelationshipParts.has(fileName))
|
|
248
|
+
continue;
|
|
249
|
+
const relsXml = await zip.readTextOrNull(fileName);
|
|
250
|
+
if (!relsXml)
|
|
251
|
+
continue;
|
|
252
|
+
const relsDoc = parseXml(relsXml);
|
|
253
|
+
for (const rel of Array.from(relsDoc.getElementsByTagNameNS(REL_NS, 'Relationship'))) {
|
|
254
|
+
const target = rel.getAttribute('Target');
|
|
255
|
+
if (!target)
|
|
256
|
+
continue;
|
|
257
|
+
if (rel.getAttribute('TargetMode') === 'External')
|
|
258
|
+
continue;
|
|
259
|
+
const resolved = resolveRelationshipTarget(fileName, target);
|
|
260
|
+
if (!zip.hasFile(resolved)) {
|
|
261
|
+
push(diagnostics, {
|
|
262
|
+
severity: touchedRelationshipParts.has(fileName) ? 'error' : 'warning',
|
|
263
|
+
code: 'RELATIONSHIP_TARGET_MISSING',
|
|
264
|
+
message: `Relationship target '${target}' resolves to missing package part '${resolved}'`,
|
|
265
|
+
part: fileName,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const sidePartsToCheck = touchedSideParts.size > 0
|
|
271
|
+
? [...touchedSideParts]
|
|
272
|
+
: REVISION_SIDE_PART_PATHS.filter((part) => zip.hasFile(part));
|
|
273
|
+
if (sidePartsToCheck.length === 0)
|
|
274
|
+
return;
|
|
275
|
+
const contentTypesXml = await zip.readTextOrNull('[Content_Types].xml');
|
|
276
|
+
const overrides = new Set();
|
|
277
|
+
if (contentTypesXml) {
|
|
278
|
+
const ctDoc = parseXml(contentTypesXml);
|
|
279
|
+
for (const override of Array.from(ctDoc.getElementsByTagNameNS(CT_NS, 'Override'))) {
|
|
280
|
+
const partName = override.getAttribute('PartName');
|
|
281
|
+
if (partName)
|
|
282
|
+
overrides.add(partName.replace(/^\//, ''));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
for (const part of sidePartsToCheck) {
|
|
286
|
+
if (!zip.hasFile(part))
|
|
287
|
+
continue;
|
|
288
|
+
if (!overrides.has(part)) {
|
|
289
|
+
push(diagnostics, {
|
|
290
|
+
severity: touchedSideParts.has(part) ? 'error' : 'warning',
|
|
291
|
+
code: 'SIDE_PART_CONTENT_TYPE_MISSING',
|
|
292
|
+
message: `Created side part '${part}' is missing a [Content_Types].xml Override`,
|
|
293
|
+
part,
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export async function validateAiRevisions(options) {
|
|
299
|
+
const touchedRevisionIds = toStringSet(options.touched?.revisionIds);
|
|
300
|
+
const touchedRangeIds = toStringSet(options.touched?.rangeIds);
|
|
301
|
+
const touchedRelationshipParts = toStringSet(options.touched?.relationshipParts);
|
|
302
|
+
const touchedSideParts = toStringSet(options.touched?.sideParts);
|
|
303
|
+
const diagnostics = [];
|
|
304
|
+
const aiIds = new Map();
|
|
305
|
+
for (const story of options.stories) {
|
|
306
|
+
checkRevisionMetadata(story, options.aiAuthor, touchedRevisionIds, diagnostics, aiIds);
|
|
307
|
+
checkRangePairs(story, options.aiAuthor, touchedRangeIds, diagnostics);
|
|
308
|
+
checkFieldStructure(story, diagnostics);
|
|
309
|
+
checkPlacement(story, options.aiAuthor, touchedRevisionIds, diagnostics);
|
|
310
|
+
}
|
|
311
|
+
if (options.packageZip) {
|
|
312
|
+
await checkPackageInvariants(options.packageZip, touchedRelationshipParts, touchedSideParts, diagnostics);
|
|
313
|
+
}
|
|
314
|
+
const errors = diagnostics.filter((d) => d.severity === 'error');
|
|
315
|
+
const warnings = diagnostics.filter((d) => d.severity === 'warning');
|
|
316
|
+
return {
|
|
317
|
+
valid: errors.length === 0,
|
|
318
|
+
errors,
|
|
319
|
+
warnings,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export const AI_REVISION_VALIDATION_STORY_PARTS = REVISION_STORY_PART_PATHS;
|
|
323
|
+
//# sourceMappingURL=validate_ai_revisions.js.map
|