@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
|
+
import type { QaAccountIdentityField, QaAccountProfile, QaAccountProfileInput, QaAccountStarters, QaAccountStartersInput } from "../../types.js";
|
|
2
|
+
import type { QaBoundSkillApi } from "../types.js";
|
|
3
|
+
import type { QaUserSettingsSections } from "../settings-extensions/index.js";
|
|
4
|
+
/** Sections of the user-facing settings dialog. */
|
|
5
|
+
export type QaSettingsSectionId = "profile" | "starters" | "general" | "skills" | (string & {});
|
|
6
|
+
export interface QaUserSettingsDialogProps {
|
|
7
|
+
readonly open: boolean;
|
|
8
|
+
/** Section to show when the dialog opens. */
|
|
9
|
+
readonly initialSection: QaSettingsSectionId;
|
|
10
|
+
readonly onClose: () => void;
|
|
11
|
+
readonly email: string;
|
|
12
|
+
readonly role: string;
|
|
13
|
+
readonly chatCount: number;
|
|
14
|
+
/** Self-service profile editing; absent when the deployment turns it off. */
|
|
15
|
+
readonly profile?: {
|
|
16
|
+
readonly profile: QaAccountProfile;
|
|
17
|
+
readonly fields: readonly QaAccountIdentityField[];
|
|
18
|
+
readonly instructionsMaxLength: number;
|
|
19
|
+
readonly onSave: (input: QaAccountProfileInput) => Promise<string | null>;
|
|
20
|
+
};
|
|
21
|
+
/** Self-service starter buttons; absent when the deployment turns them off. */
|
|
22
|
+
readonly starters?: {
|
|
23
|
+
readonly starters: QaAccountStarters;
|
|
24
|
+
readonly onSave: (input: QaAccountStartersInput) => Promise<string | null>;
|
|
25
|
+
};
|
|
26
|
+
/** Personal skills; absent when the deployment cannot host them. */
|
|
27
|
+
readonly skills?: QaBoundSkillApi;
|
|
28
|
+
/** Additive pages contributed by separately shipped QA plugins. */
|
|
29
|
+
readonly extensions?: QaUserSettingsSections;
|
|
30
|
+
/** Current account token, passed only to the selected extension page. */
|
|
31
|
+
readonly token?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One settings dialog for everything the signed-in user owns: the profile, a
|
|
35
|
+
* place for personal preferences, and their skills.
|
|
36
|
+
*
|
|
37
|
+
* It replaces the separate profile modal rather than sitting beside it — the
|
|
38
|
+
* section list is the single entry point — and it is deliberately a plain
|
|
39
|
+
* tablist inside the shared dialog shell: on a narrow screen the same element
|
|
40
|
+
* becomes a horizontal strip instead of a second navigation screen.
|
|
41
|
+
*/
|
|
42
|
+
export declare function QaUserSettingsDialog(props: QaUserSettingsDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=UserSettingsDialog.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { QaSkillDiagnostic } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Audience-facing copy for the settings dialog. The Host sends stable codes
|
|
4
|
+
* and never Russian prose, so every message a user reads is written here.
|
|
5
|
+
*/
|
|
6
|
+
/** One message per diagnostic code; `detail` carries the offending value. */
|
|
7
|
+
export declare function diagnosticMessage(diagnostic: QaSkillDiagnostic): string;
|
|
8
|
+
/**
|
|
9
|
+
* Turn one remote refusal into copy. The Host folds domain failures into a
|
|
10
|
+
* `(reason: <code>)` marker on the wire message; anything else — a transport
|
|
11
|
+
* fault, an unknown code — reads as the generic failure.
|
|
12
|
+
*/
|
|
13
|
+
export declare function skillFailureCopy(error: unknown): string;
|
|
14
|
+
/** Whether a failure is the optimistic-concurrency refusal. */
|
|
15
|
+
export declare function isSkillConflict(error: unknown): boolean;
|
|
16
|
+
export declare const SKILLS_EMPTY_COPY: {
|
|
17
|
+
readonly title: "У вас пока нет навыков.";
|
|
18
|
+
readonly body: "Навык — это набор инструкций, который помогает ассистенту стабильно выполнять повторяющиеся задачи.";
|
|
19
|
+
readonly action: "Создать первый навык";
|
|
20
|
+
};
|
|
21
|
+
export declare const SKILLS_TOOLS_HINT = "\u0418\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u044B, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u044D\u0442\u043E\u0442 \u043D\u0430\u0432\u044B\u043A. \u041E\u043D\u0438 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442 \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0445 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0439.";
|
|
22
|
+
export declare const SKILLS_DESCRIPTION_HINT = "\u041A\u0440\u0430\u0442\u043A\u043E \u043E\u043F\u0438\u0448\u0438\u0442\u0435, \u0447\u0442\u043E \u0434\u0435\u043B\u0430\u0435\u0442 \u043D\u0430\u0432\u044B\u043A \u0438 \u0432 \u043A\u0430\u043A\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044F\u0445 \u0435\u0433\u043E \u0441\u0442\u043E\u0438\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C.";
|
|
23
|
+
export declare const SKILLS_NAME_HINT = "\u0421\u0442\u0440\u043E\u0447\u043D\u044B\u0435 \u043B\u0430\u0442\u0438\u043D\u0441\u043A\u0438\u0435 \u0431\u0443\u043A\u0432\u044B, \u0446\u0438\u0444\u0440\u044B \u0438 \u0434\u0435\u0444\u0438\u0441\u044B. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: jira-investigation.";
|
|
24
|
+
export declare const SKILLS_BEHAVIOUR_HINT = "\u00AB\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u00BB \u0437\u043D\u0430\u0447\u0438\u0442, \u0447\u0442\u043E \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C \u043D\u0430\u0432\u044B\u043A \u0441\u0430\u043C, \u043A\u043E\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043E\u0432\u043F\u0430\u0434\u0451\u0442 \u0441 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\u043C. \u0421\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u043D\u0430\u0432\u044B\u043A\u0430 \u043D\u0435 \u0445\u0440\u0430\u043D\u0438\u0442\u0441\u044F \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435 \u043F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u043E.";
|
|
25
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { QaSkillDiagnostic, QaSkillDocument, QaSkillDraftInput, QaSkillSummary } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The editor's draft: a plain, mutable-shaped snapshot of one skill, plus the
|
|
4
|
+
* pure helpers the pages share.
|
|
5
|
+
*
|
|
6
|
+
* This module holds no serializer on purpose. The Host owns the file format;
|
|
7
|
+
* the editor checks the subset of rules it can check by itself — the name
|
|
8
|
+
* grammar, the required fields, the declared tools — and asks the Host for the
|
|
9
|
+
* rest: the exact file, the operator's size limit, the preserved frontmatter.
|
|
10
|
+
* A YAML library's Node build carries `require` calls the browser module
|
|
11
|
+
* loader cannot answer, so the format's YAML half stays on the Host.
|
|
12
|
+
*/
|
|
13
|
+
export interface QaSkillDraft {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly whenToUse: string;
|
|
17
|
+
readonly modelInvocable: boolean;
|
|
18
|
+
readonly userInvocable: boolean;
|
|
19
|
+
readonly allowedTools: readonly string[];
|
|
20
|
+
readonly body: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function emptyDraft(): QaSkillDraft;
|
|
23
|
+
export declare function draftFromDocument(document: QaSkillDocument): QaSkillDraft;
|
|
24
|
+
/** Whether a fresh draft carries anything worth warning about on exit. */
|
|
25
|
+
export declare function draftHasContent(draft: QaSkillDraft): boolean;
|
|
26
|
+
/** Collapse diagnostics that describe the same thing for the same field. */
|
|
27
|
+
export declare function mergeDiagnostics(...groups: readonly (readonly QaSkillDiagnostic[])[]): readonly QaSkillDiagnostic[];
|
|
28
|
+
export declare function draftIsDirty(draft: QaSkillDraft, document: QaSkillDocument): boolean;
|
|
29
|
+
export interface QaSkillDraftDiagnostics {
|
|
30
|
+
readonly availableTools: readonly string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The rules the editor checks by itself, so typing is answered immediately.
|
|
34
|
+
* The size limit, the preserved frontmatter and the serialized file are the
|
|
35
|
+
* Host's business and arrive from it; the Host also re-checks all of this on
|
|
36
|
+
* every write, so nothing here is the authority.
|
|
37
|
+
*/
|
|
38
|
+
export declare function draftDiagnostics(draft: QaSkillDraft, options: QaSkillDraftDiagnostics): readonly QaSkillDiagnostic[];
|
|
39
|
+
/** Whether the draft is complete enough to send. */
|
|
40
|
+
export declare function draftIsSavable(draft: QaSkillDraft): boolean;
|
|
41
|
+
export declare function draftInput(draft: QaSkillDraft, revision: string | null): QaSkillDraftInput;
|
|
42
|
+
/** The terse line under a catalog row: invocation, command, tool count. */
|
|
43
|
+
export declare function skillMetaLine(skill: QaSkillSummary): string;
|
|
44
|
+
/** Tools the catalog cannot use right now, as the row's warning text. */
|
|
45
|
+
export declare function skillToolWarning(skill: QaSkillSummary): string | null;
|
|
46
|
+
/** Case-insensitive search over the fields the catalog offers. */
|
|
47
|
+
export declare function skillMatchesQuery(skill: QaSkillSummary, query: string): boolean;
|
|
48
|
+
/** Editing one tool name out of a draft, wherever the picker put it. */
|
|
49
|
+
export declare function withToolRemoved(tools: readonly string[], name: string): readonly string[];
|
|
50
|
+
export declare function withToolAdded(tools: readonly string[], name: string): readonly string[];
|
|
51
|
+
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Field primitives for the settings dialog. The plugin's host-facing settings
|
|
4
|
+
* card owns `qa-card-*`, whose stylesheet is injected only where that card is
|
|
5
|
+
* mounted; the QA page carries its own `dsh-qa-settings-*` rules instead, so
|
|
6
|
+
* the dialog looks the same whether or not a loopback operator ever opened
|
|
7
|
+
* the deployment settings.
|
|
8
|
+
*/
|
|
9
|
+
export interface QaSettingsFieldProps {
|
|
10
|
+
readonly label: string;
|
|
11
|
+
/** Secondary line under the control; not part of the field's name. */
|
|
12
|
+
readonly hint?: string;
|
|
13
|
+
readonly children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function QaSettingsField(props: QaSettingsFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function QaSettingsSection(props: {
|
|
17
|
+
readonly title: string;
|
|
18
|
+
readonly aside?: ReactNode;
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function QaSettingsToggle(props: {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly checked: boolean;
|
|
24
|
+
readonly disabled?: boolean;
|
|
25
|
+
readonly hint?: string;
|
|
26
|
+
readonly onChange: (checked: boolean) => void;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare function QaSettingsNotice(props: {
|
|
29
|
+
readonly tone: "info" | "warn" | "error";
|
|
30
|
+
readonly children: ReactNode;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function QaSettingsActions(props: {
|
|
33
|
+
readonly children: ReactNode;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function QaSettingsButton(props: {
|
|
36
|
+
readonly label: string;
|
|
37
|
+
readonly tone?: "primary" | "plain" | "danger";
|
|
38
|
+
readonly type?: "button" | "submit";
|
|
39
|
+
readonly disabled?: boolean;
|
|
40
|
+
readonly title?: string;
|
|
41
|
+
readonly onClick?: () => void;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/** Trim an optional string; a blank value collapses to null. */
|
|
2
2
|
export declare function optionalText(value: string | null | undefined): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* Whether a configured directory is absolute. The rule reads a drive-letter
|
|
5
|
+
* path as absolute on every platform, like `session.cwd` does: a deployment
|
|
6
|
+
* profile is authored on one machine and may be read on another, so a
|
|
7
|
+
* Windows-style root is not a mistake to reject on a POSIX host.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isAbsoluteDirectoryPath(value: string): boolean;
|
|
3
10
|
/**
|
|
4
11
|
* Shared numeric guard for operator-tuned limits: the value has to be a safe
|
|
5
12
|
* integer inside [min, max], and every rejection carries the same message.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { QaSurfaceConfig, ResolvedQaSurfaceConfig } from "../types.js";
|
|
2
|
+
type ToolsSlice = ResolvedQaSurfaceConfig["tools"];
|
|
3
|
+
/** Resolve the QA tool delivery domain: activation trigger, policy, and scope. */
|
|
4
|
+
export declare function resolveTools(input: QaSurfaceConfig): ToolsSlice;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ULID generation for artifact ids (§18).
|
|
3
|
+
*
|
|
4
|
+
* `doc_<ULID>` — 48 bits of time followed by 80 bits of randomness, encoded in
|
|
5
|
+
* Crockford base32. The time prefix keeps a directory listing chronological,
|
|
6
|
+
* and the randomness keeps ids unguessable without a UUID dependency.
|
|
7
|
+
*/
|
|
8
|
+
/** A fresh ULID for the current millisecond. */
|
|
9
|
+
export declare function createUlid(now?: number): string;
|
|
10
|
+
/** A fresh artifact id: `doc_<ULID>`. */
|
|
11
|
+
export declare function createArtifactId(now?: number): string;
|
|
12
|
+
/** Whether a string is an artifact id this pipeline could have issued. */
|
|
13
|
+
export declare function isArtifactId(value: string): boolean;
|
|
14
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest construction and persistence (§19).
|
|
3
|
+
*
|
|
4
|
+
* The manifest is the source of truth about an artifact: which operation,
|
|
5
|
+
* which backends and versions, which template (and its hash), which files came
|
|
6
|
+
* out, which warnings were raised, and which session/workspace the bundle
|
|
7
|
+
* belongs to. Logical reproducibility rests on it, because byte-level
|
|
8
|
+
* reproducibility of DOCX/PDF cannot be promised (§31).
|
|
9
|
+
*/
|
|
10
|
+
import type { BackendInfo, DocumentFileResult, DocumentFormat, DocumentManifest, DocumentWarning } from "../types.js";
|
|
11
|
+
import type { ArtifactStore } from "./store.js";
|
|
12
|
+
export declare const MANIFEST_FILE = "manifest.json";
|
|
13
|
+
export declare const MANIFEST_SCHEMA_VERSION: 1;
|
|
14
|
+
export interface BuildManifestInput {
|
|
15
|
+
readonly artifactId: string;
|
|
16
|
+
readonly operation: DocumentManifest["operation"];
|
|
17
|
+
readonly createdAt: string;
|
|
18
|
+
readonly input: DocumentManifest["input"];
|
|
19
|
+
readonly outputs: DocumentManifest["outputs"];
|
|
20
|
+
readonly template?: string;
|
|
21
|
+
readonly templateSha256?: string;
|
|
22
|
+
readonly backends: Readonly<Record<string, BackendInfo>>;
|
|
23
|
+
readonly warnings: readonly DocumentWarning[];
|
|
24
|
+
readonly scope: DocumentManifest["scope"];
|
|
25
|
+
}
|
|
26
|
+
export declare function buildManifest(input: BuildManifestInput): DocumentManifest;
|
|
27
|
+
export declare function writeManifest(store: ArtifactStore, artifactId: string, manifest: DocumentManifest): Promise<string>;
|
|
28
|
+
export declare function readManifest(store: ArtifactStore, artifactId: string): Promise<DocumentManifest>;
|
|
29
|
+
/** Project a tool-level file result onto the manifest's output record. */
|
|
30
|
+
export declare function outputRecord(file: DocumentFileResult): DocumentManifest["outputs"][number];
|
|
31
|
+
export declare function formatOfOperation(operation: DocumentManifest["operation"]): DocumentFormat | "unknown";
|
|
32
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact bundle storage (§18, §47).
|
|
3
|
+
*
|
|
4
|
+
* One directory per operation:
|
|
5
|
+
*
|
|
6
|
+
* ```text
|
|
7
|
+
* <root>/<artifact-id>/
|
|
8
|
+
* manifest.json
|
|
9
|
+
* source.md
|
|
10
|
+
* input/original.pdf
|
|
11
|
+
* assets/
|
|
12
|
+
* output.docx
|
|
13
|
+
* extracted.md
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Everything the store writes goes through a root-relative path that is
|
|
17
|
+
* validated first, and every file lands atomically (temp file + rename) so a
|
|
18
|
+
* crashed host never leaves a half-written artifact that a later read would
|
|
19
|
+
* trust. Job temp directories live under `<root>/.tmp` and are removed on both
|
|
20
|
+
* success and failure (§47).
|
|
21
|
+
*/
|
|
22
|
+
export interface FileFingerprint {
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly size: number;
|
|
25
|
+
readonly sha256: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function sha256Hex(data: string | Buffer): string;
|
|
28
|
+
export declare function sha256OfFile(filePath: string): Promise<string>;
|
|
29
|
+
export interface ArtifactStoreOptions {
|
|
30
|
+
/** Directory the bundles live in; created on demand. */
|
|
31
|
+
readonly root: string;
|
|
32
|
+
}
|
|
33
|
+
export declare class ArtifactStore {
|
|
34
|
+
readonly root: string;
|
|
35
|
+
constructor(options: ArtifactStoreOptions);
|
|
36
|
+
/** Absolute path of a root-relative artifact member, containment checked. */
|
|
37
|
+
path(relativePath: string): string;
|
|
38
|
+
artifactDir(artifactId: string): string;
|
|
39
|
+
/** Prepare a fresh bundle directory and return its id. */
|
|
40
|
+
create(now?: number): Promise<{
|
|
41
|
+
artifactId: string;
|
|
42
|
+
dir: string;
|
|
43
|
+
}>;
|
|
44
|
+
ensureDir(relativePath: string): Promise<string>;
|
|
45
|
+
/** Atomically write a root-relative member. */
|
|
46
|
+
write(relativePath: string, data: string | Buffer): Promise<FileFingerprint>;
|
|
47
|
+
read(relativePath: string): Promise<Buffer>;
|
|
48
|
+
fingerprint(relativePath: string): Promise<FileFingerprint>;
|
|
49
|
+
exists(relativePath: string): Promise<boolean>;
|
|
50
|
+
/** Job-scoped temp directory: never an artifact, always removed (§47). */
|
|
51
|
+
createWorkDir(jobId: string): Promise<string>;
|
|
52
|
+
removeWorkDir(dir: string): Promise<void>;
|
|
53
|
+
/** Bundle directories, newest first, with their modification time. */
|
|
54
|
+
list(): Promise<{
|
|
55
|
+
artifactId: string;
|
|
56
|
+
dir: string;
|
|
57
|
+
modifiedAt: Date;
|
|
58
|
+
}[]>;
|
|
59
|
+
/** Retention sweep (§41): drop bundles older than `maxAgeDays`. */
|
|
60
|
+
cleanup(options: {
|
|
61
|
+
readonly maxAgeDays: number;
|
|
62
|
+
readonly now?: Date;
|
|
63
|
+
}): Promise<{
|
|
64
|
+
removed: string[];
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability discovery (§43) and backend health (§42).
|
|
3
|
+
*
|
|
4
|
+
* Health separates required from optional backends on purpose: a deployment
|
|
5
|
+
* without Docling cannot extract PDFs, but it still creates documents, so the
|
|
6
|
+
* subsystem reports `degraded` and names what is missing instead of declaring
|
|
7
|
+
* itself down. An optional backend that was never enabled reports `disabled`,
|
|
8
|
+
* which is not a fault.
|
|
9
|
+
*/
|
|
10
|
+
import type { ResolvedQaDocumentsConfig } from "./config.js";
|
|
11
|
+
import { type ProviderSeams, type ProviderSet } from "./providers/registry.js";
|
|
12
|
+
import type { DocumentCapabilities, DocumentHealth } from "./types.js";
|
|
13
|
+
import { type TemplateRegistry } from "./templates/registry.js";
|
|
14
|
+
export interface HealthOptions {
|
|
15
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
16
|
+
readonly providers: ProviderSet;
|
|
17
|
+
/** Probe the two process-based backends; `false` answers from configuration. */
|
|
18
|
+
readonly probeProcessBackends?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function documentHealth(options: HealthOptions): Promise<DocumentHealth>;
|
|
21
|
+
export declare function documentCapabilities(options: {
|
|
22
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
23
|
+
readonly providers: ProviderSet;
|
|
24
|
+
readonly templates: TemplateRegistry;
|
|
25
|
+
}): DocumentCapabilities;
|
|
26
|
+
/** Load the template registry of a workspace for capability reporting. */
|
|
27
|
+
export declare function capabilitiesForRoot(options: {
|
|
28
|
+
readonly config: ResolvedQaDocumentsConfig;
|
|
29
|
+
readonly templateRoot: string | undefined;
|
|
30
|
+
readonly seams?: ProviderSeams;
|
|
31
|
+
}): Promise<DocumentCapabilities>;
|
|
32
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration of the document subsystem (§20).
|
|
3
|
+
*
|
|
4
|
+
* The subsystem is part of the `qa-surface` namespace, so this resolver
|
|
5
|
+
* follows the same shape as the other domains: it normalizes, validates and
|
|
6
|
+
* freezes, and the schema in `src/config.ts` takes every default from
|
|
7
|
+
* {@link DEFAULT_QA_DOCUMENTS_CONFIG} so an untouched deployment sends the
|
|
8
|
+
* resolver nothing at all.
|
|
9
|
+
*
|
|
10
|
+
* Environment overrides are applied in `applyDocumentsEnvOverrides`, on the
|
|
11
|
+
* way into the plugin, and only for the documented variables — a deployment
|
|
12
|
+
* that injects secrets into the process environment does not thereby get to
|
|
13
|
+
* reconfigure the pipeline.
|
|
14
|
+
*/
|
|
15
|
+
import { type QaDocumentsConfig, type ResolvedQaDocumentsConfig } from "./defaults.js";
|
|
16
|
+
export { DEFAULT_QA_DOCUMENTS_CONFIG, type QaDocumentsCommandConfig, type QaDocumentsConfig, type QaDocumentsCreateConfig, type QaDocumentsEndpointConfig, type QaDocumentsExtractionConfig, type QaDocumentsLimitsConfig, type QaDocumentsRetentionConfig, type QaDocumentsStorageConfig, type QaDocumentsTemplatesConfig, type QaDocumentsWorkersConfig, type ResolvedQaDocumentsConfig, } from "./defaults.js";
|
|
17
|
+
/** Materialize and validate the document configuration. */
|
|
18
|
+
export declare function resolveDocumentsConfig(input?: QaDocumentsConfig): ResolvedQaDocumentsConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Apply the documented environment overrides (§20). Kept out of
|
|
21
|
+
* {@link resolveDocumentsConfig} so the resolver stays a pure function of its
|
|
22
|
+
* input — configuration tests never depend on the ambient environment.
|
|
23
|
+
*/
|
|
24
|
+
export declare function applyDocumentsEnvOverrides(config: QaDocumentsConfig, env: NodeJS.ProcessEnv): QaDocumentsConfig;
|
|
25
|
+
/** Milliseconds a retention sweep interval would wait. */
|
|
26
|
+
export declare function retentionIntervalMs(config: ResolvedQaDocumentsConfig): number;
|
|
27
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical document defaults (§20).
|
|
3
|
+
*
|
|
4
|
+
* This module must stay free of Node builtins: it is the only part of the
|
|
5
|
+
* document subsystem the browser settings bundle reaches (through the QA
|
|
6
|
+
* surface's resolved configuration), and the page cannot load `node:*`. The
|
|
7
|
+
* resolver and everything that touches the filesystem live in `config.ts`,
|
|
8
|
+
* which imports these values.
|
|
9
|
+
*/
|
|
10
|
+
import type { CreateFormat, ExtractionMode, OcrMode, PdfMode } from "./types.js";
|
|
11
|
+
export interface QaDocumentsStorageConfig {
|
|
12
|
+
/** Absolute artifact root; `null` means `<session cwd>/.qa/artifacts/documents`. */
|
|
13
|
+
readonly root?: string | null;
|
|
14
|
+
readonly retainSource?: boolean;
|
|
15
|
+
readonly retainInputs?: boolean;
|
|
16
|
+
/** Extra roots an input file may be read from, beside the session workspace. */
|
|
17
|
+
readonly allowedInputRoots?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
export interface QaDocumentsTemplatesConfig {
|
|
20
|
+
/** Absolute template root; `null` probes the session workspace. */
|
|
21
|
+
readonly root?: string | null;
|
|
22
|
+
readonly default?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface QaDocumentsCreateConfig {
|
|
25
|
+
readonly defaultPdfMode?: PdfMode;
|
|
26
|
+
readonly allowFormats?: readonly CreateFormat[];
|
|
27
|
+
readonly allowRawMarkup?: boolean;
|
|
28
|
+
readonly toc?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface QaDocumentsExtractionConfig {
|
|
31
|
+
readonly defaultMode?: ExtractionMode;
|
|
32
|
+
readonly ocr?: OcrMode;
|
|
33
|
+
readonly ocrLanguages?: readonly string[];
|
|
34
|
+
readonly extractImages?: boolean;
|
|
35
|
+
readonly extractTables?: boolean;
|
|
36
|
+
readonly preservePageMarkers?: boolean;
|
|
37
|
+
readonly allowFallback?: boolean;
|
|
38
|
+
/** Markdown returned inline to the model is capped at this many characters. */
|
|
39
|
+
readonly maxInlineChars?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface QaDocumentsEndpointConfig {
|
|
42
|
+
readonly enabled?: boolean;
|
|
43
|
+
readonly baseUrl?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface QaDocumentsCommandConfig {
|
|
46
|
+
readonly enabled?: boolean;
|
|
47
|
+
readonly executable?: string;
|
|
48
|
+
readonly timeoutMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface QaDocumentsWorkersConfig {
|
|
51
|
+
readonly renderConcurrency?: number;
|
|
52
|
+
readonly extractionConcurrency?: number;
|
|
53
|
+
readonly ocrConcurrency?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface QaDocumentsRetentionConfig {
|
|
56
|
+
readonly enabled?: boolean;
|
|
57
|
+
readonly maxAgeDays?: number;
|
|
58
|
+
readonly cleanupIntervalHours?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface QaDocumentsLimitsConfig {
|
|
61
|
+
readonly maxInputBytes?: number;
|
|
62
|
+
readonly maxMarkdownChars?: number;
|
|
63
|
+
readonly maxPages?: number;
|
|
64
|
+
readonly maxExtractedImages?: number;
|
|
65
|
+
readonly maxAssetBytes?: number;
|
|
66
|
+
readonly maxResponseBytes?: number;
|
|
67
|
+
readonly maxExtractedMarkdownBytes?: number;
|
|
68
|
+
readonly allowedAssetMimeTypes?: readonly string[];
|
|
69
|
+
}
|
|
70
|
+
export interface QaDocumentsConfig {
|
|
71
|
+
readonly enabled?: boolean;
|
|
72
|
+
readonly storage?: QaDocumentsStorageConfig;
|
|
73
|
+
readonly templates?: QaDocumentsTemplatesConfig;
|
|
74
|
+
readonly create?: QaDocumentsCreateConfig;
|
|
75
|
+
readonly extraction?: QaDocumentsExtractionConfig;
|
|
76
|
+
readonly docling?: QaDocumentsEndpointConfig & {
|
|
77
|
+
readonly timeoutMs?: number;
|
|
78
|
+
};
|
|
79
|
+
readonly pandoc?: QaDocumentsCommandConfig;
|
|
80
|
+
readonly libreoffice?: QaDocumentsCommandConfig;
|
|
81
|
+
readonly typst?: QaDocumentsCommandConfig;
|
|
82
|
+
readonly markitdown?: QaDocumentsCommandConfig;
|
|
83
|
+
readonly workers?: QaDocumentsWorkersConfig;
|
|
84
|
+
readonly retention?: QaDocumentsRetentionConfig;
|
|
85
|
+
readonly limits?: QaDocumentsLimitsConfig;
|
|
86
|
+
}
|
|
87
|
+
export interface ResolvedQaDocumentsConfig {
|
|
88
|
+
readonly enabled: boolean;
|
|
89
|
+
readonly storage: {
|
|
90
|
+
readonly root: string | null;
|
|
91
|
+
readonly retainSource: boolean;
|
|
92
|
+
readonly retainInputs: boolean;
|
|
93
|
+
readonly allowedInputRoots: readonly string[];
|
|
94
|
+
};
|
|
95
|
+
readonly templates: {
|
|
96
|
+
readonly root: string | null;
|
|
97
|
+
readonly default: string;
|
|
98
|
+
};
|
|
99
|
+
readonly create: {
|
|
100
|
+
readonly defaultPdfMode: PdfMode;
|
|
101
|
+
readonly allowFormats: readonly CreateFormat[];
|
|
102
|
+
readonly allowRawMarkup: boolean;
|
|
103
|
+
readonly toc: boolean;
|
|
104
|
+
};
|
|
105
|
+
readonly extraction: {
|
|
106
|
+
readonly defaultMode: ExtractionMode;
|
|
107
|
+
readonly ocr: OcrMode;
|
|
108
|
+
readonly ocrLanguages: readonly string[];
|
|
109
|
+
readonly extractImages: boolean;
|
|
110
|
+
readonly extractTables: boolean;
|
|
111
|
+
readonly preservePageMarkers: boolean;
|
|
112
|
+
readonly allowFallback: boolean;
|
|
113
|
+
readonly maxInlineChars: number;
|
|
114
|
+
};
|
|
115
|
+
readonly docling: {
|
|
116
|
+
readonly enabled: boolean;
|
|
117
|
+
readonly baseUrl: string;
|
|
118
|
+
readonly timeoutMs: number;
|
|
119
|
+
};
|
|
120
|
+
readonly pandoc: {
|
|
121
|
+
readonly executable: string;
|
|
122
|
+
readonly timeoutMs: number;
|
|
123
|
+
};
|
|
124
|
+
readonly libreoffice: {
|
|
125
|
+
readonly executable: string;
|
|
126
|
+
readonly timeoutMs: number;
|
|
127
|
+
};
|
|
128
|
+
readonly typst: {
|
|
129
|
+
readonly enabled: boolean;
|
|
130
|
+
readonly executable: string;
|
|
131
|
+
readonly timeoutMs: number;
|
|
132
|
+
};
|
|
133
|
+
readonly markitdown: {
|
|
134
|
+
readonly enabled: boolean;
|
|
135
|
+
readonly executable: string;
|
|
136
|
+
readonly timeoutMs: number;
|
|
137
|
+
};
|
|
138
|
+
readonly workers: {
|
|
139
|
+
readonly renderConcurrency: number;
|
|
140
|
+
readonly extractionConcurrency: number;
|
|
141
|
+
readonly ocrConcurrency: number;
|
|
142
|
+
};
|
|
143
|
+
readonly retention: {
|
|
144
|
+
readonly enabled: boolean;
|
|
145
|
+
readonly maxAgeDays: number;
|
|
146
|
+
readonly cleanupIntervalHours: number;
|
|
147
|
+
};
|
|
148
|
+
readonly limits: {
|
|
149
|
+
readonly maxInputBytes: number;
|
|
150
|
+
readonly maxMarkdownChars: number;
|
|
151
|
+
readonly maxPages: number;
|
|
152
|
+
readonly maxExtractedImages: number;
|
|
153
|
+
readonly maxAssetBytes: number;
|
|
154
|
+
readonly maxResponseBytes: number;
|
|
155
|
+
readonly maxExtractedMarkdownBytes: number;
|
|
156
|
+
readonly allowedAssetMimeTypes: readonly string[];
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/** The canonical resolved configuration; the schema and resolver both use it. */
|
|
160
|
+
export declare const DEFAULT_QA_DOCUMENTS_CONFIG: ResolvedQaDocumentsConfig;
|
|
161
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed failures of the document pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Every failure the agent can observe carries a stable machine-readable code
|
|
5
|
+
* (§24) and the backend that produced it. Backend output is never forwarded
|
|
6
|
+
* verbatim: {@link sanitizeBackendOutput} strips ANSI escapes, collapses
|
|
7
|
+
* whitespace, replaces absolute paths with the placeholder the operator can
|
|
8
|
+
* recognize as "inside the sandbox" and caps the length, so a converter's
|
|
9
|
+
* stderr cannot leak the deployment's layout or the document's content into a
|
|
10
|
+
* model request.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DOCUMENT_ERROR_CODES: readonly ["INVALID_INPUT", "UNSUPPORTED_FORMAT", "UNSUPPORTED_CONVERSION", "INPUT_TOO_LARGE", "DOCUMENT_TOO_LARGE", "FILE_NOT_FOUND", "TEMPLATE_NOT_FOUND", "INVALID_TEMPLATE", "INVALID_ASSET", "PATH_NOT_ALLOWED", "ENCRYPTED_DOCUMENT", "MACRO_ENABLED_DOCUMENT", "OCR_FAILED", "EXTRACTION_FAILED", "RENDER_FAILED", "CONVERSION_FAILED", "BACKEND_UNAVAILABLE", "BACKEND_TIMEOUT", "BACKEND_FAILED", "ARTIFACT_WRITE_FAILED"];
|
|
13
|
+
export type DocumentErrorCode = (typeof DOCUMENT_ERROR_CODES)[number];
|
|
14
|
+
export interface DocumentErrorFields {
|
|
15
|
+
readonly backend?: string;
|
|
16
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
17
|
+
readonly retryable?: boolean;
|
|
18
|
+
readonly cause?: unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare class DocumentError extends Error {
|
|
21
|
+
readonly code: DocumentErrorCode;
|
|
22
|
+
readonly retryable: boolean;
|
|
23
|
+
readonly backend: string | undefined;
|
|
24
|
+
readonly details: Readonly<Record<string, unknown>> | undefined;
|
|
25
|
+
constructor(code: DocumentErrorCode, message: string, fields?: DocumentErrorFields);
|
|
26
|
+
/** The structured form the manifest and the logs carry (§24). */
|
|
27
|
+
toShape(): {
|
|
28
|
+
readonly code: DocumentErrorCode;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
readonly retryable: boolean;
|
|
31
|
+
readonly backend?: string;
|
|
32
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Make a backend's diagnostic text safe to show: no escapes, no absolute
|
|
37
|
+
* paths, one line per statement, at most `max` characters.
|
|
38
|
+
*/
|
|
39
|
+
export declare function sanitizeBackendOutput(text: string, max?: number): string;
|
|
40
|
+
/** Wrap any thrown value into a {@link DocumentError} without losing its code. */
|
|
41
|
+
export declare function asDocumentError(error: unknown, fallbackCode: DocumentErrorCode, backend?: string): DocumentError;
|
|
42
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document subsystem of `dsh-qa-surface` (§38).
|
|
3
|
+
*
|
|
4
|
+
* Markdown is the canonical source for everything the agent creates, the
|
|
5
|
+
* backends that turn it into DOCX/PDF (or read it back out of them) live
|
|
6
|
+
* behind the provider interfaces in `providers/`, and the four semantic tools
|
|
7
|
+
* in `tools/` are the only surface the model ever sees. Everything else —
|
|
8
|
+
* artifact bundles, manifests, template resolution, path containment, limits —
|
|
9
|
+
* exists to make those four tools predictable.
|
|
10
|
+
*
|
|
11
|
+
* The public entry point is {@link installDocumentSubsystem}.
|
|
12
|
+
*/
|
|
13
|
+
export { DOCUMENT_ERROR_CODES, DocumentError, asDocumentError, sanitizeBackendOutput, type DocumentErrorCode, type DocumentErrorFields, } from "./errors.js";
|
|
14
|
+
export { DEFAULT_QA_DOCUMENTS_CONFIG, applyDocumentsEnvOverrides, resolveDocumentsConfig, retentionIntervalMs, type QaDocumentsConfig, type ResolvedQaDocumentsConfig, } from "./config.js";
|
|
15
|
+
export type * from "./types.js";
|
|
16
|
+
export { createDocumentRuntime, DocumentRuntime, type DocumentRuntimeOptions, } from "./runtime.js";
|
|
17
|
+
export { createDocumentTools, registerDocumentTools, DOCUMENT_TOOL_NAMES, DOCUMENT_CONVERT_TOOL, DOCUMENT_CREATE_TOOL, DOCUMENT_INSPECT_TOOL, DOCUMENT_TO_MARKDOWN_TOOL, type DocumentToolRegistry, } from "./tools/index.js";
|
|
18
|
+
export { createProviders, type ProviderSeams, type ProviderSet, } from "./providers/registry.js";
|
|
19
|
+
export { documentCapabilities, documentHealth } from "./capabilities.js";
|
|
20
|
+
export { ArtifactStore, sha256Hex, sha256OfFile } from "./artifacts/store.js";
|
|
21
|
+
export { createArtifactId, createUlid, isArtifactId } from "./artifacts/ids.js";
|
|
22
|
+
export { MANIFEST_FILE, MANIFEST_SCHEMA_VERSION, readManifest, writeManifest, } from "./artifacts/manifest.js";
|
|
23
|
+
export { BUILTIN_TEMPLATE_NAME, TEMPLATE_MANIFEST_FILE, loadTemplateRegistry, templateNames, type DocumentTemplate, type TemplateRegistry, } from "./templates/registry.js";
|
|
24
|
+
export { resolveTemplate, type ResolvedTemplate, } from "./templates/resolver.js";
|
|
25
|
+
export { CONVERSION_ROUTES } from "./orchestrator/convert-document.js";
|
|
26
|
+
export { defaultArtifactRoot, resolveDocumentScope, type DocumentScope, type ResolvedDocumentScope, } from "./orchestrator/scope.js";
|
|
27
|
+
export { silentDocumentLogger, type DocumentLogger, } from "./orchestrator/runtime-deps.js";
|
|
28
|
+
export { assertInsideRoot, canonicalizeForContainment, isInsideRoot, resolveInsideRoot, sanitizeFilename, } from "./security/paths.js";
|
|
29
|
+
export { DEFAULT_ASSET_MIME_TYPES, detectFormatByExtension, describeUnsupported, sniffDocument, supportedFormatOf, type SniffedDocument, } from "./security/file-types.js";
|
|
30
|
+
export { applyDirectives } from "./markdown/directives.js";
|
|
31
|
+
export { normalizeExtractedMarkdown } from "./markdown/normalize.js";
|
|
32
|
+
export { parseFrontMatter } from "./markdown/frontmatter.js";
|
|
33
|
+
export { readPdfFacts, readDocxFacts, readDocxMetadata, } from "./inspect/facts.js";
|
|
34
|
+
export { readZipEntries, readZipEntry, readZipEntryByName, } from "./inspect/zip.js";
|
|
35
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
36
|
+
import { type QaDocumentsConfig } from "./config.js";
|
|
37
|
+
import type { DocumentLogger } from "./orchestrator/runtime-deps.js";
|
|
38
|
+
import type { ProviderSeams } from "./providers/registry.js";
|
|
39
|
+
import { DocumentRuntime } from "./runtime.js";
|
|
40
|
+
import { type DocumentToolRegistry } from "./tools/index.js";
|
|
41
|
+
export interface InstallDocumentSubsystemOptions {
|
|
42
|
+
readonly config: QaDocumentsConfig;
|
|
43
|
+
readonly logger: DocumentLogger;
|
|
44
|
+
/** The host tool registry (`ctx.tools`). */
|
|
45
|
+
readonly register: DocumentToolRegistry["register"];
|
|
46
|
+
readonly seams?: ProviderSeams;
|
|
47
|
+
/** Environment overrides are applied by the caller, which owns the process. */
|
|
48
|
+
readonly now?: () => Date;
|
|
49
|
+
}
|
|
50
|
+
export interface DocumentSubsystem {
|
|
51
|
+
readonly runtime: DocumentRuntime;
|
|
52
|
+
readonly toolNames: readonly string[];
|
|
53
|
+
dispose(): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Wire the subsystem into a host context: build the runtime, register the four
|
|
57
|
+
* tools, and schedule the retention sweep when a storage root is pinned.
|
|
58
|
+
*
|
|
59
|
+
* `enabled: false` is answered with `undefined` — the caller then leaves both
|
|
60
|
+
* the tools and the timer absent instead of registering inert definitions.
|
|
61
|
+
*/
|
|
62
|
+
export declare function installDocumentSubsystem(ctx: Context, options: InstallDocumentSubsystemOptions): DocumentSubsystem | undefined;
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|