@promptbook/google 0.112.0-40 โ†’ 0.112.0-41

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.
Files changed (54) hide show
  1. package/README.md +23 -21
  2. package/esm/index.es.js +1 -1
  3. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +8 -2
  4. package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +0 -10
  5. package/esm/src/book-components/Chat/Chat/ChatInputUploadedFile.d.ts +10 -0
  6. package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +46 -0
  7. package/esm/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +146 -0
  8. package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +1 -1
  9. package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +39 -0
  10. package/esm/src/book-components/Chat/Chat/useChatPostprocessedMessages.d.ts +17 -0
  11. package/esm/src/book-components/Chat/Chat/useChatScrollState.d.ts +34 -0
  12. package/esm/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +61 -0
  13. package/esm/src/book-components/Chat/Chat/useChatToolCallState.d.ts +35 -0
  14. package/esm/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +58 -0
  15. package/esm/src/book-components/Chat/LlmChat/useLlmChatMessages.d.ts +29 -0
  16. package/esm/src/book-components/Chat/LlmChat/useLlmChatState.d.ts +53 -0
  17. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +7 -1
  18. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +52 -0
  19. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +128 -0
  20. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -3
  21. package/esm/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +54 -0
  22. package/esm/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +29 -0
  23. package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +28 -0
  24. package/esm/src/types/number_usd.d.ts +1 -1
  25. package/esm/src/types/string_parameter_name.d.ts +2 -2
  26. package/esm/src/types/typeAliases.d.ts +2 -2
  27. package/esm/src/version.d.ts +1 -1
  28. package/package.json +2 -2
  29. package/umd/index.umd.js +1 -1
  30. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +8 -2
  31. package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +0 -10
  32. package/umd/src/book-components/Chat/Chat/ChatInputUploadedFile.d.ts +10 -0
  33. package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +46 -0
  34. package/umd/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +146 -0
  35. package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +1 -1
  36. package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +39 -0
  37. package/umd/src/book-components/Chat/Chat/useChatPostprocessedMessages.d.ts +17 -0
  38. package/umd/src/book-components/Chat/Chat/useChatScrollState.d.ts +34 -0
  39. package/umd/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +61 -0
  40. package/umd/src/book-components/Chat/Chat/useChatToolCallState.d.ts +35 -0
  41. package/umd/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +58 -0
  42. package/umd/src/book-components/Chat/LlmChat/useLlmChatMessages.d.ts +29 -0
  43. package/umd/src/book-components/Chat/LlmChat/useLlmChatState.d.ts +53 -0
  44. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +7 -1
  45. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +52 -0
  46. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +128 -0
  47. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -3
  48. package/umd/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +54 -0
  49. package/umd/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +29 -0
  50. package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +28 -0
  51. package/umd/src/types/number_usd.d.ts +1 -1
  52. package/umd/src/types/string_parameter_name.d.ts +2 -2
  53. package/umd/src/types/typeAliases.d.ts +2 -2
  54. package/umd/src/version.d.ts +1 -1
