@yadsh/dsh-qa-surface 0.1.1 → 0.3.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/CHANGELOG.md +151 -0
- package/README.md +239 -16
- package/SPEC-dsh-qa-surface.md +600 -96
- package/capability-policy.json +5 -0
- package/compatibility.json +18 -4
- package/cordis.patch.yml +11 -0
- package/docs/ARCHITECTURE.md +50 -8
- package/docs/COMPATIBILITY.md +5 -4
- package/docs/CONFIGURATION.md +184 -3
- package/docs/SOURCES-MIGRATION.md +28 -0
- package/docs/SOURCES-PROVENANCE-AUDIT.md +88 -0
- package/docs/SPEC-dsh-qa-surface-accounts.md +219 -0
- package/docs/SPEC-dsh-qa-surface-sources-provenance.md +1692 -0
- package/lib/accounts/index.js +2 -0
- package/lib/accounts/index.js.map +1 -0
- package/lib/accounts/store.js +478 -0
- package/lib/accounts/store.js.map +1 -0
- package/lib/attestation.js +10 -0
- package/lib/attestation.js.map +1 -0
- package/lib/cli.js +143 -0
- package/lib/cli.js.map +1 -0
- package/lib/client/QaAccountsController.js +329 -0
- package/lib/client/QaAccountsController.js.map +1 -0
- package/lib/client/QaConfigController.js +111 -4
- package/lib/client/QaConfigController.js.map +1 -1
- package/lib/client/QaSessionController.js +621 -163
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +303 -24
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +324 -49
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/attestation.js +66 -0
- package/lib/client/attestation.js.map +1 -0
- package/lib/client/chat-index.js +86 -0
- package/lib/client/chat-index.js.map +1 -0
- package/lib/client/components/Markdown.js +124 -13
- package/lib/client/components/Markdown.js.map +1 -1
- package/lib/client/components/QaAgentsDrawer.js +40 -0
- package/lib/client/components/QaAgentsDrawer.js.map +1 -0
- package/lib/client/components/QaAuthGate.js +40 -0
- package/lib/client/components/QaAuthGate.js.map +1 -0
- package/lib/client/components/QaChangelog.js +112 -0
- package/lib/client/components/QaChangelog.js.map +1 -0
- package/lib/client/components/QaComposer.js +132 -15
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaMessage.js +214 -10
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaSidebar.js +167 -0
- package/lib/client/components/QaSidebar.js.map +1 -0
- package/lib/client/components/QaSourcesDrawer.js +127 -0
- package/lib/client/components/QaSourcesDrawer.js.map +1 -0
- package/lib/client/components/QaTurnRail.js +281 -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 +142 -0
- package/lib/client/components/QaWidthHandle.js.map +1 -0
- package/lib/client/components/QaWorkGroup.js +135 -0
- package/lib/client/components/QaWorkGroup.js.map +1 -0
- package/lib/client/components/VariantSwitcher.js +29 -0
- package/lib/client/components/VariantSwitcher.js.map +1 -0
- package/lib/client/components/format.js +48 -0
- package/lib/client/components/format.js.map +1 -0
- package/lib/client/components/source-refs.js +78 -0
- package/lib/client/components/source-refs.js.map +1 -0
- package/lib/client/create-session.js +51 -0
- package/lib/client/create-session.js.map +1 -0
- package/lib/client/index.js +166 -35
- 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/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/settlement.js +24 -0
- package/lib/client/settlement.js.map +1 -0
- package/lib/client/styles.js +450 -43
- 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 +15 -0
- package/lib/client/types.js.map +1 -0
- package/lib/client/use-session-ui-state.js +68 -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/wait-for.js +49 -0
- package/lib/client/wait-for.js.map +1 -0
- package/lib/client.js +12551 -918
- package/lib/client.js.map +1 -1
- package/lib/config.js +226 -58
- package/lib/config.js.map +1 -1
- package/lib/entry-redirect.js +44 -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 +354 -72
- package/lib/index.js.map +1 -1
- package/lib/launch-token.js +42 -0
- package/lib/launch-token.js.map +1 -0
- package/lib/lockdown-policy.js +20 -0
- package/lib/lockdown-policy.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 +283 -10
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +212 -0
- package/lib/secure-session.js.map +1 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +784 -0
- package/lib/typert.remote-client.d.ts +40 -0
- package/lib/typert.remote-client.js +597 -0
- package/lib/types/accounts/index.d.ts +2 -0
- package/lib/types/accounts/store.d.ts +121 -0
- package/lib/types/attestation.d.ts +17 -0
- package/lib/types/cli.d.ts +9 -0
- package/lib/types/client/QaAccountsController.d.ts +95 -0
- package/lib/types/client/QaConfigController.d.ts +35 -3
- package/lib/types/client/QaSessionController.d.ts +146 -20
- package/lib/types/client/QaSurface.d.ts +11 -5
- package/lib/types/client/QaTranscriptAdapter.d.ts +13 -3
- package/lib/types/client/attestation.d.ts +25 -0
- package/lib/types/client/chat-index.d.ts +28 -0
- package/lib/types/client/components/Markdown.d.ts +17 -3
- package/lib/types/client/components/QaAgentsDrawer.d.ts +25 -0
- 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 +12 -2
- package/lib/types/client/components/QaMessage.d.ts +22 -2
- package/lib/types/client/components/QaSidebar.d.ts +69 -0
- package/lib/types/client/components/QaSourcesDrawer.d.ts +20 -0
- package/lib/types/client/components/QaTurnRail.d.ts +59 -0
- package/lib/types/client/components/QaWelcomeNotice.d.ts +27 -0
- package/lib/types/client/components/QaWidthHandle.d.ts +36 -0
- package/lib/types/client/components/QaWorkGroup.d.ts +19 -0
- package/lib/types/client/components/VariantSwitcher.d.ts +19 -0
- package/lib/types/client/components/format.d.ts +9 -0
- package/lib/types/client/components/source-refs.d.ts +16 -0
- package/lib/types/client/create-session.d.ts +16 -0
- package/lib/types/client/index.d.ts +2 -5
- package/lib/types/client/project-session-state.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/settlement.d.ts +6 -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 +93 -0
- package/lib/types/client/use-session-ui-state.d.ts +35 -0
- package/lib/types/client/use-transcript-view.d.ts +20 -0
- package/lib/types/client/wait-for.d.ts +11 -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 +67 -7
- package/lib/types/launch-token.d.ts +21 -0
- package/lib/types/lockdown-policy.d.ts +18 -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/secure-session.d.ts +31 -0
- package/lib/types/types.d.ts +304 -1
- package/package.json +70 -27
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ClientRemote } from "@deepseek-ai/dsh-api-gateway/client";
|
|
2
|
+
import type { ISessions, SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
3
|
+
import type { UiConversation } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
4
|
+
import type { QaAccountSession, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaSessionState, QaSourceFilePreview, QaTurnSources, QaWhoamiResult } from "../types.js";
|
|
5
|
+
/** Wire content one prompt carries: text plus base64 image uploads. */
|
|
6
|
+
export type QaPromptContent = Parameters<SessionFace["prompt"]>[0];
|
|
7
|
+
/** DSH session runtime surface the QA controller is allowed to touch. */
|
|
8
|
+
export type QaSessions = ISessions;
|
|
9
|
+
/** Narrow client API slice used to pin the preset and model of a fresh chat. */
|
|
10
|
+
export type QaSessionsApi = {
|
|
11
|
+
selectModel: ClientRemote["session"]["selectModel"];
|
|
12
|
+
selectAgentPreset: ClientRemote["agentPresets"]["select"];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Conversation assembly the QA transcript is projected from: the per-Session
|
|
16
|
+
* binding carries the assembled Chat view (nodes, partials, tool calls).
|
|
17
|
+
*/
|
|
18
|
+
export type QaConversation = Pick<UiConversation, "binding">;
|
|
19
|
+
/**
|
|
20
|
+
* Attestation channel to the Host admission boundary
|
|
21
|
+
* (`qaSurface/secureSession`). The account token rides as the first argument
|
|
22
|
+
* when accounts are enabled; an empty string is the anonymous caller.
|
|
23
|
+
*/
|
|
24
|
+
export type QaSecureSession = (token: string, sessionId: string) => Promise<{
|
|
25
|
+
readonly ok: true;
|
|
26
|
+
readonly value: QaLockdownProof;
|
|
27
|
+
} | {
|
|
28
|
+
readonly ok: false;
|
|
29
|
+
readonly error: unknown;
|
|
30
|
+
}>;
|
|
31
|
+
export interface QaSourceApi {
|
|
32
|
+
sources(token: string, sessionId: string): Promise<{
|
|
33
|
+
readonly ok: true;
|
|
34
|
+
readonly value: readonly QaTurnSources[];
|
|
35
|
+
} | {
|
|
36
|
+
readonly ok: false;
|
|
37
|
+
readonly error: unknown;
|
|
38
|
+
}>;
|
|
39
|
+
readSourceFile(token: string, sessionId: string, sourcePath: string): Promise<{
|
|
40
|
+
readonly ok: true;
|
|
41
|
+
readonly value: QaSourceFilePreview;
|
|
42
|
+
} | {
|
|
43
|
+
readonly ok: false;
|
|
44
|
+
readonly error: unknown;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
/** A source API with the account token already bound at the call site. */
|
|
48
|
+
export type QaBoundSourceApi = {
|
|
49
|
+
sources(sessionId: string): Promise<{
|
|
50
|
+
readonly ok: true;
|
|
51
|
+
readonly value: readonly QaTurnSources[];
|
|
52
|
+
} | {
|
|
53
|
+
readonly ok: false;
|
|
54
|
+
readonly error: unknown;
|
|
55
|
+
}>;
|
|
56
|
+
readSourceFile(sessionId: string, sourcePath: string): Promise<{
|
|
57
|
+
readonly ok: true;
|
|
58
|
+
readonly value: QaSourceFilePreview;
|
|
59
|
+
} | {
|
|
60
|
+
readonly ok: false;
|
|
61
|
+
readonly error: unknown;
|
|
62
|
+
}>;
|
|
63
|
+
};
|
|
64
|
+
/** Account remotes exposed by the plugin's own typert namespace. */
|
|
65
|
+
export interface QaAccountsApi {
|
|
66
|
+
accountsWhoami(token: string): Promise<RemoteResult<QaWhoamiResult>>;
|
|
67
|
+
accountsLogin(email: string, password: string): Promise<RemoteResult<QaAccountSession>>;
|
|
68
|
+
accountsRegister(email: string, password: string): Promise<RemoteResult<QaAccountSession>>;
|
|
69
|
+
accountsClaimSessions(token: string, sessionIds: readonly string[]): Promise<RemoteResult<QaClaimResult>>;
|
|
70
|
+
accountsOwnedSessions(token: string): Promise<RemoteResult<{
|
|
71
|
+
readonly ids: readonly string[];
|
|
72
|
+
}>>;
|
|
73
|
+
accountsListOwnership(token: string): Promise<RemoteResult<{
|
|
74
|
+
readonly entries: readonly QaOwnershipEntry[];
|
|
75
|
+
}>>;
|
|
76
|
+
}
|
|
77
|
+
type RemoteResult<Value> = {
|
|
78
|
+
readonly ok: true;
|
|
79
|
+
readonly value: Value;
|
|
80
|
+
} | {
|
|
81
|
+
readonly ok: false;
|
|
82
|
+
readonly error: unknown;
|
|
83
|
+
};
|
|
84
|
+
/** Minimal persistence contract; backed by `window.localStorage` in the app. */
|
|
85
|
+
export interface StorageLike {
|
|
86
|
+
getItem(key: string): string | null;
|
|
87
|
+
setItem(key: string, value: string): void;
|
|
88
|
+
removeItem(key: string): void;
|
|
89
|
+
}
|
|
90
|
+
/** The state projected while no QA chat is bound (route inactive or booting). */
|
|
91
|
+
export declare const QA_SESSION_IDLE_STATE: QaSessionState;
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import type { QaImageDraft, QaSource, QaTurnSources } from "../types.js";
|
|
3
|
+
/** Snapshot completeness captured when a drawer was opened from a message. */
|
|
4
|
+
export interface QaDrawerCompleteness {
|
|
5
|
+
readonly complete: boolean;
|
|
6
|
+
readonly incompleteOrigins?: QaTurnSources["incompleteOrigins"];
|
|
7
|
+
}
|
|
8
|
+
export interface QaSessionUiState {
|
|
9
|
+
/** Per group: how many answers back from the newest is shown (0 = newest). */
|
|
10
|
+
readonly variantOffsets: Record<string, number>;
|
|
11
|
+
readonly setVariantOffsets: Dispatch<SetStateAction<Record<string, number>>>;
|
|
12
|
+
/** The turn the transcript's reading line currently owns. */
|
|
13
|
+
readonly activeTurn: number | null;
|
|
14
|
+
readonly setActiveTurn: Dispatch<SetStateAction<number | null>>;
|
|
15
|
+
readonly agentsOpen: boolean;
|
|
16
|
+
readonly setAgentsOpen: Dispatch<SetStateAction<boolean>>;
|
|
17
|
+
readonly sourcesOpen: boolean;
|
|
18
|
+
readonly setSourcesOpen: Dispatch<SetStateAction<boolean>>;
|
|
19
|
+
readonly drawerSources: readonly QaSource[] | null;
|
|
20
|
+
readonly setDrawerSources: Dispatch<SetStateAction<readonly QaSource[] | null>>;
|
|
21
|
+
readonly drawerCompleteness: QaDrawerCompleteness | null;
|
|
22
|
+
readonly setDrawerCompleteness: Dispatch<SetStateAction<QaDrawerCompleteness | null>>;
|
|
23
|
+
readonly drawerDetail: QaSource | null;
|
|
24
|
+
readonly setDrawerDetail: Dispatch<SetStateAction<QaSource | null>>;
|
|
25
|
+
readonly pendingImages: readonly QaImageDraft[];
|
|
26
|
+
readonly setPendingImages: (next: readonly QaImageDraft[]) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Per-chat UI state: composer attachments, variant offsets, the rail mark and
|
|
30
|
+
* the drawers. Everything here describes the chat it was made in, so a
|
|
31
|
+
* session change clears it instead of leaking a draft, an image or a drawer
|
|
32
|
+
* from one conversation into the next.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useSessionUiState(sessionId: string | null): QaSessionUiState;
|
|
35
|
+
//# sourceMappingURL=use-session-ui-state.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { QaMessage } from "../types.js";
|
|
2
|
+
import { type QaTurnRailItem } from "./components/QaTurnRail.js";
|
|
3
|
+
import { type QaVariantGroup } from "./components/VariantSwitcher.js";
|
|
4
|
+
export interface QaTranscriptView {
|
|
5
|
+
readonly visibleMessages: readonly QaMessage[];
|
|
6
|
+
/** Answer groups by the user message id that opens them. */
|
|
7
|
+
readonly groupByPromptId: ReadonlyMap<string, QaVariantGroup>;
|
|
8
|
+
/** Per group: the turn the current variant offset selects. */
|
|
9
|
+
readonly selectedTurn: ReadonlyMap<string, number>;
|
|
10
|
+
readonly railItems: readonly QaTurnRailItem[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Memoized transcript view model. The controller republishes state with a
|
|
14
|
+
* fresh messages array on every stream frame, but re-renders that keep the
|
|
15
|
+
* transcript unchanged (drawers, the active turn mark, variant offsets) must
|
|
16
|
+
* not re-run the projections — and per-row group lookups go through a map
|
|
17
|
+
* instead of a linear find inside the render loop.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useTranscriptView(messages: readonly QaMessage[], variantOffsets: Record<string, number>): QaTranscriptView;
|
|
20
|
+
//# sourceMappingURL=use-transcript-view.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve with the first snapshot of an observable source that satisfies
|
|
3
|
+
* `predicate`, or reject after `timeoutMs`. This is the DSH-runtime glue the
|
|
4
|
+
* QA surface needs instead of ad-hoc sleeps; the source only has to expose
|
|
5
|
+
* the getSnapshot/subscribe store pair used across the client bundle.
|
|
6
|
+
*/
|
|
7
|
+
export declare function waitFor<T>(source: {
|
|
8
|
+
getSnapshot(): T;
|
|
9
|
+
subscribe(listener: () => void): () => void;
|
|
10
|
+
}, predicate: (value: T) => boolean, timeoutMs: number): Promise<T>;
|
|
11
|
+
//# sourceMappingURL=wait-for.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResolvedQaSurfaceConfig } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The operator/LAN split is decided client-side on `location.hostname` on
|
|
4
|
+
* purpose: behind the qa-deploy proxy every request appears loopback to the
|
|
5
|
+
* Host, and the deployment convention is "operator uses localhost, QA users
|
|
6
|
+
* use the LAN address". `?ui=admin` persists the operator escape hatch under
|
|
7
|
+
* the deployment's storage key; `?ui=qa` clears it again.
|
|
8
|
+
*/
|
|
9
|
+
export declare function entryRedirectScript(config: ResolvedQaSurfaceConfig): string;
|
|
10
|
+
export interface EntryRedirectRow {
|
|
11
|
+
readonly kind: "script";
|
|
12
|
+
readonly placement: "head";
|
|
13
|
+
readonly text: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The structured index-injection row for one config snapshot, or undefined
|
|
17
|
+
* when the plugin is disabled or the redirect flag is off.
|
|
18
|
+
*/
|
|
19
|
+
export declare function entryRedirectRow(config: ResolvedQaSurfaceConfig): EntryRedirectRow | undefined;
|
|
20
|
+
//# sourceMappingURL=entry-redirect.d.ts.map
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
1
2
|
import type { WebServer } from "@deepseek-ai/dsh-host-webserver";
|
|
2
3
|
import type { ResolvedQaSurfaceConfig } from "./types.js";
|
|
4
|
+
import type { LaunchTokenSource } from "./launch-token.js";
|
|
5
|
+
export interface QaNavigationRouteOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the process launch token; when supplied and the browser carries
|
|
8
|
+
* no host-auth cookie, the route defers the marker hand-off in favor of the
|
|
9
|
+
* one-time `/?token=` exchange (relative location: the browser mints the
|
|
10
|
+
* cookie on the origin it actually used).
|
|
11
|
+
*/
|
|
12
|
+
readonly launchToken?: LaunchTokenSource;
|
|
13
|
+
}
|
|
14
|
+
/** Presence-only check: an invalid cookie still fails the root gate later. */
|
|
15
|
+
export declare function hasHostAuthCookie(request: IncomingMessage): boolean;
|
|
3
16
|
/**
|
|
4
17
|
* DSH 0.1.1 static hosting returns 404 for missing paths. Redirect a browser
|
|
5
18
|
* navigation through its canonical index entry; the client restores the
|
|
6
19
|
* requested pathname before activating the QA overlay.
|
|
7
20
|
*/
|
|
8
|
-
export declare function registerQaNavigationRoute(webServer: Pick<WebServer, "register">, config: ResolvedQaSurfaceConfig): () => void;
|
|
21
|
+
export declare function registerQaNavigationRoute(webServer: Pick<WebServer, "register">, config: ResolvedQaSurfaceConfig, options?: QaNavigationRouteOptions): () => void;
|
|
9
22
|
//# sourceMappingURL=host-route.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,29 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
2
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import type { QaTurnSources } from "./provenance/types.js";
|
|
4
|
+
import type { QaAccountSession, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaSurfaceConfig, ResolvedQaSurfaceConfig, QaSourceFilePreview, QaWhoamiResult } from "./types.js";
|
|
3
5
|
export declare const name = "qa-surface";
|
|
4
|
-
export declare const inject:
|
|
5
|
-
export declare const QA_SURFACE_SETTINGS_NAMESPACE
|
|
6
|
+
export declare const inject: string[];
|
|
7
|
+
export declare const QA_SURFACE_SETTINGS_NAMESPACE = "qa-surface";
|
|
6
8
|
export declare const Config: import("@deepseek-ai/schemastery").default<QaSurfaceConfig>;
|
|
7
9
|
declare module "@deepseek-ai/cordis" {
|
|
8
10
|
interface Context {
|
|
9
11
|
qaSurface: QaSurface;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
|
-
/**
|
|
13
|
-
export declare class QaSurface extends
|
|
14
|
-
static inject:
|
|
14
|
+
/** Host companion: validates config, owns the admission boundary and the route. */
|
|
15
|
+
export declare class QaSurface extends TypertRemoteService {
|
|
16
|
+
static inject: string[];
|
|
15
17
|
static Config: import("@deepseek-ai/schemastery").default<QaSurfaceConfig>;
|
|
16
18
|
private source;
|
|
17
19
|
private readonly logger;
|
|
20
|
+
private readonly admission;
|
|
21
|
+
private readonly provenance;
|
|
22
|
+
private accounts;
|
|
23
|
+
private accountsOptions;
|
|
24
|
+
private readonly launchToken;
|
|
18
25
|
private webServer;
|
|
19
26
|
private disposeRoute;
|
|
20
27
|
private routeKey;
|
|
21
28
|
constructor(ctx: Context, entry?: QaSurfaceConfig);
|
|
22
29
|
getConfig(): ResolvedQaSurfaceConfig;
|
|
30
|
+
/**
|
|
31
|
+
* The accounts store behind the runtime toggle. Rebuilt only when the
|
|
32
|
+
* account-affecting options change; the file is shared across rebuilds.
|
|
33
|
+
*/
|
|
34
|
+
private accountsFor;
|
|
35
|
+
/** The accounts store, or the disabled refusal the browser maps to copy. */
|
|
36
|
+
private requireAccounts;
|
|
37
|
+
/** Account failures ride the shared `(reason: <code>)` wire marker. */
|
|
38
|
+
private accountsRemote;
|
|
39
|
+
/**
|
|
40
|
+
* Self-service signup; the first account ever created becomes admin. The
|
|
41
|
+
* display name derives from the email: the generated client enforces exact
|
|
42
|
+
* wire arity, so an optional name parameter would still be required.
|
|
43
|
+
*/
|
|
44
|
+
accountsRegister(email: string, password: string): QaAccountSession;
|
|
45
|
+
accountsLogin(email: string, password: string): QaAccountSession;
|
|
46
|
+
/** Identity probe; safe to call with an empty or expired token. */
|
|
47
|
+
accountsWhoami(token: string): QaWhoamiResult;
|
|
48
|
+
/** Migrate a browser's local chat index into server-side ownership. */
|
|
49
|
+
accountsClaimSessions(token: string, sessionIds: readonly string[]): QaClaimResult;
|
|
50
|
+
/** The token user's owned session ids; the sidebar list authority. */
|
|
51
|
+
accountsOwnedSessions(token: string): {
|
|
52
|
+
readonly ids: readonly string[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Every chat-ownership entry with owner display names; the cross-user view
|
|
56
|
+
* admin browsers group the sidebar by. Ordinary accounts are refused with
|
|
57
|
+
* the dedicated reason, anonymous ones with auth-required.
|
|
58
|
+
*/
|
|
59
|
+
accountsListOwnership(token: string): {
|
|
60
|
+
readonly entries: readonly QaOwnershipEntry[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Serve the effective QA configuration to the browser. The DSH gateway pins
|
|
64
|
+
* settings RPCs to loopback, so a browser served over the LAN always sees
|
|
65
|
+
* the settings namespace as unavailable; this method is the config channel
|
|
66
|
+
* such a browser falls back to. It is read-only projection — the admission
|
|
67
|
+
* boundary stays in {@link secureSession}.
|
|
68
|
+
*/
|
|
69
|
+
describe(): ResolvedQaSurfaceConfig;
|
|
70
|
+
/** Pin and attest the effective policy. The browser supplies identity only. */
|
|
71
|
+
secureSession(token: string, sessionId: string): QaLockdownProof;
|
|
72
|
+
/** Return canonical Host snapshots; replay is rebuilt from qa/sources events. */
|
|
73
|
+
sources(token: string, sessionId: string): readonly QaTurnSources[];
|
|
74
|
+
/** Narrow read-only preview capability for files already present as sources. */
|
|
75
|
+
readSourceFile(token: string, sessionId: string, sourcePath: string): Promise<QaSourceFilePreview>;
|
|
23
76
|
private refreshRoute;
|
|
24
77
|
}
|
|
25
78
|
export { ConfigSchema, DEFAULT_QA_SURFACE_CONFIG, normalizeRoutePath, resolveConfig, } from "./config.js";
|
|
79
|
+
export { QaAttestationError } from "./attestation.js";
|
|
80
|
+
export type { QaAttestationReason } from "./attestation.js";
|
|
81
|
+
export { QaAccounts, QaAccountsError } from "./accounts/store.js";
|
|
82
|
+
export { entryRedirectRow, entryRedirectScript } from "./entry-redirect.js";
|
|
26
83
|
export { registerQaNavigationRoute } from "./host-route.js";
|
|
84
|
+
export { qaToolDenial, qaToolPolicyPlan } from "./lockdown-policy.js";
|
|
85
|
+
export { QaPolicyAdmission } from "./secure-session.js";
|
|
86
|
+
export * from "./provenance/index.js";
|
|
27
87
|
export type * from "./types.js";
|
|
28
88
|
export default QaSurface;
|
|
29
89
|
//# 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,18 @@
|
|
|
1
|
+
export interface QaToolPolicyPlan {
|
|
2
|
+
/** Exact names that must remain visible after the scoped restriction. */
|
|
3
|
+
readonly allow: readonly string[];
|
|
4
|
+
/** Configured names absent from the agent's composed tool view. */
|
|
5
|
+
readonly unknown: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Validate an allow-list against the complete agent-scoped view.
|
|
9
|
+
*
|
|
10
|
+
* Preset tools live on an ancestor scope, not necessarily in the global tool
|
|
11
|
+
* layer. The restriction must therefore retain the configured names verbatim;
|
|
12
|
+
* deriving it from the global view would hide every preset-owned tool after a
|
|
13
|
+
* successful first attestation and make the next attestation fail.
|
|
14
|
+
*/
|
|
15
|
+
export declare function qaToolPolicyPlan(allow: readonly string[], isMounted: (toolName: string) => boolean): QaToolPolicyPlan;
|
|
16
|
+
/** Monotonic execution decision shared by inherited, scoped and transport tools. */
|
|
17
|
+
export declare function qaToolDenial(allowed: ReadonlySet<string>, toolName: string): string | undefined;
|
|
18
|
+
//# sourceMappingURL=lockdown-policy.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
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
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): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Host-side QA policy admission boundary — the only browser-callable operation
|
|
14
|
+
* that turns a session into a locked QA session. It verifies the immutable
|
|
15
|
+
* session composition against the effective deployment config, refuses to
|
|
16
|
+
* adopt a non-QA session with user history, validates the named permission
|
|
17
|
+
* preset, pins the scoped tool restriction plus the monotonic execution guard,
|
|
18
|
+
* and returns a sanitized proof. Every refusal carries only a coarse reason.
|
|
19
|
+
*/
|
|
20
|
+
export declare class QaPolicyAdmission {
|
|
21
|
+
private readonly ctx;
|
|
22
|
+
private readonly config;
|
|
23
|
+
private readonly logger;
|
|
24
|
+
private readonly accounts?;
|
|
25
|
+
private readonly appliedPolicies;
|
|
26
|
+
constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig, logger: PluginLogger, accounts?: QaAccountsGate | undefined);
|
|
27
|
+
secureSession(token: string, sessionId: string): QaLockdownProof;
|
|
28
|
+
/** Detach every pinned tool policy; wired as a disposal effect by the entry. */
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=secure-session.d.ts.map
|