@yadsh/dsh-qa-surface 0.9.0 → 0.11.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 +269 -2
- package/lib/access/service.js +49 -10
- package/lib/access/service.js.map +1 -1
- package/lib/account-remotes.js +41 -0
- package/lib/account-remotes.js.map +1 -1
- package/lib/accounts/database.js +140 -0
- package/lib/accounts/database.js.map +1 -1
- package/lib/accounts/errors.js.map +1 -1
- package/lib/accounts/service-token.js +103 -0
- package/lib/accounts/service-token.js.map +1 -0
- package/lib/accounts/store.js +291 -5
- package/lib/accounts/store.js.map +1 -1
- package/lib/admin/conversation-log.js +14 -8
- package/lib/admin/conversation-log.js.map +1 -1
- package/lib/admin/permissions.js +5 -0
- package/lib/admin/permissions.js.map +1 -1
- package/lib/admin/quality-store.js +4 -0
- package/lib/admin/quality-store.js.map +1 -1
- package/lib/admin/service.js +180 -7
- package/lib/admin/service.js.map +1 -1
- package/lib/admin/session-log.js +39 -8
- package/lib/admin/session-log.js.map +1 -1
- package/lib/attachment-rules.js +39 -6
- package/lib/attachment-rules.js.map +1 -1
- package/lib/cli.js +83 -1
- package/lib/cli.js.map +1 -1
- package/lib/client/QaAccountsController.js +213 -4
- package/lib/client/QaAccountsController.js.map +1 -1
- package/lib/client/QaSessionController.js +49 -21
- package/lib/client/QaSessionController.js.map +1 -1
- package/lib/client/QaSurface.js +51 -9
- package/lib/client/QaSurface.js.map +1 -1
- package/lib/client/QaSurfaceGuard.js +12 -5
- package/lib/client/QaSurfaceGuard.js.map +1 -1
- package/lib/client/admin/QaAdmin.js +14 -2
- package/lib/client/admin/QaAdmin.js.map +1 -1
- package/lib/client/admin/pages/SkillFiles.js +78 -0
- package/lib/client/admin/pages/SkillFiles.js.map +1 -0
- package/lib/client/admin/pages/Users.js +74 -3
- package/lib/client/admin/pages/Users.js.map +1 -1
- package/lib/client/admin/routes.js +8 -1
- package/lib/client/admin/routes.js.map +1 -1
- package/lib/client/admin/shared.js +5 -1
- package/lib/client/admin/shared.js.map +1 -1
- package/lib/client/admin/styles.js +2 -0
- package/lib/client/admin/styles.js.map +1 -1
- package/lib/client/attachments.js +41 -11
- package/lib/client/attachments.js.map +1 -1
- package/lib/client/base64.js +22 -1
- package/lib/client/base64.js.map +1 -1
- package/lib/client/components/QaAgentsDrawer.js +9 -6
- package/lib/client/components/QaAgentsDrawer.js.map +1 -1
- package/lib/client/components/QaApproval.js +1 -1
- package/lib/client/components/QaApproval.js.map +1 -1
- package/lib/client/components/QaAuthGate.js +19 -10
- package/lib/client/components/QaAuthGate.js.map +1 -1
- package/lib/client/components/QaChangelog.js +56 -0
- package/lib/client/components/QaChangelog.js.map +1 -1
- package/lib/client/components/QaFilesPanel.js +17 -11
- package/lib/client/components/QaFilesPanel.js.map +1 -1
- package/lib/client/components/QaHeader.js +3 -11
- package/lib/client/components/QaHeader.js.map +1 -1
- package/lib/client/components/QaModal.js.map +1 -1
- package/lib/client/components/QaQuestions.js +4 -4
- package/lib/client/components/QaQuestions.js.map +1 -1
- package/lib/client/components/QaSidebar.js +10 -2
- package/lib/client/components/QaSidebar.js.map +1 -1
- package/lib/client/components/QaWidthHandle.js +111 -5
- package/lib/client/components/QaWidthHandle.js.map +1 -1
- package/lib/client/components/QaWorkspaceBrowser.js +231 -0
- package/lib/client/components/QaWorkspaceBrowser.js.map +1 -0
- package/lib/client/index.js +122 -53
- package/lib/client/index.js.map +1 -1
- package/lib/client/kiosk.js +51 -0
- package/lib/client/kiosk.js.map +1 -0
- package/lib/client/lineage.js +64 -0
- package/lib/client/lineage.js.map +1 -1
- package/lib/client/markdown/blocks.js +122 -7
- package/lib/client/markdown/blocks.js.map +1 -1
- package/lib/client/markdown/inline.js +108 -12
- package/lib/client/markdown/inline.js.map +1 -1
- package/lib/client/markdown/katex-css.js +12 -0
- package/lib/client/markdown/katex-css.js.map +1 -0
- package/lib/client/markdown/math.js +84 -0
- package/lib/client/markdown/math.js.map +1 -0
- package/lib/client/markdown/render.js +74 -5
- package/lib/client/markdown/render.js.map +1 -1
- package/lib/client/settings/card.js +2 -2
- package/lib/client/settings/card.js.map +1 -1
- package/lib/client/settings/sections/attachments.js +6 -5
- package/lib/client/settings/sections/attachments.js.map +1 -1
- package/lib/client/settings/sections/notes.js +64 -0
- package/lib/client/settings/sections/notes.js.map +1 -0
- package/lib/client/settings/sections/sources.js +4 -1
- package/lib/client/settings/sections/sources.js.map +1 -1
- package/lib/client/settings/sections.js +1 -0
- package/lib/client/settings/sections.js.map +1 -1
- package/lib/client/settlement.js +1 -1
- package/lib/client/settlement.js.map +1 -1
- package/lib/client/source-preview.js +3 -0
- package/lib/client/source-preview.js.map +1 -1
- package/lib/client/styles.js +106 -18
- package/lib/client/styles.js.map +1 -1
- package/lib/client/types.js.map +1 -1
- package/lib/client/user-settings/IntegrationTokensPage.js +150 -0
- package/lib/client/user-settings/IntegrationTokensPage.js.map +1 -0
- package/lib/client/user-settings/PasswordSettingsPage.js +48 -0
- package/lib/client/user-settings/PasswordSettingsPage.js.map +1 -0
- package/lib/client/user-settings/SkillCatalog.js +2 -2
- package/lib/client/user-settings/SkillCatalog.js.map +1 -1
- package/lib/client/user-settings/UserSettingsDialog.js +17 -2
- package/lib/client/user-settings/UserSettingsDialog.js.map +1 -1
- package/lib/client/user-settings/copy.js +20 -0
- package/lib/client/user-settings/copy.js.map +1 -1
- package/lib/client.js +31007 -686
- package/lib/client.js.map +1 -1
- package/lib/config-resolvers/attachments.js +6 -5
- package/lib/config-resolvers/attachments.js.map +1 -1
- package/lib/config-resolvers/defaults.js +33 -2
- package/lib/config-resolvers/defaults.js.map +1 -1
- package/lib/config-resolvers/integration.js +94 -0
- package/lib/config-resolvers/integration.js.map +1 -0
- package/lib/config-resolvers/notes.js +26 -0
- package/lib/config-resolvers/notes.js.map +1 -0
- package/lib/config-resolvers/sources.js +4 -0
- package/lib/config-resolvers/sources.js.map +1 -1
- package/lib/config.js +107 -0
- package/lib/config.js.map +1 -1
- package/lib/index.js +348 -12
- package/lib/index.js.map +1 -1
- package/lib/integration/answer.js +100 -0
- package/lib/integration/answer.js.map +1 -0
- package/lib/integration/attachments.js +231 -0
- package/lib/integration/attachments.js.map +1 -0
- package/lib/integration/contract.js +53 -0
- package/lib/integration/contract.js.map +1 -0
- package/lib/integration/host-runner.js +243 -0
- package/lib/integration/host-runner.js.map +1 -0
- package/lib/integration/http.js +538 -0
- package/lib/integration/http.js.map +1 -0
- package/lib/integration/service.js +331 -0
- package/lib/integration/service.js.map +1 -0
- package/lib/integration/transcript-reader.js +202 -0
- package/lib/integration/transcript-reader.js.map +1 -0
- package/lib/integration/transcript.js +148 -0
- package/lib/integration/transcript.js.map +1 -0
- package/lib/personal-skills/index.js +2 -2
- package/lib/personal-skills/index.js.map +1 -1
- package/lib/personal-skills/paths.js +14 -8
- package/lib/personal-skills/paths.js.map +1 -1
- package/lib/personal-skills/provider.js +16 -4
- package/lib/personal-skills/provider.js.map +1 -1
- package/lib/personal-skills/service.js +240 -30
- package/lib/personal-skills/service.js.map +1 -1
- package/lib/prompt-notes.js +103 -6
- package/lib/prompt-notes.js.map +1 -1
- package/lib/provenance/document-preview.js +60 -0
- package/lib/provenance/document-preview.js.map +1 -0
- package/lib/provenance/file-preview.js +191 -19
- package/lib/provenance/file-preview.js.map +1 -1
- package/lib/qa-tools/catalog.js +18 -1
- package/lib/qa-tools/catalog.js.map +1 -1
- package/lib/qa-tools/docs-tools.js +563 -0
- package/lib/qa-tools/docs-tools.js.map +1 -0
- package/lib/qa-tools/file-delete-gate.js +60 -0
- package/lib/qa-tools/file-delete-gate.js.map +1 -0
- package/lib/qa-tools/file-delete.js +156 -0
- package/lib/qa-tools/file-delete.js.map +1 -0
- package/lib/resolve-config.js +6 -0
- package/lib/resolve-config.js.map +1 -1
- package/lib/secure-session.js +83 -3
- package/lib/secure-session.js.map +1 -1
- package/lib/shared/documents.js +22 -0
- package/lib/shared/documents.js.map +1 -0
- package/lib/shared/integration-tokens.js +23 -0
- package/lib/shared/integration-tokens.js.map +1 -0
- package/lib/typert.host.js +1320 -134
- package/lib/typert.remote-client.d.ts +33 -1
- package/lib/typert.remote-client.js +1102 -74
- package/lib/types/access/service.d.ts +33 -2
- package/lib/types/account-remotes.d.ts +30 -1
- package/lib/types/accounts/database.d.ts +53 -0
- package/lib/types/accounts/errors.d.ts +5 -1
- package/lib/types/accounts/service-token.d.ts +70 -0
- package/lib/types/accounts/store.d.ts +131 -1
- package/lib/types/admin/conversation-log.d.ts +12 -0
- package/lib/types/admin/service.d.ts +56 -1
- package/lib/types/admin/session-log.d.ts +21 -0
- package/lib/types/attachment-rules.d.ts +26 -3
- package/lib/types/client/QaAccountsController.d.ts +64 -5
- package/lib/types/client/QaSessionController.d.ts +24 -2
- package/lib/types/client/admin/pages/SkillFiles.d.ts +17 -0
- package/lib/types/client/admin/routes.d.ts +2 -0
- package/lib/types/client/admin/shared.d.ts +2 -0
- package/lib/types/client/attachments.d.ts +21 -4
- package/lib/types/client/base64.d.ts +13 -1
- package/lib/types/client/components/QaAgentsDrawer.d.ts +2 -1
- package/lib/types/client/components/QaFilesPanel.d.ts +16 -4
- package/lib/types/client/components/QaHeader.d.ts +9 -3
- package/lib/types/client/components/QaModal.d.ts +4 -3
- package/lib/types/client/components/QaWidthHandle.d.ts +48 -2
- package/lib/types/client/components/QaWorkspaceBrowser.d.ts +15 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/kiosk.d.ts +34 -0
- package/lib/types/client/lineage.d.ts +42 -0
- package/lib/types/client/markdown/blocks.d.ts +14 -1
- package/lib/types/client/markdown/inline.d.ts +23 -7
- package/lib/types/client/markdown/katex-css.d.ts +11 -0
- package/lib/types/client/markdown/math.d.ts +23 -0
- package/lib/types/client/markdown/render.d.ts +2 -1
- package/lib/types/client/settings/sections/notes.d.ts +12 -0
- package/lib/types/client/settings/sections.d.ts +1 -0
- package/lib/types/client/settlement.d.ts +4 -1
- package/lib/types/client/styles.d.ts +15 -2
- package/lib/types/client/types.d.ts +120 -1
- package/lib/types/client/user-settings/IntegrationTokensPage.d.ts +21 -0
- package/lib/types/client/user-settings/PasswordSettingsPage.d.ts +19 -0
- package/lib/types/client/user-settings/UserSettingsDialog.d.ts +11 -2
- package/lib/types/client/user-settings/copy.d.ts +10 -1
- package/lib/types/config-resolvers/integration.d.ts +47 -0
- package/lib/types/config-resolvers/notes.d.ts +10 -0
- package/lib/types/config.d.ts +10 -0
- package/lib/types/index.d.ts +111 -1
- package/lib/types/integration/answer.d.ts +65 -0
- package/lib/types/integration/attachments.d.ts +85 -0
- package/lib/types/integration/contract.d.ts +196 -0
- package/lib/types/integration/host-runner.d.ts +44 -0
- package/lib/types/integration/http.d.ts +79 -0
- package/lib/types/integration/service.d.ts +120 -0
- package/lib/types/integration/transcript-reader.d.ts +100 -0
- package/lib/types/integration/transcript.d.ts +59 -0
- package/lib/types/personal-skills/index.d.ts +2 -2
- package/lib/types/personal-skills/paths.d.ts +15 -3
- package/lib/types/personal-skills/provider.d.ts +14 -2
- package/lib/types/personal-skills/service.d.ts +89 -14
- package/lib/types/prompt-notes.d.ts +37 -0
- package/lib/types/provenance/document-preview.d.ts +28 -0
- package/lib/types/provenance/file-preview.d.ts +69 -2
- package/lib/types/qa-tools/catalog.d.ts +1 -1
- package/lib/types/qa-tools/docs-tools.d.ts +160 -0
- package/lib/types/qa-tools/file-delete-gate.d.ts +42 -0
- package/lib/types/qa-tools/file-delete.d.ts +32 -0
- package/lib/types/secure-session.d.ts +52 -1
- package/lib/types/shared/documents.d.ts +20 -0
- package/lib/types/shared/integration-tokens.d.ts +24 -0
- package/lib/types/types.d.ts +263 -3
- package/lib/types/ui-mode.d.ts +18 -0
- package/lib/ui-mode.js +22 -0
- package/lib/ui-mode.js.map +1 -0
- package/package.json +12 -10
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type { QaAccountProfileInput, QaAccountStartersInput, QaAccountUserPublic, QaOwnershipEntry, ResolvedQaSurfaceConfig } from "../types.js";
|
|
2
|
-
import type { QaAccountsApi, StorageLike } from "./types.js";
|
|
1
|
+
import type { QaAccountProfileInput, QaAccountStartersInput, QaAccountUserPublic, QaIssuedServiceToken, QaOwnershipEntry, QaServiceTokenCreateInput, QaServiceTokenSummary, ResolvedQaSurfaceConfig } from "../types.js";
|
|
2
|
+
import type { QaAccountsApi, QaIntegrationTokenResult, StorageLike } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* What the sign-in card says after a forgotten-password request. It names the
|
|
5
|
+
* request, never the account: a real address and an unknown one get the same
|
|
6
|
+
* sentence, which is the whole point of the endpoint.
|
|
7
|
+
*/
|
|
8
|
+
export declare const QA_RESET_FILED_NOTICE = "\u0417\u0430\u044F\u0432\u043A\u0430 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0443. \u0415\u0441\u043B\u0438 \u0442\u0430\u043A\u043E\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442 \u0435\u0441\u0442\u044C, \u043F\u0430\u0440\u043E\u043B\u044C \u0441\u0431\u0440\u043E\u0441\u044F\u0442 \u2014 \u0437\u0430\u0442\u0435\u043C \u0432\u043E\u0439\u0434\u0438\u0442\u0435 \u0441 \u043D\u043E\u0432\u044B\u043C \u043F\u0430\u0440\u043E\u043B\u0435\u043C.";
|
|
3
9
|
export type QaAccountsSnapshot = {
|
|
4
10
|
readonly stage: "checking";
|
|
5
11
|
} | {
|
|
6
12
|
readonly stage: "gate";
|
|
7
|
-
readonly mode: "login" | "register";
|
|
13
|
+
readonly mode: "login" | "register" | "reset";
|
|
8
14
|
readonly busy: boolean;
|
|
9
15
|
readonly error: string | null;
|
|
16
|
+
/** Neutral confirmation of a filed reset request; null otherwise. */
|
|
17
|
+
readonly notice?: string | null;
|
|
10
18
|
} | {
|
|
11
19
|
readonly stage: "authed";
|
|
12
20
|
readonly user: QaAccountUserPublic;
|
|
@@ -67,11 +75,45 @@ export declare class QaAccountsController {
|
|
|
67
75
|
start(): Promise<void>;
|
|
68
76
|
login(email: string, password: string): Promise<void>;
|
|
69
77
|
register(email: string, password: string): Promise<void>;
|
|
70
|
-
setMode(mode: "login" | "register"): void;
|
|
78
|
+
setMode(mode: "login" | "register" | "reset"): void;
|
|
79
|
+
/**
|
|
80
|
+
* File a forgotten-password request for the operator queue. The card says
|
|
81
|
+
* the same thing whether or not the address exists — the Host refuses to
|
|
82
|
+
* tell, and so does this controller.
|
|
83
|
+
*/
|
|
84
|
+
requestPasswordReset(email: string): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Change the signed-in user's own password. The Host answers with a fresh
|
|
87
|
+
* token, because the write bumps the account's token version — this browser
|
|
88
|
+
* keeps its session only by storing that token. Resolves to audience-safe
|
|
89
|
+
* refusal copy, or to null once the snapshot carries the new account.
|
|
90
|
+
*/
|
|
91
|
+
changePassword(currentPassword: string, nextPassword: string): Promise<string | null>;
|
|
71
92
|
/** Drop the token and return to the gate (logout or expired identity). */
|
|
72
93
|
signOut(): void;
|
|
73
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Claim one freshly created chat so the ownership map stays current, and
|
|
96
|
+
* remember it in the owned list the sidebar shows.
|
|
97
|
+
*
|
|
98
|
+
* The claim runs on every bind — a chat created now and one reopened later
|
|
99
|
+
* both take this path. A chat the Host reports as taken by another account
|
|
100
|
+
* stays out of the list: the page then holds a binding whose ownership
|
|
101
|
+
* belongs to someone else, and showing it is exactly what the list must not
|
|
102
|
+
* do. A claim that never reached the Host still records the id, because the
|
|
103
|
+
* page opened this chat through the attendance boundary, which claims an
|
|
104
|
+
* unowned chat for whoever asks first and refuses another account's — so the
|
|
105
|
+
* binding is this account's either way, and hiding a chat the visitor is
|
|
106
|
+
* looking at would be the greater lie.
|
|
107
|
+
*/
|
|
74
108
|
claimNewSession(sessionId: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Add one chat this page holds to the owned list. The list is what the
|
|
111
|
+
* sidebar shows and what every cross-chat projection is scoped by, so a chat
|
|
112
|
+
* created or opened after login enters it here — the next login is not a
|
|
113
|
+
* reasonable price for a chat the visitor is looking at. Ids already known,
|
|
114
|
+
* and the ones an admin's cross-user view contributed, are left as they are.
|
|
115
|
+
*/
|
|
116
|
+
private noteOwnedSession;
|
|
75
117
|
/**
|
|
76
118
|
* Replace the signed-in user's own profile. Resolves to audience-safe
|
|
77
119
|
* refusal copy when the Host rejected the write, and to null once the
|
|
@@ -85,6 +127,23 @@ export declare class QaAccountsController {
|
|
|
85
127
|
* carries the stored record, so the composer picks the new buttons up.
|
|
86
128
|
*/
|
|
87
129
|
updateStarters(input: QaAccountStartersInput): Promise<string | null>;
|
|
130
|
+
/**
|
|
131
|
+
* The signed-in user's integration tokens. Resolves to the list, or to the
|
|
132
|
+
* copy the page renders when the Host refused the read; the tokens are not
|
|
133
|
+
* part of the account snapshot, because they are not part of the account.
|
|
134
|
+
*/
|
|
135
|
+
serviceTokens(): Promise<QaIntegrationTokenResult<readonly QaServiceTokenSummary[]>>;
|
|
136
|
+
/**
|
|
137
|
+
* Mint one integration token for the signed-in user. The plaintext is in the
|
|
138
|
+
* answer and nowhere else — the caller has to hand it over now, because
|
|
139
|
+
* nothing can show it again.
|
|
140
|
+
*/
|
|
141
|
+
createServiceToken(input: QaServiceTokenCreateInput): Promise<QaIntegrationTokenResult<QaIssuedServiceToken>>;
|
|
142
|
+
/**
|
|
143
|
+
* Revoke one of the signed-in user's integration tokens. The Host is the
|
|
144
|
+
* authority on whose token it is; a refusal is shown as it arrives.
|
|
145
|
+
*/
|
|
146
|
+
revokeServiceToken(tokenId: string): Promise<QaIntegrationTokenResult<null>>;
|
|
88
147
|
private authenticate;
|
|
89
148
|
/** Own the account, migrate the legacy index, then project authed. */
|
|
90
149
|
private enterSession;
|
|
@@ -233,8 +233,18 @@ export declare class QaSessionController {
|
|
|
233
233
|
viewSubagent(id: string, title: string): Promise<void>;
|
|
234
234
|
/** Leave the subagent transcript and re-open the chat it was launched from. */
|
|
235
235
|
closeSubagent(): Promise<void>;
|
|
236
|
-
/**
|
|
237
|
-
*
|
|
236
|
+
/**
|
|
237
|
+
* This browser's chat ids: the account's owned chats while accounts are on,
|
|
238
|
+
* else the browser-local index. Either way they intersect the host session
|
|
239
|
+
* list at projection time.
|
|
240
|
+
*
|
|
241
|
+
* The local index is what this browser accumulated, not an identity: with
|
|
242
|
+
* accounts on it is the set the page *claims* at login, never one it lists.
|
|
243
|
+
* Unioning it in would show a chat another account started — its title, its
|
|
244
|
+
* timestamp, its live activity — on a shared browser, and a chat this page
|
|
245
|
+
* has yet to claim is added to the owned list by the claim itself, so the
|
|
246
|
+
* index has nothing left to supply.
|
|
247
|
+
*/
|
|
238
248
|
chatIds(): readonly string[];
|
|
239
249
|
/** The bound session id, or null while no chat is bound. */
|
|
240
250
|
activeSessionId(): string | null;
|
|
@@ -281,8 +291,20 @@ export declare class QaSessionController {
|
|
|
281
291
|
* delegation's description verbatim; a child the host listed without a
|
|
282
292
|
* catalog falls back to its own list title. Tolerates a host bundle older
|
|
283
293
|
* than either field: an absent snapshot piece just contributes no names.
|
|
294
|
+
*
|
|
295
|
+
* Only the chats this page lists contribute: the host list is the whole
|
|
296
|
+
* deployment's, so an unfiltered read would hand another account's
|
|
297
|
+
* delegation into this browser — and a notice signed with a name that is
|
|
298
|
+
* not the chat's own is exactly the leak the chat list itself is scoped
|
|
299
|
+
* against.
|
|
284
300
|
*/
|
|
285
301
|
private subagentNames;
|
|
302
|
+
/**
|
|
303
|
+
* The chats this page may show and name: the account's owned list while
|
|
304
|
+
* accounts are on, and `undefined` — every chat on the Host — for a
|
|
305
|
+
* deployment without accounts, where the list is the browser's own.
|
|
306
|
+
*/
|
|
307
|
+
private visibleChatIds;
|
|
286
308
|
private fail;
|
|
287
309
|
/**
|
|
288
310
|
* Attest the currently bound session. `ok` carries the session id the proof
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { QaAdminApi } from "../../types.js";
|
|
2
|
+
export interface AdminSkillFilesProps {
|
|
3
|
+
readonly api: QaAdminApi;
|
|
4
|
+
readonly token: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Skill files: the deployment's shared skills, and the personal skills of one
|
|
8
|
+
* named account.
|
|
9
|
+
*
|
|
10
|
+
* The page is a scope picker around the very component a person edits their
|
|
11
|
+
* own skills with — there is no second editor, because a second editor is a
|
|
12
|
+
* second set of rules for what a `SKILL.md` may contain. What the console adds
|
|
13
|
+
* is the choice of store, the naming of its owner, and the fact that its writes
|
|
14
|
+
* are recorded as an administrator's.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AdminSkillFiles(props: AdminSkillFilesProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=SkillFiles.d.ts.map
|
|
@@ -17,6 +17,8 @@ export declare function useAdminResource<T>(load: () => Promise<RemoteResult<T>>
|
|
|
17
17
|
readonly error: string | undefined;
|
|
18
18
|
readonly loading: boolean;
|
|
19
19
|
reload: () => Promise<void>;
|
|
20
|
+
/** Adopt a value this page already holds, without re-asking the Host. */
|
|
21
|
+
apply: (value: T) => void;
|
|
20
22
|
};
|
|
21
23
|
/** A status chip; the modifier class carries the semantic colour. */
|
|
22
24
|
export declare function Badge(props: {
|
|
@@ -24,14 +24,31 @@ export interface QaAttachmentLimits {
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function attachmentLimits(config: ResolvedQaSurfaceConfig): QaAttachmentLimits;
|
|
26
26
|
/**
|
|
27
|
-
* The file picker's `accept` value: the raster formats plus either
|
|
28
|
-
* configured
|
|
27
|
+
* The file picker's `accept` value: the raster formats plus either every
|
|
28
|
+
* configured extension and the browser's whole `text/*` family, or nothing
|
|
29
|
+
* when file attachments are off.
|
|
29
30
|
* @param limits - attachment policy in effect.
|
|
30
31
|
* @returns the accept attribute value.
|
|
31
32
|
*/
|
|
32
33
|
export declare function attachmentAccept(limits: QaAttachmentLimits): string;
|
|
33
|
-
/**
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Whether a dropped payload may be attached as a file at all. An extension the
|
|
36
|
+
* operator listed is enough on its own: the list is what the deployment can
|
|
37
|
+
* work with, and a stand whose pipeline reads Word documents lists `docx`
|
|
38
|
+
* rather than hoping the browser calls it text.
|
|
39
|
+
*/
|
|
40
|
+
export declare function acceptsFileAttachment(name: string, mediaType: string, limits: QaAttachmentLimits): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Why one non-image file is refused, in the visitor's terms, or null when it is
|
|
43
|
+
* accepted. The copy used to name a fixed list ("md, txt, log и другие") that
|
|
44
|
+
* had nothing to do with the deployment's own setting, which is how a stand
|
|
45
|
+
* able to read Word documents ended up looking like a text-only one.
|
|
46
|
+
* @param name - display file name.
|
|
47
|
+
* @param mediaType - MIME type the browser reported.
|
|
48
|
+
* @param limits - attachment policy in effect.
|
|
49
|
+
* @returns the refusal message, or null.
|
|
50
|
+
*/
|
|
51
|
+
export declare function fileAttachmentRefusal(name: string, mediaType: string, limits: QaAttachmentLimits): string | null;
|
|
35
52
|
/**
|
|
36
53
|
* Turn one dropped or picked file into a composer draft, or into the message
|
|
37
54
|
* the visitor sees when the file is not accepted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Browser-side
|
|
2
|
+
* Browser-side base64. Encoding is chunked so `String.fromCharCode` never
|
|
3
3
|
* crosses the engine's argument limit on large attachments.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -7,4 +7,16 @@
|
|
|
7
7
|
* @returns the canonical base64 text (no `data:` prefix, no padding tricks).
|
|
8
8
|
*/
|
|
9
9
|
export declare function bytesToBase64(bytes: Uint8Array): string;
|
|
10
|
+
/**
|
|
11
|
+
* Decode base64 the Host sent for a file the panel could not read as text.
|
|
12
|
+
*
|
|
13
|
+
* A malformed body is tolerated rather than thrown on: the caller is about to
|
|
14
|
+
* hand the bytes to a download or an image tag, and a partial file is a better
|
|
15
|
+
* outcome than losing the panel to an exception. `atob` still rejects input
|
|
16
|
+
* that is not base64 at all; the caller keeps that refusal.
|
|
17
|
+
*
|
|
18
|
+
* @param value - base64 text, with or without a data-URL prefix.
|
|
19
|
+
* @returns the decoded bytes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function base64ToBytes(value: string): Uint8Array;
|
|
10
22
|
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -5,7 +5,8 @@ export interface QaSubagentRow {
|
|
|
5
5
|
readonly title: string;
|
|
6
6
|
readonly running: boolean;
|
|
7
7
|
readonly completed: boolean;
|
|
8
|
-
|
|
8
|
+
/** Muted facts rendered after the title, one span per part. */
|
|
9
|
+
readonly meta: readonly string[];
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Direct subagent children of the open chat, running first. Reads the host
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { QaChatFileGroup } from "../chat-files.js";
|
|
2
|
+
import type { QaBoundSourceApi } from "../types.js";
|
|
2
3
|
export interface QaFilesPanelProps {
|
|
3
4
|
readonly groups: readonly QaChatFileGroup[];
|
|
4
5
|
/** Resolve an image attachment to an object URL; images render inert without it. */
|
|
5
6
|
readonly resolveImage?: (attachmentId: string) => Promise<string>;
|
|
6
7
|
/** Scroll the transcript to the group's user message. */
|
|
7
8
|
readonly onJumpToMessage: (messageId: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* The chat whose workspace the panel browses. Both this and `api` are absent
|
|
11
|
+
* in hosts that only render the attachment roster, where the workspace
|
|
12
|
+
* section is left out rather than shown as a refusal.
|
|
13
|
+
*/
|
|
14
|
+
readonly sessionId?: string;
|
|
15
|
+
readonly api?: QaBoundSourceApi;
|
|
8
16
|
}
|
|
9
17
|
/**
|
|
10
|
-
* The chat's attachment roster
|
|
11
|
-
*
|
|
12
|
-
*
|
|
18
|
+
* The chat's attachment roster plus, when the Host is reachable, the chat's
|
|
19
|
+
* own workspace: one section per sending message, newest first, and above it
|
|
20
|
+
* the file browser the conversation worked in.
|
|
21
|
+
*
|
|
22
|
+
* Rows mirror the transcript's handles — the browser never reads an attachment
|
|
23
|
+
* back, and the images are the same object URLs the message showed — while the
|
|
24
|
+
* workspace section reads through the Host's fenced listing and file reads.
|
|
13
25
|
*/
|
|
14
|
-
export declare function QaFilesPanel({ groups, resolveImage, onJumpToMessage, }: QaFilesPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function QaFilesPanel({ groups, resolveImage, onJumpToMessage, sessionId, api, }: QaFilesPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
15
27
|
//# sourceMappingURL=QaFilesPanel.d.ts.map
|
|
@@ -17,10 +17,9 @@ export interface QaHeaderProps {
|
|
|
17
17
|
readonly logoUrl: string | null;
|
|
18
18
|
/** The derived conversation title; null hides the heading. */
|
|
19
19
|
readonly title: string | null;
|
|
20
|
-
/** A subagent view
|
|
20
|
+
/** A subagent view shows its return control in the title row. */
|
|
21
21
|
readonly viewingSubagent: boolean;
|
|
22
22
|
readonly onCloseSubagent: () => void;
|
|
23
|
-
readonly agentPreset: string | null;
|
|
24
23
|
readonly roleSelector?: ReactNode;
|
|
25
24
|
readonly administration?: {
|
|
26
25
|
readonly onOpen: () => void;
|
|
@@ -36,6 +35,13 @@ export interface QaHeaderProps {
|
|
|
36
35
|
readonly sourcesOpen: boolean;
|
|
37
36
|
readonly onOpenSources: () => void;
|
|
38
37
|
readonly fileCount: number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the files tab has anything to open: attachments, or the chat's own
|
|
40
|
+
* workspace when the deployment lets the panel read files. The count stays
|
|
41
|
+
* the attachment number, so an empty chat with a readable workspace shows no
|
|
42
|
+
* badge but still opens.
|
|
43
|
+
*/
|
|
44
|
+
readonly filesEnabled: boolean;
|
|
39
45
|
readonly filesOpen: boolean;
|
|
40
46
|
readonly onOpenFiles: () => void;
|
|
41
47
|
/**
|
|
@@ -53,5 +59,5 @@ export interface QaHeaderProps {
|
|
|
53
59
|
readonly resetDisabled: boolean;
|
|
54
60
|
readonly onReset: () => void;
|
|
55
61
|
}
|
|
56
|
-
export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent,
|
|
62
|
+
export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent, roleSelector, administration, agentCount, agentsOpen, onToggleAgents, sourcesVisible, sourcesCount, sourcesComplete, sourcesOpen, onOpenSources, fileCount, filesEnabled, filesOpen, onOpenFiles, settings, panelLauncher, showReset, resetDisabled, onReset, }: QaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
57
63
|
//# sourceMappingURL=QaHeader.d.ts.map
|
|
@@ -11,11 +11,12 @@ export interface QaModalProps {
|
|
|
11
11
|
readonly footer?: ReactNode;
|
|
12
12
|
readonly wide?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Panel size: `wide` fits prose that must not wrap mid-sentence,
|
|
14
|
+
* Panel size: `wide` fits prose that must not wrap mid-sentence,
|
|
15
15
|
* `settings` the sectioned user-settings dialog, which needs both a
|
|
16
|
-
* comfortable height and a two-column body
|
|
16
|
+
* comfortable height and a two-column body, and `document` a file
|
|
17
|
+
* preview the reader expanded out of the rail.
|
|
17
18
|
*/
|
|
18
|
-
readonly size?: "default" | "wide" | "settings";
|
|
19
|
+
readonly size?: "default" | "wide" | "settings" | "document";
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* The shared QA dialog shell: backdrop, panel, head with the close control,
|
|
@@ -19,8 +19,12 @@ export declare const QA_HANDLE_FREE_BAND = 40;
|
|
|
19
19
|
* at every width; the stylesheet caps it once more by the live side gutter.
|
|
20
20
|
*/
|
|
21
21
|
export declare const QA_BLEED_MAX_WIDTH: number;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* A stored positive width, or null when the browser has none (first visit,
|
|
24
|
+
* denied storage, corrupt value). Shared by every draggable width.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readQaStoredWidth(storage: Pick<Storage, "getItem">, key: string): number | null;
|
|
27
|
+
export declare function writeQaStoredWidth(storage: Pick<Storage, "setItem">, key: string, width: number): void;
|
|
24
28
|
/**
|
|
25
29
|
* Resolve the centered content width for the currently available column. The
|
|
26
30
|
* operator sets only the floor; the column is the ceiling, so the content may
|
|
@@ -52,5 +56,47 @@ export declare function useQaContentWidth({ active, root, storage, storageKey, m
|
|
|
52
56
|
readonly onEnd: () => void;
|
|
53
57
|
};
|
|
54
58
|
export type UseQaContentWidthResult = ReturnType<typeof useQaContentWidth>;
|
|
59
|
+
/** Drag clamp for the chat-list sidebar, borrowed from the DSH frame. */
|
|
60
|
+
export declare const QA_SIDEBAR_MIN_WIDTH = 264;
|
|
61
|
+
export declare const QA_SIDEBAR_MAX_WIDTH = 420;
|
|
62
|
+
/** The width the sidebar keeps until its first drag: today's fixed width. */
|
|
63
|
+
export declare const QA_SIDEBAR_DEFAULT_WIDTH = 264;
|
|
64
|
+
/** Integer pixels, no snapping and no step, like the DSH frame clamp. */
|
|
65
|
+
export declare function clampQaSidebarWidth(px: number): number;
|
|
66
|
+
/** Resolve the sidebar width for this browser: the stored drag or the default. */
|
|
67
|
+
export declare function resolveQaSidebarWidth(stored: number | null): number;
|
|
68
|
+
interface QaSidebarHandleProps {
|
|
69
|
+
readonly onStart: () => number;
|
|
70
|
+
readonly onDrag: (width: number) => void;
|
|
71
|
+
readonly onCommit: (width: number) => void;
|
|
72
|
+
readonly onEnd: () => void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The invisible strip on the sidebar's border, like the DSH frame's handle: an
|
|
76
|
+
* 8px hit target straddling the edge, found by the cursor alone. One-sided —
|
|
77
|
+
* the pointer delta is the width delta — and pointer-captured, so the drag
|
|
78
|
+
* keeps tracking outside the strip and never selects text.
|
|
79
|
+
*/
|
|
80
|
+
export declare function QaSidebarHandle(props: QaSidebarHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
interface UseQaSidebarWidthOptions {
|
|
82
|
+
/** Whether the expanded sidebar is mounted (the collapsed rail has none). */
|
|
83
|
+
readonly active: boolean;
|
|
84
|
+
readonly root: RefObject<HTMLElement | null>;
|
|
85
|
+
readonly storage: Pick<Storage, "getItem" | "setItem">;
|
|
86
|
+
readonly storageKey: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sidebar counterpart of `useQaContentWidth`: the width never enters React
|
|
90
|
+
* state — the drag writes the custom property straight onto the nav element,
|
|
91
|
+
* so the memoized sidebar does not re-render per frame — and only the
|
|
92
|
+
* committed value reaches storage, which the next mount restores.
|
|
93
|
+
*/
|
|
94
|
+
export declare function useQaSidebarWidth({ active, root, storage, storageKey, }: UseQaSidebarWidthOptions): {
|
|
95
|
+
readonly onStart: () => number;
|
|
96
|
+
readonly onDrag: (width: number) => void;
|
|
97
|
+
readonly onCommit: (width: number) => void;
|
|
98
|
+
readonly onEnd: () => void;
|
|
99
|
+
};
|
|
100
|
+
export type UseQaSidebarWidthResult = ReturnType<typeof useQaSidebarWidth>;
|
|
55
101
|
export {};
|
|
56
102
|
//# sourceMappingURL=QaWidthHandle.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QaBoundSourceApi } from "../types.js";
|
|
2
|
+
export interface QaWorkspaceBrowserProps {
|
|
3
|
+
readonly sessionId: string;
|
|
4
|
+
readonly api: QaBoundSourceApi;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The chat's own workspace, browsable from the files rail.
|
|
8
|
+
*
|
|
9
|
+
* One directory at a time: the Host lists a directory, the panel descends into
|
|
10
|
+
* its children and never travels by path, so a link in a listing cannot walk
|
|
11
|
+
* the visitor out of the chat's tree. Opening a file reads exactly that file —
|
|
12
|
+
* text inline, anything else as a downloadable handle.
|
|
13
|
+
*/
|
|
14
|
+
export declare function QaWorkspaceBrowser({ sessionId, api, }: QaWorkspaceBrowserProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=QaWorkspaceBrowser.d.ts.map
|
|
@@ -6,7 +6,7 @@ declare module "@deepseek-ai/cordis" {
|
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
export declare const inject: string[];
|
|
9
|
-
/** Register the route-aware, full-frame QA entry in the additive overlay slot. */
|
|
9
|
+
/** Register the route-aware, full-frame QA entry: root owner in the kiosk, additive overlay slot otherwise. */
|
|
10
10
|
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
|
11
11
|
export { QaConfigController } from "./QaConfigController.js";
|
|
12
12
|
export { QaAccountsController } from "./QaAccountsController.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The QA kiosk presentation mode, as the client half of the plugin sees it.
|
|
3
|
+
*
|
|
4
|
+
* The harness publishes the deployment's UI mode into every served document
|
|
5
|
+
* ahead of the first application script (the index prelude injected for
|
|
6
|
+
* `DSH_UI_MODE=qa`): `window.DSH_UI_MODE` and, alongside it, the QA base path
|
|
7
|
+
* the server-side route policy serves the application under. The mode — not
|
|
8
|
+
* `location.pathname` — is what the client branches on: the route policy owns
|
|
9
|
+
* which paths carry a document at all, and a client that keyed off the
|
|
10
|
+
* pathname would re-introduce exactly the paths the policy closed.
|
|
11
|
+
*
|
|
12
|
+
* A document without the globals (a host without the kiosk patches, a plugin
|
|
13
|
+
* bundle served into an overlay deployment) reads as the overlay
|
|
14
|
+
* presentation: the `shell.overlay` registration this plugin has always
|
|
15
|
+
* used. That keeps one plugin build compatible with both compositions.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Whether one URL pathname lives on a surface: the surface path itself or any
|
|
19
|
+
* child of it. A plain prefix check would also match `/qadmin` or `/qa-test`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function matchesSurface(pathname: string, surface: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this browser was served by a QA kiosk deployment.
|
|
24
|
+
* @param target - the global object; overridable for tests.
|
|
25
|
+
*/
|
|
26
|
+
export declare function qaKioskMode(target?: Readonly<Record<string, unknown>>): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The QA surface's base path of a kiosk deployment, normalized: single
|
|
29
|
+
* leading slash, no trailing slash. A malformed value falls back to the
|
|
30
|
+
* default rather than disabling the mode.
|
|
31
|
+
* @param target - the global object; overridable for tests.
|
|
32
|
+
*/
|
|
33
|
+
export declare function qaKioskBasePath(target?: Readonly<Record<string, unknown>>): string;
|
|
34
|
+
//# sourceMappingURL=kiosk.d.ts.map
|
|
@@ -12,4 +12,46 @@ import type { SessionSummary } from "@deepseek-ai/dsh-api-session-controller/cli
|
|
|
12
12
|
* disagree about what a chat is.
|
|
13
13
|
*/
|
|
14
14
|
export declare function isDelegatedSession(summary: Pick<SessionSummary, "origin" | "parentId"> | undefined): boolean;
|
|
15
|
+
/** The session-list slice the lineage walk reads. */
|
|
16
|
+
export type SessionLineage = Readonly<Record<string, Pick<SessionSummary, "parentId"> | undefined>>;
|
|
17
|
+
/**
|
|
18
|
+
* The chat a session belongs to: itself when nothing delegated it, otherwise
|
|
19
|
+
* the root of its parent chain.
|
|
20
|
+
*
|
|
21
|
+
* A nested child names its own delegated parent in `parentId`, so one hop is
|
|
22
|
+
* not the chat. The walk stops at the first entry the host list does not know,
|
|
23
|
+
* which keeps a partially hydrated list from inventing a chat that is not
|
|
24
|
+
* there; a repeated id (a hostile or broken list) resolves to the id it
|
|
25
|
+
* repeated on instead of hanging.
|
|
26
|
+
*/
|
|
27
|
+
export declare function chatRootOf(byId: SessionLineage, sessionId: string): string;
|
|
28
|
+
/** One delegated session a notice may be signed with, and its raw label. */
|
|
29
|
+
export interface SubagentNameCandidate {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
/** The Host's own wording for the delegation; empty when it listed none. */
|
|
32
|
+
readonly label: string;
|
|
33
|
+
}
|
|
34
|
+
/** One durable delegation catalog entry, as the Host lists it. */
|
|
35
|
+
export interface SubagentCatalogEntry {
|
|
36
|
+
readonly kind?: string;
|
|
37
|
+
readonly id?: string;
|
|
38
|
+
readonly label?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Direct delegation catalogs keyed by their parent chat. */
|
|
41
|
+
export type SubagentCatalogs = Readonly<Record<string, {
|
|
42
|
+
readonly entries?: readonly SubagentCatalogEntry[];
|
|
43
|
+
} | undefined>>;
|
|
44
|
+
/**
|
|
45
|
+
* Delegated sessions whose names a page may sign its notices with: the
|
|
46
|
+
* children of the chats it lists, catalog labels first and list titles after.
|
|
47
|
+
*
|
|
48
|
+
* `chats` is the visible chat set — the account's own chats while accounts are
|
|
49
|
+
* on, and `undefined` for a deployment without accounts, where every chat on
|
|
50
|
+
* the Host is the browser's own. Ownership is checked against the chat, never
|
|
51
|
+
* against the child: a delegated session has no owner of its own, so a child
|
|
52
|
+
* is visible exactly when the chat it belongs to is. Another account's chat
|
|
53
|
+
* therefore contributes no id and no label — a foreign chat can neither sign
|
|
54
|
+
* a notice nor be named by one.
|
|
55
|
+
*/
|
|
56
|
+
export declare function visibleSubagentCandidates(byId: Readonly<Record<string, SessionSummary>>, catalogs: SubagentCatalogs, chats: ReadonlySet<string> | undefined): readonly SubagentNameCandidate[];
|
|
15
57
|
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
* blocks, setext inside lists, link reference definitions spanning lines) stay
|
|
10
10
|
* out. Raw HTML never becomes a block: a tag line is a paragraph whose inline
|
|
11
11
|
* pass leaves the tag as literal text.
|
|
12
|
+
*
|
|
13
|
+
* Math follows the Host transcript's settled grammar: display TeX is a
|
|
14
|
+
* `$$`-delimited block (a fence on its own lines or one line
|
|
15
|
+
* `$$…$$`) or a ```math fence, and nothing else — the `\(…\)` and `\[…\]`
|
|
16
|
+
* delimiters stay literal text, exactly as the Host renders them. Footnote
|
|
17
|
+
* definitions (`[^id]: …`) are collected the way GitHub's dialect does, with
|
|
18
|
+
* lazy and indented continuation lines.
|
|
12
19
|
*/
|
|
13
20
|
/** `#`-through-`######` heading levels. */
|
|
14
21
|
export type HeadingDepth = 1 | 2 | 3 | 4 | 5 | 6;
|
|
@@ -46,6 +53,9 @@ export type MarkdownBlock = {
|
|
|
46
53
|
readonly align: readonly TableAlign[];
|
|
47
54
|
readonly head: readonly string[];
|
|
48
55
|
readonly rows: readonly (readonly string[])[];
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: "math";
|
|
58
|
+
readonly text: string;
|
|
49
59
|
} | {
|
|
50
60
|
readonly kind: "rule";
|
|
51
61
|
};
|
|
@@ -54,6 +64,8 @@ export interface ParsedMarkdown {
|
|
|
54
64
|
readonly blocks: readonly MarkdownBlock[];
|
|
55
65
|
/** Link/image definitions by upper-cased identifier. */
|
|
56
66
|
readonly definitions: ReadonlyMap<string, string>;
|
|
67
|
+
/** Footnote bodies by upper-cased identifier; first definition wins. */
|
|
68
|
+
readonly footnotes: ReadonlyMap<string, readonly MarkdownBlock[]>;
|
|
57
69
|
}
|
|
58
70
|
/** Split one table row into trimmed cells, honoring escaped pipes. */
|
|
59
71
|
export declare function splitTableRow(line: string): string[];
|
|
@@ -67,8 +79,9 @@ export declare function parseMarkdown(text: string): ParsedMarkdown;
|
|
|
67
79
|
* Parse the blocks of one container (document, quote, or list item).
|
|
68
80
|
* @param lines - Container lines, already de-indented by the caller.
|
|
69
81
|
* @param definitions - Document-wide definition accumulator.
|
|
82
|
+
* @param footnotes - Document-wide footnote accumulator.
|
|
70
83
|
* @param depth - Container nesting depth.
|
|
71
84
|
* @returns The container's blocks.
|
|
72
85
|
*/
|
|
73
|
-
export declare function parseBlocks(lines: readonly string[], definitions: Map<string, string>, depth: number): MarkdownBlock[];
|
|
86
|
+
export declare function parseBlocks(lines: readonly string[], definitions: Map<string, string>, footnotes: Map<string, readonly MarkdownBlock[]>, depth: number): MarkdownBlock[];
|
|
74
87
|
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GFM inline grammar for the chat renderer: code spans, emphasis, links,
|
|
3
|
-
* images, autolinks, and the two line-break flavors.
|
|
4
|
-
* CommonMark intent (a closer must match its opener's
|
|
5
|
-
* opens inside a word) rather than the full
|
|
6
|
-
* shapes this grammar cannot express are the
|
|
7
|
-
* degrade to literal text instead of mangling the
|
|
3
|
+
* images, autolinks, TeX math, footnotes, and the two line-break flavors.
|
|
4
|
+
* Emphasis follows the CommonMark intent (a closer must match its opener's
|
|
5
|
+
* delimiter run, `_` never opens inside a word) rather than the full
|
|
6
|
+
* delimiter-stack algorithm — the shapes this grammar cannot express are the
|
|
7
|
+
* pathological ones, and they degrade to literal text instead of mangling the
|
|
8
|
+
* sentence. Math follows the Host transcript: `$…$` and `$$…$$` spans, with
|
|
9
|
+
* maximal-munch dollar runs and whitespace padding stripped only when both
|
|
10
|
+
* ends carry it.
|
|
8
11
|
*/
|
|
9
12
|
/** One inline node; `children` nodes nest. */
|
|
10
13
|
export type MarkdownInline = {
|
|
@@ -28,13 +31,26 @@ export type MarkdownInline = {
|
|
|
28
31
|
readonly kind: "image";
|
|
29
32
|
readonly src: string;
|
|
30
33
|
readonly alt: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: "inlineMath";
|
|
36
|
+
readonly value: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: "footnoteRef";
|
|
39
|
+
readonly id: string;
|
|
31
40
|
};
|
|
41
|
+
/** The reference targets one inline pass resolves against. */
|
|
42
|
+
export interface InlineTargets {
|
|
43
|
+
/** Link/image definitions by upper-cased identifier. */
|
|
44
|
+
readonly definitions: ReadonlyMap<string, string>;
|
|
45
|
+
/** Footnote identifiers that have a definition, by upper-cased label. */
|
|
46
|
+
readonly footnotes: ReadonlyMap<string, unknown>;
|
|
47
|
+
}
|
|
32
48
|
/**
|
|
33
49
|
* Parse the inline content of one leaf block.
|
|
34
50
|
* @param text - Raw inline Markdown, newlines included.
|
|
35
|
-
* @param
|
|
51
|
+
* @param targets - The definitions and footnotes this pass resolves against.
|
|
36
52
|
* @param depth - Inline nesting depth.
|
|
37
53
|
* @returns The inline nodes in document order.
|
|
38
54
|
*/
|
|
39
|
-
export declare function parseInline(text: string,
|
|
55
|
+
export declare function parseInline(text: string, targets: ReadonlyMap<string, string> | InlineTargets, depth?: number): MarkdownInline[];
|
|
40
56
|
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `katex/dist/katex.min.css` with every font inlined as a woff2 data URI.
|
|
3
|
+
* Generated by `scripts/generate-katex-css.mjs` from the pinned `katex`
|
|
4
|
+
* devDependency — do not edit by hand; regenerate after a `katex` upgrade.
|
|
5
|
+
*
|
|
6
|
+
* The QA overlay is a self-contained client bundle, so the math styles and
|
|
7
|
+
* their fonts travel inside it: nothing here may reference an external file,
|
|
8
|
+
* and a data URI cannot collide with the Host's own KaTeX font declarations.
|
|
9
|
+
*/
|
|
10
|
+
export declare const KATEX_CSS: string;
|
|
11
|
+
//# sourceMappingURL=katex-css.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TeX-to-React via KaTeX, mirroring the Host transcript's math pipeline: the
|
|
3
|
+
* same two-arm error chain (strict render, `strict: 'ignore'` retry, error
|
|
4
|
+
* span) so a formula renders identically here and in DSH's own message. KaTeX
|
|
5
|
+
* emits an HTML string; the browser's HTML parser turns it into a tree this
|
|
6
|
+
* module maps onto React elements — the output is a static span/MathML/SVG
|
|
7
|
+
* vocabulary with no raw author HTML, the same trust the fenced-code
|
|
8
|
+
* highlighter's tree gets.
|
|
9
|
+
*
|
|
10
|
+
* React has no MathML support, so the `.katex-mathml` subtree's elements land
|
|
11
|
+
* in the HTML namespace; the visual arm is the `.katex-html` span tree and
|
|
12
|
+
* the MathML arm serves assistive technology, which reads it by tag name.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
|
+
/**
|
|
16
|
+
* Render TeX source to React elements through KaTeX.
|
|
17
|
+
* @param value - The TeX source (a math node's raw content).
|
|
18
|
+
* @param displayMode - Display (block) versus inline rendering.
|
|
19
|
+
* @returns KaTeX's element tree, or the error span when the source does not
|
|
20
|
+
* parse even under `strict: 'ignore'`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function renderTexToReact(value: string, displayMode: boolean): ReactNode;
|
|
23
|
+
//# sourceMappingURL=math.d.ts.map
|