package/README.md CHANGED
@@ -19,11 +19,13 @@ Create persistent AI agents that turn your company's scattered knowledge into ac
19
19
  [![๐Ÿงช Test types](https://github.com/webgptorg/promptbook/actions/workflows/test-types.yml/badge.svg)](https://github.com/webgptorg/promptbook/actions/workflows/test-types.yml)
20
20
  [![Issues](https://img.shields.io/github/issues/webgptorg/promptbook.svg?style=flat)](https://github.com/webgptorg/promptbook/issues)
21
21
 
22
+ ## ๐Ÿš€ Quick deploy
22
23
 
23
24
 
24
- ## ๐ŸŒŸ New Features
25
25
 
26
- - **Gemini 3 Support**
26
+ [![Vercel](https://img.shields.io/badge/Vercel-Deploy%20Agents%20Server-black?logo=vercel)](https://vercel.com/new/clone?project-name=promptbook-agents-server&repository-name=promptbook-agents-server&repository-url=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook&root-directory=apps%2Fagents-server&demo-title=Promptbook+Agents+Server&demo-description=Persistent+AI+agents+with+a+built-in+admin+UI.+This+deploy+creates+a+Supabase+project+automatically%2C+injects+the+required+database+credentials%2C+and+Promptbook+runs+the+SQL+migrations+on+first+startup.&demo-url=https%3A%2F%2Fgallery.ptbk.io%2F&external-id=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Ftree%2Fmain%2Fapps%2Fagents-server&env=OPENAI_API_KEY%2CADMIN_PASSWORD%2CSUPABASE_AUTO_MIGRATE&envDescription=Supabase+is+created+automatically+by+the+required+Vercel+integration.+Add+OPENAI_API_KEY+from+https%3A%2F%2Fplatform.openai.com%2Fapi-keys%2C+choose+ADMIN_PASSWORD+for+your+first+admin+login%2C+and+leave+SUPABASE_AUTO_MIGRATE+enabled.&envLink=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Fblob%2Fmain%2FREADME.md%23vercel-form-fields&envDefaults=%7B%22SUPABASE_AUTO_MIGRATE%22%3A%22true%22%7D&stores=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22supabase%22%2C%22productSlug%22%3A%22supabase%22%7D%5D)
27
+
28
+
27
29
 
28
30
 
29
31
 
@@ -669,28 +671,28 @@ npx ptbk coder verify
669
671
 
670
672
  #### What each command does
671
673
 
672
- | Command | What it does |
673
- | --- | --- |
674
- | `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.tmp`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
675
- | `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
676
- | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, marks success or failure, then commits and pushes the result. |
677
- | `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow|low|medium|high|xhigh|extreme>` ranges from a very benevolent scan to a very aggressive sweep. |
678
- | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
674
+ | Command | What it does |
675
+ | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
676
+ | `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.tmp`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
677
+ | `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
678
+ | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, marks success or failure, then commits and pushes the result. |
679
+ | `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow | low | medium | high | xhigh | extreme>` ranges from a very benevolent scan to a very aggressive sweep. |
680
+ | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
679
681
 
680
682
  #### Most useful `ptbk coder run` flags
681
683
 
682
- | Flag | Purpose |
683
- | --- | --- |
684
- | `--agent <name>` | Selects the coding backend. |
685
- | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
686
- | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
687
- | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
688
- | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
689
- | `--ignore-git-changes` | Disables the clean-working-tree guard. |
690
- | `--priority <n>` | Runs only prompts at or above the given priority. |
691
- | `--dry-run` | Prints which prompts are ready instead of executing them. |
692
- | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
693
- | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
684
+ | Flag | Purpose |
685
+ | -------------------------- | -------------------------------------------------------------------------------------------------- |
686
+ | `--agent <name>` | Selects the coding backend. |
687
+ | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
688
+ | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
689
+ | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
690
+ | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
691
+ | `--ignore-git-changes` | Disables the clean-working-tree guard. |
692
+ | `--priority <n>` | Runs only prompts at or above the given priority. |
693
+ | `--dry-run` | Prints which prompts are ready instead of executing them. |
694
+ | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
695
+ | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
694
696
 
695
697
  #### Typical usage pattern
696
698
 
package/esm/index.es.js CHANGED
@@ -16,7 +16,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/promptbook
18
18
  */
19
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-40';
19
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-41';
20
20
  /**
21
21
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
22
22
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -3,8 +3,14 @@ import type { AgentModelRequirements } from './AgentModelRequirements';
3
3
  import type { CreateAgentModelRequirementsOptions } from './CreateAgentModelRequirementsOptions';
4
4
  import type { string_book } from './string_book';
5
5
  /**
6
- * @@@
6
+ * Creates agent model requirements by parsing commitments, applying them in source order,
7
+ * and finalizing derived sections such as imports, example interactions, and inline knowledge uploads.
7
8
  *
8
- * @private @@@
9
+ * @param agentSource - Agent source book to parse.
10
+ * @param modelName - Optional override for the agent model name.
11
+ * @param options - Additional options such as reference and teammate resolvers.
12
+ * @returns Fully prepared model requirements for the parsed agent source.
13
+ *
14
+ * @private internal utility of `createAgentModelRequirements`
9
15
  */
10
16
  export declare function createAgentModelRequirementsWithCommitments(agentSource: string_book, modelName?: string_model_name, options?: CreateAgentModelRequirementsOptions): Promise<AgentModelRequirements>;
@@ -10,16 +10,6 @@ import type { ChatProps, ChatSoundSystem } from './ChatProps';
10
10
  * @private component of `<Chat/>`
11
11
  */
12
12
  export type ChatInputButtonClickHandler = (handler?: (event: MouseEvent<HTMLButtonElement>) => void) => (event: MouseEvent<HTMLButtonElement>) => void;
13
- /**
14
- * Internal representation of an uploaded file in the chat input.
15
- *
16
- * @private component of `<Chat/>`
17
- */
18
- export type ChatInputUploadedFile = {
19
- id: string;
20
- file: File;
21
- content: string;
22
- };
23
13
  /**
24
14
  * Props for the chat input area.
25
15
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Internal representation of an uploaded file in the chat input.
3
+ *
4
+ * @private type of `<ChatInputArea/>`
5
+ */
6
+ export type ChatInputUploadedFile = {
7
+ readonly id: string;
8
+ readonly file: File;
9
+ readonly content: string;
10
+ };
@@ -0,0 +1,46 @@
1
+ import { type ReactElement } from 'react';
2
+ import { Color } from '../../../utils/color/Color';
3
+ import type { WithTake } from '../../../utils/take/interfaces/ITakeChain';
4
+ import type { ChatMessage } from '../types/ChatMessage';
5
+ import type { ChatParticipant } from '../types/ChatParticipant';
6
+ import { type TeamToolCallSummary, type TransitiveToolCall } from '../utils/collectTeamToolCallSummary';
7
+ import type { AgentProfileData } from '../utils/loadAgentProfile';
8
+ import type { TeamToolResult } from '../utils/toolCallParsing';
9
+ import type { ChatUiTranslations } from './ChatProps';
10
+ /**
11
+ * Tool-call snapshot rendered by the modal body.
12
+ *
13
+ * @private function of `ChatToolCallModalContent`
14
+ */
15
+ type ToolCallModalToolCall = NonNullable<ChatMessage['toolCalls']>[number];
16
+ /**
17
+ * Props consumed by `<ChatToolCallModalContent/>`.
18
+ *
19
+ * @private function of `ChatToolCallModalContent`
20
+ */
21
+ type ChatToolCallModalContentProps = {
22
+ readonly agentParticipant?: ChatParticipant;
23
+ readonly availableTools?: ChatMessage['availableTools'];
24
+ readonly buttonColor: WithTake<Color>;
25
+ readonly chatUiTranslations?: ChatUiTranslations;
26
+ readonly focusedToolCall: ToolCallModalToolCall;
27
+ readonly isAdvancedView: boolean;
28
+ readonly locale?: string;
29
+ readonly onClearSelectedTeamToolCall: () => void;
30
+ readonly onRequestAdvancedView: () => void;
31
+ readonly onSelectTeamToolCall: (toolCall: TransitiveToolCall) => void;
32
+ readonly selectedTeamToolCall: TransitiveToolCall | null;
33
+ readonly teamProfiles: Record<string, AgentProfileData>;
34
+ readonly teamResult: TeamToolResult | null;
35
+ readonly teamToolCallSummary: TeamToolCallSummary;
36
+ readonly toolCall: ToolCallModalToolCall;
37
+ readonly toolCallDate: Date | null;
38
+ readonly toolTitles?: Record<string, string>;
39
+ };
40
+ /**
41
+ * Renders the simple TEAM view, the simple single-tool view, or the advanced raw-payload view.
42
+ *
43
+ * @private component of `ChatToolCallModal`
44
+ */
45
+ export declare function ChatToolCallModalContent({ agentParticipant, availableTools, buttonColor, chatUiTranslations, focusedToolCall, isAdvancedView, locale, onClearSelectedTeamToolCall, onRequestAdvancedView, onSelectTeamToolCall, selectedTeamToolCall, teamProfiles, teamResult, teamToolCallSummary, toolCall, toolCallDate, toolTitles, }: ChatToolCallModalContentProps): ReactElement;
46
+ export {};
@@ -0,0 +1,146 @@
1
+ import type { ToolCallLogEntry, ToolCallState } from '../../../types/ToolCall';
2
+ import type { TODO_any } from '../../../utils/organization/TODO_any';
3
+ import type { ChatMessage } from '../types/ChatMessage';
4
+ import type { RunBrowserToolArtifact, RunBrowserToolError } from '../utils/toolCallParsing';
5
+ /**
6
+ * One browser tool call rendered in the replay modal.
7
+ *
8
+ * @private type of resolveRunBrowserToolCallDetailsState
9
+ */
10
+ type RunBrowserToolCall = NonNullable<ChatMessage['toolCalls']>[number];
11
+ /**
12
+ * Rendering options needed to derive browser replay state.
13
+ *
14
+ * @private type of resolveRunBrowserToolCallDetailsState
15
+ */
16
+ type ResolveRunBrowserToolCallDetailsStateOptions = {
17
+ /**
18
+ * Tool call being rendered.
19
+ */
20
+ toolCall: RunBrowserToolCall;
21
+ /**
22
+ * Parsed tool call arguments.
23
+ */
24
+ args: Record<string, TODO_any>;
25
+ /**
26
+ * Parsed tool result payload.
27
+ */
28
+ resultRaw: TODO_any;
29
+ };
30
+ /**
31
+ * Current visual state rendered for one browser action row in the modal.
32
+ *
33
+ * @private type of resolveRunBrowserToolCallDetailsState
34
+ */
35
+ type BrowserActionRowState = 'pending' | 'running' | 'complete' | 'error';
36
+ /**
37
+ * One browser action row rendered in the simple browser-tool view.
38
+ *
39
+ * @private type of resolveRunBrowserToolCallDetailsState
40
+ */
41
+ type BrowserActionRow = {
42
+ /**
43
+ * Stable row key.
44
+ */
45
+ key: string;
46
+ /**
47
+ * Human-readable action summary.
48
+ */
49
+ label: string;
50
+ /**
51
+ * Current action state.
52
+ */
53
+ state: BrowserActionRowState;
54
+ };
55
+ /**
56
+ * One metadata row rendered in the browser replay summary block.
57
+ *
58
+ * @private type of resolveRunBrowserToolCallDetailsState
59
+ */
60
+ type RunBrowserMetaItem = {
61
+ /**
62
+ * Stable key for React rendering.
63
+ */
64
+ key: string;
65
+ /**
66
+ * User-facing row label.
67
+ */
68
+ label: string;
69
+ /**
70
+ * User-facing row value.
71
+ */
72
+ value: string;
73
+ /**
74
+ * Optional link target when the value is a URL.
75
+ */
76
+ href?: string;
77
+ };
78
+ /**
79
+ * Fully derived browser replay state consumed by render helpers.
80
+ *
81
+ * @private type of resolveRunBrowserToolCallDetailsState
82
+ */
83
+ type RunBrowserToolCallDetailsState = {
84
+ /**
85
+ * Original tool call currently being rendered.
86
+ */
87
+ toolCall: RunBrowserToolCall;
88
+ /**
89
+ * Resolved lifecycle state of the tool call snapshot.
90
+ */
91
+ toolCallState: ToolCallState;
92
+ /**
93
+ * Metadata rows shown at the top of the replay UI.
94
+ */
95
+ metaItems: Array<RunBrowserMetaItem>;
96
+ /**
97
+ * Browser-session log entry surfaced as a status banner.
98
+ */
99
+ browserReadyLog: ToolCallLogEntry | null;
100
+ /**
101
+ * Parsed browser warning message, when present.
102
+ */
103
+ warning: string | null;
104
+ /**
105
+ * Parsed fallback extracted content, when present.
106
+ */
107
+ fallbackContent: string | null;
108
+ /**
109
+ * Parsed browser error, when present.
110
+ */
111
+ runBrowserError: RunBrowserToolError | null;
112
+ /**
113
+ * Visual artifacts captured during the browser session.
114
+ */
115
+ artifacts: Array<RunBrowserToolArtifact>;
116
+ /**
117
+ * Ordered action rows combining requested actions, streamed logs, and final summaries.
118
+ */
119
+ actionRows: Array<BrowserActionRow>;
120
+ /**
121
+ * Indicates that the visual replay placeholder should be shown.
122
+ */
123
+ isVisualReplayPending: boolean;
124
+ /**
125
+ * Indicates that the empty visual replay state should be shown.
126
+ */
127
+ isVisualReplayEmpty: boolean;
128
+ /**
129
+ * Indicates that the action-plan placeholder should be shown.
130
+ */
131
+ isActionPlanPending: boolean;
132
+ /**
133
+ * Indicates that a streaming issue notice should be shown below the sections.
134
+ */
135
+ isStreamingErrorNoticeVisible: boolean;
136
+ };
137
+ /**
138
+ * Resolves all derived state needed by `renderRunBrowserToolCallDetails`.
139
+ *
140
+ * @param options - Raw browser tool-call data.
141
+ * @returns Derived state ready for focused render helpers.
142
+ *
143
+ * @private function of renderRunBrowserToolCallDetails
144
+ */
145
+ export declare function resolveRunBrowserToolCallDetailsState(options: ResolveRunBrowserToolCallDetailsStateOptions): RunBrowserToolCallDetailsState;
146
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { type ChangeEvent, type ClipboardEvent, type DragEvent } from 'react';
2
- import type { ChatInputUploadedFile } from './ChatInputArea';
2
+ import type { ChatInputUploadedFile } from './ChatInputUploadedFile';
3
3
  import type { ChatProps } from './ChatProps';
4
4
  /**
5
5
  * Props for `useChatInputAreaAttachments`.
@@ -0,0 +1,39 @@
1
+ import { type ChangeEvent, type KeyboardEvent as ReactKeyboardEvent, type MutableRefObject } from 'react';
2
+ import type { ChatMessage } from '../types/ChatMessage';
3
+ import type { ChatInputUploadedFile } from './ChatInputUploadedFile';
4
+ import type { ChatProps, ChatSoundSystem } from './ChatProps';
5
+ /**
6
+ * Props for `useChatInputAreaComposer`.
7
+ *
8
+ * @private function of `<ChatInputArea/>`
9
+ */
10
+ type UseChatInputAreaComposerProps = {
11
+ readonly onMessage?: ChatProps['onMessage'];
12
+ readonly onChange?: ChatProps['onChange'];
13
+ readonly defaultMessage?: string;
14
+ readonly enterBehavior?: ChatProps['enterBehavior'];
15
+ readonly resolveEnterBehavior?: ChatProps['resolveEnterBehavior'];
16
+ readonly isFocusedOnLoad?: boolean;
17
+ readonly isMobile: boolean;
18
+ readonly uploadedFiles: ReadonlyArray<ChatInputUploadedFile>;
19
+ readonly uploadedFilesRef: MutableRefObject<Array<ChatInputUploadedFile>>;
20
+ readonly clearUploadedFiles: () => void;
21
+ readonly replyingToMessage?: ChatMessage | null;
22
+ readonly onCancelReply?: ChatProps['onCancelReply'];
23
+ readonly soundSystem?: ChatSoundSystem;
24
+ };
25
+ /**
26
+ * Manages textarea state, send/newline behavior, and deferred Enter resolution for `<ChatInputArea/>`.
27
+ *
28
+ * @private function of `<ChatInputArea/>`
29
+ */
30
+ export declare function useChatInputAreaComposer(props: UseChatInputAreaComposerProps): {
31
+ textareaRef: import("react").RefObject<HTMLTextAreaElement | null>;
32
+ messageContent: string;
33
+ messageContentRef: import("react").RefObject<string>;
34
+ applyMessageContent: (nextContent: string) => void;
35
+ handleTextInputChange: (event: ChangeEvent<HTMLTextAreaElement>) => void;
36
+ handleComposerKeyDown: (event: ReactKeyboardEvent<HTMLTextAreaElement>) => void;
37
+ handleSend: () => Promise<void>;
38
+ };
39
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { ChatMessage } from '../types/ChatMessage';
2
+ /**
3
+ * Inputs required to normalize rendered chat messages.
4
+ *
5
+ * @private function of `useChatPostprocessedMessages`
6
+ */
7
+ type UseChatPostprocessedMessagesProps = {
8
+ messages: ReadonlyArray<ChatMessage>;
9
+ isAiTextHumanizedAndPromptbookified: boolean;
10
+ };
11
+ /**
12
+ * Memoizes the render-only message normalization used by `<Chat/>`.
13
+ *
14
+ * @private function of `<Chat/>`
15
+ */
16
+ export declare function useChatPostprocessedMessages({ messages, isAiTextHumanizedAndPromptbookified, }: UseChatPostprocessedMessagesProps): ReadonlyArray<ChatMessage>;
17
+ export {};
@@ -0,0 +1,34 @@
1
+ import { type MutableRefObject, type UIEvent } from 'react';
2
+ import type { ChatMessage } from '../types/ChatMessage';
3
+ /**
4
+ * Inputs required to coordinate Chat scroll behavior.
5
+ *
6
+ * @private function of `useChatScrollState`
7
+ */
8
+ type UseChatScrollStateProps = {
9
+ messages: ReadonlyArray<ChatMessage>;
10
+ };
11
+ /**
12
+ * Public result consumed by `<Chat/>`.
13
+ *
14
+ * @private function of `useChatScrollState`
15
+ */
16
+ type UseChatScrollStateResult = {
17
+ readonly actionsRef: MutableRefObject<HTMLDivElement | null>;
18
+ readonly ariaLabel: string;
19
+ readonly badgeLabel: string;
20
+ readonly handleChatScroll: (event: UIEvent<HTMLDivElement>) => void;
21
+ readonly isMobile: boolean;
22
+ readonly scrollToBottom: (behavior?: 'smooth' | 'auto') => void;
23
+ readonly setChatMessagesElement: (element: HTMLDivElement | null) => void;
24
+ readonly shouldDisableActions: boolean;
25
+ readonly shouldFadeActions: boolean;
26
+ readonly shouldShowScrollToBottom: boolean;
27
+ };
28
+ /**
29
+ * Coordinates auto-scroll, overlap tracking, and the scroll-to-bottom indicator for `<Chat/>`.
30
+ *
31
+ * @private function of `<Chat/>`
32
+ */
33
+ export declare function useChatScrollState({ messages }: UseChatScrollStateProps): UseChatScrollStateResult;
34
+ export {};
@@ -0,0 +1,61 @@
1
+ import { type MutableRefObject } from 'react';
2
+ import type { AgentChipData } from '../AgentChip/AgentChip';
3
+ import type { ChatMessage } from '../types/ChatMessage';
4
+ import { type TeamToolCallSummary, type TransitiveToolCall } from '../utils/collectTeamToolCallSummary';
5
+ import { type AgentProfileData } from '../utils/loadAgentProfile';
6
+ import { type TeamToolResult } from '../utils/toolCallParsing';
7
+ /**
8
+ * Tool-call snapshot rendered by the modal.
9
+ *
10
+ * @private function of `ChatToolCallModal`
11
+ */
12
+ type ToolCallModalToolCall = NonNullable<ChatMessage['toolCalls']>[number];
13
+ /**
14
+ * Export target used by the advanced tool-call report controls.
15
+ *
16
+ * @private function of `ChatToolCallModal`
17
+ */
18
+ type ToolCallReportDestination = 'clipboard' | 'file';
19
+ /**
20
+ * Inputs required to coordinate `<ChatToolCallModal/>` state.
21
+ *
22
+ * @private function of `useChatToolCallModalState`
23
+ */
24
+ type UseChatToolCallModalStateProps = {
25
+ readonly isOpen: boolean;
26
+ readonly toolCall: ToolCallModalToolCall | null;
27
+ /**
28
+ * Stable identity of the selected tool call.
29
+ */
30
+ readonly toolCallIdentity?: string | null;
31
+ readonly onClose: () => void;
32
+ readonly toolTitles?: Record<string, string>;
33
+ readonly teamAgentProfiles?: Record<string, AgentChipData>;
34
+ };
35
+ /**
36
+ * State and callbacks consumed by `<ChatToolCallModal/>`.
37
+ *
38
+ * @private function of `useChatToolCallModalState`
39
+ */
40
+ type UseChatToolCallModalStateResult = {
41
+ readonly clearSelectedTeamToolCall: () => void;
42
+ readonly exportAdvancedToolCallReport: (destination: ToolCallReportDestination) => Promise<void>;
43
+ readonly focusedToolCall: ToolCallModalToolCall | null;
44
+ readonly isAdvancedView: boolean;
45
+ readonly modalDialogRef: MutableRefObject<HTMLDivElement | null>;
46
+ readonly openAdvancedView: () => void;
47
+ readonly selectTeamToolCall: (toolCall: TransitiveToolCall) => void;
48
+ readonly selectedTeamToolCall: TransitiveToolCall | null;
49
+ readonly teamProfiles: Record<string, AgentProfileData>;
50
+ readonly teamResult: TeamToolResult | null;
51
+ readonly teamToolCallSummary: TeamToolCallSummary;
52
+ readonly toggleViewMode: () => void;
53
+ readonly toolCallDate: Date | null;
54
+ };
55
+ /**
56
+ * Coordinates derived data, modal lifecycle, and advanced-export actions for `<ChatToolCallModal/>`.
57
+ *
58
+ * @private function of `ChatToolCallModal`
59
+ */
60
+ export declare function useChatToolCallModalState({ isOpen, toolCall, toolCallIdentity, onClose, toolTitles, teamAgentProfiles, }: UseChatToolCallModalStateProps): UseChatToolCallModalStateResult;
61
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { ToolCall } from '../../../types/ToolCall';
2
+ import type { ChatMessage } from '../types/ChatMessage';
3
+ import type { ParsedCitation } from '../utils/parseCitationsFromContent';
4
+ /**
5
+ * Inputs required to keep Chat tool-call and citation modals in sync.
6
+ *
7
+ * @private function of `useChatToolCallState`
8
+ */
9
+ type UseChatToolCallStateProps = {
10
+ messages: ReadonlyArray<ChatMessage>;
11
+ };
12
+ /**
13
+ * State and callbacks exposed back to `<Chat/>`.
14
+ *
15
+ * @private function of `useChatToolCallState`
16
+ */
17
+ type UseChatToolCallStateResult = {
18
+ readonly citationModalOpen: boolean;
19
+ readonly closeCitationModal: () => void;
20
+ readonly closeToolCallModal: () => void;
21
+ readonly openCitation: (citation: ParsedCitation) => void;
22
+ readonly openToolCall: (toolCall: ToolCall) => void;
23
+ readonly selectedCitation: ParsedCitation | null;
24
+ readonly selectedMessageAvailableTools: ChatMessage['availableTools'];
25
+ readonly selectedToolCall: ToolCall | null;
26
+ readonly selectedToolCallIdentity: string | null;
27
+ readonly toolCallModalOpen: boolean;
28
+ };
29
+ /**
30
+ * Keeps Chat modal state focused on one selected tool call or citation.
31
+ *
32
+ * @private function of `<Chat/>`
33
+ */
34
+ export declare function useChatToolCallState({ messages }: UseChatToolCallStateProps): UseChatToolCallStateResult;
35
+ export {};
@@ -0,0 +1,58 @@
1
+ import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
2
+ import type { LlmExecutionTools } from '../../../execution/LlmExecutionTools';
3
+ import type { id } from '../../../types/typeAliases';
4
+ import type { ChatMessage } from '../types/ChatMessage';
5
+ import type { LlmChatProps } from './LlmChatProps';
6
+ /**
7
+ * Minimal task-progress item rendered by `<Chat/>`.
8
+ *
9
+ * @private function of `useLlmChatMessageHandler`
10
+ */
11
+ type LlmChatTaskProgress = {
12
+ readonly id: string;
13
+ readonly name: string;
14
+ readonly progress?: number;
15
+ };
16
+ /**
17
+ * Internal send signature shared across retry and visibility-recovery flows.
18
+ *
19
+ * @private function of `useLlmChatMessageHandler`
20
+ */
21
+ type HandleMessageFn = (messageContent: string, attachments?: ChatMessage['attachments']) => Promise<void>;
22
+ /**
23
+ * Inputs required by `useLlmChatMessageHandler`.
24
+ *
25
+ * @private function of `useLlmChatMessageHandler`
26
+ */
27
+ type UseLlmChatMessageHandlerProps = {
28
+ readonly chatFailMessage: string;
29
+ readonly hasUserInteractedRef: MutableRefObject<boolean>;
30
+ readonly llmParticipantName: id;
31
+ readonly llmTools: LlmExecutionTools;
32
+ readonly messages: ReadonlyArray<ChatMessage>;
33
+ readonly onError?: LlmChatProps['onError'];
34
+ readonly promptParameters: Record<string, string>;
35
+ readonly setMessages: Dispatch<SetStateAction<Array<ChatMessage>>>;
36
+ readonly setTasksProgress: Dispatch<SetStateAction<Array<LlmChatTaskProgress>>>;
37
+ readonly thinkingVariants: ReadonlyArray<string>;
38
+ readonly thread?: ReadonlyArray<ChatMessage>;
39
+ readonly userParticipantName: id;
40
+ };
41
+ /**
42
+ * State and handlers returned by `useLlmChatMessageHandler`.
43
+ *
44
+ * @private function of `useLlmChatMessageHandler`
45
+ */
46
+ type UseLlmChatMessageHandlerResult = {
47
+ readonly clearLastFailedMessage: () => void;
48
+ readonly handleMessage: HandleMessageFn;
49
+ readonly handleStopStreaming: () => void;
50
+ readonly isStreaming: boolean;
51
+ };
52
+ /**
53
+ * Manages send, stream, retry, and background-recovery flows for `<LlmChat/>`.
54
+ *
55
+ * @private function of `useLlmChatState`
56
+ */
57
+ export declare function useLlmChatMessageHandler(props: UseLlmChatMessageHandlerProps): UseLlmChatMessageHandlerResult;
58
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
2
+ import type { ChatMessage } from '../types/ChatMessage';
3
+ /**
4
+ * Inputs required to manage the persisted `<LlmChat/>` message list.
5
+ *
6
+ * @private function of `useLlmChatMessages`
7
+ */
8
+ type UseLlmChatMessagesProps = {
9
+ readonly initialMessages?: ReadonlyArray<ChatMessage>;
10
+ readonly persistenceKey?: string;
11
+ };
12
+ /**
13
+ * State and helpers returned by `useLlmChatMessages`.
14
+ *
15
+ * @private function of `useLlmChatMessages`
16
+ */
17
+ type UseLlmChatMessagesResult = {
18
+ readonly buildInitialMessages: () => Array<ChatMessage>;
19
+ readonly hasUserInteractedRef: MutableRefObject<boolean>;
20
+ readonly messages: Array<ChatMessage>;
21
+ readonly setMessages: Dispatch<SetStateAction<Array<ChatMessage>>>;
22
+ };
23
+ /**
24
+ * Manages initial seeding plus optional local persistence for `<LlmChat/>`.
25
+ *
26
+ * @private function of `useLlmChatState`
27
+ */
28
+ export declare function useLlmChatMessages(props: UseLlmChatMessagesProps): UseLlmChatMessagesResult;
29
+ export {};