@yadsh/dsh-qa-surface 0.6.1 → 0.7.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 +136 -7
- package/capability-policy.json +1 -1
- package/lib/access/capability-catalog.js +144 -0
- package/lib/access/capability-catalog.js.map +1 -0
- package/lib/access/model.js +379 -0
- package/lib/access/model.js.map +1 -0
- package/lib/access/role-repository.js +195 -0
- package/lib/access/role-repository.js.map +1 -0
- package/lib/access/service.js +380 -0
- package/lib/access/service.js.map +1 -0
- package/lib/access/skill-metadata.js +234 -0
- package/lib/access/skill-metadata.js.map +1 -0
- package/lib/account-remotes.js +20 -10
- package/lib/account-remotes.js.map +1 -1
- package/lib/accounts/errors.js.map +1 -1
- package/lib/accounts/file.js.map +1 -1
- package/lib/accounts/store.js +202 -3
- package/lib/accounts/store.js.map +1 -1
- package/lib/admin/conversation-log.js +256 -0
- package/lib/admin/conversation-log.js.map +1 -0
- package/lib/admin/index.js +17 -0
- package/lib/admin/index.js.map +1 -0
- package/lib/admin/metrics.js +103 -0
- package/lib/admin/metrics.js.map +1 -0
- package/lib/admin/paging.js +23 -0
- package/lib/admin/paging.js.map +1 -0
- package/lib/admin/permissions.js +50 -0
- package/lib/admin/permissions.js.map +1 -0
- package/lib/admin/quality-store.js +485 -0
- package/lib/admin/quality-store.js.map +1 -0
- package/lib/admin/queue.js +107 -0
- package/lib/admin/queue.js.map +1 -0
- package/lib/admin/redaction.js +45 -0
- package/lib/admin/redaction.js.map +1 -0
- package/lib/admin/service.js +897 -0
- package/lib/admin/service.js.map +1 -0
- package/lib/admin/session-log.js +142 -0
- package/lib/admin/session-log.js.map +1 -0
- package/lib/cli.js +9 -6
- package/lib/cli.js.map +1 -1
- package/lib/client/QaSessionController.js +28 -2
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +143 -5
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +1 -0
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/admin/QaAdmin.js +458 -0
- package/lib/client/admin/QaAdmin.js.map +1 -0
- package/lib/client/admin/format.js +177 -0
- package/lib/client/admin/format.js.map +1 -0
- package/lib/client/admin/pages/Conversations.js +114 -0
- package/lib/client/admin/pages/Conversations.js.map +1 -0
- package/lib/client/admin/pages/Overview.js +24 -0
- package/lib/client/admin/pages/Overview.js.map +1 -0
- package/lib/client/admin/pages/Quality.js +71 -0
- package/lib/client/admin/pages/Quality.js.map +1 -0
- package/lib/client/admin/pages/Review.js +93 -0
- package/lib/client/admin/pages/Review.js.map +1 -0
- package/lib/client/admin/pages/Users.js +95 -0
- package/lib/client/admin/pages/Users.js.map +1 -0
- package/lib/client/admin/routes.js +127 -0
- package/lib/client/admin/routes.js.map +1 -0
- package/lib/client/admin/shared.js +91 -0
- package/lib/client/admin/shared.js.map +1 -0
- package/lib/client/admin/styles.js +111 -0
- package/lib/client/admin/styles.js.map +1 -0
- package/lib/client/components/QaChangelog.js +35 -0
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaHeader.js +3 -3
- package/lib/client/components/QaHeader.js.map +1 -1
- package/lib/client/components/QaMessage.js +61 -2
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/create-session.js +1 -1
- package/lib/client/create-session.js.map +1 -1
- package/lib/client/index.js +33 -1
- package/lib/client/index.js.map +1 -1
- package/lib/client/role/RoleSelector.js +31 -0
- package/lib/client/role/RoleSelector.js.map +1 -0
- package/lib/client/session-sources.js +37 -1
- package/lib/client/session-sources.js.map +1 -1
- package/lib/client/settings/card.js +2 -2
- package/lib/client/settings/card.js.map +1 -1
- package/lib/client/settings/sections.js +0 -1
- package/lib/client/settings/sections.js.map +1 -1
- package/lib/client/styles.js +31 -0
- package/lib/client/styles.js.map +1 -1
- package/lib/client/types.js.map +1 -1
- package/lib/client.js +9908 -4857
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/defaults.js +0 -2
- package/lib/config-resolvers/defaults.js.map +1 -1
- package/lib/config.js +0 -249
- package/lib/config.js.map +1 -1
- package/lib/enforcement/skill-policy.js +172 -0
- package/lib/enforcement/skill-policy.js.map +1 -0
- package/lib/enforcement/tool-grants.js +151 -0
- package/lib/enforcement/tool-grants.js.map +1 -0
- package/lib/index.js +224 -42
- package/lib/index.js.map +1 -1
- package/lib/personal-skills/service.js +10 -3
- package/lib/personal-skills/service.js.map +1 -1
- package/lib/qa-tools/index.js +4 -0
- package/lib/qa-tools/index.js.map +1 -1
- package/lib/resolve-config.js +0 -2
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +71 -17
- package/lib/secure-session.js.map +1 -1
- package/lib/typert.host.js +2237 -202
- package/lib/typert.remote-client.d.ts +49 -3
- package/lib/typert.remote-client.js +1863 -183
- package/lib/types/access/capability-catalog.d.ts +37 -0
- package/lib/types/access/model.d.ts +60 -0
- package/lib/types/access/role-repository.d.ts +32 -0
- package/lib/types/access/service.d.ts +57 -0
- package/lib/types/access/skill-metadata.d.ts +53 -0
- package/lib/types/account-remotes.d.ts +6 -0
- package/lib/types/accounts/errors.d.ts +1 -1
- package/lib/types/accounts/file.d.ts +16 -5
- package/lib/types/accounts/store.d.ts +83 -3
- package/lib/types/admin/conversation-log.d.ts +39 -0
- package/lib/types/admin/index.d.ts +24 -0
- package/lib/types/admin/metrics.d.ts +29 -0
- package/lib/types/admin/paging.d.ts +33 -0
- package/lib/types/admin/permissions.d.ts +10 -0
- package/lib/types/admin/quality-store.d.ts +82 -0
- package/lib/types/admin/queue.d.ts +21 -0
- package/lib/types/admin/redaction.d.ts +29 -0
- package/lib/types/admin/service.d.ts +105 -0
- package/lib/types/admin/session-log.d.ts +53 -0
- package/lib/types/client/QaSessionController.d.ts +12 -1
- package/lib/types/client/QaSurface.d.ts +7 -1
- package/lib/types/client/admin/QaAdmin.d.ts +17 -0
- package/lib/types/client/admin/format.d.ts +43 -0
- package/lib/types/client/admin/pages/Conversations.d.ts +21 -0
- package/lib/types/client/admin/pages/Overview.d.ts +13 -0
- package/lib/types/client/admin/pages/Quality.d.ts +18 -0
- package/lib/types/client/admin/pages/Review.d.ts +15 -0
- package/lib/types/client/admin/pages/Users.d.ts +22 -0
- package/lib/types/client/admin/routes.d.ts +50 -0
- package/lib/types/client/admin/shared.d.ts +53 -0
- package/lib/types/client/admin/styles.d.ts +11 -0
- package/lib/types/client/components/QaHeader.d.ts +5 -1
- package/lib/types/client/components/QaMessage.d.ts +14 -1
- package/lib/types/client/create-session.d.ts +2 -0
- package/lib/types/client/role/RoleSelector.d.ts +14 -0
- package/lib/types/client/session-sources.d.ts +9 -0
- package/lib/types/client/settings/sections.d.ts +0 -1
- package/lib/types/client/types.d.ts +39 -2
- package/lib/types/enforcement/skill-policy.d.ts +29 -0
- package/lib/types/enforcement/tool-grants.d.ts +84 -0
- package/lib/types/index.d.ts +62 -14
- package/lib/types/qa-tools/index.d.ts +2 -0
- package/lib/types/secure-session.d.ts +10 -1
- package/lib/types/types.d.ts +568 -5
- package/package.json +1 -1
- package/lib/client/settings/sections/documents.js +0 -88
- package/lib/client/settings/sections/documents.js.map +0 -1
- package/lib/documents/artifacts/ids.js +0 -43
- package/lib/documents/artifacts/ids.js.map +0 -1
- package/lib/documents/artifacts/manifest.js +0 -66
- package/lib/documents/artifacts/manifest.js.map +0 -1
- package/lib/documents/artifacts/store.js +0 -169
- package/lib/documents/artifacts/store.js.map +0 -1
- package/lib/documents/capabilities.js +0 -93
- package/lib/documents/capabilities.js.map +0 -1
- package/lib/documents/config.js +0 -302
- package/lib/documents/config.js.map +0 -1
- package/lib/documents/defaults.js +0 -78
- package/lib/documents/defaults.js.map +0 -1
- package/lib/documents/errors.js +0 -101
- package/lib/documents/errors.js.map +0 -1
- package/lib/documents/index.js +0 -80
- package/lib/documents/index.js.map +0 -1
- package/lib/documents/inspect/facts.js +0 -161
- package/lib/documents/inspect/facts.js.map +0 -1
- package/lib/documents/inspect/zip.js +0 -108
- package/lib/documents/inspect/zip.js.map +0 -1
- package/lib/documents/markdown/directives.js +0 -135
- package/lib/documents/markdown/directives.js.map +0 -1
- package/lib/documents/markdown/frontmatter.js +0 -35
- package/lib/documents/markdown/frontmatter.js.map +0 -1
- package/lib/documents/markdown/normalize.js +0 -113
- package/lib/documents/markdown/normalize.js.map +0 -1
- package/lib/documents/orchestrator/assets.js +0 -243
- package/lib/documents/orchestrator/assets.js.map +0 -1
- package/lib/documents/orchestrator/convert-document.js +0 -186
- package/lib/documents/orchestrator/convert-document.js.map +0 -1
- package/lib/documents/orchestrator/create-document.js +0 -292
- package/lib/documents/orchestrator/create-document.js.map +0 -1
- package/lib/documents/orchestrator/extract-document.js +0 -162
- package/lib/documents/orchestrator/extract-document.js.map +0 -1
- package/lib/documents/orchestrator/inspect-document.js +0 -89
- package/lib/documents/orchestrator/inspect-document.js.map +0 -1
- package/lib/documents/orchestrator/runtime-deps.js +0 -59
- package/lib/documents/orchestrator/runtime-deps.js.map +0 -1
- package/lib/documents/orchestrator/scope.js +0 -132
- package/lib/documents/orchestrator/scope.js.map +0 -1
- package/lib/documents/providers/docling.js +0 -247
- package/lib/documents/providers/docling.js.map +0 -1
- package/lib/documents/providers/libreoffice.js +0 -130
- package/lib/documents/providers/libreoffice.js.map +0 -1
- package/lib/documents/providers/markitdown.js +0 -89
- package/lib/documents/providers/markitdown.js.map +0 -1
- package/lib/documents/providers/pandoc.js +0 -161
- package/lib/documents/providers/pandoc.js.map +0 -1
- package/lib/documents/providers/process.js +0 -164
- package/lib/documents/providers/process.js.map +0 -1
- package/lib/documents/providers/registry.js +0 -152
- package/lib/documents/providers/registry.js.map +0 -1
- package/lib/documents/providers/shared.js +0 -75
- package/lib/documents/providers/shared.js.map +0 -1
- package/lib/documents/runtime.js +0 -114
- package/lib/documents/runtime.js.map +0 -1
- package/lib/documents/security/file-types.js +0 -188
- package/lib/documents/security/file-types.js.map +0 -1
- package/lib/documents/security/limits.js +0 -78
- package/lib/documents/security/limits.js.map +0 -1
- package/lib/documents/security/mime.js +0 -43
- package/lib/documents/security/mime.js.map +0 -1
- package/lib/documents/security/paths.js +0 -133
- package/lib/documents/security/paths.js.map +0 -1
- package/lib/documents/templates/registry.js +0 -147
- package/lib/documents/templates/registry.js.map +0 -1
- package/lib/documents/templates/resolver.js +0 -59
- package/lib/documents/templates/resolver.js.map +0 -1
- package/lib/documents/tools/convert.js +0 -125
- package/lib/documents/tools/convert.js.map +0 -1
- package/lib/documents/tools/create.js +0 -187
- package/lib/documents/tools/create.js.map +0 -1
- package/lib/documents/tools/index.js +0 -41
- package/lib/documents/tools/index.js.map +0 -1
- package/lib/documents/tools/inspect.js +0 -135
- package/lib/documents/tools/inspect.js.map +0 -1
- package/lib/documents/tools/shared.js +0 -88
- package/lib/documents/tools/shared.js.map +0 -1
- package/lib/documents/tools/to-markdown.js +0 -125
- package/lib/documents/tools/to-markdown.js.map +0 -1
- package/lib/documents/types.js +0 -12
- package/lib/documents/types.js.map +0 -1
- package/lib/types/client/settings/sections/documents.d.ts +0 -13
- package/lib/types/documents/artifacts/ids.d.ts +0 -14
- package/lib/types/documents/artifacts/manifest.d.ts +0 -32
- package/lib/types/documents/artifacts/store.d.ts +0 -67
- package/lib/types/documents/capabilities.d.ts +0 -32
- package/lib/types/documents/config.d.ts +0 -27
- package/lib/types/documents/defaults.d.ts +0 -161
- package/lib/types/documents/errors.d.ts +0 -42
- package/lib/types/documents/index.d.ts +0 -63
- package/lib/types/documents/inspect/facts.d.ts +0 -43
- package/lib/types/documents/inspect/zip.d.ts +0 -28
- package/lib/types/documents/markdown/directives.d.ts +0 -39
- package/lib/types/documents/markdown/frontmatter.d.ts +0 -15
- package/lib/types/documents/markdown/normalize.d.ts +0 -30
- package/lib/types/documents/orchestrator/assets.d.ts +0 -55
- package/lib/types/documents/orchestrator/convert-document.d.ts +0 -25
- package/lib/types/documents/orchestrator/create-document.d.ts +0 -18
- package/lib/types/documents/orchestrator/extract-document.d.ts +0 -24
- package/lib/types/documents/orchestrator/inspect-document.d.ts +0 -12
- package/lib/types/documents/orchestrator/runtime-deps.d.ts +0 -43
- package/lib/types/documents/orchestrator/scope.d.ts +0 -52
- package/lib/types/documents/providers/docling.d.ts +0 -54
- package/lib/types/documents/providers/libreoffice.d.ts +0 -40
- package/lib/types/documents/providers/markitdown.d.ts +0 -28
- package/lib/types/documents/providers/pandoc.d.ts +0 -42
- package/lib/types/documents/providers/process.d.ts +0 -54
- package/lib/types/documents/providers/registry.d.ts +0 -68
- package/lib/types/documents/providers/shared.d.ts +0 -27
- package/lib/types/documents/runtime.d.ts +0 -59
- package/lib/types/documents/security/file-types.d.ts +0 -39
- package/lib/types/documents/security/limits.d.ts +0 -24
- package/lib/types/documents/security/mime.d.ts +0 -13
- package/lib/types/documents/security/paths.d.ts +0 -38
- package/lib/types/documents/templates/registry.d.ts +0 -50
- package/lib/types/documents/templates/resolver.d.ts +0 -30
- package/lib/types/documents/tools/convert.d.ts +0 -9
- package/lib/types/documents/tools/create.d.ts +0 -14
- package/lib/types/documents/tools/index.d.ts +0 -33
- package/lib/types/documents/tools/inspect.d.ts +0 -9
- package/lib/types/documents/tools/shared.d.ts +0 -77
- package/lib/types/documents/tools/to-markdown.d.ts +0 -12
- package/lib/types/documents/types.d.ts +0 -294
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QaConversationReview, QaMessageFeedback, QaReviewQueueItem } from "../types.js";
|
|
2
|
+
import type { QaManualQueueEntry } from "./quality-store.js";
|
|
3
|
+
/** A tool call that failed inside one conversation, found while projecting it. */
|
|
4
|
+
export interface QaToolFailureSignal {
|
|
5
|
+
readonly conversationId: string;
|
|
6
|
+
readonly messageId?: string;
|
|
7
|
+
readonly at: string;
|
|
8
|
+
}
|
|
9
|
+
export interface QaQueueInput {
|
|
10
|
+
readonly feedback: readonly QaMessageFeedback[];
|
|
11
|
+
readonly reviews: readonly QaConversationReview[];
|
|
12
|
+
readonly manual: readonly QaManualQueueEntry[];
|
|
13
|
+
readonly failures?: readonly QaToolFailureSignal[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build queue rows, newest signal first within a priority band. A conversation
|
|
17
|
+
* reached by several signals appears once per answered target, so a reviewer
|
|
18
|
+
* can see that the same chat was rated down twice.
|
|
19
|
+
*/
|
|
20
|
+
export declare function deriveQueue({ feedback, reviews, manual, failures, }: QaQueueInput): readonly QaReviewQueueItem[];
|
|
21
|
+
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The redaction seam of the review console.
|
|
3
|
+
*
|
|
4
|
+
* Review work needs user prompts, tool arguments and tool results — the exact
|
|
5
|
+
* material most likely to carry credentials, customer data or internal
|
|
6
|
+
* knowledge. The default implementation does not pretend to be a DLP engine; it
|
|
7
|
+
* bounds every preview and masks the credential shapes that appear in tool
|
|
8
|
+
* traffic. A deployment that needs more replaces this object, which is why the
|
|
9
|
+
* projection takes a redactor rather than reading the environment.
|
|
10
|
+
*/
|
|
11
|
+
export interface QaAdminRedactor {
|
|
12
|
+
/** One user or assistant message text, as the reviewer reads it. */
|
|
13
|
+
redactMessage(text: string): string;
|
|
14
|
+
/** One tool call's raw argument JSON. */
|
|
15
|
+
redactToolArguments(value: string): string;
|
|
16
|
+
/** One tool result preview. */
|
|
17
|
+
redactToolResult(value: string): string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Preview bounds. A review needs enough to judge a call, not a full dump: a
|
|
21
|
+
* large result would otherwise dominate the transcript and the wire payload.
|
|
22
|
+
*/
|
|
23
|
+
export declare const QA_ADMIN_TEXT_LIMIT = 8000;
|
|
24
|
+
export declare const QA_ADMIN_ARGUMENTS_LIMIT = 2000;
|
|
25
|
+
export declare const QA_ADMIN_RESULT_LIMIT = 6000;
|
|
26
|
+
export declare function maskSecrets(value: string): string;
|
|
27
|
+
/** The deployment default: bounded previews with credential shapes masked. */
|
|
28
|
+
export declare const defaultAdminRedactor: QaAdminRedactor;
|
|
29
|
+
//# sourceMappingURL=redaction.d.ts.map
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { PluginLogger } from "@yadsh/dsh-plugin-log";
|
|
2
|
+
import type { QaAccounts } from "../accounts/store.js";
|
|
3
|
+
import type { QaAccessService } from "../access/service.js";
|
|
4
|
+
import type { QaRoleRepository } from "../access/role-repository.js";
|
|
5
|
+
import type { QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaConversationDetail, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaUserQuery } from "../types.js";
|
|
6
|
+
import type { QaQualityStore } from "./quality-store.js";
|
|
7
|
+
import type { QaAdminRedactor } from "./redaction.js";
|
|
8
|
+
import type { QaSessionLogReader } from "./session-log.js";
|
|
9
|
+
/**
|
|
10
|
+
* The administrative console's server side.
|
|
11
|
+
*
|
|
12
|
+
* Every entry point takes the caller's token and names the permission it
|
|
13
|
+
* needs; there is no `isAdmin` shortcut and no client-supplied identity. The
|
|
14
|
+
* browser may only ever read what a role grants, and every write lands in the
|
|
15
|
+
* audit trail with its before and after images.
|
|
16
|
+
*/
|
|
17
|
+
export declare const QA_ADMIN_PAGE_DEFAULT = 25;
|
|
18
|
+
export declare const QA_ADMIN_PAGE_MAX = 100;
|
|
19
|
+
/**
|
|
20
|
+
* How many conversations one metrics or search pass will open. Reading every
|
|
21
|
+
* stored log is unbounded work, so the aggregation covers the newest logs and
|
|
22
|
+
* says so; moving these counters onto a real index is the next iteration.
|
|
23
|
+
*/
|
|
24
|
+
export declare const QA_ADMIN_SCAN_LIMIT = 200;
|
|
25
|
+
interface QaServiceClock {
|
|
26
|
+
now(): number;
|
|
27
|
+
}
|
|
28
|
+
export interface QaAdminServiceOptions {
|
|
29
|
+
readonly accounts: () => QaAccounts | undefined;
|
|
30
|
+
readonly quality: () => QaQualityStore;
|
|
31
|
+
readonly roles: () => QaRoleRepository;
|
|
32
|
+
readonly access: () => QaAccessService;
|
|
33
|
+
readonly sessionLog: QaSessionLogReader;
|
|
34
|
+
readonly logger: PluginLogger;
|
|
35
|
+
readonly redactor?: QaAdminRedactor;
|
|
36
|
+
readonly clock?: QaServiceClock;
|
|
37
|
+
}
|
|
38
|
+
export declare class QaAdminService {
|
|
39
|
+
private readonly options;
|
|
40
|
+
private readonly redactor;
|
|
41
|
+
private readonly transcripts;
|
|
42
|
+
constructor(options: QaAdminServiceOptions);
|
|
43
|
+
private requireAccounts;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve the caller and check one permission. The refusal carries the shared
|
|
46
|
+
* `forbidden` reason, so a browser shows the same audience-safe copy for
|
|
47
|
+
* every administrative surface it may not open.
|
|
48
|
+
*/
|
|
49
|
+
private require;
|
|
50
|
+
/**
|
|
51
|
+
* The deployment's conversation index: one row per reserved QA session,
|
|
52
|
+
* enriched with the stored header when the deployment can list one. A chat
|
|
53
|
+
* that exists but has no readable log still appears — the reviewer must see
|
|
54
|
+
* that it happened.
|
|
55
|
+
*/
|
|
56
|
+
private index;
|
|
57
|
+
/** One conversation's projected log, cached for the TTL unless asked fresh. */
|
|
58
|
+
private transcript;
|
|
59
|
+
private facts;
|
|
60
|
+
overview(token: string): Promise<QaAdminOverview>;
|
|
61
|
+
metrics(token: string): Promise<QaQualityMetrics>;
|
|
62
|
+
private metricsOf;
|
|
63
|
+
/** One attention line per condition worth an administrator's time. */
|
|
64
|
+
private alertsOf;
|
|
65
|
+
users(token: string, query: QaUserQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaAdminUserRow>>;
|
|
66
|
+
user(token: string, userId: string): Promise<QaAdminUserDetail>;
|
|
67
|
+
updateUser(token: string, userId: string, update: QaAdminUserUpdate): Promise<QaAdminUserDetail>;
|
|
68
|
+
/**
|
|
69
|
+
* Refuse a write that would leave the deployment without a usable admin.
|
|
70
|
+
* Granting the admin role carries no such risk; demoting or disabling the
|
|
71
|
+
* last enabled administrator locks everyone out of the console.
|
|
72
|
+
*/
|
|
73
|
+
private assertAdminSurvives;
|
|
74
|
+
/** Validate an assignment against the enabled roles before storing it. */
|
|
75
|
+
private exactAssignment;
|
|
76
|
+
conversations(token: string, query: QaConversationQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaConversationSummary>>;
|
|
77
|
+
private summaryOf;
|
|
78
|
+
conversation(token: string, conversationId: string): Promise<QaConversationDetail>;
|
|
79
|
+
private failuresOf;
|
|
80
|
+
private failureSignals;
|
|
81
|
+
/**
|
|
82
|
+
* Record the caller's verdict on one assistant message. The conversation must
|
|
83
|
+
* be the caller's own: a rating is the user's own signal, and nobody rates
|
|
84
|
+
* someone else's answer on their behalf.
|
|
85
|
+
*/
|
|
86
|
+
rateMessage(token: string, conversationId: string, messageId: string, input: QaMessageFeedbackInput): QaMessageFeedback;
|
|
87
|
+
feedback(token: string, query: QaFeedbackQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaFeedbackRow>>;
|
|
88
|
+
private feedbackRows;
|
|
89
|
+
private queueRows;
|
|
90
|
+
reviewQueue(token: string, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaReviewQueueRow>>;
|
|
91
|
+
/** Park a conversation for review without rating it. */
|
|
92
|
+
queueConversation(token: string, conversationId: string, messageId: string | undefined): QaReviewQueueItem;
|
|
93
|
+
/** Save a reviewer's verdict, and take the item out of the queue when done. */
|
|
94
|
+
saveReview(token: string, input: QaConversationReviewInput): QaConversationReview;
|
|
95
|
+
/**
|
|
96
|
+
* The audit trail as one table. Two writers keep records — the capability
|
|
97
|
+
* service, whose repository predates the console, and the quality store —
|
|
98
|
+
* and an administrator expects one timeline, so both are normalized here.
|
|
99
|
+
*/
|
|
100
|
+
audit(token: string, query: QaAuditQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaAdminAuditEvent>>;
|
|
101
|
+
/** Capability-policy events, reshaped into the console's audit vocabulary. */
|
|
102
|
+
private accessAuditEvents;
|
|
103
|
+
}
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { QaTranscriptUnavailableReason } from "../types.js";
|
|
3
|
+
import type { StoredSessionEvent } from "./conversation-log.js";
|
|
4
|
+
/**
|
|
5
|
+
* Read access to the deployment's conversations.
|
|
6
|
+
*
|
|
7
|
+
* Two sources, because neither alone is complete:
|
|
8
|
+
*
|
|
9
|
+
* - Durable storage (`ctx.sessionQuery`) owns history — every conversation a
|
|
10
|
+
* deployment ever had, including the ones this process never opened. Its
|
|
11
|
+
* concrete backend is a deployment choice, so the service is read off the
|
|
12
|
+
* context at call time and described structurally: the QA bundle must keep
|
|
13
|
+
* loading on a deployment that serves no query engine.
|
|
14
|
+
* - The live session store (`ctx.sessions`) owns the chats running right now.
|
|
15
|
+
* It is the one source that always exists, and it is what a chat becomes the
|
|
16
|
+
* moment its first message is appended.
|
|
17
|
+
*
|
|
18
|
+
* Reads never throw for an unavailable backend: the caller gets a reason, so
|
|
19
|
+
* the review viewer can say why a transcript is missing instead of failing the
|
|
20
|
+
* whole page.
|
|
21
|
+
*/
|
|
22
|
+
export interface QaStoredSessionHeader {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/** Epoch milliseconds, as the session header records it. */
|
|
25
|
+
readonly createdAt: number;
|
|
26
|
+
readonly cwd?: string;
|
|
27
|
+
/** Set on a subagent's session; such sessions are not conversations. */
|
|
28
|
+
readonly parentSessionId?: string;
|
|
29
|
+
readonly agentPreset?: string;
|
|
30
|
+
}
|
|
31
|
+
export type QaSessionReadResult = {
|
|
32
|
+
readonly ok: true;
|
|
33
|
+
readonly events: readonly StoredSessionEvent[];
|
|
34
|
+
} | {
|
|
35
|
+
readonly ok: false;
|
|
36
|
+
readonly reason: QaTranscriptUnavailableReason;
|
|
37
|
+
};
|
|
38
|
+
export interface QaSessionLogReader {
|
|
39
|
+
list(): Promise<readonly QaStoredSessionHeader[]>;
|
|
40
|
+
read(sessionId: string): Promise<QaSessionReadResult>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the reader for one plugin instance. The services are looked up per
|
|
44
|
+
* call rather than captured: a cordis provider is only visible once its fiber
|
|
45
|
+
* is active, and a reference taken at construction time would stay dead.
|
|
46
|
+
*/
|
|
47
|
+
export declare function createSessionLogReader(ctx: Context): QaSessionLogReader;
|
|
48
|
+
/** A reader over an explicit set of logs; the tests' seam, and the empty default. */
|
|
49
|
+
export declare function staticSessionLogReader(input: {
|
|
50
|
+
readonly sessions?: readonly QaStoredSessionHeader[];
|
|
51
|
+
readonly events?: Readonly<Record<string, readonly StoredSessionEvent[]>>;
|
|
52
|
+
}): QaSessionLogReader;
|
|
53
|
+
//# sourceMappingURL=session-log.d.ts.map
|
|
@@ -46,6 +46,9 @@ export interface QaSessionControllerOptions {
|
|
|
46
46
|
readonly fileUpload?: () => QaFileUpload | undefined;
|
|
47
47
|
/** Present while the deployment gates QA users with accounts. */
|
|
48
48
|
readonly accounts?: QaAccountsFacade;
|
|
49
|
+
/** Server-validated role requested for newly materialized sessions. */
|
|
50
|
+
readonly initialSubrole?: string | null;
|
|
51
|
+
readonly adminPreview?: boolean;
|
|
49
52
|
readonly timeoutMs?: number;
|
|
50
53
|
/**
|
|
51
54
|
* Minimum spacing between projections of a running turn's stream frames.
|
|
@@ -101,6 +104,8 @@ export declare class QaSessionController {
|
|
|
101
104
|
private disposed;
|
|
102
105
|
private generation;
|
|
103
106
|
private chatsRevision;
|
|
107
|
+
private selectedSubrole;
|
|
108
|
+
private adminPreview;
|
|
104
109
|
/** Host-side provenance of the bound chat, merged into the projection. */
|
|
105
110
|
private readonly hostSources;
|
|
106
111
|
/** Host-side approvals of the bound chat waiting for the operator. */
|
|
@@ -113,6 +118,12 @@ export declare class QaSessionController {
|
|
|
113
118
|
getSnapshot: () => QaSessionState;
|
|
114
119
|
subscribe: (listener: () => void) => (() => void);
|
|
115
120
|
ensureSession(): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Select a different capability profile for the next agent. The current
|
|
123
|
+
* agent is never mutated: even a blank materialized chat is abandoned in
|
|
124
|
+
* favor of a fresh Host-owned session.
|
|
125
|
+
*/
|
|
126
|
+
selectSubrole(subroleId: string, adminPreview?: boolean): Promise<void>;
|
|
116
127
|
send(text: string, attachments?: readonly QaAttachmentDraft[]): Promise<boolean>;
|
|
117
128
|
/** Publish a browser-only copy before any network or Host admission awaits. */
|
|
118
129
|
private beginSubmission;
|
|
@@ -131,7 +142,7 @@ export declare class QaSessionController {
|
|
|
131
142
|
* until the first prompt is actually sent, which materializes the session
|
|
132
143
|
* lazily ({@link materializeDraft}). Fixed-policy deployments cannot draft.
|
|
133
144
|
*/
|
|
134
|
-
startDraft(): Promise<void>;
|
|
145
|
+
startDraft(policyChange?: boolean): Promise<void>;
|
|
135
146
|
/**
|
|
136
147
|
* Turn the current draft into a real attested session. Runs inside the
|
|
137
148
|
* send flow; concurrent sends share one materialization. A refusal here is
|
|
@@ -3,7 +3,7 @@ import type { InjectFace, PropsRenderSlots, PropsRuntime } from "@deepseek-ai/ds
|
|
|
3
3
|
import type { QaConfigController } from "./QaConfigController.js";
|
|
4
4
|
import type { QaRouteController } from "./QaRouteController.js";
|
|
5
5
|
import type { QaAccountsController } from "./QaAccountsController.js";
|
|
6
|
-
import type { QaApprovalApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSkillApi, QaSourceApi } from "./types.js";
|
|
6
|
+
import type { QaApprovalApi, QaAccessApi, QaAdminApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSkillApi, QaSourceApi } from "./types.js";
|
|
7
7
|
import type { QaSurfacePanelRegistry } from "./panels/registry.js";
|
|
8
8
|
import type { QaUserSettingsSections } from "./settings-extensions/index.js";
|
|
9
9
|
export interface QaSurfaceFace {
|
|
@@ -15,6 +15,12 @@ export interface QaSurfaceFace {
|
|
|
15
15
|
readonly connection: ConnectionGenerationState;
|
|
16
16
|
readonly secureSession: QaSecureSession;
|
|
17
17
|
readonly createSession: QaCreateSession;
|
|
18
|
+
readonly accessApi: QaAccessApi;
|
|
19
|
+
/**
|
|
20
|
+
* The administrative console's surface. Optional so an older Host that does
|
|
21
|
+
* not answer it still renders the capability editors.
|
|
22
|
+
*/
|
|
23
|
+
readonly adminApi?: QaAdminApi;
|
|
18
24
|
readonly sourceApi: QaSourceApi;
|
|
19
25
|
/**
|
|
20
26
|
* Personal-skill half of the plugin's namespace. Absent on a page whose Host
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { QaAccountRole, QaSubrole } from "../../types.js";
|
|
2
|
+
import type { QaAccessApi, QaAdminApi } from "../types.js";
|
|
3
|
+
export declare function QaAdmin(props: {
|
|
4
|
+
/** Capability administration; the access service's own wire surface. */
|
|
5
|
+
readonly api: QaAccessApi;
|
|
6
|
+
/**
|
|
7
|
+
* The console's own surface. A deployment that serves only the chat surface
|
|
8
|
+
* has no accounts, so the console falls back to the role editors.
|
|
9
|
+
*/
|
|
10
|
+
readonly adminApi?: QaAdminApi;
|
|
11
|
+
readonly token: string;
|
|
12
|
+
readonly routePath: string;
|
|
13
|
+
/** The signed-in account's role, used only to filter the navigation. */
|
|
14
|
+
readonly role?: QaAccountRole;
|
|
15
|
+
readonly onPreview: (role: QaSubrole) => void;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=QaAdmin.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { QaAccountRole, QaFeedbackReason, QaQualityIssueType, QaQualitySeverity, QaRemediationTarget, QaReviewPriority, QaReviewStatus, QaTranscriptUnavailableReason } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Russian copy for the console's vocabulary. Kept in one module so the pages
|
|
4
|
+
* stay about layout, and so the wording an operator sees is edited in one
|
|
5
|
+
* place rather than hunted across components.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ADMIN_ROLE_LABELS: Readonly<Record<QaAccountRole, string>>;
|
|
8
|
+
export declare const FEEDBACK_RATING_LABELS: {
|
|
9
|
+
readonly positive: "Полезно";
|
|
10
|
+
readonly negative: "Проблема";
|
|
11
|
+
};
|
|
12
|
+
export declare const FEEDBACK_REASON_LABELS: Readonly<Record<QaFeedbackReason, string>>;
|
|
13
|
+
export declare const REVIEW_STATUS_LABELS: Readonly<Record<QaReviewStatus, string>>;
|
|
14
|
+
export declare const REVIEW_PRIORITY_LABELS: Readonly<Record<QaReviewPriority, string>>;
|
|
15
|
+
export declare const REVIEW_REASON_LABELS: {
|
|
16
|
+
readonly negative_feedback: "Негативная оценка";
|
|
17
|
+
readonly manual: "Отправлено на разбор";
|
|
18
|
+
readonly tool_failure: "Сбой инструмента";
|
|
19
|
+
readonly automatic: "Автоматически";
|
|
20
|
+
};
|
|
21
|
+
export declare const SEVERITY_LABELS: Readonly<Record<QaQualitySeverity, string>>;
|
|
22
|
+
/**
|
|
23
|
+
* Issue labels grouped by the taxonomy's own branches (spec §21). The groups
|
|
24
|
+
* are only a rendering concern: issue ids stay flat so aggregations never walk
|
|
25
|
+
* a tree.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ISSUE_GROUPS: readonly {
|
|
28
|
+
readonly title: string;
|
|
29
|
+
readonly issues: readonly QaQualityIssueType[];
|
|
30
|
+
}[];
|
|
31
|
+
export declare const ISSUE_LABELS: Readonly<Record<QaQualityIssueType, string>>;
|
|
32
|
+
export declare const TARGET_LABELS: Readonly<Record<QaRemediationTarget, string>>;
|
|
33
|
+
export declare const TRANSCRIPT_UNAVAILABLE_LABELS: Readonly<Record<QaTranscriptUnavailableReason, string>>;
|
|
34
|
+
/** Percent, or a dash when there is nothing to take a share of. */
|
|
35
|
+
export declare function formatRate(value: number | null): string;
|
|
36
|
+
/** Local date and time of an ISO stamp, or a dash for an unusable value. */
|
|
37
|
+
export declare function formatStamp(iso: string | undefined): string;
|
|
38
|
+
/** Coarse "how long ago", which is what a triage list needs. */
|
|
39
|
+
export declare function formatRelative(iso: string, now?: number): string;
|
|
40
|
+
/** Milliseconds as a short duration; tool timings are second-scale. */
|
|
41
|
+
export declare function formatDuration(ms: number | undefined): string;
|
|
42
|
+
export declare function formatCount(value: number): string;
|
|
43
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QaAdminApi } from "../../types.js";
|
|
2
|
+
export declare function AdminConversations(props: {
|
|
3
|
+
readonly api: QaAdminApi;
|
|
4
|
+
readonly token: string;
|
|
5
|
+
readonly userId?: string;
|
|
6
|
+
readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The review viewer: the conversation as it happened, next to the reviewer's
|
|
10
|
+
* form. Tool calls collapse by default — a reviewer looking for "the tool
|
|
11
|
+
* failed" should not have to scroll past every argument to find it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AdminConversation(props: {
|
|
14
|
+
readonly api: QaAdminApi;
|
|
15
|
+
readonly token: string;
|
|
16
|
+
readonly conversationId: string;
|
|
17
|
+
readonly messageId?: string;
|
|
18
|
+
readonly canReview: boolean;
|
|
19
|
+
readonly onBack: () => void;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=Conversations.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { QaReviewQueueRow } from "../../../types.js";
|
|
2
|
+
import type { QaAdminApi } from "../../types.js";
|
|
3
|
+
export declare function AdminOverview(props: {
|
|
4
|
+
readonly api: QaAdminApi;
|
|
5
|
+
readonly token: string;
|
|
6
|
+
readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
|
|
7
|
+
readonly onOpenQueue: () => void;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function QueuePreview(props: {
|
|
10
|
+
readonly rows: readonly QaReviewQueueRow[];
|
|
11
|
+
readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=Overview.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { QaAdminApi } from "../../types.js";
|
|
2
|
+
/** The feedback table: every rating against the exact answer it judged. */
|
|
3
|
+
export declare function AdminFeedback(props: {
|
|
4
|
+
readonly api: QaAdminApi;
|
|
5
|
+
readonly token: string;
|
|
6
|
+
readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/** Issue distribution, per-subrole satisfaction and the trend over time. */
|
|
9
|
+
export declare function AdminQuality(props: {
|
|
10
|
+
readonly api: QaAdminApi;
|
|
11
|
+
readonly token: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/** Every administrative action, newest first, from both writers. */
|
|
14
|
+
export declare function AdminAudit(props: {
|
|
15
|
+
readonly api: QaAdminApi;
|
|
16
|
+
readonly token: string;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Quality.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QaConversationDetail } from "../../../types.js";
|
|
2
|
+
import type { QaAdminApi } from "../../types.js";
|
|
3
|
+
export declare function AdminReviewQueue(props: {
|
|
4
|
+
readonly api: QaAdminApi;
|
|
5
|
+
readonly token: string;
|
|
6
|
+
readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ReviewPanel(props: {
|
|
9
|
+
readonly api: QaAdminApi;
|
|
10
|
+
readonly token: string;
|
|
11
|
+
readonly detail: QaConversationDetail;
|
|
12
|
+
readonly canReview: boolean;
|
|
13
|
+
readonly onSaved: () => void;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=Review.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { QaAdminApi, QaAccessApi } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Users: the table an administrator triages from, and the detail page that
|
|
4
|
+
* separates authorization from the QA subrole assignment — an admin may work
|
|
5
|
+
* as an analyst without that saying anything about their administrative reach.
|
|
6
|
+
*/
|
|
7
|
+
export declare function AdminUsers(props: {
|
|
8
|
+
readonly api: QaAdminApi;
|
|
9
|
+
readonly token: string;
|
|
10
|
+
readonly onOpenUser: (userId: string) => void;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/** Authorization, assignment and the activity counters of one account. */
|
|
13
|
+
export declare function AdminUserDetail(props: {
|
|
14
|
+
readonly api: QaAdminApi;
|
|
15
|
+
readonly accessApi: QaAccessApi;
|
|
16
|
+
readonly token: string;
|
|
17
|
+
readonly userId: string;
|
|
18
|
+
readonly onBack: () => void;
|
|
19
|
+
readonly onOpenAudit: () => void;
|
|
20
|
+
readonly onOpenConversations: (userId: string) => void;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=Users.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The admin console's route model.
|
|
3
|
+
*
|
|
4
|
+
* The console lives under one host route (`/qa/admin`) and gives every entity
|
|
5
|
+
* with its own identity its own path, because a review finding is something
|
|
6
|
+
* people paste into a chat. Parsing and serializing live here, away from the
|
|
7
|
+
* components, so the mapping is testable without a DOM.
|
|
8
|
+
*/
|
|
9
|
+
export type QaAdminRoute = {
|
|
10
|
+
readonly page: "overview";
|
|
11
|
+
} | {
|
|
12
|
+
readonly page: "users";
|
|
13
|
+
} | {
|
|
14
|
+
readonly page: "user";
|
|
15
|
+
readonly userId: string;
|
|
16
|
+
} | {
|
|
17
|
+
readonly page: "subroles";
|
|
18
|
+
} | {
|
|
19
|
+
readonly page: "skills";
|
|
20
|
+
} | {
|
|
21
|
+
readonly page: "common";
|
|
22
|
+
} | {
|
|
23
|
+
readonly page: "conversations";
|
|
24
|
+
} | {
|
|
25
|
+
readonly page: "conversation";
|
|
26
|
+
readonly conversationId: string;
|
|
27
|
+
/** Deep link to one message inside the conversation (spec §34). */
|
|
28
|
+
readonly messageId?: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly page: "review";
|
|
31
|
+
} | {
|
|
32
|
+
readonly page: "feedback";
|
|
33
|
+
} | {
|
|
34
|
+
readonly page: "quality";
|
|
35
|
+
} | {
|
|
36
|
+
readonly page: "audit";
|
|
37
|
+
};
|
|
38
|
+
/** Path segments after `/qa/admin`, without the leading slash. */
|
|
39
|
+
export declare function adminSegments(pathname: string, routePath: string): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a pathname into a console route. Unknown segments fall back to the
|
|
42
|
+
* section they live under rather than to an error page: a stale link should
|
|
43
|
+
* still land the reviewer somewhere useful.
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseAdminRoute(pathname: string, routePath: string): QaAdminRoute;
|
|
46
|
+
/** The pathname for one console route; the inverse of {@link parseAdminRoute}. */
|
|
47
|
+
export declare function adminPath(routePath: string, route: QaAdminRoute, search?: string): string;
|
|
48
|
+
/** Which navigation entry is current for one route. */
|
|
49
|
+
export declare function adminSectionOf(route: QaAdminRoute): "overview" | "users" | "access" | "conversations" | "review" | "feedback" | "quality" | "audit";
|
|
50
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { RemoteResult } from "../types.js";
|
|
2
|
+
/** The audience-safe text of a refused Remote call. */
|
|
3
|
+
export declare function errorMessage(error: unknown): string;
|
|
4
|
+
/**
|
|
5
|
+
* The refusal copy a console page shows. The Host sends a coarse reason code
|
|
6
|
+
* on the wire and nothing else, so the wording lives here — one place to edit,
|
|
7
|
+
* and no deployment detail leaks into the browser.
|
|
8
|
+
*/
|
|
9
|
+
export declare function adminErrorMessage(error: unknown): string;
|
|
10
|
+
/**
|
|
11
|
+
* Load one administrative resource, keeping the previous value visible while
|
|
12
|
+
* it refreshes. Reviewers page through lists while new conversations arrive;
|
|
13
|
+
* blanking the table on every reload would make that unusable.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useAdminResource<T>(load: () => Promise<RemoteResult<T>>, deps: readonly unknown[]): {
|
|
16
|
+
readonly data: T | undefined;
|
|
17
|
+
readonly error: string | undefined;
|
|
18
|
+
readonly loading: boolean;
|
|
19
|
+
reload: () => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
/** A status chip; the modifier class carries the semantic colour. */
|
|
22
|
+
export declare function Badge(props: {
|
|
23
|
+
readonly tone?: "neutral" | "positive" | "negative" | "warning";
|
|
24
|
+
readonly children: React.ReactNode;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function Empty(props: {
|
|
27
|
+
readonly children: React.ReactNode;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
/** A relative timestamp with the exact one available on hover. */
|
|
30
|
+
export declare function Stamp(props: {
|
|
31
|
+
readonly value: string | undefined;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function ErrorLine(props: {
|
|
34
|
+
readonly message: string | undefined;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
36
|
+
/**
|
|
37
|
+
* Cursor paging controls. The cursor is opaque to the browser by design: only
|
|
38
|
+
* the Host knows how a page was cut.
|
|
39
|
+
*/
|
|
40
|
+
export declare function Pager(props: {
|
|
41
|
+
readonly total: number;
|
|
42
|
+
readonly shown: number;
|
|
43
|
+
readonly hasMore: boolean;
|
|
44
|
+
readonly loading: boolean;
|
|
45
|
+
readonly onMore: () => void;
|
|
46
|
+
readonly onReset: () => void;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
/** One labeled filter control in a table toolbar. */
|
|
49
|
+
export declare function FilterField(props: {
|
|
50
|
+
readonly label: string;
|
|
51
|
+
readonly children: React.ReactNode;
|
|
52
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The administrative console's stylesheet. Colors come only from the QA
|
|
3
|
+
* palette tokens or the host's themed aliases, so light, dark and system themes
|
|
4
|
+
* stay coherent; the stylesheet test enforces that rule.
|
|
5
|
+
*
|
|
6
|
+
* Layout intent: a dense table surface for triage, a side panel for the review
|
|
7
|
+
* form, and no modal windows — the console is a place to work through a list,
|
|
8
|
+
* not a wizard.
|
|
9
|
+
*/
|
|
10
|
+
export declare const QA_ADMIN_CONSOLE_STYLES: string;
|
|
11
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -21,6 +21,10 @@ export interface QaHeaderProps {
|
|
|
21
21
|
readonly viewingSubagent: boolean;
|
|
22
22
|
readonly onCloseSubagent: () => void;
|
|
23
23
|
readonly agentPreset: string | null;
|
|
24
|
+
readonly roleSelector?: ReactNode;
|
|
25
|
+
readonly administration?: {
|
|
26
|
+
readonly onOpen: () => void;
|
|
27
|
+
};
|
|
24
28
|
readonly agentCount: number;
|
|
25
29
|
readonly agentsOpen: boolean;
|
|
26
30
|
/** Toggles the agents drawer; also closes the right rail. */
|
|
@@ -39,5 +43,5 @@ export interface QaHeaderProps {
|
|
|
39
43
|
readonly resetDisabled: boolean;
|
|
40
44
|
readonly onReset: () => void;
|
|
41
45
|
}
|
|
42
|
-
export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent, agentPreset, agentCount, agentsOpen, onToggleAgents, sourcesVisible, sourcesCount, sourcesComplete, sourcesOpen, onOpenSources, fileCount, filesOpen, onOpenFiles, panelLauncher, showReset, resetDisabled, onReset, }: QaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent, agentPreset, roleSelector, administration, agentCount, agentsOpen, onToggleAgents, sourcesVisible, sourcesCount, sourcesComplete, sourcesOpen, onOpenSources, fileCount, filesOpen, onOpenFiles, panelLauncher, showReset, resetDisabled, onReset, }: QaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
43
47
|
//# sourceMappingURL=QaHeader.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { QaMessage as QaMessageModel, QaSource, QaTurnSources } from "../../types.js";
|
|
2
|
+
import type { QaFeedbackReason } from "../../types.js";
|
|
2
3
|
export interface QaMessageProps {
|
|
3
4
|
readonly message: QaMessageModel;
|
|
4
5
|
readonly renderMarkdown: boolean;
|
|
@@ -18,6 +19,18 @@ export interface QaMessageProps {
|
|
|
18
19
|
readonly onSourceDetail?: (source: QaSource) => void;
|
|
19
20
|
/** Operator-configured running phrases; omitted reads the built-in list. */
|
|
20
21
|
readonly thinkingPhrases?: readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* Persist a rating for this answer. Omitted on a surface with no accounts or
|
|
24
|
+
* no durable message identity: the control then only records the choice
|
|
25
|
+
* locally, which is what the standalone QA surface has always done.
|
|
26
|
+
*/
|
|
27
|
+
readonly onRateFeedback?: (input: {
|
|
28
|
+
/** Durable log position of this answer, when the transcript knows it. */
|
|
29
|
+
readonly messageId?: number;
|
|
30
|
+
readonly rating: "positive" | "negative";
|
|
31
|
+
readonly reasons?: readonly QaFeedbackReason[];
|
|
32
|
+
readonly comment?: string;
|
|
33
|
+
}) => void;
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
36
|
* Whether two transcript messages render identically. The transcript
|
|
@@ -26,5 +39,5 @@ export interface QaMessageProps {
|
|
|
26
39
|
* comparison is by value, which keeps fresh copies cheap to recognize.
|
|
27
40
|
*/
|
|
28
41
|
export declare function sameMessage(a: QaMessageModel, b: QaMessageModel): boolean;
|
|
29
|
-
export declare const QaMessage: import("react").MemoExoticComponent<({ message, renderMarkdown, showTimestamp, stateKey, onRegenerate, resolveImage, onOpenSources, onSourceDetail, thinkingPhrases, }: QaMessageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
42
|
+
export declare const QaMessage: import("react").MemoExoticComponent<({ message, renderMarkdown, showTimestamp, stateKey, onRegenerate, resolveImage, onOpenSources, onSourceDetail, thinkingPhrases, onRateFeedback, }: QaMessageProps) => import("react/jsx-runtime").JSX.Element>;
|
|
30
43
|
//# sourceMappingURL=QaMessage.d.ts.map
|
|
@@ -9,5 +9,7 @@ import type { QaCreateSession } from "./types.js";
|
|
|
9
9
|
export declare function createQaSession(args: {
|
|
10
10
|
readonly createSession: QaCreateSession;
|
|
11
11
|
readonly token: string;
|
|
12
|
+
readonly subroleId: string | null;
|
|
13
|
+
readonly adminPreview: boolean;
|
|
12
14
|
}): Promise<string>;
|
|
13
15
|
//# sourceMappingURL=create-session.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { QaSubrole } from "../../types.js";
|
|
2
|
+
export interface QaRoleSelectorProps {
|
|
3
|
+
readonly roles: readonly QaSubrole[];
|
|
4
|
+
readonly selected: string;
|
|
5
|
+
readonly conversationStarted: boolean;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
readonly onSelect: (subroleId: string) => void;
|
|
8
|
+
}
|
|
9
|
+
/** Visible only when the account can actually choose between profiles. */
|
|
10
|
+
export declare function QaRoleSelector(props: QaRoleSelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function QaAdminPreviewBanner({ role }: {
|
|
12
|
+
readonly role: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=RoleSelector.d.ts.map
|
|
@@ -12,6 +12,8 @@ export declare class QaHostSourceBridge {
|
|
|
12
12
|
private bundles;
|
|
13
13
|
private signature;
|
|
14
14
|
private refreshing;
|
|
15
|
+
/** The refusal already reported, so a repeating failure reaches the console once. */
|
|
16
|
+
private refusal;
|
|
15
17
|
/** Bumped on reset so a stale in-flight fetch never lands. */
|
|
16
18
|
private generation;
|
|
17
19
|
constructor(sourceApi: QaSourceApi, token: () => string);
|
|
@@ -22,6 +24,13 @@ export declare class QaHostSourceBridge {
|
|
|
22
24
|
* Fetch the Host bundles of one chat; a changed payload republishes through
|
|
23
25
|
* the callback. Repeated calls coalesce while one is in flight, and a
|
|
24
26
|
* response that outlives the chat is dropped.
|
|
27
|
+
*
|
|
28
|
+
* A refused fetch is not the same fact as an empty bundle set: the panel
|
|
29
|
+
* renders both as "this answer carries no sources", so without a word here a
|
|
30
|
+
* rejected RPC — an unattested chat, a token the Host no longer accepts —
|
|
31
|
+
* would be indistinguishable from a chat that genuinely has none. The
|
|
32
|
+
* refusal is reported once per distinct reason, because this runs on every
|
|
33
|
+
* publish.
|
|
25
34
|
*/
|
|
26
35
|
refresh(sessionId: string, onChanged: () => void): Promise<void>;
|
|
27
36
|
}
|