@yadsh/dsh-qa-surface 0.4.0 → 0.6.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/README.md +235 -14
- package/compatibility.json +10 -1
- package/cordis.patch.yml +17 -0
- package/lib/account-remotes.js +10 -0
- package/lib/account-remotes.js.map +1 -1
- package/lib/accounts/credentials.js +12 -4
- package/lib/accounts/credentials.js.map +1 -1
- package/lib/accounts/errors.js.map +1 -1
- package/lib/accounts/file.js.map +1 -1
- package/lib/accounts/store.js +38 -1
- package/lib/accounts/store.js.map +1 -1
- package/lib/approvals.js +179 -0
- package/lib/approvals.js.map +1 -0
- package/lib/cli.js +10 -0
- package/lib/cli.js.map +1 -1
- package/lib/client/QaAccountsController.js +29 -0
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaSessionController.js +261 -48
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +138 -56
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaSurfaceGuard.js +96 -0
- package/lib/client/QaSurfaceGuard.js.map +1 -0
- package/lib/client/QaTranscriptAdapter.js +11 -5
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/approvals.js +104 -0
- package/lib/client/approvals.js.map +1 -0
- package/lib/client/attestation.js +3 -0
- package/lib/client/attestation.js.map +1 -1
- package/lib/client/components/QaApproval.js +23 -0
- package/lib/client/components/QaApproval.js.map +1 -0
- package/lib/client/components/QaChangelog.js +55 -0
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaComposer.js +1 -1
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaHeader.js +2 -8
- package/lib/client/components/QaHeader.js.map +1 -1
- package/lib/client/components/QaMessage.js +20 -7
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaModal.js +24 -6
- package/lib/client/components/QaModal.js.map +1 -1
- package/lib/client/components/QaQuestions.js +96 -0
- package/lib/client/components/QaQuestions.js.map +1 -0
- package/lib/client/components/QaSidebar.js +2 -6
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaSourcesPanel.js +6 -5
- package/lib/client/components/QaSourcesPanel.js.map +1 -1
- package/lib/client/components/QaWidthHandle.js +21 -1
- package/lib/client/components/QaWidthHandle.js.map +1 -1
- package/lib/client/components/surface-utils.js +2 -0
- package/lib/client/components/surface-utils.js.map +1 -1
- package/lib/client/index.js +81 -22
- package/lib/client/index.js.map +1 -1
- package/lib/client/panels/PanelHost.js +209 -0
- package/lib/client/panels/PanelHost.js.map +1 -0
- package/lib/client/panels/PanelLauncher.js +39 -0
- package/lib/client/panels/PanelLauncher.js.map +1 -0
- package/lib/client/panels/contract.js +2 -0
- package/lib/client/panels/contract.js.map +1 -0
- package/lib/client/panels/index.js +2 -0
- package/lib/client/panels/index.js.map +1 -0
- package/lib/client/panels/registry.js +171 -0
- package/lib/client/panels/registry.js.map +1 -0
- package/lib/client/project-session-state.js +8 -3
- package/lib/client/project-session-state.js.map +1 -1
- package/lib/client/questions.js +114 -0
- package/lib/client/questions.js.map +1 -0
- package/lib/client/settings/card.js +2 -2
- package/lib/client/settings/card.js.map +1 -1
- package/lib/client/settings/sections/accounts.js +3 -1
- package/lib/client/settings/sections/accounts.js.map +1 -1
- package/lib/client/settings/sections/documents.js +88 -0
- package/lib/client/settings/sections/documents.js.map +1 -0
- package/lib/client/settings/sections/interface.js +2 -0
- package/lib/client/settings/sections/interface.js.map +1 -1
- package/lib/client/settings/sections/sources.js +2 -0
- package/lib/client/settings/sections/sources.js.map +1 -1
- package/lib/client/settings/sections.js +1 -0
- package/lib/client/settings/sections.js.map +1 -1
- package/lib/client/settings-extensions/contract.js +2 -0
- package/lib/client/settings-extensions/contract.js.map +1 -0
- package/lib/client/settings-extensions/index.js +2 -0
- package/lib/client/settings-extensions/index.js.map +1 -0
- package/lib/client/settings-extensions/registry.js +63 -0
- package/lib/client/settings-extensions/registry.js.map +1 -0
- package/lib/client/settlement.js +51 -5
- package/lib/client/settlement.js.map +1 -1
- package/lib/client/source-preview.js +24 -0
- package/lib/client/source-preview.js.map +1 -0
- package/lib/client/styles.js +199 -32
- package/lib/client/styles.js.map +1 -1
- package/lib/client/subagent-codenames.js +109 -0
- package/lib/client/subagent-codenames.js.map +1 -0
- package/lib/client/types.js +3 -0
- package/lib/client/types.js.map +1 -1
- package/lib/client/user-settings/GeneralSettingsPage.js +13 -0
- package/lib/client/user-settings/GeneralSettingsPage.js.map +1 -0
- package/lib/client/user-settings/ProfileSettingsPage.js +59 -0
- package/lib/client/user-settings/ProfileSettingsPage.js.map +1 -0
- package/lib/client/user-settings/SkillCatalog.js +23 -0
- package/lib/client/user-settings/SkillCatalog.js.map +1 -0
- package/lib/client/user-settings/SkillEditor.js +89 -0
- package/lib/client/user-settings/SkillEditor.js.map +1 -0
- package/lib/client/user-settings/SkillToolPicker.js +58 -0
- package/lib/client/user-settings/SkillToolPicker.js.map +1 -0
- package/lib/client/user-settings/SkillsSettingsPage.js +171 -0
- package/lib/client/user-settings/SkillsSettingsPage.js.map +1 -0
- package/lib/client/user-settings/StartersSettingsPage.js +78 -0
- package/lib/client/user-settings/StartersSettingsPage.js.map +1 -0
- package/lib/client/user-settings/UserSettingsDialog.js +50 -0
- package/lib/client/user-settings/UserSettingsDialog.js.map +1 -0
- package/lib/client/user-settings/copy.js +84 -0
- package/lib/client/user-settings/copy.js.map +1 -0
- package/lib/client/user-settings/draft.js +127 -0
- package/lib/client/user-settings/draft.js.map +1 -0
- package/lib/client/user-settings/fields.js +24 -0
- package/lib/client/user-settings/fields.js.map +1 -0
- package/lib/client.js +6629 -1579
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/accounts.js +30 -0
- package/lib/config-resolvers/accounts.js.map +1 -1
- package/lib/config-resolvers/basics.js +4 -2
- package/lib/config-resolvers/basics.js.map +1 -1
- package/lib/config-resolvers/defaults.js +27 -0
- package/lib/config-resolvers/defaults.js.map +1 -1
- package/lib/config-resolvers/lockdown.js +11 -0
- package/lib/config-resolvers/lockdown.js.map +1 -1
- package/lib/config-resolvers/session.js +2 -2
- package/lib/config-resolvers/session.js.map +1 -1
- package/lib/config-resolvers/shared.js +9 -0
- package/lib/config-resolvers/shared.js.map +1 -1
- package/lib/config-resolvers/sources.js +2 -0
- package/lib/config-resolvers/sources.js.map +1 -1
- package/lib/config-resolvers/tools.js +37 -0
- package/lib/config-resolvers/tools.js.map +1 -0
- package/lib/config-resolvers/ui.js +2 -0
- package/lib/config-resolvers/ui.js.map +1 -1
- package/lib/config.js +299 -2
- package/lib/config.js.map +1 -1
- package/lib/documents/artifacts/ids.js +43 -0
- package/lib/documents/artifacts/ids.js.map +1 -0
- package/lib/documents/artifacts/manifest.js +66 -0
- package/lib/documents/artifacts/manifest.js.map +1 -0
- package/lib/documents/artifacts/store.js +169 -0
- package/lib/documents/artifacts/store.js.map +1 -0
- package/lib/documents/capabilities.js +93 -0
- package/lib/documents/capabilities.js.map +1 -0
- package/lib/documents/config.js +302 -0
- package/lib/documents/config.js.map +1 -0
- package/lib/documents/defaults.js +78 -0
- package/lib/documents/defaults.js.map +1 -0
- package/lib/documents/errors.js +101 -0
- package/lib/documents/errors.js.map +1 -0
- package/lib/documents/index.js +80 -0
- package/lib/documents/index.js.map +1 -0
- package/lib/documents/inspect/facts.js +161 -0
- package/lib/documents/inspect/facts.js.map +1 -0
- package/lib/documents/inspect/zip.js +108 -0
- package/lib/documents/inspect/zip.js.map +1 -0
- package/lib/documents/markdown/directives.js +135 -0
- package/lib/documents/markdown/directives.js.map +1 -0
- package/lib/documents/markdown/frontmatter.js +35 -0
- package/lib/documents/markdown/frontmatter.js.map +1 -0
- package/lib/documents/markdown/normalize.js +113 -0
- package/lib/documents/markdown/normalize.js.map +1 -0
- package/lib/documents/orchestrator/assets.js +243 -0
- package/lib/documents/orchestrator/assets.js.map +1 -0
- package/lib/documents/orchestrator/convert-document.js +186 -0
- package/lib/documents/orchestrator/convert-document.js.map +1 -0
- package/lib/documents/orchestrator/create-document.js +292 -0
- package/lib/documents/orchestrator/create-document.js.map +1 -0
- package/lib/documents/orchestrator/extract-document.js +162 -0
- package/lib/documents/orchestrator/extract-document.js.map +1 -0
- package/lib/documents/orchestrator/inspect-document.js +89 -0
- package/lib/documents/orchestrator/inspect-document.js.map +1 -0
- package/lib/documents/orchestrator/runtime-deps.js +59 -0
- package/lib/documents/orchestrator/runtime-deps.js.map +1 -0
- package/lib/documents/orchestrator/scope.js +132 -0
- package/lib/documents/orchestrator/scope.js.map +1 -0
- package/lib/documents/providers/docling.js +247 -0
- package/lib/documents/providers/docling.js.map +1 -0
- package/lib/documents/providers/libreoffice.js +130 -0
- package/lib/documents/providers/libreoffice.js.map +1 -0
- package/lib/documents/providers/markitdown.js +89 -0
- package/lib/documents/providers/markitdown.js.map +1 -0
- package/lib/documents/providers/pandoc.js +161 -0
- package/lib/documents/providers/pandoc.js.map +1 -0
- package/lib/documents/providers/process.js +164 -0
- package/lib/documents/providers/process.js.map +1 -0
- package/lib/documents/providers/registry.js +152 -0
- package/lib/documents/providers/registry.js.map +1 -0
- package/lib/documents/providers/shared.js +75 -0
- package/lib/documents/providers/shared.js.map +1 -0
- package/lib/documents/runtime.js +114 -0
- package/lib/documents/runtime.js.map +1 -0
- package/lib/documents/security/file-types.js +188 -0
- package/lib/documents/security/file-types.js.map +1 -0
- package/lib/documents/security/limits.js +78 -0
- package/lib/documents/security/limits.js.map +1 -0
- package/lib/documents/security/mime.js +43 -0
- package/lib/documents/security/mime.js.map +1 -0
- package/lib/documents/security/paths.js +133 -0
- package/lib/documents/security/paths.js.map +1 -0
- package/lib/documents/templates/registry.js +147 -0
- package/lib/documents/templates/registry.js.map +1 -0
- package/lib/documents/templates/resolver.js +59 -0
- package/lib/documents/templates/resolver.js.map +1 -0
- package/lib/documents/tools/convert.js +125 -0
- package/lib/documents/tools/convert.js.map +1 -0
- package/lib/documents/tools/create.js +187 -0
- package/lib/documents/tools/create.js.map +1 -0
- package/lib/documents/tools/index.js +41 -0
- package/lib/documents/tools/index.js.map +1 -0
- package/lib/documents/tools/inspect.js +135 -0
- package/lib/documents/tools/inspect.js.map +1 -0
- package/lib/documents/tools/shared.js +88 -0
- package/lib/documents/tools/shared.js.map +1 -0
- package/lib/documents/tools/to-markdown.js +125 -0
- package/lib/documents/tools/to-markdown.js.map +1 -0
- package/lib/documents/types.js +12 -0
- package/lib/documents/types.js.map +1 -0
- package/lib/index.js +299 -24
- package/lib/index.js.map +1 -1
- package/lib/integration-principals.js +22 -0
- package/lib/integration-principals.js.map +1 -0
- package/lib/lockdown-policy.js +15 -3
- package/lib/lockdown-policy.js.map +1 -1
- package/lib/personal-skills/errors.js +9 -0
- package/lib/personal-skills/errors.js.map +1 -0
- package/lib/personal-skills/host.js +80 -0
- package/lib/personal-skills/host.js.map +1 -0
- package/lib/personal-skills/index.js +10 -0
- package/lib/personal-skills/index.js.map +1 -0
- package/lib/personal-skills/paths.js +127 -0
- package/lib/personal-skills/paths.js.map +1 -0
- package/lib/personal-skills/provider.js +109 -0
- package/lib/personal-skills/provider.js.map +1 -0
- package/lib/personal-skills/remotes.js +40 -0
- package/lib/personal-skills/remotes.js.map +1 -0
- package/lib/personal-skills/service.js +686 -0
- package/lib/personal-skills/service.js.map +1 -0
- package/lib/personal-skills/skill-file.js +278 -0
- package/lib/personal-skills/skill-file.js.map +1 -0
- package/lib/personal-skills/skill-format.js +202 -0
- package/lib/personal-skills/skill-format.js.map +1 -0
- package/lib/personal-skills/watcher.js +96 -0
- package/lib/personal-skills/watcher.js.map +1 -0
- package/lib/profile.js +6 -4
- package/lib/profile.js.map +1 -1
- package/lib/prompt-notes.js +19 -0
- package/lib/prompt-notes.js.map +1 -1
- package/lib/provenance/file-preview.js +68 -21
- package/lib/provenance/file-preview.js.map +1 -1
- package/lib/provenance/host-store.js +69 -20
- package/lib/provenance/host-store.js.map +1 -1
- package/lib/provenance/index.js +1 -0
- package/lib/provenance/index.js.map +1 -1
- package/lib/provenance/normalize.js +3 -1
- package/lib/provenance/normalize.js.map +1 -1
- package/lib/provenance/reported.js +37 -12
- package/lib/provenance/reported.js.map +1 -1
- package/lib/provenance/snapshot-store.js +154 -0
- package/lib/provenance/snapshot-store.js.map +1 -0
- package/lib/qa-tools/activation-detector.js +53 -0
- package/lib/qa-tools/activation-detector.js.map +1 -0
- package/lib/qa-tools/activation-manager.js +111 -0
- package/lib/qa-tools/activation-manager.js.map +1 -0
- package/lib/qa-tools/catalog.js +108 -0
- package/lib/qa-tools/catalog.js.map +1 -0
- package/lib/qa-tools/durable-marker.js +115 -0
- package/lib/qa-tools/durable-marker.js.map +1 -0
- package/lib/qa-tools/index.js +83 -0
- package/lib/qa-tools/index.js.map +1 -0
- package/lib/qa-tools/lifecycle.js +64 -0
- package/lib/qa-tools/lifecycle.js.map +1 -0
- package/lib/qa-tools/types.js +2 -0
- package/lib/qa-tools/types.js.map +1 -0
- package/lib/questions.js +185 -0
- package/lib/questions.js.map +1 -0
- package/lib/resolve-config.js +5 -0
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +104 -20
- package/lib/secure-session.js.map +1 -1
- package/lib/session-ownership.js +55 -0
- package/lib/session-ownership.js.map +1 -0
- package/lib/starters.js +117 -0
- package/lib/starters.js.map +1 -0
- package/lib/typert.host.js +1162 -77
- package/lib/typert.remote-client.d.ts +27 -1
- package/lib/typert.remote-client.js +879 -14
- package/lib/types/account-remotes.d.ts +3 -1
- package/lib/types/accounts/credentials.d.ts +6 -0
- package/lib/types/accounts/errors.d.ts +1 -1
- package/lib/types/accounts/file.d.ts +10 -0
- package/lib/types/accounts/store.d.ts +15 -1
- package/lib/types/approvals.d.ts +65 -0
- package/lib/types/client/QaAccountsController.d.ts +7 -1
- package/lib/types/client/QaSessionController.d.ts +50 -1
- package/lib/types/client/QaSurface.d.ts +21 -4
- package/lib/types/client/QaSurfaceGuard.d.ts +27 -0
- package/lib/types/client/QaTranscriptAdapter.d.ts +7 -0
- package/lib/types/client/approvals.d.ts +39 -0
- package/lib/types/client/components/QaApproval.d.ts +13 -0
- package/lib/types/client/components/QaComposer.d.ts +3 -1
- package/lib/types/client/components/QaHeader.d.ts +3 -1
- package/lib/types/client/components/QaModal.d.ts +5 -4
- package/lib/types/client/components/QaQuestions.d.ts +13 -0
- package/lib/types/client/components/QaSidebar.d.ts +8 -11
- package/lib/types/client/components/QaWidthHandle.d.ts +13 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/panels/PanelHost.d.ts +18 -0
- package/lib/types/client/panels/PanelLauncher.d.ts +5 -0
- package/lib/types/client/panels/contract.d.ts +83 -0
- package/lib/types/client/panels/index.d.ts +3 -0
- package/lib/types/client/panels/registry.d.ts +40 -0
- package/lib/types/client/project-session-state.d.ts +13 -1
- package/lib/types/client/questions.d.ts +45 -0
- package/lib/types/client/settings/sections/documents.d.ts +13 -0
- package/lib/types/client/settings/sections.d.ts +1 -0
- package/lib/types/client/settings-extensions/contract.d.ts +32 -0
- package/lib/types/client/settings-extensions/index.d.ts +3 -0
- package/lib/types/client/settings-extensions/registry.d.ts +15 -0
- package/lib/types/client/settlement.d.ts +41 -5
- package/lib/types/client/source-preview.d.ts +8 -0
- package/lib/types/client/styles.d.ts +2 -0
- package/lib/types/client/subagent-codenames.d.ts +18 -0
- package/lib/types/client/types.d.ts +82 -3
- package/lib/types/client/user-settings/GeneralSettingsPage.d.ts +14 -0
- package/lib/types/client/user-settings/ProfileSettingsPage.d.ts +18 -0
- package/lib/types/client/user-settings/SkillCatalog.d.ts +16 -0
- package/lib/types/client/user-settings/SkillEditor.d.ts +42 -0
- package/lib/types/client/user-settings/SkillToolPicker.d.ts +17 -0
- package/lib/types/client/user-settings/SkillsSettingsPage.d.ts +15 -0
- package/lib/types/client/user-settings/StartersSettingsPage.d.ts +14 -0
- package/lib/types/client/user-settings/UserSettingsDialog.d.ts +43 -0
- package/lib/types/client/user-settings/copy.d.ts +25 -0
- package/lib/types/client/user-settings/draft.d.ts +51 -0
- package/lib/types/client/user-settings/fields.d.ts +43 -0
- package/lib/types/config-resolvers/shared.d.ts +7 -0
- package/lib/types/config-resolvers/tools.d.ts +6 -0
- package/lib/types/documents/artifacts/ids.d.ts +14 -0
- package/lib/types/documents/artifacts/manifest.d.ts +32 -0
- package/lib/types/documents/artifacts/store.d.ts +67 -0
- package/lib/types/documents/capabilities.d.ts +32 -0
- package/lib/types/documents/config.d.ts +27 -0
- package/lib/types/documents/defaults.d.ts +161 -0
- package/lib/types/documents/errors.d.ts +42 -0
- package/lib/types/documents/index.d.ts +63 -0
- package/lib/types/documents/inspect/facts.d.ts +43 -0
- package/lib/types/documents/inspect/zip.d.ts +28 -0
- package/lib/types/documents/markdown/directives.d.ts +39 -0
- package/lib/types/documents/markdown/frontmatter.d.ts +15 -0
- package/lib/types/documents/markdown/normalize.d.ts +30 -0
- package/lib/types/documents/orchestrator/assets.d.ts +55 -0
- package/lib/types/documents/orchestrator/convert-document.d.ts +25 -0
- package/lib/types/documents/orchestrator/create-document.d.ts +18 -0
- package/lib/types/documents/orchestrator/extract-document.d.ts +24 -0
- package/lib/types/documents/orchestrator/inspect-document.d.ts +12 -0
- package/lib/types/documents/orchestrator/runtime-deps.d.ts +43 -0
- package/lib/types/documents/orchestrator/scope.d.ts +52 -0
- package/lib/types/documents/providers/docling.d.ts +54 -0
- package/lib/types/documents/providers/libreoffice.d.ts +40 -0
- package/lib/types/documents/providers/markitdown.d.ts +28 -0
- package/lib/types/documents/providers/pandoc.d.ts +42 -0
- package/lib/types/documents/providers/process.d.ts +54 -0
- package/lib/types/documents/providers/registry.d.ts +68 -0
- package/lib/types/documents/providers/shared.d.ts +27 -0
- package/lib/types/documents/runtime.d.ts +59 -0
- package/lib/types/documents/security/file-types.d.ts +39 -0
- package/lib/types/documents/security/limits.d.ts +24 -0
- package/lib/types/documents/security/mime.d.ts +13 -0
- package/lib/types/documents/security/paths.d.ts +38 -0
- package/lib/types/documents/templates/registry.d.ts +50 -0
- package/lib/types/documents/templates/resolver.d.ts +30 -0
- package/lib/types/documents/tools/convert.d.ts +9 -0
- package/lib/types/documents/tools/create.d.ts +14 -0
- package/lib/types/documents/tools/index.d.ts +33 -0
- package/lib/types/documents/tools/inspect.d.ts +9 -0
- package/lib/types/documents/tools/shared.d.ts +77 -0
- package/lib/types/documents/tools/to-markdown.d.ts +12 -0
- package/lib/types/documents/types.d.ts +294 -0
- package/lib/types/index.d.ts +103 -5
- package/lib/types/integration-principals.d.ts +9 -0
- package/lib/types/lockdown-policy.d.ts +12 -2
- package/lib/types/personal-skills/errors.d.ts +11 -0
- package/lib/types/personal-skills/host.d.ts +42 -0
- package/lib/types/personal-skills/index.d.ts +10 -0
- package/lib/types/personal-skills/paths.d.ts +39 -0
- package/lib/types/personal-skills/provider.d.ts +33 -0
- package/lib/types/personal-skills/remotes.d.ts +35 -0
- package/lib/types/personal-skills/service.d.ts +131 -0
- package/lib/types/personal-skills/skill-file.d.ts +64 -0
- package/lib/types/personal-skills/skill-format.d.ts +100 -0
- package/lib/types/personal-skills/watcher.d.ts +39 -0
- package/lib/types/profile.d.ts +13 -0
- package/lib/types/prompt-notes.d.ts +9 -0
- package/lib/types/provenance/file-preview.d.ts +47 -4
- package/lib/types/provenance/host-store.d.ts +7 -1
- package/lib/types/provenance/index.d.ts +1 -0
- package/lib/types/provenance/reported.d.ts +9 -1
- package/lib/types/provenance/snapshot-store.d.ts +23 -0
- package/lib/types/qa-tools/activation-detector.d.ts +29 -0
- package/lib/types/qa-tools/activation-manager.d.ts +47 -0
- package/lib/types/qa-tools/catalog.d.ts +40 -0
- package/lib/types/qa-tools/durable-marker.d.ts +16 -0
- package/lib/types/qa-tools/index.d.ts +40 -0
- package/lib/types/qa-tools/lifecycle.d.ts +44 -0
- package/lib/types/qa-tools/types.d.ts +45 -0
- package/lib/types/questions.d.ts +83 -0
- package/lib/types/secure-session.d.ts +45 -4
- package/lib/types/session-ownership.d.ts +30 -0
- package/lib/types/starters.d.ts +45 -0
- package/lib/types/types.d.ts +282 -7
- package/lib/types/user-workspace.d.ts +5 -1
- package/lib/user-workspace.js +21 -6
- package/lib/user-workspace.js.map +1 -1
- package/package.json +22 -9
- package/scripts/repair-session-events.mjs +260 -0
- package/lib/client/components/QaProfile.js +0 -64
- package/lib/client/components/QaProfile.js.map +0 -1
- package/lib/types/client/components/QaProfile.d.ts +0 -25
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document facts read without converting anything (§11).
|
|
3
|
+
*
|
|
4
|
+
* `document_inspect` must be cheap and safe: it reads the bytes it was given
|
|
5
|
+
* and answers what they claim to be. Two tiny readers cover the formats the
|
|
6
|
+
* pipeline supports — a PDF dictionary scan and an OOXML package scan — which
|
|
7
|
+
* is what makes inspect useful on a 400-page file that nobody wants to render.
|
|
8
|
+
*/
|
|
9
|
+
import type { DetectedFormat } from "../types.js";
|
|
10
|
+
export interface PdfFacts {
|
|
11
|
+
readonly pages?: number;
|
|
12
|
+
readonly encrypted: boolean;
|
|
13
|
+
readonly metadata: {
|
|
14
|
+
readonly title?: string;
|
|
15
|
+
readonly author?: string;
|
|
16
|
+
readonly createdAt?: string;
|
|
17
|
+
readonly modifiedAt?: string;
|
|
18
|
+
};
|
|
19
|
+
readonly images?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Read a PDF's page count, encryption flag and document-information entries.
|
|
23
|
+
* This is a scan, not a parser: it is immune to malformed cross-reference
|
|
24
|
+
* tables (a broken PDF still answers "how many pages does it claim"), and it
|
|
25
|
+
* never follows an object stream.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readPdfFacts(buffer: Buffer): PdfFacts;
|
|
28
|
+
export interface DocxFacts {
|
|
29
|
+
readonly headings?: number;
|
|
30
|
+
readonly tables?: number;
|
|
31
|
+
readonly images?: number;
|
|
32
|
+
}
|
|
33
|
+
/** Count document structure from the OOXML package, without rendering it. */
|
|
34
|
+
export declare function readDocxFacts(buffer: Buffer): DocxFacts;
|
|
35
|
+
/** Metadata recorded in `docProps/core.xml`. */
|
|
36
|
+
export declare function readDocxMetadata(buffer: Buffer): {
|
|
37
|
+
readonly title?: string;
|
|
38
|
+
readonly author?: string;
|
|
39
|
+
readonly createdAt?: string;
|
|
40
|
+
readonly modifiedAt?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function mediaTypeOfDetected(format: DetectedFormat): string;
|
|
43
|
+
//# sourceMappingURL=facts.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal ZIP reader (central directory + per-entry inflate).
|
|
3
|
+
*
|
|
4
|
+
* The document pipeline inspects OOXML containers — `document_inspect` counts
|
|
5
|
+
* headings and images, `security/file-types.ts` decides DOCX vs macro-enabled
|
|
6
|
+
* DOCM — and neither may pull a ZIP dependency into the host plugin. Only the
|
|
7
|
+
* two compression methods OOXML writers actually produce are supported
|
|
8
|
+
* (stored and deflate); anything else is reported as unreadable instead of
|
|
9
|
+
* being guessed at.
|
|
10
|
+
*/
|
|
11
|
+
export interface ZipEntry {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly compressionMethod: number;
|
|
14
|
+
readonly compressedSize: number;
|
|
15
|
+
readonly uncompressedSize: number;
|
|
16
|
+
readonly localHeaderOffset: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parse the central directory. Returns `undefined` when the buffer is not a
|
|
20
|
+
* ZIP archive (or is truncated) — the caller decides whether that is an error.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readZipEntries(buffer: Buffer): ZipEntry[] | undefined;
|
|
23
|
+
export declare function findZipEntry(entries: readonly ZipEntry[], name: string): ZipEntry | undefined;
|
|
24
|
+
/** Decompress one entry, or `undefined` when it is unreadable/oversized. */
|
|
25
|
+
export declare function readZipEntry(buffer: Buffer, entry: ZipEntry): Buffer | undefined;
|
|
26
|
+
/** Convenience: read a named entry from an archive in one call. */
|
|
27
|
+
export declare function readZipEntryByName(buffer: Buffer, name: string): Buffer | undefined;
|
|
28
|
+
//# sourceMappingURL=zip.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled document directives (§36).
|
|
3
|
+
*
|
|
4
|
+
* Markdown stays the canonical source, so the few structures Markdown cannot
|
|
5
|
+
* express — a page break, a callout — are written as fences the orchestrator
|
|
6
|
+
* rewrites into the target backend's own representation before the renderer
|
|
7
|
+
* sees the text:
|
|
8
|
+
*
|
|
9
|
+
* ```md
|
|
10
|
+
* :::pagebreak
|
|
11
|
+
* :::
|
|
12
|
+
*
|
|
13
|
+
* :::note
|
|
14
|
+
* Important information.
|
|
15
|
+
* :::
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Anything else is refused rather than passed through: an unknown `:::`
|
|
19
|
+
* directive would otherwise reach pandoc as literal text, and raw markup
|
|
20
|
+
* (HTML, LaTeX, Typst escapes) is only accepted when a deployment explicitly
|
|
21
|
+
* opts in with `documents.create.allowRawMarkup`.
|
|
22
|
+
*/
|
|
23
|
+
import type { DocumentWarning } from "../types.js";
|
|
24
|
+
/** Backends whose directive spelling differs. */
|
|
25
|
+
export type DirectiveBackend = "docx" | "typst";
|
|
26
|
+
export interface DirectiveOptions {
|
|
27
|
+
readonly backend: DirectiveBackend;
|
|
28
|
+
readonly allowRawMarkup: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface DirectiveResult {
|
|
31
|
+
readonly markdown: string;
|
|
32
|
+
readonly warnings: readonly DocumentWarning[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Rewrite directives for one backend. Line-oriented on purpose: a fence that
|
|
36
|
+
* appears inside a code block is content, not a directive.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyDirectives(markdown: string, options: DirectiveOptions): DirectiveResult;
|
|
39
|
+
//# sourceMappingURL=directives.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Front-matter handling (§35).
|
|
3
|
+
*
|
|
4
|
+
* A generated document may carry a leading `---` block with scalar metadata.
|
|
5
|
+
* Only scalars are read: the block feeds document properties and the manifest,
|
|
6
|
+
* never a nested configuration surface, so there is nothing here an author
|
|
7
|
+
* could use to reach a backend option.
|
|
8
|
+
*/
|
|
9
|
+
export interface FrontMatter {
|
|
10
|
+
readonly attributes: Readonly<Record<string, string>>;
|
|
11
|
+
readonly body: string;
|
|
12
|
+
}
|
|
13
|
+
/** Split leading front matter from the body. Malformed lines are ignored. */
|
|
14
|
+
export declare function parseFrontMatter(markdown: string): FrontMatter;
|
|
15
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown normalization for extracted documents (§16).
|
|
3
|
+
*
|
|
4
|
+
* The layer is deliberately conservative: it removes artifacts a converter
|
|
5
|
+
* reliably produces (platform line endings, non-breaking spaces, page-number
|
|
6
|
+
* lines, a running head repeated on every page) and never touches meaning.
|
|
7
|
+
* Guessing missing content is explicitly out of scope, and an LLM pass is not
|
|
8
|
+
* part of this stage at all — a document is never sent to a model to make its
|
|
9
|
+
* Markdown nicer.
|
|
10
|
+
*/
|
|
11
|
+
import type { DocumentWarning } from "../types.js";
|
|
12
|
+
export interface NormalizeOptions {
|
|
13
|
+
/** Drop standalone page-number lines (`12`, `- 12 -`, `Page 12`). */
|
|
14
|
+
readonly stripPageNumbers?: boolean;
|
|
15
|
+
/** Drop short lines repeated on three or more pages. */
|
|
16
|
+
readonly stripRunningHeads?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface NormalizeResult {
|
|
19
|
+
readonly markdown: string;
|
|
20
|
+
readonly warnings: readonly DocumentWarning[];
|
|
21
|
+
}
|
|
22
|
+
/** Normalize extracted Markdown; returns the text and what was changed. */
|
|
23
|
+
export declare function normalizeExtractedMarkdown(markdown: string, options?: NormalizeOptions): NormalizeResult;
|
|
24
|
+
/** Count Markdown structure for `document_inspect` on Markdown inputs. */
|
|
25
|
+
export declare function markdownStructure(markdown: string): {
|
|
26
|
+
headings: number;
|
|
27
|
+
tables: number;
|
|
28
|
+
images: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset preparation and reference auditing (§17.1).
|
|
3
|
+
*
|
|
4
|
+
* Assets reach a document two ways: the caller names a file in the workspace,
|
|
5
|
+
* or it inlines bytes as a data URI. Both are copied into the bundle's
|
|
6
|
+
* `assets/` directory under a name the pipeline chooses, so the rendered
|
|
7
|
+
* document never depends on a path outside the artifact, and the Markdown
|
|
8
|
+
* references are rewritten to match.
|
|
9
|
+
*
|
|
10
|
+
* Before a renderer runs, every image reference in the source is accounted
|
|
11
|
+
* for: a missing local file, a reference that leaves the assets directory, or
|
|
12
|
+
* a remote URL (which the renderer would fetch from the network) is an error,
|
|
13
|
+
* not a silent drop.
|
|
14
|
+
*/
|
|
15
|
+
import type { ResolvedQaDocumentsConfig } from "../config.js";
|
|
16
|
+
import type { DocumentAssetInput, DocumentWarning } from "../types.js";
|
|
17
|
+
import { type ResolvedDocumentScope } from "./scope.js";
|
|
18
|
+
export interface PreparedAsset {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
/** Name inside the bundle's `assets/` directory. */
|
|
21
|
+
readonly fileName: string;
|
|
22
|
+
readonly mediaType: string;
|
|
23
|
+
readonly bytes: number;
|
|
24
|
+
/** How the caller referred to this asset, for reference rewriting. */
|
|
25
|
+
readonly references: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export interface PreparedAssets {
|
|
28
|
+
readonly assets: readonly PreparedAsset[];
|
|
29
|
+
readonly warnings: readonly DocumentWarning[];
|
|
30
|
+
}
|
|
31
|
+
export declare function prepareAssets(assets: readonly DocumentAssetInput[] | undefined, options: {
|
|
32
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
33
|
+
readonly scope: ResolvedDocumentScope;
|
|
34
|
+
readonly assetsDir: string;
|
|
35
|
+
}): Promise<PreparedAssets>;
|
|
36
|
+
/**
|
|
37
|
+
* Rewrite the image references that point at a provided asset to the bundle's
|
|
38
|
+
* own `assets/<name>`, keeping every other reference untouched. Matching is
|
|
39
|
+
* whole-reference (never a substring) and resolves relative spellings against
|
|
40
|
+
* the workspace, so an absolute path and a workspace-relative path to the same
|
|
41
|
+
* file both land on the same asset.
|
|
42
|
+
*/
|
|
43
|
+
export declare function rewriteAssetReferences(markdown: string, assets: readonly PreparedAsset[], options: {
|
|
44
|
+
readonly roots: readonly string[];
|
|
45
|
+
}): string;
|
|
46
|
+
/**
|
|
47
|
+
* Verify every image reference in the Markdown before a renderer can act on
|
|
48
|
+
* it: local files must exist inside the assets directory, and remote URLs are
|
|
49
|
+
* refused because the renderer would fetch them (§26.5).
|
|
50
|
+
*/
|
|
51
|
+
export declare function auditAssetReferences(markdown: string, options: {
|
|
52
|
+
readonly assetsDir: string;
|
|
53
|
+
readonly assets: readonly PreparedAsset[];
|
|
54
|
+
}): Promise<readonly DocumentWarning[]>;
|
|
55
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_convert` orchestration (§10).
|
|
3
|
+
*
|
|
4
|
+
* The route table is explicit and closed:
|
|
5
|
+
*
|
|
6
|
+
* ```text
|
|
7
|
+
* MD → DOCX, PDF
|
|
8
|
+
* DOCX → PDF, MD
|
|
9
|
+
* PDF → MD
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Anything else answers `UNSUPPORTED_CONVERSION` — the pipeline never falls
|
|
13
|
+
* back to "run some shell pipeline and hope", because a conversion the service
|
|
14
|
+
* does not model is a conversion it cannot bound, observe or secure.
|
|
15
|
+
*/
|
|
16
|
+
import type { DocumentConvertInput, DocumentConvertResult, DocumentFormat } from "../types.js";
|
|
17
|
+
import { type DocumentScope } from "./scope.js";
|
|
18
|
+
import { type DocumentRuntimeDeps } from "./runtime-deps.js";
|
|
19
|
+
/** Routes this pipeline implements (source → target). */
|
|
20
|
+
export declare const CONVERSION_ROUTES: readonly (readonly [
|
|
21
|
+
DocumentFormat,
|
|
22
|
+
DocumentFormat
|
|
23
|
+
])[];
|
|
24
|
+
export declare function convertDocument(deps: DocumentRuntimeDeps, input: DocumentConvertInput, scopeInput: DocumentScope): Promise<DocumentConvertResult>;
|
|
25
|
+
//# sourceMappingURL=convert-document.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_create` orchestration (§8, §13, §14, §45).
|
|
3
|
+
*
|
|
4
|
+
* Markdown in, DOCX and/or PDF out, with the source, the assets and a manifest
|
|
5
|
+
* kept beside the results. The orchestration is where the pipeline's promises
|
|
6
|
+
* are actually kept:
|
|
7
|
+
*
|
|
8
|
+
* - the caller picks intent (formats, template name, pdf mode), never a
|
|
9
|
+
* command line;
|
|
10
|
+
* - a failure of the second format does not discard the first — partial
|
|
11
|
+
* success is returned with a warning (§45);
|
|
12
|
+
* - every produced file is fingerprinted and recorded in the manifest.
|
|
13
|
+
*/
|
|
14
|
+
import type { DocumentCreateInput, DocumentCreateResult } from "../types.js";
|
|
15
|
+
import { type DocumentScope } from "./scope.js";
|
|
16
|
+
import { type DocumentRuntimeDeps } from "./runtime-deps.js";
|
|
17
|
+
export declare function createDocument(deps: DocumentRuntimeDeps, input: DocumentCreateInput, scopeInput: DocumentScope): Promise<DocumentCreateResult>;
|
|
18
|
+
//# sourceMappingURL=create-document.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_to_markdown` orchestration (§9, §15, §16).
|
|
3
|
+
*
|
|
4
|
+
* The tool returns the extracted Markdown, and the bundle keeps it: the model
|
|
5
|
+
* may only see a truncated view (a 300-page PDF is not a conversation), while
|
|
6
|
+
* the artifact always carries the full text with its assets and manifest.
|
|
7
|
+
*/
|
|
8
|
+
import type { DocumentToMarkdownInput, DocumentToMarkdownResult, ExtractionMode, OcrMode } from "../types.js";
|
|
9
|
+
import { type DocumentScope } from "./scope.js";
|
|
10
|
+
import { type DocumentRuntimeDeps } from "./runtime-deps.js";
|
|
11
|
+
export type ExtractionOperation = "document_to_markdown" | "document_convert";
|
|
12
|
+
export interface ExtractToMarkdownParams {
|
|
13
|
+
readonly file: string;
|
|
14
|
+
readonly mode?: ExtractionMode;
|
|
15
|
+
readonly ocr?: OcrMode;
|
|
16
|
+
readonly ocrLanguages?: readonly string[];
|
|
17
|
+
readonly extractImages?: boolean;
|
|
18
|
+
readonly extractTables?: boolean;
|
|
19
|
+
readonly preservePageMarkers?: boolean;
|
|
20
|
+
readonly outputFilename?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function extractToMarkdown(deps: DocumentRuntimeDeps, params: ExtractToMarkdownParams, scopeInput: DocumentScope, operation: ExtractionOperation): Promise<DocumentToMarkdownResult>;
|
|
23
|
+
export declare function toMarkdown(deps: DocumentRuntimeDeps, input: DocumentToMarkdownInput, scope: DocumentScope): Promise<DocumentToMarkdownResult>;
|
|
24
|
+
//# sourceMappingURL=extract-document.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_inspect` orchestration (§11).
|
|
3
|
+
*
|
|
4
|
+
* A read-only pass over one file: what it is, how big it is, what it says
|
|
5
|
+
* about itself, and what structure it holds. No artifact is created — the
|
|
6
|
+
* operation answers a question, it does not make a document.
|
|
7
|
+
*/
|
|
8
|
+
import type { DocumentInspectInput, DocumentInspectResult } from "../types.js";
|
|
9
|
+
import { type DocumentScope } from "./scope.js";
|
|
10
|
+
import type { DocumentRuntimeDeps } from "./runtime-deps.js";
|
|
11
|
+
export declare function inspectDocument(deps: DocumentRuntimeDeps, input: DocumentInspectInput, scopeInput: DocumentScope): Promise<DocumentInspectResult>;
|
|
12
|
+
//# sourceMappingURL=inspect-document.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime wiring shared by the four orchestrator operations.
|
|
3
|
+
*
|
|
4
|
+
* The runtime owns what must outlive a single call — the backend registry, the
|
|
5
|
+
* concurrency semaphores and the clock — and each operation reads its
|
|
6
|
+
* configuration and providers from here, so a test can substitute stub
|
|
7
|
+
* backends without touching a tool definition.
|
|
8
|
+
*/
|
|
9
|
+
import type { ResolvedQaDocumentsConfig } from "../config.js";
|
|
10
|
+
import type { ProviderSet } from "../providers/registry.js";
|
|
11
|
+
import { type Semaphore } from "../security/limits.js";
|
|
12
|
+
/** The logging surface the subsystem uses; a structural subset of PluginLogger. */
|
|
13
|
+
export interface DocumentLogger {
|
|
14
|
+
debug(event: string, fields?: Record<string, unknown>): void;
|
|
15
|
+
info(event: string, fields?: Record<string, unknown>): void;
|
|
16
|
+
warn(event: string, fields?: Record<string, unknown>): void;
|
|
17
|
+
error(event: string, fields?: Record<string, unknown>): void;
|
|
18
|
+
}
|
|
19
|
+
/** A logger that drops everything; the default when none is supplied. */
|
|
20
|
+
export declare const silentDocumentLogger: DocumentLogger;
|
|
21
|
+
export interface DocumentRuntimeDeps {
|
|
22
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
23
|
+
readonly providers: ProviderSet;
|
|
24
|
+
readonly logger: DocumentLogger;
|
|
25
|
+
readonly now: () => Date;
|
|
26
|
+
readonly semaphores: {
|
|
27
|
+
readonly render: Semaphore;
|
|
28
|
+
readonly extraction: Semaphore;
|
|
29
|
+
readonly ocr: Semaphore;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare function createRuntimeDeps(options: {
|
|
33
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
34
|
+
readonly providers: ProviderSet;
|
|
35
|
+
readonly logger?: DocumentLogger;
|
|
36
|
+
readonly now?: () => Date;
|
|
37
|
+
}): DocumentRuntimeDeps;
|
|
38
|
+
/** Run `body` with one render slot held, releasing it on every path. */
|
|
39
|
+
export declare function withRenderSlot<T>(deps: DocumentRuntimeDeps, signal: AbortSignal | undefined, body: () => Promise<T>): Promise<T>;
|
|
40
|
+
export declare function withExtractionSlot<T>(deps: DocumentRuntimeDeps, signal: AbortSignal | undefined, body: () => Promise<T>): Promise<T>;
|
|
41
|
+
/** OCR runs behind its own, narrower slot (§27: `ocrConcurrency`). */
|
|
42
|
+
export declare function withOcrSlot<T>(deps: DocumentRuntimeDeps, signal: AbortSignal | undefined, body: () => Promise<T>): Promise<T>;
|
|
43
|
+
//# sourceMappingURL=runtime-deps.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Job scope: where an operation reads from and writes to.
|
|
3
|
+
*
|
|
4
|
+
* Artifacts live in the session workspace by default
|
|
5
|
+
* (`<cwd>/.qa/artifacts/documents/<artifact-id>`), which is what makes a QA
|
|
6
|
+
* deployment's per-user workspaces isolate document bundles for free (§40).
|
|
7
|
+
* A deployment may pin `documents.storage.root` to a shared volume instead, in
|
|
8
|
+
* which case the session workspace stays the only place inputs are read from.
|
|
9
|
+
* Inputs may additionally come from explicitly configured roots (§26.2).
|
|
10
|
+
*/
|
|
11
|
+
import { ArtifactStore } from "../artifacts/store.js";
|
|
12
|
+
import type { ResolvedQaDocumentsConfig } from "../config.js";
|
|
13
|
+
import { type TemplateRegistry } from "../templates/registry.js";
|
|
14
|
+
/** What the caller (a tool) knows about the session. */
|
|
15
|
+
export interface DocumentScope {
|
|
16
|
+
readonly workspaceRoot: string;
|
|
17
|
+
readonly sessionId?: string;
|
|
18
|
+
readonly signal?: AbortSignal;
|
|
19
|
+
}
|
|
20
|
+
export interface ResolvedDocumentScope {
|
|
21
|
+
readonly workspaceRoot: string;
|
|
22
|
+
readonly artifactRoot: string;
|
|
23
|
+
readonly sessionId?: string;
|
|
24
|
+
readonly signal?: AbortSignal;
|
|
25
|
+
readonly store: ArtifactStore;
|
|
26
|
+
readonly templates: TemplateRegistry;
|
|
27
|
+
}
|
|
28
|
+
/** Artifact root of one workspace: configured root, else the workspace itself. */
|
|
29
|
+
export declare function defaultArtifactRoot(config: ResolvedQaDocumentsConfig, workspaceRoot: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Template roots to probe, in order. An explicitly configured root is
|
|
32
|
+
* authoritative; a deployment that configures none gets the two conventional
|
|
33
|
+
* workspace directories.
|
|
34
|
+
*/
|
|
35
|
+
export declare function templateCandidateRoots(config: ResolvedQaDocumentsConfig, workspaceRoot: string): string[];
|
|
36
|
+
/** Load the first candidate root that carries a registry manifest. */
|
|
37
|
+
export declare function loadScopeTemplates(config: ResolvedQaDocumentsConfig, workspaceRoot: string): Promise<TemplateRegistry>;
|
|
38
|
+
export declare function resolveDocumentScope(config: ResolvedQaDocumentsConfig, scope: DocumentScope): Promise<ResolvedDocumentScope>;
|
|
39
|
+
/** Roots an input file may be read from, most specific first. */
|
|
40
|
+
export declare function allowedInputRoots(config: ResolvedQaDocumentsConfig, scope: ResolvedDocumentScope): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a caller-supplied input path. The file must exist inside one of the
|
|
43
|
+
* allowed roots — traversal, symlinks out of the root and absolute paths to
|
|
44
|
+
* unrelated directories are all refused (§26.2).
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveInputPath(config: ResolvedQaDocumentsConfig, scope: ResolvedDocumentScope, requested: string, label: string): Promise<string>;
|
|
47
|
+
/** Read an input file under a byte budget. */
|
|
48
|
+
export declare function readInputBytes(filePath: string, config: ResolvedQaDocumentsConfig, label: string): Promise<Buffer>;
|
|
49
|
+
/** Ensure the artifact root exists and is writable, failing with a clear code. */
|
|
50
|
+
export declare function ensureArtifactRoot(scope: ResolvedDocumentScope): Promise<void>;
|
|
51
|
+
export declare function assertInsideArtifactRoot(scope: ResolvedDocumentScope, target: string, label: string): string;
|
|
52
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docling provider — the default DOCX/PDF → Markdown extractor (§6.1, §15).
|
|
3
|
+
*
|
|
4
|
+
* Docling runs as a separate HTTP service (`docling-serve`) rather than inside
|
|
5
|
+
* the host process: it is the heaviest dependency of the pipeline, it is where
|
|
6
|
+
* OCR happens, and keeping it across a network boundary is what lets the QA
|
|
7
|
+
* image stay small (§21, §39).
|
|
8
|
+
*
|
|
9
|
+
* Two behaviours are deliberate:
|
|
10
|
+
*
|
|
11
|
+
* - images come back inline as base64 data URIs (the only representation that
|
|
12
|
+
* survives an HTTP boundary without a second fetch), and the extractor writes
|
|
13
|
+
* them out as real files under `assets/`, rewriting references to relative
|
|
14
|
+
* paths (§17.2);
|
|
15
|
+
* - nothing about the response shape is assumed beyond "there is Markdown
|
|
16
|
+
* somewhere in it": a deployment upgrades docling-serve independently of
|
|
17
|
+
* this plugin, so both the wrapped (`document.md_content`) and flat
|
|
18
|
+
* (`md_content`) spellings are read.
|
|
19
|
+
*/
|
|
20
|
+
import type { BackendStatus, DocumentExtractor, DocumentFormat, ExtractInput, ExtractedDocument } from "../types.js";
|
|
21
|
+
export interface DoclingProviderOptions {
|
|
22
|
+
/** Base URL of docling-serve, e.g. `http://docling:5001`. */
|
|
23
|
+
readonly baseUrl: string;
|
|
24
|
+
readonly timeoutMs: number;
|
|
25
|
+
/** Cap on the response body the extractor will read. */
|
|
26
|
+
readonly maxResponseBytes: number;
|
|
27
|
+
readonly maxImages: number;
|
|
28
|
+
/** Test seam and proxy hook; defaults to the global `fetch`. */
|
|
29
|
+
readonly fetchImpl?: typeof fetch;
|
|
30
|
+
}
|
|
31
|
+
export declare class DoclingExtractor implements DocumentExtractor {
|
|
32
|
+
private readonly options;
|
|
33
|
+
readonly name = "docling";
|
|
34
|
+
constructor(options: DoclingProviderOptions);
|
|
35
|
+
supports(_format: DocumentFormat): boolean;
|
|
36
|
+
private get fetchImpl();
|
|
37
|
+
health(): Promise<BackendStatus>;
|
|
38
|
+
extract(input: ExtractInput): Promise<ExtractedDocument>;
|
|
39
|
+
/**
|
|
40
|
+
* Write inline images out as files and rewrite the Markdown to reference
|
|
41
|
+
* them relatively. Images beyond the configured cap are dropped with a
|
|
42
|
+
* warning rather than silently inflating the artifact (§25).
|
|
43
|
+
*/
|
|
44
|
+
private materializeAssets;
|
|
45
|
+
}
|
|
46
|
+
interface DoclingPayload {
|
|
47
|
+
readonly markdown: string;
|
|
48
|
+
readonly pages?: number;
|
|
49
|
+
readonly serviceVersion?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Read the Markdown out of a docling-serve response, in either spelling. */
|
|
52
|
+
export declare function readDoclingPayload(payload: unknown, backend: string): DoclingPayload;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=docling.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LibreOffice provider — DOCX → PDF (§6.1, §14.1, §46).
|
|
3
|
+
*
|
|
4
|
+
* Two details matter beyond "call the converter":
|
|
5
|
+
*
|
|
6
|
+
* - every invocation gets its own `-env:UserInstallation` profile, because
|
|
7
|
+
* concurrent headless LibreOffice processes sharing one profile corrupt each
|
|
8
|
+
* other's state; the temp profile is removed afterwards on success and on
|
|
9
|
+
* failure alike;
|
|
10
|
+
* - a conversion that produced no file, timed out, or died is reported as a
|
|
11
|
+
* failure of this step only. The orchestrator keeps whatever earlier steps
|
|
12
|
+
* already produced (§45).
|
|
13
|
+
*/
|
|
14
|
+
import type { ConvertPdfInput, ConvertedDocument, DocumentConverter } from "../types.js";
|
|
15
|
+
export interface LibreOfficeProviderOptions {
|
|
16
|
+
readonly executable: string;
|
|
17
|
+
readonly timeoutMs: number;
|
|
18
|
+
/** Directory the per-job profiles are created under (default: os temp). */
|
|
19
|
+
readonly profileRoot?: string;
|
|
20
|
+
/** Test seam: arguments placed before the provider's own argv. */
|
|
21
|
+
readonly programPrefixArgs?: readonly string[];
|
|
22
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export declare class LibreOfficePdfConverter implements DocumentConverter {
|
|
25
|
+
private readonly options;
|
|
26
|
+
readonly name = "libreoffice";
|
|
27
|
+
private cachedVersion;
|
|
28
|
+
constructor(options: LibreOfficeProviderOptions);
|
|
29
|
+
supports(source: string, target: string): boolean;
|
|
30
|
+
version(): Promise<string | undefined>;
|
|
31
|
+
private probeVersion;
|
|
32
|
+
convert(input: ConvertPdfInput): Promise<ConvertedDocument>;
|
|
33
|
+
/**
|
|
34
|
+
* LibreOffice derives the output name from the input, so the expected path
|
|
35
|
+
* is a prediction. When it is absent exactly one PDF in the output directory
|
|
36
|
+
* is accepted; anything else is a failure rather than a guess.
|
|
37
|
+
*/
|
|
38
|
+
private locateOutput;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=libreoffice.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarkItDown provider — the optional fast extractor (§6.2, §9).
|
|
3
|
+
*
|
|
4
|
+
* Kept behind `documents.markitdown.enabled` (off by default): it is a
|
|
5
|
+
* convenient fallback when Docling is unreachable and high-fidelity parsing is
|
|
6
|
+
* not needed, but it is not the extractor a QA report should be built on.
|
|
7
|
+
*/
|
|
8
|
+
import type { BackendStatus, DocumentExtractor, DocumentFormat, ExtractInput, ExtractedDocument } from "../types.js";
|
|
9
|
+
export interface MarkItDownProviderOptions {
|
|
10
|
+
readonly executable: string;
|
|
11
|
+
readonly timeoutMs: number;
|
|
12
|
+
readonly maxStdoutBytes: number;
|
|
13
|
+
/** Test seam: arguments placed before the provider's own argv. */
|
|
14
|
+
readonly programPrefixArgs?: readonly string[];
|
|
15
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
16
|
+
}
|
|
17
|
+
export declare class MarkItDownExtractor implements DocumentExtractor {
|
|
18
|
+
private readonly options;
|
|
19
|
+
readonly name = "markitdown";
|
|
20
|
+
private cachedVersion;
|
|
21
|
+
constructor(options: MarkItDownProviderOptions);
|
|
22
|
+
supports(format: DocumentFormat): boolean;
|
|
23
|
+
version(): Promise<string | undefined>;
|
|
24
|
+
private probeVersion;
|
|
25
|
+
health(): Promise<BackendStatus>;
|
|
26
|
+
extract(input: ExtractInput): Promise<ExtractedDocument>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=markitdown.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pandoc provider (§6.1, §13, §14.2).
|
|
3
|
+
*
|
|
4
|
+
* The command line is assembled here and nowhere else: the agent supplies
|
|
5
|
+
* content, a template *name* and a handful of enumerated options, and this
|
|
6
|
+
* module turns them into argv. There is no path through the pipeline by which
|
|
7
|
+
* a caller can add `--lua-filter`, an arbitrary `--resource-path`, or a
|
|
8
|
+
* `--pdf-engine-opt` (§26.1).
|
|
9
|
+
*/
|
|
10
|
+
import type { DocxRenderer, PdfRenderer, RenderDocxInput, RenderPdfInput, RenderedArtifact } from "../types.js";
|
|
11
|
+
export interface PandocProviderOptions {
|
|
12
|
+
/** Executable name or absolute path (`pandoc`, `pandoc.exe`). */
|
|
13
|
+
readonly executable: string;
|
|
14
|
+
readonly timeoutMs: number;
|
|
15
|
+
/** Test seam: arguments placed before the provider's own argv. */
|
|
16
|
+
readonly programPrefixArgs?: readonly string[];
|
|
17
|
+
/** Test seam: replacement for `--version` probing. */
|
|
18
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
19
|
+
}
|
|
20
|
+
/** Pandoc renders Markdown into DOCX, optionally through a reference document. */
|
|
21
|
+
export declare class PandocDocxRenderer implements DocxRenderer {
|
|
22
|
+
private readonly options;
|
|
23
|
+
readonly name = "pandoc";
|
|
24
|
+
private cachedVersion;
|
|
25
|
+
constructor(options: PandocProviderOptions);
|
|
26
|
+
version(): Promise<string | undefined>;
|
|
27
|
+
render(input: RenderDocxInput): Promise<RenderedArtifact>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Pandoc-driven PDF renderer. The only engine this pipeline enables is Typst,
|
|
31
|
+
* so the provider exists for `pdfMode: "typst"` alone (§14.2); the office route
|
|
32
|
+
* renders DOCX first and converts it with LibreOffice.
|
|
33
|
+
*/
|
|
34
|
+
export declare class PandocTypstPdfRenderer implements PdfRenderer {
|
|
35
|
+
private readonly options;
|
|
36
|
+
readonly name = "typst";
|
|
37
|
+
private cachedVersion;
|
|
38
|
+
constructor(options: PandocProviderOptions);
|
|
39
|
+
version(): Promise<string | undefined>;
|
|
40
|
+
render(input: RenderPdfInput): Promise<RenderedArtifact>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=pandoc.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hardened child-process runner for document backends (§26.1, §28, §47).
|
|
3
|
+
*
|
|
4
|
+
* Every backend invocation goes through here. The contract mirrors the one the
|
|
5
|
+
* git tools use, because the threat is the same shape — a document is
|
|
6
|
+
* untrusted input and the backend is a powerful external program:
|
|
7
|
+
*
|
|
8
|
+
* - argv array only, built by the provider, never by the model, no shell;
|
|
9
|
+
* - an explicit environment allow-list, so ambient secrets and proxies do not
|
|
10
|
+
* reach the backend;
|
|
11
|
+
* - output is byte-capped and the process is killed when the cap or the
|
|
12
|
+
* timeout hits; a killed run is reported as `timedOut`/`truncated` rather
|
|
13
|
+
* than being confused with a backend that failed on its own;
|
|
14
|
+
* - the caller's abort signal terminates the child and its descendants.
|
|
15
|
+
*/
|
|
16
|
+
export interface ProcessOptions {
|
|
17
|
+
readonly cwd?: string;
|
|
18
|
+
readonly timeoutMs: number;
|
|
19
|
+
/** Maximum stdout bytes retained; the process is killed beyond this. */
|
|
20
|
+
readonly maxStdoutBytes: number;
|
|
21
|
+
/** Maximum stderr bytes retained (collection stops, the process continues). */
|
|
22
|
+
readonly maxStderrBytes?: number;
|
|
23
|
+
readonly signal?: AbortSignal;
|
|
24
|
+
/** Extra environment entries layered over the allow-listed base. */
|
|
25
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
26
|
+
/** Test seam: arguments between the program and the provider's own argv. */
|
|
27
|
+
readonly programPrefixArgs?: readonly string[];
|
|
28
|
+
/** Backend name for error reporting. */
|
|
29
|
+
readonly backend: string;
|
|
30
|
+
/** What the invocation is doing, for error messages. */
|
|
31
|
+
readonly context: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ProcessResult {
|
|
34
|
+
readonly stdout: string;
|
|
35
|
+
readonly stderr: string;
|
|
36
|
+
readonly exitCode: number | null;
|
|
37
|
+
readonly truncated: boolean;
|
|
38
|
+
readonly timedOut: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Ambient variables a document backend legitimately needs. Everything else —
|
|
42
|
+
* API keys, proxy settings, cloud credentials — is withheld: a converter
|
|
43
|
+
* parsing a hostile document should not be able to read the deployment's
|
|
44
|
+
* secrets out of its own environment (§26.5).
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildProcessEnv(extra?: Readonly<Record<string, string>>, source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
47
|
+
export declare function runProcess(program: string, argv: readonly string[], options: ProcessOptions): Promise<ProcessResult>;
|
|
48
|
+
/** Map a finished run that the provider expected to succeed onto an error. */
|
|
49
|
+
export declare function expectProcessOk(result: ProcessResult, options: {
|
|
50
|
+
backend: string;
|
|
51
|
+
context: string;
|
|
52
|
+
fallbackCode: "RENDER_FAILED" | "CONVERSION_FAILED" | "EXTRACTION_FAILED" | "OCR_FAILED";
|
|
53
|
+
}): void;
|
|
54
|
+
//# sourceMappingURL=process.d.ts.map
|