@yadsh/dsh-qa-surface 0.5.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 +194 -9
- package/compatibility.json +10 -1
- package/cordis.patch.yml +9 -0
- package/lib/account-remotes.js +10 -0
- package/lib/account-remotes.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 +22 -0
- package/lib/accounts/store.js.map +1 -1
- package/lib/client/QaAccountsController.js +29 -0
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaSessionController.js +168 -48
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +125 -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/components/QaChangelog.js +31 -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/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 +72 -24
- 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 +3 -0
- package/lib/client/project-session-state.js.map +1 -1
- 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.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 +157 -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 +1 -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 +5467 -1379
- 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/defaults.js +23 -0
- package/lib/config-resolvers/defaults.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 +288 -0
- 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 +225 -20
- 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 +44 -11
- 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/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/resolve-config.js +5 -0
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +35 -3
- package/lib/secure-session.js.map +1 -1
- package/lib/starters.js +117 -0
- package/lib/starters.js.map +1 -0
- package/lib/typert.host.js +767 -22
- package/lib/typert.remote-client.d.ts +17 -1
- package/lib/typert.remote-client.js +609 -17
- package/lib/types/account-remotes.d.ts +3 -1
- 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 +7 -1
- package/lib/types/client/QaAccountsController.d.ts +7 -1
- package/lib/types/client/QaSessionController.d.ts +12 -0
- package/lib/types/client/QaSurface.d.ts +14 -4
- package/lib/types/client/QaSurfaceGuard.d.ts +27 -0
- package/lib/types/client/QaTranscriptAdapter.d.ts +7 -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/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 +5 -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 +35 -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/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 +75 -3
- 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/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/secure-session.d.ts +24 -2
- package/lib/types/starters.d.ts +45 -0
- package/lib/types/types.d.ts +202 -3
- package/package.json +24 -11
- 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,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
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types of the QA Surface document pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The shapes here are the contract the agent sees (tool inputs and results),
|
|
5
|
+
* the contract the artifact store persists (manifest), and the contract the
|
|
6
|
+
* providers implement. They are deliberately free of any backend vocabulary:
|
|
7
|
+
* a tool result never names pandoc, LibreOffice or Docling, so a provider can
|
|
8
|
+
* be replaced without touching a prompt, a skill or a workflow
|
|
9
|
+
* (docs/specs/document-pipeline.md §4.1, §22).
|
|
10
|
+
*/
|
|
11
|
+
/** Formats the pipeline can read and write. */
|
|
12
|
+
export type DocumentFormat = "md" | "docx" | "pdf";
|
|
13
|
+
/** Formats a document can be created in. */
|
|
14
|
+
export type CreateFormat = "docx" | "pdf";
|
|
15
|
+
/** PDF production route (§14). */
|
|
16
|
+
export type PdfMode = "office" | "typst" | "auto";
|
|
17
|
+
/** Extraction quality/route selector (§9). */
|
|
18
|
+
export type ExtractionMode = "auto" | "fast" | "accurate";
|
|
19
|
+
/** OCR policy (§15.2). */
|
|
20
|
+
export type OcrMode = "auto" | "off" | "force";
|
|
21
|
+
/** Structural classification of an inspected input (§11). */
|
|
22
|
+
export type DetectedFormat = "pdf" | "docx" | "docm" | "markdown" | "unknown";
|
|
23
|
+
/** Stable warning codes; a warning never turns a success into a failure (§25). */
|
|
24
|
+
export type DocumentWarningCode = "OCR_USED" | "TABLE_EXTRACTION_DEGRADED" | "UNSUPPORTED_EMBEDDED_OBJECT" | "FONT_SUBSTITUTED" | "IMAGE_SKIPPED" | "PAGE_LIMIT_REACHED" | "METADATA_PARTIALLY_EXTRACTED" | "BACKEND_FALLBACK_USED" | "FORMAT_FAILED" | "MARKDOWN_TRUNCATED" | "PAGE_SIZE_NOT_APPLIED" | "ASSET_MISSING" | "SOURCE_NOT_RETAINED" | "TEMPLATE_DEFAULTED";
|
|
25
|
+
export interface DocumentWarning {
|
|
26
|
+
readonly code: DocumentWarningCode;
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly backend?: string;
|
|
29
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
30
|
+
}
|
|
31
|
+
/** One artifact file as reported to the agent. */
|
|
32
|
+
export interface DocumentFileResult {
|
|
33
|
+
readonly format: CreateFormat | "md";
|
|
34
|
+
/** Absolute path, inside the session workspace. */
|
|
35
|
+
readonly path: string;
|
|
36
|
+
readonly mediaType: string;
|
|
37
|
+
readonly size: number;
|
|
38
|
+
readonly sha256: string;
|
|
39
|
+
readonly status: "created" | "failed";
|
|
40
|
+
/** Present when `status` is `failed`; the format's own error code. */
|
|
41
|
+
readonly error?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface DocumentAssetInput {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
/** Workspace-relative or absolute path inside the session scope. */
|
|
46
|
+
readonly path?: string;
|
|
47
|
+
/** Inline asset content: base64 data URI or raw base64. */
|
|
48
|
+
readonly dataRef?: string;
|
|
49
|
+
readonly filename?: string;
|
|
50
|
+
readonly mimeType?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface DocumentCreateOptions {
|
|
53
|
+
readonly pdfMode?: PdfMode;
|
|
54
|
+
readonly pageSize?: string;
|
|
55
|
+
readonly locale?: string;
|
|
56
|
+
readonly toc?: boolean;
|
|
57
|
+
readonly preserveSource?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface DocumentCreateInput {
|
|
60
|
+
readonly content: string;
|
|
61
|
+
readonly filename?: string;
|
|
62
|
+
readonly formats: readonly CreateFormat[];
|
|
63
|
+
readonly template?: string;
|
|
64
|
+
readonly title?: string;
|
|
65
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
66
|
+
readonly assets?: readonly DocumentAssetInput[];
|
|
67
|
+
readonly options?: DocumentCreateOptions;
|
|
68
|
+
}
|
|
69
|
+
export interface DocumentCreateResult {
|
|
70
|
+
readonly artifactId: string;
|
|
71
|
+
readonly source?: {
|
|
72
|
+
readonly path: string;
|
|
73
|
+
readonly mediaType: "text/markdown";
|
|
74
|
+
};
|
|
75
|
+
readonly files: readonly DocumentFileResult[];
|
|
76
|
+
readonly template?: string;
|
|
77
|
+
readonly warnings: readonly DocumentWarning[];
|
|
78
|
+
readonly manifestPath: string;
|
|
79
|
+
}
|
|
80
|
+
export interface DocumentToMarkdownInput {
|
|
81
|
+
readonly file: string;
|
|
82
|
+
readonly mode?: ExtractionMode;
|
|
83
|
+
readonly ocr?: OcrMode;
|
|
84
|
+
readonly ocrLanguages?: readonly string[];
|
|
85
|
+
readonly extractImages?: boolean;
|
|
86
|
+
readonly extractTables?: boolean;
|
|
87
|
+
readonly preservePageMarkers?: boolean;
|
|
88
|
+
readonly outputFilename?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface DocumentToMarkdownResult {
|
|
91
|
+
readonly artifactId: string;
|
|
92
|
+
/** Extracted Markdown; truncated to the configured inline budget. */
|
|
93
|
+
readonly markdown: string;
|
|
94
|
+
readonly markdownPath: string;
|
|
95
|
+
readonly assets?: readonly {
|
|
96
|
+
readonly path: string;
|
|
97
|
+
readonly mediaType: string;
|
|
98
|
+
}[];
|
|
99
|
+
readonly pages?: number;
|
|
100
|
+
readonly backend: string;
|
|
101
|
+
readonly warnings: readonly DocumentWarning[];
|
|
102
|
+
readonly manifestPath: string;
|
|
103
|
+
}
|
|
104
|
+
export interface DocumentConvertInput {
|
|
105
|
+
readonly file: string;
|
|
106
|
+
readonly targetFormat: CreateFormat | "md";
|
|
107
|
+
readonly template?: string;
|
|
108
|
+
readonly filename?: string;
|
|
109
|
+
/** Artifact name of the extracted Markdown when the target is `md`. */
|
|
110
|
+
readonly outputFilename?: string;
|
|
111
|
+
readonly options?: {
|
|
112
|
+
readonly pdfMode?: PdfMode;
|
|
113
|
+
readonly ocr?: OcrMode;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export interface DocumentConvertResult {
|
|
117
|
+
readonly artifactId: string;
|
|
118
|
+
readonly files: readonly DocumentFileResult[];
|
|
119
|
+
readonly source: {
|
|
120
|
+
readonly path: string;
|
|
121
|
+
readonly format: DocumentFormat;
|
|
122
|
+
};
|
|
123
|
+
readonly warnings: readonly DocumentWarning[];
|
|
124
|
+
readonly manifestPath: string;
|
|
125
|
+
}
|
|
126
|
+
export interface DocumentInspectInput {
|
|
127
|
+
readonly file: string;
|
|
128
|
+
}
|
|
129
|
+
export interface DocumentInspectResult {
|
|
130
|
+
readonly filename: string;
|
|
131
|
+
readonly format: DetectedFormat;
|
|
132
|
+
readonly mediaType: string;
|
|
133
|
+
readonly size: number;
|
|
134
|
+
readonly sha256: string;
|
|
135
|
+
readonly metadata?: {
|
|
136
|
+
readonly title?: string;
|
|
137
|
+
readonly author?: string;
|
|
138
|
+
readonly createdAt?: string;
|
|
139
|
+
readonly modifiedAt?: string;
|
|
140
|
+
};
|
|
141
|
+
readonly structure?: {
|
|
142
|
+
readonly pages?: number;
|
|
143
|
+
readonly headings?: number;
|
|
144
|
+
readonly tables?: number;
|
|
145
|
+
readonly images?: number;
|
|
146
|
+
};
|
|
147
|
+
readonly encrypted?: boolean;
|
|
148
|
+
readonly macroEnabled?: boolean;
|
|
149
|
+
readonly warnings: readonly DocumentWarning[];
|
|
150
|
+
}
|
|
151
|
+
/** Identifies the backend that produced one output, for the manifest (§19). */
|
|
152
|
+
export interface BackendInfo {
|
|
153
|
+
readonly provider: string;
|
|
154
|
+
readonly version?: string;
|
|
155
|
+
}
|
|
156
|
+
/** Returned by providers that write a file. */
|
|
157
|
+
export interface RenderedArtifact {
|
|
158
|
+
readonly path: string;
|
|
159
|
+
readonly size: number;
|
|
160
|
+
readonly sha256: string;
|
|
161
|
+
readonly backend: BackendInfo;
|
|
162
|
+
readonly warnings: readonly DocumentWarning[];
|
|
163
|
+
}
|
|
164
|
+
export interface RenderDocxInput {
|
|
165
|
+
readonly sourcePath: string;
|
|
166
|
+
readonly outputPath: string;
|
|
167
|
+
readonly workDir: string;
|
|
168
|
+
readonly assetsDir?: string;
|
|
169
|
+
/** Reference DOCX resolved from a template, when the template has one. */
|
|
170
|
+
readonly referenceDocPath?: string;
|
|
171
|
+
readonly templateName?: string;
|
|
172
|
+
readonly title?: string;
|
|
173
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
174
|
+
readonly toc?: boolean;
|
|
175
|
+
readonly locale?: string;
|
|
176
|
+
readonly signal?: AbortSignal;
|
|
177
|
+
}
|
|
178
|
+
export interface RenderPdfInput {
|
|
179
|
+
readonly sourcePath: string;
|
|
180
|
+
readonly outputPath: string;
|
|
181
|
+
readonly workDir: string;
|
|
182
|
+
readonly assetsDir?: string;
|
|
183
|
+
readonly templateName?: string;
|
|
184
|
+
readonly typstTemplateDir?: string;
|
|
185
|
+
readonly pageSize?: string;
|
|
186
|
+
readonly title?: string;
|
|
187
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
188
|
+
readonly toc?: boolean;
|
|
189
|
+
readonly signal?: AbortSignal;
|
|
190
|
+
}
|
|
191
|
+
export interface ExtractInput {
|
|
192
|
+
readonly inputPath: string;
|
|
193
|
+
readonly workDir: string;
|
|
194
|
+
/** Directory extracted images are written into, when extraction asks for them. */
|
|
195
|
+
readonly assetsDir: string;
|
|
196
|
+
readonly ocr: OcrMode;
|
|
197
|
+
readonly ocrLanguages?: readonly string[];
|
|
198
|
+
readonly extractImages: boolean;
|
|
199
|
+
readonly extractTables: boolean;
|
|
200
|
+
readonly preservePageMarkers: boolean;
|
|
201
|
+
readonly maxPages?: number;
|
|
202
|
+
readonly maxImages?: number;
|
|
203
|
+
readonly signal?: AbortSignal;
|
|
204
|
+
}
|
|
205
|
+
export interface ExtractedDocument {
|
|
206
|
+
readonly markdown: string;
|
|
207
|
+
readonly assets: readonly {
|
|
208
|
+
readonly path: string;
|
|
209
|
+
readonly mediaType: string;
|
|
210
|
+
}[];
|
|
211
|
+
readonly pages?: number;
|
|
212
|
+
readonly backend: BackendInfo;
|
|
213
|
+
readonly warnings: readonly DocumentWarning[];
|
|
214
|
+
}
|
|
215
|
+
export interface ConvertPdfInput {
|
|
216
|
+
readonly inputPath: string;
|
|
217
|
+
readonly outputPath: string;
|
|
218
|
+
readonly workDir: string;
|
|
219
|
+
readonly signal?: AbortSignal;
|
|
220
|
+
}
|
|
221
|
+
export interface ConvertedDocument {
|
|
222
|
+
readonly path: string;
|
|
223
|
+
readonly size: number;
|
|
224
|
+
readonly sha256: string;
|
|
225
|
+
readonly backend: BackendInfo;
|
|
226
|
+
readonly warnings: readonly DocumentWarning[];
|
|
227
|
+
}
|
|
228
|
+
/** §22 provider interfaces. A tool never imports a concrete implementation. */
|
|
229
|
+
export interface DocxRenderer {
|
|
230
|
+
readonly name: string;
|
|
231
|
+
render(input: RenderDocxInput): Promise<RenderedArtifact>;
|
|
232
|
+
}
|
|
233
|
+
export interface PdfRenderer {
|
|
234
|
+
readonly name: string;
|
|
235
|
+
render(input: RenderPdfInput): Promise<RenderedArtifact>;
|
|
236
|
+
}
|
|
237
|
+
export interface DocumentExtractor {
|
|
238
|
+
readonly name: string;
|
|
239
|
+
supports(format: DocumentFormat): boolean;
|
|
240
|
+
extract(input: ExtractInput): Promise<ExtractedDocument>;
|
|
241
|
+
}
|
|
242
|
+
export interface DocumentConverter {
|
|
243
|
+
readonly name: string;
|
|
244
|
+
supports(source: DocumentFormat, target: DocumentFormat): boolean;
|
|
245
|
+
convert(input: ConvertPdfInput): Promise<ConvertedDocument>;
|
|
246
|
+
}
|
|
247
|
+
/** Manifest document, written beside every artifact (§19). */
|
|
248
|
+
export interface DocumentManifest {
|
|
249
|
+
readonly schemaVersion: 1;
|
|
250
|
+
readonly artifactId: string;
|
|
251
|
+
readonly operation: "document_create" | "document_to_markdown" | "document_convert";
|
|
252
|
+
readonly createdAt: string;
|
|
253
|
+
readonly input: {
|
|
254
|
+
readonly format: DocumentFormat | "unknown";
|
|
255
|
+
readonly sha256: string;
|
|
256
|
+
readonly filename?: string;
|
|
257
|
+
readonly bytes?: number;
|
|
258
|
+
};
|
|
259
|
+
readonly outputs: readonly {
|
|
260
|
+
readonly format: CreateFormat | "md";
|
|
261
|
+
readonly path: string;
|
|
262
|
+
readonly sha256: string;
|
|
263
|
+
readonly size: number;
|
|
264
|
+
readonly status: "created" | "failed";
|
|
265
|
+
readonly error?: string;
|
|
266
|
+
}[];
|
|
267
|
+
readonly template?: string;
|
|
268
|
+
readonly templateSha256?: string;
|
|
269
|
+
readonly backends: Readonly<Record<string, BackendInfo>>;
|
|
270
|
+
readonly warnings: readonly DocumentWarning[];
|
|
271
|
+
/** Authorization context (§40): what this artifact belongs to. */
|
|
272
|
+
readonly scope: {
|
|
273
|
+
readonly sessionId?: string;
|
|
274
|
+
readonly workspace?: string;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
/** Backend availability, reported by capacity discovery and health (§42). */
|
|
278
|
+
export type BackendStatus = "ok" | "unavailable" | "disabled";
|
|
279
|
+
export interface DocumentHealth {
|
|
280
|
+
readonly status: "ok" | "degraded" | "unavailable";
|
|
281
|
+
readonly required: Readonly<Record<string, BackendStatus>>;
|
|
282
|
+
readonly optional: Readonly<Record<string, BackendStatus>>;
|
|
283
|
+
}
|
|
284
|
+
/** Capability discovery (§43). */
|
|
285
|
+
export interface DocumentCapabilities {
|
|
286
|
+
readonly enabled: boolean;
|
|
287
|
+
readonly create: readonly CreateFormat[];
|
|
288
|
+
readonly extract: readonly DocumentFormat[];
|
|
289
|
+
readonly convert: readonly (readonly [DocumentFormat, DocumentFormat])[];
|
|
290
|
+
readonly ocr: boolean;
|
|
291
|
+
readonly templates: readonly string[];
|
|
292
|
+
readonly pdfModes: readonly PdfMode[];
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=types.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
2
2
|
import type { Context } from "@deepseek-ai/cordis";
|
|
3
3
|
import type { QaTurnSources } from "./provenance/types.js";
|
|
4
|
-
import type { QaAccountProfileInput, QaAccountSession, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaSurfaceConfig, ResolvedQaSurfaceConfig, QaSourceFilePreview, QaWhoamiResult } from "./types.js";
|
|
4
|
+
import type { QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaSurfaceConfig, ResolvedQaSurfaceConfig, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaWhoamiResult, QaPrincipal } from "./types.js";
|
|
5
5
|
export declare const name = "qa-surface";
|
|
6
6
|
export declare const inject: string[];
|
|
7
7
|
import { QA_SURFACE_SETTINGS_NAMESPACE } from "./shared/settings.js";
|
|
@@ -23,13 +23,34 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
23
23
|
private readonly userQuestions;
|
|
24
24
|
private readonly provenance;
|
|
25
25
|
private readonly notes;
|
|
26
|
+
/** Assigned after the admission gate; that gate only reads it per execution. */
|
|
27
|
+
private readonly tools;
|
|
26
28
|
/** Account-remote bodies; the wire signatures stay on this class. */
|
|
27
29
|
private readonly accountRemotes;
|
|
30
|
+
/** Personal skills: storage, the DSH provider and the manual-edit watcher. */
|
|
31
|
+
private readonly personalSkills;
|
|
32
|
+
/** Personal-skill remote bodies; the wire signatures stay on this class. */
|
|
33
|
+
private readonly skillRemotes;
|
|
28
34
|
private readonly launchToken;
|
|
35
|
+
/** Root session principals attested for their owner, never for admin viewing. */
|
|
36
|
+
private readonly integrationPrincipals;
|
|
29
37
|
private webServer;
|
|
30
38
|
private disposeRoute;
|
|
31
39
|
private routeKey;
|
|
40
|
+
/**
|
|
41
|
+
* The document subsystem: its own runtime and the four tool registrations.
|
|
42
|
+
* Rebuilt when the document configuration changes and torn down while the
|
|
43
|
+
* subsystem or the whole surface is disabled.
|
|
44
|
+
*/
|
|
45
|
+
private documents;
|
|
46
|
+
private documentsKey;
|
|
32
47
|
constructor(ctx: Context, entry?: QaSurfaceConfig);
|
|
48
|
+
/** Resolve browser authentication to the caller only; never accepts an id. */
|
|
49
|
+
principalForToken(token: string): QaPrincipal | undefined;
|
|
50
|
+
/** Resolve only a directly QA-owned root session; delegated children fail closed. */
|
|
51
|
+
principalForSession(sessionId: string): QaPrincipal | undefined;
|
|
52
|
+
/** Admit tools that independently enforce the same QA principal boundary. */
|
|
53
|
+
registerPrincipalScopedTools(names: readonly string[]): () => void;
|
|
33
54
|
getConfig(): ResolvedQaSurfaceConfig;
|
|
34
55
|
/**
|
|
35
56
|
* Self-service signup; the first account ever created becomes admin. The
|
|
@@ -61,6 +82,12 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
61
82
|
* store before anything is written.
|
|
62
83
|
*/
|
|
63
84
|
accountsUpdateProfile(token: string, input: QaAccountProfileInput): QaAccountUserPublic;
|
|
85
|
+
/**
|
|
86
|
+
* Replace the caller's own starter buttons. Same self-service contract as
|
|
87
|
+
* the profile write: the token names the only editable account, and the
|
|
88
|
+
* deployment's limits are enforced in the store before anything is written.
|
|
89
|
+
*/
|
|
90
|
+
accountsUpdateStarters(token: string, input: QaAccountStartersInput): QaAccountUserPublic;
|
|
64
91
|
/**
|
|
65
92
|
* Serve the effective QA configuration to the browser. The DSH gateway pins
|
|
66
93
|
* settings RPCs to loopback, so a browser served over the LAN always sees
|
|
@@ -77,7 +104,7 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
77
104
|
createSession(token: string): Promise<string>;
|
|
78
105
|
/** Pin and attest the effective policy. The browser supplies identity only. */
|
|
79
106
|
secureSession(token: string, sessionId: string): Promise<QaLockdownProof>;
|
|
80
|
-
/** Return canonical Host snapshots
|
|
107
|
+
/** Return canonical Host snapshots from plugin-owned durable provenance. */
|
|
81
108
|
sources(token: string, sessionId: string): Promise<readonly QaTurnSources[]>;
|
|
82
109
|
/**
|
|
83
110
|
* The tool calls of one chat that wait for the operator. Read-only: a
|
|
@@ -103,9 +130,52 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
103
130
|
answerQuestion(token: string, sessionId: string, requestId: string, answers: readonly QaQuestionAnswerItem[]): Promise<boolean>;
|
|
104
131
|
/** Close a parked question request without answering it. */
|
|
105
132
|
cancelQuestion(token: string, sessionId: string, requestId: string): Promise<boolean>;
|
|
106
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Narrow read-only preview capability for files already present as sources.
|
|
135
|
+
*
|
|
136
|
+
* The readable roots mirror the per-user execution guard: the chat's own cwd
|
|
137
|
+
* plus the deployment's shared read-only directories and the attachment
|
|
138
|
+
* store. Without that mirroring a source the model was explicitly allowed to
|
|
139
|
+
* read — the normal case for a deployment whose docs and code live beside
|
|
140
|
+
* the per-account scratch directory — could never be opened in the panel.
|
|
141
|
+
*/
|
|
107
142
|
readSourceFile(token: string, sessionId: string, sourcePath: string): Promise<QaSourceFilePreview>;
|
|
143
|
+
/** Every personal skill of the token's account, sorted by name. */
|
|
144
|
+
skillsList(token: string): {
|
|
145
|
+
readonly skills: readonly QaSkillSummary[];
|
|
146
|
+
};
|
|
147
|
+
/** One personal skill with the body, its preserved frontmatter and revision. */
|
|
148
|
+
skillsGet(token: string, name: string): QaSkillDocument;
|
|
149
|
+
/** Create one skill directory below the account's own workspace. */
|
|
150
|
+
skillsCreate(token: string, input: QaSkillDraftInput): QaSkillDocument;
|
|
151
|
+
/**
|
|
152
|
+
* Replace one skill. `expectedRevision` is the revision the editor read; a
|
|
153
|
+
* mismatch is refused rather than overwriting an edit made elsewhere.
|
|
154
|
+
*/
|
|
155
|
+
skillsUpdate(token: string, name: string, input: QaSkillDraftInput): QaSkillDocument;
|
|
156
|
+
/** Remove one skill into the account's own trash directory. */
|
|
157
|
+
skillsRemove(token: string, name: string, expectedRevision: string | null): QaSkillRemoval;
|
|
158
|
+
/**
|
|
159
|
+
* Check an unsaved draft: the file a save would write and the diagnostics
|
|
160
|
+
* for it. `name` names the stored skill being edited, or null to create one.
|
|
161
|
+
*/
|
|
162
|
+
skillsValidate(token: string, name: string | null, input: QaSkillDraftInput): QaSkillValidation;
|
|
163
|
+
/**
|
|
164
|
+
* The tool catalog the picker offers, with availability computed against
|
|
165
|
+
* this deployment's QA scope. Declaring a tool here never grants it.
|
|
166
|
+
*/
|
|
167
|
+
skillsTools(token: string): {
|
|
168
|
+
readonly tools: readonly QaSkillToolDescriptor[];
|
|
169
|
+
};
|
|
108
170
|
private refreshRoute;
|
|
171
|
+
/**
|
|
172
|
+
* Install, rebuild or tear down the document subsystem. The raw entry is
|
|
173
|
+
* resolved with the documented environment overrides applied, so a
|
|
174
|
+
* deployment can point `QA_DOCLING_BASE_URL` at its own service without
|
|
175
|
+
* touching the settings namespace; the settings layer stays authoritative
|
|
176
|
+
* for everything it declares.
|
|
177
|
+
*/
|
|
178
|
+
private refreshDocuments;
|
|
109
179
|
}
|
|
110
180
|
export { ConfigSchema, DEFAULT_QA_SURFACE_CONFIG, normalizeRoutePath, resolveConfig, } from "./config.js";
|
|
111
181
|
export { QaAttestationError } from "./attestation.js";
|
|
@@ -113,7 +183,9 @@ export type { QaAttestationReason } from "./attestation.js";
|
|
|
113
183
|
export { QaAccounts, QaAccountsError } from "./accounts/store.js";
|
|
114
184
|
export { entryRedirectRow, entryRedirectScript } from "./entry-redirect.js";
|
|
115
185
|
export { registerQaNavigationRoute } from "./host-route.js";
|
|
186
|
+
export { QaIntegrationPrincipalBindings } from "./integration-principals.js";
|
|
116
187
|
export { qaToolDenial, qaToolPolicyPlan } from "./lockdown-policy.js";
|
|
188
|
+
export * from "./documents/index.js";
|
|
117
189
|
export { QaPolicyAdmission } from "./secure-session.js";
|
|
118
190
|
export { QaPromptNotes, renderUserIdentity, QA_IDENTITY_NOTE, QA_SOURCES_NOTE, } from "./prompt-notes.js";
|
|
119
191
|
export * from "./provenance/index.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { QaPrincipal } from "./types.js";
|
|
2
|
+
/** Runtime-only proof that a QA root session was attested by its own user. */
|
|
3
|
+
export declare class QaIntegrationPrincipalBindings {
|
|
4
|
+
private readonly principals;
|
|
5
|
+
attest(sessionId: string, actorUserId: string | undefined, ownerUserId: string | undefined): void;
|
|
6
|
+
resolve(sessionId: string, currentOwnerUserId: string | undefined): QaPrincipal | undefined;
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=integration-principals.d.ts.map
|
|
@@ -13,6 +13,16 @@ export interface QaToolPolicyPlan {
|
|
|
13
13
|
* successful first attestation and make the next attestation fail.
|
|
14
14
|
*/
|
|
15
15
|
export declare function qaToolPolicyPlan(allow: readonly string[], isMounted: (toolName: string) => boolean): QaToolPolicyPlan;
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Monotonic execution decision shared by inherited, scoped and transport tools.
|
|
18
|
+
* @param allowed - the operator's configured allow-list for this agent.
|
|
19
|
+
* @param toolName - the tool the model is trying to call.
|
|
20
|
+
* @param dynamicNames - names this plugin attached for the calling agent after
|
|
21
|
+
* a successful skill load. They are deliberately absent from the allow-list:
|
|
22
|
+
* that list is validated against the mounted catalog at attestation time, and
|
|
23
|
+
* a tool that appears only later cannot be named there without failing the
|
|
24
|
+
* check. The guard is therefore where they are authorized — a dynamic tool
|
|
25
|
+
* stays as unchecked as any allow-listed one, and no less.
|
|
26
|
+
*/
|
|
27
|
+
export declare function qaToolDenial(allowed: ReadonlySet<string>, toolName: string, dynamicNames?: readonly string[]): string | undefined;
|
|
18
28
|
//# sourceMappingURL=lockdown-policy.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coarse, wire-safe personal-skill failure codes. They ride the same
|
|
3
|
+
* `(reason: <code>)` marker the account remotes established: the browser maps
|
|
4
|
+
* them to audience-safe copy, while the precise cause stays in the Host log.
|
|
5
|
+
*/
|
|
6
|
+
export type QaPersonalSkillErrorReason = "skills-disabled" | "workspace-unavailable" | "skill-not-found" | "skill-exists" | "skill-conflict" | "skill-name-invalid" | "skill-invalid" | "storage-unavailable";
|
|
7
|
+
export declare class QaPersonalSkillError extends Error {
|
|
8
|
+
readonly reason: QaPersonalSkillErrorReason;
|
|
9
|
+
constructor(reason: QaPersonalSkillErrorReason, message: string);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
3
|
+
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
4
|
+
import { QaPersonalSkills } from "./service.js";
|
|
5
|
+
export interface QaPersonalSkillsHostOptions {
|
|
6
|
+
readonly ctx: Context;
|
|
7
|
+
readonly getConfig: () => ResolvedQaSurfaceConfig;
|
|
8
|
+
readonly logger: PluginLogger;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Host owner of the personal-skills feature: the storage service, the DSH
|
|
12
|
+
* provider registration and the manual-edit watcher.
|
|
13
|
+
*
|
|
14
|
+
* The three are one unit because they share a single liveness contract — every
|
|
15
|
+
* write through the service, and every filesystem event the watcher observes,
|
|
16
|
+
* invalidates the same provider registration, so the catalog the model reads
|
|
17
|
+
* and the catalog the editor writes cannot drift apart. The provider is
|
|
18
|
+
* registered through `ctx.inject`, so a deployment without the skills service
|
|
19
|
+
* keeps the editor working and simply publishes nothing to DSH.
|
|
20
|
+
*/
|
|
21
|
+
export declare class QaPersonalSkillsHost {
|
|
22
|
+
readonly service: QaPersonalSkills;
|
|
23
|
+
private readonly watcher;
|
|
24
|
+
private readonly options;
|
|
25
|
+
/**
|
|
26
|
+
* The registry's own invalidation callback, guarded by registration
|
|
27
|
+
* identity on its side: a reference kept past disposal is a no-op.
|
|
28
|
+
*/
|
|
29
|
+
private invalidateCatalog;
|
|
30
|
+
private disposeRegistration;
|
|
31
|
+
constructor(options: QaPersonalSkillsHostOptions);
|
|
32
|
+
/** Whether the DSH registry currently owns this deployment's provider. */
|
|
33
|
+
get registered(): boolean;
|
|
34
|
+
dispose(): void;
|
|
35
|
+
/**
|
|
36
|
+
* The registered workspace path the per-account directories live under.
|
|
37
|
+
* Resolved per call: a deployment may register the workspace after this
|
|
38
|
+
* plugin loads.
|
|
39
|
+
*/
|
|
40
|
+
private registeredWorkspacePath;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { QaPersonalSkillError, type QaPersonalSkillErrorReason, } from "./errors.js";
|
|
2
|
+
export { QA_SKILL_TRASH_SUFFIX, resolveSkillRoots, skillDirectory, skillFilePath, type QaSkillRoots, } from "./paths.js";
|
|
3
|
+
export { normalizeAllowedTools, parseSkillFile, serializeSkillFile, skillFileBody, skillNameProblem, toJsonValue, type QaSkillFileContents, type QaSkillFileDraft, type QaSkillFileParse, } from "./skill-file.js";
|
|
4
|
+
export { skillFileBytes, skillRelativeRootProblem, skillRelativeRootSegments, validateSkillDraft, QA_SKILL_DEFAULT_RELATIVE_ROOT, QA_SKILL_DESCRIPTION_MAX, QA_SKILL_ENABLED_BY_DEFAULT, QA_SKILL_FILE_MAX_BYTES, QA_SKILL_MAX_BYTES_MAX, QA_SKILL_MAX_BYTES_MIN, QA_SKILL_MAX_TOOLS, QA_SKILL_NAME_MAX, QA_SKILL_NAME_PATTERN, QA_SKILL_WHEN_TO_USE_MAX, type QaSkillValidationInput, } from "./skill-format.js";
|
|
5
|
+
export { QA_USER_SKILLS_PROVIDER, QA_USER_SKILLS_RANK, QA_USER_SKILLS_SOURCE, createQaUserSkillProvider, } from "./provider.js";
|
|
6
|
+
export { QaPersonalSkills, type QaPersonalSkillContext, type QaPersonalSkillsOptions, type QaStoredSkill, } from "./service.js";
|
|
7
|
+
export { createQaPersonalSkillRemotes, type QaPersonalSkillRemotes, } from "./remotes.js";
|
|
8
|
+
export { QaPersonalSkillsHost } from "./host.js";
|
|
9
|
+
export { QaSkillWatcher } from "./watcher.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|