@yadsh/dsh-qa-surface 0.2.0 → 0.4.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 +236 -20
- package/compatibility.json +11 -3
- package/lib/account-remotes.js +100 -0
- package/lib/account-remotes.js.map +1 -0
- package/lib/accounts/credentials.js +27 -0
- package/lib/accounts/credentials.js.map +1 -0
- package/lib/accounts/errors.js +9 -0
- package/lib/accounts/errors.js.map +1 -0
- package/lib/accounts/file.js +101 -0
- package/lib/accounts/file.js.map +1 -0
- package/lib/accounts/index.js +2 -0
- package/lib/accounts/index.js.map +1 -0
- package/lib/accounts/store.js +461 -0
- package/lib/accounts/store.js.map +1 -0
- package/lib/accounts/token.js +61 -0
- package/lib/accounts/token.js.map +1 -0
- package/lib/attachment-rules.js +111 -0
- package/lib/attachment-rules.js.map +1 -0
- package/lib/attestation.js.map +1 -1
- package/lib/cli.js +256 -0
- package/lib/cli.js.map +1 -0
- package/lib/client/QaAccountsController.js +359 -0
- package/lib/client/QaAccountsController.js.map +1 -0
- package/lib/client/QaSessionController.js +238 -180
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +281 -105
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +95 -244
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/attachments.js +150 -0
- package/lib/client/attachments.js.map +1 -0
- package/lib/client/attestation.js +7 -1
- package/lib/client/attestation.js.map +1 -1
- package/lib/client/base64.js +16 -0
- package/lib/client/base64.js.map +1 -0
- package/lib/client/chat-files.js +48 -0
- package/lib/client/chat-files.js.map +1 -0
- package/lib/client/components/Markdown.js +54 -13
- package/lib/client/components/Markdown.js.map +1 -1
- package/lib/client/components/QaAuthGate.js +40 -0
- package/lib/client/components/QaAuthGate.js.map +1 -0
- package/lib/client/components/QaChangelog.js +131 -0
- package/lib/client/components/QaChangelog.js.map +1 -0
- package/lib/client/components/QaComposer.js +56 -74
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaFileAttachment.js +19 -0
- package/lib/client/components/QaFileAttachment.js.map +1 -0
- package/lib/client/components/QaFilesPanel.js +45 -0
- package/lib/client/components/QaFilesPanel.js.map +1 -0
- package/lib/client/components/QaHeader.js +34 -0
- package/lib/client/components/QaHeader.js.map +1 -0
- package/lib/client/components/QaMessage.js +61 -18
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaModal.js +31 -0
- package/lib/client/components/QaModal.js.map +1 -0
- package/lib/client/components/QaProfile.js +64 -0
- package/lib/client/components/QaProfile.js.map +1 -0
- package/lib/client/components/QaRightRail.js +15 -0
- package/lib/client/components/QaRightRail.js.map +1 -0
- package/lib/client/components/QaSidebar.js +68 -20
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaSourcesPanel.js +127 -0
- package/lib/client/components/QaSourcesPanel.js.map +1 -0
- package/lib/client/components/QaTurnRail.js +296 -0
- package/lib/client/components/QaTurnRail.js.map +1 -0
- package/lib/client/components/QaWelcomeNotice.js +125 -0
- package/lib/client/components/QaWelcomeNotice.js.map +1 -0
- package/lib/client/components/QaWidthHandle.js +147 -0
- package/lib/client/components/QaWidthHandle.js.map +1 -0
- package/lib/client/components/QaWorkGroup.js +19 -20
- package/lib/client/components/QaWorkGroup.js.map +1 -1
- package/lib/client/components/source-refs.js +78 -0
- package/lib/client/components/source-refs.js.map +1 -0
- package/lib/client/components/surface-utils.js +28 -0
- package/lib/client/components/surface-utils.js.map +1 -0
- package/lib/client/components/thinking-phrases.js +24 -0
- package/lib/client/components/thinking-phrases.js.map +1 -0
- package/lib/client/create-session.js +26 -0
- package/lib/client/create-session.js.map +1 -0
- package/lib/client/failure-copy.js +63 -0
- package/lib/client/failure-copy.js.map +1 -0
- package/lib/client/index.js +135 -16
- package/lib/client/index.js.map +1 -1
- package/lib/client/project-session-state.js +78 -0
- package/lib/client/project-session-state.js.map +1 -0
- package/lib/client/prompt-content.js +54 -0
- package/lib/client/prompt-content.js.map +1 -0
- package/lib/client/session-admission.js +38 -0
- package/lib/client/session-admission.js.map +1 -0
- package/lib/client/session-assets.js +52 -0
- package/lib/client/session-assets.js.map +1 -0
- package/lib/client/session-sources.js +61 -0
- package/lib/client/session-sources.js.map +1 -0
- package/lib/client/settings/card.js +143 -0
- package/lib/client/settings/card.js.map +1 -0
- package/lib/client/settings/fields.js +145 -0
- package/lib/client/settings/fields.js.map +1 -0
- package/lib/client/settings/format.js +255 -0
- package/lib/client/settings/format.js.map +1 -0
- package/lib/client/settings/sections/access.js +25 -0
- package/lib/client/settings/sections/access.js.map +1 -0
- package/lib/client/settings/sections/accounts.js +47 -0
- package/lib/client/settings/sections/accounts.js.map +1 -0
- package/lib/client/settings/sections/attachments.js +46 -0
- package/lib/client/settings/sections/attachments.js.map +1 -0
- package/lib/client/settings/sections/branding.js +28 -0
- package/lib/client/settings/sections/branding.js.map +1 -0
- package/lib/client/settings/sections/common.js +20 -0
- package/lib/client/settings/sections/common.js.map +1 -0
- package/lib/client/settings/sections/embedding.js +19 -0
- package/lib/client/settings/sections/embedding.js.map +1 -0
- package/lib/client/settings/sections/interface.js +60 -0
- package/lib/client/settings/sections/interface.js.map +1 -0
- package/lib/client/settings/sections/lockdown.js +82 -0
- package/lib/client/settings/sections/lockdown.js.map +1 -0
- package/lib/client/settings/sections/session.js +53 -0
- package/lib/client/settings/sections/session.js.map +1 -0
- package/lib/client/settings/sections/sources.js +72 -0
- package/lib/client/settings/sections/sources.js.map +1 -0
- package/lib/client/settings/sections/status.js +37 -0
- package/lib/client/settings/sections/status.js.map +1 -0
- package/lib/client/settings/sections.js +23 -0
- package/lib/client/settings/sections.js.map +1 -0
- package/lib/client/settings/styles.js +57 -0
- package/lib/client/settings/styles.js.map +1 -0
- package/lib/client/settlement.js +24 -0
- package/lib/client/settlement.js.map +1 -0
- package/lib/client/stream-publisher.js +47 -0
- package/lib/client/stream-publisher.js.map +1 -0
- package/lib/client/styles.js +225 -17
- package/lib/client/styles.js.map +1 -1
- package/lib/client/tool-presentation.js +102 -0
- package/lib/client/tool-presentation.js.map +1 -0
- package/lib/client/turn-sources.js +98 -0
- package/lib/client/turn-sources.js.map +1 -0
- package/lib/client/types.js +2 -0
- package/lib/client/types.js.map +1 -1
- package/lib/client/use-right-rail.js +96 -0
- package/lib/client/use-right-rail.js.map +1 -0
- package/lib/client/use-session-ui-state.js +75 -0
- package/lib/client/use-session-ui-state.js.map +1 -0
- package/lib/client/use-transcript-view.js +44 -0
- package/lib/client/use-transcript-view.js.map +1 -0
- package/lib/client.js +9052 -1345
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/accounts.js +60 -0
- package/lib/config-resolvers/accounts.js.map +1 -0
- package/lib/config-resolvers/attachments.js +28 -0
- package/lib/config-resolvers/attachments.js.map +1 -0
- package/lib/config-resolvers/basics.js +59 -0
- package/lib/config-resolvers/basics.js.map +1 -0
- package/lib/config-resolvers/defaults.js +132 -0
- package/lib/config-resolvers/defaults.js.map +1 -0
- package/lib/config-resolvers/lockdown.js +79 -0
- package/lib/config-resolvers/lockdown.js.map +1 -0
- package/lib/config-resolvers/session.js +42 -0
- package/lib/config-resolvers/session.js.map +1 -0
- package/lib/config-resolvers/shared.js +42 -0
- package/lib/config-resolvers/shared.js.map +1 -0
- package/lib/config-resolvers/sources.js +81 -0
- package/lib/config-resolvers/sources.js.map +1 -0
- package/lib/config-resolvers/ui.js +20 -0
- package/lib/config-resolvers/ui.js.map +1 -0
- package/lib/config.js +279 -102
- package/lib/config.js.map +1 -1
- package/lib/entry-redirect.js +45 -0
- package/lib/entry-redirect.js.map +1 -0
- package/lib/host-route.js +25 -1
- package/lib/host-route.js.map +1 -1
- package/lib/index.js +258 -23
- package/lib/index.js.map +1 -1
- package/lib/launch-token.js +42 -0
- package/lib/launch-token.js.map +1 -0
- package/lib/profile.js +214 -0
- package/lib/profile.js.map +1 -0
- package/lib/prompt-notes.js +231 -0
- package/lib/prompt-notes.js.map +1 -0
- package/lib/provenance/collector.js +40 -0
- package/lib/provenance/collector.js.map +1 -0
- package/lib/provenance/connectors.js +147 -0
- package/lib/provenance/connectors.js.map +1 -0
- package/lib/provenance/dedupe.js +89 -0
- package/lib/provenance/dedupe.js.map +1 -0
- package/lib/provenance/extractors.js +340 -0
- package/lib/provenance/extractors.js.map +1 -0
- package/lib/provenance/file-preview.js +39 -0
- package/lib/provenance/file-preview.js.map +1 -0
- package/lib/provenance/host-store.js +387 -0
- package/lib/provenance/host-store.js.map +1 -0
- package/lib/provenance/index.js +9 -0
- package/lib/provenance/index.js.map +1 -0
- package/lib/provenance/normalize.js +128 -0
- package/lib/provenance/normalize.js.map +1 -0
- package/lib/provenance/reported.js +53 -0
- package/lib/provenance/reported.js.map +1 -0
- package/lib/provenance/types.js +2 -0
- package/lib/provenance/types.js.map +1 -0
- package/lib/resolve-config.js +35 -249
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +122 -14
- package/lib/secure-session.js.map +1 -1
- package/lib/shared/session-key.js +18 -0
- package/lib/shared/session-key.js.map +1 -0
- package/lib/shared/settings.js +10 -0
- package/lib/shared/settings.js.map +1 -0
- package/lib/thinking-phrases.js +68 -0
- package/lib/thinking-phrases.js.map +1 -0
- package/lib/typert.host.js +749 -11
- package/lib/typert.remote-client.d.ts +23 -3
- package/lib/typert.remote-client.js +593 -6
- package/lib/types/account-remotes.d.ts +42 -0
- package/lib/types/accounts/credentials.d.ts +14 -0
- package/lib/types/accounts/errors.d.ts +11 -0
- package/lib/types/accounts/file.d.ts +82 -0
- package/lib/types/accounts/index.d.ts +2 -0
- package/lib/types/accounts/store.d.ts +144 -0
- package/lib/types/accounts/token.d.ts +31 -0
- package/lib/types/attachment-rules.d.ts +44 -0
- package/lib/types/attestation.d.ts +1 -1
- package/lib/types/cli.d.ts +9 -0
- package/lib/types/client/QaAccountsController.d.ts +102 -0
- package/lib/types/client/QaConfigController.d.ts +1 -1
- package/lib/types/client/QaSessionController.d.ts +61 -22
- package/lib/types/client/QaSurface.d.ts +14 -3
- package/lib/types/client/QaTranscriptAdapter.d.ts +5 -10
- package/lib/types/client/attachments.d.ts +54 -0
- package/lib/types/client/base64.d.ts +10 -0
- package/lib/types/client/chat-files.d.ts +30 -0
- package/lib/types/client/components/Markdown.d.ts +11 -1
- package/lib/types/client/components/QaAgentsDrawer.d.ts +1 -1
- package/lib/types/client/components/QaAuthGate.d.ts +15 -0
- package/lib/types/client/components/QaChangelog.d.ts +21 -0
- package/lib/types/client/components/QaComposer.d.ts +8 -4
- package/lib/types/client/components/QaFileAttachment.d.ts +14 -0
- package/lib/types/client/components/QaFilesPanel.d.ts +15 -0
- package/lib/types/client/components/QaHeader.d.ts +41 -0
- package/lib/types/client/components/QaMessage.d.ts +12 -3
- package/lib/types/client/components/QaModal.d.ts +26 -0
- package/lib/types/client/components/QaProfile.d.ts +25 -0
- package/lib/types/client/components/QaRightRail.d.ts +23 -0
- package/lib/types/client/components/QaSidebar.d.ts +44 -2
- package/lib/types/client/components/QaSourcesPanel.d.ts +23 -0
- package/lib/types/client/components/QaTurnRail.d.ts +65 -0
- package/lib/types/client/components/QaWelcomeNotice.d.ts +27 -0
- package/lib/types/client/components/QaWidthHandle.d.ts +43 -0
- package/lib/types/client/components/QaWorkGroup.d.ts +5 -3
- package/lib/types/client/components/source-refs.d.ts +16 -0
- package/lib/types/client/components/surface-utils.d.ts +11 -0
- package/lib/types/client/components/thinking-phrases.d.ts +9 -0
- package/lib/types/client/create-session.d.ts +13 -0
- package/lib/types/client/failure-copy.d.ts +19 -0
- package/lib/types/client/index.d.ts +1 -0
- package/lib/types/client/project-session-state.d.ts +30 -0
- package/lib/types/client/prompt-content.d.ts +30 -0
- package/lib/types/client/session-admission.d.ts +23 -0
- package/lib/types/client/session-assets.d.ts +20 -0
- package/lib/types/client/session-sources.d.ts +28 -0
- package/lib/types/client/settings/card.d.ts +23 -0
- package/lib/types/client/settings/fields.d.ts +139 -0
- package/lib/types/client/settings/format.d.ts +108 -0
- package/lib/types/client/settings/sections/access.d.ts +9 -0
- package/lib/types/client/settings/sections/accounts.d.ts +9 -0
- package/lib/types/client/settings/sections/attachments.d.ts +15 -0
- package/lib/types/client/settings/sections/branding.d.ts +8 -0
- package/lib/types/client/settings/sections/common.d.ts +28 -0
- package/lib/types/client/settings/sections/embedding.d.ts +8 -0
- package/lib/types/client/settings/sections/interface.d.ts +9 -0
- package/lib/types/client/settings/sections/lockdown.d.ts +9 -0
- package/lib/types/client/settings/sections/session.d.ts +9 -0
- package/lib/types/client/settings/sections/sources.d.ts +9 -0
- package/lib/types/client/settings/sections/status.d.ts +22 -0
- package/lib/types/client/settings/sections.d.ts +25 -0
- package/lib/types/client/settings/styles.d.ts +8 -0
- package/lib/types/client/settlement.d.ts +6 -0
- package/lib/types/client/stream-publisher.d.ts +28 -0
- package/lib/types/client/tool-presentation.d.ts +6 -0
- package/lib/types/client/turn-sources.d.ts +14 -0
- package/lib/types/client/types.d.ts +101 -9
- package/lib/types/client/use-right-rail.d.ts +56 -0
- package/lib/types/client/use-session-ui-state.d.ts +41 -0
- package/lib/types/client/use-transcript-view.d.ts +20 -0
- package/lib/types/config-resolvers/accounts.d.ts +15 -0
- package/lib/types/config-resolvers/attachments.d.ts +6 -0
- package/lib/types/config-resolvers/basics.d.ts +8 -0
- package/lib/types/config-resolvers/defaults.d.ts +4 -0
- package/lib/types/config-resolvers/lockdown.d.ts +10 -0
- package/lib/types/config-resolvers/session.d.ts +6 -0
- package/lib/types/config-resolvers/shared.d.ts +16 -0
- package/lib/types/config-resolvers/sources.d.ts +6 -0
- package/lib/types/config-resolvers/ui.d.ts +6 -0
- package/lib/types/entry-redirect.d.ts +20 -0
- package/lib/types/host-route.d.ts +14 -1
- package/lib/types/index.d.ts +54 -3
- package/lib/types/launch-token.d.ts +21 -0
- package/lib/types/profile.d.ts +76 -0
- package/lib/types/prompt-notes.d.ts +110 -0
- package/lib/types/provenance/collector.d.ts +26 -0
- package/lib/types/provenance/connectors.d.ts +11 -0
- package/lib/types/provenance/dedupe.d.ts +6 -0
- package/lib/types/provenance/extractors.d.ts +14 -0
- package/lib/types/provenance/file-preview.d.ts +10 -0
- package/lib/types/provenance/host-store.d.ts +54 -0
- package/lib/types/provenance/index.d.ts +10 -0
- package/lib/types/provenance/normalize.d.ts +13 -0
- package/lib/types/provenance/reported.d.ts +5 -0
- package/lib/types/provenance/types.d.ts +78 -0
- package/lib/types/resolve-config.d.ts +8 -3
- package/lib/types/secure-session.d.ts +36 -2
- package/lib/types/shared/session-key.d.ts +23 -0
- package/lib/types/shared/settings.d.ts +10 -0
- package/lib/types/thinking-phrases.d.ts +17 -0
- package/lib/types/types.d.ts +290 -16
- package/lib/types/user-workspace.d.ts +38 -0
- package/lib/user-workspace.js +231 -0
- package/lib/user-workspace.js.map +1 -0
- package/package.json +71 -47
- package/CHANGELOG.md +0 -93
- package/SPEC-dsh-qa-surface.md +0 -2425
- package/docs/ARCHITECTURE.md +0 -66
- package/docs/COMPATIBILITY.md +0 -14
- package/docs/CONFIGURATION.md +0 -112
- package/docs/EMBEDDING.md +0 -13
- package/lib/client/components/QaSourcesDrawer.js +0 -46
- package/lib/client/components/QaSourcesDrawer.js.map +0 -1
- package/lib/types/client/components/QaSourcesDrawer.d.ts +0 -8
package/lib/types/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
2
2
|
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
-
import type {
|
|
3
|
+
import type { QaTurnSources } from "./provenance/types.js";
|
|
4
|
+
import type { QaAccountProfileInput, QaAccountSession, QaAccountUserPublic, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaSurfaceConfig, ResolvedQaSurfaceConfig, QaSourceFilePreview, QaWhoamiResult } from "./types.js";
|
|
4
5
|
export declare const name = "qa-surface";
|
|
5
6
|
export declare const inject: string[];
|
|
6
|
-
|
|
7
|
+
import { QA_SURFACE_SETTINGS_NAMESPACE } from "./shared/settings.js";
|
|
8
|
+
export { QA_SURFACE_SETTINGS_NAMESPACE };
|
|
7
9
|
export declare const Config: import("@deepseek-ai/schemastery").default<QaSurfaceConfig>;
|
|
8
10
|
declare module "@deepseek-ai/cordis" {
|
|
9
11
|
interface Context {
|
|
@@ -17,11 +19,46 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
17
19
|
private source;
|
|
18
20
|
private readonly logger;
|
|
19
21
|
private readonly admission;
|
|
22
|
+
private readonly provenance;
|
|
23
|
+
private readonly notes;
|
|
24
|
+
/** Account-remote bodies; the wire signatures stay on this class. */
|
|
25
|
+
private readonly accountRemotes;
|
|
26
|
+
private readonly launchToken;
|
|
20
27
|
private webServer;
|
|
21
28
|
private disposeRoute;
|
|
22
29
|
private routeKey;
|
|
23
30
|
constructor(ctx: Context, entry?: QaSurfaceConfig);
|
|
24
31
|
getConfig(): ResolvedQaSurfaceConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Self-service signup; the first account ever created becomes admin. The
|
|
34
|
+
* display name derives from the email: the generated client enforces exact
|
|
35
|
+
* wire arity, so an optional name parameter would still be required.
|
|
36
|
+
*/
|
|
37
|
+
accountsRegister(email: string, password: string): QaAccountSession;
|
|
38
|
+
accountsLogin(email: string, password: string): QaAccountSession;
|
|
39
|
+
/** Identity probe; safe to call with an empty or expired token. */
|
|
40
|
+
accountsWhoami(token: string): QaWhoamiResult;
|
|
41
|
+
/** Migrate a browser's local chat index into server-side ownership. */
|
|
42
|
+
accountsClaimSessions(token: string, sessionIds: readonly string[]): QaClaimResult;
|
|
43
|
+
/** The token user's owned session ids; the sidebar list authority. */
|
|
44
|
+
accountsOwnedSessions(token: string): {
|
|
45
|
+
readonly ids: readonly string[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Every chat-ownership entry with owner display names; the cross-user view
|
|
49
|
+
* admin browsers group the sidebar by. Ordinary accounts are refused with
|
|
50
|
+
* the dedicated reason, anonymous ones with auth-required.
|
|
51
|
+
*/
|
|
52
|
+
accountsListOwnership(token: string): {
|
|
53
|
+
readonly entries: readonly QaOwnershipEntry[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Replace the caller's own self-declared profile. The token is the only
|
|
57
|
+
* identity the wire carries: a browser can never name a profile but its own,
|
|
58
|
+
* and the deployment's declared fields and length limits are enforced in the
|
|
59
|
+
* store before anything is written.
|
|
60
|
+
*/
|
|
61
|
+
accountsUpdateProfile(token: string, input: QaAccountProfileInput): QaAccountUserPublic;
|
|
25
62
|
/**
|
|
26
63
|
* Serve the effective QA configuration to the browser. The DSH gateway pins
|
|
27
64
|
* settings RPCs to loopback, so a browser served over the LAN always sees
|
|
@@ -30,16 +67,30 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
30
67
|
* boundary stays in {@link secureSession}.
|
|
31
68
|
*/
|
|
32
69
|
describe(): ResolvedQaSurfaceConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Create a QA session from Host-owned inputs. With account workspaces on,
|
|
72
|
+
* cwd is `<configured workspace>/.qa-users/<account UUID>` and the child is
|
|
73
|
+
* intentionally not registered or attached as another DSH workspace.
|
|
74
|
+
*/
|
|
75
|
+
createSession(token: string): Promise<string>;
|
|
33
76
|
/** Pin and attest the effective policy. The browser supplies identity only. */
|
|
34
|
-
secureSession(sessionId: string): QaLockdownProof;
|
|
77
|
+
secureSession(token: string, sessionId: string): QaLockdownProof;
|
|
78
|
+
/** Return canonical Host snapshots; replay is rebuilt from qa/sources events. */
|
|
79
|
+
sources(token: string, sessionId: string): readonly QaTurnSources[];
|
|
80
|
+
/** Narrow read-only preview capability for files already present as sources. */
|
|
81
|
+
readSourceFile(token: string, sessionId: string, sourcePath: string): Promise<QaSourceFilePreview>;
|
|
35
82
|
private refreshRoute;
|
|
36
83
|
}
|
|
37
84
|
export { ConfigSchema, DEFAULT_QA_SURFACE_CONFIG, normalizeRoutePath, resolveConfig, } from "./config.js";
|
|
38
85
|
export { QaAttestationError } from "./attestation.js";
|
|
39
86
|
export type { QaAttestationReason } from "./attestation.js";
|
|
87
|
+
export { QaAccounts, QaAccountsError } from "./accounts/store.js";
|
|
88
|
+
export { entryRedirectRow, entryRedirectScript } from "./entry-redirect.js";
|
|
40
89
|
export { registerQaNavigationRoute } from "./host-route.js";
|
|
41
90
|
export { qaToolDenial, qaToolPolicyPlan } from "./lockdown-policy.js";
|
|
42
91
|
export { QaPolicyAdmission } from "./secure-session.js";
|
|
92
|
+
export { QaPromptNotes, renderUserIdentity, QA_IDENTITY_NOTE, QA_SOURCES_NOTE, } from "./prompt-notes.js";
|
|
93
|
+
export * from "./provenance/index.js";
|
|
43
94
|
export type * from "./types.js";
|
|
44
95
|
export default QaSurface;
|
|
45
96
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin-side launch-token bridge (the pattern proven by dsh-auth-gate): the
|
|
3
|
+
* 0.1.x host exposes `connection.authenticatedUrl(baseUrl)` whose `?token=`
|
|
4
|
+
* parameter carries the per-process launch token. The `/qa` route handler
|
|
5
|
+
* uses it to send cookie-less browsers through the one-time host-cookie
|
|
6
|
+
* exchange themselves, so the transparent entry works without the qa-deploy
|
|
7
|
+
* proxy. The host/scheme of the resolved URL are dropped — the redirect is
|
|
8
|
+
* relative, so the browser stays on the origin it actually used.
|
|
9
|
+
*/
|
|
10
|
+
export type LaunchTokenSource = () => string | undefined;
|
|
11
|
+
interface AuthenticatedUrlFace {
|
|
12
|
+
authenticatedUrl?(baseUrl: string): string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the launch token once per process (it is stable for the process
|
|
16
|
+
* lifetime); a missing connection service or an unusable answer warns once
|
|
17
|
+
* and permanently disables the bridge instead of retrying per request.
|
|
18
|
+
*/
|
|
19
|
+
export declare function makeLaunchTokenSource(getConnection: () => AuthenticatedUrlFace | undefined, warn: (message: string) => void): LaunchTokenSource;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=launch-token.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { QaAccountIdentityField, QaAccountProfile } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Profile shape, limits, and the normalization both halves of the plugin
|
|
4
|
+
* agree on. Deliberately free of Node built-ins: the configuration resolver
|
|
5
|
+
* and the browser-side form import these same limits, and a Host-only import
|
|
6
|
+
* here would drag the accounts store into the client bundle.
|
|
7
|
+
*/
|
|
8
|
+
/** Longest accepted full name. */
|
|
9
|
+
export declare const QA_PROFILE_MAX_FULL_NAME = 200;
|
|
10
|
+
/** Longest accepted value of one external-system handle. */
|
|
11
|
+
export declare const QA_PROFILE_MAX_IDENTITY_VALUE = 200;
|
|
12
|
+
/** Most handles one profile may carry. */
|
|
13
|
+
export declare const QA_PROFILE_MAX_IDENTITIES = 16;
|
|
14
|
+
/** Handle keys are lowercase labels; the deployment declares which ones exist. */
|
|
15
|
+
export declare const QA_PROFILE_IDENTITY_KEY: RegExp;
|
|
16
|
+
/** Longest accepted display label of one declared handle field. */
|
|
17
|
+
export declare const QA_PROFILE_MAX_IDENTITY_LABEL = 40;
|
|
18
|
+
/** Most handle fields one deployment may declare. */
|
|
19
|
+
export declare const QA_PROFILE_MAX_IDENTITY_FIELDS = 8;
|
|
20
|
+
/** Default cap on the user's free-form agent guidance. */
|
|
21
|
+
export declare const QA_PROFILE_DEFAULT_INSTRUCTIONS_MAX = 2000;
|
|
22
|
+
/** Bounds within which a deployment may set that cap. */
|
|
23
|
+
export declare const QA_PROFILE_INSTRUCTIONS_MAX_MIN = 200;
|
|
24
|
+
export declare const QA_PROFILE_INSTRUCTIONS_MAX_MAX = 20000;
|
|
25
|
+
/** The profile of an account that never filled one in. */
|
|
26
|
+
export declare function emptyProfile(): QaAccountProfile;
|
|
27
|
+
/**
|
|
28
|
+
* Read one stored (or wire-delivered) profile into its public shape. Unknown
|
|
29
|
+
* or hand-edited input degrades to the readable subset instead of throwing:
|
|
30
|
+
* a malformed profile must never cost the account its session. Overlong text
|
|
31
|
+
* is truncated here — the write path rejects it with a message instead.
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeProfile(value: unknown): QaAccountProfile;
|
|
34
|
+
/** Validated profile values, before the store stamps `updatedAt`. */
|
|
35
|
+
export interface QaProfileWrite {
|
|
36
|
+
readonly fullName: string;
|
|
37
|
+
readonly identities: Readonly<Record<string, string>>;
|
|
38
|
+
readonly instructions: string;
|
|
39
|
+
}
|
|
40
|
+
export type QaProfileWriteResult = {
|
|
41
|
+
readonly ok: true;
|
|
42
|
+
readonly value: QaProfileWrite;
|
|
43
|
+
} | {
|
|
44
|
+
readonly ok: false;
|
|
45
|
+
readonly message: string;
|
|
46
|
+
};
|
|
47
|
+
export interface QaProfileWriteOptions {
|
|
48
|
+
readonly instructionsMaxLength: number;
|
|
49
|
+
/**
|
|
50
|
+
* Fields the deployment declares; a write may name only these keys. Omit to
|
|
51
|
+
* check the key shape alone — the operator CLI path, where the writer is the
|
|
52
|
+
* same person who owns the configuration.
|
|
53
|
+
*/
|
|
54
|
+
readonly identities?: readonly QaAccountIdentityField[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validate one full-replace profile write. Values are cleaned the same way
|
|
58
|
+
* the read path cleans them, so what a caller sends is what the prompt will
|
|
59
|
+
* later render; limits are refused with a message instead of truncated, so a
|
|
60
|
+
* user pasting an essay learns why it was not stored.
|
|
61
|
+
*/
|
|
62
|
+
export declare function validateProfileWrite(input: unknown, options: QaProfileWriteOptions): QaProfileWriteResult;
|
|
63
|
+
export type QaIdentityFieldsResult = {
|
|
64
|
+
readonly ok: true;
|
|
65
|
+
readonly value: readonly QaAccountIdentityField[];
|
|
66
|
+
} | {
|
|
67
|
+
readonly ok: false;
|
|
68
|
+
readonly message: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Validate the deployment's declared handle fields: the profile form renders
|
|
72
|
+
* one input per entry and the prompt names exactly these, so a typo in a key
|
|
73
|
+
* becomes a refusal at configuration time rather than a silent no-op.
|
|
74
|
+
*/
|
|
75
|
+
export declare function validateIdentityFields(value: unknown): QaIdentityFieldsResult;
|
|
76
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
3
|
+
import type { QaAccounts } from "./accounts/store.js";
|
|
4
|
+
import type { QaAccountIdentityField, QaAccountProfile, ResolvedQaSurfaceConfig } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Plugin marker on every injected message. The chat projection turns a
|
|
7
|
+
* plugin-sourced user message into injected context rather than a chat
|
|
8
|
+
* bubble, and the QA transcript keeps exactly those hidden.
|
|
9
|
+
*/
|
|
10
|
+
export declare const QA_NOTES_PLUGIN = "qa-surface";
|
|
11
|
+
/** Note name carrying who the assistant is talking to. */
|
|
12
|
+
export declare const QA_IDENTITY_NOTE = "dsh-qa-surface:user-identity";
|
|
13
|
+
/** Note name carrying the deployment's rule about source provenance. */
|
|
14
|
+
export declare const QA_SOURCES_NOTE = "dsh-qa-surface:structured-sources";
|
|
15
|
+
export interface QaIdentityRenderInput {
|
|
16
|
+
/** The owner's account address; the one fact accounts always provide. */
|
|
17
|
+
readonly email: string;
|
|
18
|
+
readonly profile: QaAccountProfile;
|
|
19
|
+
/** Handle fields the deployment declares, in its configured order. */
|
|
20
|
+
readonly identities: readonly QaAccountIdentityField[];
|
|
21
|
+
}
|
|
22
|
+
/** The two identity parts one user resolves to; either may be empty. */
|
|
23
|
+
export interface QaRenderedIdentity {
|
|
24
|
+
readonly identity: string;
|
|
25
|
+
readonly instructions: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Render the identity text for one attested user.
|
|
29
|
+
*
|
|
30
|
+
* The wording is deliberately explicit about provenance: these are the user's
|
|
31
|
+
* own claims, so the model is told to name the identifier it searched by and
|
|
32
|
+
* to ask when the results contradict the request. A wrong handle that the
|
|
33
|
+
* model trusts silently is the failure mode this text exists to prevent.
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderUserIdentity(input: QaIdentityRenderInput): QaRenderedIdentity;
|
|
36
|
+
/** One named block the injector can add to a step. */
|
|
37
|
+
export interface QaPromptNote {
|
|
38
|
+
/** Source-section name, and the marker that finds the note again. */
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly text: string;
|
|
41
|
+
}
|
|
42
|
+
export interface QaPromptNotesOptions {
|
|
43
|
+
readonly config: () => ResolvedQaSurfaceConfig;
|
|
44
|
+
/** The live accounts store, or undefined while accounts are disabled. */
|
|
45
|
+
readonly accounts: () => QaAccounts | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Whether one session belongs to the QA surface. The admission answers it:
|
|
48
|
+
* only an attested session reaches the QA audience the notes are written
|
|
49
|
+
* for, and delegated children resolve through their root session.
|
|
50
|
+
*/
|
|
51
|
+
readonly isQaSession: (sessionId: string) => boolean;
|
|
52
|
+
readonly logger: PluginLogger;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Delivers the QA surface's ambient notes to the agent: who the assistant is
|
|
56
|
+
* talking to, and what the deployment expects around source provenance.
|
|
57
|
+
*
|
|
58
|
+
* A system-prompt section would be the natural home for both, and this plugin
|
|
59
|
+
* used one for each. Neither survives the QA deployment's own preset: the
|
|
60
|
+
* `qa-research` persona registers with `complete: true` (the persona IS the
|
|
61
|
+
* whole system prompt, so every other section is discarded) and
|
|
62
|
+
* `includeRuntimeContext: false` (which drops every context contribution as
|
|
63
|
+
* well). The preset says so outright — no plugin adds prompt text.
|
|
64
|
+
*
|
|
65
|
+
* What stays open is the conversation: a plugin-sourced user message is
|
|
66
|
+
* admitted to the request as injected context, survives both switches, and
|
|
67
|
+
* the transcript projection already hides every non-`subagent` context note
|
|
68
|
+
* from the QA audience. Each note is written once per text rather than once
|
|
69
|
+
* per step — the session's own surface is the state, so a resume or a plugin
|
|
70
|
+
* reload never duplicates a note — and written again only when its text
|
|
71
|
+
* actually changes.
|
|
72
|
+
*
|
|
73
|
+
* The notes are advisory text, never authority: nothing here is enforced by
|
|
74
|
+
* the model's compliance. The lockdown (allow-list, guards, permission
|
|
75
|
+
* preset) is host-side and holds whatever the conversation says.
|
|
76
|
+
*/
|
|
77
|
+
export declare class QaPromptNotes {
|
|
78
|
+
private readonly ctx;
|
|
79
|
+
private readonly options;
|
|
80
|
+
/** `${agentId}:${noteName}` → the text the note already carries. */
|
|
81
|
+
private readonly carried;
|
|
82
|
+
private readonly disposePreStep;
|
|
83
|
+
private disposed;
|
|
84
|
+
constructor(ctx: Context, options: QaPromptNotesOptions);
|
|
85
|
+
dispose(): void;
|
|
86
|
+
/** Append every note whose text this step does not already carry. */
|
|
87
|
+
private inject;
|
|
88
|
+
/** Who is asking: the owner's name, handles and their own instructions. */
|
|
89
|
+
private identityNotes;
|
|
90
|
+
/** What the deployment expects around the sources the surface collects. */
|
|
91
|
+
private sourcesNotes;
|
|
92
|
+
private carriedKey;
|
|
93
|
+
/**
|
|
94
|
+
* The text one note already carries in this agent's conversation. Process
|
|
95
|
+
* memory answers it after the first step; a cold read walks the durable
|
|
96
|
+
* surface so a resumed session or a reloaded plugin does not write twice.
|
|
97
|
+
*/
|
|
98
|
+
private carriedText;
|
|
99
|
+
/**
|
|
100
|
+
* The session a chat started from. Delegated children are joined to their
|
|
101
|
+
* preset's standing scope rather than to their parent agent, so the chain
|
|
102
|
+
* has to be walked through the durable session headers; an unresolvable link
|
|
103
|
+
* (a resumed session whose parent is no longer loaded) degrades to the
|
|
104
|
+
* farthest ancestor known at that moment.
|
|
105
|
+
*/
|
|
106
|
+
private rootSessionId;
|
|
107
|
+
/** The owner's email and profile, or nothing while the chat is anonymous. */
|
|
108
|
+
private identityOf;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=prompt-notes.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { QaSourceReference, QaTurnSources, SourceExtractorContext } from "./types.js";
|
|
2
|
+
import type { SourceExtractorRegistry } from "./extractors.js";
|
|
3
|
+
export interface QaSourceCollectorOptions {
|
|
4
|
+
readonly sessionId: string;
|
|
5
|
+
readonly turn: number;
|
|
6
|
+
readonly registry: SourceExtractorRegistry;
|
|
7
|
+
readonly displayScoreThreshold?: number;
|
|
8
|
+
readonly mergeFileRanges?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Mutable turn-local accumulator; snapshots are immutable plain data. */
|
|
11
|
+
export declare class QaSourceCollector {
|
|
12
|
+
private readonly options;
|
|
13
|
+
private readonly collected;
|
|
14
|
+
private readonly incompleteOrigins;
|
|
15
|
+
private readonly threshold;
|
|
16
|
+
constructor(options: QaSourceCollectorOptions);
|
|
17
|
+
observe(context: SourceExtractorContext): void;
|
|
18
|
+
add(sources: readonly QaSourceReference[]): void;
|
|
19
|
+
markIncomplete(origin: {
|
|
20
|
+
readonly subagentRunId?: string;
|
|
21
|
+
readonly provider?: string;
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
}): void;
|
|
24
|
+
snapshot(): QaTurnSources;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=collector.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { canonicalizeUrl } from "./normalize.js";
|
|
2
|
+
import type { SourceExtractor } from "./types.js";
|
|
3
|
+
type UrlOptions = Parameters<typeof canonicalizeUrl>[1];
|
|
4
|
+
export declare function createJiraExtractor(urlOptions?: UrlOptions): SourceExtractor;
|
|
5
|
+
export declare function createConfluenceExtractor(urlOptions?: UrlOptions): SourceExtractor;
|
|
6
|
+
export declare function createKnowledgeExtractor(urlOptions?: UrlOptions): SourceExtractor;
|
|
7
|
+
export declare const jiraExtractor: SourceExtractor;
|
|
8
|
+
export declare const confluenceExtractor: SourceExtractor;
|
|
9
|
+
export declare const knowledgeExtractor: SourceExtractor;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { QaSourceReference } from "./types.js";
|
|
2
|
+
/** Merge by canonical id and rank by score, preserving first-use order on ties. */
|
|
3
|
+
export declare function dedupeAndRankSources(sources: readonly QaSourceReference[], options?: {
|
|
4
|
+
readonly mergeFileRanges?: boolean;
|
|
5
|
+
}): readonly QaSourceReference[];
|
|
6
|
+
//# sourceMappingURL=dedupe.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { canonicalizeUrl } from "./normalize.js";
|
|
2
|
+
import type { QaSourceReference, SourceExtractor, SourceExtractorContext } from "./types.js";
|
|
3
|
+
export declare const readFileExtractor: SourceExtractor;
|
|
4
|
+
export declare function createWebSearchExtractor(maxPromotedPerSearch?: number, urlOptions?: Parameters<typeof canonicalizeUrl>[1]): SourceExtractor;
|
|
5
|
+
export declare function createWebFetchExtractor(urlOptions?: Parameters<typeof canonicalizeUrl>[1]): SourceExtractor;
|
|
6
|
+
export declare const webFetchExtractor: SourceExtractor;
|
|
7
|
+
export declare const fileSearchExtractor: SourceExtractor;
|
|
8
|
+
export declare class SourceExtractorRegistry {
|
|
9
|
+
private readonly extractors;
|
|
10
|
+
register(extractor: SourceExtractor): () => void;
|
|
11
|
+
extract(context: SourceExtractorContext): readonly QaSourceReference[];
|
|
12
|
+
}
|
|
13
|
+
export declare function createDefaultSourceExtractorRegistry(maxPromotedPerSearch?: number, urlOptions?: Parameters<typeof canonicalizeUrl>[1]): SourceExtractorRegistry;
|
|
14
|
+
//# sourceMappingURL=extractors.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QaSourceFilePreview } from "../types.js";
|
|
2
|
+
export interface QaSourceFilePreviewOptions {
|
|
3
|
+
readonly root: string;
|
|
4
|
+
readonly sourcePath: string;
|
|
5
|
+
readonly maxBytes: number;
|
|
6
|
+
readonly maxMarkdownRenderBytes: number;
|
|
7
|
+
}
|
|
8
|
+
/** Read one canonical in-root file without following a symlink outside root. */
|
|
9
|
+
export declare function readSourceFilePreview({ root, sourcePath, maxBytes, maxMarkdownRenderBytes, }: QaSourceFilePreviewOptions): Promise<QaSourceFilePreview>;
|
|
10
|
+
//# sourceMappingURL=file-preview.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { QaTurnSources } from "./types.js";
|
|
3
|
+
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
4
|
+
export declare const QA_REPORT_SOURCES_TOOL = "qa_report_sources";
|
|
5
|
+
declare module "@deepseek-ai/dsh-session" {
|
|
6
|
+
interface SessionEventMap {
|
|
7
|
+
"qa/sources": QaTurnSources;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
interface SubagentInfo {
|
|
11
|
+
readonly runId: string;
|
|
12
|
+
readonly provider: string;
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly local: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare module "@deepseek-ai/cordis" {
|
|
17
|
+
interface Events {
|
|
18
|
+
"subagent/start"(info: SubagentInfo): void;
|
|
19
|
+
"subagent/end"(info: SubagentInfo): void;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** Host authority for collection, replay, delegation inheritance and snapshots. */
|
|
23
|
+
export declare class QaProvenanceHost {
|
|
24
|
+
private readonly ctx;
|
|
25
|
+
private readonly config;
|
|
26
|
+
private readonly collectors;
|
|
27
|
+
private readonly snapshots;
|
|
28
|
+
private readonly calls;
|
|
29
|
+
private readonly lineage;
|
|
30
|
+
private readonly disposers;
|
|
31
|
+
constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig);
|
|
32
|
+
dispose(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Drop every per-session record of one chat. Long-lived servers outlive
|
|
35
|
+
* their sessions by weeks; without this the collector, snapshot, call and
|
|
36
|
+
* lineage maps grow with every chat and turn forever.
|
|
37
|
+
*/
|
|
38
|
+
private forget;
|
|
39
|
+
private forgetAll;
|
|
40
|
+
bundles(sessionId: string): readonly QaTurnSources[];
|
|
41
|
+
sourceAllowed(sessionId: string, path: string): boolean;
|
|
42
|
+
private seed;
|
|
43
|
+
private observeEvent;
|
|
44
|
+
private shouldCollect;
|
|
45
|
+
private materialize;
|
|
46
|
+
private startSubagent;
|
|
47
|
+
private endSubagent;
|
|
48
|
+
private registerReportTool;
|
|
49
|
+
private collector;
|
|
50
|
+
private sessionCalls;
|
|
51
|
+
private sessionSnapshots;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=host-store.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./collector.js";
|
|
2
|
+
export * from "./connectors.js";
|
|
3
|
+
export * from "./dedupe.js";
|
|
4
|
+
export * from "./extractors.js";
|
|
5
|
+
export * from "./file-preview.js";
|
|
6
|
+
export * from "./host-store.js";
|
|
7
|
+
export * from "./normalize.js";
|
|
8
|
+
export * from "./reported.js";
|
|
9
|
+
export type * from "./types.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { QaSourceLocation } from "./types.js";
|
|
2
|
+
/** Strip model-added XML-like wrappers without interpreting arbitrary prose. */
|
|
3
|
+
export declare function unwrapSourceTarget(value: string): string;
|
|
4
|
+
/** Canonical HTTP(S) identity while retaining business-relevant parameters. */
|
|
5
|
+
export declare function canonicalizeUrl(value: string, options?: {
|
|
6
|
+
readonly normalize?: boolean;
|
|
7
|
+
readonly stripTrackingParams?: boolean;
|
|
8
|
+
}): string | null;
|
|
9
|
+
/** Normalize separators and, when possible, make a path workspace-relative. */
|
|
10
|
+
export declare function canonicalizeWorkspacePath(value: string, workspaceRoot?: string): string;
|
|
11
|
+
/** Union exact anchors and compact overlapping or adjacent ranges. */
|
|
12
|
+
export declare function compactLocations(locations: readonly QaSourceLocation[]): readonly QaSourceLocation[];
|
|
13
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { canonicalizeUrl } from "./normalize.js";
|
|
2
|
+
import type { QaReportedSource, QaSourceOrigin, QaSourceReference } from "./types.js";
|
|
3
|
+
/** Normalize a source explicitly reported by a delegated provider. */
|
|
4
|
+
export declare function normalizeReportedSource(source: QaReportedSource, origin: QaSourceOrigin, workspaceRoot?: string, urlOptions?: Parameters<typeof canonicalizeUrl>[1]): QaSourceReference | null;
|
|
5
|
+
//# sourceMappingURL=reported.d.ts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type QaSourceKind = "file" | "code" | "web" | "jira" | "confluence" | "knowledge" | "other";
|
|
2
|
+
export type QaSourceEvidence = "read" | "fetched" | "queried" | "reported" | "inherited" | "discovered";
|
|
3
|
+
export type QaSourceMetadataValue = string | number | boolean | null | readonly QaSourceMetadataValue[] | {
|
|
4
|
+
readonly [key: string]: QaSourceMetadataValue;
|
|
5
|
+
};
|
|
6
|
+
export interface QaSourceMetadata {
|
|
7
|
+
readonly [key: string]: QaSourceMetadataValue;
|
|
8
|
+
}
|
|
9
|
+
export interface QaSourceLocation {
|
|
10
|
+
readonly path?: string;
|
|
11
|
+
readonly lineStart?: number;
|
|
12
|
+
readonly lineEnd?: number;
|
|
13
|
+
readonly anchor?: string;
|
|
14
|
+
readonly jiraKey?: string;
|
|
15
|
+
readonly confluencePageId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface QaSourceOrigin {
|
|
18
|
+
readonly sessionId: string;
|
|
19
|
+
readonly turn: number;
|
|
20
|
+
readonly step?: number;
|
|
21
|
+
readonly toolCallId?: string;
|
|
22
|
+
readonly toolName?: string;
|
|
23
|
+
readonly agentId?: string;
|
|
24
|
+
readonly role: "parent" | "subagent";
|
|
25
|
+
readonly subagentRunId?: string;
|
|
26
|
+
readonly subagentSessionId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface QaSourceReference {
|
|
29
|
+
/** Stable identity after path, URL or provider-specific normalization. */
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly kind: QaSourceKind;
|
|
32
|
+
readonly title: string;
|
|
33
|
+
readonly uri?: string;
|
|
34
|
+
readonly path?: string;
|
|
35
|
+
readonly snippet?: string;
|
|
36
|
+
readonly locations: readonly QaSourceLocation[];
|
|
37
|
+
readonly evidence: QaSourceEvidence;
|
|
38
|
+
readonly origins: readonly QaSourceOrigin[];
|
|
39
|
+
readonly score: number;
|
|
40
|
+
readonly metadata?: QaSourceMetadata;
|
|
41
|
+
}
|
|
42
|
+
export interface QaTurnSources {
|
|
43
|
+
readonly version: 1;
|
|
44
|
+
readonly sessionId: string;
|
|
45
|
+
readonly turn: number;
|
|
46
|
+
readonly sources: readonly QaSourceReference[];
|
|
47
|
+
readonly discovered?: readonly QaSourceReference[];
|
|
48
|
+
readonly complete: boolean;
|
|
49
|
+
readonly incompleteOrigins?: readonly {
|
|
50
|
+
readonly subagentRunId?: string;
|
|
51
|
+
readonly provider?: string;
|
|
52
|
+
readonly reason: string;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
export interface SourceExtractorContext {
|
|
56
|
+
readonly toolName: string;
|
|
57
|
+
readonly args: unknown;
|
|
58
|
+
readonly result: unknown;
|
|
59
|
+
readonly presentation?: unknown;
|
|
60
|
+
readonly origin: QaSourceOrigin;
|
|
61
|
+
/** Canonical session/workspace root used to make local paths portable. */
|
|
62
|
+
readonly workspaceRoot?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface QaReportedSource {
|
|
65
|
+
readonly kind: QaSourceKind;
|
|
66
|
+
readonly title: string;
|
|
67
|
+
readonly uri?: string;
|
|
68
|
+
readonly path?: string;
|
|
69
|
+
readonly snippet?: string;
|
|
70
|
+
readonly locations?: readonly QaSourceLocation[];
|
|
71
|
+
readonly metadata?: QaSourceMetadata;
|
|
72
|
+
}
|
|
73
|
+
export interface SourceExtractor {
|
|
74
|
+
readonly id: string;
|
|
75
|
+
matches(context: SourceExtractorContext): boolean;
|
|
76
|
+
extract(context: SourceExtractorContext): readonly QaSourceReference[];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { normalizeRoutePath } from "./config-resolvers/basics.js";
|
|
2
|
+
import { DEFAULT_QA_SURFACE_CONFIG } from "./config-resolvers/defaults.js";
|
|
1
3
|
import type { QaSurfaceConfig, ResolvedQaSurfaceConfig } from "./types.js";
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
export { DEFAULT_QA_SURFACE_CONFIG, normalizeRoutePath };
|
|
5
|
+
/**
|
|
6
|
+
* Materialize defaults and enforce route/session/model safety constraints by
|
|
7
|
+
* running one resolver per config domain — in the order the checks have
|
|
8
|
+
* always fired — and assembling the frozen result.
|
|
9
|
+
*/
|
|
5
10
|
export declare function resolveConfig(input?: QaSurfaceConfig): ResolvedQaSurfaceConfig;
|
|
6
11
|
//# sourceMappingURL=resolve-config.d.ts.map
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
3
3
|
import type { QaLockdownProof, ResolvedQaSurfaceConfig } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* The accounts half of admission, resolved per call by the entry (accounts
|
|
6
|
+
* may be toggled at runtime). A gate must either accept the token/session
|
|
7
|
+
* pair or throw the coarse `QaAttestationError`; see {@link QaAccounts}.
|
|
8
|
+
*/
|
|
9
|
+
export interface QaAccountsGate {
|
|
10
|
+
enforceSessionAccess(token: string, sessionId: string): {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
} | undefined;
|
|
13
|
+
userWorkspace(userId: string, registeredWorkspacePath: string): string;
|
|
14
|
+
}
|
|
4
15
|
/**
|
|
5
16
|
* Host-side QA policy admission boundary — the only browser-callable operation
|
|
6
17
|
* that turns a session into a locked QA session. It verifies the immutable
|
|
@@ -13,9 +24,32 @@ export declare class QaPolicyAdmission {
|
|
|
13
24
|
private readonly ctx;
|
|
14
25
|
private readonly config;
|
|
15
26
|
private readonly logger;
|
|
27
|
+
private readonly accounts?;
|
|
16
28
|
private readonly appliedPolicies;
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Sessions the QA surface has attested. The provenance note is written for
|
|
31
|
+
* exactly these, and a delegated child resolves through its root session, so
|
|
32
|
+
* one set answers for the whole chat.
|
|
33
|
+
*/
|
|
34
|
+
private readonly attested;
|
|
35
|
+
private readonly workspaceRoots;
|
|
36
|
+
private readonly disposeWorkspaceGuard;
|
|
37
|
+
constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig, logger: PluginLogger, accounts?: QaAccountsGate | undefined);
|
|
38
|
+
/**
|
|
39
|
+
* The mounted attachment store's verbatim root, when the backend exposes
|
|
40
|
+
* one. It sits outside every workspace, so the per-user fence would
|
|
41
|
+
* otherwise deny the model the exact file an upload produced and the prompt
|
|
42
|
+
* points it at. A backend without a resolvable root simply keeps the fence
|
|
43
|
+
* closed — attachments then only work where reads are not fenced per user.
|
|
44
|
+
*/
|
|
45
|
+
private attachmentRoot;
|
|
46
|
+
secureSession(token: string, sessionId: string): QaLockdownProof;
|
|
47
|
+
/**
|
|
48
|
+
* Whether one session went through this boundary. The provenance note is
|
|
49
|
+
* written only for attested sessions, which is what keeps a deployment's
|
|
50
|
+
* source rules out of unrelated chats served by the same process.
|
|
51
|
+
*/
|
|
52
|
+
knowsSession(sessionId: string): boolean;
|
|
19
53
|
/** Detach every pinned tool policy; wired as a disposal effect by the entry. */
|
|
20
54
|
dispose(): void;
|
|
21
55
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser-local key namespace every QA-side index derives from: the
|
|
3
|
+
* configured storage key pinned to the served route, versioned once so the
|
|
4
|
+
* Host's head-script injection and the client bundle cannot drift apart.
|
|
5
|
+
*
|
|
6
|
+
* Dependency-free like every `src/shared` module: both bundles inline it.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The versioned key prefix for browser-local QA state of one deployment.
|
|
10
|
+
* Callers append their own scope suffix (`:account-token`, `:welcome-notice`,
|
|
11
|
+
* `:chat:<id>`, …).
|
|
12
|
+
* @param config - configuration holding the storage key and the route path.
|
|
13
|
+
* @returns the versioned prefix, e.g. `dsh-qa-surface.session:v1:/qa`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function qaStorageNamespace(config: Readonly<{
|
|
16
|
+
session: {
|
|
17
|
+
storageKey: string;
|
|
18
|
+
};
|
|
19
|
+
route: {
|
|
20
|
+
path: string;
|
|
21
|
+
};
|
|
22
|
+
}>): string;
|
|
23
|
+
//# sourceMappingURL=session-key.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identity shared by the Host plugin and its browser settings card.
|
|
3
|
+
*
|
|
4
|
+
* This module must stay dependency-free: the card bundle inlines it, and a
|
|
5
|
+
* browser build must not pull the Host config surface (schemastery) into the
|
|
6
|
+
* page just to learn the namespace name.
|
|
7
|
+
*/
|
|
8
|
+
/** Settings namespace the QA surface owns and its card binds to. */
|
|
9
|
+
export declare const QA_SURFACE_SETTINGS_NAMESPACE = "qa-surface";
|
|
10
|
+
//# sourceMappingURL=settings.d.ts.map
|