@promptbook/pdf 0.113.0-9 → 0.114.0-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 +4 -3
- package/esm/index.es.js +1 -1
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +8 -0
- package/esm/src/_packages/core.index.d.ts +4 -0
- package/esm/src/_packages/types.index.d.ts +12 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/esm/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/esm/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/esm/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/esm/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/esm/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/esm/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/esm/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/esm/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/esm/src/commitments/META/META.d.ts +2 -0
- package/esm/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/esm/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/esm/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/esm/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/esm/src/utils/html/escapeHtml.d.ts +9 -0
- package/esm/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +8 -0
- package/umd/src/_packages/core.index.d.ts +4 -0
- package/umd/src/_packages/types.index.d.ts +12 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/parseAgentSource/ParsedAgentProfile.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +5 -13
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +195 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +43 -1
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts +1 -0
- package/umd/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +33 -0
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualDictionary.d.ts +15 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +30 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +2 -1
- package/umd/src/book-2.0/book-language-documentation/toStableAnchorId.d.ts +12 -0
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +78 -0
- package/umd/src/book-3.0/AgentMessageRunReport.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +9 -0
- package/umd/src/book-3.0/codexLoginMethod.d.ts +38 -0
- package/umd/src/book-components/BookEditor/BookEditorSyntaxTokenStyles.d.ts +39 -0
- package/umd/src/book-components/BookEditor/createBookSourceHighlightStyles.d.ts +12 -0
- package/umd/src/book-components/BookEditor/highlightBookSourceToHtml.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatFeedbackStar.d.ts +37 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/ChatRatingModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +25 -2
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreview.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/LiveBrowserPreviewToolbar.d.ts +71 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputEvent.d.ts +72 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.d.ts +64 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewInputQueue.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewSessionState.d.ts +14 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/PagePreviewViewport.d.ts +37 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/createPagePreviewSessionId.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/resolveChatRatingMessageKey.d.ts +8 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.test.d.ts +2 -0
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.test.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +78 -0
- package/umd/src/book-components/Chat/utils/resolveCitationSourceDisplay.d.ts +149 -0
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +9 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -2
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/AgentsServerChildEnvironment.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/PreparedAgentsServerLaunch.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/forwardChildOutput.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startNextServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer/startUserChatJobWorkerPump.d.ts +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/add.d.ts +36 -0
- package/umd/src/cli/cli-commands/coder/add.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +24 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +13 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +40 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +35 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessInstallationWarning.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.d.ts +18 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/buildAgentNameOrPermanentIdFilter.test.d.ts +1 -0
- package/umd/src/commitments/META/META.d.ts +2 -0
- package/umd/src/commitments/META_THINKING_MESSAGE/META_THINKING_MESSAGE.d.ts +26 -0
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/execution/utils/formatUsagePrice.d.ts +12 -0
- package/umd/src/execution/utils/formatUsagePrice.test.d.ts +1 -0
- package/umd/src/utils/agent-message-runtime/agentMessageRuntimePaths.d.ts +24 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +16 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.test.d.ts +1 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +104 -0
- package/umd/src/utils/agents/terminalAgentAvatarVisual.test.d.ts +1 -0
- package/umd/src/utils/html/escapeHtml.d.ts +9 -0
- package/umd/src/utils/markdown/shiftMarkdownHeadingLevels.d.ts +15 -0
- package/umd/src/version.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/esm/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +0 -25
- package/umd/src/book-components/_common/react-utils/escapeHtml.d.ts +0 -6
- /package/esm/src/{executables/browsers/locateInternetExplorer.test.d.ts → book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.test.d.ts} +0 -0
- /package/{umd/src/executables/browsers/locateInternetExplorer.test.d.ts → esm/src/book-3.0/AgentMessageRunReport.test.d.ts} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication method that the OpenAI Codex CLI used for one run.
|
|
3
|
+
*
|
|
4
|
+
* - `chatgpt` — the server's ChatGPT account (subscription) login was used.
|
|
5
|
+
* - `api` — `OPENAI_API_KEY` API-key authentication was used.
|
|
6
|
+
* - `unknown` — the runner could not determine which method Codex used.
|
|
7
|
+
*
|
|
8
|
+
* @private internal type of the OpenAI Codex runner and the Agents Server task details
|
|
9
|
+
*/
|
|
10
|
+
export type CodexLoginMethod = 'chatgpt' | 'api' | 'unknown';
|
|
11
|
+
/**
|
|
12
|
+
* Stable stdout marker printed by the generated Codex runner script to report which login method it used.
|
|
13
|
+
*
|
|
14
|
+
* The marker is followed by the resolved method keyword, for example `ptbk-codex-login-method: chatgpt`,
|
|
15
|
+
* so `parseCodexLoginMethodFromOutput` can recover it from the captured runner output.
|
|
16
|
+
*
|
|
17
|
+
* @private internal constant of the OpenAI Codex runner
|
|
18
|
+
*/
|
|
19
|
+
export declare const CODEX_LOGIN_METHOD_MARKER = "ptbk-codex-login-method:";
|
|
20
|
+
/**
|
|
21
|
+
* Substring that the `codex login status` command prints when the Codex CLI is signed in with a
|
|
22
|
+
* ChatGPT subscription account instead of an `OPENAI_API_KEY`.
|
|
23
|
+
*
|
|
24
|
+
* This is the single source of truth for detecting an active ChatGPT login, reused by the Codex runner
|
|
25
|
+
* script and by the Agents Server harness authentication status resolver.
|
|
26
|
+
*
|
|
27
|
+
* @private internal constant of the OpenAI Codex runner and the Agents Server Harness Auth
|
|
28
|
+
*/
|
|
29
|
+
export declare const CODEX_CHATGPT_LOGIN_STATUS_NEEDLE = "Logged in using ChatGPT";
|
|
30
|
+
/**
|
|
31
|
+
* Formats one Codex login method as a short human-readable label for prompt status lines and task details.
|
|
32
|
+
*
|
|
33
|
+
* @returns The label to append to a status line, or `undefined` when there is no meaningful method to show
|
|
34
|
+
* (for example the runner is not Codex or the method could not be determined), so callers can omit the suffix.
|
|
35
|
+
*
|
|
36
|
+
* @private internal utility of the OpenAI Codex runner and the Agents Server task details
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatCodexLoginMethod(loginMethod: CodexLoginMethod | undefined): string | undefined;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One token emitted while highlighting Book source.
|
|
3
|
+
*
|
|
4
|
+
* @private internal type of `BookEditor`
|
|
5
|
+
*/
|
|
6
|
+
export type BookEditorSyntaxTokenName = 'title' | 'commitment' | 'note-commitment' | 'todo-commitment' | 'parameter' | 'agent-reference' | 'code-block';
|
|
7
|
+
/**
|
|
8
|
+
* Visual style of one Book syntax token.
|
|
9
|
+
*
|
|
10
|
+
* @private internal type of `BookEditor`
|
|
11
|
+
*/
|
|
12
|
+
export type BookEditorSyntaxTokenStyle = {
|
|
13
|
+
/**
|
|
14
|
+
* Token this style belongs to.
|
|
15
|
+
*/
|
|
16
|
+
readonly token: BookEditorSyntaxTokenName;
|
|
17
|
+
/**
|
|
18
|
+
* Text color of the token.
|
|
19
|
+
*/
|
|
20
|
+
readonly foreground: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional background color of the token.
|
|
23
|
+
*/
|
|
24
|
+
readonly background?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional space-separated font style, for example `bold underline`.
|
|
27
|
+
*/
|
|
28
|
+
readonly fontStyle?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Single source of truth for how Book source is colored.
|
|
32
|
+
*
|
|
33
|
+
* The Monaco theme of `<BookEditor/>` and every static rendering of Book source
|
|
34
|
+
* (for example the Book language manual PDF) are derived from these styles, so
|
|
35
|
+
* a book always looks the same no matter where it is displayed.
|
|
36
|
+
*
|
|
37
|
+
* @private internal constant of `BookEditor`
|
|
38
|
+
*/
|
|
39
|
+
export declare const BOOK_EDITOR_SYNTAX_TOKEN_STYLES: ReadonlyArray<BookEditorSyntaxTokenStyle>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the CSS matching the markup of `highlightBookSourceToHtml`.
|
|
3
|
+
*
|
|
4
|
+
* Both the stylesheet and the markup are derived from the shared
|
|
5
|
+
* `BOOK_EDITOR_SYNTAX_TOKEN_STYLES`, therefore a statically rendered book keeps
|
|
6
|
+
* the exact colors of `<BookEditor/>`.
|
|
7
|
+
*
|
|
8
|
+
* @returns CSS rules for every Book syntax token.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `BookEditor`
|
|
11
|
+
*/
|
|
12
|
+
export declare function createBookSourceHighlightStyles(): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix of the CSS class names emitted for highlighted Book source.
|
|
3
|
+
*
|
|
4
|
+
* @private internal constant of `BookEditor`
|
|
5
|
+
*/
|
|
6
|
+
export declare const BOOK_SYNTAX_TOKEN_CLASS_NAME_PREFIX = "book-syntax-";
|
|
7
|
+
/**
|
|
8
|
+
* Highlights Book source into static HTML using the `<BookEditor/>` token colors.
|
|
9
|
+
*
|
|
10
|
+
* `<BookEditor/>` itself is a Monaco-based browser component and cannot run
|
|
11
|
+
* where a book has to be rendered as plain markup (server-side exports such as
|
|
12
|
+
* the Book language manual PDF). This function reuses the very same
|
|
13
|
+
* tokenization patterns and token names, so both surfaces stay in sync.
|
|
14
|
+
*
|
|
15
|
+
* @param bookSource - Raw Book source to highlight.
|
|
16
|
+
* @returns HTML with one `<span>` per highlighted token, safe to place into `<pre>`.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of `BookEditor`
|
|
19
|
+
*/
|
|
20
|
+
export declare function highlightBookSourceToHtml(bookSource: string): string;
|
|
@@ -13,6 +13,11 @@ export type ChatCitationModalProps = {
|
|
|
13
13
|
participants: ReadonlyArray<ChatParticipant>;
|
|
14
14
|
resolveCitationLabel?: CitationLabelResolver;
|
|
15
15
|
soundSystem?: ChatSoundSystem;
|
|
16
|
+
/**
|
|
17
|
+
* Optional agent identifier (name or permanent id) scoping the live browser fallback
|
|
18
|
+
* to the agent's persistent server-side browser profile.
|
|
19
|
+
*/
|
|
20
|
+
agentIdentifier?: string;
|
|
16
21
|
onClose: () => void;
|
|
17
22
|
};
|
|
18
23
|
/**
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { MouseEventHandler } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Star values available in the chat feedback UI.
|
|
4
|
+
*
|
|
5
|
+
* @private constant of `<Chat/>`
|
|
6
|
+
*/
|
|
7
|
+
export declare const CHAT_FEEDBACK_STAR_RATINGS: readonly [1, 2, 3, 4, 5];
|
|
8
|
+
/**
|
|
9
|
+
* Props for the shared chat feedback star icon.
|
|
10
|
+
*
|
|
11
|
+
* @private type of `<Chat/>`
|
|
12
|
+
*/
|
|
13
|
+
type ChatFeedbackStarProps = {
|
|
14
|
+
readonly isActive: boolean;
|
|
15
|
+
readonly inactiveColor: string;
|
|
16
|
+
readonly className?: string;
|
|
17
|
+
readonly onClick?: MouseEventHandler<HTMLSpanElement>;
|
|
18
|
+
readonly onMouseEnter?: MouseEventHandler<HTMLSpanElement>;
|
|
19
|
+
readonly onMouseLeave?: MouseEventHandler<HTMLSpanElement>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the inactive color for stars in the feedback controls.
|
|
23
|
+
*
|
|
24
|
+
* @param mode Current chat color mode.
|
|
25
|
+
* @param tone Visual weight for the inactive star.
|
|
26
|
+
* @returns Hex color for an inactive star.
|
|
27
|
+
*
|
|
28
|
+
* @private function of `<Chat/>`
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveChatFeedbackStarInactiveColor(mode: 'LIGHT' | 'DARK', tone?: 'subtle' | 'muted'): "#888" | "#666" | "#ccc" | "#555";
|
|
31
|
+
/**
|
|
32
|
+
* Renders one CSS-colored feedback star.
|
|
33
|
+
*
|
|
34
|
+
* @private component of `<Chat/>`
|
|
35
|
+
*/
|
|
36
|
+
export declare function ChatFeedbackStar({ isActive, inactiveColor, className, onClick, onMouseEnter, onMouseLeave, }: ChatFeedbackStarProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -76,6 +76,10 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'onActionButton' | 'on
|
|
|
76
76
|
* Optional cached metadata keyed by TEAM tool names to enrich tool call chips.
|
|
77
77
|
*/
|
|
78
78
|
teamAgentProfiles?: ChatProps['teamAgentProfiles'];
|
|
79
|
+
/**
|
|
80
|
+
* Optional inline references rendered from `[[reference]]` tokens in message markdown.
|
|
81
|
+
*/
|
|
82
|
+
markdownInlineReferences?: ChatProps['markdownInlineReferences'];
|
|
79
83
|
/**
|
|
80
84
|
* Controls whether assistant replies render as bubbles or article blocks.
|
|
81
85
|
*/
|
|
@@ -51,6 +51,10 @@ export type ChatMessageListProps = {
|
|
|
51
51
|
toolTitles?: Record<string, string>;
|
|
52
52
|
teammates?: ChatProps['teammates'];
|
|
53
53
|
teamAgentProfiles?: ChatProps['teamAgentProfiles'];
|
|
54
|
+
/**
|
|
55
|
+
* Optional inline references rendered from `[[reference]]` tokens in message markdown.
|
|
56
|
+
*/
|
|
57
|
+
markdownInlineReferences?: ChatProps['markdownInlineReferences'];
|
|
54
58
|
visualMode?: ChatProps['visualMode'];
|
|
55
59
|
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
|
|
56
60
|
onCitationClick?: (citation: ParsedCitation) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChatMessage } from '../types/ChatMessage';
|
|
2
|
+
import type { MarkdownInlineReference } from '../utils/renderMarkdown';
|
|
2
3
|
import type { ChatMessageContentSegment } from '../utils/splitMessageContentIntoSegments';
|
|
3
4
|
import type { StreamingFeaturePlaceholderKind } from './StreamingFeaturePlaceholder';
|
|
4
5
|
/**
|
|
@@ -23,6 +24,10 @@ export type ChatMessageRichContentProps = {
|
|
|
23
24
|
* Optional callback for creating a new agent from a book code block.
|
|
24
25
|
*/
|
|
25
26
|
readonly onCreateAgent?: (bookContent: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Optional inline references rendered from `[[reference]]` tokens in message markdown.
|
|
29
|
+
*/
|
|
30
|
+
readonly markdownInlineReferences?: ReadonlyArray<MarkdownInlineReference>;
|
|
26
31
|
/**
|
|
27
32
|
* Resolved theme used by nested code blocks and editors.
|
|
28
33
|
*/
|
|
@@ -10,6 +10,7 @@ import type { ChatMessage } from '../types/ChatMessage';
|
|
|
10
10
|
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
11
11
|
import type { CitationLabelResolver } from '../types/CitationLabelResolver';
|
|
12
12
|
import type { ChatSaveFormatHandlerMap } from '../save/_common/ChatSaveFormatHandler';
|
|
13
|
+
import type { MarkdownInlineReference } from '../utils/renderMarkdown';
|
|
13
14
|
/**
|
|
14
15
|
* Response data returned by the optional `onFeedback` handler.
|
|
15
16
|
*
|
|
@@ -440,6 +441,14 @@ export type ChatProps = {
|
|
|
440
441
|
* The title of the chat
|
|
441
442
|
*/
|
|
442
443
|
readonly title?: string;
|
|
444
|
+
/**
|
|
445
|
+
* Optional identifier (name or permanent id) of the agent owning this chat.
|
|
446
|
+
*
|
|
447
|
+
* When set, server-side live browser previews opened from the chat (for example from
|
|
448
|
+
* knowledge citation chips) run inside the agent's persistent browser profile, so logins
|
|
449
|
+
* performed by the user in the live session are saved for the agent's future browsing.
|
|
450
|
+
*/
|
|
451
|
+
readonly agentIdentifier?: string;
|
|
443
452
|
/**
|
|
444
453
|
* Messages to render - they are rendered as they are
|
|
445
454
|
*/
|
|
@@ -685,6 +694,10 @@ export type ChatProps = {
|
|
|
685
694
|
* Optional cached agent metadata keyed by TEAM tool names to improve chip rendering.
|
|
686
695
|
*/
|
|
687
696
|
readonly teamAgentProfiles?: Record<string, AgentChipData>;
|
|
697
|
+
/**
|
|
698
|
+
* Optional inline references rendered from `[[reference]]` tokens in message markdown.
|
|
699
|
+
*/
|
|
700
|
+
readonly markdownInlineReferences?: ReadonlyArray<MarkdownInlineReference>;
|
|
688
701
|
/**
|
|
689
702
|
* Optional callback to create a new agent from the template.
|
|
690
703
|
* If provided, renders the [Create Agent] button for book code blocks.
|
|
@@ -6,10 +6,33 @@
|
|
|
6
6
|
export type CitationIframePreviewProps = {
|
|
7
7
|
src: string;
|
|
8
8
|
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional agent identifier (name or permanent id) scoping the live browser fallback
|
|
11
|
+
* to the agent's persistent server-side browser profile.
|
|
12
|
+
*/
|
|
13
|
+
agentIdentifier?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional close handler passed to the live browser toolbar when the preview fills a modal.
|
|
16
|
+
*/
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Reports whether the URL is embedded directly or shown through the live browser fallback.
|
|
20
|
+
*/
|
|
21
|
+
onStatusChange?: (status: CitationIframePreviewStatus) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Initial preview status used when the parent already knows the resolved mode.
|
|
24
|
+
*/
|
|
25
|
+
initialStatus?: CitationIframePreviewStatus;
|
|
9
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Internal status of the iframe embed check.
|
|
29
|
+
*
|
|
30
|
+
* @private type of `<CitationIframePreview/>`
|
|
31
|
+
*/
|
|
32
|
+
export type CitationIframePreviewStatus = 'loading' | 'embed' | 'browser-stream';
|
|
10
33
|
/**
|
|
11
34
|
* Renders a citation URL preview as an iframe when the target page allows embedding,
|
|
12
|
-
* or falls back to
|
|
35
|
+
* or falls back to an interactive live server-side browser session (`<LiveBrowserPreview/>`)
|
|
13
36
|
* when it does not (e.g. X-Frame-Options: DENY / SAMEORIGIN).
|
|
14
37
|
*
|
|
15
38
|
* Embedding capability is determined by `GET /api/page-preview/check?url=<url>`.
|
|
@@ -17,4 +40,4 @@ export type CitationIframePreviewProps = {
|
|
|
17
40
|
*
|
|
18
41
|
* @private component of `<ChatCitationModal/>`
|
|
19
42
|
*/
|
|
20
|
-
export declare function CitationIframePreview({ src, title }: CitationIframePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function CitationIframePreview({ src, title, agentIdentifier, onClose, onStatusChange, initialStatus, }: CitationIframePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props of the live browser preview.
|
|
3
|
+
*
|
|
4
|
+
* @private component of `<ChatCitationModal/>`
|
|
5
|
+
*/
|
|
6
|
+
export type LiveBrowserPreviewProps = {
|
|
7
|
+
/**
|
|
8
|
+
* URL opened in the remote headless browser.
|
|
9
|
+
*/
|
|
10
|
+
readonly src: string;
|
|
11
|
+
/**
|
|
12
|
+
* Human-readable title of the previewed source.
|
|
13
|
+
*/
|
|
14
|
+
readonly title: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional agent identifier (name or permanent id).
|
|
17
|
+
*
|
|
18
|
+
* When set, the live session runs inside the agent's persistent server-side browser profile,
|
|
19
|
+
* so actions like logging into a website are saved for the agent's future browsing.
|
|
20
|
+
*/
|
|
21
|
+
readonly agentIdentifier?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional close handler for modal-hosted previews.
|
|
24
|
+
*/
|
|
25
|
+
readonly onClose?: () => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Remote-desktop-like live preview of one server-side headless browser session.
|
|
29
|
+
*
|
|
30
|
+
* Renders the MJPEG stream of the Agents Server page-preview route and forwards natural
|
|
31
|
+
* browser interactions to it — hovering, clicking, double-clicking, dragging and text
|
|
32
|
+
* selection (raw pointer presses with click counts), scrolling, typing and keyboard
|
|
33
|
+
* shortcuts. A browser-like toolbar adds history navigation, an editable address bar,
|
|
34
|
+
* local zoom (Ctrl+wheel or buttons), and a full screen mode. The remote viewport follows
|
|
35
|
+
* the size of the preview area, so the page is always rendered at the size the user sees.
|
|
36
|
+
*
|
|
37
|
+
* @private component of `<ChatCitationModal/>`
|
|
38
|
+
*/
|
|
39
|
+
export declare function LiveBrowserPreview({ src, title, agentIdentifier, onClose }: LiveBrowserPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PagePreviewNavigationAction } from './PagePreviewInputEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Props of the live browser preview toolbar.
|
|
4
|
+
*
|
|
5
|
+
* @private component of `<LiveBrowserPreview/>`
|
|
6
|
+
*/
|
|
7
|
+
export type LiveBrowserPreviewToolbarProps = {
|
|
8
|
+
/**
|
|
9
|
+
* URL shown in the address input (either the user's draft or the remote page URL).
|
|
10
|
+
*/
|
|
11
|
+
readonly displayedUrl: string;
|
|
12
|
+
/**
|
|
13
|
+
* URL of the remote page used by the "Open in new tab" link.
|
|
14
|
+
*/
|
|
15
|
+
readonly externalUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the remote browser can navigate back, `null` when unknown.
|
|
18
|
+
*/
|
|
19
|
+
readonly canGoBack: boolean | null;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the remote browser can navigate forward, `null` when unknown.
|
|
22
|
+
*/
|
|
23
|
+
readonly canGoForward: boolean | null;
|
|
24
|
+
/**
|
|
25
|
+
* Current local zoom level (`1` = 100%).
|
|
26
|
+
*/
|
|
27
|
+
readonly zoomLevel: number;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the preview is currently in full screen mode.
|
|
30
|
+
*/
|
|
31
|
+
readonly isFullscreen: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Sends one history navigation to the remote browser.
|
|
34
|
+
*/
|
|
35
|
+
readonly onNavigate: (action: PagePreviewNavigationAction) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Updates the address-input draft, `null` restores the live remote URL.
|
|
38
|
+
*/
|
|
39
|
+
readonly onUrlDraftChange: (draft: string | null) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Navigates the remote browser to the submitted address.
|
|
42
|
+
*/
|
|
43
|
+
readonly onUrlSubmit: (url: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Zooms the local preview in.
|
|
46
|
+
*/
|
|
47
|
+
readonly onZoomIn: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Zooms the local preview out.
|
|
50
|
+
*/
|
|
51
|
+
readonly onZoomOut: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Resets the local preview zoom to 100%.
|
|
54
|
+
*/
|
|
55
|
+
readonly onZoomReset: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Toggles the full screen mode of the preview.
|
|
58
|
+
*/
|
|
59
|
+
readonly onToggleFullscreen: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Optional close handler shown when the preview fills a modal dialog.
|
|
62
|
+
*/
|
|
63
|
+
readonly onClose?: () => void;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Browser-like toolbar of the live page preview with history navigation, an editable
|
|
67
|
+
* address bar, local zoom controls, full screen toggle, and an "Open in new tab" link.
|
|
68
|
+
*
|
|
69
|
+
* @private component of `<LiveBrowserPreview/>`
|
|
70
|
+
*/
|
|
71
|
+
export declare function LiveBrowserPreviewToolbar(props: LiveBrowserPreviewToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pointer button forwarded from the client to the live page-preview browser.
|
|
3
|
+
*
|
|
4
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
5
|
+
*/
|
|
6
|
+
export type PagePreviewPointerButton = 'left' | 'middle' | 'right';
|
|
7
|
+
/**
|
|
8
|
+
* Browser-history action forwarded from the preview toolbar.
|
|
9
|
+
*
|
|
10
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
11
|
+
*/
|
|
12
|
+
export type PagePreviewNavigationAction = 'back' | 'forward' | 'reload';
|
|
13
|
+
/**
|
|
14
|
+
* One remote-control event forwarded from the live page-preview client to the headless browser.
|
|
15
|
+
*
|
|
16
|
+
* Pointer coordinates are expressed as ratios of the streamed viewport (`0` to `1`), so the client
|
|
17
|
+
* does not need to know the exact remote viewport size.
|
|
18
|
+
*
|
|
19
|
+
* - `move` — hover / pointer movement
|
|
20
|
+
* - `down` / `up` — raw pointer press and release (drag, text selection, double-click via `clickCount`)
|
|
21
|
+
* - `click` — legacy single click kept for backward compatibility with older preview clients
|
|
22
|
+
* - `wheel` — scrolling
|
|
23
|
+
* - `keydown` / `keyup` — keyboard typing and shortcuts, `key` uses `KeyboardEvent.key` values
|
|
24
|
+
* - `resize` — the client preview area changed, the remote viewport should follow
|
|
25
|
+
* - `navigate` — browser-history navigation from the preview toolbar
|
|
26
|
+
* - `goto` — navigate to one absolute HTTP(S) URL from the preview toolbar
|
|
27
|
+
*
|
|
28
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
29
|
+
*/
|
|
30
|
+
export type PagePreviewInputEvent = {
|
|
31
|
+
readonly type: 'move';
|
|
32
|
+
readonly xRatio: number;
|
|
33
|
+
readonly yRatio: number;
|
|
34
|
+
} | {
|
|
35
|
+
readonly type: 'down';
|
|
36
|
+
readonly xRatio: number;
|
|
37
|
+
readonly yRatio: number;
|
|
38
|
+
readonly button: PagePreviewPointerButton;
|
|
39
|
+
readonly clickCount: number;
|
|
40
|
+
} | {
|
|
41
|
+
readonly type: 'up';
|
|
42
|
+
readonly xRatio: number;
|
|
43
|
+
readonly yRatio: number;
|
|
44
|
+
readonly button: PagePreviewPointerButton;
|
|
45
|
+
readonly clickCount: number;
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: 'click';
|
|
48
|
+
readonly xRatio: number;
|
|
49
|
+
readonly yRatio: number;
|
|
50
|
+
} | {
|
|
51
|
+
readonly type: 'wheel';
|
|
52
|
+
readonly xRatio: number;
|
|
53
|
+
readonly yRatio: number;
|
|
54
|
+
readonly deltaX: number;
|
|
55
|
+
readonly deltaY: number;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: 'keydown';
|
|
58
|
+
readonly key: string;
|
|
59
|
+
} | {
|
|
60
|
+
readonly type: 'keyup';
|
|
61
|
+
readonly key: string;
|
|
62
|
+
} | {
|
|
63
|
+
readonly type: 'resize';
|
|
64
|
+
readonly width: number;
|
|
65
|
+
readonly height: number;
|
|
66
|
+
} | {
|
|
67
|
+
readonly type: 'navigate';
|
|
68
|
+
readonly action: PagePreviewNavigationAction;
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: 'goto';
|
|
71
|
+
readonly url: string;
|
|
72
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { PagePreviewInputEvent } from './PagePreviewInputEvent';
|
|
2
|
+
import type { PagePreviewSessionState } from './PagePreviewSessionState';
|
|
3
|
+
/**
|
|
4
|
+
* Options of one `PagePreviewInputQueue`.
|
|
5
|
+
*
|
|
6
|
+
* @private type of `PagePreviewInputQueue`
|
|
7
|
+
*/
|
|
8
|
+
export type PagePreviewInputQueueOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Page-preview browser session id the events belong to.
|
|
11
|
+
*/
|
|
12
|
+
readonly sessionId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Endpoint receiving the input events, defaults to `/api/page-preview/input`.
|
|
15
|
+
*/
|
|
16
|
+
readonly endpointUrl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Called with the fresh session navigation state returned by the server after each delivered event.
|
|
19
|
+
*/
|
|
20
|
+
readonly onSessionState?: (state: PagePreviewSessionState) => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Delivers remote-control events of one live page-preview browser session to the Agents Server.
|
|
24
|
+
*
|
|
25
|
+
* Events are sent strictly one after another so the remote browser receives them in order
|
|
26
|
+
* (crucial for drags and text selection). While one request is in flight, bursty events are
|
|
27
|
+
* coalesced: consecutive `move` events collapse into the latest one, consecutive `wheel`
|
|
28
|
+
* events accumulate their deltas, and only the latest `resize` is kept.
|
|
29
|
+
*
|
|
30
|
+
* @private utility of `<LiveBrowserPreview/>`
|
|
31
|
+
*/
|
|
32
|
+
export declare class PagePreviewInputQueue {
|
|
33
|
+
private readonly options;
|
|
34
|
+
private readonly pendingEvents;
|
|
35
|
+
private isFlushing;
|
|
36
|
+
private isDisposed;
|
|
37
|
+
constructor(options: PagePreviewInputQueueOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Enqueues one input event for ordered delivery.
|
|
40
|
+
*
|
|
41
|
+
* @param inputEvent - Event to forward to the remote browser.
|
|
42
|
+
*/
|
|
43
|
+
send(inputEvent: PagePreviewInputEvent): void;
|
|
44
|
+
/**
|
|
45
|
+
* Stops the queue and drops all undelivered events.
|
|
46
|
+
*/
|
|
47
|
+
dispose(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Adds one event to the queue, merging it with the trailing event when possible.
|
|
50
|
+
*
|
|
51
|
+
* @param inputEvent - Event to enqueue.
|
|
52
|
+
*/
|
|
53
|
+
private coalesceIntoPendingEvents;
|
|
54
|
+
/**
|
|
55
|
+
* Delivers pending events one by one until the queue is drained.
|
|
56
|
+
*/
|
|
57
|
+
private flushPendingEvents;
|
|
58
|
+
/**
|
|
59
|
+
* Sends one event to the server, surfacing the returned session state.
|
|
60
|
+
*
|
|
61
|
+
* @param inputEvent - Event to deliver.
|
|
62
|
+
*/
|
|
63
|
+
private deliverInputEvent;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation state of one live page-preview browser session, shown in the preview toolbar.
|
|
3
|
+
*
|
|
4
|
+
* `canGoBack` / `canGoForward` are `null` when the server cannot inspect the remote history
|
|
5
|
+
* (for example when the CDP session is unavailable) — the toolbar keeps its buttons enabled then.
|
|
6
|
+
*
|
|
7
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
8
|
+
*/
|
|
9
|
+
export type PagePreviewSessionState = {
|
|
10
|
+
readonly url: string;
|
|
11
|
+
readonly title: string | null;
|
|
12
|
+
readonly canGoBack: boolean | null;
|
|
13
|
+
readonly canGoForward: boolean | null;
|
|
14
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewport of one live page-preview browser session, in CSS pixels.
|
|
3
|
+
*
|
|
4
|
+
* @private type shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
5
|
+
*/
|
|
6
|
+
export type PagePreviewViewport = {
|
|
7
|
+
readonly width: number;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Smallest viewport accepted for one live page-preview browser session.
|
|
12
|
+
*
|
|
13
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
14
|
+
*/
|
|
15
|
+
export declare const PAGE_PREVIEW_MIN_VIEWPORT: PagePreviewViewport;
|
|
16
|
+
/**
|
|
17
|
+
* Largest viewport accepted for one live page-preview browser session.
|
|
18
|
+
*
|
|
19
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
20
|
+
*/
|
|
21
|
+
export declare const PAGE_PREVIEW_MAX_VIEWPORT: PagePreviewViewport;
|
|
22
|
+
/**
|
|
23
|
+
* Viewport used when the client did not measure its preview area yet.
|
|
24
|
+
*
|
|
25
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
26
|
+
*/
|
|
27
|
+
export declare const PAGE_PREVIEW_DEFAULT_VIEWPORT: PagePreviewViewport;
|
|
28
|
+
/**
|
|
29
|
+
* Clamps one requested page-preview viewport into the supported bounds.
|
|
30
|
+
*
|
|
31
|
+
* @param width - Requested viewport width.
|
|
32
|
+
* @param height - Requested viewport height.
|
|
33
|
+
* @returns Rounded viewport within the supported bounds, or `null` when the values are not finite numbers.
|
|
34
|
+
*
|
|
35
|
+
* @private utility shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
36
|
+
*/
|
|
37
|
+
export declare function clampPagePreviewViewport(width: unknown, height: unknown): PagePreviewViewport | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix of every live page-preview browser session id.
|
|
3
|
+
*
|
|
4
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
5
|
+
*/
|
|
6
|
+
export declare const PAGE_PREVIEW_SESSION_ID_PREFIX = "page-preview-";
|
|
7
|
+
/**
|
|
8
|
+
* Pattern accepted for client-created page-preview session identifiers.
|
|
9
|
+
*
|
|
10
|
+
* @private constant shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
11
|
+
*/
|
|
12
|
+
export declare const PAGE_PREVIEW_SESSION_ID_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* Creates one client-side page-preview browser session id.
|
|
15
|
+
*
|
|
16
|
+
* @returns Session id accepted by the Agents Server page-preview routes.
|
|
17
|
+
*
|
|
18
|
+
* @private utility of `<LiveBrowserPreview/>`
|
|
19
|
+
*/
|
|
20
|
+
export declare function createPagePreviewSessionId(): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PagePreviewInputEvent } from './PagePreviewInputEvent';
|
|
2
|
+
/**
|
|
3
|
+
* Validates and normalizes one untrusted page-preview input payload into a typed input event.
|
|
4
|
+
*
|
|
5
|
+
* Note: This performs only structural validation shared by client and server — the Agents Server
|
|
6
|
+
* additionally re-checks `goto` URLs against private/internal targets before navigating.
|
|
7
|
+
*
|
|
8
|
+
* @param payload - Unknown JSON payload (usually the parsed request body).
|
|
9
|
+
* @returns Normalized input event or `null` when the payload is invalid.
|
|
10
|
+
*
|
|
11
|
+
* @private utility shared between `<LiveBrowserPreview/>` and the Agents Server page-preview routes
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizePagePreviewInputEvent(payload: unknown): PagePreviewInputEvent | null;
|
package/esm/src/book-components/Chat/Chat/pagePreview/normalizePagePreviewInputEvent.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { id } from '../../../types/string_token';
|
|
2
|
+
import type { ChatMessage } from '../types/ChatMessage';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the stable key used for local chat feedback state.
|
|
5
|
+
*
|
|
6
|
+
* @private utility of `<Chat/>`
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveChatRatingMessageKey(message: Pick<ChatMessage, 'id' | 'content'>): id;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { string_markdown } from '../../../types/string_markdown';
|
|
3
|
+
import type { MarkdownInlineReference } from '../utils/renderMarkdown';
|
|
3
4
|
/**
|
|
4
5
|
* Props for markdown content.
|
|
5
6
|
*/
|
|
6
7
|
type MarkdownContentProps = {
|
|
7
8
|
content: string_markdown;
|
|
8
9
|
className?: string;
|
|
10
|
+
inlineReferences?: ReadonlyArray<MarkdownInlineReference>;
|
|
9
11
|
onCreateAgent?: (bookContent: string) => void;
|
|
10
12
|
theme?: 'LIGHT' | 'DARK';
|
|
11
13
|
};
|