@yadsh/dsh-qa-surface 0.3.0 → 0.5.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 +192 -15
- package/cordis.patch.yml +8 -0
- package/lib/account-remotes.js +100 -0
- package/lib/account-remotes.js.map +1 -0
- package/lib/accounts/credentials.js +35 -0
- package/lib/accounts/credentials.js.map +1 -0
- package/lib/accounts/errors.js +9 -0
- package/lib/accounts/errors.js.map +1 -0
- package/lib/accounts/file.js +101 -0
- package/lib/accounts/file.js.map +1 -0
- package/lib/accounts/store.js +159 -161
- package/lib/accounts/store.js.map +1 -1
- package/lib/accounts/token.js +61 -0
- package/lib/accounts/token.js.map +1 -0
- package/lib/approvals.js +179 -0
- package/lib/approvals.js.map +1 -0
- package/lib/attachment-rules.js +111 -0
- package/lib/attachment-rules.js.map +1 -0
- package/lib/cli.js +132 -9
- package/lib/cli.js.map +1 -1
- package/lib/client/QaAccountsController.js +32 -2
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaSessionController.js +140 -65
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +134 -107
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +71 -6
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/approvals.js +104 -0
- package/lib/client/approvals.js.map +1 -0
- package/lib/client/attachments.js +150 -0
- package/lib/client/attachments.js.map +1 -0
- package/lib/client/attestation.js +4 -1
- package/lib/client/attestation.js.map +1 -1
- package/lib/client/base64.js +16 -0
- package/lib/client/base64.js.map +1 -0
- package/lib/client/chat-files.js +48 -0
- package/lib/client/chat-files.js.map +1 -0
- package/lib/client/components/Markdown.js +1 -1
- package/lib/client/components/Markdown.js.map +1 -1
- package/lib/client/components/QaApproval.js +23 -0
- package/lib/client/components/QaApproval.js.map +1 -0
- package/lib/client/components/QaChangelog.js +62 -19
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaComposer.js +56 -74
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaFileAttachment.js +19 -0
- package/lib/client/components/QaFileAttachment.js.map +1 -0
- package/lib/client/components/QaFilesPanel.js +45 -0
- package/lib/client/components/QaFilesPanel.js.map +1 -0
- package/lib/client/components/QaHeader.js +34 -0
- package/lib/client/components/QaHeader.js.map +1 -0
- package/lib/client/components/QaMessage.js +17 -4
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaModal.js +31 -0
- package/lib/client/components/QaModal.js.map +1 -0
- package/lib/client/components/QaProfile.js +64 -0
- package/lib/client/components/QaProfile.js.map +1 -0
- package/lib/client/components/QaQuestions.js +96 -0
- package/lib/client/components/QaQuestions.js.map +1 -0
- package/lib/client/components/QaRightRail.js +15 -0
- package/lib/client/components/QaRightRail.js.map +1 -0
- package/lib/client/components/QaSidebar.js +6 -1
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/{QaSourcesDrawer.js → QaSourcesPanel.js} +3 -3
- package/lib/client/components/QaSourcesPanel.js.map +1 -0
- package/lib/client/components/QaTurnRail.js +15 -0
- package/lib/client/components/QaTurnRail.js.map +1 -1
- package/lib/client/components/QaWidthHandle.js +25 -20
- package/lib/client/components/QaWidthHandle.js.map +1 -1
- package/lib/client/components/QaWorkGroup.js +19 -20
- package/lib/client/components/QaWorkGroup.js.map +1 -1
- package/lib/client/components/surface-utils.js +28 -0
- package/lib/client/components/surface-utils.js.map +1 -0
- package/lib/client/components/thinking-phrases.js +24 -0
- package/lib/client/components/thinking-phrases.js.map +1 -0
- package/lib/client/create-session.js +7 -32
- package/lib/client/create-session.js.map +1 -1
- package/lib/client/failure-copy.js +63 -0
- package/lib/client/failure-copy.js.map +1 -0
- package/lib/client/index.js +49 -7
- package/lib/client/index.js.map +1 -1
- package/lib/client/project-session-state.js +5 -3
- package/lib/client/project-session-state.js.map +1 -1
- package/lib/client/prompt-content.js +54 -0
- package/lib/client/prompt-content.js.map +1 -0
- package/lib/client/questions.js +114 -0
- package/lib/client/questions.js.map +1 -0
- package/lib/client/settings/card.js +143 -0
- package/lib/client/settings/card.js.map +1 -0
- package/lib/client/settings/fields.js +145 -0
- package/lib/client/settings/fields.js.map +1 -0
- package/lib/client/settings/format.js +255 -0
- package/lib/client/settings/format.js.map +1 -0
- package/lib/client/settings/sections/access.js +25 -0
- package/lib/client/settings/sections/access.js.map +1 -0
- package/lib/client/settings/sections/accounts.js +47 -0
- package/lib/client/settings/sections/accounts.js.map +1 -0
- package/lib/client/settings/sections/attachments.js +46 -0
- package/lib/client/settings/sections/attachments.js.map +1 -0
- package/lib/client/settings/sections/branding.js +28 -0
- package/lib/client/settings/sections/branding.js.map +1 -0
- package/lib/client/settings/sections/common.js +20 -0
- package/lib/client/settings/sections/common.js.map +1 -0
- package/lib/client/settings/sections/embedding.js +19 -0
- package/lib/client/settings/sections/embedding.js.map +1 -0
- package/lib/client/settings/sections/interface.js +60 -0
- package/lib/client/settings/sections/interface.js.map +1 -0
- package/lib/client/settings/sections/lockdown.js +82 -0
- package/lib/client/settings/sections/lockdown.js.map +1 -0
- package/lib/client/settings/sections/session.js +53 -0
- package/lib/client/settings/sections/session.js.map +1 -0
- package/lib/client/settings/sections/sources.js +74 -0
- package/lib/client/settings/sections/sources.js.map +1 -0
- package/lib/client/settings/sections/status.js +37 -0
- package/lib/client/settings/sections/status.js.map +1 -0
- package/lib/client/settings/sections.js +23 -0
- package/lib/client/settings/sections.js.map +1 -0
- package/lib/client/settings/styles.js +57 -0
- package/lib/client/settings/styles.js.map +1 -0
- package/lib/client/stream-publisher.js +47 -0
- package/lib/client/stream-publisher.js.map +1 -0
- package/lib/client/styles.js +127 -19
- package/lib/client/styles.js.map +1 -1
- package/lib/client/types.js +2 -0
- package/lib/client/types.js.map +1 -1
- package/lib/client/use-right-rail.js +96 -0
- package/lib/client/use-right-rail.js.map +1 -0
- package/lib/client/use-session-ui-state.js +26 -19
- package/lib/client/use-session-ui-state.js.map +1 -1
- package/lib/client.js +5694 -813
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/accounts.js +60 -0
- package/lib/config-resolvers/accounts.js.map +1 -0
- package/lib/config-resolvers/attachments.js +28 -0
- package/lib/config-resolvers/attachments.js.map +1 -0
- package/lib/config-resolvers/basics.js +61 -0
- package/lib/config-resolvers/basics.js.map +1 -0
- package/lib/config-resolvers/defaults.js +136 -0
- package/lib/config-resolvers/defaults.js.map +1 -0
- package/lib/config-resolvers/lockdown.js +90 -0
- package/lib/config-resolvers/lockdown.js.map +1 -0
- package/lib/config-resolvers/session.js +42 -0
- package/lib/config-resolvers/session.js.map +1 -0
- package/lib/config-resolvers/shared.js +51 -0
- package/lib/config-resolvers/shared.js.map +1 -0
- package/lib/config-resolvers/sources.js +83 -0
- package/lib/config-resolvers/sources.js.map +1 -0
- package/lib/config-resolvers/ui.js +20 -0
- package/lib/config-resolvers/ui.js.map +1 -0
- package/lib/config.js +76 -6
- package/lib/config.js.map +1 -1
- package/lib/entry-redirect.js +2 -1
- package/lib/entry-redirect.js.map +1 -1
- package/lib/index.js +198 -79
- package/lib/index.js.map +1 -1
- package/lib/profile.js +214 -0
- package/lib/profile.js.map +1 -0
- package/lib/prompt-notes.js +231 -0
- package/lib/prompt-notes.js.map +1 -0
- package/lib/provenance/host-store.js +25 -9
- package/lib/provenance/host-store.js.map +1 -1
- package/lib/provenance/reported.js +37 -12
- package/lib/provenance/reported.js.map +1 -1
- package/lib/questions.js +185 -0
- package/lib/questions.js.map +1 -0
- package/lib/resolve-config.js +35 -410
- 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/session-ownership.js +55 -0
- package/lib/session-ownership.js.map +1 -0
- package/lib/shared/session-key.js +18 -0
- package/lib/shared/session-key.js.map +1 -0
- package/lib/shared/settings.js +10 -0
- package/lib/shared/settings.js.map +1 -0
- package/lib/thinking-phrases.js +68 -0
- package/lib/thinking-phrases.js.map +1 -0
- package/lib/typert.host.js +506 -21
- package/lib/typert.remote-client.d.ts +15 -1
- package/lib/typert.remote-client.js +407 -15
- package/lib/types/account-remotes.d.ts +42 -0
- package/lib/types/accounts/credentials.d.ts +20 -0
- package/lib/types/accounts/errors.d.ts +11 -0
- package/lib/types/accounts/file.d.ts +82 -0
- package/lib/types/accounts/store.d.ts +74 -43
- package/lib/types/accounts/token.d.ts +31 -0
- package/lib/types/approvals.d.ts +65 -0
- package/lib/types/attachment-rules.d.ts +44 -0
- package/lib/types/cli.d.ts +2 -2
- package/lib/types/client/QaAccountsController.d.ts +8 -1
- package/lib/types/client/QaSessionController.d.ts +53 -16
- package/lib/types/client/QaSurface.d.ts +14 -1
- package/lib/types/client/approvals.d.ts +39 -0
- package/lib/types/client/attachments.d.ts +54 -0
- package/lib/types/client/base64.d.ts +10 -0
- package/lib/types/client/chat-files.d.ts +30 -0
- package/lib/types/client/components/QaApproval.d.ts +13 -0
- package/lib/types/client/components/QaChangelog.d.ts +1 -1
- package/lib/types/client/components/QaComposer.d.ts +8 -4
- package/lib/types/client/components/QaFileAttachment.d.ts +14 -0
- package/lib/types/client/components/QaFilesPanel.d.ts +15 -0
- package/lib/types/client/components/QaHeader.d.ts +41 -0
- package/lib/types/client/components/QaMessage.d.ts +3 -1
- package/lib/types/client/components/QaModal.d.ts +26 -0
- package/lib/types/client/components/QaProfile.d.ts +25 -0
- package/lib/types/client/components/QaQuestions.d.ts +13 -0
- package/lib/types/client/components/QaRightRail.d.ts +23 -0
- package/lib/types/client/components/QaSidebar.d.ts +14 -0
- package/lib/types/client/components/{QaSourcesDrawer.d.ts → QaSourcesPanel.d.ts} +7 -4
- package/lib/types/client/components/QaTurnRail.d.ts +6 -0
- package/lib/types/client/components/QaWidthHandle.d.ts +14 -7
- package/lib/types/client/components/QaWorkGroup.d.ts +5 -3
- package/lib/types/client/components/surface-utils.d.ts +11 -0
- package/lib/types/client/components/thinking-phrases.d.ts +9 -0
- package/lib/types/client/create-session.d.ts +6 -9
- package/lib/types/client/failure-copy.d.ts +19 -0
- package/lib/types/client/project-session-state.d.ts +8 -1
- package/lib/types/client/prompt-content.d.ts +30 -0
- package/lib/types/client/questions.d.ts +45 -0
- package/lib/types/client/settings/card.d.ts +23 -0
- package/lib/types/client/settings/fields.d.ts +139 -0
- package/lib/types/client/settings/format.d.ts +108 -0
- package/lib/types/client/settings/sections/access.d.ts +9 -0
- package/lib/types/client/settings/sections/accounts.d.ts +9 -0
- package/lib/types/client/settings/sections/attachments.d.ts +15 -0
- package/lib/types/client/settings/sections/branding.d.ts +8 -0
- package/lib/types/client/settings/sections/common.d.ts +28 -0
- package/lib/types/client/settings/sections/embedding.d.ts +8 -0
- package/lib/types/client/settings/sections/interface.d.ts +9 -0
- package/lib/types/client/settings/sections/lockdown.d.ts +9 -0
- package/lib/types/client/settings/sections/session.d.ts +9 -0
- package/lib/types/client/settings/sections/sources.d.ts +9 -0
- package/lib/types/client/settings/sections/status.d.ts +22 -0
- package/lib/types/client/settings/sections.d.ts +25 -0
- package/lib/types/client/settings/styles.d.ts +8 -0
- package/lib/types/client/stream-publisher.d.ts +28 -0
- package/lib/types/client/types.d.ts +76 -1
- package/lib/types/client/use-right-rail.d.ts +56 -0
- package/lib/types/client/use-session-ui-state.d.ts +13 -7
- package/lib/types/config-resolvers/accounts.d.ts +15 -0
- package/lib/types/config-resolvers/attachments.d.ts +6 -0
- package/lib/types/config-resolvers/basics.d.ts +8 -0
- package/lib/types/config-resolvers/defaults.d.ts +4 -0
- package/lib/types/config-resolvers/lockdown.d.ts +10 -0
- package/lib/types/config-resolvers/session.d.ts +6 -0
- package/lib/types/config-resolvers/shared.d.ts +23 -0
- package/lib/types/config-resolvers/sources.d.ts +6 -0
- package/lib/types/config-resolvers/ui.d.ts +6 -0
- package/lib/types/index.d.ts +48 -15
- package/lib/types/profile.d.ts +76 -0
- package/lib/types/prompt-notes.d.ts +110 -0
- package/lib/types/provenance/reported.d.ts +9 -1
- package/lib/types/questions.d.ts +83 -0
- package/lib/types/resolve-config.d.ts +8 -3
- package/lib/types/secure-session.d.ts +46 -2
- package/lib/types/session-ownership.d.ts +30 -0
- package/lib/types/shared/session-key.d.ts +23 -0
- package/lib/types/shared/settings.d.ts +10 -0
- package/lib/types/thinking-phrases.d.ts +17 -0
- package/lib/types/types.d.ts +203 -9
- package/lib/types/user-workspace.d.ts +42 -0
- package/lib/user-workspace.js +246 -0
- package/lib/user-workspace.js.map +1 -0
- package/package.json +15 -8
- package/CHANGELOG.md +0 -176
- package/SPEC-dsh-qa-surface.md +0 -2425
- package/docs/ARCHITECTURE.md +0 -66
- package/docs/COMPATIBILITY.md +0 -14
- package/docs/CONFIGURATION.md +0 -199
- package/docs/EMBEDDING.md +0 -13
- package/docs/SOURCES-MIGRATION.md +0 -28
- package/docs/SOURCES-PROVENANCE-AUDIT.md +0 -88
- package/docs/SPEC-dsh-qa-surface-accounts.md +0 -219
- package/docs/SPEC-dsh-qa-surface-sources-provenance.md +0 -1692
- package/lib/client/components/QaSourcesDrawer.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The QA Surface settings card.
|
|
3
|
+
*
|
|
4
|
+
* Two sources meet here: the `qa-surface` settings namespace, which is the
|
|
5
|
+
* page's configuration source on the Host, and the `qaSurface/describe`
|
|
6
|
+
* Remote, which reports the configuration the running Host actually resolved.
|
|
7
|
+
* Everything the user changes is written immediately as a path-addressed
|
|
8
|
+
* mutation; the status view re-reads the Remote while the card is visible, so
|
|
9
|
+
* a saved change is confirmed against the Host rather than against the form.
|
|
10
|
+
*/
|
|
11
|
+
import type { SettingsScope } from "@deepseek-ai/dsh-client-ui-settings/client";
|
|
12
|
+
import type { InjectFace, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
|
|
13
|
+
import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
|
|
14
|
+
import type { QaSurfaceConfig, ResolvedQaSurfaceConfig } from "../../types.js";
|
|
15
|
+
/** The face the slot entry injects into this card. */
|
|
16
|
+
export interface QaSettingsCardFace {
|
|
17
|
+
readonly scope: SettingsScope<QaSurfaceConfig>;
|
|
18
|
+
describe(): Promise<RemoteResult<ResolvedQaSurfaceConfig>>;
|
|
19
|
+
}
|
|
20
|
+
type CardProps = PropsRuntime<"settings.plugin.item"> & InjectFace<QaSettingsCardFace>;
|
|
21
|
+
export declare function QaSettingsCard({ scope, describe }: CardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared controls of the QA Surface card body.
|
|
3
|
+
*
|
|
4
|
+
* Every control edits the settings namespace through the same path-addressed
|
|
5
|
+
* write, and text and number drafts commit on blur or Enter rather than per
|
|
6
|
+
* keystroke: a half-typed path or an emptied number is a value the Host
|
|
7
|
+
* refuses, and a refusal mid-typing would clear the field the user is still
|
|
8
|
+
* editing. Controls that must land together (a provider with its model, the
|
|
9
|
+
* per-user sandbox with its flag) write every path in one mutation, because
|
|
10
|
+
* the Host validates the section as a whole.
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from "react";
|
|
13
|
+
import { type IdentityFieldDraft } from "./format.js";
|
|
14
|
+
/** One field write inside the plugin's settings namespace. */
|
|
15
|
+
export interface ConfigEntry {
|
|
16
|
+
readonly path: readonly string[];
|
|
17
|
+
readonly value: unknown;
|
|
18
|
+
}
|
|
19
|
+
/** Path-addressed write into the plugin's settings namespace. */
|
|
20
|
+
export type ConfigWrite = (path: readonly string[], value: unknown) => void;
|
|
21
|
+
/** Several path-addressed writes applied as one mutation. */
|
|
22
|
+
export type ConfigWriteMany = (entries: readonly ConfigEntry[]) => void;
|
|
23
|
+
/** Path-addressed clear, so the field re-inherits the composition layer. */
|
|
24
|
+
export type ConfigUnset = (path: readonly string[]) => void;
|
|
25
|
+
/** Whether the raw user layer carries a path. */
|
|
26
|
+
export type OverrideCheck = (path: readonly string[]) => boolean;
|
|
27
|
+
export interface SectionProps {
|
|
28
|
+
readonly writable: boolean;
|
|
29
|
+
readonly write: ConfigWrite;
|
|
30
|
+
readonly writeMany: ConfigWriteMany;
|
|
31
|
+
readonly unset: ConfigUnset;
|
|
32
|
+
readonly overridden: OverrideCheck;
|
|
33
|
+
}
|
|
34
|
+
/** Section frame: title, optional modified marker, optional trailing control. */
|
|
35
|
+
export declare function Section(props: {
|
|
36
|
+
title: string;
|
|
37
|
+
modified: boolean;
|
|
38
|
+
hint?: ReactNode;
|
|
39
|
+
aside?: ReactNode;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
/** Small clearing control shown beside a section the user layer overrides. */
|
|
43
|
+
export declare function ResetButton(props: {
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
label: string;
|
|
46
|
+
onClick: () => void;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
/** Two-state control with a label and an explanatory hint. */
|
|
49
|
+
export declare function Toggle(props: {
|
|
50
|
+
checked: boolean;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
label: string;
|
|
53
|
+
hint: string;
|
|
54
|
+
onChange: (checked: boolean) => void;
|
|
55
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/** Fixed-option control for the schema's string unions. */
|
|
57
|
+
export declare function SelectField(props: {
|
|
58
|
+
label: string;
|
|
59
|
+
value: string;
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
options: ReadonlyArray<{
|
|
62
|
+
value: string;
|
|
63
|
+
label: string;
|
|
64
|
+
}>;
|
|
65
|
+
hint?: string;
|
|
66
|
+
onChange: (value: string) => void;
|
|
67
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
/** Text control; the draft commits on blur and on Enter. */
|
|
69
|
+
export declare function TextField(props: {
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
disabled: boolean;
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
hint?: string;
|
|
75
|
+
multiline?: boolean;
|
|
76
|
+
rows?: number;
|
|
77
|
+
onChange: (value: string) => void;
|
|
78
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
/**
|
|
80
|
+
* Whole-number control; the draft commits on blur and on Enter. A value
|
|
81
|
+
* outside the range snaps into it on commit, so the field never holds a
|
|
82
|
+
* number the Host would refuse outright.
|
|
83
|
+
*/
|
|
84
|
+
export declare function NumberField(props: {
|
|
85
|
+
label: string;
|
|
86
|
+
value: number;
|
|
87
|
+
min: number;
|
|
88
|
+
max: number;
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
hint?: string;
|
|
91
|
+
onChange: (value: number) => void;
|
|
92
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
/**
|
|
94
|
+
* List control for string arrays. The draft parses on commit so a separator
|
|
95
|
+
* the user is still typing never becomes a stored entry.
|
|
96
|
+
*/
|
|
97
|
+
export declare function ListField(props: {
|
|
98
|
+
label: string;
|
|
99
|
+
hint?: string;
|
|
100
|
+
value: readonly string[];
|
|
101
|
+
disabled: boolean;
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
rows?: number;
|
|
104
|
+
parse: (text: string) => string[];
|
|
105
|
+
onCommit: (values: string[]) => void;
|
|
106
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
107
|
+
/**
|
|
108
|
+
* The deployment's declared profile fields, one `key = подпись` per line. The
|
|
109
|
+
* control keeps its own draft so a line still being typed is not parsed into
|
|
110
|
+
* the stored array.
|
|
111
|
+
*/
|
|
112
|
+
export declare function IdentitiesField(props: {
|
|
113
|
+
value: ReadonlyArray<{
|
|
114
|
+
readonly key?: string | undefined;
|
|
115
|
+
readonly label?: string | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
disabled: boolean;
|
|
118
|
+
onCommit: (fields: IdentityFieldDraft[]) => void;
|
|
119
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
/** Status chip pair: label and value with the mode's tone. */
|
|
121
|
+
export declare function Chip(props: {
|
|
122
|
+
label: string;
|
|
123
|
+
value: string;
|
|
124
|
+
tone?: string;
|
|
125
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
126
|
+
/** Prose notice: informational or warning, never a control. */
|
|
127
|
+
export declare function Notice(props: {
|
|
128
|
+
tone: "info" | "warn";
|
|
129
|
+
children: ReactNode;
|
|
130
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
/** Fixed facts of the composed policy, shown as label/value rows. */
|
|
132
|
+
export declare function Facts(props: {
|
|
133
|
+
items: ReadonlyArray<{
|
|
134
|
+
label: string;
|
|
135
|
+
value: string;
|
|
136
|
+
note?: string;
|
|
137
|
+
}>;
|
|
138
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
139
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure presentation helpers of the QA Surface settings card.
|
|
3
|
+
*
|
|
4
|
+
* Kept out of the components so the wording and the draft parsing are
|
|
5
|
+
* unit-testable without a DOM, and so every place that renders the same value
|
|
6
|
+
* renders it identically. Nothing here may reach the Host config surface: the
|
|
7
|
+
* card bundle must not pull schemastery into the page.
|
|
8
|
+
*/
|
|
9
|
+
import type { QaSurfaceConfig } from "../../types.js";
|
|
10
|
+
/** A control's label with the sentence explaining what it does. */
|
|
11
|
+
export interface DescribedOption {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly hint: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Header badge: the route the page answers on, or that the surface is off.
|
|
17
|
+
* The route is the one fact an operator scanning the plugin list looks for.
|
|
18
|
+
*/
|
|
19
|
+
export declare function badgeText(enabled: boolean | undefined, routePath: string | undefined): string;
|
|
20
|
+
/** Wording of the session-policy control. */
|
|
21
|
+
export declare function describeSessionPolicy(policy: string | undefined): DescribedOption;
|
|
22
|
+
/** Wording of the sandbox-mode control. */
|
|
23
|
+
export declare function describeSandbox(mode: string | undefined): DescribedOption;
|
|
24
|
+
/**
|
|
25
|
+
* Parse a numeric control's draft text.
|
|
26
|
+
* @param text - raw input value.
|
|
27
|
+
* @param min - lowest accepted value, clamped into range on commit.
|
|
28
|
+
* @param max - highest accepted value, clamped into range on commit.
|
|
29
|
+
* @returns the integer, or null when the field is empty or not numeric (the
|
|
30
|
+
* caller leaves the stored value alone rather than writing a NaN).
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseNumberDraft(text: string, min: number, max: number): number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Parse a one-entry-per-line list control's draft text. Questions and phrases
|
|
35
|
+
* are free copy, so a comma inside an entry must stay part of that entry.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseLineList(text: string): string[];
|
|
38
|
+
/** Parse a list control whose entries may also be comma-separated. */
|
|
39
|
+
export declare function parseCommaList(text: string): string[];
|
|
40
|
+
/** One declared identity field as the operator writes it. */
|
|
41
|
+
export interface IdentityFieldDraft {
|
|
42
|
+
readonly key: string;
|
|
43
|
+
readonly label: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Parse the identity-field control: one `key = подпись` entry per line. A
|
|
47
|
+
* missing label falls back to the key, and an entry whose key cannot exist on
|
|
48
|
+
* the Host is dropped here rather than refused as a whole write.
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseIdentityFields(text: string): IdentityFieldDraft[];
|
|
51
|
+
/** Render declared identity fields back into the control's draft text. */
|
|
52
|
+
export declare function formatIdentityFields(fields: readonly IdentityFieldDraft[] | undefined): string;
|
|
53
|
+
/**
|
|
54
|
+
* Prerequisites `accounts.perUserWorkspace` cannot run without. The Host
|
|
55
|
+
* refuses the configuration while any of them is unmet, and the sandbox mode
|
|
56
|
+
* is the one entry the card must write together with the flag: both
|
|
57
|
+
* `workspace-write` alone and per-user workspaces alone are refused.
|
|
58
|
+
*/
|
|
59
|
+
export declare function perUserWorkspaceGaps(config: QaSurfaceConfig): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Whether the raw user layer carries this path, which is what marks a field
|
|
62
|
+
* overridden — a value equal to the composition default is still an override.
|
|
63
|
+
* @param user - raw user section from the settings snapshot.
|
|
64
|
+
* @param path - path from the section root.
|
|
65
|
+
* @returns true when every segment exists in the user layer.
|
|
66
|
+
*/
|
|
67
|
+
export declare function isOverridden(user: unknown, path: readonly string[]): boolean;
|
|
68
|
+
/** Top-level keys the user layer carries; the reset-all action clears exactly these. */
|
|
69
|
+
export declare function overriddenKeys(user: unknown): string[];
|
|
70
|
+
/**
|
|
71
|
+
* Read a path out of a settings section.
|
|
72
|
+
* @param value - section root (the snapshot's effective value or user layer).
|
|
73
|
+
* @param path - path from the section root.
|
|
74
|
+
* @returns the value found, or undefined when any segment is absent.
|
|
75
|
+
*/
|
|
76
|
+
export declare function readPath(value: unknown, path: readonly string[]): unknown;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a settled mutation left the section holding what it asked for.
|
|
79
|
+
*
|
|
80
|
+
* The scope resolves a Host-rejected write instead of rejecting it — it
|
|
81
|
+
* reloads Host state and returns — so acceptance is confirmed here. The
|
|
82
|
+
* namespace revision advances on every committed change, and a write that
|
|
83
|
+
* changed nothing is indistinguishable from a refusal; in that one case the
|
|
84
|
+
* section itself answers whether the value already stood.
|
|
85
|
+
* @param entries - writes the mutation asked for.
|
|
86
|
+
* @param cleared - paths the mutation asked to clear.
|
|
87
|
+
* @param snapshot - the scope snapshot as it stands after the settlement.
|
|
88
|
+
* @returns true when the mutation's intent is visible in the section.
|
|
89
|
+
*/
|
|
90
|
+
export declare function mutationLanded(entries: readonly {
|
|
91
|
+
readonly path: readonly string[];
|
|
92
|
+
readonly value: unknown;
|
|
93
|
+
}[], cleared: readonly (readonly string[])[], snapshot: {
|
|
94
|
+
readonly value: unknown;
|
|
95
|
+
readonly user: unknown;
|
|
96
|
+
}): boolean;
|
|
97
|
+
/** Wall-clock stamp of the last Host answer, for the status line. */
|
|
98
|
+
export declare function formatClock(timestamp: number | undefined): string;
|
|
99
|
+
/**
|
|
100
|
+
* Count with the Russian form of its noun: 1 ключ, 2 ключа, 5 ключей.
|
|
101
|
+
* @param count - counted value.
|
|
102
|
+
* @param forms - singular, few, and many forms of the noun.
|
|
103
|
+
* @returns the counted noun as the copy renders it.
|
|
104
|
+
*/
|
|
105
|
+
export declare function pluralRu(count: number, forms: readonly [string, string, string]): string;
|
|
106
|
+
/** Thousands separator so long byte budgets stay readable. */
|
|
107
|
+
export declare function formatCount(value: number | undefined): string;
|
|
108
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access and route: the only section whose consequences reach beyond this
|
|
3
|
+
* plugin's namespace — the path it claims on the Host and where external
|
|
4
|
+
* visitors of the harness root land.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** Where the page lives and who may reach it. */
|
|
8
|
+
export declare function AccessSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounts: the account gate, the self-declared profile, and per-user
|
|
3
|
+
* workspaces. The per-user toggle lands together with the sandbox mode —
|
|
4
|
+
* the Host accepts that pairing or nothing.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** The account gate, the self-declared profile, and per-user workspaces. */
|
|
8
|
+
export declare function AccountsSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachments: what a visitor may attach to one message. Like the interface
|
|
3
|
+
* section, the list fields show the value in effect — a stored list, else the
|
|
4
|
+
* Host's resolved one — so an untouched deployment never sees an empty box
|
|
5
|
+
* for a setting that is active.
|
|
6
|
+
*/
|
|
7
|
+
import { type ConfigProps } from "./common.js";
|
|
8
|
+
/**
|
|
9
|
+
* What a visitor may attach to one message. Files never ride the prompt
|
|
10
|
+
* inline: the browser stages them on the Host and the prompt cites the
|
|
11
|
+
* receipt, so the model resolves the stored copy through its file tools — the
|
|
12
|
+
* deployment's tool allow-list has to keep `read` for that to be useful.
|
|
13
|
+
*/
|
|
14
|
+
export declare function AttachmentsSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branding: pure copy the visitor reads, so nothing here constrains what the
|
|
3
|
+
* Host accepts — every field is free-form and safe to leave empty.
|
|
4
|
+
*/
|
|
5
|
+
import { type ConfigProps } from "./common.js";
|
|
6
|
+
/** Titles, welcome copy, and the notice under the composer. */
|
|
7
|
+
export declare function BrandingSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=branding.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the config sections share: the props every section receives, the
|
|
3
|
+
* override check behind the modified marker, and the reset control that
|
|
4
|
+
* clears a whole section with one click.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from "react";
|
|
7
|
+
import type { QaSurfaceConfig, ResolvedQaSurfaceConfig } from "../../../types.js";
|
|
8
|
+
import { type SectionProps } from "../fields.js";
|
|
9
|
+
export interface ConfigProps extends SectionProps {
|
|
10
|
+
readonly config: QaSurfaceConfig | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* What the running Host resolved, when it answered. A control whose default
|
|
13
|
+
* is not a literal — the running phrases — reads the effective list from
|
|
14
|
+
* here instead of showing an empty field for a setting that is in effect.
|
|
15
|
+
*/
|
|
16
|
+
readonly effective: ResolvedQaSurfaceConfig | null;
|
|
17
|
+
}
|
|
18
|
+
/** The setting paths one section owns; its reset clears them in order. */
|
|
19
|
+
export type SectionPaths = ReadonlyArray<readonly string[]>;
|
|
20
|
+
/** Whether the user layer overrides any of the paths the section owns. */
|
|
21
|
+
export declare function overriddenAny(props: ConfigProps, paths: SectionPaths): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The reset control beside a section whose paths the user layer overrides:
|
|
24
|
+
* one button clearing every path of the section, disabled while the settings
|
|
25
|
+
* namespace itself is read-only.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resetAside(props: ConfigProps, paths: SectionPaths): ReactNode;
|
|
28
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embedding: one CSP field with a wide blast radius — an overly generous
|
|
3
|
+
* frame-ancestors list lets any listed site run this page as its own UI.
|
|
4
|
+
*/
|
|
5
|
+
import { type ConfigProps } from "./common.js";
|
|
6
|
+
/** Embedding the page into another site's frame. */
|
|
7
|
+
export declare function EmbeddingSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=embedding.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface: what the visitor sees of the conversation. The show-reset toggle
|
|
3
|
+
* stays disabled while the lockdown section withholds session reset — the
|
|
4
|
+
* Host refuses one without the other.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** What the visitor sees of the conversation. */
|
|
8
|
+
export declare function InterfaceSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lockdown: the execution policy every QA chat is pinned to. Its fixed
|
|
3
|
+
* choices are not editable on purpose — the Host rejects any configuration
|
|
4
|
+
* that relaxes them, so the card explains rather than offers.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** The execution policy every QA chat is pinned to. */
|
|
8
|
+
export declare function LockdownSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=lockdown.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session: which chat a visitor gets, and which agent and model serve it.
|
|
3
|
+
* Provider and model are written as one mutation because the Host refuses
|
|
4
|
+
* either of them alone.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** Which chat a visitor gets, and which agent and model serve it. */
|
|
8
|
+
export declare function SessionSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sources: which sources the assistant may cite and how they are shown. Most
|
|
3
|
+
* of the controls live behind "advanced" disclosures so the default view
|
|
4
|
+
* carries only the collection switches a deployment actually argues about.
|
|
5
|
+
*/
|
|
6
|
+
import { type ConfigProps } from "./common.js";
|
|
7
|
+
/** Which sources the assistant may cite, and how they are shown. */
|
|
8
|
+
export declare function SourcesSection(props: ConfigProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The status view: what the deployment actually serves, read from the running
|
|
3
|
+
* Host rather than from the settings snapshot.
|
|
4
|
+
*/
|
|
5
|
+
import type { QaSurfaceConfig, ResolvedQaSurfaceConfig } from "../../../types.js";
|
|
6
|
+
export interface StatusProps {
|
|
7
|
+
/** Effective configuration the running Host answered with, when it did. */
|
|
8
|
+
readonly effective: ResolvedQaSurfaceConfig | null;
|
|
9
|
+
/** Settings snapshot shown while the Host has not answered. */
|
|
10
|
+
readonly config: QaSurfaceConfig | undefined;
|
|
11
|
+
readonly refreshing: boolean;
|
|
12
|
+
readonly refreshedAt: number | undefined;
|
|
13
|
+
readonly overrides: number;
|
|
14
|
+
readonly onRefresh: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* What the deployment is actually serving: the route, the session policy, the
|
|
18
|
+
* execution policy, and the account gate, as the Host resolved them. The card
|
|
19
|
+
* polls this while it is open, so a saved change is confirmed here.
|
|
20
|
+
*/
|
|
21
|
+
export declare function StatusSection(props: StatusProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body sections of the QA Surface settings card.
|
|
3
|
+
*
|
|
4
|
+
* Each section owns its controls and derives every value from the settings
|
|
5
|
+
* snapshot (the effective configuration) or, for the status view, from the
|
|
6
|
+
* running Host through the `qaSurface/describe` Remote. The controls mirror
|
|
7
|
+
* the Host's own validation: combinations the resolver refuses are either
|
|
8
|
+
* written together in one mutation or explained rather than offered.
|
|
9
|
+
*
|
|
10
|
+
* One file per section lives in `sections/`, with what the config sections
|
|
11
|
+
* share in `sections/common.tsx`; this module is the barrel the card imports.
|
|
12
|
+
*/
|
|
13
|
+
export type { ConfigProps } from "./sections/common.js";
|
|
14
|
+
export { AccessSection } from "./sections/access.js";
|
|
15
|
+
export { AccountsSection } from "./sections/accounts.js";
|
|
16
|
+
export { AttachmentsSection } from "./sections/attachments.js";
|
|
17
|
+
export { BrandingSection } from "./sections/branding.js";
|
|
18
|
+
export { EmbeddingSection } from "./sections/embedding.js";
|
|
19
|
+
export { InterfaceSection } from "./sections/interface.js";
|
|
20
|
+
export { LockdownSection } from "./sections/lockdown.js";
|
|
21
|
+
export { SessionSection } from "./sections/session.js";
|
|
22
|
+
export { SourcesSection } from "./sections/sources.js";
|
|
23
|
+
export { StatusSection } from "./sections/status.js";
|
|
24
|
+
export type { StatusProps } from "./sections/status.js";
|
|
25
|
+
//# sourceMappingURL=sections.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card stylesheet: the canonical shell (AGENTS.md contract) plus body rules
|
|
3
|
+
* for this plugin's own controls. Every surface, border, and colour comes from
|
|
4
|
+
* `--dsw-alias-*` tokens so light, dark, and system themes stay coherent; the
|
|
5
|
+
* QA page's own palette stays out of the settings page.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QA_SETTINGS_STYLES: string;
|
|
8
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spacing for a running turn's stream frames. A running turn's frames arrive
|
|
3
|
+
* at animation-frame cadence, so re-projections are spaced at least the
|
|
4
|
+
* configured interval apart: the first frame of a window projects at once and
|
|
5
|
+
* further frames are absorbed (the memoized render path replays nothing, so
|
|
6
|
+
* absorbing a frame only defers it). Everything outside a running turn —
|
|
7
|
+
* phase flips, errors, turn completion — projects immediately, and a
|
|
8
|
+
* non-running notification also cancels an absorbed window so the final
|
|
9
|
+
* state never waits for it. Zero disables the spacing entirely.
|
|
10
|
+
*/
|
|
11
|
+
export declare class StreamPublisher {
|
|
12
|
+
private readonly intervalMs;
|
|
13
|
+
private timer;
|
|
14
|
+
constructor(intervalMs: number);
|
|
15
|
+
/**
|
|
16
|
+
* Deliver one notification. `running` says whether the bound session is
|
|
17
|
+
* mid-turn; `emit` performs the actual projection and must stay cheap to
|
|
18
|
+
* defer.
|
|
19
|
+
*/
|
|
20
|
+
publish(running: boolean, emit: () => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Cancel an absorbed window so the next frame projects at once. Called
|
|
23
|
+
* when the binding goes away or the controller winds down: a stale window
|
|
24
|
+
* must not swallow the first frame of a fresh binding.
|
|
25
|
+
*/
|
|
26
|
+
clear(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=stream-publisher.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientRemote } from "@deepseek-ai/dsh-api-gateway/client";
|
|
2
2
|
import type { ISessions, SessionFace } from "@deepseek-ai/dsh-api-session-controller/client";
|
|
3
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";
|
|
4
|
+
import type { QaAccountProfileInput, QaAccountSession, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaLockdownProof, QaOwnershipEntry, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, 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. */
|
|
@@ -28,6 +28,32 @@ export type QaSecureSession = (token: string, sessionId: string) => Promise<{
|
|
|
28
28
|
readonly ok: false;
|
|
29
29
|
readonly error: unknown;
|
|
30
30
|
}>;
|
|
31
|
+
/** Host-authoritative creation: identity, cwd and policy never come from the browser. */
|
|
32
|
+
export type QaCreateSession = (token: string) => Promise<RemoteResult<string>>;
|
|
33
|
+
/**
|
|
34
|
+
* Browser file-upload service (`ctx.fileUpload`), described structurally on
|
|
35
|
+
* purpose: files do not ride the prompt inline the way images do, they are
|
|
36
|
+
* staged through the Host upload route and cited by receipt. The QA bundle
|
|
37
|
+
* must not link the upload package — a deployment may not serve it — so the
|
|
38
|
+
* service is read off the context at send time and this is the only shape the
|
|
39
|
+
* surface relies on.
|
|
40
|
+
*/
|
|
41
|
+
export interface QaFileUpload {
|
|
42
|
+
upload(sessionId: string, data: Blob | Uint8Array, name?: string, signal?: AbortSignal): Promise<{
|
|
43
|
+
readonly ok: true;
|
|
44
|
+
readonly value: {
|
|
45
|
+
readonly receiptId: string;
|
|
46
|
+
readonly file: {
|
|
47
|
+
readonly attachmentId: string;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly bytes: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
readonly ok: false;
|
|
54
|
+
readonly error: unknown;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
31
57
|
export interface QaSourceApi {
|
|
32
58
|
sources(token: string, sessionId: string): Promise<{
|
|
33
59
|
readonly ok: true;
|
|
@@ -61,6 +87,53 @@ export type QaBoundSourceApi = {
|
|
|
61
87
|
readonly error: unknown;
|
|
62
88
|
}>;
|
|
63
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* Approval remotes of this plugin's namespace. Read-only listing plus the one
|
|
92
|
+
* write: the operator's answer to a parked tool call.
|
|
93
|
+
*/
|
|
94
|
+
export interface QaApprovalApi {
|
|
95
|
+
pendingApprovals(token: string, sessionId: string): Promise<{
|
|
96
|
+
readonly ok: true;
|
|
97
|
+
readonly value: readonly QaPendingApproval[];
|
|
98
|
+
} | {
|
|
99
|
+
readonly ok: false;
|
|
100
|
+
readonly error: unknown;
|
|
101
|
+
}>;
|
|
102
|
+
answerApproval(token: string, sessionId: string, requestId: string, decision: QaApprovalDecision): Promise<{
|
|
103
|
+
readonly ok: true;
|
|
104
|
+
readonly value: boolean;
|
|
105
|
+
} | {
|
|
106
|
+
readonly ok: false;
|
|
107
|
+
readonly error: unknown;
|
|
108
|
+
}>;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Question remotes of this plugin's namespace: the parked `ask_user_question`
|
|
112
|
+
* requests of one chat, the operator's answers, and closing one unanswered.
|
|
113
|
+
*/
|
|
114
|
+
export interface QaQuestionApi {
|
|
115
|
+
pendingQuestions(token: string, sessionId: string): Promise<{
|
|
116
|
+
readonly ok: true;
|
|
117
|
+
readonly value: readonly QaPendingQuestion[];
|
|
118
|
+
} | {
|
|
119
|
+
readonly ok: false;
|
|
120
|
+
readonly error: unknown;
|
|
121
|
+
}>;
|
|
122
|
+
answerQuestion(token: string, sessionId: string, requestId: string, answers: readonly QaQuestionAnswerItem[]): Promise<{
|
|
123
|
+
readonly ok: true;
|
|
124
|
+
readonly value: boolean;
|
|
125
|
+
} | {
|
|
126
|
+
readonly ok: false;
|
|
127
|
+
readonly error: unknown;
|
|
128
|
+
}>;
|
|
129
|
+
cancelQuestion(token: string, sessionId: string, requestId: string): Promise<{
|
|
130
|
+
readonly ok: true;
|
|
131
|
+
readonly value: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
readonly ok: false;
|
|
134
|
+
readonly error: unknown;
|
|
135
|
+
}>;
|
|
136
|
+
}
|
|
64
137
|
/** Account remotes exposed by the plugin's own typert namespace. */
|
|
65
138
|
export interface QaAccountsApi {
|
|
66
139
|
accountsWhoami(token: string): Promise<RemoteResult<QaWhoamiResult>>;
|
|
@@ -73,6 +146,8 @@ export interface QaAccountsApi {
|
|
|
73
146
|
accountsListOwnership(token: string): Promise<RemoteResult<{
|
|
74
147
|
readonly entries: readonly QaOwnershipEntry[];
|
|
75
148
|
}>>;
|
|
149
|
+
/** Replace the caller's own self-declared profile; the token is the identity. */
|
|
150
|
+
accountsUpdateProfile(token: string, input: QaAccountProfileInput): Promise<RemoteResult<QaAccountUserPublic>>;
|
|
76
151
|
}
|
|
77
152
|
type RemoteResult<Value> = {
|
|
78
153
|
readonly ok: true;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
import type { QaSource, QaTurnSources } from "../types.js";
|
|
3
|
+
import type { QaDrawerCompleteness, QaRailTab } from "./use-session-ui-state.js";
|
|
4
|
+
/**
|
|
5
|
+
* The rail-related slice of `useSessionUiState`, declared structurally so the
|
|
6
|
+
* controller consumes exactly what it drives and the rest of the chat-local
|
|
7
|
+
* state (draft text, variant offsets, the turn mark) stays with the surface.
|
|
8
|
+
*/
|
|
9
|
+
export interface QaRightRailState {
|
|
10
|
+
readonly railOpen: boolean;
|
|
11
|
+
readonly setRailOpen: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
readonly railTab: QaRailTab;
|
|
13
|
+
readonly setRailTab: Dispatch<SetStateAction<QaRailTab>>;
|
|
14
|
+
readonly drawerSources: readonly QaSource[] | null;
|
|
15
|
+
readonly setDrawerSources: Dispatch<SetStateAction<readonly QaSource[] | null>>;
|
|
16
|
+
readonly drawerCompleteness: QaDrawerCompleteness | null;
|
|
17
|
+
readonly setDrawerCompleteness: Dispatch<SetStateAction<QaDrawerCompleteness | null>>;
|
|
18
|
+
readonly drawerDetail: QaSource | null;
|
|
19
|
+
readonly setDrawerDetail: Dispatch<SetStateAction<QaSource | null>>;
|
|
20
|
+
readonly setAgentsOpen: Dispatch<SetStateAction<boolean>>;
|
|
21
|
+
}
|
|
22
|
+
/** What QaSurface reads and hands to the rail, the panels and the header. */
|
|
23
|
+
export interface QaRightRailFacade {
|
|
24
|
+
readonly railOpen: boolean;
|
|
25
|
+
readonly railTab: QaRailTab;
|
|
26
|
+
/** Message-scoped source pin, or null for the whole-chat list. */
|
|
27
|
+
readonly drawerSources: readonly QaSource[] | null;
|
|
28
|
+
readonly drawerCompleteness: QaDrawerCompleteness | null;
|
|
29
|
+
readonly drawerDetail: QaSource | null;
|
|
30
|
+
/** A message footer's sources control: pin the message-scoped subset. */
|
|
31
|
+
readonly openSources: (sources: readonly QaSource[], complete: boolean, incompleteOrigins: QaTurnSources["incompleteOrigins"]) => void;
|
|
32
|
+
/** A message's source chip: show that source's detail instead of a list. */
|
|
33
|
+
readonly openSourceDetail: (source: QaSource) => void;
|
|
34
|
+
/** Back to the whole-chat source list, dropping the pin. */
|
|
35
|
+
readonly showAllSources: () => void;
|
|
36
|
+
/** Closing the rail also discards the pinned sources, as the drawer did. */
|
|
37
|
+
readonly close: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* The header buttons: a second click on the active tab's button closes the
|
|
40
|
+
* rail; opening the sources tab shows the full list, dropping any pin.
|
|
41
|
+
*/
|
|
42
|
+
readonly openTab: (tab: QaRailTab) => void;
|
|
43
|
+
/** The rail strip's plain tab switch. */
|
|
44
|
+
readonly selectTab: (tab: QaRailTab) => void;
|
|
45
|
+
/** The agents drawer and the rail are mutually exclusive; this is its side. */
|
|
46
|
+
readonly toggleAgents: () => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Right-rail controller over the chat-local drawer state: every transition
|
|
50
|
+
* between the whole-chat list, a pinned message subset and a single source's
|
|
51
|
+
* detail lives here, so the surface only wires controls to intents. The
|
|
52
|
+
* callbacks stay referentially stable — they close over `useState` setters,
|
|
53
|
+
* whose identities never change.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useRightRail(ui: QaRightRailState): QaRightRailFacade;
|
|
56
|
+
//# sourceMappingURL=use-right-rail.d.ts.map
|