@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,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend registry and selection (§22, §23, §14.3, §45).
|
|
3
|
+
*
|
|
4
|
+
* Tools never import a concrete provider: they ask the registry for the
|
|
5
|
+
* renderer, extractor or converter that fits the request, and the registry
|
|
6
|
+
* decides — from configuration and from what is actually available — which
|
|
7
|
+
* implementation that is. Swapping Docling for another extractor, or Typst for
|
|
8
|
+
* another PDF engine, is a change here and nowhere else.
|
|
9
|
+
*/
|
|
10
|
+
import type { ResolvedQaDocumentsConfig } from "../config.js";
|
|
11
|
+
import type { BackendStatus, DocumentConverter, DocumentExtractor, DocumentFormat, ExtractedDocument, ExtractInput, DocxRenderer, PdfMode, PdfRenderer, ExtractionMode } from "../types.js";
|
|
12
|
+
export interface ProviderSeams {
|
|
13
|
+
/** Substituted for the global `fetch` when talking to docling-serve. */
|
|
14
|
+
readonly fetchImpl?: typeof fetch;
|
|
15
|
+
readonly pandoc?: {
|
|
16
|
+
readonly programPrefixArgs?: readonly string[];
|
|
17
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
18
|
+
};
|
|
19
|
+
readonly libreoffice?: {
|
|
20
|
+
readonly programPrefixArgs?: readonly string[];
|
|
21
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
22
|
+
};
|
|
23
|
+
readonly markitdown?: {
|
|
24
|
+
readonly programPrefixArgs?: readonly string[];
|
|
25
|
+
readonly versionProbe?: () => Promise<string | undefined>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface ProviderSet {
|
|
29
|
+
readonly docx: DocxRenderer;
|
|
30
|
+
readonly typstPdf: PdfRenderer | undefined;
|
|
31
|
+
readonly converter: DocumentConverter;
|
|
32
|
+
readonly docling: DocumentExtractor | undefined;
|
|
33
|
+
readonly doclingHealth: (() => Promise<BackendStatus>) | undefined;
|
|
34
|
+
readonly markitdown: DocumentExtractor | undefined;
|
|
35
|
+
readonly markitdownHealth: (() => Promise<BackendStatus>) | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare function createProviders(config: ResolvedQaDocumentsConfig, seams?: ProviderSeams): ProviderSet;
|
|
38
|
+
/**
|
|
39
|
+
* The PDF route (§14.3):
|
|
40
|
+
*
|
|
41
|
+
* ```text
|
|
42
|
+
* DOCX + PDF requested → office
|
|
43
|
+
* PDF only, template has Typst → typst
|
|
44
|
+
* otherwise → office
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* A deployment that asked for `typst` without enabling the engine is answered
|
|
48
|
+
* with `BACKEND_UNAVAILABLE` instead of silently rendering an office PDF in
|
|
49
|
+
* the wrong layout.
|
|
50
|
+
*/
|
|
51
|
+
export declare function selectPdfMode(options: {
|
|
52
|
+
readonly requested: PdfMode;
|
|
53
|
+
readonly formats: readonly ("docx" | "pdf")[];
|
|
54
|
+
readonly templateHasTypst: boolean;
|
|
55
|
+
readonly typstEnabled: boolean;
|
|
56
|
+
}): "office" | "typst";
|
|
57
|
+
export interface ExtractorSelection {
|
|
58
|
+
readonly extractor: DocumentExtractor;
|
|
59
|
+
/** Extractors to try, in order, when the first one is unreachable. */
|
|
60
|
+
readonly fallbacks: readonly DocumentExtractor[];
|
|
61
|
+
}
|
|
62
|
+
export declare function selectExtractor(providers: ProviderSet, config: ResolvedQaDocumentsConfig, mode: ExtractionMode, format: DocumentFormat): ExtractorSelection;
|
|
63
|
+
/** Run the selected extractor, falling back only when it is unreachable. */
|
|
64
|
+
export declare function extractWithFallback(selection: ExtractorSelection, input: ExtractInput): Promise<{
|
|
65
|
+
document: ExtractedDocument;
|
|
66
|
+
fellBackFrom?: string;
|
|
67
|
+
}>;
|
|
68
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared plumbing of the document providers.
|
|
3
|
+
*
|
|
4
|
+
* Providers report what they wrote through {@link verifyOutput}: a backend
|
|
5
|
+
* that exits 0 but leaves no file behind is a failure, and one that leaves an
|
|
6
|
+
* empty file is a failure too — the caller must never be handed a path that
|
|
7
|
+
* looks like an artifact and is not.
|
|
8
|
+
*/
|
|
9
|
+
import type { BackendInfo, DocumentWarning } from "../types.js";
|
|
10
|
+
export type ProviderFailureCode = "RENDER_FAILED" | "CONVERSION_FAILED" | "EXTRACTION_FAILED";
|
|
11
|
+
export interface VerifiedOutput {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
readonly size: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function verifyOutput(outputPath: string, backend: string, code: ProviderFailureCode): Promise<VerifiedOutput>;
|
|
16
|
+
/** `--metadata=key=value` pairs, sanitized of control characters. */
|
|
17
|
+
export declare function metadataArguments(metadata: Readonly<Record<string, string>> | undefined): string[];
|
|
18
|
+
/** First line of a `--version` run, reduced to the version token. */
|
|
19
|
+
export declare function parseVersionOutput(stdout: string, program: string): string | undefined;
|
|
20
|
+
export declare function backendInfo(provider: string, version?: string): BackendInfo;
|
|
21
|
+
/** Read a text output produced by a backend, with a bounded size. */
|
|
22
|
+
export declare function readTextOutput(filePath: string, backend: string, maxBytes: number): Promise<{
|
|
23
|
+
text: string;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function truncationWarning(backend: string, contentType: string): DocumentWarning;
|
|
27
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime facade the tools talk to.
|
|
3
|
+
*
|
|
4
|
+
* One instance lives in the plugin and survives across calls, so the backend
|
|
5
|
+
* registry, the concurrency semaphores and the version caches are shared
|
|
6
|
+
* instead of rebuilt per request. The four operations are the whole surface:
|
|
7
|
+
* everything else in this subsystem is an implementation detail behind them.
|
|
8
|
+
*/
|
|
9
|
+
import { type QaDocumentsConfig, type ResolvedQaDocumentsConfig } from "./config.js";
|
|
10
|
+
import { type ProviderSeams, type ProviderSet } from "./providers/registry.js";
|
|
11
|
+
import { type DocumentLogger } from "./orchestrator/runtime-deps.js";
|
|
12
|
+
import { resolveDocumentScope, type DocumentScope } from "./orchestrator/scope.js";
|
|
13
|
+
import type { DocumentCapabilities, DocumentConvertInput, DocumentConvertResult, DocumentCreateInput, DocumentCreateResult, DocumentHealth, DocumentInspectInput, DocumentInspectResult, DocumentToMarkdownInput, DocumentToMarkdownResult } from "./types.js";
|
|
14
|
+
export interface DocumentRuntimeOptions {
|
|
15
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
16
|
+
readonly logger?: DocumentLogger;
|
|
17
|
+
readonly seams?: ProviderSeams;
|
|
18
|
+
/** Pre-built registry; tests substitute stub backends here. */
|
|
19
|
+
readonly providers?: ProviderSet;
|
|
20
|
+
readonly now?: () => Date;
|
|
21
|
+
}
|
|
22
|
+
export declare class DocumentRuntime {
|
|
23
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
24
|
+
readonly providers: ProviderSet;
|
|
25
|
+
private readonly deps;
|
|
26
|
+
private readonly seams;
|
|
27
|
+
constructor(options: DocumentRuntimeOptions);
|
|
28
|
+
create(input: DocumentCreateInput, scope: DocumentScope): Promise<DocumentCreateResult>;
|
|
29
|
+
toMarkdown(input: DocumentToMarkdownInput, scope: DocumentScope): Promise<DocumentToMarkdownResult>;
|
|
30
|
+
convert(input: DocumentConvertInput, scope: DocumentScope): Promise<DocumentConvertResult>;
|
|
31
|
+
inspect(input: DocumentInspectInput, scope: DocumentScope): Promise<DocumentInspectResult>;
|
|
32
|
+
health(options?: {
|
|
33
|
+
readonly probeProcessBackends?: boolean;
|
|
34
|
+
}): Promise<DocumentHealth>;
|
|
35
|
+
capabilities(scope?: DocumentScope): Promise<DocumentCapabilities>;
|
|
36
|
+
/** Routes this runtime advertises, in documentation order. */
|
|
37
|
+
routes(): readonly (readonly [string, string])[];
|
|
38
|
+
/**
|
|
39
|
+
* Retention sweep (§41). Meaningful only for a pinned storage root: with the
|
|
40
|
+
* default per-workspace layout the plugin cannot enumerate workspaces, and a
|
|
41
|
+
* sweep that guessed would delete other projects' artifacts.
|
|
42
|
+
*/
|
|
43
|
+
cleanup(options?: {
|
|
44
|
+
readonly now?: Date;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
removed: string[];
|
|
47
|
+
} | undefined>;
|
|
48
|
+
}
|
|
49
|
+
/** Build a runtime from raw (schema-parsed) configuration. */
|
|
50
|
+
export declare function createDocumentRuntime(options: {
|
|
51
|
+
readonly config: QaDocumentsConfig;
|
|
52
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
53
|
+
readonly logger?: DocumentLogger;
|
|
54
|
+
readonly seams?: ProviderSeams;
|
|
55
|
+
readonly providers?: ProviderSet;
|
|
56
|
+
readonly now?: () => Date;
|
|
57
|
+
}): DocumentRuntime;
|
|
58
|
+
export { resolveDocumentScope };
|
|
59
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-type identification and asset MIME policy (§26.3, §26.6, §17.1).
|
|
3
|
+
*
|
|
4
|
+
* The extension is a hint, never the authority: PDF is recognized by its
|
|
5
|
+
* header (after a bounded scan, because a PDF may carry leading junk), OOXML
|
|
6
|
+
* by its ZIP container plus the parts it holds, and macro-enabled documents by
|
|
7
|
+
* the presence of a VBA project. Legacy OLE documents (`.doc`, `.xls`, `.ppt`)
|
|
8
|
+
* are recognized only to be refused with a precise message.
|
|
9
|
+
*/
|
|
10
|
+
import type { DetectedFormat, DocumentFormat } from "../types.js";
|
|
11
|
+
export declare const DOCUMENT_MEDIA_TYPES: Readonly<Record<DocumentFormat, string>>;
|
|
12
|
+
export declare function mediaTypeFor(format: DocumentFormat): string;
|
|
13
|
+
export declare function extensionFor(format: DocumentFormat): string;
|
|
14
|
+
export interface SniffedDocument {
|
|
15
|
+
readonly format: DetectedFormat;
|
|
16
|
+
readonly mediaType: string;
|
|
17
|
+
/** The file is a ZIP container holding a Word processing document. */
|
|
18
|
+
readonly wordprocessing?: boolean;
|
|
19
|
+
/** `word/vbaProject.bin` or a macro-enabled content type is present. */
|
|
20
|
+
readonly macroEnabled?: boolean;
|
|
21
|
+
/** Container recognized as OOXML but not a supported document flavour. */
|
|
22
|
+
readonly unsupportedOffice?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function detectFormatByExtension(filename: string): DocumentFormat | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Identify a document from its bytes, falling back to the extension only where
|
|
27
|
+
* bytes are inconclusive (plain text and Markdown are both just text).
|
|
28
|
+
*/
|
|
29
|
+
export declare function sniffDocument(buffer: Buffer, filename?: string): SniffedDocument;
|
|
30
|
+
/** The supported source format behind a sniff result, or `undefined`. */
|
|
31
|
+
export declare function supportedFormatOf(sniffed: SniffedDocument): DocumentFormat | undefined;
|
|
32
|
+
/** Human-facing explanation of a sniff result the pipeline refuses. */
|
|
33
|
+
export declare function describeUnsupported(sniffed: SniffedDocument, filename: string): string;
|
|
34
|
+
export { DEFAULT_ASSET_MIME_TYPES, isAllowedAssetMimeType, mimeTypeForFilename, } from "./mime.js";
|
|
35
|
+
/** Magic-byte MIME detection for the asset types the pipeline accepts. */
|
|
36
|
+
export declare function mimeTypeOfBytes(buffer: Buffer): string | undefined;
|
|
37
|
+
/** A short, sanitized description of the first bytes, for error messages. */
|
|
38
|
+
export declare function describeBytes(buffer: Buffer): string;
|
|
39
|
+
//# sourceMappingURL=file-types.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource limits and concurrency control (§26.4, §27).
|
|
3
|
+
*
|
|
4
|
+
* Every expensive stage (render, extraction, OCR) runs behind a semaphore so a
|
|
5
|
+
* burst of documents cannot exhaust the host, and every size/count budget is
|
|
6
|
+
* checked before the work starts rather than after a backend has already spent
|
|
7
|
+
* minutes on it.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertBytesWithinBudget(bytes: number, maxBytes: number, label: string): void;
|
|
10
|
+
export declare function assertCharsWithinBudget(chars: number, maxChars: number, label: string): void;
|
|
11
|
+
export declare function assertCountWithinBudget(count: number, maxCount: number, label: string): void;
|
|
12
|
+
export interface Semaphore {
|
|
13
|
+
/** Resolve with the release function once a slot is free. */
|
|
14
|
+
acquire(signal?: AbortSignal): Promise<() => void>;
|
|
15
|
+
readonly limit: number;
|
|
16
|
+
/** Slots in use right now (tests and health output). */
|
|
17
|
+
readonly inUse: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Counting semaphore with FIFO fairness. An aborted waiter leaves the queue
|
|
21
|
+
* without consuming a slot, so a stopped turn never leaks capacity.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createSemaphore(limit: number): Semaphore;
|
|
24
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIME policy for document assets (§17.1).
|
|
3
|
+
*
|
|
4
|
+
* Kept free of Node builtins on purpose: the QA settings schema reaches this
|
|
5
|
+
* module from the browser bundle, so anything imported here also has to run in
|
|
6
|
+
* a page. The byte sniffing stays with the pipeline's file-type module, which
|
|
7
|
+
* may import whatever it needs.
|
|
8
|
+
*/
|
|
9
|
+
/** Asset MIME types accepted by default. */
|
|
10
|
+
export declare const DEFAULT_ASSET_MIME_TYPES: readonly string[];
|
|
11
|
+
export declare function mimeTypeForFilename(filename: string): string | undefined;
|
|
12
|
+
export declare function isAllowedAssetMimeType(mimeType: string, allowed: readonly string[]): boolean;
|
|
13
|
+
//# sourceMappingURL=mime.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path containment and filename hygiene (§26.2, §32).
|
|
3
|
+
*
|
|
4
|
+
* Two rules hold everywhere in the pipeline:
|
|
5
|
+
*
|
|
6
|
+
* - every path the pipeline touches is resolved against an allowed root and
|
|
7
|
+
* the resolution must stay inside it — traversal, absolute escapes and
|
|
8
|
+
* `file://` references are refused before anything is opened;
|
|
9
|
+
* - a caller-supplied filename is a label, never a path: directories are
|
|
10
|
+
* dropped, separators and reserved characters collapse to `-`, and the
|
|
11
|
+
* extension is the one the operation itself chose.
|
|
12
|
+
*/
|
|
13
|
+
/** Whether `target` is `root` or a descendant of it (no symlink resolution). */
|
|
14
|
+
export declare function isInsideRoot(root: string, target: string): boolean;
|
|
15
|
+
export declare function assertInsideRoot(root: string, target: string, label: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Canonicalize a path for containment checks: the existing prefix is resolved
|
|
18
|
+
* through symlinks, the non-existent remainder is appended unresolved. A
|
|
19
|
+
* symlink pointing outside the root therefore canonicalizes outside it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function canonicalizeForContainment(input: string): Promise<string>;
|
|
22
|
+
/** Resolve a caller-supplied path against `root`, refusing any escape. */
|
|
23
|
+
export declare function resolveInsideRoot(root: string, requested: string, label: string): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Turn a caller-supplied filename into a safe file name (§32).
|
|
26
|
+
* `../../foo report?.docx` becomes `foo-report.docx`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function sanitizeFilename(requested: string | undefined, fallbackStem: string, extension: string): string;
|
|
29
|
+
/** `file:///...` form required by `-env:UserInstallation` and friends. */
|
|
30
|
+
export declare function toFileUri(target: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Assert an asset reference inside Markdown targets the assets directory and
|
|
33
|
+
* nothing else: no absolute paths, no URLs, no traversal (§17.1).
|
|
34
|
+
*/
|
|
35
|
+
export declare function assertRelativeAssetReference(reference: string): string;
|
|
36
|
+
/** Recursively-size snapshot helper used by the limits guard. */
|
|
37
|
+
export declare function assertNotBlank(value: string, label: string): string;
|
|
38
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template registry (§12.2).
|
|
3
|
+
*
|
|
4
|
+
* A deployment describes its templates in a `manifest.yml` beside the
|
|
5
|
+
* template files:
|
|
6
|
+
*
|
|
7
|
+
* ```yaml
|
|
8
|
+
* templates:
|
|
9
|
+
* default:
|
|
10
|
+
* docx: ./docx/default.docx
|
|
11
|
+
* qa-report:
|
|
12
|
+
* docx: ./docx/qa-report.docx
|
|
13
|
+
* typst: ./typst/qa-report
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Every declared path is resolved against the template root and must stay
|
|
17
|
+
* inside it: a registry file is operator input, but it is read from the
|
|
18
|
+
* workspace, so it gets the same containment treatment as everything else
|
|
19
|
+
* (§26.2).
|
|
20
|
+
*/
|
|
21
|
+
import type { DocumentWarning } from "../types.js";
|
|
22
|
+
export declare const TEMPLATE_MANIFEST_FILE = "manifest.yml";
|
|
23
|
+
export interface DocumentTemplate {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/** Absolute path of the reference DOCX, when the template declares one. */
|
|
26
|
+
readonly docx?: string;
|
|
27
|
+
/** Absolute path of the Typst template directory, when it declares one. */
|
|
28
|
+
readonly typst?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TemplateRegistry {
|
|
31
|
+
/** Absolute template root, when the workspace provides one. */
|
|
32
|
+
readonly root?: string;
|
|
33
|
+
readonly templates: ReadonlyMap<string, DocumentTemplate>;
|
|
34
|
+
readonly warnings: readonly DocumentWarning[];
|
|
35
|
+
}
|
|
36
|
+
/** The template name that always resolves, with or without a registry. */
|
|
37
|
+
export declare const BUILTIN_TEMPLATE_NAME = "default";
|
|
38
|
+
/** Located registry file inside a candidate root. */
|
|
39
|
+
export declare function findTemplateManifest(root: string): Promise<string | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Load a registry from a template root. A missing root, a missing manifest or
|
|
42
|
+
* an unreadable document all leave the builtin default in place and report a
|
|
43
|
+
* warning — a broken template directory must not stop the agent from writing a
|
|
44
|
+
* plain document, but it must not be silent either.
|
|
45
|
+
*/
|
|
46
|
+
export declare function loadTemplateRegistry(root: string | undefined): Promise<TemplateRegistry>;
|
|
47
|
+
export declare function templateNames(registry: TemplateRegistry): string[];
|
|
48
|
+
/** Load a registry from a candidate root, defaulting to a file-system probe. */
|
|
49
|
+
export declare function loadTemplateRegistryFrom(roots: readonly (string | undefined)[], probe: (candidate: string) => Promise<boolean>): Promise<TemplateRegistry>;
|
|
50
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template resolution (§12.3).
|
|
3
|
+
*
|
|
4
|
+
* ```text
|
|
5
|
+
* requested template
|
|
6
|
+
* ↓ (absent)
|
|
7
|
+
* project default
|
|
8
|
+
* ↓ (absent)
|
|
9
|
+
* builtin default
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* A requested template that does not exist is an error, never a silent
|
|
13
|
+
* fallback: a report rendered in the wrong corporate layout is worse than a
|
|
14
|
+
* failed call the operator can read. The builtin `default` name resolves
|
|
15
|
+
* without a registry entry — it means "the document backend's own defaults".
|
|
16
|
+
*/
|
|
17
|
+
import type { DocumentWarning } from "../types.js";
|
|
18
|
+
import { type DocumentTemplate, type TemplateRegistry } from "./registry.js";
|
|
19
|
+
export interface ResolvedTemplate {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly template?: DocumentTemplate;
|
|
22
|
+
/** How the effective name was chosen. */
|
|
23
|
+
readonly source: "requested" | "project-default" | "builtin";
|
|
24
|
+
}
|
|
25
|
+
export interface TemplateResolution {
|
|
26
|
+
readonly resolved: ResolvedTemplate;
|
|
27
|
+
readonly warnings: readonly DocumentWarning[];
|
|
28
|
+
}
|
|
29
|
+
export declare function resolveTemplate(registry: TemplateRegistry, requested: string | undefined, projectDefault: string): TemplateResolution;
|
|
30
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_convert` — one supported format to another (§10, §34).
|
|
3
|
+
*/
|
|
4
|
+
import type { DocumentRuntime } from "../runtime.js";
|
|
5
|
+
export declare const DOCUMENT_CONVERT_TOOL = "document_convert";
|
|
6
|
+
export declare function createDocumentConvertTool(options: {
|
|
7
|
+
readonly runtime: DocumentRuntime;
|
|
8
|
+
}): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
9
|
+
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_create` — Markdown to DOCX and/or PDF (§8, §34).
|
|
3
|
+
*
|
|
4
|
+
* This is the tool the agent reaches for instead of driving pandoc and
|
|
5
|
+
* LibreOffice itself, which is the whole point of the pipeline: the intent is
|
|
6
|
+
* "give me this report as a Word file and a PDF", and the service decides how
|
|
7
|
+
* that happens.
|
|
8
|
+
*/
|
|
9
|
+
import type { DocumentRuntime } from "../runtime.js";
|
|
10
|
+
export declare const DOCUMENT_CREATE_TOOL = "document_create";
|
|
11
|
+
export declare function createDocumentCreateTool(options: {
|
|
12
|
+
readonly runtime: DocumentRuntime;
|
|
13
|
+
}): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
14
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four agent-facing document tools (§8–§11, §34) and their registration.
|
|
3
|
+
*
|
|
4
|
+
* Registration is explicit and returns its disposers: the host may register
|
|
5
|
+
* them globally (the default) or an agent scope may register the same
|
|
6
|
+
* definitions later, which is what a deployment that wants progressive
|
|
7
|
+
* disclosure needs. Nothing here decides *whether* document tools are visible;
|
|
8
|
+
* that is the deployment's allow-list.
|
|
9
|
+
*/
|
|
10
|
+
import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
|
|
11
|
+
import type { DocumentRuntime } from "../runtime.js";
|
|
12
|
+
import { DOCUMENT_CONVERT_TOOL } from "./convert.js";
|
|
13
|
+
import { DOCUMENT_CREATE_TOOL } from "./create.js";
|
|
14
|
+
import { DOCUMENT_INSPECT_TOOL } from "./inspect.js";
|
|
15
|
+
import { DOCUMENT_TO_MARKDOWN_TOOL } from "./to-markdown.js";
|
|
16
|
+
/** Exact names of the tools this subsystem registers (allow-list contract). */
|
|
17
|
+
export declare const DOCUMENT_TOOL_NAMES: readonly string[];
|
|
18
|
+
export { DOCUMENT_CONVERT_TOOL, DOCUMENT_CREATE_TOOL, DOCUMENT_INSPECT_TOOL, DOCUMENT_TO_MARKDOWN_TOOL, };
|
|
19
|
+
export declare function createDocumentTools(options: {
|
|
20
|
+
readonly runtime: DocumentRuntime;
|
|
21
|
+
}): ToolDefinition[];
|
|
22
|
+
/** Anything that can accept a tool definition; the host's registry facade. */
|
|
23
|
+
export interface DocumentToolRegistry {
|
|
24
|
+
register(definition: ToolDefinition): () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Register every document tool and return one disposer. `enabled: false` is
|
|
28
|
+
* handled by the caller: the surface is then absent rather than inert.
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerDocumentTools(registry: DocumentToolRegistry, options: {
|
|
31
|
+
readonly runtime: DocumentRuntime;
|
|
32
|
+
}): () => void;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_inspect` — what a document is, without converting it (§11, §34).
|
|
3
|
+
*/
|
|
4
|
+
import type { DocumentRuntime } from "../runtime.js";
|
|
5
|
+
export declare const DOCUMENT_INSPECT_TOOL = "document_inspect";
|
|
6
|
+
export declare function createDocumentInspectTool(options: {
|
|
7
|
+
readonly runtime: DocumentRuntime;
|
|
8
|
+
}): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
9
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the four document tools share: the calling session's scope, the output
|
|
3
|
+
* shapes they render, and the warning formatter.
|
|
4
|
+
*
|
|
5
|
+
* A tool is a thin adapter. It reads the session's working directory (the
|
|
6
|
+
* artifact root and the allowed input roots both derive from it), hands intent
|
|
7
|
+
* to the runtime, and renders the structured result for the model. No tool
|
|
8
|
+
* knows a backend name beyond the one the result reports.
|
|
9
|
+
*/
|
|
10
|
+
import type { ParameterSchemaSpec } from "@deepseek-ai/dsh-tools";
|
|
11
|
+
import type { DocumentScope } from "../orchestrator/scope.js";
|
|
12
|
+
import type { DocumentFileResult, DocumentWarning } from "../types.js";
|
|
13
|
+
/**
|
|
14
|
+
* Model-facing shape of a warning. The tool results carry code, message and
|
|
15
|
+
* backend; the diagnostic `details` stay in the manifest, where they are read
|
|
16
|
+
* by an operator rather than by the model.
|
|
17
|
+
*/
|
|
18
|
+
export interface ToolWarning {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly backend?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function toolWarnings(warnings: readonly DocumentWarning[]): ToolWarning[];
|
|
24
|
+
/** Shared output-schema fragment for the `warnings` array of every tool. */
|
|
25
|
+
export declare const warningsSchema: {
|
|
26
|
+
type: "array";
|
|
27
|
+
items: {
|
|
28
|
+
type: "object";
|
|
29
|
+
additionalProperties: false;
|
|
30
|
+
properties: {
|
|
31
|
+
code: {
|
|
32
|
+
type: "string";
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
message: {
|
|
36
|
+
type: "string";
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
backend: {
|
|
40
|
+
type: "string";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** Mutable projection of a produced file for the tool result. */
|
|
46
|
+
export declare function toolFiles(files: readonly DocumentFileResult[]): {
|
|
47
|
+
format: string;
|
|
48
|
+
path: string;
|
|
49
|
+
mediaType: string;
|
|
50
|
+
size: number;
|
|
51
|
+
sha256: string;
|
|
52
|
+
status: string;
|
|
53
|
+
error?: string;
|
|
54
|
+
}[];
|
|
55
|
+
/** Structural view of the execution context a tool body needs. */
|
|
56
|
+
export interface DocumentToolExec {
|
|
57
|
+
readonly signal?: AbortSignal;
|
|
58
|
+
readonly agent?: {
|
|
59
|
+
readonly session: {
|
|
60
|
+
readonly header: {
|
|
61
|
+
readonly cwd?: string;
|
|
62
|
+
readonly id?: unknown;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the session scope, failing closed: a session without a working
|
|
69
|
+
* directory gets no document access rather than the host process's cwd.
|
|
70
|
+
*/ export declare function requireDocumentScope(exec: DocumentToolExec): DocumentScope;
|
|
71
|
+
export declare function fileParameter(): ParameterSchemaSpec[string];
|
|
72
|
+
export declare function formatBytes(bytes: number): string;
|
|
73
|
+
export declare function renderWarning(warning: ToolWarning): string;
|
|
74
|
+
/** One line per produced file, plus failed formats explicitly named. */
|
|
75
|
+
export declare function renderFiles(files: readonly DocumentFileResult[]): string[];
|
|
76
|
+
export declare const ARTIFACT_NOTE = "The artifact directory keeps the source, the assets and manifest.json beside the outputs.";
|
|
77
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `document_to_markdown` — DOCX/PDF to Markdown (§9, §34).
|
|
3
|
+
*
|
|
4
|
+
* The model gets the extracted text and a path to the full copy; the artifact
|
|
5
|
+
* bundle keeps the input, the extracted Markdown and any extracted images.
|
|
6
|
+
*/
|
|
7
|
+
import type { DocumentRuntime } from "../runtime.js";
|
|
8
|
+
export declare const DOCUMENT_TO_MARKDOWN_TOOL = "document_to_markdown";
|
|
9
|
+
export declare function createDocumentToMarkdownTool(options: {
|
|
10
|
+
readonly runtime: DocumentRuntime;
|
|
11
|
+
}): import("@deepseek-ai/dsh-tools").ToolDefinition;
|
|
12
|
+
//# sourceMappingURL=to-markdown.d.ts.map
|