@yadsh/dsh-qa-surface 0.2.0 → 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 +84 -1
- package/README.md +87 -12
- package/compatibility.json +11 -3
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMPATIBILITY.md +1 -1
- package/docs/CONFIGURATION.md +88 -1
- 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.map +1 -1
- 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/QaSessionController.js +203 -127
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +234 -72
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +27 -241
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/attestation.js +6 -0
- package/lib/client/attestation.js.map +1 -1
- 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 +112 -0
- package/lib/client/components/QaChangelog.js.map +1 -0
- package/lib/client/components/QaMessage.js +47 -17
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaSidebar.js +63 -20
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaSourcesDrawer.js +113 -32
- package/lib/client/components/QaSourcesDrawer.js.map +1 -1
- 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/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 +100 -12
- 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 +151 -9
- 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-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.js +4649 -861
- package/lib/client.js.map +1 -1
- package/lib/config.js +218 -102
- 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 +209 -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/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 +161 -0
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +50 -8
- package/lib/secure-session.js.map +1 -1
- package/lib/typert.host.js +599 -6
- package/lib/typert.remote-client.d.ts +19 -3
- package/lib/typert.remote-client.js +471 -3
- package/lib/types/accounts/index.d.ts +2 -0
- package/lib/types/accounts/store.d.ts +121 -0
- package/lib/types/attestation.d.ts +1 -1
- package/lib/types/cli.d.ts +9 -0
- package/lib/types/client/QaAccountsController.d.ts +95 -0
- package/lib/types/client/QaConfigController.d.ts +1 -1
- package/lib/types/client/QaSessionController.d.ts +46 -7
- package/lib/types/client/QaSurface.d.ts +8 -3
- package/lib/types/client/QaTranscriptAdapter.d.ts +5 -10
- 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/QaMessage.d.ts +10 -3
- package/lib/types/client/components/QaSidebar.d.ts +30 -2
- package/lib/types/client/components/QaSourcesDrawer.d.ts +15 -3
- 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/source-refs.d.ts +16 -0
- package/lib/types/client/create-session.d.ts +16 -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/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 +73 -9
- 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/entry-redirect.d.ts +20 -0
- package/lib/types/host-route.d.ts +14 -1
- package/lib/types/index.d.ts +47 -3
- package/lib/types/launch-token.d.ts +21 -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 +11 -2
- package/lib/types/types.d.ts +167 -11
- package/package.json +58 -41
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SettingsOnboardingOwnerProps } from "@deepseek-ai/dsh-client-ui-settings/client";
|
|
2
|
+
import type { StorageLike } from "../types.js";
|
|
3
|
+
/** Bump when the notice changes materially and must be acknowledged again. */
|
|
4
|
+
export declare const QA_WELCOME_NOTICE_VERSION = "2026-09-12.1";
|
|
5
|
+
export declare const QA_WELCOME_NOTICE_COPY: Readonly<{
|
|
6
|
+
title: "Перед началом тестирования";
|
|
7
|
+
paragraphs: readonly string[];
|
|
8
|
+
continueLabel: "Понятно, продолжить";
|
|
9
|
+
}>;
|
|
10
|
+
export interface QaWelcomeNoticeFace {
|
|
11
|
+
readonly storage: StorageLike;
|
|
12
|
+
readonly storageKey: string;
|
|
13
|
+
}
|
|
14
|
+
export interface QaWelcomeNoticeProps extends QaWelcomeNoticeFace {
|
|
15
|
+
readonly complete?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface QaWelcomeNoticeStepProps extends SettingsOnboardingOwnerProps, QaWelcomeNoticeFace {
|
|
18
|
+
}
|
|
19
|
+
/** Route-scoped replacement for DSH's stock `welcome-notice` onboarding step. */
|
|
20
|
+
export declare function QaWelcomeNotice(props: QaWelcomeNoticeProps): import("react").ReactPortal | null;
|
|
21
|
+
/**
|
|
22
|
+
* Invisible shadow for DSH's stock welcome step. The host coordinator removes
|
|
23
|
+
* onboarding content as soon as a chat stops being blank, so the visible QA
|
|
24
|
+
* notice is owned by the route overlay above instead of this lifecycle.
|
|
25
|
+
*/
|
|
26
|
+
export declare function QaWelcomeNoticeStep(props: QaWelcomeNoticeStepProps): null;
|
|
27
|
+
//# sourceMappingURL=QaWelcomeNotice.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/** DSH's dragged content-width floor; a lower operator cap still wins. */
|
|
3
|
+
export declare const QA_CONTENT_MIN_WIDTH = 640;
|
|
4
|
+
/**
|
|
5
|
+
* Space kept outside the content: 88px per side leaves room for the handle,
|
|
6
|
+
* its inset, and a safe zone that remains draggable in both directions.
|
|
7
|
+
*/
|
|
8
|
+
export declare const QA_CONTENT_EDGE_BUDGET = 176;
|
|
9
|
+
export declare function readQaContentWidth(storage: Pick<Storage, "getItem">, key: string): number | null;
|
|
10
|
+
export declare function writeQaContentWidth(storage: Pick<Storage, "setItem">, key: string, width: number): void;
|
|
11
|
+
/** Resolve the centered content width for the currently available column. */
|
|
12
|
+
export declare function resolveQaContentWidth(columnWidth: number, preference: number | null, maxContentWidth: number): number;
|
|
13
|
+
interface QaWidthHandleProps {
|
|
14
|
+
readonly side: "left" | "right";
|
|
15
|
+
readonly onStart: () => number;
|
|
16
|
+
readonly onDrag: (width: number) => void;
|
|
17
|
+
readonly onCommit: (width: number) => void;
|
|
18
|
+
readonly onEnd: () => void;
|
|
19
|
+
}
|
|
20
|
+
/** Pointer-captured, rAF-throttled symmetric content-width handle. */
|
|
21
|
+
export declare function QaWidthHandle(props: QaWidthHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
interface UseQaContentWidthOptions {
|
|
23
|
+
readonly active: boolean;
|
|
24
|
+
readonly root: RefObject<HTMLDivElement | null>;
|
|
25
|
+
readonly storage: Pick<Storage, "getItem" | "setItem">;
|
|
26
|
+
readonly storageKey: string;
|
|
27
|
+
readonly maxContentWidth: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function useQaContentWidth({ active, root, storage, storageKey, maxContentWidth, }: UseQaContentWidthOptions): {
|
|
30
|
+
readonly onStart: () => number;
|
|
31
|
+
readonly onDrag: (requestedWidth: number) => void;
|
|
32
|
+
readonly onCommit: (requestedWidth: number) => void;
|
|
33
|
+
readonly onEnd: () => void;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=QaWidthHandle.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { QaSource } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Match layer between assistant text and the canonical turn sources: markdown
|
|
4
|
+
* links resolve by normalized URL, inline-code tokens by file path. A token
|
|
5
|
+
* that matches nothing keeps its plain rendering — the surface never guesses.
|
|
6
|
+
*/
|
|
7
|
+
export interface QaSourceRefs {
|
|
8
|
+
/** Identity of the source set; memo comparators compare this. */
|
|
9
|
+
readonly signature: string;
|
|
10
|
+
resolveUrl(url: string): QaSource | undefined;
|
|
11
|
+
resolvePath(token: string): QaSource | undefined;
|
|
12
|
+
}
|
|
13
|
+
/** Display name for a file-backed source: the file name alone, case kept. */
|
|
14
|
+
export declare function sourceFileName(source: QaSource): string;
|
|
15
|
+
export declare function buildSourceRefs(sources: readonly QaSource[]): QaSourceRefs;
|
|
16
|
+
//# sourceMappingURL=source-refs.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
2
|
+
import type { QaSessions, QaSessionsApi } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create one Host session and pin the configured preset and model onto the
|
|
5
|
+
* still-blank session. The creation wire takes no preset, so
|
|
6
|
+
* agentPresets/select recomposes the agent and durably logs
|
|
7
|
+
* `agent-preset/selected`, which the client projection replays. The session
|
|
8
|
+
* is addressed only here — no prompt can run before the caller attests the
|
|
9
|
+
* composed preset.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createQaSession(args: {
|
|
12
|
+
readonly sessions: QaSessions;
|
|
13
|
+
readonly api: QaSessionsApi;
|
|
14
|
+
readonly config: ResolvedQaSurfaceConfig;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
//# sourceMappingURL=create-session.d.ts.map
|
|
@@ -9,6 +9,7 @@ export declare const inject: string[];
|
|
|
9
9
|
/** Register the route-aware, full-frame QA entry in the additive overlay slot. */
|
|
10
10
|
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
|
11
11
|
export { QaConfigController } from "./QaConfigController.js";
|
|
12
|
+
export { QaAccountsController } from "./QaAccountsController.js";
|
|
12
13
|
export { QaRouteController, matchesQaRoute } from "./QaRouteController.js";
|
|
13
14
|
export { QaSessionController } from "./QaSessionController.js";
|
|
14
15
|
export { projectTranscript } from "./QaTranscriptAdapter.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
2
|
+
import type { ConversationSnapshot } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
3
|
+
import type { QaSessionState, QaSubagentView, QaTurnSources, ResolvedQaSurfaceConfig } from "../types.js";
|
|
4
|
+
/** Everything the bound-chat projection reads; the computation is pure. */
|
|
5
|
+
export interface QaBoundProjectionInput {
|
|
6
|
+
readonly connected: boolean;
|
|
7
|
+
readonly sessionId: string;
|
|
8
|
+
readonly sessionSnapshot: ReturnType<SessionFace["getSnapshot"]>;
|
|
9
|
+
readonly conversationSnapshot: ConversationSnapshot | undefined;
|
|
10
|
+
/** Turn bundles with the Host provenance already merged in (Host wins). */
|
|
11
|
+
readonly sourceBundles: readonly QaTurnSources[];
|
|
12
|
+
readonly operationError: string | null;
|
|
13
|
+
readonly policyReady: boolean;
|
|
14
|
+
readonly admissionPending: boolean;
|
|
15
|
+
readonly chatsRevision: number;
|
|
16
|
+
readonly viewingSubagent: QaSubagentView | null;
|
|
17
|
+
readonly config: ResolvedQaSurfaceConfig;
|
|
18
|
+
/**
|
|
19
|
+
* The chat owner's display name for author labels; present only when an
|
|
20
|
+
* admin reads a foreign chat (chat-level, not per-message).
|
|
21
|
+
*/
|
|
22
|
+
readonly author?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Project one bound chat into the observable surface state: phase, transcript
|
|
26
|
+
* with per-turn sources, footer sources, and the composer's capabilities.
|
|
27
|
+
* Side effects (host-bundle refresh, notifications) live in the controller.
|
|
28
|
+
*/
|
|
29
|
+
export declare function projectBoundSessionState(input: QaBoundProjectionInput): QaSessionState;
|
|
30
|
+
//# sourceMappingURL=project-session-state.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { QaSecureSession } from "./types.js";
|
|
2
|
+
import type { ResolvedQaSurfaceConfig } from "../types.js";
|
|
3
|
+
export type QaAttestationOutcome = {
|
|
4
|
+
readonly ok: true;
|
|
5
|
+
} | {
|
|
6
|
+
readonly ok: false;
|
|
7
|
+
/** The identity is absent or expired; the caller returns to the gate. */
|
|
8
|
+
readonly authRequired: boolean;
|
|
9
|
+
readonly reason: string | null;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* One send-time policy attestation against the Host admission gate. The
|
|
13
|
+
* QA-facing message stays generic by design; the coarse reason plus an
|
|
14
|
+
* operator hint go to the console once per refusal.
|
|
15
|
+
*/
|
|
16
|
+
export declare function attestQaPolicy(args: {
|
|
17
|
+
readonly secureSession: QaSecureSession;
|
|
18
|
+
readonly token: string;
|
|
19
|
+
readonly sessionId: string;
|
|
20
|
+
readonly lockdown: ResolvedQaSurfaceConfig["lockdown"];
|
|
21
|
+
readonly report: boolean;
|
|
22
|
+
}): Promise<QaAttestationOutcome>;
|
|
23
|
+
//# sourceMappingURL=session-admission.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-chat cache of resolved attachment URLs. Attachment reads are
|
|
3
|
+
* session-scoped (the loader reads the bound session's durable store), and
|
|
4
|
+
* attachment ids are only unique within a chat, so both the cache and the
|
|
5
|
+
* blob lifetime are keyed by chat, not by the page.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SessionAssetRepository {
|
|
8
|
+
private readonly bySession;
|
|
9
|
+
/** Resolve one attachment of one chat, deduplicating concurrent reads. */
|
|
10
|
+
resolve(sessionId: string, attachmentId: string, load: (attachmentId: string) => Promise<string>): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* Revoke the chat's blob URLs and drop its cache. Data URLs need no
|
|
13
|
+
* revocation; a failed resolution never produced a URL at all.
|
|
14
|
+
*/
|
|
15
|
+
release(sessionId: string): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
/** Revoke one blob URL; data URLs (and other runtimes) need nothing. */
|
|
19
|
+
export declare function revokeObjectUrlIfBlob(url: string): void;
|
|
20
|
+
//# sourceMappingURL=session-assets.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { QaTurnSources } from "../types.js";
|
|
2
|
+
import type { QaSourceApi } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Host-side provenance of the bound chat. The client projects turn sources
|
|
5
|
+
* from durable conversation events; the Host bundle (which also carries
|
|
6
|
+
* subagent-inherited evidence) is fetched on the side and merged by turn,
|
|
7
|
+
* Host data winning over the projection.
|
|
8
|
+
*/
|
|
9
|
+
export declare class QaHostSourceBridge {
|
|
10
|
+
private readonly sourceApi;
|
|
11
|
+
private readonly token;
|
|
12
|
+
private bundles;
|
|
13
|
+
private signature;
|
|
14
|
+
private refreshing;
|
|
15
|
+
/** Bumped on reset so a stale in-flight fetch never lands. */
|
|
16
|
+
private generation;
|
|
17
|
+
constructor(sourceApi: QaSourceApi, token: () => string);
|
|
18
|
+
/** Leave the chat: drop its bundles; merging degrades to the projection. */
|
|
19
|
+
reset(): void;
|
|
20
|
+
merge(projected: readonly QaTurnSources[]): readonly QaTurnSources[];
|
|
21
|
+
/**
|
|
22
|
+
* Fetch the Host bundles of one chat; a changed payload republishes through
|
|
23
|
+
* the callback. Repeated calls coalesce while one is in flight, and a
|
|
24
|
+
* response that outlives the chat is dropped.
|
|
25
|
+
*/
|
|
26
|
+
refresh(sessionId: string, onChanged: () => void): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=session-sources.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToolResultNode } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
2
|
+
import type { QaWorkItem } from "../types.js";
|
|
3
|
+
export declare function flattenToolOutput(node: ToolResultNode): string | null;
|
|
4
|
+
export declare function toolStatus(node: ToolResultNode): "ok" | "error" | "stopped";
|
|
5
|
+
export declare function workTool(callId: string, name: string, argsRaw: string, status: "running" | "ok" | "error" | "stopped", startedAt: number | undefined, endedAt: number | undefined, output: string | null): QaWorkItem;
|
|
6
|
+
//# sourceMappingURL=tool-presentation.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ConversationSnapshot } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
2
|
+
import type { LegacyConversationSlice } from "@deepseek-ai/dsh-client-ui-chat/client";
|
|
3
|
+
import type { QaSource, QaTurnSources } from "../types.js";
|
|
4
|
+
/** The transcript-bearing Chat slice of one Conversation snapshot (absent before the view activates). */
|
|
5
|
+
export declare function chatLegacyOf(snapshot: ConversationSnapshot | undefined): LegacyConversationSlice;
|
|
6
|
+
/**
|
|
7
|
+
* Rebuild canonical turn bundles from durable tool-result metadata. Since the
|
|
8
|
+
* metadata is persisted by DSH, this projection is identical on live updates
|
|
9
|
+
* and replay and requires no assistant-authored bibliography.
|
|
10
|
+
*/
|
|
11
|
+
export declare function projectTurnSources(snapshot: ConversationSnapshot | undefined, sessionId?: string, workspaceRoot?: string): readonly QaTurnSources[];
|
|
12
|
+
/** Visible evidence sources for the latest turn, shared by the drawer/footer. */
|
|
13
|
+
export declare function projectSources(snapshot: ConversationSnapshot | undefined, sessionId?: string, workspaceRoot?: string): readonly QaSource[];
|
|
14
|
+
//# sourceMappingURL=turn-sources.d.ts.map
|
|
@@ -1,23 +1,86 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ISessions,
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
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
5
|
/** Wire content one prompt carries: text plus base64 image uploads. */
|
|
6
6
|
export type QaPromptContent = Parameters<SessionFace["prompt"]>[0];
|
|
7
7
|
/** DSH session runtime surface the QA controller is allowed to touch. */
|
|
8
|
-
export type QaSessions = ISessions
|
|
8
|
+
export type QaSessions = ISessions;
|
|
9
9
|
/** Narrow client API slice used to pin the preset and model of a fresh chat. */
|
|
10
|
-
export type QaSessionsApi =
|
|
11
|
-
|
|
10
|
+
export type QaSessionsApi = {
|
|
11
|
+
selectModel: ClientRemote["session"]["selectModel"];
|
|
12
|
+
selectAgentPreset: ClientRemote["agentPresets"]["select"];
|
|
12
13
|
};
|
|
13
|
-
/**
|
|
14
|
-
|
|
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<{
|
|
15
25
|
readonly ok: true;
|
|
16
26
|
readonly value: QaLockdownProof;
|
|
17
27
|
} | {
|
|
18
28
|
readonly ok: false;
|
|
19
29
|
readonly error: unknown;
|
|
20
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
|
+
};
|
|
21
84
|
/** Minimal persistence contract; backed by `window.localStorage` in the app. */
|
|
22
85
|
export interface StorageLike {
|
|
23
86
|
getItem(key: string): string | null;
|
|
@@ -26,4 +89,5 @@ export interface StorageLike {
|
|
|
26
89
|
}
|
|
27
90
|
/** The state projected while no QA chat is bound (route inactive or booting). */
|
|
28
91
|
export declare const QA_SESSION_IDLE_STATE: QaSessionState;
|
|
92
|
+
export {};
|
|
29
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,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,9 +1,10 @@
|
|
|
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 { QaAccountSession, 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
|
-
export declare const QA_SURFACE_SETTINGS_NAMESPACE
|
|
7
|
+
export declare const QA_SURFACE_SETTINGS_NAMESPACE = "qa-surface";
|
|
7
8
|
export declare const Config: import("@deepseek-ai/schemastery").default<QaSurfaceConfig>;
|
|
8
9
|
declare module "@deepseek-ai/cordis" {
|
|
9
10
|
interface Context {
|
|
@@ -17,11 +18,47 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
17
18
|
private source;
|
|
18
19
|
private readonly logger;
|
|
19
20
|
private readonly admission;
|
|
21
|
+
private readonly provenance;
|
|
22
|
+
private accounts;
|
|
23
|
+
private accountsOptions;
|
|
24
|
+
private readonly launchToken;
|
|
20
25
|
private webServer;
|
|
21
26
|
private disposeRoute;
|
|
22
27
|
private routeKey;
|
|
23
28
|
constructor(ctx: Context, entry?: QaSurfaceConfig);
|
|
24
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
|
+
};
|
|
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
|
|
@@ -31,15 +68,22 @@ export declare class QaSurface extends TypertRemoteService {
|
|
|
31
68
|
*/
|
|
32
69
|
describe(): ResolvedQaSurfaceConfig;
|
|
33
70
|
/** Pin and attest the effective policy. The browser supplies identity only. */
|
|
34
|
-
secureSession(sessionId: string): QaLockdownProof;
|
|
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>;
|
|
35
76
|
private refreshRoute;
|
|
36
77
|
}
|
|
37
78
|
export { ConfigSchema, DEFAULT_QA_SURFACE_CONFIG, normalizeRoutePath, resolveConfig, } from "./config.js";
|
|
38
79
|
export { QaAttestationError } from "./attestation.js";
|
|
39
80
|
export type { QaAttestationReason } from "./attestation.js";
|
|
81
|
+
export { QaAccounts, QaAccountsError } from "./accounts/store.js";
|
|
82
|
+
export { entryRedirectRow, entryRedirectScript } from "./entry-redirect.js";
|
|
40
83
|
export { registerQaNavigationRoute } from "./host-route.js";
|
|
41
84
|
export { qaToolDenial, qaToolPolicyPlan } from "./lockdown-policy.js";
|
|
42
85
|
export { QaPolicyAdmission } from "./secure-session.js";
|
|
86
|
+
export * from "./provenance/index.js";
|
|
43
87
|
export type * from "./types.js";
|
|
44
88
|
export default QaSurface;
|
|
45
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,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
|