@yadsh/dsh-qa-surface 0.7.4 → 0.9.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 +169 -12
- package/compatibility.json +5 -0
- package/lib/access/capability-catalog.js +32 -3
- package/lib/access/capability-catalog.js.map +1 -1
- package/lib/access/model.js +24 -4
- package/lib/access/model.js.map +1 -1
- package/lib/access/role-repository.js +199 -91
- package/lib/access/role-repository.js.map +1 -1
- package/lib/access/service.js +223 -7
- package/lib/access/service.js.map +1 -1
- package/lib/account-remotes.js +2 -4
- package/lib/account-remotes.js.map +1 -1
- package/lib/accounts/database.js +447 -0
- package/lib/accounts/database.js.map +1 -0
- package/lib/accounts/errors.js.map +1 -1
- package/lib/accounts/file.js +27 -90
- package/lib/accounts/file.js.map +1 -1
- package/lib/accounts/store.js +224 -59
- package/lib/accounts/store.js.map +1 -1
- package/lib/admin/permissions.js +4 -0
- package/lib/admin/permissions.js.map +1 -1
- package/lib/admin/quality-store.js +270 -54
- package/lib/admin/quality-store.js.map +1 -1
- package/lib/admin/service.js +145 -7
- package/lib/admin/service.js.map +1 -1
- package/lib/admin/session-log.js +66 -5
- package/lib/admin/session-log.js.map +1 -1
- package/lib/cli.js +2 -1
- package/lib/cli.js.map +1 -1
- package/lib/client/QaSessionController.js +379 -39
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +94 -34
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +40 -0
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/admin/QaAdmin.js +26 -8
- package/lib/client/admin/QaAdmin.js.map +1 -1
- package/lib/client/admin/{format.js → copy.js} +1 -1
- package/lib/client/admin/copy.js.map +1 -0
- package/lib/client/admin/pages/Conversations.js +34 -8
- package/lib/client/admin/pages/Conversations.js.map +1 -1
- package/lib/client/admin/pages/Overview.js +1 -1
- package/lib/client/admin/pages/Overview.js.map +1 -1
- package/lib/client/admin/pages/Quality.js +1 -1
- package/lib/client/admin/pages/Quality.js.map +1 -1
- package/lib/client/admin/pages/Review.js +1 -1
- package/lib/client/admin/pages/Review.js.map +1 -1
- package/lib/client/admin/pages/Users.js +6 -2
- package/lib/client/admin/pages/Users.js.map +1 -1
- package/lib/client/admin/shared.js +10 -1
- package/lib/client/admin/shared.js.map +1 -1
- package/lib/client/admin/styles.js +2 -0
- package/lib/client/admin/styles.js.map +1 -1
- package/lib/client/audit/QaAuditDialog.js +74 -0
- package/lib/client/audit/QaAuditDialog.js.map +1 -0
- package/lib/client/audit/QaAuditRowBadge.js +17 -0
- package/lib/client/audit/QaAuditRowBadge.js.map +1 -0
- package/lib/client/audit/controller.js +39 -0
- package/lib/client/audit/controller.js.map +1 -0
- package/lib/client/audit/types.js +36 -0
- package/lib/client/audit/types.js.map +1 -0
- package/lib/client/audit/use-chat-audits.js +139 -0
- package/lib/client/audit/use-chat-audits.js.map +1 -0
- package/lib/client/components/Markdown.js +14 -206
- package/lib/client/components/Markdown.js.map +1 -1
- package/lib/client/components/QaChangelog.js +91 -0
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaComposer.js +63 -3
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaHeader.js +1 -3
- package/lib/client/components/QaHeader.js.map +1 -1
- package/lib/client/components/QaMessage.js +25 -4
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaQuestions.js +1 -1
- package/lib/client/components/QaQuestions.js.map +1 -1
- package/lib/client/components/QaSidebar.js +17 -3
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaSourcesPanel.js +3 -18
- package/lib/client/components/QaSourcesPanel.js.map +1 -1
- package/lib/client/components/QaWorkGroup.js +4 -8
- package/lib/client/components/QaWorkGroup.js.map +1 -1
- package/lib/client/components/source-icon.js +26 -0
- package/lib/client/components/source-icon.js.map +1 -0
- package/lib/client/components/thinking-phrases.js +2 -11
- package/lib/client/components/thinking-phrases.js.map +1 -1
- package/lib/client/components/use-now.js +21 -0
- package/lib/client/components/use-now.js.map +1 -0
- package/lib/client/index.js +33 -5
- package/lib/client/index.js.map +1 -1
- package/lib/client/lineage.js +18 -0
- package/lib/client/lineage.js.map +1 -0
- package/lib/client/markdown/CodeBlock.js +28 -0
- package/lib/client/markdown/CodeBlock.js.map +1 -0
- package/lib/client/markdown/blocks.js +342 -0
- package/lib/client/markdown/blocks.js.map +1 -0
- package/lib/client/markdown/highlight.js +1089 -0
- package/lib/client/markdown/highlight.js.map +1 -0
- package/lib/client/markdown/inline.js +377 -0
- package/lib/client/markdown/inline.js.map +1 -0
- package/lib/client/markdown/render.js +147 -0
- package/lib/client/markdown/render.js.map +1 -0
- package/lib/client/markdown/source-chip.js +55 -0
- package/lib/client/markdown/source-chip.js.map +1 -0
- package/lib/client/markdown/use-transient-flag.js +27 -0
- package/lib/client/markdown/use-transient-flag.js.map +1 -0
- package/lib/client/project-session-state.js +15 -2
- package/lib/client/project-session-state.js.map +1 -1
- package/lib/client/prompt-content.js +26 -0
- package/lib/client/prompt-content.js.map +1 -1
- package/lib/client/role/RoleSelector.js +11 -2
- package/lib/client/role/RoleSelector.js.map +1 -1
- package/lib/client/role/preview.js +123 -0
- package/lib/client/role/preview.js.map +1 -0
- package/lib/client/settings/card.js +2 -2
- package/lib/client/settings/card.js.map +1 -1
- package/lib/client/settings/sections/lockdown.js +1 -6
- package/lib/client/settings/sections/lockdown.js.map +1 -1
- package/lib/client/settings/sections/slash.js +57 -0
- package/lib/client/settings/sections/slash.js.map +1 -0
- package/lib/client/settings/sections/status.js +9 -1
- package/lib/client/settings/sections/status.js.map +1 -1
- package/lib/client/settings/sections.js +1 -0
- package/lib/client/settings/sections.js.map +1 -1
- package/lib/client/slash/SlashPalette.js +48 -0
- package/lib/client/slash/SlashPalette.js.map +1 -0
- package/lib/client/slash/copy.js +54 -0
- package/lib/client/slash/copy.js.map +1 -0
- package/lib/client/slash/slash-router.js +49 -0
- package/lib/client/slash/slash-router.js.map +1 -0
- package/lib/client/slash/useSlashNavigation.js +95 -0
- package/lib/client/slash/useSlashNavigation.js.map +1 -0
- package/lib/client/styles.js +124 -20
- package/lib/client/styles.js.map +1 -1
- package/lib/client/types.js +11 -0
- package/lib/client/types.js.map +1 -1
- package/lib/client.js +7615 -1567
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/accounts.js +15 -0
- package/lib/config-resolvers/accounts.js.map +1 -1
- package/lib/config-resolvers/basics.js +11 -2
- package/lib/config-resolvers/basics.js.map +1 -1
- package/lib/config-resolvers/defaults.js +30 -0
- package/lib/config-resolvers/defaults.js.map +1 -1
- package/lib/config-resolvers/lockdown.js +8 -2
- package/lib/config-resolvers/lockdown.js.map +1 -1
- package/lib/config-resolvers/slash-commands.js +60 -0
- package/lib/config-resolvers/slash-commands.js.map +1 -0
- package/lib/config-resolvers/sources.js +16 -0
- package/lib/config-resolvers/sources.js.map +1 -1
- package/lib/config.js +118 -2
- package/lib/config.js.map +1 -1
- package/lib/index.js +183 -11
- package/lib/index.js.map +1 -1
- package/lib/lockdown-policy.js +19 -0
- package/lib/lockdown-policy.js.map +1 -1
- package/lib/personal-skills/service.js +16 -3
- package/lib/personal-skills/service.js.map +1 -1
- package/lib/provenance/host-store.js +25 -4
- package/lib/provenance/host-store.js.map +1 -1
- package/lib/provenance/retention.js +25 -0
- package/lib/provenance/retention.js.map +1 -0
- package/lib/provenance/snapshot-store.js +290 -35
- package/lib/provenance/snapshot-store.js.map +1 -1
- package/lib/questions.js +98 -38
- package/lib/questions.js.map +1 -1
- package/lib/resolve-config.js +5 -0
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +139 -21
- package/lib/secure-session.js.map +1 -1
- package/lib/slash/catalog.js +77 -0
- package/lib/slash/catalog.js.map +1 -0
- package/lib/slash/matcher.js +100 -0
- package/lib/slash/matcher.js.map +1 -0
- package/lib/slash/parser.js +79 -0
- package/lib/slash/parser.js.map +1 -0
- package/lib/slash/policy.js +72 -0
- package/lib/slash/policy.js.map +1 -0
- package/lib/slash/remotes.js +272 -0
- package/lib/slash/remotes.js.map +1 -0
- package/lib/typert.host.js +348 -56
- package/lib/typert.remote-client.d.ts +7 -1
- package/lib/typert.remote-client.js +274 -51
- package/lib/types/access/capability-catalog.d.ts +28 -1
- package/lib/types/access/role-repository.d.ts +38 -7
- package/lib/types/access/service.d.ts +106 -3
- package/lib/types/account-remotes.d.ts +8 -4
- package/lib/types/accounts/database.d.ts +84 -0
- package/lib/types/accounts/errors.d.ts +7 -1
- package/lib/types/accounts/file.d.ts +17 -39
- package/lib/types/accounts/store.d.ts +110 -19
- package/lib/types/admin/quality-store.d.ts +38 -2
- package/lib/types/admin/service.d.ts +34 -2
- package/lib/types/admin/session-log.d.ts +65 -1
- package/lib/types/client/QaSessionController.d.ts +84 -2
- package/lib/types/client/QaSurface.d.ts +14 -1
- package/lib/types/client/admin/{format.d.ts → copy.d.ts} +1 -1
- package/lib/types/client/admin/pages/Conversations.d.ts +4 -0
- package/lib/types/client/audit/QaAuditDialog.d.ts +21 -0
- package/lib/types/client/audit/QaAuditRowBadge.d.ts +18 -0
- package/lib/types/client/audit/controller.d.ts +27 -0
- package/lib/types/client/audit/types.d.ts +72 -0
- package/lib/types/client/audit/use-chat-audits.d.ts +20 -0
- package/lib/types/client/components/Markdown.d.ts +7 -8
- package/lib/types/client/components/QaComposer.d.ts +12 -2
- package/lib/types/client/components/QaQuestions.d.ts +7 -0
- package/lib/types/client/components/QaSidebar.d.ts +11 -1
- package/lib/types/client/components/QaSourcesPanel.d.ts +1 -3
- package/lib/types/client/components/source-icon.d.ts +12 -0
- package/lib/types/client/components/use-now.d.ts +8 -0
- package/lib/types/client/lineage.d.ts +15 -0
- package/lib/types/client/markdown/CodeBlock.d.ts +14 -0
- package/lib/types/client/markdown/blocks.d.ts +74 -0
- package/lib/types/client/markdown/highlight.d.ts +29 -0
- package/lib/types/client/markdown/inline.d.ts +40 -0
- package/lib/types/client/markdown/render.d.ts +13 -0
- package/lib/types/client/markdown/source-chip.d.ts +32 -0
- package/lib/types/client/markdown/use-transient-flag.d.ts +12 -0
- package/lib/types/client/project-session-state.d.ts +3 -1
- package/lib/types/client/prompt-content.d.ts +9 -1
- package/lib/types/client/role/RoleSelector.d.ts +11 -1
- package/lib/types/client/role/preview.d.ts +109 -0
- package/lib/types/client/settings/sections/slash.d.ts +16 -0
- package/lib/types/client/settings/sections.d.ts +1 -0
- package/lib/types/client/slash/SlashPalette.d.ts +24 -0
- package/lib/types/client/slash/copy.d.ts +30 -0
- package/lib/types/client/slash/slash-router.d.ts +67 -0
- package/lib/types/client/slash/useSlashNavigation.d.ts +47 -0
- package/lib/types/client/styles.d.ts +9 -0
- package/lib/types/client/types.d.ts +16 -1
- package/lib/types/config-resolvers/slash-commands.d.ts +20 -0
- package/lib/types/index.d.ts +83 -2
- package/lib/types/lockdown-policy.d.ts +16 -0
- package/lib/types/personal-skills/service.d.ts +5 -0
- package/lib/types/provenance/host-store.d.ts +20 -3
- package/lib/types/provenance/retention.d.ts +46 -0
- package/lib/types/provenance/snapshot-store.d.ts +63 -7
- package/lib/types/questions.d.ts +13 -0
- package/lib/types/secure-session.d.ts +27 -1
- package/lib/types/slash/catalog.d.ts +56 -0
- package/lib/types/slash/matcher.d.ts +51 -0
- package/lib/types/slash/parser.d.ts +46 -0
- package/lib/types/slash/policy.d.ts +40 -0
- package/lib/types/slash/remotes.d.ts +35 -0
- package/lib/types/types.d.ts +254 -5
- package/package.json +9 -5
- package/scripts/attach-workspace-sessions.mjs +472 -0
- package/lib/client/admin/format.js.map +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { QaSource, QaTurnSources, ResolvedQaSurfaceConfig } from "../../types.js";
|
|
2
2
|
import type { QaBoundSourceApi } from "../types.js";
|
|
3
|
-
export
|
|
4
|
-
readonly kind: QaSource["kind"];
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export { SourceIcon } from "./source-icon.js";
|
|
6
4
|
export interface QaSourcesPanelProps {
|
|
7
5
|
readonly sources: readonly QaSource[];
|
|
8
6
|
readonly complete: boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { QaSource } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Leaf source-kind vocabulary: the icon and the group labels a kind wears.
|
|
4
|
+
* Kept free of component imports so the markdown renderer's chips can share
|
|
5
|
+
* it without pulling the sources panel (and its markdown dependency) into
|
|
6
|
+
* every inline parse.
|
|
7
|
+
*/
|
|
8
|
+
export declare const KIND_LABELS: Readonly<Record<QaSource["kind"], string>>;
|
|
9
|
+
export declare function SourceIcon({ kind }: {
|
|
10
|
+
readonly kind: QaSource["kind"];
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=source-icon.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A per-second `Date.now()` that runs only while `active` (and re-syncs the
|
|
3
|
+
* instant it turns on). The thinking phrase and the running work group read
|
|
4
|
+
* the same clock through this hook, so the surface never stacks duplicate
|
|
5
|
+
* second intervals for one turn.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useNow(active: boolean): number;
|
|
8
|
+
//# sourceMappingURL=use-now.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SessionSummary } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
2
|
+
/**
|
|
3
|
+
* Whether one session-list entry is a delegated child — a subagent's session —
|
|
4
|
+
* rather than a chat.
|
|
5
|
+
*
|
|
6
|
+
* A delegated run is an implementation detail of a single answer: the Host
|
|
7
|
+
* refuses to attest it, its sources reach the parent chat through the
|
|
8
|
+
* provenance inheritance flow, and it has no owner. The host list the surface
|
|
9
|
+
* already follows carries both marks (`origin` and `parentId`), so every
|
|
10
|
+
* projection that talks about chats asks this one question instead of
|
|
11
|
+
* re-deriving it — and a chat row, a chat count and a claim batch can never
|
|
12
|
+
* disagree about what a chat is.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isDelegatedSession(summary: Pick<SessionSummary, "origin" | "parentId"> | undefined): boolean;
|
|
15
|
+
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One fenced code block: the language banner, a copy button, and the code
|
|
4
|
+
* itself. Highlighting is our own scanner (see `highlight.ts`) — the fence is
|
|
5
|
+
* memoized on its source and info string, so a streaming append re-tokenizes
|
|
6
|
+
* only the fence that grew.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CodeBlock: import("react").MemoExoticComponent<({ code, lang, }: {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly lang?: string;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
+
/** The globe an external link wears, drawn like the surface's other icons. */
|
|
13
|
+
export declare function LinkGlyph(): ReactNode;
|
|
14
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GFM block grammar for the chat renderer: the container and leaf blocks the
|
|
3
|
+
* assistant's answers actually use, parsed here and handed to `render.tsx` as
|
|
4
|
+
* plain data. Text inside a leaf block stays raw Markdown — `parseInline`
|
|
5
|
+
* resolves it at render time — so one block pass feeds every inline consumer.
|
|
6
|
+
*
|
|
7
|
+
* The grammar is deliberately a subset of CommonMark: nested containers and
|
|
8
|
+
* lazy continuation are supported, while the pathological corners (HTML
|
|
9
|
+
* blocks, setext inside lists, link reference definitions spanning lines) stay
|
|
10
|
+
* out. Raw HTML never becomes a block: a tag line is a paragraph whose inline
|
|
11
|
+
* pass leaves the tag as literal text.
|
|
12
|
+
*/
|
|
13
|
+
/** `#`-through-`######` heading levels. */
|
|
14
|
+
export type HeadingDepth = 1 | 2 | 3 | 4 | 5 | 6;
|
|
15
|
+
/** Column alignment carried by a table's delimiter row. */
|
|
16
|
+
export type TableAlign = "left" | "center" | "right";
|
|
17
|
+
/** One list item: its own blocks plus the checkbox a task item declares. */
|
|
18
|
+
export interface MarkdownListItem {
|
|
19
|
+
readonly blocks: readonly MarkdownBlock[];
|
|
20
|
+
readonly task: boolean;
|
|
21
|
+
readonly checked: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** A block-level node; `text` fields hold raw inline Markdown. */
|
|
24
|
+
export type MarkdownBlock = {
|
|
25
|
+
readonly kind: "paragraph";
|
|
26
|
+
readonly text: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "heading";
|
|
29
|
+
readonly depth: HeadingDepth;
|
|
30
|
+
readonly text: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: "code";
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly lang?: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "quote";
|
|
37
|
+
readonly blocks: readonly MarkdownBlock[];
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "list";
|
|
40
|
+
readonly ordered: boolean;
|
|
41
|
+
readonly start: number;
|
|
42
|
+
readonly loose: boolean;
|
|
43
|
+
readonly items: readonly MarkdownListItem[];
|
|
44
|
+
} | {
|
|
45
|
+
readonly kind: "table";
|
|
46
|
+
readonly align: readonly TableAlign[];
|
|
47
|
+
readonly head: readonly string[];
|
|
48
|
+
readonly rows: readonly (readonly string[])[];
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: "rule";
|
|
51
|
+
};
|
|
52
|
+
/** A parsed document: its blocks plus the reference targets they resolve. */
|
|
53
|
+
export interface ParsedMarkdown {
|
|
54
|
+
readonly blocks: readonly MarkdownBlock[];
|
|
55
|
+
/** Link/image definitions by upper-cased identifier. */
|
|
56
|
+
readonly definitions: ReadonlyMap<string, string>;
|
|
57
|
+
}
|
|
58
|
+
/** Split one table row into trimmed cells, honoring escaped pipes. */
|
|
59
|
+
export declare function splitTableRow(line: string): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Parse a whole document.
|
|
62
|
+
* @param text - Markdown source with any line endings.
|
|
63
|
+
* @returns Blocks plus the definitions the inline pass resolves against.
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseMarkdown(text: string): ParsedMarkdown;
|
|
66
|
+
/**
|
|
67
|
+
* Parse the blocks of one container (document, quote, or list item).
|
|
68
|
+
* @param lines - Container lines, already de-indented by the caller.
|
|
69
|
+
* @param definitions - Document-wide definition accumulator.
|
|
70
|
+
* @param depth - Container nesting depth.
|
|
71
|
+
* @returns The container's blocks.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseBlocks(lines: readonly string[], definitions: Map<string, string>, depth: number): MarkdownBlock[];
|
|
74
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat renderer's syntax highlighter: a small tokenizer over per-language
|
|
3
|
+
* keyword/comment/string tables, not a grammar engine. The original UI runs
|
|
4
|
+
* shiki; its grammar modules alone cost ~1.6 MB, which a self-contained plugin
|
|
5
|
+
* bundle cannot carry, so this scanner covers the shapes that carry meaning in
|
|
6
|
+
* an answer — comments, strings, numbers, keywords — and leaves the rest of the
|
|
7
|
+
* line in the foreground color. Colors come from the host theme's
|
|
8
|
+
* `--shiki-token-*` custom properties, so a fenced block here matches a fenced
|
|
9
|
+
* block in the assistant's own transcript in both light and dark themes.
|
|
10
|
+
*
|
|
11
|
+
* An unknown or absent language renders plain: never an error, never a guess.
|
|
12
|
+
*/
|
|
13
|
+
/** Token categories the stylesheet colors. */
|
|
14
|
+
export type HighlightClass = "comment" | "string" | "keyword" | "number" | "constant" | "meta" | "tag" | "attr" | "key" | "insert" | "delete" | "hunk";
|
|
15
|
+
/** One colored run of a code line. */
|
|
16
|
+
export interface HighlightSpan {
|
|
17
|
+
readonly text: string;
|
|
18
|
+
readonly cls?: HighlightClass;
|
|
19
|
+
}
|
|
20
|
+
/** One code line as colored runs. */
|
|
21
|
+
export type HighlightLine = readonly HighlightSpan[];
|
|
22
|
+
/**
|
|
23
|
+
* Highlight one fenced block.
|
|
24
|
+
* @param code - The fence's source text.
|
|
25
|
+
* @param lang - The fence's info string.
|
|
26
|
+
* @returns One {@link HighlightLine} per source line.
|
|
27
|
+
*/
|
|
28
|
+
export declare function highlightLines(code: string, lang: string | undefined): HighlightLine[];
|
|
29
|
+
//# sourceMappingURL=highlight.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GFM inline grammar for the chat renderer: code spans, emphasis, links,
|
|
3
|
+
* images, autolinks, and the two line-break flavors. Emphasis follows the
|
|
4
|
+
* CommonMark intent (a closer must match its opener's delimiter run, `_` never
|
|
5
|
+
* opens inside a word) rather than the full delimiter-stack algorithm — the
|
|
6
|
+
* shapes this grammar cannot express are the pathological ones, and they
|
|
7
|
+
* degrade to literal text instead of mangling the sentence.
|
|
8
|
+
*/
|
|
9
|
+
/** One inline node; `children` nodes nest. */
|
|
10
|
+
export type MarkdownInline = {
|
|
11
|
+
readonly kind: "text";
|
|
12
|
+
readonly value: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: "softbreak";
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: "break";
|
|
17
|
+
} | {
|
|
18
|
+
readonly kind: "code";
|
|
19
|
+
readonly value: string;
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: "strong" | "em" | "del";
|
|
22
|
+
readonly children: readonly MarkdownInline[];
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: "link";
|
|
25
|
+
readonly href: string;
|
|
26
|
+
readonly children: readonly MarkdownInline[];
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "image";
|
|
29
|
+
readonly src: string;
|
|
30
|
+
readonly alt: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Parse the inline content of one leaf block.
|
|
34
|
+
* @param text - Raw inline Markdown, newlines included.
|
|
35
|
+
* @param definitions - Link/image definitions collected by the block pass.
|
|
36
|
+
* @param depth - Inline nesting depth.
|
|
37
|
+
* @returns The inline nodes in document order.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseInline(text: string, definitions: ReadonlyMap<string, string>, depth?: number): MarkdownInline[];
|
|
40
|
+
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type MarkdownSourceContext } from "./source-chip.js";
|
|
3
|
+
/**
|
|
4
|
+
* Render markdown source as semantic React elements. Raw HTML never enters the
|
|
5
|
+
* DOM (a tag is literal text), link and image destinations pass a protocol
|
|
6
|
+
* allowlist, and a source the owning message knows about becomes a chip
|
|
7
|
+
* instead of a plain link or code token.
|
|
8
|
+
* @param text - Assistant-authored markdown.
|
|
9
|
+
* @param context - Source resolution handed down by the owning message.
|
|
10
|
+
* @returns The document's blocks.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderMarkdown(text: string, context: MarkdownSourceContext): ReactNode[];
|
|
13
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { QaSource } from "../../types.js";
|
|
3
|
+
import { type QaSourceRefs } from "../components/source-refs.js";
|
|
4
|
+
/** Inline source awareness handed down from the owning assistant message. */
|
|
5
|
+
export interface MarkdownSourceContext {
|
|
6
|
+
readonly refs?: QaSourceRefs;
|
|
7
|
+
/** Open a path-backed source in the sources drawer's detail view. */
|
|
8
|
+
readonly onSourceOpen?: (source: QaSource) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One inline source footnote: a pill over the matched link or path with a
|
|
12
|
+
* hover/focus preview card (title, target, snippet). A URL-backed source is
|
|
13
|
+
* an anchor that opens right away; a path-backed one is a button whose click
|
|
14
|
+
* the owner routes to the sources drawer. The hover card stays out of the
|
|
15
|
+
* chip's accessible name and rides along as its description instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SourceChip({ source, label, href, onOpen, }: {
|
|
18
|
+
readonly source: QaSource;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly href?: string;
|
|
21
|
+
readonly onOpen?: (source: QaSource) => void;
|
|
22
|
+
}): ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The chip a path-backed inline-code token earns, or undefined when the token
|
|
25
|
+
* names no known source. A URL-backed token is a chip that opens right away.
|
|
26
|
+
*/
|
|
27
|
+
export declare function codeChip(value: string, context: MarkdownSourceContext): ReactNode | undefined;
|
|
28
|
+
/** The chip a matched markdown link earns, or undefined when it matches none. */
|
|
29
|
+
export declare function linkChip(href: string, label: string, context: MarkdownSourceContext): ReactNode | undefined;
|
|
30
|
+
/** http(s)/mailto destinations only; images are narrowed further to http(s). */
|
|
31
|
+
export declare function safeHref(value: string): string | undefined;
|
|
32
|
+
//# sourceMappingURL=source-chip.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A boolean that turns on for a fixed window and drops back off — the
|
|
3
|
+
* "Скопировано" flash and its siblings. The pending timer lives in a ref and
|
|
4
|
+
* is cleared by the unmount cleanup, so a pulse fired right before the block
|
|
5
|
+
* leaves the DOM never schedules a state update on it, and re-pulsing restarts
|
|
6
|
+
* the window instead of stacking timers.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useTransientFlag(windowMs: number): {
|
|
9
|
+
readonly on: boolean;
|
|
10
|
+
readonly pulse: () => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=use-transient-flag.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
2
2
|
import type { ConversationSnapshot } from "@deepseek-ai/dsh-client-ui-conversation/client";
|
|
3
|
-
import type { QaPendingApproval, QaPendingQuestion, QaSessionState, QaSubagentView, QaTurnSources, ResolvedQaSurfaceConfig } from "../types.js";
|
|
3
|
+
import type { QaPendingApproval, QaPendingQuestion, QaSessionState, QaSlashView, QaSubagentView, QaTurnSources, ResolvedQaSurfaceConfig } from "../types.js";
|
|
4
4
|
/** Everything the bound-chat projection reads; the computation is pure. */
|
|
5
5
|
export interface QaBoundProjectionInput {
|
|
6
6
|
readonly connected: boolean;
|
|
@@ -23,6 +23,8 @@ export interface QaBoundProjectionInput {
|
|
|
23
23
|
readonly admissionPending: boolean;
|
|
24
24
|
readonly chatsRevision: number;
|
|
25
25
|
readonly viewingSubagent: QaSubagentView | null;
|
|
26
|
+
/** Slash catalog state of this chat; the controller owns its lifetime. */
|
|
27
|
+
readonly slash: QaSlashView;
|
|
26
28
|
readonly config: ResolvedQaSurfaceConfig;
|
|
27
29
|
/**
|
|
28
30
|
* The chat's subagent display names keyed by session id, read from the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
2
|
-
import type { QaAttachmentDraft, QaFileDraft } from "../types.js";
|
|
2
|
+
import type { QaAttachmentDraft, QaFileDraft, QaSlashSubmitAttachment } from "../types.js";
|
|
3
3
|
import type { QaFileUpload, QaPromptContent } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Stage every pending file on the Host and collect the receipts the prompt
|
|
@@ -26,5 +26,13 @@ export declare function stageQaFiles(service: QaFileUpload | undefined, session:
|
|
|
26
26
|
* staging failed elsewhere) degrades to an empty receipt rather than
|
|
27
27
|
* dropping the attachment.
|
|
28
28
|
*/
|
|
29
|
+
/**
|
|
30
|
+
* The same two shapes for a human command, which admits attachments through
|
|
31
|
+
* the shared store rather than through the prompt: an image rides encoded, a
|
|
32
|
+
* file rides the receipt its staging minted. An attachment whose staging
|
|
33
|
+
* failed is dropped instead of being sent as an empty receipt — the command
|
|
34
|
+
* would otherwise read a handle that resolves to nothing.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildQaSlashAttachments(attachments: readonly QaAttachmentDraft[], receipts: ReadonlyMap<string, string>): readonly QaSlashSubmitAttachment[];
|
|
29
37
|
export declare function buildQaPromptContent(prompt: string, attachments: readonly QaAttachmentDraft[], receipts: ReadonlyMap<string, string>): QaPromptContent;
|
|
30
38
|
//# sourceMappingURL=prompt-content.d.ts.map
|
|
@@ -8,7 +8,17 @@ export interface QaRoleSelectorProps {
|
|
|
8
8
|
}
|
|
9
9
|
/** Visible only when the account can actually choose between profiles. */
|
|
10
10
|
export declare function QaRoleSelector(props: QaRoleSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The banner that keeps a preview from being mistaken for an ordinary chat.
|
|
13
|
+
*
|
|
14
|
+
* It carries the way out as well: while previewing, the header's role selector
|
|
15
|
+
* is hidden — the previewed profile need not be one the account holds — so
|
|
16
|
+
* without a control here the only exit was the browser's Back button, and a new
|
|
17
|
+
* chat meanwhile ran as the previewed profile instead of the account's default.
|
|
18
|
+
* @param props - the previewed role's name, and how to leave the preview.
|
|
19
|
+
*/
|
|
20
|
+
export declare function QaAdminPreviewBanner(props: {
|
|
12
21
|
readonly role: string;
|
|
22
|
+
readonly onExit?: () => void;
|
|
13
23
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
24
|
//# sourceMappingURL=RoleSelector.d.ts.map
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { QaSubrole } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The administrator preview mode, as a property of the history entry.
|
|
4
|
+
*
|
|
5
|
+
* "Preview as role" navigates to the chat route carrying a marker in the
|
|
6
|
+
* history state. Deriving the mode from the entry — instead of latching it in
|
|
7
|
+
* component state — is what lets the browser's own Back button leave the
|
|
8
|
+
* preview, and what keeps a preview from outliving its entry: while the mode
|
|
9
|
+
* was latched, every later new chat in that browser tab was created as a
|
|
10
|
+
* preview of the previewed profile, silently ignoring the account's default
|
|
11
|
+
* profile, with the role selector hidden and only a corner banner to say so.
|
|
12
|
+
*/
|
|
13
|
+
/** One preview in force: the role and the name it was previewed under. */
|
|
14
|
+
export interface QaAdminPreview {
|
|
15
|
+
readonly roleId: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
}
|
|
18
|
+
interface PreviewState {
|
|
19
|
+
readonly qaPreview: string;
|
|
20
|
+
readonly qaPreviewName: string;
|
|
21
|
+
}
|
|
22
|
+
/** The history state a "Preview as role" navigation carries. */
|
|
23
|
+
export declare function previewEntryState(role: Pick<QaSubrole, "id" | "name">): PreviewState;
|
|
24
|
+
/**
|
|
25
|
+
* The preview one history entry asks for, or undefined for an ordinary entry.
|
|
26
|
+
*
|
|
27
|
+
* Home of an older Host or of a cleared entry carries no marker at all, and a
|
|
28
|
+
* marker whose role id cannot be read is ignored rather than guessed: the name
|
|
29
|
+
* is cosmetic, so an entry written before names travelled with the marker
|
|
30
|
+
* still previews, under its role id.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readPreviewEntry(state: unknown): QaAdminPreview | undefined;
|
|
33
|
+
export type QaPreviewTransition = {
|
|
34
|
+
readonly kind: "enter";
|
|
35
|
+
readonly preview: QaAdminPreview;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: "leave";
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "keep";
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* What the surface should do with the preview mode for one history entry.
|
|
43
|
+
*
|
|
44
|
+
* Only an administrator can preview, so an entry that asks for one while an
|
|
45
|
+
* ordinary account is signed in leaves the mode instead of entering it — the
|
|
46
|
+
* marker survives in the browser's history across a sign-out, and latching it
|
|
47
|
+
* again would hand the next account a chat under a profile it was never
|
|
48
|
+
* assigned.
|
|
49
|
+
* @param input - the entry's state, the preview in force, and who is signed in.
|
|
50
|
+
* @returns enter, leave, or keep, so the caller only writes state it must.
|
|
51
|
+
*/
|
|
52
|
+
export declare function planPreviewTransition(input: {
|
|
53
|
+
readonly state: unknown;
|
|
54
|
+
readonly preview: QaAdminPreview | null;
|
|
55
|
+
readonly isAdmin: boolean;
|
|
56
|
+
}): QaPreviewTransition;
|
|
57
|
+
/** The slice of the browser the preview needs; a test injects its own. */
|
|
58
|
+
export interface QaPreviewBrowser {
|
|
59
|
+
readonly state: unknown;
|
|
60
|
+
pushState(data: unknown, unused: string, url?: string | null): void;
|
|
61
|
+
replaceState(data: unknown, unused: string, url?: string | null): void;
|
|
62
|
+
/** Subscribe to browser navigation; returns the unsubscribe. */
|
|
63
|
+
onPopState(listener: () => void): () => void;
|
|
64
|
+
}
|
|
65
|
+
export interface QaAdminPreviewOptions {
|
|
66
|
+
/** Only an administrator may preview; anyone else leaves the mode. */
|
|
67
|
+
readonly isAdmin: boolean;
|
|
68
|
+
/** The account's own default profile, restored when a preview ends. */
|
|
69
|
+
readonly fallbackSubrole: string | null;
|
|
70
|
+
/** The chat route a preview navigation returns to. */
|
|
71
|
+
readonly previewUrl: string;
|
|
72
|
+
/** Called with the profile the next chat must use; null when none is known. */
|
|
73
|
+
readonly onSelect: (roleId: string | null) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Re-checked on every browser navigation AND whenever this changes: an
|
|
76
|
+
* in-app navigation to the chat route arrives without a `popstate` event.
|
|
77
|
+
*/
|
|
78
|
+
readonly routeKey: string;
|
|
79
|
+
readonly target?: QaPreviewBrowser;
|
|
80
|
+
}
|
|
81
|
+
export interface QaAdminPreviewMode {
|
|
82
|
+
/** The preview in force right now, if any. */
|
|
83
|
+
readonly preview: QaAdminPreview | null;
|
|
84
|
+
/** Enter the preview of one role, as the administration console asks. */
|
|
85
|
+
readonly enter: (role: Pick<QaSubrole, "id" | "name">) => void;
|
|
86
|
+
/**
|
|
87
|
+
* End the mode because the chat on screen is not a preview, leaving the
|
|
88
|
+
* history entry alone: going Back to it is entering the preview again.
|
|
89
|
+
*/
|
|
90
|
+
readonly clear: () => void;
|
|
91
|
+
/** End the mode for good, as the administrator asked from the banner. */
|
|
92
|
+
readonly leave: () => void;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The administrator preview mode of one browser tab.
|
|
96
|
+
*
|
|
97
|
+
* The mode is a property of the history entry, so entering and leaving it
|
|
98
|
+
* follows the browser: the console pushes an entry that carries the preview,
|
|
99
|
+
* every navigation back to an entry without one ends the mode, and only an
|
|
100
|
+
* administrator can hold it. The alternative — reading the marker once and
|
|
101
|
+
* latching it in component state — kept the mode alive for the whole tab, and
|
|
102
|
+
* since the role selector is hidden while previewing, later new chats silently
|
|
103
|
+
* ran as the previewed profile instead of the account's default one.
|
|
104
|
+
* @param options - who is signed in, the account default, and the history.
|
|
105
|
+
* @returns the preview in force plus the two explicit transitions.
|
|
106
|
+
*/
|
|
107
|
+
export declare function useQaAdminPreview(options: QaAdminPreviewOptions): QaAdminPreviewMode;
|
|
108
|
+
export {};
|
|
109
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slash interface: the master switch, the two admission policies and the
|
|
3
|
+
* palette itself.
|
|
4
|
+
*
|
|
5
|
+
* The allow lists stay name-based, which is what the deployment config stores
|
|
6
|
+
* — an operator writes `generate-tkp`, never an id. They are plain lists
|
|
7
|
+
* rather than checkboxes over a discovered catalog because the two halves are
|
|
8
|
+
* discovered differently and only one of them can be enumerated here at all:
|
|
9
|
+
* skills are a registry lookup, while a command is only resolvable against a
|
|
10
|
+
* live chat's agent, so this card could not honestly offer a fixed list of
|
|
11
|
+
* command names to tick.
|
|
12
|
+
*/
|
|
13
|
+
import { type ConfigProps } from "./common.js";
|
|
14
|
+
/** Master switch, per-kind admission policy and palette presentation. */
|
|
15
|
+
export declare function SlashSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=slash.d.ts.map
|
|
@@ -19,6 +19,7 @@ export { EmbeddingSection } from "./sections/embedding.js";
|
|
|
19
19
|
export { InterfaceSection } from "./sections/interface.js";
|
|
20
20
|
export { LockdownSection } from "./sections/lockdown.js";
|
|
21
21
|
export { SessionSection } from "./sections/session.js";
|
|
22
|
+
export { SlashSection } from "./sections/slash.js";
|
|
22
23
|
export { SourcesSection } from "./sections/sources.js";
|
|
23
24
|
export { StatusSection } from "./sections/status.js";
|
|
24
25
|
export type { StatusProps } from "./sections/status.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QaSlashCatalogEntry, QaSlashCommandSurface, QaSlashView } from "../../types.js";
|
|
2
|
+
export interface QaSlashPaletteProps {
|
|
3
|
+
readonly rows: readonly QaSlashCatalogEntry[];
|
|
4
|
+
readonly activeId: string | null;
|
|
5
|
+
readonly state: QaSlashView["state"];
|
|
6
|
+
readonly error: string | null;
|
|
7
|
+
readonly commandSurface: QaSlashCommandSurface;
|
|
8
|
+
readonly showDescriptions: boolean;
|
|
9
|
+
readonly showKindBadge: boolean;
|
|
10
|
+
readonly idPrefix: string;
|
|
11
|
+
readonly onHover: (index: number) => void;
|
|
12
|
+
readonly onPick: (entry: QaSlashCatalogEntry) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The palette itself: a listbox over rows the composer has already filtered
|
|
16
|
+
* and ranked. It owns no state — an empty list means "nothing matches", and
|
|
17
|
+
* the surface line says why when the catalog could not be read at all.
|
|
18
|
+
*
|
|
19
|
+
* Options are picked on `click` and never take focus (`onMouseDown` prevents
|
|
20
|
+
* the default) so the caret stays in the textarea: the keyboard keeps working
|
|
21
|
+
* straight after a click, and Escape still closes what the mouse opened.
|
|
22
|
+
*/
|
|
23
|
+
export declare const QaSlashPalette: import("react").MemoExoticComponent<(props: QaSlashPaletteProps) => import("react/jsx-runtime").JSX.Element>;
|
|
24
|
+
//# sourceMappingURL=SlashPalette.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { QaSlashCatalogEntry, QaSlashExecution } from "../../types.js";
|
|
2
|
+
import type { QaSlashRoute } from "./slash-router.js";
|
|
3
|
+
/**
|
|
4
|
+
* The user-facing copy of every slash decision. One module because these
|
|
5
|
+
* strings are the whole interface between a refusal and the person reading it:
|
|
6
|
+
* a refusal that does not say what to do next is indistinguishable from a bug.
|
|
7
|
+
*/
|
|
8
|
+
/** The refusal that predates the feature; unchanged, so nothing regresses. */
|
|
9
|
+
export declare const SLASH_DISABLED_COPY = "\u041A\u043E\u043C\u0430\u043D\u0434\u044B \u0441\u043E \u0441\u043B\u0435\u0448\u0435\u043C \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0432 \u0440\u0435\u0436\u0438\u043C\u0435 \u043F\u043E\u043C\u043E\u0449\u043D\u0438\u043A\u0430.";
|
|
10
|
+
export declare function slashRefusalCopy(route: Extract<QaSlashRoute, {
|
|
11
|
+
kind: "unknown" | "ambiguous" | "unavailable";
|
|
12
|
+
}>): string;
|
|
13
|
+
/**
|
|
14
|
+
* A gesture inside an ordinary prompt that this deployment withholds. Stated
|
|
15
|
+
* as a fact about the deployment, not as a fault of the message, because the
|
|
16
|
+
* message itself is fine — it is one word of it that will not take effect.
|
|
17
|
+
*/
|
|
18
|
+
export declare function slashWithheldCopy(names: readonly string[]): string;
|
|
19
|
+
export declare function slashExecuteFailureCopy(entry: QaSlashCatalogEntry): string;
|
|
20
|
+
/** Copy for a refusal the Host decided, keyed by its reason. */
|
|
21
|
+
export declare function slashHostRefusalCopy(refusal: Extract<QaSlashExecution, {
|
|
22
|
+
kind: "refused";
|
|
23
|
+
}>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Attachments the chosen command refuses. Checked before dispatch so the
|
|
26
|
+
* composer keeps the draft and the files; the Host checks it again and stays
|
|
27
|
+
* the authority.
|
|
28
|
+
*/
|
|
29
|
+
export declare function slashAttachmentsCopy(entry: QaSlashCatalogEntry): string;
|
|
30
|
+
//# sourceMappingURL=copy.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { QaSlashCatalogEntry } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Where one composer draft should go.
|
|
4
|
+
*
|
|
5
|
+
* The composer used to have a single path — `sendPrompt` — with a guard that
|
|
6
|
+
* turned every `/`-leading line away. That guard is now the `disabled` case
|
|
7
|
+
* below, and everything else is decided here, in one place, from the draft and
|
|
8
|
+
* the catalog alone. Keeping it pure is what makes the ambiguous, unknown and
|
|
9
|
+
* withheld cases testable without a browser or a Host.
|
|
10
|
+
*/
|
|
11
|
+
export type QaSlashRoute =
|
|
12
|
+
/**
|
|
13
|
+
* Ordinary text: the model gets it, exactly as before this feature. It may
|
|
14
|
+
* still name a skill this deployment withholds — the turn runs, and the
|
|
15
|
+
* surface says so rather than letting the user believe it took effect.
|
|
16
|
+
*/
|
|
17
|
+
{
|
|
18
|
+
readonly kind: "prompt";
|
|
19
|
+
readonly withheld?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/** A user-invocable skill: the native prompt path carries the gesture. */
|
|
22
|
+
| {
|
|
23
|
+
readonly kind: "skill";
|
|
24
|
+
readonly entry: QaSlashCatalogEntry;
|
|
25
|
+
}
|
|
26
|
+
/** A human command: the Host's command runtime answers it, the model never sees it. */
|
|
27
|
+
| {
|
|
28
|
+
readonly kind: "command";
|
|
29
|
+
readonly entry: QaSlashCatalogEntry;
|
|
30
|
+
}
|
|
31
|
+
/** Nothing by that name is offered here. */
|
|
32
|
+
| {
|
|
33
|
+
readonly kind: "unknown";
|
|
34
|
+
readonly name: string;
|
|
35
|
+
}
|
|
36
|
+
/** A skill and a command share the name; only the user may choose. */
|
|
37
|
+
| {
|
|
38
|
+
readonly kind: "ambiguous";
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly entries: readonly QaSlashCatalogEntry[];
|
|
41
|
+
}
|
|
42
|
+
/** The catalog could not be read, so no `/name` can be classified. */
|
|
43
|
+
| {
|
|
44
|
+
readonly kind: "unavailable";
|
|
45
|
+
readonly name: string;
|
|
46
|
+
}
|
|
47
|
+
/** The deployment runs with the slash interface off. */
|
|
48
|
+
| {
|
|
49
|
+
readonly kind: "disabled";
|
|
50
|
+
};
|
|
51
|
+
export interface ResolveSlashRouteInput {
|
|
52
|
+
readonly text: string;
|
|
53
|
+
readonly enabled: boolean;
|
|
54
|
+
readonly catalogReady: boolean;
|
|
55
|
+
readonly entries: readonly QaSlashCatalogEntry[];
|
|
56
|
+
/** User-invocable skills this deployment withholds from this chat. */
|
|
57
|
+
readonly deniedSkills: readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* The entry the user picked in the palette, while the draft still reads as
|
|
60
|
+
* its invocation. A picked identity outranks name resolution: when a skill
|
|
61
|
+
* and a command share a name, the user already answered the only question
|
|
62
|
+
* the router would otherwise have to guess at.
|
|
63
|
+
*/
|
|
64
|
+
readonly picked?: string | null;
|
|
65
|
+
}
|
|
66
|
+
export declare function resolveSlashRoute(input: ResolveSlashRouteInput): QaSlashRoute;
|
|
67
|
+
//# sourceMappingURL=slash-router.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { QaSlashCatalogEntry, QaSlashView } from "../../types.js";
|
|
2
|
+
export interface QaSlashNavigation {
|
|
3
|
+
/** True while the palette is on screen. */
|
|
4
|
+
readonly open: boolean;
|
|
5
|
+
readonly query: string;
|
|
6
|
+
/** The rows the palette renders, best match first. */
|
|
7
|
+
readonly rows: readonly QaSlashCatalogEntry[];
|
|
8
|
+
/** Index into `rows`; -1 when there is nothing to select. */
|
|
9
|
+
readonly active: number;
|
|
10
|
+
readonly activeId: string | null;
|
|
11
|
+
/** Move the selection by one row, wrapping at both ends. */
|
|
12
|
+
readonly move: (delta: number) => void;
|
|
13
|
+
/** Point the selection at one row, as a tap does. */
|
|
14
|
+
readonly hover: (index: number) => void;
|
|
15
|
+
/** Insert the active row's invocation into the draft. */
|
|
16
|
+
readonly pickActive: () => void;
|
|
17
|
+
/** Insert one row, as a click or a tap does. */
|
|
18
|
+
readonly pick: (entry: QaSlashCatalogEntry) => void;
|
|
19
|
+
/** Dismiss the palette for this draft. */
|
|
20
|
+
readonly dismiss: () => void;
|
|
21
|
+
/** The identity the user picked, while the draft still reads as its call. */
|
|
22
|
+
readonly picked: QaSlashCatalogEntry | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface UseSlashNavigationOptions {
|
|
25
|
+
readonly draft: string;
|
|
26
|
+
readonly slash: QaSlashView;
|
|
27
|
+
readonly maxVisible: number;
|
|
28
|
+
readonly fuzzySearch: boolean;
|
|
29
|
+
/** Set the draft to `text` and put the caret at its end. */
|
|
30
|
+
readonly setDraft: (text: string) => void;
|
|
31
|
+
/** Monotonic token; a change re-opens a palette the user had dismissed. */
|
|
32
|
+
readonly reopen: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Palette state for one composer draft.
|
|
36
|
+
*
|
|
37
|
+
* The palette is a pure function of the draft: it is open while the draft is
|
|
38
|
+
* `/` plus a name still being typed, and closes the moment the user types a
|
|
39
|
+
* space and starts writing arguments. Nothing has to be kept in sync — which
|
|
40
|
+
* is also why switching chats (the composer is keyed by chat and remounts)
|
|
41
|
+
* cannot leave a palette behind.
|
|
42
|
+
*
|
|
43
|
+
* Selection is one index over the filtered rows; the arrow keys, the mouse and
|
|
44
|
+
* the touch screen all move the same number.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useSlashNavigation(options: UseSlashNavigationOptions): QaSlashNavigation;
|
|
47
|
+
//# sourceMappingURL=useSlashNavigation.d.ts.map
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
/** Every `--dsh-qa-*` custom property the root rule declares. */
|
|
2
2
|
export declare const QA_BRAND_TOKEN_NAMES: readonly string[];
|
|
3
3
|
export declare const QA_SURFACE_STYLES: string;
|
|
4
|
+
/**
|
|
5
|
+
* Everything the QA overlay paints, as one sheet for one `<style>` tag.
|
|
6
|
+
*
|
|
7
|
+
* The shared audit components keep their own stylesheet in
|
|
8
|
+
* `@yadsh/dsh-audit-ui`; it is folded in here so the overlay is self-contained
|
|
9
|
+
* — the audit dialog must look right whether or not the audit plugin's own
|
|
10
|
+
* client bundle happens to have injected the same rules into the document.
|
|
11
|
+
*/
|
|
12
|
+
export declare const QA_OVERLAY_STYLES: string;
|
|
4
13
|
//# sourceMappingURL=styles.d.ts.map
|