@yadsh/dsh-qa-surface 0.15.6 → 0.16.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 +8 -0
- package/lib/access/capability-catalog.js +11 -4
- package/lib/access/capability-catalog.js.map +1 -1
- package/lib/access/service.js +46 -5
- package/lib/access/service.js.map +1 -1
- package/lib/accounts/store.js +2 -2
- package/lib/accounts/store.js.map +1 -1
- package/lib/admin/service.js +4 -2
- package/lib/admin/service.js.map +1 -1
- package/lib/admin/session-log.js +3 -0
- package/lib/admin/session-log.js.map +1 -1
- package/lib/agent-scope.js +9 -0
- package/lib/agent-scope.js.map +1 -0
- package/lib/chat-sharing/native-fence.js +111 -0
- package/lib/chat-sharing/native-fence.js.map +1 -0
- package/lib/chat-sharing/resources.js +57 -0
- package/lib/chat-sharing/resources.js.map +1 -0
- package/lib/chat-sharing/store.js +193 -0
- package/lib/chat-sharing/store.js.map +1 -0
- package/lib/chat-sharing/transport.js +274 -0
- package/lib/chat-sharing/transport.js.map +1 -0
- package/lib/chat-sharing/turn-guard.js +154 -0
- package/lib/chat-sharing/turn-guard.js.map +1 -0
- package/lib/chat-sharing/types.js +2 -0
- package/lib/chat-sharing/types.js.map +1 -0
- package/lib/chat-sharing/uploads.js +55 -0
- package/lib/chat-sharing/uploads.js.map +1 -0
- package/lib/client/QaAccountsController.js +29 -2
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaConfigController.js +7 -12
- package/lib/client/QaConfigController.js.map +1 -1
- package/lib/client/QaSessionController.js +186 -19
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +110 -9
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaSurfaceGuard.js +6 -1
- package/lib/client/QaSurfaceGuard.js.map +1 -1
- package/lib/client/QaTranscriptAdapter.js +13 -3
- package/lib/client/QaTranscriptAdapter.js.map +1 -1
- package/lib/client/account-conversation.js +33 -0
- package/lib/client/account-conversation.js.map +1 -0
- package/lib/client/account-sessions.js +106 -0
- package/lib/client/account-sessions.js.map +1 -0
- package/lib/client/account-upload.js +30 -0
- package/lib/client/account-upload.js.map +1 -0
- package/lib/client/chat-artifacts.js +17 -3
- package/lib/client/chat-artifacts.js.map +1 -1
- package/lib/client/chat-sharing-api.js +2 -0
- package/lib/client/chat-sharing-api.js.map +1 -0
- package/lib/client/components/QaChangelog.js +70 -3
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaChatSharing.js +92 -0
- package/lib/client/components/QaChatSharing.js.map +1 -0
- package/lib/client/components/QaComposer.js +8 -4
- package/lib/client/components/QaComposer.js.map +1 -1
- package/lib/client/components/QaFileAttachment.js +12 -3
- package/lib/client/components/QaFileAttachment.js.map +1 -1
- package/lib/client/components/QaFilesPanel.js +11 -4
- package/lib/client/components/QaFilesPanel.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 +34 -9
- package/lib/client/components/QaMessage.js.map +1 -1
- package/lib/client/components/QaSidebar.js +1 -1
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaSourcesPanel.js +12 -4
- package/lib/client/components/QaSourcesPanel.js.map +1 -1
- package/lib/client/components/QaWorkspaceBrowser.js +28 -7
- package/lib/client/components/QaWorkspaceBrowser.js.map +1 -1
- package/lib/client/components/source-refs.js +42 -23
- package/lib/client/components/source-refs.js.map +1 -1
- package/lib/client/index.js +60 -6
- package/lib/client/index.js.map +1 -1
- package/lib/client/lineage.js +4 -3
- package/lib/client/lineage.js.map +1 -1
- package/lib/client/markdown/katex-css.js +1 -1
- package/lib/client/markdown/render.js +3 -4
- package/lib/client/markdown/render.js.map +1 -1
- package/lib/client/markdown/source-chip.js +4 -1
- package/lib/client/markdown/source-chip.js.map +1 -1
- package/lib/client/notifications/notification-dispatcher.js +50 -11
- package/lib/client/notifications/notification-dispatcher.js.map +1 -1
- package/lib/client/notifications/use-turn-notifications.js +107 -18
- package/lib/client/notifications/use-turn-notifications.js.map +1 -1
- package/lib/client/project-session-state.js +28 -13
- package/lib/client/project-session-state.js.map +1 -1
- package/lib/client/session-admission.js +9 -1
- package/lib/client/session-admission.js.map +1 -1
- package/lib/client/session-sources.js +44 -3
- package/lib/client/session-sources.js.map +1 -1
- package/lib/client/slash/useSlashNavigation.js +8 -5
- package/lib/client/slash/useSlashNavigation.js.map +1 -1
- package/lib/client/source-preview.js +1 -1
- package/lib/client/source-preview.js.map +1 -1
- package/lib/client/styles.js +9 -2
- package/lib/client/styles.js.map +1 -1
- package/lib/client/turn-sources.js +2 -1
- package/lib/client/turn-sources.js.map +1 -1
- package/lib/client/types.js.map +1 -1
- package/lib/client/workspace-download.js +42 -2
- package/lib/client/workspace-download.js.map +1 -1
- package/lib/client.js +3337 -947
- package/lib/client.js.map +1 -1
- package/lib/enforcement/skill-policy.js +29 -4
- package/lib/enforcement/skill-policy.js.map +1 -1
- package/lib/enforcement/skill-resource-paths.js +32 -0
- package/lib/enforcement/skill-resource-paths.js.map +1 -0
- package/lib/enforcement/structured-result.js +38 -0
- package/lib/enforcement/structured-result.js.map +1 -0
- package/lib/enforcement/tool-grants.js +3 -1
- package/lib/enforcement/tool-grants.js.map +1 -1
- package/lib/index.js +403 -15
- package/lib/index.js.map +1 -1
- package/lib/prompt-notes.js +18 -1
- package/lib/prompt-notes.js.map +1 -1
- package/lib/provenance/collector.js +13 -1
- package/lib/provenance/collector.js.map +1 -1
- package/lib/provenance/connectors.js +32 -8
- package/lib/provenance/connectors.js.map +1 -1
- package/lib/provenance/dedupe.js +8 -1
- package/lib/provenance/dedupe.js.map +1 -1
- package/lib/provenance/document-preview.js +19 -1
- package/lib/provenance/document-preview.js.map +1 -1
- package/lib/provenance/extractors.js +67 -1
- package/lib/provenance/extractors.js.map +1 -1
- package/lib/provenance/file-download.js +56 -0
- package/lib/provenance/file-download.js.map +1 -0
- package/lib/provenance/file-preview.js +12 -1
- package/lib/provenance/file-preview.js.map +1 -1
- package/lib/provenance/host-store.js +59 -10
- package/lib/provenance/host-store.js.map +1 -1
- package/lib/provenance/integration-extractor.js +63 -0
- package/lib/provenance/integration-extractor.js.map +1 -0
- package/lib/qa-tools/docs-tools.js +14 -0
- package/lib/qa-tools/docs-tools.js.map +1 -1
- package/lib/secure-session.js +37 -5
- package/lib/secure-session.js.map +1 -1
- package/lib/session-fork-host.js +157 -0
- package/lib/session-fork-host.js.map +1 -0
- package/lib/session-fork.js +34 -0
- package/lib/session-fork.js.map +1 -0
- package/lib/session-ownership.js +5 -1
- package/lib/session-ownership.js.map +1 -1
- package/lib/shared/session-lineage.js +6 -0
- package/lib/shared/session-lineage.js.map +1 -0
- package/lib/slash/draft-target.js +21 -0
- package/lib/slash/draft-target.js.map +1 -0
- package/lib/slash/remotes.js +39 -4
- package/lib/slash/remotes.js.map +1 -1
- package/lib/typert.host.js +1628 -231
- package/lib/typert.remote-client.d.ts +48 -1
- package/lib/typert.remote-client.js +1436 -193
- package/lib/types/access/capability-catalog.d.ts +1 -1
- package/lib/types/access/service.d.ts +7 -0
- package/lib/types/access.js +2 -0
- package/lib/types/access.js.map +1 -0
- package/lib/types/accounts/store.d.ts +1 -1
- package/lib/types/accounts.js +2 -0
- package/lib/types/accounts.js.map +1 -0
- package/lib/types/admin/session-log.d.ts +2 -0
- package/lib/types/admin.js +2 -0
- package/lib/types/admin.js.map +1 -0
- package/lib/types/agent-scope.d.ts +4 -0
- package/lib/types/capability.js +2 -0
- package/lib/types/capability.js.map +1 -0
- package/lib/types/chat-sharing/native-fence.d.ts +11 -0
- package/lib/types/chat-sharing/resources.d.ts +5 -0
- package/lib/types/chat-sharing/store.d.ts +28 -0
- package/lib/types/chat-sharing/transport.d.ts +31 -0
- package/lib/types/chat-sharing/turn-guard.d.ts +21 -0
- package/lib/types/chat-sharing/types.d.ts +25 -0
- package/lib/types/chat-sharing/uploads.d.ts +5 -0
- package/lib/types/client/QaAccountsController.d.ts +3 -0
- package/lib/types/client/QaConfigController.d.ts +3 -2
- package/lib/types/client/QaSessionController.d.ts +17 -3
- package/lib/types/client/QaSurface.d.ts +6 -1
- package/lib/types/client/account-conversation.d.ts +6 -0
- package/lib/types/client/account-sessions.d.ts +7 -0
- package/lib/types/client/account-upload.d.ts +15 -0
- package/lib/types/client/chat-sharing-api.d.ts +35 -0
- package/lib/types/client/components/QaChatSharing.d.ts +10 -0
- package/lib/types/client/components/QaComposer.d.ts +2 -0
- package/lib/types/client/components/QaFileAttachment.d.ts +3 -2
- package/lib/types/client/components/QaFilesPanel.d.ts +4 -1
- package/lib/types/client/components/QaMessage.d.ts +5 -2
- package/lib/types/client/components/QaWorkspaceBrowser.d.ts +8 -1
- package/lib/types/client/components/source-refs.d.ts +1 -0
- package/lib/types/client/lineage.d.ts +2 -2
- package/lib/types/client/notifications/notification-dispatcher.d.ts +10 -6
- package/lib/types/client/notifications/use-turn-notifications.d.ts +4 -0
- package/lib/types/client/project-session-state.d.ts +1 -0
- package/lib/types/client/session-admission.d.ts +2 -0
- package/lib/types/client/session-sources.d.ts +1 -0
- package/lib/types/client/turn-sources.d.ts +1 -1
- package/lib/types/client/types.d.ts +8 -1
- package/lib/types/client/workspace-download.d.ts +9 -1
- package/lib/types/config.js +2 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/documents.js +2 -0
- package/lib/types/documents.js.map +1 -0
- package/lib/types/enforcement/skill-resource-paths.d.ts +5 -0
- package/lib/types/enforcement/structured-result.d.ts +11 -0
- package/lib/types/expert-memory.js +2 -0
- package/lib/types/expert-memory.js.map +1 -0
- package/lib/types/index.d.ts +35 -1
- package/lib/types/policy.js +2 -0
- package/lib/types/policy.js.map +1 -0
- package/lib/types/prompt-notes.d.ts +2 -0
- package/lib/types/provenance/connectors.d.ts +4 -1
- package/lib/types/provenance/document-preview.d.ts +2 -0
- package/lib/types/provenance/extractors.d.ts +2 -0
- package/lib/types/provenance/file-download.d.ts +10 -0
- package/lib/types/provenance/host-store.d.ts +2 -0
- package/lib/types/provenance/integration-extractor.d.ts +5 -0
- package/lib/types/provenance/types.d.ts +2 -0
- package/lib/types/qa-tools/docs-tools.d.ts +2 -0
- package/lib/types/quality.js +7 -0
- package/lib/types/quality.js.map +1 -0
- package/lib/types/secure-session.d.ts +20 -1
- package/lib/types/session-fork-host.d.ts +27 -0
- package/lib/types/session-fork.d.ts +7 -0
- package/lib/types/session.js +2 -0
- package/lib/types/session.js.map +1 -0
- package/lib/types/shared/session-lineage.d.ts +7 -0
- package/lib/types/skills.js +2 -0
- package/lib/types/skills.js.map +1 -0
- package/lib/types/slash/draft-target.d.ts +7 -0
- package/lib/types/slash/remotes.d.ts +7 -0
- package/lib/types/slash.js +2 -0
- package/lib/types/slash.js.map +1 -0
- package/lib/types/types/access.d.ts +43 -0
- package/lib/types/types/accounts.d.ts +173 -0
- package/lib/types/types/admin.d.ts +286 -0
- package/lib/types/types/capability.d.ts +230 -0
- package/lib/types/types/config.d.ts +594 -0
- package/lib/types/types/documents.d.ts +34 -0
- package/lib/types/types/expert-memory.d.ts +35 -0
- package/lib/types/types/policy.d.ts +54 -0
- package/lib/types/types/quality.d.ts +100 -0
- package/lib/types/types/session.d.ts +382 -0
- package/lib/types/types/skills.d.ts +143 -0
- package/lib/types/types/slash.d.ts +159 -0
- package/lib/types/types.d.ts +13 -2180
- package/package.json +8 -7
package/lib/types/types.d.ts
CHANGED
|
@@ -1,2182 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
* How a tool policy `ask` resolves on an attested QA agent. `blocked` refuses
|
|
14
|
-
* the call with the surface's own reason; `interactive` parks it until the
|
|
15
|
-
* operator answers in the QA view.
|
|
16
|
-
*/
|
|
17
|
-
export type QaApprovalInteraction = "blocked" | "interactive";
|
|
18
|
-
/**
|
|
19
|
-
* How a user-questions request resolves on an attested QA agent. `unsupported`
|
|
20
|
-
* refuses the ask outright; `interactive` answers it from the QA view.
|
|
21
|
-
*/
|
|
22
|
-
export type QaQuestionInteraction = "unsupported" | "interactive";
|
|
23
|
-
/**
|
|
24
|
-
* What a deployment may write for the question seam. `enabled` is accepted as
|
|
25
|
-
* the spelling of `interactive` a feature request asked for; the resolved
|
|
26
|
-
* config carries one name only.
|
|
27
|
-
*/
|
|
28
|
-
export type QaQuestionInteractionInput = QaQuestionInteraction | "enabled";
|
|
29
|
-
/** The operator's answer to one parked tool call. */
|
|
30
|
-
export type QaApprovalDecision = "allowed-once" | "rejected";
|
|
31
|
-
/** One answered question; `custom` is free text, and may accompany `selected`. */
|
|
32
|
-
export interface QaQuestionAnswerItem {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly selected: readonly string[];
|
|
35
|
-
readonly custom?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Authorization inside QA Surface. It is deliberately independent of a QA
|
|
39
|
-
* subrole: an admin may work as any analyst profile while still holding the
|
|
40
|
-
* administrative permissions, and a reviewer answers conversations without
|
|
41
|
-
* being able to manage accounts.
|
|
42
|
-
*/
|
|
43
|
-
export type QaAccountRole = "user" | "reviewer" | "admin";
|
|
44
|
-
/** Administrative permissions a role grants; see `admin/permissions.ts`. */
|
|
45
|
-
export type QaPermission = "users.read" | "users.manage" | "roles.read" | "roles.manage" | "conversations.read.all" | "conversations.read.own" | "conversations.delete" | "reviews.read" | "reviews.write" | "analytics.read" | "audit.read" | "settings.manage"
|
|
46
|
-
/** Write access to skill files, personal and deployment-wide. */
|
|
47
|
-
| "skills.manage"
|
|
48
|
-
/**
|
|
49
|
-
* What the domain experts wrote into their durable memory. Reading is split
|
|
50
|
-
* from correcting because a reviewer is the one who notices a remembered
|
|
51
|
-
* inaccuracy in an answer, and an answer the expert keeps getting wrong is
|
|
52
|
-
* the reviewer's business even though the fix is not.
|
|
53
|
-
*/
|
|
54
|
-
| "memory.read" | "memory.manage";
|
|
55
|
-
/**
|
|
56
|
-
* Tools split by how they become available. `always` is visible from the first
|
|
57
|
-
* model step; `skillGrantable` is a ceiling — the tool only appears once an
|
|
58
|
-
* activated skill requires it, and never outside this list.
|
|
59
|
-
*/
|
|
60
|
-
export interface QaToolSelection {
|
|
61
|
-
readonly always: readonly string[];
|
|
62
|
-
readonly skillGrantable: readonly string[];
|
|
63
|
-
/**
|
|
64
|
-
* Names this layer takes away, whatever grants them.
|
|
65
|
-
*
|
|
66
|
-
* The deployment's pinned tools and the Common layer reach every role, so
|
|
67
|
-
* without this a system tool could only be withdrawn by editing the profile
|
|
68
|
-
* and restarting the Host. A denial beats every grant — system, Common, the
|
|
69
|
-
* role's own list and every skill — and it narrows the ceiling a delegated
|
|
70
|
-
* assistant is held to, so one checkbox takes a tool away from a role and
|
|
71
|
-
* from the experts that role may spawn.
|
|
72
|
-
*/
|
|
73
|
-
readonly deny?: readonly string[];
|
|
74
|
-
}
|
|
75
|
-
/** Tool/skill selection shared by the common layer and one QA subrole. */
|
|
76
|
-
export interface QaCapabilitySelection {
|
|
77
|
-
readonly tools: QaToolSelection;
|
|
78
|
-
readonly skills: readonly string[];
|
|
79
|
-
/** Reserved extension seams; v1 enforcement intentionally ignores them. */
|
|
80
|
-
readonly mcpServers?: readonly string[];
|
|
81
|
-
readonly knowledgeSources?: readonly string[];
|
|
82
|
-
readonly promptAdditions?: readonly string[];
|
|
83
|
-
}
|
|
84
|
-
/** Audience one skill declares for itself in its own SKILL.md metadata. */
|
|
85
|
-
export type QaSkillAudience = {
|
|
86
|
-
readonly type: "unassigned";
|
|
87
|
-
} | {
|
|
88
|
-
readonly type: "common";
|
|
89
|
-
} | {
|
|
90
|
-
readonly type: "subroles";
|
|
91
|
-
readonly include: readonly string[];
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Normalized `metadata.qa-surface` of one skill. Discovery never throws on a
|
|
95
|
-
* malformed block: the fields fall back to the fail-closed defaults and every
|
|
96
|
-
* complaint lands in `warnings` for the administration surface.
|
|
97
|
-
*/
|
|
98
|
-
export interface QaSkillDescriptor {
|
|
99
|
-
readonly name: string;
|
|
100
|
-
readonly audience: QaSkillAudience;
|
|
101
|
-
/** Tools the skill needs to work; the role ceiling still decides the grant. */
|
|
102
|
-
readonly requiredTools: readonly string[];
|
|
103
|
-
/** Whether activation must be refused when one required tool is unavailable. */
|
|
104
|
-
readonly requireAll: boolean;
|
|
105
|
-
readonly lifecycle: "session";
|
|
106
|
-
/** `metadata.qa-surface.version`; 0 when the block declared none. */
|
|
107
|
-
readonly schemaVersion: number;
|
|
108
|
-
/** Whether the skill carried a readable qa-surface metadata block. */
|
|
109
|
-
readonly declared: boolean;
|
|
110
|
-
readonly warnings: readonly string[];
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Administrator overlay over one skill's declared audience. The skill file is
|
|
114
|
-
* never rewritten: assignments are stored beside the policy and merged here.
|
|
115
|
-
*/
|
|
116
|
-
export interface QaSkillAssignmentOverride {
|
|
117
|
-
readonly skillName: string;
|
|
118
|
-
readonly addToSubroles?: readonly string[];
|
|
119
|
-
readonly removeFromSubroles?: readonly string[];
|
|
120
|
-
readonly forceCommon?: boolean;
|
|
121
|
-
readonly disabled?: boolean;
|
|
122
|
-
}
|
|
123
|
-
export type QaSkillHealth = "healthy" | "degraded" | "blocked" | "unassigned";
|
|
124
|
-
/** Per-role projection of one skill: what the role sees and what it may grant. */
|
|
125
|
-
export interface QaSkillRoleGrant {
|
|
126
|
-
readonly roleId: string;
|
|
127
|
-
readonly visible: boolean;
|
|
128
|
-
readonly declared: boolean;
|
|
129
|
-
readonly addedByAdmin: boolean;
|
|
130
|
-
readonly removedByAdmin: boolean;
|
|
131
|
-
readonly disabled: boolean;
|
|
132
|
-
/** Required tools this role's ceiling admits. */
|
|
133
|
-
readonly grantableTools: readonly string[];
|
|
134
|
-
/** Required tools this role cannot grant: outside the ceiling or not installed. */
|
|
135
|
-
readonly unavailableTools: readonly string[];
|
|
136
|
-
}
|
|
137
|
-
/** One row of the administration Skills table plus its detail view. */
|
|
138
|
-
export interface QaSkillAccess {
|
|
139
|
-
readonly name: string;
|
|
140
|
-
readonly description?: string;
|
|
141
|
-
readonly whenToUse?: string;
|
|
142
|
-
readonly source: QaCapabilityDescriptor["source"];
|
|
143
|
-
readonly status: "available" | "missing";
|
|
144
|
-
readonly descriptor: QaSkillDescriptor;
|
|
145
|
-
/** Roles whose policy currently exposes the skill. */
|
|
146
|
-
readonly visibleTo: readonly string[];
|
|
147
|
-
readonly disabled: boolean;
|
|
148
|
-
readonly forceCommon: boolean;
|
|
149
|
-
readonly overridden: boolean;
|
|
150
|
-
readonly health: QaSkillHealth;
|
|
151
|
-
/** Every required tool with the union of roles that could grant it. */
|
|
152
|
-
readonly tools: readonly {
|
|
153
|
-
readonly id: string;
|
|
154
|
-
readonly installed: boolean;
|
|
155
|
-
readonly grantableBy: readonly string[];
|
|
156
|
-
readonly blockedFor: readonly string[];
|
|
157
|
-
}[];
|
|
158
|
-
readonly roles: readonly QaSkillRoleGrant[];
|
|
159
|
-
}
|
|
160
|
-
/** Why a skill activation was attempted; recorded for conversation review. */
|
|
161
|
-
export type QaSkillActivationOrigin = "model" | "user" | "preview";
|
|
162
|
-
/**
|
|
163
|
-
* One activation attempt on a live session, appended to the session record.
|
|
164
|
-
* `denied` covers an audience refusal, `rejected` a failed `requireAll` check.
|
|
165
|
-
*/
|
|
166
|
-
export interface QaSkillActivationRecord {
|
|
167
|
-
readonly timestamp: string;
|
|
168
|
-
readonly skillName: string;
|
|
169
|
-
readonly origin: QaSkillActivationOrigin;
|
|
170
|
-
readonly outcome: "activated" | "rejected" | "denied";
|
|
171
|
-
readonly requestedTools: readonly string[];
|
|
172
|
-
readonly grantedTools: readonly string[];
|
|
173
|
-
readonly deniedTools: readonly string[];
|
|
174
|
-
readonly reason?: string;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* One provider and model pair, fixed by policy rather than chosen in the
|
|
178
|
-
* interface. `provider` and `model` are named together or not at all, because
|
|
179
|
-
* the Host refuses either of them alone.
|
|
180
|
-
*/
|
|
181
|
-
export interface QaModelPair {
|
|
182
|
-
readonly provider: string;
|
|
183
|
-
readonly model: string;
|
|
184
|
-
readonly reasoningEffort?: string;
|
|
185
|
-
}
|
|
186
|
-
/** One agent capability profile. It never grants administrative access. */
|
|
187
|
-
export interface QaSubrole {
|
|
188
|
-
readonly id: string;
|
|
189
|
-
readonly name: string;
|
|
190
|
-
readonly description?: string;
|
|
191
|
-
readonly enabled: boolean;
|
|
192
|
-
readonly capabilities: QaCapabilitySelection;
|
|
193
|
-
/**
|
|
194
|
-
* The pair every chat of this role is opened on, whatever the visitor picks
|
|
195
|
-
* in the interface. Absent means the role keeps no opinion and the
|
|
196
|
-
* deployment's pair serves it.
|
|
197
|
-
*/
|
|
198
|
-
readonly model?: QaModelPair;
|
|
199
|
-
readonly ui?: {
|
|
200
|
-
readonly icon?: string;
|
|
201
|
-
readonly accent?: string;
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/** Host-owned, versioned capability configuration. */
|
|
205
|
-
export interface QaCapabilityConfig {
|
|
206
|
-
readonly version: 1;
|
|
207
|
-
readonly common: QaCapabilitySelection;
|
|
208
|
-
readonly subroles: readonly QaSubrole[];
|
|
209
|
-
/** Administrator assignments layered over what each skill declares. */
|
|
210
|
-
readonly skillOverrides: readonly QaSkillAssignmentOverride[];
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* One pair the Host can serve right now, as the administration surface lists
|
|
214
|
-
* it. A projection of the harness catalog, so the browser never learns the
|
|
215
|
-
* provider's own catalog shape and a policy can only be written by picking one
|
|
216
|
-
* of these.
|
|
217
|
-
*/
|
|
218
|
-
export interface QaModelCatalogEntry {
|
|
219
|
-
readonly provider: string;
|
|
220
|
-
readonly model: string;
|
|
221
|
-
/** The catalog's display name for the model, or its id when it has none. */
|
|
222
|
-
readonly label: string;
|
|
223
|
-
readonly reasoningEfforts: readonly string[];
|
|
224
|
-
}
|
|
225
|
-
/** The QA profiles one account may choose, independently of its access role. */
|
|
226
|
-
export interface QaUserAccess {
|
|
227
|
-
readonly allowedSubroles: readonly string[];
|
|
228
|
-
readonly defaultSubrole: string;
|
|
229
|
-
/**
|
|
230
|
-
* The pair this account is opened on, ahead of what its role says: a support
|
|
231
|
-
* desk runs on the local model even when it borrows a role the rest of the
|
|
232
|
-
* deployment shares. Absent means the account keeps no opinion.
|
|
233
|
-
*/
|
|
234
|
-
readonly model?: QaModelPair;
|
|
235
|
-
}
|
|
236
|
-
export type QaCapabilitySourceKind = "core" | "plugin" | "mcp" | "filesystem" | "runtime";
|
|
237
|
-
/** One capability currently installed, or retained as a missing selection. */
|
|
238
|
-
export interface QaCapabilityDescriptor {
|
|
239
|
-
readonly type: "tool" | "skill";
|
|
240
|
-
readonly id: string;
|
|
241
|
-
readonly title: string;
|
|
242
|
-
readonly description?: string;
|
|
243
|
-
readonly source: {
|
|
244
|
-
readonly kind: QaCapabilitySourceKind;
|
|
245
|
-
readonly name?: string;
|
|
246
|
-
};
|
|
247
|
-
readonly status: "available" | "missing";
|
|
248
|
-
readonly modelInvocable?: boolean;
|
|
249
|
-
readonly userInvocable?: boolean;
|
|
250
|
-
}
|
|
251
|
-
/** JSON-safe projection of an immutable policy snapshot. */
|
|
252
|
-
export interface QaEffectiveCapabilityPolicy {
|
|
253
|
-
readonly subroleId: string;
|
|
254
|
-
/** Tools visible from the first model step, before any skill is loaded. */
|
|
255
|
-
readonly tools: readonly string[];
|
|
256
|
-
/** Ceiling for the tools an activated skill may add to this session. */
|
|
257
|
-
readonly grantableTools: readonly string[];
|
|
258
|
-
/** Skills the model may see and load for the frozen subrole. */
|
|
259
|
-
readonly skills: readonly string[];
|
|
260
|
-
/**
|
|
261
|
-
* Visible skills a person may invoke with `/name`, including skills that
|
|
262
|
-
* opted out of model invocation and therefore stay out of the catalog. The
|
|
263
|
-
* skills this account owns are here for it without a role grant, unless an
|
|
264
|
-
* administrator has withdrawn the name outright.
|
|
265
|
-
*/
|
|
266
|
-
readonly userSkills: readonly string[];
|
|
267
|
-
readonly sources: {
|
|
268
|
-
readonly systemTools: readonly string[];
|
|
269
|
-
readonly commonTools: readonly string[];
|
|
270
|
-
readonly roleTools: readonly string[];
|
|
271
|
-
readonly commonGrantableTools: readonly string[];
|
|
272
|
-
readonly roleGrantableTools: readonly string[];
|
|
273
|
-
readonly systemSkills: readonly string[];
|
|
274
|
-
readonly commonSkills: readonly string[];
|
|
275
|
-
readonly roleSkills: readonly string[];
|
|
276
|
-
/** Skills this subrole received from their own SKILL.md audience. */
|
|
277
|
-
readonly declaredSkills: readonly string[];
|
|
278
|
-
};
|
|
279
|
-
readonly missingTools: readonly string[];
|
|
280
|
-
readonly missingSkills: readonly string[];
|
|
281
|
-
/** Revision of the resolved policy, recorded with the session snapshot. */
|
|
282
|
-
readonly policyRevision: string;
|
|
283
|
-
}
|
|
284
|
-
export type QaAccessAuditAction = "subrole.created" | "subrole.updated" | "subrole.deleted" | "common.updated" | "assignment.updated" | "skill.assignment-updated";
|
|
285
|
-
export interface QaAccessAuditEvent {
|
|
286
|
-
readonly timestamp: string;
|
|
287
|
-
readonly actorId: string;
|
|
288
|
-
readonly action: QaAccessAuditAction;
|
|
289
|
-
readonly targetId?: string;
|
|
290
|
-
/** JSON snapshots serialized at the storage boundary for a strict Remote type. */
|
|
291
|
-
readonly before?: string;
|
|
292
|
-
readonly after?: string;
|
|
293
|
-
}
|
|
294
|
-
/** Admin table row: credentials and token material are never projected. */
|
|
295
|
-
export interface QaAccessUser {
|
|
296
|
-
readonly id: string;
|
|
297
|
-
readonly email: string;
|
|
298
|
-
readonly displayName: string;
|
|
299
|
-
readonly accessRole: QaAccountRole;
|
|
300
|
-
readonly disabled: boolean;
|
|
301
|
-
readonly access: QaUserAccess;
|
|
302
|
-
}
|
|
303
|
-
/** Ordinary user's role selector data. */
|
|
304
|
-
export interface QaCurrentAccess {
|
|
305
|
-
readonly subroles: readonly QaSubrole[];
|
|
306
|
-
readonly defaultSubrole: string;
|
|
307
|
-
}
|
|
308
|
-
/** The role pinned to one existing session. */
|
|
309
|
-
export interface QaSessionAccess {
|
|
310
|
-
readonly subrole: QaSubrole;
|
|
311
|
-
readonly adminPreview: boolean;
|
|
312
|
-
}
|
|
313
|
-
/** One authoritative payload for the /qa/admin application. */
|
|
314
|
-
export interface QaAccessAdminSnapshot {
|
|
315
|
-
readonly config: QaCapabilityConfig;
|
|
316
|
-
/** Immutable capabilities inherited by every role; exposed read-only. */
|
|
317
|
-
readonly systemRequired: QaCapabilitySelection;
|
|
318
|
-
readonly catalog: readonly QaCapabilityDescriptor[];
|
|
319
|
-
/** Every discovered skill with its declared audience and grant ceiling. */
|
|
320
|
-
readonly skills: readonly QaSkillAccess[];
|
|
321
|
-
readonly users: readonly QaAccessUser[];
|
|
322
|
-
readonly audit: readonly QaAccessAuditEvent[];
|
|
323
|
-
}
|
|
324
|
-
/** The account fields projected to browsers; never includes credentials. */
|
|
325
|
-
export interface QaAccountUserPublic {
|
|
326
|
-
readonly id: string;
|
|
327
|
-
readonly email: string;
|
|
328
|
-
readonly displayName: string;
|
|
329
|
-
readonly role: QaAccountRole;
|
|
330
|
-
readonly createdAt: string;
|
|
331
|
-
readonly lastLoginAt: string | null;
|
|
332
|
-
readonly disabled: boolean;
|
|
333
|
-
/** Self-declared identity the QA prompt renders; empty until edited. */
|
|
334
|
-
readonly profile: QaAccountProfile;
|
|
335
|
-
/** The account's own starter buttons; empty until customized. */
|
|
336
|
-
readonly starters: QaAccountStarters;
|
|
337
|
-
/** Which channels a finished turn may use for this reader. */
|
|
338
|
-
readonly notifications: QaAccountNotifications;
|
|
339
|
-
}
|
|
340
|
-
/** One external system the deployment collects a handle for. */
|
|
341
|
-
export interface QaAccountIdentityField {
|
|
342
|
-
/** Stable lowercase key: the profile's storage key and the prompt's label. */
|
|
343
|
-
readonly key: string;
|
|
344
|
-
/** Operator copy shown in the profile form. */
|
|
345
|
-
readonly label: string;
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* What one account says about itself. Every value is the owner's own wording,
|
|
349
|
-
* which is why the prompt renders it as self-declared rather than as a
|
|
350
|
-
* verified directory attribute.
|
|
351
|
-
*/
|
|
352
|
-
export interface QaAccountProfile {
|
|
353
|
-
/** Full name as the user writes it; empty when unset. */
|
|
354
|
-
readonly fullName: string;
|
|
355
|
-
/** External-system handles, keyed by the declared field key. */
|
|
356
|
-
readonly identities: Readonly<Record<string, string>>;
|
|
357
|
-
/** Free-form guidance about how the user wants answers; empty when unset. */
|
|
358
|
-
readonly instructions: string;
|
|
359
|
-
/** ISO timestamp of the last edit; null while the profile is untouched. */
|
|
360
|
-
readonly updatedAt: string | null;
|
|
361
|
-
}
|
|
362
|
-
/** Full-replace profile write: an absent value clears the stored one. */
|
|
363
|
-
export interface QaAccountProfileInput {
|
|
364
|
-
readonly fullName: string;
|
|
365
|
-
readonly identities: Readonly<Record<string, string>>;
|
|
366
|
-
readonly instructions: string;
|
|
367
|
-
}
|
|
368
|
-
/** One starter button: what it reads and what pressing it sends. */
|
|
369
|
-
export interface QaAccountStarter {
|
|
370
|
-
readonly label: string;
|
|
371
|
-
readonly prompt: string;
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* An account's own starter buttons plus the choice about the deployment's
|
|
375
|
-
* built-in suggestions. Pure UI preferences: unlike the profile, none of this
|
|
376
|
-
* reaches the agent prompt.
|
|
377
|
-
*/
|
|
378
|
-
export interface QaAccountStarters {
|
|
379
|
-
readonly items: readonly QaAccountStarter[];
|
|
380
|
-
/** Hide the deployment's suggested questions in this account's composer. */
|
|
381
|
-
readonly hideDefaults: boolean;
|
|
382
|
-
}
|
|
383
|
-
/** Full-replace starters write: an absent value clears the stored one. */
|
|
384
|
-
export interface QaAccountStartersInput {
|
|
385
|
-
readonly items: readonly QaAccountStarter[];
|
|
386
|
-
readonly hideDefaults: boolean;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* What one account allows a finished turn to do to it. Pure UI preferences:
|
|
390
|
-
* unlike the profile, none of this reaches the agent prompt, and unlike the
|
|
391
|
-
* starter buttons, none of it is content — it is two switches over the
|
|
392
|
-
* channels the plugin already knows how to raise.
|
|
393
|
-
*
|
|
394
|
-
* The deployment's `config.notifications` sits above these: a channel the stand
|
|
395
|
-
* closed stays closed whatever an account asks for, which is the operator's
|
|
396
|
-
* answer to a laptop more than one person signs in on.
|
|
397
|
-
*/
|
|
398
|
-
export interface QaAccountNotifications {
|
|
399
|
-
/** Show the in-page line naming the chat whose turn ended. */
|
|
400
|
-
readonly inApp: boolean;
|
|
401
|
-
/**
|
|
402
|
-
* Hand the same fact to the operating system while this page is hidden or
|
|
403
|
-
* behind another window. Needs the browser's permission as well: without it
|
|
404
|
-
* the line stays inside the page and nothing asks a second time.
|
|
405
|
-
*/
|
|
406
|
-
readonly desktop: boolean;
|
|
407
|
-
}
|
|
408
|
-
/** Full-replace notifications write: both channels are always sent. */
|
|
409
|
-
export interface QaAccountNotificationsInput {
|
|
410
|
-
readonly inApp: boolean;
|
|
411
|
-
readonly desktop: boolean;
|
|
412
|
-
}
|
|
413
|
-
/** One successful login/registration: the bearer token plus the user. */
|
|
414
|
-
export interface QaAccountSession {
|
|
415
|
-
readonly token: string;
|
|
416
|
-
readonly user: QaAccountUserPublic;
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* One forgotten-password request waiting for an operator. The address and name
|
|
420
|
-
* travel with it so the console can show who is locked out without a second
|
|
421
|
-
* lookup; the count makes repeated taps visible instead of silent.
|
|
422
|
-
*/
|
|
423
|
-
export interface QaPasswordResetRequest {
|
|
424
|
-
readonly userId: string;
|
|
425
|
-
readonly email: string;
|
|
426
|
-
readonly displayName: string;
|
|
427
|
-
readonly requestedAt: string;
|
|
428
|
-
readonly lastRequestedAt: string;
|
|
429
|
-
readonly requestCount: number;
|
|
430
|
-
/** True when the account is disabled: a reset will not let it sign in. */
|
|
431
|
-
readonly disabled: boolean;
|
|
432
|
-
}
|
|
433
|
-
export type QaWhoamiResult = {
|
|
434
|
-
readonly authenticated: false;
|
|
435
|
-
} | {
|
|
436
|
-
readonly authenticated: true;
|
|
437
|
-
readonly user: QaAccountUserPublic;
|
|
438
|
-
};
|
|
439
|
-
/** Bulk ownership claim outcome for one browser's local chat index. */
|
|
440
|
-
export interface QaClaimResult {
|
|
441
|
-
readonly claimed: number;
|
|
442
|
-
/** Ids already owned by a different user; the browser drops them. */
|
|
443
|
-
readonly conflicts: readonly string[];
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* What an integration token may do. The credential a non-browser application
|
|
447
|
-
* presents to the QA HTTP API carries its own scopes, so a bridge that asks
|
|
448
|
-
* questions cannot read back conversations it was never given.
|
|
449
|
-
*/
|
|
450
|
-
export type QaServiceTokenScope = "ask" | "sessions:read";
|
|
451
|
-
/**
|
|
452
|
-
* What an account asks a new integration token to be. The credential is always
|
|
453
|
-
* issued to the caller: nothing a browser sends may name another account, so
|
|
454
|
-
* this shape has no owner field and the administrative path keeps its own.
|
|
455
|
-
*/
|
|
456
|
-
export interface QaServiceTokenCreateInput {
|
|
457
|
-
/** A note the operator's list shows; empty becomes a generic label. */
|
|
458
|
-
readonly label?: string;
|
|
459
|
-
/** Requested scopes; unknown ones are dropped, empty falls back to `ask`. */
|
|
460
|
-
readonly scopes?: readonly string[];
|
|
461
|
-
/** How long the token lives, in days; bounded server-side. */
|
|
462
|
-
readonly ttlDays?: number;
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* One integration token as a list shows it. The plaintext is deliberately not
|
|
466
|
-
* part of this shape: a secret is shown once, when it is minted, and a list
|
|
467
|
-
* that could repeat it would be a list that leaks it.
|
|
468
|
-
*/
|
|
469
|
-
export interface QaServiceTokenSummary {
|
|
470
|
-
readonly id: string;
|
|
471
|
-
readonly label: string;
|
|
472
|
-
readonly scopes: readonly QaServiceTokenScope[];
|
|
473
|
-
readonly createdAt: string;
|
|
474
|
-
readonly expiresAt: string;
|
|
475
|
-
readonly lastUsedAt: string | null;
|
|
476
|
-
readonly revokedAt: string | null;
|
|
477
|
-
readonly useCount: number;
|
|
478
|
-
}
|
|
479
|
-
/** One freshly minted token: the plaintext is here and nowhere else, ever. */
|
|
480
|
-
export interface QaIssuedServiceToken extends QaServiceTokenSummary {
|
|
481
|
-
/** The credential to hand to the integration. Never recoverable later. */
|
|
482
|
-
readonly token: string;
|
|
483
|
-
}
|
|
484
|
-
/**
|
|
485
|
-
* One chat-ownership entry as the admin views see it: the session, its owner
|
|
486
|
-
* and the owner's display name resolved at read time (a disabled account
|
|
487
|
-
* still names its chats).
|
|
488
|
-
*/
|
|
489
|
-
export interface QaOwnershipEntry {
|
|
490
|
-
readonly sessionId: string;
|
|
491
|
-
readonly userId: string;
|
|
492
|
-
readonly displayName: string;
|
|
493
|
-
readonly claimedAt: string;
|
|
494
|
-
}
|
|
495
|
-
/**
|
|
496
|
-
* Why one skill draft cannot be saved, or why it saves with a caveat. Codes
|
|
497
|
-
* stay stable on the wire; the browser owns the Russian copy.
|
|
498
|
-
*/
|
|
499
|
-
export type QaSkillDiagnosticCode = "name-required" | "name-invalid" | "name-mismatch" | "description-required" | "description-too-long" | "when-to-use-too-long" | "field-type-invalid" | "invocation-never" | "invocation-invalid" | "invocation-legacy-key" | "allowed-tools-invalid" | "tool-name-invalid" | "tool-unavailable" | "tools-too-many" | "file-too-large" | "frontmatter-missing" | "skill-file-missing" | "skill-file-truncated" | "frontmatter-invalid" | "unknown-field" | "resource-unsupported";
|
|
500
|
-
/** One finding about a skill file or an editor draft. */
|
|
501
|
-
export interface QaSkillDiagnostic {
|
|
502
|
-
readonly code: QaSkillDiagnosticCode;
|
|
503
|
-
readonly severity: "error" | "warning";
|
|
504
|
-
/** The editor field the message belongs to, or null for a file-wide one. */
|
|
505
|
-
readonly field: string | null;
|
|
506
|
-
/** The offending value: a tool name, a frontmatter key, a limit. */
|
|
507
|
-
readonly detail: string | null;
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* A JSON-representable frontmatter value. The editor receives the preserved
|
|
511
|
-
* foreign fields verbatim over the Host bridge, which carries JSON only, so
|
|
512
|
-
* the parser drops anything a YAML document can hold but JSON cannot.
|
|
513
|
-
*/
|
|
514
|
-
export type QaSkillJsonValue = string | number | boolean | null | readonly QaSkillJsonValue[] | {
|
|
515
|
-
readonly [key: string]: QaSkillJsonValue;
|
|
516
|
-
};
|
|
517
|
-
/** One personal skill as the catalog list renders it. */
|
|
518
|
-
/**
|
|
519
|
-
* One administrator write to a skill somebody else owns.
|
|
520
|
-
*
|
|
521
|
-
* The record exists so a personal skill cannot be changed behind its owner's
|
|
522
|
-
* back: it is written beside the skill and reported on every read, and the
|
|
523
|
-
* owner sees the badge in their own catalog.
|
|
524
|
-
*/
|
|
525
|
-
export interface QaSkillAdminEdit {
|
|
526
|
-
/** Administrator account id; the owner is told a role, not a colleague. */
|
|
527
|
-
readonly actorId: string;
|
|
528
|
-
/** ISO timestamp of that write. */
|
|
529
|
-
readonly at: string;
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* Which skill store an administrator is editing: the deployment-wide shared
|
|
533
|
-
* root every account may read, or one account's own directory.
|
|
534
|
-
*/
|
|
535
|
-
export type QaAdminSkillScope = {
|
|
536
|
-
readonly kind: "shared";
|
|
537
|
-
} | {
|
|
538
|
-
readonly kind: "user";
|
|
539
|
-
readonly userId: string;
|
|
540
|
-
};
|
|
541
|
-
/** The account a personal skill scope belongs to, for the console's header. */
|
|
542
|
-
export interface QaAdminSkillOwner {
|
|
543
|
-
readonly userId: string;
|
|
544
|
-
readonly email: string;
|
|
545
|
-
readonly displayName: string;
|
|
546
|
-
}
|
|
547
|
-
/** One scope's catalog plus the facts the console names it by. */
|
|
548
|
-
export interface QaAdminSkillsView {
|
|
549
|
-
readonly scope: QaAdminSkillScope;
|
|
550
|
-
/** The account of a personal scope; null for the shared root. */
|
|
551
|
-
readonly owner: QaAdminSkillOwner | null;
|
|
552
|
-
readonly skills: readonly QaSkillSummary[];
|
|
553
|
-
/** Absolute directory this scope reads and writes, rendered read-only. */
|
|
554
|
-
readonly rootPath: string;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* One memory namespace as the console lists it: which expert it belongs to and
|
|
558
|
-
* whether it takes writes. `access` comes from the expert's own definition, so
|
|
559
|
-
* a shared carrier shows up as what its owner declared rather than as whatever
|
|
560
|
-
* the browser guessed.
|
|
561
|
-
*/
|
|
562
|
-
export interface QaExpertMemoryScope {
|
|
563
|
-
readonly domainId: string;
|
|
564
|
-
readonly domainName: string;
|
|
565
|
-
readonly namespace: string;
|
|
566
|
-
readonly access: "read-write" | "read-only";
|
|
567
|
-
readonly records: number;
|
|
568
|
-
}
|
|
569
|
-
/** One line an expert recorded. */
|
|
570
|
-
export interface QaExpertMemoryRecord {
|
|
571
|
-
readonly namespace: string;
|
|
572
|
-
readonly key: string;
|
|
573
|
-
readonly text: string;
|
|
574
|
-
readonly tags: readonly string[];
|
|
575
|
-
readonly createdAt: number;
|
|
576
|
-
readonly updatedAt: number;
|
|
577
|
-
}
|
|
578
|
-
/** One page of a namespace, with the count the filter matched. */
|
|
579
|
-
export interface QaExpertMemoryPage {
|
|
580
|
-
readonly records: readonly QaExpertMemoryRecord[];
|
|
581
|
-
readonly total: number;
|
|
582
|
-
readonly offset: number;
|
|
583
|
-
readonly limit: number;
|
|
584
|
-
}
|
|
585
|
-
/** What an operator says a record should hold. The key never moves. */
|
|
586
|
-
export interface QaExpertMemoryDraft {
|
|
587
|
-
readonly text: string;
|
|
588
|
-
readonly tags: readonly string[];
|
|
589
|
-
}
|
|
590
|
-
export interface QaSkillSummary {
|
|
591
|
-
readonly name: string;
|
|
592
|
-
readonly description: string;
|
|
593
|
-
readonly whenToUse: string | null;
|
|
594
|
-
readonly modelInvocable: boolean;
|
|
595
|
-
readonly userInvocable: boolean;
|
|
596
|
-
/** Declared tools, in canonical order; unknown ones included. */
|
|
597
|
-
readonly allowedTools: readonly string[];
|
|
598
|
-
/** Declared tools the current QA scope cannot use; still stored as declared. */
|
|
599
|
-
readonly unavailableTools: readonly string[];
|
|
600
|
-
/** Entries in the skill directory besides SKILL.md (references, assets, …). */
|
|
601
|
-
readonly resourceCount: number;
|
|
602
|
-
readonly valid: boolean;
|
|
603
|
-
readonly diagnostics: readonly QaSkillDiagnostic[];
|
|
604
|
-
readonly updatedAt: string | null;
|
|
605
|
-
/** sha256 of the stored bytes; an update must echo the revision it read. */
|
|
606
|
-
readonly revision: string;
|
|
607
|
-
/**
|
|
608
|
-
* The administrator write that produced the stored revision, or null. A
|
|
609
|
-
* record whose revision no longer matches is stale and reports as null: the
|
|
610
|
-
* badge answers "did an administrator write what I am looking at", not
|
|
611
|
-
* "was this skill ever touched by an administrator".
|
|
612
|
-
*/
|
|
613
|
-
readonly adminEdit: QaSkillAdminEdit | null;
|
|
614
|
-
}
|
|
615
|
-
/** One personal skill with everything the editor needs. */
|
|
616
|
-
export interface QaSkillDocument extends QaSkillSummary {
|
|
617
|
-
readonly body: string;
|
|
618
|
-
/** Frontmatter the editor preserves but does not own. */
|
|
619
|
-
readonly extraFrontmatter: Readonly<Record<string, QaSkillJsonValue>>;
|
|
620
|
-
/** Absolute SKILL.md path; rendered read-only for advanced users. */
|
|
621
|
-
readonly sourcePath: string;
|
|
622
|
-
/** The canonical file the serializer writes, built from the parsed content. */
|
|
623
|
-
readonly preview: string;
|
|
624
|
-
/**
|
|
625
|
-
* True when the stored file is larger than the Host's read ceiling, so `body`
|
|
626
|
-
* and `preview` describe its head only. A save over such a document erases
|
|
627
|
-
* the unread tail, and the Host refuses it until the client confirms.
|
|
628
|
-
*/
|
|
629
|
-
readonly truncated: boolean;
|
|
630
|
-
}
|
|
631
|
-
/** One tool the picker can offer, with this deployment's availability. */
|
|
632
|
-
export interface QaSkillToolDescriptor {
|
|
633
|
-
readonly name: string;
|
|
634
|
-
readonly description: string;
|
|
635
|
-
/** False when the QA session's own scope cannot use the tool. */
|
|
636
|
-
readonly available: boolean;
|
|
637
|
-
}
|
|
638
|
-
/** The editor's save payload. */
|
|
639
|
-
export interface QaSkillDraftInput {
|
|
640
|
-
readonly name: string;
|
|
641
|
-
readonly description: string;
|
|
642
|
-
readonly whenToUse: string | null;
|
|
643
|
-
readonly modelInvocable: boolean;
|
|
644
|
-
readonly userInvocable: boolean;
|
|
645
|
-
readonly allowedTools: readonly string[];
|
|
646
|
-
readonly body: string;
|
|
647
|
-
/** Echo of the revision the editor read; a stale one is refused. */
|
|
648
|
-
readonly expectedRevision: string | null;
|
|
649
|
-
/**
|
|
650
|
-
* The client's acknowledgement that it is saving from an incomplete copy: the
|
|
651
|
-
* stored `SKILL.md` is over the read ceiling, so the draft carries the head
|
|
652
|
-
* of the file and a save would drop everything the read never loaded. A write
|
|
653
|
-
* without it is refused.
|
|
654
|
-
*/
|
|
655
|
-
readonly confirmPartialOverwrite?: boolean;
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* The Host's answer about one unsaved draft: the file a save would write and
|
|
659
|
-
* the diagnostics it found. The editor shows its own subset immediately and
|
|
660
|
-
* this authoritative set as soon as it arrives.
|
|
661
|
-
*/
|
|
662
|
-
export interface QaSkillValidation {
|
|
663
|
-
readonly preview: string;
|
|
664
|
-
readonly diagnostics: readonly QaSkillDiagnostic[];
|
|
665
|
-
}
|
|
666
|
-
/** What one delete did: v1 keeps the directory recoverable. */
|
|
667
|
-
export interface QaSkillRemoval {
|
|
668
|
-
readonly name: string;
|
|
669
|
-
readonly trashed: boolean;
|
|
670
|
-
}
|
|
671
|
-
export interface QaSourcesConfig {
|
|
672
|
-
readonly enabled?: boolean;
|
|
673
|
-
/**
|
|
674
|
-
* How much durable provenance the deployment keeps. Every bound counts
|
|
675
|
-
* turns, shards or days, and zero keeps everything for that bound.
|
|
676
|
-
*/
|
|
677
|
-
readonly retention?: {
|
|
678
|
-
readonly maxTurnsPerSession?: number;
|
|
679
|
-
readonly maxSessions?: number;
|
|
680
|
-
readonly maxAgeDays?: number;
|
|
681
|
-
readonly sweepIntervalMinutes?: number;
|
|
682
|
-
};
|
|
683
|
-
readonly collect?: {
|
|
684
|
-
readonly parentAgent?: boolean;
|
|
685
|
-
readonly subagents?: boolean;
|
|
686
|
-
readonly persistTurnEvent?: boolean;
|
|
687
|
-
};
|
|
688
|
-
readonly display?: {
|
|
689
|
-
readonly sidebar?: boolean;
|
|
690
|
-
readonly footer?: boolean;
|
|
691
|
-
readonly groupByKind?: boolean;
|
|
692
|
-
readonly showDiscovered?: boolean;
|
|
693
|
-
readonly showOriginBadges?: boolean;
|
|
694
|
-
readonly maxInitiallyVisiblePerGroup?: number;
|
|
695
|
-
};
|
|
696
|
-
readonly webSearch?: {
|
|
697
|
-
readonly promoteSearchResultsWithoutFetch?: boolean;
|
|
698
|
-
readonly maxPromotedPerSearch?: number;
|
|
699
|
-
};
|
|
700
|
-
readonly dedupe?: {
|
|
701
|
-
readonly normalizeUrls?: boolean;
|
|
702
|
-
readonly stripTrackingParams?: boolean;
|
|
703
|
-
readonly mergeFileRanges?: boolean;
|
|
704
|
-
};
|
|
705
|
-
readonly filePreview?: {
|
|
706
|
-
readonly enabled?: boolean;
|
|
707
|
-
readonly markdownRenderedByDefault?: boolean;
|
|
708
|
-
readonly allowRawToggle?: boolean;
|
|
709
|
-
readonly maxBytes?: number;
|
|
710
|
-
readonly maxMarkdownRenderBytes?: number;
|
|
711
|
-
readonly maxListingEntries?: number;
|
|
712
|
-
};
|
|
713
|
-
readonly subagents?: {
|
|
714
|
-
readonly inheritSources?: boolean;
|
|
715
|
-
readonly enableReportToolFallback?: boolean;
|
|
716
|
-
readonly markIncompleteOpaqueRuns?: boolean;
|
|
717
|
-
/**
|
|
718
|
-
* Whether a source the model writes into `qa_report_sources` must carry a
|
|
719
|
-
* usable path or URL. Off records the model's own type, title and snippet.
|
|
720
|
-
*/
|
|
721
|
-
readonly validateReportedSources?: boolean;
|
|
722
|
-
};
|
|
723
|
-
readonly legacy?: {
|
|
724
|
-
readonly parseAssistantSourcesBlock?: boolean;
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
/**
|
|
728
|
-
* The ambient notes the injector writes into a QA chat as plugin-sourced user
|
|
729
|
-
* messages (`prompt-notes.ts`). Each note can be switched off and reworded;
|
|
730
|
-
* an empty template keeps the built-in wording.
|
|
731
|
-
*/
|
|
732
|
-
export interface QaNotesConfig {
|
|
733
|
-
/** Who the assistant is talking to; `{identity}` + `{instructions}`. */
|
|
734
|
-
readonly identity?: {
|
|
735
|
-
readonly enabled?: boolean;
|
|
736
|
-
readonly template?: string;
|
|
737
|
-
};
|
|
738
|
-
/** Source-provenance rules; `{reportTool}` names the subagent report tool. */
|
|
739
|
-
readonly sources?: {
|
|
740
|
-
readonly enabled?: boolean;
|
|
741
|
-
readonly template?: string;
|
|
742
|
-
/** The sentence appended when the report-tool fallback is on. */
|
|
743
|
-
readonly fallbackTemplate?: string;
|
|
744
|
-
};
|
|
745
|
-
/** How to label background delegations; no placeholders. */
|
|
746
|
-
readonly delegation?: {
|
|
747
|
-
readonly enabled?: boolean;
|
|
748
|
-
readonly template?: string;
|
|
749
|
-
};
|
|
750
|
-
/** Which reader an attached office document belongs to; no placeholders. */
|
|
751
|
-
readonly documents?: {
|
|
752
|
-
readonly enabled?: boolean;
|
|
753
|
-
readonly template?: string;
|
|
754
|
-
};
|
|
755
|
-
/** Where an answer should come from; no placeholders. */
|
|
756
|
-
readonly sourcePriority?: {
|
|
757
|
-
readonly enabled?: boolean;
|
|
758
|
-
readonly template?: string;
|
|
759
|
-
};
|
|
760
|
-
}
|
|
761
|
-
export interface QaSurfaceConfig {
|
|
762
|
-
readonly enabled?: boolean;
|
|
763
|
-
readonly route?: {
|
|
764
|
-
readonly path?: string;
|
|
765
|
-
readonly matchChildren?: boolean;
|
|
766
|
-
};
|
|
767
|
-
readonly branding?: {
|
|
768
|
-
readonly title?: string;
|
|
769
|
-
readonly subtitle?: string;
|
|
770
|
-
readonly welcomeMessage?: string;
|
|
771
|
-
readonly placeholder?: string;
|
|
772
|
-
readonly logoUrl?: string | null;
|
|
773
|
-
/** Data-usage notice under the composer; empty string hides the plate. */
|
|
774
|
-
readonly disclaimer?: string | null;
|
|
775
|
-
};
|
|
776
|
-
readonly session?: {
|
|
777
|
-
readonly policy?: QaSessionPolicy;
|
|
778
|
-
readonly storageKey?: string;
|
|
779
|
-
/** Absolute directory pinned as the session cwd (alternative to workspaceId). */
|
|
780
|
-
readonly cwd?: string | null;
|
|
781
|
-
readonly workspaceId?: string | null;
|
|
782
|
-
readonly fixedSessionId?: string | null;
|
|
783
|
-
readonly agentPreset?: string | null;
|
|
784
|
-
readonly provider?: string | null;
|
|
785
|
-
readonly model?: string | null;
|
|
786
|
-
readonly reasoningEffort?: string | null;
|
|
787
|
-
/**
|
|
788
|
-
* How many chat turns the deployment answers at once. A ceiling is what a
|
|
789
|
-
* locally hosted model needs: the card runs out long before the queue does,
|
|
790
|
-
* and a third request makes every answer on the stand slower instead of
|
|
791
|
-
* adding capacity. 0 leaves the count unbounded, which is the default
|
|
792
|
-
* because a hosted model has no such ceiling.
|
|
793
|
-
*/
|
|
794
|
-
readonly maxActiveRequests?: number;
|
|
795
|
-
};
|
|
796
|
-
readonly ui?: {
|
|
797
|
-
readonly showHeader?: boolean;
|
|
798
|
-
readonly showReset?: boolean;
|
|
799
|
-
readonly showStop?: boolean;
|
|
800
|
-
readonly showTimestamps?: boolean;
|
|
801
|
-
readonly showToolActivity?: boolean;
|
|
802
|
-
readonly showReasoning?: boolean;
|
|
803
|
-
readonly renderMarkdown?: boolean;
|
|
804
|
-
/** Floor for the visitor-resizable transcript/composer width; the page caps it. */
|
|
805
|
-
readonly minContentWidth?: number;
|
|
806
|
-
readonly showSessionList?: boolean;
|
|
807
|
-
/**
|
|
808
|
-
* Sign subagent completion notices with deterministic codenames
|
|
809
|
-
* («Дотошный Барсук») instead of the child's readable name or raw id.
|
|
810
|
-
*/
|
|
811
|
-
readonly subagentCodenames?: boolean;
|
|
812
|
-
};
|
|
813
|
-
readonly suggestedQuestions?: readonly string[];
|
|
814
|
-
/**
|
|
815
|
-
* Phrases the running indicator cycles through. An empty list restores the
|
|
816
|
-
* built-in phrases: the indicator always carries a label.
|
|
817
|
-
*/
|
|
818
|
-
readonly thinkingPhrases?: readonly string[];
|
|
819
|
-
readonly interaction?: {
|
|
820
|
-
readonly approvals?: QaApprovalInteraction;
|
|
821
|
-
readonly questions?: QaQuestionInteractionInput;
|
|
822
|
-
};
|
|
823
|
-
/**
|
|
824
|
-
* QA tool delivery. Dynamic activation keeps the QA tool schemas out of the
|
|
825
|
-
* model request until the activation skill has actually been loaded.
|
|
826
|
-
*/
|
|
827
|
-
readonly tools?: {
|
|
828
|
-
/**
|
|
829
|
-
* `true` attaches the QA tools only after the activation skill loads;
|
|
830
|
-
* `false` attaches them to every managed agent at creation.
|
|
831
|
-
*/
|
|
832
|
-
readonly dynamicActivation?: boolean;
|
|
833
|
-
/** The skill name whose successful load attaches the QA tools. */
|
|
834
|
-
readonly activationSkill?: string;
|
|
835
|
-
/** Accepted activation policy; only `all` is implemented. */
|
|
836
|
-
readonly activationMode?: QaToolActivationMode;
|
|
837
|
-
/**
|
|
838
|
-
* Agent presets whose sessions participate. An empty list leaves the gate
|
|
839
|
-
* open, which is only safe when this plugin serves one agent composition —
|
|
840
|
-
* name the QA preset in any deployment that composes more than one.
|
|
841
|
-
*/
|
|
842
|
-
readonly activationPresets?: readonly string[];
|
|
843
|
-
/**
|
|
844
|
-
* Absolute path of the documentation tree `docs_search`/`docs_read` read.
|
|
845
|
-
* Leave it empty when the deployment publishes `docs/` inside each chat's
|
|
846
|
-
* own workspace; name it when the corpus is published once, outside every
|
|
847
|
-
* per-user directory, which is otherwise unreadable to those tools.
|
|
848
|
-
*/
|
|
849
|
-
readonly docsRoot?: string;
|
|
850
|
-
/**
|
|
851
|
-
* Documentation version `docs_search` stays inside when the model named
|
|
852
|
-
* neither `version` nor `path`. A corpus carries several editions of the
|
|
853
|
-
* same module, and a chat asked about "the product" answers out of whichever
|
|
854
|
-
* edition it happened to read first; naming the stand's edition here lets a
|
|
855
|
-
* search default to it, and an explicit `version` or `path` still decides
|
|
856
|
-
* for itself.
|
|
857
|
-
*/
|
|
858
|
-
readonly docsDefaultVersion?: string;
|
|
859
|
-
/**
|
|
860
|
-
* Whether `docsDefaultVersion` is applied. The value stays configured while
|
|
861
|
-
* the switch is off, so a stand can turn the default back on without
|
|
862
|
-
* retyping it.
|
|
863
|
-
*/
|
|
864
|
-
readonly docsDefaultVersionEnabled?: boolean;
|
|
865
|
-
};
|
|
866
|
-
readonly lockdown?: {
|
|
867
|
-
readonly enabled?: boolean;
|
|
868
|
-
readonly enforceFixedAgentPreset?: boolean;
|
|
869
|
-
readonly enforceFixedWorkspace?: boolean;
|
|
870
|
-
readonly enforceFixedModel?: boolean;
|
|
871
|
-
readonly sandboxMode?: QaSandboxMode;
|
|
872
|
-
readonly approvalPolicy?: QaApprovalPolicy;
|
|
873
|
-
readonly permissionPreset?: string;
|
|
874
|
-
readonly allowPermissionChanges?: false;
|
|
875
|
-
/**
|
|
876
|
-
* Master switch for the slash interface, and the only capability flag the
|
|
877
|
-
* resolver lets a deployment turn on. It opens the palette, which then
|
|
878
|
-
* offers exactly what `slashCommands` admits — human commands stay denied
|
|
879
|
-
* until the deployment names them. Nothing here widens the tool allow-list,
|
|
880
|
-
* the sandbox or the approval policy.
|
|
881
|
-
*/
|
|
882
|
-
readonly allowSlashCommands?: boolean;
|
|
883
|
-
readonly allowSettingsMutation?: false;
|
|
884
|
-
readonly allowSessionReset?: boolean;
|
|
885
|
-
readonly allowSessionRename?: false;
|
|
886
|
-
readonly allowSessionDelete?: false;
|
|
887
|
-
readonly allowArbitrarySessionOpen?: false;
|
|
888
|
-
readonly toolPolicy?: {
|
|
889
|
-
readonly mode?: QaToolPolicyMode;
|
|
890
|
-
readonly allow?: readonly string[];
|
|
891
|
-
};
|
|
892
|
-
/** Shared directories available to read-only filesystem tools. */
|
|
893
|
-
readonly sharedReadOnlyRoots?: readonly string[];
|
|
894
|
-
};
|
|
895
|
-
/**
|
|
896
|
-
* Slash interface policy. Admission only: the QA surface never implements a
|
|
897
|
-
* skill or command registry, it decides which native ones reach the palette.
|
|
898
|
-
* Inert while `lockdown.allowSlashCommands` is off.
|
|
899
|
-
*/
|
|
900
|
-
readonly slashCommands?: QaSlashCommandsConfig;
|
|
901
|
-
readonly embedding?: {
|
|
902
|
-
readonly frameAncestors?: string | null;
|
|
903
|
-
};
|
|
904
|
-
readonly accounts?: {
|
|
905
|
-
/** Opt-in; the QA gate stays off until the deployment turns this on. */
|
|
906
|
-
readonly enabled?: boolean;
|
|
907
|
-
readonly allowRegistration?: boolean;
|
|
908
|
-
readonly sessionTtlDays?: number;
|
|
909
|
-
/**
|
|
910
|
-
* Login/registration attempts accepted per rolling minute, store-wide.
|
|
911
|
-
* The limit backs the password checks, so the default stays tight.
|
|
912
|
-
*/
|
|
913
|
-
readonly maxAuthAttemptsPerMinute?: number;
|
|
914
|
-
/**
|
|
915
|
-
* What happens to ownership records of chats the Harness no longer knows.
|
|
916
|
-
* A record is a chat's auth boundary, so only vanished chats are ever
|
|
917
|
-
* swept, and only after `ownershipGraceHours`.
|
|
918
|
-
*/
|
|
919
|
-
readonly retention?: {
|
|
920
|
-
readonly pruneVanishedSessions?: boolean;
|
|
921
|
-
readonly ownershipGraceHours?: number;
|
|
922
|
-
readonly sweepIntervalMinutes?: number;
|
|
923
|
-
};
|
|
924
|
-
/** Let admins see chats owned by other QA accounts. */
|
|
925
|
-
readonly showOtherUsersChats?: boolean;
|
|
926
|
-
/**
|
|
927
|
-
* Give every account a private cwd below the configured workspaceId.
|
|
928
|
-
* The child directory is not registered as a separate DSH workspace.
|
|
929
|
-
*/
|
|
930
|
-
readonly perUserWorkspace?: boolean;
|
|
931
|
-
/**
|
|
932
|
-
* Personal Skills: the user's own `.dsh/skills` below their QA workspace,
|
|
933
|
-
* surfaced through a skill provider this plugin owns.
|
|
934
|
-
*/
|
|
935
|
-
readonly skills?: {
|
|
936
|
-
readonly enabled?: boolean;
|
|
937
|
-
/** Directory below the personal root; relative, never escaping it. */
|
|
938
|
-
readonly relativeRoot?: string;
|
|
939
|
-
/** Follow manual file edits and refresh the DSH catalog. */
|
|
940
|
-
readonly watch?: boolean;
|
|
941
|
-
readonly maxSkillBytes?: number;
|
|
942
|
-
/** Reserved for the resource editor; v1 edits SKILL.md only. */
|
|
943
|
-
readonly allowResourceEditing?: boolean;
|
|
944
|
-
};
|
|
945
|
-
/** Self-declared profile: storage, the owner's form, and prompt injection. */
|
|
946
|
-
readonly profile?: {
|
|
947
|
-
readonly enabled?: boolean;
|
|
948
|
-
/** Render the profile into the QA agent's system prompt. */
|
|
949
|
-
readonly inject?: boolean;
|
|
950
|
-
/** External systems to collect a handle for; empty declares none. */
|
|
951
|
-
readonly identities?: readonly {
|
|
952
|
-
readonly key?: string;
|
|
953
|
-
readonly label?: string;
|
|
954
|
-
}[];
|
|
955
|
-
/** Character cap on the user's free-form agent guidance. */
|
|
956
|
-
readonly instructionsMaxLength?: number;
|
|
957
|
-
};
|
|
958
|
-
/** Per-account starter buttons above an empty composer. */
|
|
959
|
-
readonly starters?: {
|
|
960
|
-
readonly enabled?: boolean;
|
|
961
|
-
};
|
|
962
|
-
};
|
|
963
|
-
readonly entry?: {
|
|
964
|
-
/** Inject the root → /qa redirect for non-loopback hostnames. */
|
|
965
|
-
readonly redirectNonLoopback?: boolean;
|
|
966
|
-
/** Cookie-less /qa navigations go through the one-time ?token= exchange. */
|
|
967
|
-
readonly cookieBootstrap?: boolean;
|
|
968
|
-
};
|
|
969
|
-
/** Notices for a turn that ended in one of this browser's own chats. */
|
|
970
|
-
readonly notifications?: {
|
|
971
|
-
/** Master switch: with it off no channel raises anything. */
|
|
972
|
-
readonly enabled?: boolean;
|
|
973
|
-
/**
|
|
974
|
-
* Allow the desktop (operating-system) channel on this stand at all.
|
|
975
|
-
* A reader's own choice only applies while this is on: it is the answer
|
|
976
|
-
* for a shared laptop, where a personal notice is everybody's notice.
|
|
977
|
-
*/
|
|
978
|
-
readonly allowOs?: boolean;
|
|
979
|
-
};
|
|
980
|
-
readonly sources?: QaSourcesConfig;
|
|
981
|
-
readonly attachments?: QaAttachmentsConfig;
|
|
982
|
-
readonly notes?: QaNotesConfig;
|
|
983
|
-
readonly integration?: QaIntegrationConfig;
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* The HTTP API an external application (the ticket bridge) uses to ask
|
|
987
|
-
* questions and read its own conversations back: `POST {basePath}/ask`,
|
|
988
|
-
* `GET {basePath}/session` and `GET {basePath}/health`, authenticated with an
|
|
989
|
-
* account's integration token. Off unless a deployment asks for it.
|
|
990
|
-
*/
|
|
991
|
-
export interface QaIntegrationConfig {
|
|
992
|
-
/** Serve the API at all. Requires accounts; off by default. */
|
|
993
|
-
readonly enabled?: boolean;
|
|
994
|
-
/** Route namespace; the endpoints all hang off it. */
|
|
995
|
-
readonly basePath?: string;
|
|
996
|
-
/** Default lifetime of a minted integration token, in days. */
|
|
997
|
-
readonly tokenTtlDays?: number;
|
|
998
|
-
/**
|
|
999
|
-
* Wall-clock budget for one question. The endpoint answers within it — with
|
|
1000
|
-
* an escalation when the turn is still running — because the caller's own
|
|
1001
|
-
* timeout is a fixed part of the contract.
|
|
1002
|
-
*/
|
|
1003
|
-
readonly requestTimeoutMs?: number;
|
|
1004
|
-
/** Questions answered at the same time, deployment wide. */
|
|
1005
|
-
readonly maxConcurrent?: number;
|
|
1006
|
-
/** Requests one token may make per rolling minute. */
|
|
1007
|
-
readonly requestsPerMinute?: number;
|
|
1008
|
-
/** Ceiling on one request body, in bytes. */
|
|
1009
|
-
readonly maxRequestBytes?: number;
|
|
1010
|
-
/** Ceiling on one inline image attachment, in bytes. */
|
|
1011
|
-
readonly maxAttachmentBytes?: number;
|
|
1012
|
-
/**
|
|
1013
|
-
* Ceiling on the published answer, in characters. The caller posts it into a
|
|
1014
|
-
* ticket comment, whose own budget is smaller than a model's answer, and a
|
|
1015
|
-
* cut made here at a paragraph boundary is readable where the caller's own
|
|
1016
|
-
* silent truncation is not.
|
|
1017
|
-
*/
|
|
1018
|
-
readonly maxAnswerCharacters?: number;
|
|
1019
|
-
}
|
|
1020
|
-
/** What a QA visitor may attach to one message. */
|
|
1021
|
-
export interface QaAttachmentsConfig {
|
|
1022
|
-
/** Offer text files (md, txt, log, …) next to images; off = images only. */
|
|
1023
|
-
readonly textFiles?: boolean;
|
|
1024
|
-
/**
|
|
1025
|
-
* Line count above which pasted plain text becomes an attached file instead
|
|
1026
|
-
* of landing in the input field. Zero never converts.
|
|
1027
|
-
*/
|
|
1028
|
-
readonly pastedTextLines?: number;
|
|
1029
|
-
/** Byte ceiling for one attached file; the composer refuses anything larger. */
|
|
1030
|
-
readonly maxFileBytes?: number;
|
|
1031
|
-
/**
|
|
1032
|
-
* Pending attachments (images plus text files) allowed on one message. The
|
|
1033
|
-
* Host keeps its own authority over assembled image batches.
|
|
1034
|
-
*/
|
|
1035
|
-
readonly maxPending?: number;
|
|
1036
|
-
/** Accepted text-file extensions, lowercase and without the dot. */
|
|
1037
|
-
readonly extensions?: readonly string[];
|
|
1038
|
-
}
|
|
1039
|
-
export interface ResolvedQaSurfaceConfig {
|
|
1040
|
-
readonly enabled: boolean;
|
|
1041
|
-
readonly route: {
|
|
1042
|
-
readonly path: string;
|
|
1043
|
-
readonly matchChildren: boolean;
|
|
1044
|
-
};
|
|
1045
|
-
readonly branding: {
|
|
1046
|
-
readonly title: string;
|
|
1047
|
-
readonly subtitle: string;
|
|
1048
|
-
readonly welcomeMessage: string;
|
|
1049
|
-
readonly placeholder: string;
|
|
1050
|
-
readonly logoUrl: string | null;
|
|
1051
|
-
readonly disclaimer: string;
|
|
1052
|
-
};
|
|
1053
|
-
readonly session: {
|
|
1054
|
-
readonly policy: QaSessionPolicy;
|
|
1055
|
-
readonly storageKey: string;
|
|
1056
|
-
readonly cwd: string | null;
|
|
1057
|
-
readonly workspaceId: string | null;
|
|
1058
|
-
readonly fixedSessionId: string | null;
|
|
1059
|
-
readonly agentPreset: string | null;
|
|
1060
|
-
readonly provider: string | null;
|
|
1061
|
-
readonly model: string | null;
|
|
1062
|
-
readonly reasoningEffort: string | null;
|
|
1063
|
-
readonly maxActiveRequests: number;
|
|
1064
|
-
};
|
|
1065
|
-
readonly ui: {
|
|
1066
|
-
readonly showHeader: boolean;
|
|
1067
|
-
readonly showReset: boolean;
|
|
1068
|
-
readonly showStop: boolean;
|
|
1069
|
-
readonly showTimestamps: boolean;
|
|
1070
|
-
readonly showToolActivity: boolean;
|
|
1071
|
-
readonly showReasoning: boolean;
|
|
1072
|
-
readonly renderMarkdown: boolean;
|
|
1073
|
-
readonly minContentWidth: number;
|
|
1074
|
-
readonly showSessionList: boolean;
|
|
1075
|
-
readonly subagentCodenames: boolean;
|
|
1076
|
-
};
|
|
1077
|
-
readonly suggestedQuestions: readonly string[];
|
|
1078
|
-
readonly thinkingPhrases: readonly string[];
|
|
1079
|
-
readonly interaction: {
|
|
1080
|
-
readonly approvals: QaApprovalInteraction;
|
|
1081
|
-
readonly questions: QaQuestionInteraction;
|
|
1082
|
-
};
|
|
1083
|
-
readonly lockdown: {
|
|
1084
|
-
readonly enabled: boolean;
|
|
1085
|
-
readonly enforceFixedAgentPreset: boolean;
|
|
1086
|
-
readonly enforceFixedWorkspace: boolean;
|
|
1087
|
-
readonly enforceFixedModel: boolean;
|
|
1088
|
-
readonly sandboxMode: QaSandboxMode;
|
|
1089
|
-
readonly approvalPolicy: QaApprovalPolicy;
|
|
1090
|
-
readonly permissionPreset: string;
|
|
1091
|
-
readonly allowPermissionChanges: false;
|
|
1092
|
-
readonly allowSlashCommands: boolean;
|
|
1093
|
-
readonly allowSettingsMutation: false;
|
|
1094
|
-
readonly allowSessionReset: boolean;
|
|
1095
|
-
readonly allowSessionRename: false;
|
|
1096
|
-
readonly allowSessionDelete: false;
|
|
1097
|
-
readonly allowArbitrarySessionOpen: false;
|
|
1098
|
-
readonly toolPolicy: {
|
|
1099
|
-
readonly mode: QaToolPolicyMode;
|
|
1100
|
-
readonly allow: readonly string[];
|
|
1101
|
-
};
|
|
1102
|
-
readonly sharedReadOnlyRoots: readonly string[];
|
|
1103
|
-
};
|
|
1104
|
-
readonly slashCommands: ResolvedQaSlashCommands;
|
|
1105
|
-
readonly embedding: {
|
|
1106
|
-
readonly frameAncestors: string | null;
|
|
1107
|
-
};
|
|
1108
|
-
readonly accounts: {
|
|
1109
|
-
readonly enabled: boolean;
|
|
1110
|
-
readonly allowRegistration: boolean;
|
|
1111
|
-
readonly sessionTtlDays: number;
|
|
1112
|
-
/** Login/registration attempts accepted per rolling minute, store-wide. */
|
|
1113
|
-
readonly maxAuthAttemptsPerMinute: number;
|
|
1114
|
-
readonly showOtherUsersChats: boolean;
|
|
1115
|
-
readonly perUserWorkspace: boolean;
|
|
1116
|
-
readonly retention: {
|
|
1117
|
-
readonly pruneVanishedSessions: boolean;
|
|
1118
|
-
readonly ownershipGraceHours: number;
|
|
1119
|
-
readonly sweepIntervalMinutes: number;
|
|
1120
|
-
};
|
|
1121
|
-
readonly profile: {
|
|
1122
|
-
readonly enabled: boolean;
|
|
1123
|
-
readonly inject: boolean;
|
|
1124
|
-
readonly identities: readonly QaAccountIdentityField[];
|
|
1125
|
-
readonly instructionsMaxLength: number;
|
|
1126
|
-
};
|
|
1127
|
-
/** Per-account starter buttons above an empty composer. */
|
|
1128
|
-
readonly starters: {
|
|
1129
|
-
readonly enabled: boolean;
|
|
1130
|
-
};
|
|
1131
|
-
/**
|
|
1132
|
-
* Personal Skills. Resolution turns the flag off on any deployment that
|
|
1133
|
-
* cannot give every account its own directory: the storage root is the
|
|
1134
|
-
* account's own workspace, so there is no safe shared fallback.
|
|
1135
|
-
*/
|
|
1136
|
-
skills: {
|
|
1137
|
-
readonly enabled: boolean;
|
|
1138
|
-
readonly relativeRoot: string;
|
|
1139
|
-
readonly watch: boolean;
|
|
1140
|
-
readonly maxSkillBytes: number;
|
|
1141
|
-
readonly allowResourceEditing: boolean;
|
|
1142
|
-
};
|
|
1143
|
-
};
|
|
1144
|
-
readonly entry: {
|
|
1145
|
-
readonly redirectNonLoopback: boolean;
|
|
1146
|
-
readonly cookieBootstrap: boolean;
|
|
1147
|
-
};
|
|
1148
|
-
/** Channels a finished turn of this browser's own chats may use. */
|
|
1149
|
-
readonly notifications: {
|
|
1150
|
-
readonly enabled: boolean;
|
|
1151
|
-
readonly allowOs: boolean;
|
|
1152
|
-
};
|
|
1153
|
-
readonly tools: {
|
|
1154
|
-
readonly dynamicActivation: boolean;
|
|
1155
|
-
readonly activationSkill: string;
|
|
1156
|
-
readonly activationMode: QaToolActivationMode;
|
|
1157
|
-
readonly activationPresets: readonly string[];
|
|
1158
|
-
/**
|
|
1159
|
-
* Absolute documentation root the QA catalogue reads, or `""` for the
|
|
1160
|
-
* `docs/` directory inside each chat's own workspace.
|
|
1161
|
-
*/
|
|
1162
|
-
readonly docsRoot: string;
|
|
1163
|
-
/**
|
|
1164
|
-
* Version a search without `version` and without `path` stays inside, or
|
|
1165
|
-
* `""` for a search across every edition the corpus carries.
|
|
1166
|
-
*/
|
|
1167
|
-
readonly docsDefaultVersion: string;
|
|
1168
|
-
/** Whether the deployment's default version is in force. */
|
|
1169
|
-
readonly docsDefaultVersionEnabled: boolean;
|
|
1170
|
-
};
|
|
1171
|
-
readonly sources: {
|
|
1172
|
-
readonly enabled: boolean;
|
|
1173
|
-
readonly retention: {
|
|
1174
|
-
readonly maxTurnsPerSession: number;
|
|
1175
|
-
readonly maxSessions: number;
|
|
1176
|
-
readonly maxAgeDays: number;
|
|
1177
|
-
readonly sweepIntervalMinutes: number;
|
|
1178
|
-
};
|
|
1179
|
-
readonly collect: {
|
|
1180
|
-
readonly parentAgent: boolean;
|
|
1181
|
-
readonly subagents: boolean;
|
|
1182
|
-
readonly persistTurnEvent: boolean;
|
|
1183
|
-
};
|
|
1184
|
-
readonly display: {
|
|
1185
|
-
readonly sidebar: boolean;
|
|
1186
|
-
readonly footer: boolean;
|
|
1187
|
-
readonly groupByKind: boolean;
|
|
1188
|
-
readonly showDiscovered: boolean;
|
|
1189
|
-
readonly showOriginBadges: boolean;
|
|
1190
|
-
readonly maxInitiallyVisiblePerGroup: number;
|
|
1191
|
-
};
|
|
1192
|
-
readonly webSearch: {
|
|
1193
|
-
readonly promoteSearchResultsWithoutFetch: boolean;
|
|
1194
|
-
readonly maxPromotedPerSearch: number;
|
|
1195
|
-
};
|
|
1196
|
-
readonly dedupe: {
|
|
1197
|
-
readonly normalizeUrls: boolean;
|
|
1198
|
-
readonly stripTrackingParams: boolean;
|
|
1199
|
-
readonly mergeFileRanges: boolean;
|
|
1200
|
-
};
|
|
1201
|
-
readonly filePreview: {
|
|
1202
|
-
readonly enabled: boolean;
|
|
1203
|
-
readonly markdownRenderedByDefault: boolean;
|
|
1204
|
-
readonly allowRawToggle: boolean;
|
|
1205
|
-
readonly maxBytes: number;
|
|
1206
|
-
readonly maxMarkdownRenderBytes: number;
|
|
1207
|
-
readonly maxListingEntries: number;
|
|
1208
|
-
};
|
|
1209
|
-
readonly subagents: {
|
|
1210
|
-
readonly inheritSources: boolean;
|
|
1211
|
-
readonly enableReportToolFallback: boolean;
|
|
1212
|
-
readonly markIncompleteOpaqueRuns: boolean;
|
|
1213
|
-
readonly validateReportedSources: boolean;
|
|
1214
|
-
};
|
|
1215
|
-
readonly legacy: {
|
|
1216
|
-
readonly parseAssistantSourcesBlock: boolean;
|
|
1217
|
-
};
|
|
1218
|
-
};
|
|
1219
|
-
readonly attachments: {
|
|
1220
|
-
readonly textFiles: boolean;
|
|
1221
|
-
readonly pastedTextLines: number;
|
|
1222
|
-
readonly maxFileBytes: number;
|
|
1223
|
-
readonly maxPending: number;
|
|
1224
|
-
readonly extensions: readonly string[];
|
|
1225
|
-
};
|
|
1226
|
-
readonly notes: {
|
|
1227
|
-
readonly identity: {
|
|
1228
|
-
readonly enabled: boolean;
|
|
1229
|
-
readonly template: string;
|
|
1230
|
-
};
|
|
1231
|
-
readonly sources: {
|
|
1232
|
-
readonly enabled: boolean;
|
|
1233
|
-
readonly template: string;
|
|
1234
|
-
readonly fallbackTemplate: string;
|
|
1235
|
-
};
|
|
1236
|
-
readonly delegation: {
|
|
1237
|
-
readonly enabled: boolean;
|
|
1238
|
-
readonly template: string;
|
|
1239
|
-
};
|
|
1240
|
-
readonly documents: {
|
|
1241
|
-
readonly enabled: boolean;
|
|
1242
|
-
readonly template: string;
|
|
1243
|
-
};
|
|
1244
|
-
readonly sourcePriority: {
|
|
1245
|
-
readonly enabled: boolean;
|
|
1246
|
-
readonly template: string;
|
|
1247
|
-
};
|
|
1248
|
-
};
|
|
1249
|
-
readonly integration: {
|
|
1250
|
-
readonly enabled: boolean;
|
|
1251
|
-
readonly basePath: string;
|
|
1252
|
-
readonly tokenTtlDays: number;
|
|
1253
|
-
readonly requestTimeoutMs: number;
|
|
1254
|
-
readonly maxConcurrent: number;
|
|
1255
|
-
readonly requestsPerMinute: number;
|
|
1256
|
-
readonly maxRequestBytes: number;
|
|
1257
|
-
readonly maxAttachmentBytes: number;
|
|
1258
|
-
readonly maxAnswerCharacters: number;
|
|
1259
|
-
};
|
|
1260
|
-
}
|
|
1261
|
-
/** Which native registry one unified entry came from. */
|
|
1262
|
-
export type QaSlashEntryKind = "skill" | "command";
|
|
1263
|
-
/** How one half of the catalog admits native entries. */
|
|
1264
|
-
export type QaSlashPolicyMode = "deny-all" | "allow-list" | "all";
|
|
1265
|
-
export interface QaSlashPolicyConfig {
|
|
1266
|
-
readonly mode?: QaSlashPolicyMode;
|
|
1267
|
-
readonly allow?: readonly string[];
|
|
1268
|
-
}
|
|
1269
|
-
export interface QaSlashPaletteConfig {
|
|
1270
|
-
readonly enabled?: boolean;
|
|
1271
|
-
/** Run the two weakest matcher rungs (substring, subsequence). */
|
|
1272
|
-
readonly fuzzySearch?: boolean;
|
|
1273
|
-
readonly maxVisible?: number;
|
|
1274
|
-
readonly showDescriptions?: boolean;
|
|
1275
|
-
readonly showKindBadge?: boolean;
|
|
1276
|
-
}
|
|
1277
|
-
export interface QaSlashCommandsConfig {
|
|
1278
|
-
readonly skills?: QaSlashPolicyConfig;
|
|
1279
|
-
readonly commands?: QaSlashPolicyConfig;
|
|
1280
|
-
readonly palette?: QaSlashPaletteConfig;
|
|
1281
|
-
}
|
|
1282
|
-
export interface ResolvedQaSlashCommands {
|
|
1283
|
-
/** Mirror of `lockdown.allowSlashCommands`; the one master switch. */
|
|
1284
|
-
readonly enabled: boolean;
|
|
1285
|
-
readonly skills: {
|
|
1286
|
-
readonly mode: QaSlashPolicyMode;
|
|
1287
|
-
readonly allow: readonly string[];
|
|
1288
|
-
};
|
|
1289
|
-
readonly commands: {
|
|
1290
|
-
readonly mode: QaSlashPolicyMode;
|
|
1291
|
-
readonly allow: readonly string[];
|
|
1292
|
-
};
|
|
1293
|
-
readonly palette: {
|
|
1294
|
-
readonly enabled: boolean;
|
|
1295
|
-
readonly fuzzySearch: boolean;
|
|
1296
|
-
readonly maxVisible: number;
|
|
1297
|
-
readonly showDescriptions: boolean;
|
|
1298
|
-
readonly showKindBadge: boolean;
|
|
1299
|
-
};
|
|
1300
|
-
/**
|
|
1301
|
-
* True when the deployment turned the master switch on without declaring a
|
|
1302
|
-
* `slashCommands` section: skills then admit every user-invocable skill the
|
|
1303
|
-
* session already exposes, commands stay denied. The Host logs it once, so
|
|
1304
|
-
* an upgrade cannot silently widen anything.
|
|
1305
|
-
*/
|
|
1306
|
-
readonly legacyDefaults: boolean;
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* One palette row. `id` is the routing identity: skill and command may share a
|
|
1310
|
-
* name, so identity is `skill:<name>` or `command:<name>` and never the bare
|
|
1311
|
-
* name the two halves would collide on.
|
|
1312
|
-
*/
|
|
1313
|
-
export interface QaSlashCatalogEntry {
|
|
1314
|
-
readonly id: string;
|
|
1315
|
-
readonly kind: QaSlashEntryKind;
|
|
1316
|
-
readonly name: string;
|
|
1317
|
-
readonly description: string;
|
|
1318
|
-
/** Skill-only: the native `whenToUse`, rendered as secondary copy. */
|
|
1319
|
-
readonly whenToUse?: string;
|
|
1320
|
-
/** Skill-only: whether the model is also offered this skill. */
|
|
1321
|
-
readonly modelInvocable?: boolean;
|
|
1322
|
-
/** Command-only: the advertised argument shape. */
|
|
1323
|
-
readonly inputHint?: string;
|
|
1324
|
-
/** Command-only: whether the executor admits composer attachments. */
|
|
1325
|
-
readonly acceptsAttachments?: boolean;
|
|
1326
|
-
}
|
|
1327
|
-
/**
|
|
1328
|
-
* Whether the command half of the catalog could be read. `inactive` is the
|
|
1329
|
-
* ordinary state of a cold chat: the native command registry resolves through
|
|
1330
|
-
* a live Agent, and a chat with none answers with no commands rather than an
|
|
1331
|
-
* error — the palette then offers skills alone.
|
|
1332
|
-
*/
|
|
1333
|
-
export type QaSlashCommandSurface = "ready" | "unavailable" | "inactive";
|
|
1334
|
-
export interface QaSlashCatalog {
|
|
1335
|
-
/** False while `lockdown.allowSlashCommands` is off. */
|
|
1336
|
-
readonly enabled: boolean;
|
|
1337
|
-
readonly entries: readonly QaSlashCatalogEntry[];
|
|
1338
|
-
readonly commandSurface: QaSlashCommandSurface;
|
|
1339
|
-
/**
|
|
1340
|
-
* User-invocable skills of this chat that the deployment or the chat's role
|
|
1341
|
-
* withheld from the palette. Naming them is what lets the browser warn about
|
|
1342
|
-
* a `/name` typed inside an ordinary prompt — the native gesture path never
|
|
1343
|
-
* consults this list, so it is a courtesy, not an authorization.
|
|
1344
|
-
*/
|
|
1345
|
-
readonly deniedSkills: readonly string[];
|
|
1346
|
-
}
|
|
1347
|
-
/**
|
|
1348
|
-
* One composer attachment offered to a human command. The same two shapes the
|
|
1349
|
-
* prompt path uses — an image rides inline, a file rides its staged receipt —
|
|
1350
|
-
* because the native executor admits both through one attachment store.
|
|
1351
|
-
*/
|
|
1352
|
-
export type QaSlashSubmitAttachment = {
|
|
1353
|
-
readonly type: "image";
|
|
1354
|
-
readonly mediaType: QaImageMediaType;
|
|
1355
|
-
readonly data: string;
|
|
1356
|
-
readonly name?: string;
|
|
1357
|
-
} | {
|
|
1358
|
-
readonly type: "file";
|
|
1359
|
-
readonly receiptId: string;
|
|
1360
|
-
};
|
|
1361
|
-
/** Why a command line was refused before, or instead of, running. */
|
|
1362
|
-
export type QaSlashRefusal = "slash-disabled" | "unknown-command" | "not-allowed" | "attachments-unsupported" | "inactive-session";
|
|
1363
|
-
export type QaSlashCommandOutcome = {
|
|
1364
|
-
readonly kind: "success";
|
|
1365
|
-
readonly text?: string;
|
|
1366
|
-
/** Earlier authoritative event this result is presented from. */
|
|
1367
|
-
readonly sourceEventSeq?: number;
|
|
1368
|
-
} | {
|
|
1369
|
-
readonly kind: "error";
|
|
1370
|
-
readonly text: string;
|
|
1371
|
-
};
|
|
1372
|
-
/**
|
|
1373
|
-
* The result of one admitted command. `refused` is an admission decision and
|
|
1374
|
-
* costs nothing; `executed` means the native runtime ran the handler and the
|
|
1375
|
-
* lifecycle is already in the session log, which is what the transcript row
|
|
1376
|
-
* projects.
|
|
1377
|
-
*/
|
|
1378
|
-
export type QaSlashExecution = {
|
|
1379
|
-
readonly kind: "executed";
|
|
1380
|
-
readonly commandId: string;
|
|
1381
|
-
readonly outcome: QaSlashCommandOutcome;
|
|
1382
|
-
} | {
|
|
1383
|
-
readonly kind: "refused";
|
|
1384
|
-
readonly reason: QaSlashRefusal;
|
|
1385
|
-
/** Host-authored detail; the browser renders its own copy for `reason`. */
|
|
1386
|
-
readonly message: string;
|
|
1387
|
-
};
|
|
1388
|
-
/** One entry of the palette the browser is filtering. */
|
|
1389
|
-
export interface QaSlashView {
|
|
1390
|
-
readonly enabled: boolean;
|
|
1391
|
-
readonly state: "idle" | "loading" | "ready" | "error";
|
|
1392
|
-
readonly entries: readonly QaSlashCatalogEntry[];
|
|
1393
|
-
readonly commandSurface: QaSlashCommandSurface;
|
|
1394
|
-
readonly deniedSkills: readonly string[];
|
|
1395
|
-
/** Set when the catalog could not be read; ordinary prompts keep working. */
|
|
1396
|
-
readonly error: string | null;
|
|
1397
|
-
/**
|
|
1398
|
-
* Bumped when the surface must re-open a palette the user had dismissed —
|
|
1399
|
-
* an ambiguous `/name` is the case that needs it. The composer watches the
|
|
1400
|
-
* counter rather than the message, so a refusal can be re-stated.
|
|
1401
|
-
*/
|
|
1402
|
-
readonly reopen: number;
|
|
1403
|
-
}
|
|
1404
|
-
/**
|
|
1405
|
-
* One human command line projected into the transcript. Commands never enter
|
|
1406
|
-
* the model conversation, so this row is their only visible trace; it is a
|
|
1407
|
-
* control row, not an assistant bubble.
|
|
1408
|
-
*/
|
|
1409
|
-
export interface QaCommandActivity {
|
|
1410
|
-
readonly commandId: string;
|
|
1411
|
-
readonly name: string;
|
|
1412
|
-
/** Verbatim text after the name, with its separator whitespace removed. */
|
|
1413
|
-
readonly args?: string;
|
|
1414
|
-
readonly state: "running" | "success" | "error";
|
|
1415
|
-
readonly resultText?: string;
|
|
1416
|
-
readonly sourceEventSeq?: number;
|
|
1417
|
-
}
|
|
1418
|
-
export interface QaSourceFilePreview {
|
|
1419
|
-
readonly path: string;
|
|
1420
|
-
readonly content: string;
|
|
1421
|
-
readonly size: number;
|
|
1422
|
-
readonly truncated: boolean;
|
|
1423
|
-
readonly markdown: boolean;
|
|
1424
|
-
readonly renderableMarkdown: boolean;
|
|
1425
|
-
}
|
|
1426
|
-
/**
|
|
1427
|
-
* A file the panel renders by conversion rather than by bytes: the document
|
|
1428
|
-
* pipeline turned a Word file into PDF, and the browser shows that PDF.
|
|
1429
|
-
*/
|
|
1430
|
-
export interface QaDocumentPreview {
|
|
1431
|
-
readonly kind: "pdf";
|
|
1432
|
-
readonly base64: string;
|
|
1433
|
-
readonly mime: "application/pdf";
|
|
1434
|
-
readonly name: string;
|
|
1435
|
-
readonly bytes: number;
|
|
1436
|
-
}
|
|
1437
|
-
/** One directory entry of a chat's own workspace, as the files panel browses it. */
|
|
1438
|
-
export interface QaWorkspaceEntry {
|
|
1439
|
-
readonly name: string;
|
|
1440
|
-
readonly type: "file" | "directory";
|
|
1441
|
-
readonly size: number | null;
|
|
1442
|
-
}
|
|
1443
|
-
/**
|
|
1444
|
-
* One directory of the chat's workspace. `path` is the canonical form of the
|
|
1445
|
-
* directory as requested — the chat root itself is the empty string — so the
|
|
1446
|
-
* panel can build a breadcrumb without another round trip.
|
|
1447
|
-
*/
|
|
1448
|
-
export interface QaWorkspaceListing {
|
|
1449
|
-
readonly path: string;
|
|
1450
|
-
readonly entries: readonly QaWorkspaceEntry[];
|
|
1451
|
-
/** More children existed than one listing carries. */
|
|
1452
|
-
readonly truncated: boolean;
|
|
1453
|
-
}
|
|
1454
|
-
/**
|
|
1455
|
-
* One file of the chat's workspace: decoded text when it reads as UTF-8, base64
|
|
1456
|
-
* bytes when it does not. The panel needs both — documents the agent produced
|
|
1457
|
-
* are binary, while notes and transcripts preview as text.
|
|
1458
|
-
*/
|
|
1459
|
-
export interface QaWorkspaceFile {
|
|
1460
|
-
readonly path: string;
|
|
1461
|
-
readonly size: number;
|
|
1462
|
-
readonly truncated: boolean;
|
|
1463
|
-
readonly markdown: boolean;
|
|
1464
|
-
readonly renderableMarkdown: boolean;
|
|
1465
|
-
readonly mime: string;
|
|
1466
|
-
/** Present when the file decoded as text; absent for binary content. */
|
|
1467
|
-
readonly text?: string;
|
|
1468
|
-
/** Present when the file is not text; base64 of at most the byte cap. */
|
|
1469
|
-
readonly base64?: string;
|
|
1470
|
-
}
|
|
1471
|
-
/** Host-attested facts required before the QA composer may become writable. */
|
|
1472
|
-
export interface QaLockdownProof {
|
|
1473
|
-
readonly sessionId: string;
|
|
1474
|
-
readonly enabled: boolean;
|
|
1475
|
-
readonly agentPresetMatches: boolean;
|
|
1476
|
-
readonly workspaceMatches: boolean;
|
|
1477
|
-
readonly modelMatches: boolean;
|
|
1478
|
-
readonly sandboxModeMatches: boolean;
|
|
1479
|
-
readonly approvalIsNever: boolean;
|
|
1480
|
-
readonly permissionPreset: string;
|
|
1481
|
-
readonly toolPolicyLoaded: boolean;
|
|
1482
|
-
readonly toolAllowList: readonly string[];
|
|
1483
|
-
}
|
|
1484
|
-
export interface QaUserMessage {
|
|
1485
|
-
readonly id: string;
|
|
1486
|
-
readonly role: "user";
|
|
1487
|
-
readonly text: string;
|
|
1488
|
-
/** `pending` is a browser-only optimistic row until the Host emits it. */
|
|
1489
|
-
readonly status: "pending" | "committed";
|
|
1490
|
-
readonly timestamp?: number;
|
|
1491
|
-
readonly images?: readonly QaImageView[];
|
|
1492
|
-
/** Durable files the user attached to this message, in prompt order. */
|
|
1493
|
-
readonly files?: readonly QaFileView[];
|
|
1494
|
-
/**
|
|
1495
|
-
* Chat owner's display name, set only for an admin reading a foreign
|
|
1496
|
-
* chat; the owner themself sees their messages unlabeled.
|
|
1497
|
-
*/
|
|
1498
|
-
readonly author?: string;
|
|
1499
|
-
}
|
|
1500
|
-
/** Browser-only user row shown while the Host prepares the accepted turn. */
|
|
1501
|
-
export type QaPendingUserMessage = Omit<QaUserMessage, "status"> & {
|
|
1502
|
-
readonly status: "pending";
|
|
1503
|
-
};
|
|
1504
|
-
export type QaMessage = QaUserMessage | {
|
|
1505
|
-
readonly id: string;
|
|
1506
|
-
readonly role: "assistant";
|
|
1507
|
-
readonly text: string;
|
|
1508
|
-
readonly status: "streaming" | "committed" | "failed";
|
|
1509
|
-
readonly timestamp?: number;
|
|
1510
|
-
/**
|
|
1511
|
-
* Position of this answer in the session's durable event log. Feedback is
|
|
1512
|
-
* keyed to it: a rating survives a replay, a reload and a role change,
|
|
1513
|
-
* while the browser's own message id does not.
|
|
1514
|
-
*/
|
|
1515
|
-
readonly seq?: number;
|
|
1516
|
-
/** Host turn this answer belongs to; groups regenerations into variants. */
|
|
1517
|
-
readonly turn?: number;
|
|
1518
|
-
/**
|
|
1519
|
-
* Files this turn produced, in the order the tools reported them. The
|
|
1520
|
-
* answer is the place a produced document is handed over: without these
|
|
1521
|
-
* cards the file exists only as a path in a paragraph, and a reader who
|
|
1522
|
-
* does not know the files tab concludes nothing was made.
|
|
1523
|
-
*/
|
|
1524
|
-
readonly artifacts?: readonly QaArtifactView[];
|
|
1525
|
-
/** Canonical evidence snapshot shared with this answer's source drawer. */
|
|
1526
|
-
readonly sources?: readonly QaSource[];
|
|
1527
|
-
readonly sourcesComplete?: boolean;
|
|
1528
|
-
readonly incompleteSourceOrigins?: QaTurnSources["incompleteOrigins"];
|
|
1529
|
-
/** Host-recorded response timing, present on finalized messages only. */
|
|
1530
|
-
readonly stats?: {
|
|
1531
|
-
/** step start → final message. */
|
|
1532
|
-
readonly durationMs: number;
|
|
1533
|
-
/** step start → first token; null when no token delta was recorded. */
|
|
1534
|
-
readonly ttftMs: number | null;
|
|
1535
|
-
/** Estimated from visible text (≈4 chars/token) over the generation window. */
|
|
1536
|
-
readonly tokensPerSecond: number | null;
|
|
1537
|
-
};
|
|
1538
|
-
} | {
|
|
1539
|
-
readonly id: string;
|
|
1540
|
-
readonly role: "system";
|
|
1541
|
-
readonly text: string;
|
|
1542
|
-
readonly status: "info" | "error";
|
|
1543
|
-
readonly timestamp?: number;
|
|
1544
|
-
/**
|
|
1545
|
-
* Set on a human command row. Commands stay out of the model
|
|
1546
|
-
* conversation, so this projection is the only trace the user sees.
|
|
1547
|
-
*/
|
|
1548
|
-
readonly command?: QaCommandActivity;
|
|
1549
|
-
/** Collapsible settlement row (subagent finished/stopped/failed). */
|
|
1550
|
-
readonly notice?: {
|
|
1551
|
-
readonly title: string;
|
|
1552
|
-
readonly body: string;
|
|
1553
|
-
/** Muted correlation line above the body (task name, session id). */
|
|
1554
|
-
readonly meta?: string;
|
|
1555
|
-
};
|
|
1556
|
-
} | {
|
|
1557
|
-
readonly id: string;
|
|
1558
|
-
readonly role: "work";
|
|
1559
|
-
readonly turn: number;
|
|
1560
|
-
/**
|
|
1561
|
-
* "error" marks a turn the host ended with a provider failure; "stopped"
|
|
1562
|
-
* marks one the user ended, whose answer is a prefix rather than a reply.
|
|
1563
|
-
*/
|
|
1564
|
-
readonly status: "running" | "complete" | "error" | "stopped";
|
|
1565
|
-
readonly startedAt?: number;
|
|
1566
|
-
readonly endedAt?: number;
|
|
1567
|
-
readonly items: readonly QaWorkItem[];
|
|
1568
|
-
};
|
|
1569
|
-
export type QaWorkItem = {
|
|
1570
|
-
readonly id: string;
|
|
1571
|
-
readonly kind: "reasoning" | "progress";
|
|
1572
|
-
readonly text: string;
|
|
1573
|
-
readonly status: "running" | "complete";
|
|
1574
|
-
} | {
|
|
1575
|
-
readonly id: string;
|
|
1576
|
-
readonly kind: "tool";
|
|
1577
|
-
readonly name: string;
|
|
1578
|
-
readonly label: string;
|
|
1579
|
-
readonly summary: string;
|
|
1580
|
-
readonly input: string | null;
|
|
1581
|
-
readonly output: string | null;
|
|
1582
|
-
readonly status: "running" | "ok" | "error" | "stopped";
|
|
1583
|
-
/** Durable child id, present on subagent launch calls that started one. */
|
|
1584
|
-
readonly subagentId?: string;
|
|
1585
|
-
readonly startedAt?: number;
|
|
1586
|
-
readonly endedAt?: number;
|
|
1587
|
-
};
|
|
1588
|
-
export type QaSessionPhase = "idle" | "creating" | "ready" | "running" | "reconnecting" | "blocked" | "error";
|
|
1
|
+
export type * from "./types/policy.js";
|
|
2
|
+
export type * from "./types/capability.js";
|
|
3
|
+
export type * from "./types/access.js";
|
|
4
|
+
export type * from "./types/accounts.js";
|
|
5
|
+
export type * from "./types/skills.js";
|
|
6
|
+
export type * from "./types/expert-memory.js";
|
|
7
|
+
export type * from "./types/config.js";
|
|
8
|
+
export type * from "./types/slash.js";
|
|
9
|
+
export type * from "./types/documents.js";
|
|
10
|
+
export type * from "./types/session.js";
|
|
11
|
+
export type * from "./types/quality.js";
|
|
12
|
+
export type * from "./types/admin.js";
|
|
1589
13
|
export type { QaSourceEvidence, QaSourceKind, QaSourceLocation, QaSourceOrigin, QaSourceReference, QaTurnSources, } from "./provenance/types.js";
|
|
1590
|
-
|
|
1591
|
-
export type QaSource = import("./provenance/types.js").QaSourceReference;
|
|
1592
|
-
/** Raster formats the attachment path accepts (mirrors the host contract). */
|
|
1593
|
-
export type QaImageMediaType = "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
1594
|
-
/** One image pending in the composer, browser-owned until the prompt lands. */
|
|
1595
|
-
export interface QaImageDraft {
|
|
1596
|
-
readonly kind: "image";
|
|
1597
|
-
readonly id: string;
|
|
1598
|
-
readonly mediaType: QaImageMediaType;
|
|
1599
|
-
readonly name: string;
|
|
1600
|
-
/** Canonical base64 of the image bytes, without the data: URL prefix. */
|
|
1601
|
-
readonly data: string;
|
|
1602
|
-
/** Local object URL for the preview thumbnail. */
|
|
1603
|
-
readonly previewUrl: string;
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* One file pending in the composer. The bytes stay in the browser until the
|
|
1607
|
-
* prompt is sent: an image can ride the prompt inline, but a file must be
|
|
1608
|
-
* staged through the Host upload route first and then cited by its receipt.
|
|
1609
|
-
*/
|
|
1610
|
-
export interface QaFileDraft {
|
|
1611
|
-
readonly kind: "file";
|
|
1612
|
-
readonly id: string;
|
|
1613
|
-
readonly name: string;
|
|
1614
|
-
readonly bytes: number;
|
|
1615
|
-
/** Verbatim payload; a pasted blob is a File built from the pasted text. */
|
|
1616
|
-
readonly blob: Blob;
|
|
1617
|
-
}
|
|
1618
|
-
/** Anything the composer may hold before the prompt is sent. */
|
|
1619
|
-
export type QaAttachmentDraft = QaImageDraft | QaFileDraft;
|
|
1620
|
-
/** A durable image attached to a sent message. */
|
|
1621
|
-
export interface QaImageView {
|
|
1622
|
-
readonly attachmentId: string;
|
|
1623
|
-
readonly mediaType: QaImageMediaType;
|
|
1624
|
-
/** Browser-local thumbnail URL, present only on an optimistic message. */
|
|
1625
|
-
readonly previewUrl?: string;
|
|
1626
|
-
}
|
|
1627
|
-
/**
|
|
1628
|
-
* A durable file attached to a sent message. The browser never reads these
|
|
1629
|
-
* bytes back (the attachment route serves images); the row shows the handle
|
|
1630
|
-
* the model resolves, and the Host keeps the verbatim copy.
|
|
1631
|
-
*/
|
|
1632
|
-
export interface QaFileView {
|
|
1633
|
-
readonly attachmentId: string;
|
|
1634
|
-
readonly name: string;
|
|
1635
|
-
readonly bytes: number;
|
|
1636
|
-
}
|
|
1637
|
-
/**
|
|
1638
|
-
* A file the agent produced during the turn an answer belongs to.
|
|
1639
|
-
*
|
|
1640
|
-
* An artifact has no attachment-store handle: it lives in the chat's own
|
|
1641
|
-
* workspace, so the card addresses it by the workspace-relative name the
|
|
1642
|
-
* producing tool reported — the spelling the Host's workspace reads take, and
|
|
1643
|
-
* the only spelling that cannot publish the directory the deployment keeps
|
|
1644
|
-
* this account's workspace in.
|
|
1645
|
-
*/
|
|
1646
|
-
export interface QaArtifactView {
|
|
1647
|
-
/** Workspace-relative path; the identifier every workspace read takes. */
|
|
1648
|
-
readonly path: string;
|
|
1649
|
-
/** Last path segment, which is what the card is signed with. */
|
|
1650
|
-
readonly name: string;
|
|
1651
|
-
/** Format the producing tool reported: `docx`, `pdf` or `md`. */
|
|
1652
|
-
readonly format: string;
|
|
1653
|
-
/** Bytes as the tool reported them; 0 when it reported no size. */
|
|
1654
|
-
readonly bytes: number;
|
|
1655
|
-
}
|
|
1656
|
-
/** A subagent transcript opened read-only from the agents panel. */
|
|
1657
|
-
export interface QaSubagentView {
|
|
1658
|
-
readonly id: string;
|
|
1659
|
-
readonly title: string;
|
|
1660
|
-
}
|
|
1661
|
-
/**
|
|
1662
|
-
* One tool call waiting for the operator. The browser lists these over its own
|
|
1663
|
-
* remote and answers them one by one; nothing here is answered automatically.
|
|
1664
|
-
*/
|
|
1665
|
-
export interface QaPendingApproval {
|
|
1666
|
-
readonly id: string;
|
|
1667
|
-
/** The chat the request belongs to: a delegated child asks under its root. */
|
|
1668
|
-
readonly sessionId: string;
|
|
1669
|
-
readonly toolName: string;
|
|
1670
|
-
/** The reason the composed gate gave for asking, when it gave one. */
|
|
1671
|
-
readonly reason: string | null;
|
|
1672
|
-
readonly createdAt: number;
|
|
1673
|
-
/** True when a delegated child of the chat made the call. */
|
|
1674
|
-
readonly delegated: boolean;
|
|
1675
|
-
}
|
|
1676
|
-
/**
|
|
1677
|
-
* One question waiting for the operator, normalized for the form the QA view
|
|
1678
|
-
* renders. The protocol fields are the harness user-questions contract; absent
|
|
1679
|
-
* ones become explicit nulls so the browser never branches on undefined.
|
|
1680
|
-
*/
|
|
1681
|
-
export interface QaPendingQuestionItem {
|
|
1682
|
-
readonly id: string;
|
|
1683
|
-
readonly question: string;
|
|
1684
|
-
readonly header: string | null;
|
|
1685
|
-
readonly detail: string | null;
|
|
1686
|
-
readonly options: readonly QaPendingQuestionOption[];
|
|
1687
|
-
readonly multiSelect: boolean;
|
|
1688
|
-
}
|
|
1689
|
-
export interface QaPendingQuestionOption {
|
|
1690
|
-
readonly label: string;
|
|
1691
|
-
readonly description: string | null;
|
|
1692
|
-
}
|
|
1693
|
-
/**
|
|
1694
|
-
* One user-questions request parked for the operator. A single request carries
|
|
1695
|
-
* every question the model asked in one call, so the card is a form with a
|
|
1696
|
-
* pager, not a list of independent prompts.
|
|
1697
|
-
*/
|
|
1698
|
-
export interface QaPendingQuestion {
|
|
1699
|
-
readonly id: string;
|
|
1700
|
-
/** The chat the request belongs to. */
|
|
1701
|
-
readonly sessionId: string;
|
|
1702
|
-
readonly questions: readonly QaPendingQuestionItem[];
|
|
1703
|
-
readonly createdAt: number;
|
|
1704
|
-
}
|
|
1705
|
-
/**
|
|
1706
|
-
* One message that waits for the agent's next turn. Rows the Host already
|
|
1707
|
-
* admitted carry their durable occurrence id, which is what a queue operation
|
|
1708
|
-
* addresses; a row still in flight carries a browser id and edits nothing.
|
|
1709
|
-
*/
|
|
1710
|
-
export interface QaQueueRow {
|
|
1711
|
-
readonly id: string;
|
|
1712
|
-
/** Short single-line text for the strip; newlines are folded away. */
|
|
1713
|
-
readonly preview: string;
|
|
1714
|
-
/** Full text to edit, or null when the row is not plain text. */
|
|
1715
|
-
readonly text: string | null;
|
|
1716
|
-
/** Attachments the row carries besides its text. */
|
|
1717
|
-
readonly attachments: number;
|
|
1718
|
-
/** Set for a local row the Host queue has not echoed back yet. */
|
|
1719
|
-
readonly sending: boolean;
|
|
1720
|
-
}
|
|
1721
|
-
/** What the queue strip may ask the Host to do with one waiting message. */
|
|
1722
|
-
export type QaQueueOperation = "edit" | "remove" | "steer";
|
|
1723
|
-
/**
|
|
1724
|
-
* What `qaSurface/queueStatus` answers: how much of the deployment's request
|
|
1725
|
-
* ceiling is in use right now. The Host counts the chats whose agent is running
|
|
1726
|
-
* a turn, so the load is read where the whole of it is visible rather than
|
|
1727
|
-
* guessed from one browser's view of the stand.
|
|
1728
|
-
*/
|
|
1729
|
-
export interface QaQueueStatus {
|
|
1730
|
-
/** The configured ceiling; 0 means the deployment sets none. */
|
|
1731
|
-
readonly limit: number;
|
|
1732
|
-
/**
|
|
1733
|
-
* Turns answering at the moment of the read, this visitor's own included —
|
|
1734
|
-
* the stand cannot tell a place it owes someone from one it owes you.
|
|
1735
|
-
*/
|
|
1736
|
-
readonly active: number;
|
|
1737
|
-
/** Whether one more turn fits; false while no ceiling is set. */
|
|
1738
|
-
readonly full: boolean;
|
|
1739
|
-
}
|
|
1740
|
-
export interface QaSessionState {
|
|
1741
|
-
readonly phase: QaSessionPhase;
|
|
1742
|
-
readonly sessionId: string | null;
|
|
1743
|
-
/**
|
|
1744
|
-
* Identity of the chat the surface is showing. Unique across every chat the
|
|
1745
|
-
* page has opened — a controller that is re-created for a new chat is handed
|
|
1746
|
-
* a new identity, so a component keyed by it cannot carry one chat's composer
|
|
1747
|
-
* text into another. It is taken only when the chat changes: a draft that
|
|
1748
|
-
* creates its session on the first prompt keeps its key, because the composer
|
|
1749
|
-
* holds an unsent question in component state, and remounting it on the new
|
|
1750
|
-
* session id would throw that text away before the Host has accepted
|
|
1751
|
-
* anything. `0` means no chat — see `QA_SESSION_IDLE_STATE`.
|
|
1752
|
-
*/
|
|
1753
|
-
readonly chatKey: number;
|
|
1754
|
-
readonly messages: readonly QaMessage[];
|
|
1755
|
-
/** Immediate send feedback, kept outside the durable transcript. */
|
|
1756
|
-
readonly pendingMessage: QaPendingUserMessage | null;
|
|
1757
|
-
readonly error: string | null;
|
|
1758
|
-
/**
|
|
1759
|
-
* An owner-authorized historical chat whose recorded composition no longer
|
|
1760
|
-
* matches the deployment. Its transcript remains visible, but no Host
|
|
1761
|
-
* operation may be issued through this binding.
|
|
1762
|
-
*/
|
|
1763
|
-
readonly compatibilityReadOnly?: boolean;
|
|
1764
|
-
readonly canSend: boolean;
|
|
1765
|
-
readonly canStop: boolean;
|
|
1766
|
-
/**
|
|
1767
|
-
* Messages waiting for the next turn, oldest first. Sending while the agent
|
|
1768
|
-
* runs lands here instead of in the transcript, so the strip beside the
|
|
1769
|
-
* composer is the only place the user can still see them.
|
|
1770
|
-
*/
|
|
1771
|
-
readonly queue: readonly QaQueueRow[];
|
|
1772
|
-
/** Whether a queue operation may be issued on this binding right now. */
|
|
1773
|
-
readonly canEditQueue: boolean;
|
|
1774
|
-
/** Bumped whenever this browser's chat index changes (add/forget). */
|
|
1775
|
-
readonly chatsRevision: number;
|
|
1776
|
-
/** Tool-derived sources of the current chat (web targets and files read). */
|
|
1777
|
-
readonly sources: readonly QaSource[];
|
|
1778
|
-
readonly sourcesComplete: boolean;
|
|
1779
|
-
readonly incompleteSourceOrigins: QaTurnSources["incompleteOrigins"];
|
|
1780
|
-
/** Set while the bound session is a subagent watched from the panel. */
|
|
1781
|
-
readonly viewingSubagent: QaSubagentView | null;
|
|
1782
|
-
/** Tool calls parked for the operator's answer, oldest first. */
|
|
1783
|
-
readonly approvals: readonly QaPendingApproval[];
|
|
1784
|
-
/** Question requests parked for the operator's answer, oldest first. */
|
|
1785
|
-
readonly questions: readonly QaPendingQuestion[];
|
|
1786
|
-
/**
|
|
1787
|
-
* Set when a send was held back because the stand is already answering as
|
|
1788
|
-
* many questions as it allows. The question never left the browser, so this
|
|
1789
|
-
* is the whole of what the visitor is told about it; the surface answers with
|
|
1790
|
-
* the request-ceiling dialog and the composer keeps the draft. Named apart
|
|
1791
|
-
* from `queue`, which is the same chat's list of waiting messages.
|
|
1792
|
-
*/
|
|
1793
|
-
readonly requestQueue: QaQueueStatus | null;
|
|
1794
|
-
/** Slash palette state, keyed to the chat this snapshot describes. */
|
|
1795
|
-
readonly slash: QaSlashView;
|
|
1796
|
-
}
|
|
1797
|
-
/** Minimal server-trusted identity exposed to principal-scoped plugins. */
|
|
1798
|
-
export interface QaPrincipal {
|
|
1799
|
-
readonly userId: string;
|
|
1800
|
-
}
|
|
1801
|
-
/** A user's verdict on one assistant message. Binary by design. */
|
|
1802
|
-
export type QaFeedbackRating = "positive" | "negative";
|
|
1803
|
-
/**
|
|
1804
|
-
* Optional negative-feedback reasons. The list is short on purpose: asking for
|
|
1805
|
-
* a precise cause at rating time costs more answers than it buys insight, and
|
|
1806
|
-
* a reviewer classifies the hard cases afterwards.
|
|
1807
|
-
*/
|
|
1808
|
-
export type QaFeedbackReason = "incorrect" | "instruction_not_followed" | "missing_information" | "outdated_information" | "tool_issue" | "too_verbose" | "too_short" | "other";
|
|
1809
|
-
/** One user's rating of one assistant message. */
|
|
1810
|
-
export interface QaMessageFeedback {
|
|
1811
|
-
readonly id: string;
|
|
1812
|
-
readonly conversationId: string;
|
|
1813
|
-
readonly messageId: string;
|
|
1814
|
-
readonly userId: string;
|
|
1815
|
-
readonly rating: QaFeedbackRating;
|
|
1816
|
-
readonly reasons?: readonly QaFeedbackReason[];
|
|
1817
|
-
readonly comment?: string;
|
|
1818
|
-
readonly createdAt: string;
|
|
1819
|
-
readonly updatedAt?: string;
|
|
1820
|
-
}
|
|
1821
|
-
/** The rating fields a browser may write; identity and time are Host-owned. */
|
|
1822
|
-
export interface QaMessageFeedbackInput {
|
|
1823
|
-
readonly rating: QaFeedbackRating;
|
|
1824
|
-
readonly reasons?: readonly QaFeedbackReason[];
|
|
1825
|
-
readonly comment?: string;
|
|
1826
|
-
}
|
|
1827
|
-
/**
|
|
1828
|
-
* One rating a browser still holds locally: a verdict given while the surface
|
|
1829
|
-
* had no way to file it, replayed by the harvest. Reasons never ride along —
|
|
1830
|
-
* the browser's map only ever stored the thumbs.
|
|
1831
|
-
*/
|
|
1832
|
-
export interface QaFeedbackHarvestEntry {
|
|
1833
|
-
readonly conversationId: string;
|
|
1834
|
-
/** The durable log position, exactly as a live rating carries it. */
|
|
1835
|
-
readonly messageId: string;
|
|
1836
|
-
readonly rating: QaFeedbackRating;
|
|
1837
|
-
}
|
|
1838
|
-
/** What one harvest write did; the counts answer for the whole batch. */
|
|
1839
|
-
export interface QaFeedbackHarvestResult {
|
|
1840
|
-
/** Ratings the Host stored now. Replaying the same batch stores none. */
|
|
1841
|
-
readonly recorded: number;
|
|
1842
|
-
/** Entries the Host already held a rating for, left as they were. */
|
|
1843
|
-
readonly present: number;
|
|
1844
|
-
/** Entries refused: not the caller's conversation, or unusable. */
|
|
1845
|
-
readonly rejected: number;
|
|
1846
|
-
}
|
|
1847
|
-
/** Review workflow state of a conversation or one of its messages. */
|
|
1848
|
-
export type QaReviewStatus = "unreviewed" | "in_review" | "reviewed" | "needs_followup";
|
|
1849
|
-
/**
|
|
1850
|
-
* Reviewer taxonomy, grouped the way the spec groups it. Issue ids stay flat so
|
|
1851
|
-
* aggregations never depend on walking a tree in the browser.
|
|
1852
|
-
*/
|
|
1853
|
-
export type QaQualityIssueType = "answer.incorrect" | "answer.incomplete" | "answer.hallucination" | "answer.request_not_followed" | "answer.poor_formatting" | "answer.communication" | "context.missing_conversation" | "context.missing_knowledge" | "context.outdated_knowledge" | "tool.wrong_selection" | "tool.should_have_been_used" | "tool.bad_arguments" | "tool.failure" | "tool.unavailable" | "skill.missing" | "skill.wrong" | "skill.not_followed" | "skill.prompt_policy" | "access.missing_capability" | "access.excessive_capability" | "other";
|
|
1854
|
-
export type QaQualitySeverity = "minor" | "major" | "critical";
|
|
1855
|
-
/** Where a reviewer thinks the fix belongs; the loop's change target. */
|
|
1856
|
-
export type QaRemediationTarget = "prompt" | "skill" | "tool" | "knowledge" | "role" | "model" | "product_ux" | "user_misunderstanding" | "unknown";
|
|
1857
|
-
/** One reviewer result. `needs_followup` keeps the item in the queue. */
|
|
1858
|
-
export interface QaConversationReview {
|
|
1859
|
-
readonly id: string;
|
|
1860
|
-
readonly conversationId: string;
|
|
1861
|
-
readonly messageId?: string;
|
|
1862
|
-
readonly reviewerId: string;
|
|
1863
|
-
readonly status: "reviewed" | "needs_followup";
|
|
1864
|
-
readonly issues: readonly QaQualityIssueType[];
|
|
1865
|
-
readonly severity: QaQualitySeverity;
|
|
1866
|
-
readonly notes?: string;
|
|
1867
|
-
readonly target?: QaRemediationTarget;
|
|
1868
|
-
readonly suggestedAction?: string;
|
|
1869
|
-
readonly createdAt: string;
|
|
1870
|
-
readonly updatedAt?: string;
|
|
1871
|
-
}
|
|
1872
|
-
/** A reviewer's write; ids, author and first-seen time are Host-owned. */
|
|
1873
|
-
export interface QaConversationReviewInput {
|
|
1874
|
-
readonly conversationId: string;
|
|
1875
|
-
readonly messageId?: string;
|
|
1876
|
-
readonly status: "reviewed" | "needs_followup";
|
|
1877
|
-
readonly issues: readonly QaQualityIssueType[];
|
|
1878
|
-
readonly severity: QaQualitySeverity;
|
|
1879
|
-
readonly notes?: string;
|
|
1880
|
-
readonly target?: QaRemediationTarget;
|
|
1881
|
-
readonly suggestedAction?: string;
|
|
1882
|
-
}
|
|
1883
|
-
/** Why a conversation entered the review queue. */
|
|
1884
|
-
export type QaReviewReason = "negative_feedback" | "manual" | "tool_failure" | "automatic";
|
|
1885
|
-
export type QaReviewPriority = "low" | "normal" | "high";
|
|
1886
|
-
/** One queue row: a conversation needing attention, with its derived state. */
|
|
1887
|
-
export interface QaReviewQueueItem {
|
|
1888
|
-
readonly conversationId: string;
|
|
1889
|
-
readonly messageId?: string;
|
|
1890
|
-
readonly reason: QaReviewReason;
|
|
1891
|
-
readonly priority: QaReviewPriority;
|
|
1892
|
-
readonly status: QaReviewStatus;
|
|
1893
|
-
readonly assignedReviewerId?: string;
|
|
1894
|
-
/** ISO time of the signal that put the item in the queue. */
|
|
1895
|
-
readonly raisedAt: string;
|
|
1896
|
-
readonly reviewerId?: string;
|
|
1897
|
-
readonly reviewId?: string;
|
|
1898
|
-
readonly feedbackId?: string;
|
|
1899
|
-
}
|
|
1900
|
-
/** Administrative actions recorded in the audit trail. */
|
|
1901
|
-
export type QaAdminAuditAction = "user.created" | "user.updated" | "user.enabled" | "user.disabled"
|
|
1902
|
-
/** An operator set a new password for an account that had requested one. */
|
|
1903
|
-
| "user.password-reset" | "authorization.changed" | "subrole.assignment.changed" | "subrole.created" | "subrole.updated" | "subrole.deleted" | "common_capabilities.updated" | "conversation.reviewed" | "conversation.deleted" | "review.updated" | "review.queued" | "admin.settings.updated" | "skill.created" | "skill.updated" | "skill.deleted"
|
|
1904
|
-
/** An operator rewrote a line an expert had remembered. */
|
|
1905
|
-
| "memory.corrected"
|
|
1906
|
-
/** One or several remembered lines were deleted; the count is in the target. */
|
|
1907
|
-
| "memory.deleted"
|
|
1908
|
-
/** A whole namespace was emptied. */
|
|
1909
|
-
| "memory.wiped";
|
|
1910
|
-
export interface QaAdminAuditEvent {
|
|
1911
|
-
readonly id: string;
|
|
1912
|
-
readonly timestamp: string;
|
|
1913
|
-
readonly actorId: string;
|
|
1914
|
-
readonly action: QaAdminAuditAction;
|
|
1915
|
-
readonly targetType?: string;
|
|
1916
|
-
readonly targetId?: string;
|
|
1917
|
-
/** JSON snapshots serialized at the storage boundary for a strict Remote type. */
|
|
1918
|
-
readonly before?: string;
|
|
1919
|
-
readonly after?: string;
|
|
1920
|
-
}
|
|
1921
|
-
/**
|
|
1922
|
-
* One tool call as the review viewer shows it. `arguments` and `result` are
|
|
1923
|
-
* preview strings, not raw payloads: the admin redaction seam owns trimming.
|
|
1924
|
-
*/
|
|
1925
|
-
export interface QaConversationToolCall {
|
|
1926
|
-
readonly callId: string;
|
|
1927
|
-
readonly name: string;
|
|
1928
|
-
readonly arguments: string;
|
|
1929
|
-
readonly result?: string;
|
|
1930
|
-
readonly error?: string;
|
|
1931
|
-
readonly time?: number;
|
|
1932
|
-
readonly durationMs?: number;
|
|
1933
|
-
}
|
|
1934
|
-
/** Token accounting of one assistant message, when the log carries it. */
|
|
1935
|
-
export interface QaMessageUsage {
|
|
1936
|
-
readonly inputTokens: number;
|
|
1937
|
-
readonly outputTokens: number;
|
|
1938
|
-
readonly totalTokens?: number;
|
|
1939
|
-
}
|
|
1940
|
-
/** One message in the review viewer, in log order. */
|
|
1941
|
-
export interface QaConversationMessage {
|
|
1942
|
-
/** Stable message identity: the session event seq it was projected from. */
|
|
1943
|
-
readonly id: string;
|
|
1944
|
-
readonly seq: number;
|
|
1945
|
-
readonly role: "user" | "assistant" | "system";
|
|
1946
|
-
readonly text: string;
|
|
1947
|
-
readonly time: number;
|
|
1948
|
-
readonly model?: string;
|
|
1949
|
-
readonly provider?: string;
|
|
1950
|
-
readonly usage?: QaMessageUsage;
|
|
1951
|
-
readonly interrupted?: boolean;
|
|
1952
|
-
readonly toolCalls?: readonly QaConversationToolCall[];
|
|
1953
|
-
/** Ratings of this message by its owner, newest first. */
|
|
1954
|
-
readonly feedback?: readonly QaMessageFeedback[];
|
|
1955
|
-
/** Reviewer results attached to this exact message. */
|
|
1956
|
-
readonly reviews?: readonly QaConversationReview[];
|
|
1957
|
-
}
|
|
1958
|
-
/**
|
|
1959
|
-
* What the agent could use in a conversation, frozen when the session was
|
|
1960
|
-
* reserved. Reviewing an old answer against today's role configuration would
|
|
1961
|
-
* answer the wrong question.
|
|
1962
|
-
*/
|
|
1963
|
-
export interface QaConversationRuntime {
|
|
1964
|
-
readonly subroleId: string;
|
|
1965
|
-
readonly adminPreview: boolean;
|
|
1966
|
-
readonly model?: string;
|
|
1967
|
-
readonly provider?: string;
|
|
1968
|
-
readonly agentPreset?: string;
|
|
1969
|
-
readonly effectiveTools?: readonly string[];
|
|
1970
|
-
readonly effectiveSkills?: readonly string[];
|
|
1971
|
-
/** Skills the model actually loaded, derived from the log's skill tool calls. */
|
|
1972
|
-
readonly loadedSkills?: readonly string[];
|
|
1973
|
-
/** True when the stored log could not be read; counts stay 0 and text is absent. */
|
|
1974
|
-
readonly transcriptUnavailable?: QaTranscriptUnavailableReason;
|
|
1975
|
-
}
|
|
1976
|
-
/** Why a stored transcript could not be projected for the reviewer. */
|
|
1977
|
-
export type QaTranscriptUnavailableReason = "storage-unavailable" | "not-found" | "unreadable";
|
|
1978
|
-
/** One conversation row of the administrative list. */
|
|
1979
|
-
export interface QaConversationSummary {
|
|
1980
|
-
readonly conversationId: string;
|
|
1981
|
-
readonly userId: string;
|
|
1982
|
-
readonly displayName: string;
|
|
1983
|
-
readonly subroleId: string;
|
|
1984
|
-
readonly createdAt: string;
|
|
1985
|
-
/** Newest activity the deployment can see: creation, log tail, or a review. */
|
|
1986
|
-
readonly updatedAt: string;
|
|
1987
|
-
readonly title?: string;
|
|
1988
|
-
readonly messageCount: number;
|
|
1989
|
-
readonly positiveFeedback: number;
|
|
1990
|
-
readonly negativeFeedback: number;
|
|
1991
|
-
readonly reviewStatus: QaReviewStatus;
|
|
1992
|
-
}
|
|
1993
|
-
/** The full review payload of one conversation. */
|
|
1994
|
-
export interface QaConversationDetail {
|
|
1995
|
-
readonly conversationId: string;
|
|
1996
|
-
readonly summary: QaConversationSummary;
|
|
1997
|
-
readonly runtime: QaConversationRuntime;
|
|
1998
|
-
readonly messages: readonly QaConversationMessage[];
|
|
1999
|
-
readonly reviews: readonly QaConversationReview[];
|
|
2000
|
-
readonly queueItems: readonly QaReviewQueueItem[];
|
|
2001
|
-
}
|
|
2002
|
-
/** What one administrative deletion removed, for the console to report. */
|
|
2003
|
-
export interface QaConversationDeletion {
|
|
2004
|
-
readonly conversationId: string;
|
|
2005
|
-
/**
|
|
2006
|
-
* Every session whose stored log is gone, the chat first: a conversation's
|
|
2007
|
-
* subagent sessions are part of it and are removed with it.
|
|
2008
|
-
*/
|
|
2009
|
-
readonly sessions: readonly string[];
|
|
2010
|
-
/** Quality rows dropped with the conversation. */
|
|
2011
|
-
readonly qualityRows: number;
|
|
2012
|
-
}
|
|
2013
|
-
/**
|
|
2014
|
-
* Server-side filter for the conversation list. Every field is optional and
|
|
2015
|
-
* accepts an explicit null: the wire carries whatever the browser has, and an
|
|
2016
|
-
* absent filter must never be mistaken for a filter on `null`.
|
|
2017
|
-
*/
|
|
2018
|
-
export interface QaConversationQuery {
|
|
2019
|
-
readonly userId?: string | null;
|
|
2020
|
-
readonly subroleId?: string | null;
|
|
2021
|
-
readonly from?: string | null;
|
|
2022
|
-
readonly to?: string | null;
|
|
2023
|
-
readonly rating?: QaFeedbackRating | null;
|
|
2024
|
-
readonly reviewStatus?: QaReviewStatus | null;
|
|
2025
|
-
/** Search matches the conversation title and the owner's name or email. */
|
|
2026
|
-
readonly search?: string | null;
|
|
2027
|
-
}
|
|
2028
|
-
/** Server-side filter for the feedback table. */
|
|
2029
|
-
export interface QaFeedbackQuery {
|
|
2030
|
-
readonly rating?: QaFeedbackRating | null;
|
|
2031
|
-
readonly userId?: string | null;
|
|
2032
|
-
readonly subroleId?: string | null;
|
|
2033
|
-
readonly reason?: QaFeedbackReason | null;
|
|
2034
|
-
readonly from?: string | null;
|
|
2035
|
-
readonly to?: string | null;
|
|
2036
|
-
readonly reviewStatus?: QaReviewStatus | null;
|
|
2037
|
-
}
|
|
2038
|
-
/** Server-side filter for the audit table. */
|
|
2039
|
-
export interface QaAuditQuery {
|
|
2040
|
-
readonly actorId?: string | null;
|
|
2041
|
-
readonly action?: QaAdminAuditAction | null;
|
|
2042
|
-
readonly from?: string | null;
|
|
2043
|
-
readonly to?: string | null;
|
|
2044
|
-
}
|
|
2045
|
-
/** Server-side filter for the user list. */
|
|
2046
|
-
export interface QaUserQuery {
|
|
2047
|
-
readonly search?: string | null;
|
|
2048
|
-
readonly status?: "active" | "disabled" | null;
|
|
2049
|
-
readonly role?: QaAccountRole | null;
|
|
2050
|
-
readonly subroleId?: string | null;
|
|
2051
|
-
}
|
|
2052
|
-
/** Cursor page of any admin list. `nextCursor` is null on the last page. */
|
|
2053
|
-
export interface QaAdminPage<T> {
|
|
2054
|
-
readonly items: readonly T[];
|
|
2055
|
-
readonly nextCursor: string | null;
|
|
2056
|
-
readonly total: number;
|
|
2057
|
-
}
|
|
2058
|
-
/** One pending item of the review queue, with the context to triage it. */
|
|
2059
|
-
export interface QaReviewQueueRow extends QaReviewQueueItem {
|
|
2060
|
-
readonly displayName: string;
|
|
2061
|
-
readonly subroleId: string;
|
|
2062
|
-
readonly title?: string;
|
|
2063
|
-
readonly raisedAtLabel: string;
|
|
2064
|
-
readonly issueSummary?: readonly QaQualityIssueType[];
|
|
2065
|
-
readonly severity?: QaQualitySeverity;
|
|
2066
|
-
}
|
|
2067
|
-
/** One row of the feedback table (spec §33). */
|
|
2068
|
-
export interface QaFeedbackRow extends QaMessageFeedback {
|
|
2069
|
-
readonly displayName: string;
|
|
2070
|
-
readonly subroleId: string;
|
|
2071
|
-
readonly conversationTitle?: string;
|
|
2072
|
-
readonly reviewStatus: QaReviewStatus;
|
|
2073
|
-
}
|
|
2074
|
-
/** Aggregated quality counters (spec §27). */
|
|
2075
|
-
export interface QaQualityIssueCount {
|
|
2076
|
-
readonly issue: QaQualityIssueType;
|
|
2077
|
-
readonly count: number;
|
|
2078
|
-
}
|
|
2079
|
-
export interface QaQualityRatingBreakdown {
|
|
2080
|
-
readonly key: string;
|
|
2081
|
-
readonly label: string;
|
|
2082
|
-
readonly rated: number;
|
|
2083
|
-
readonly positive: number;
|
|
2084
|
-
readonly negative: number;
|
|
2085
|
-
readonly positiveRate: number | null;
|
|
2086
|
-
}
|
|
2087
|
-
export interface QaQualityTrendPoint {
|
|
2088
|
-
/** ISO date (UTC) of the bucket. */
|
|
2089
|
-
readonly date: string;
|
|
2090
|
-
readonly rated: number;
|
|
2091
|
-
readonly positive: number;
|
|
2092
|
-
readonly negative: number;
|
|
2093
|
-
}
|
|
2094
|
-
export interface QaQualityMetrics {
|
|
2095
|
-
readonly conversations: number;
|
|
2096
|
-
readonly activeUsers: number;
|
|
2097
|
-
readonly assistantMessages: number;
|
|
2098
|
-
readonly ratedMessages: number;
|
|
2099
|
-
readonly positiveRatings: number;
|
|
2100
|
-
readonly negativeRatings: number;
|
|
2101
|
-
/** Share of assistant messages that carry a rating; null without messages. */
|
|
2102
|
-
readonly ratingRate: number | null;
|
|
2103
|
-
/** Share of positive ratings among rated messages; null without ratings. */
|
|
2104
|
-
readonly positiveRate: number | null;
|
|
2105
|
-
readonly unreviewedNegatives: number;
|
|
2106
|
-
readonly reviewedItems: number;
|
|
2107
|
-
readonly issues: readonly QaQualityIssueCount[];
|
|
2108
|
-
readonly bySubrole: readonly QaQualityRatingBreakdown[];
|
|
2109
|
-
readonly trend: readonly QaQualityTrendPoint[];
|
|
2110
|
-
}
|
|
2111
|
-
/**
|
|
2112
|
-
* One attention line on the admin overview. The Host reports the condition and
|
|
2113
|
-
* its numbers; the browser owns the wording, so an operator's language never
|
|
2114
|
-
* depends on the deployment's locale.
|
|
2115
|
-
*/
|
|
2116
|
-
export interface QaOverviewAlert {
|
|
2117
|
-
readonly level: "critical" | "warning" | "info";
|
|
2118
|
-
readonly code: "unreviewed-negatives" | "subrole-satisfaction" | "recurring-reason";
|
|
2119
|
-
readonly count: number;
|
|
2120
|
-
/** Subrole id or feedback reason, when the condition names one. */
|
|
2121
|
-
readonly subject?: string;
|
|
2122
|
-
/** Positive-feedback share of the subject, when the condition measured one. */
|
|
2123
|
-
readonly rate?: number;
|
|
2124
|
-
}
|
|
2125
|
-
/** The /qa/admin landing payload. */
|
|
2126
|
-
export interface QaAdminOverview {
|
|
2127
|
-
readonly metrics: QaQualityMetrics;
|
|
2128
|
-
readonly alerts: readonly QaOverviewAlert[];
|
|
2129
|
-
readonly recentFeedback: readonly QaFeedbackRow[];
|
|
2130
|
-
readonly queue: readonly QaReviewQueueRow[];
|
|
2131
|
-
}
|
|
2132
|
-
/** The account columns the store owns, without any joined counters. */
|
|
2133
|
-
export interface QaAdminAccountRow {
|
|
2134
|
-
readonly id: string;
|
|
2135
|
-
readonly email: string;
|
|
2136
|
-
readonly displayName: string;
|
|
2137
|
-
readonly fullName: string;
|
|
2138
|
-
readonly role: QaAccountRole;
|
|
2139
|
-
readonly disabled: boolean;
|
|
2140
|
-
readonly createdAt: string;
|
|
2141
|
-
readonly lastLoginAt: string | null;
|
|
2142
|
-
readonly access: QaUserAccess;
|
|
2143
|
-
}
|
|
2144
|
-
/** One user row of the admin user list (spec §5). */
|
|
2145
|
-
export interface QaAdminUserRow extends QaAdminAccountRow {
|
|
2146
|
-
readonly conversations: number;
|
|
2147
|
-
readonly feedbackGiven: number;
|
|
2148
|
-
}
|
|
2149
|
-
/** Everything the user detail page renders, in one payload (spec §6). */
|
|
2150
|
-
export interface QaAdminUserDetail {
|
|
2151
|
-
readonly user: QaAdminUserRow;
|
|
2152
|
-
/** Effective capability counts per assigned subrole, for the access preview. */
|
|
2153
|
-
readonly effective: readonly {
|
|
2154
|
-
readonly subroleId: string;
|
|
2155
|
-
readonly name: string;
|
|
2156
|
-
/** Visible from the first step: system-required, Common and the role. */
|
|
2157
|
-
readonly tools: number;
|
|
2158
|
-
/** The role's ceiling for tools a loaded skill requires. */
|
|
2159
|
-
readonly grantableTools: number;
|
|
2160
|
-
/** Tools the profile withdraws, whatever else grants them. */
|
|
2161
|
-
readonly deniedTools: number;
|
|
2162
|
-
readonly skills: number;
|
|
2163
|
-
}[];
|
|
2164
|
-
readonly activity: {
|
|
2165
|
-
readonly conversations: number;
|
|
2166
|
-
/**
|
|
2167
|
-
* Unknown until the conversations page is opened: the count needs every
|
|
2168
|
-
* conversation's log read, so the detail card reports null instead of
|
|
2169
|
-
* blocking its payload on the scan.
|
|
2170
|
-
*/
|
|
2171
|
-
readonly messages: number | null;
|
|
2172
|
-
readonly positiveRatings: number;
|
|
2173
|
-
readonly negativeRatings: number;
|
|
2174
|
-
};
|
|
2175
|
-
}
|
|
2176
|
-
/** The administrative write of one account; absent fields stay unchanged. */
|
|
2177
|
-
export interface QaAdminUserUpdate {
|
|
2178
|
-
readonly role?: QaAccountRole | null;
|
|
2179
|
-
readonly disabled?: boolean | null;
|
|
2180
|
-
readonly access?: QaUserAccess | null;
|
|
2181
|
-
}
|
|
14
|
+
export type { QaChatAccess, QaChatAuthor, QaChatGrant, QaChatMode, QaChatJson, } from "./chat-sharing/types.js";
|
|
2182
15
|
//# sourceMappingURL=types.d.ts.map
|