@promptbook/types 0.112.0-45 → 0.112.0-47

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 (44) hide show
  1. package/README.md +16 -16
  2. package/esm/src/avatars/AvatarOrImage.d.ts +45 -0
  3. package/esm/src/avatars/index.d.ts +1 -0
  4. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
  5. package/esm/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
  6. package/esm/src/avatars/visuals/avatarVisualRegistry.test.d.ts +1 -0
  7. package/esm/src/avatars/visuals/fractalAvatarVisual.d.ts +7 -0
  8. package/esm/src/avatars/visuals/octopus2AvatarVisual.d.ts +7 -0
  9. package/esm/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
  10. package/esm/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
  11. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  12. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  13. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
  14. package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
  15. package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
  16. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
  17. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  18. package/esm/src/config.d.ts +2 -2
  19. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
  20. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
  21. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
  22. package/esm/src/version.d.ts +1 -1
  23. package/package.json +5 -4
  24. package/umd/src/avatars/AvatarOrImage.d.ts +45 -0
  25. package/umd/src/avatars/index.d.ts +1 -0
  26. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
  27. package/umd/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
  28. package/umd/src/avatars/visuals/avatarVisualRegistry.test.d.ts +1 -0
  29. package/umd/src/avatars/visuals/fractalAvatarVisual.d.ts +7 -0
  30. package/umd/src/avatars/visuals/octopus2AvatarVisual.d.ts +7 -0
  31. package/umd/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
  32. package/umd/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
  33. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  34. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  35. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
  36. package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
  37. package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
  38. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
  39. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  40. package/umd/src/config.d.ts +2 -2
  41. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
  42. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
  43. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
  44. package/umd/src/version.d.ts +1 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  <!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
2
2
 
3
- # Promptbook: AI Agents
3
+ # 🐙 Promptbook: Invisible AI Agents
4
4
 
5
- Create persistent AI agents that turn your company's scattered knowledge into action powered by the [Agents Server](https://gallery.ptbk.io/)
5
+ Create persistent AI agents that turn your company's scattered knowledge into action - powered by the [Agents Server](https://gallery.ptbk.io/)
6
6
 
7
7
 
8
8
 
@@ -306,13 +306,13 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
306
306
 
307
307
  ## 📖 The Book Whitepaper
308
308
 
309
- Promptbook lets you create **persistent AI agents** that work on real goals for your company. The [**Agents Server**](https://gallery.ptbk.io/) is the heart of the project a place where your AI agents live, remember context, collaborate in teams, and get things done.
309
+ Promptbook lets you create **persistent AI agents** that work on real goals for your company. The [**Agents Server**](https://gallery.ptbk.io/) is the heart of the project - a place where your AI agents live, remember context, collaborate in teams, and get things done.
310
310
 
311
311
  Nowadays, the biggest challenge for most business applications isn't the raw capabilities of AI models. Large language models such as GPT-5.2 and Claude-4.5 are incredibly capable.
312
312
 
313
313
  The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
314
314
 
315
- In Promptbook, you define your agents **using simple Books** a human-readable language that is explicit, easy to understand and write, reliable, and highly portable. You then deploy them to the **Agents Server**, where they run persistently and work toward their goals.
315
+ In Promptbook, you define your agents **using simple Books** - a human-readable language that is explicit, easy to understand and write, reliable, and highly portable. You then deploy them to the **Agents Server**, where they run persistently and work toward their goals.
316
316
 
317
317
  <table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
318
318
 
@@ -413,7 +413,7 @@ Your job is to provide legal advice and support to the company and its employees
413
413
 
414
414
  #### `Use` commitments
415
415
 
416
- Use commitments grant the agent real capabilities tools it can use to interact with the outside world. `USE EMAIL` lets the agent send emails, `USE BROWSER` lets it access and read web content, `USE SEARCH ENGINE` lets it search the web, and many more.
416
+ Use commitments grant the agent real capabilities - tools it can use to interact with the outside world. `USE EMAIL` lets the agent send emails, `USE BROWSER` lets it access and read web content, `USE SEARCH ENGINE` lets it search the web, and many more.
417
417
 
418
418
  These are what turn a chatbot into a persistent agent that actually does work.
419
419
 
@@ -462,7 +462,7 @@ Your job is to provide legal advice and support to the company and its employees
462
462
 
463
463
  ### Promptbook Ecosystem
464
464
 
465
- Promptbook is an ecosystem of tools centered around the **Agents Server** a production-ready platform for running persistent AI agents.
465
+ Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
466
466
 
467
467
  #### Agents Server
468
468
 
@@ -484,7 +484,7 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
484
484
 
485
485
  ## 💜 The Promptbook Project
486
486
 
487
- Promptbook project is an ecosystem centered around the **Agents Server** a platform for creating, deploying, and running persistent AI agents. Following is a list of the most important pieces of the project:
487
+ Promptbook project is an ecosystem centered around the **Agents Server** - a platform for creating, deploying, and running persistent AI agents. Following is a list of the most important pieces of the project:
488
488
 
489
489
  <table>
490
490
  <thead>
@@ -497,7 +497,7 @@ Promptbook project is an ecosystem centered around the **Agents Server** — a p
497
497
  <tr>
498
498
  <td><a href="https://gallery.ptbk.io/"><strong>⭐ Agents Server</strong></a></td>
499
499
  <td>
500
- The primary way to use Promptbook. A production-ready platform where your AI agents live create, manage, deploy, and interact with persistent agents that work on goals. Available as a hosted service or <a href="https://hub.docker.com/r/hejny/promptbook/">self-hosted via Docker</a>.
500
+ The primary way to use Promptbook. A production-ready platform where your AI agents live - create, manage, deploy, and interact with persistent agents that work on goals. Available as a hosted service or <a href="https://hub.docker.com/r/hejny/promptbook/">self-hosted via Docker</a>.
501
501
  </td>
502
502
  </tr>
503
503
  <tr>
@@ -587,8 +587,8 @@ For information on reporting security vulnerabilities, see our [Security Policy]
587
587
 
588
588
  The fastest way to get started is with the **Agents Server**:
589
589
 
590
- - 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** Self-host the Agents Server with full control over your data
591
- - ☁️ **[Hosted Agents Server](https://gallery.ptbk.io/)** Start creating agents immediately, no setup required
590
+ - 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Self-host the Agents Server with full control over your data
591
+ - ☁️ **[Hosted Agents Server](https://gallery.ptbk.io/)** - Start creating agents immediately, no setup required
592
592
 
593
593
  ### NPM Packages _(for developers embedding the Engine)_
594
594
 
@@ -733,7 +733,7 @@ npx ptbk coder verify
733
733
  | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
734
734
  | `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/`. |
735
735
  | `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. |
736
- | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
736
+ | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
737
737
  | `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. |
738
738
  | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
739
739
 
@@ -744,7 +744,7 @@ npx ptbk coder verify
744
744
  | `--agent <name>` | Selects the coding backend. |
745
745
  | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
746
746
  | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
747
- | `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
747
+ | `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
748
748
  | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
749
749
  | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
750
750
  | `--ignore-git-changes` | Disables the clean-working-tree guard. |
@@ -847,8 +847,8 @@ _Note: This section is not a complete dictionary, more list of general AI / LLM
847
847
 
848
848
  The **[Agents Server](https://gallery.ptbk.io/)** is the primary way to use Promptbook. It is a production-ready platform where you create, deploy, and manage persistent AI agents that work toward goals. Agents remember context across conversations, collaborate in teams, and follow the rules and knowledge you define in the Book language.
849
849
 
850
- - **Hosted** at [gallery.ptbk.io](https://gallery.ptbk.io/) start creating agents immediately
851
- - **Self-hosted** via [Docker](https://hub.docker.com/r/hejny/promptbook/) full control over your data and infrastructure
850
+ - **Hosted** at [gallery.ptbk.io](https://gallery.ptbk.io/) - start creating agents immediately
851
+ - **Self-hosted** via [Docker](https://hub.docker.com/r/hejny/promptbook/) - full control over your data and infrastructure
852
852
  - **API** for integrating agents into your own applications
853
853
 
854
854
  ## 🚂 Promptbook Engine
@@ -866,7 +866,7 @@ The Engine is the open-source core that powers the Agents Server. If you need to
866
866
  - When you want agents that **collaborate in teams** and consult each other
867
867
  - When you need to **integrate AI agents into your existing applications** via API
868
868
  - When you want to **self-host** your AI agents with full control over data and infrastructure
869
- - When you are writing an app that generates complex things via LLM like **websites, articles, presentations, code, stories, songs**,...
869
+ - When you are writing an app that generates complex things via LLM - like **websites, articles, presentations, code, stories, songs**,...
870
870
  - When you want to **version** your agent definitions and **test multiple versions**
871
871
  - When you want to **log** agent execution and backtrace issues
872
872
 
@@ -878,7 +878,7 @@ The Engine is the open-source core that powers the Agents Server. If you need to
878
878
  - When [OpenAI Assistant (GPTs)](https://help.openai.com/en/articles/8673914-gpts-vs-assistants) is enough for you
879
879
  - When you need streaming _(this may be implemented in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/102))_
880
880
  - When you need to use something other than JavaScript or TypeScript _(other languages are on the way, [see the discussion](https://github.com/webgptorg/promptbook/discussions/101))_
881
- - When your main focus is on something other than text like images, audio, video, spreadsheets _(other media types may be added in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/103))_
881
+ - When your main focus is on something other than text - like images, audio, video, spreadsheets _(other media types may be added in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/103))_
882
882
  - When you need to use recursion _([see the discussion](https://github.com/webgptorg/promptbook/discussions/38))_
883
883
 
884
884
  [See more](https://github.com/webgptorg/promptbook/discussions/112)
@@ -0,0 +1,45 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { string_css_class, string_url_image } from '../types/typeAliases';
3
+ import type { AvatarDefinition } from './types/AvatarDefinition';
4
+ import type { AvatarVisualId } from './types/AvatarVisualDefinition';
5
+ /**
6
+ * Shared avatar-rendering props for places that may receive either an image URL or a deterministic avatar visual.
7
+ *
8
+ * @private shared component for avatar media rendering
9
+ */
10
+ export type AvatarOrImageProps = {
11
+ /**
12
+ * Explicit image URL to render.
13
+ */
14
+ readonly imageUrl?: string_url_image | null;
15
+ /**
16
+ * Deterministic avatar definition used by built-in visuals.
17
+ */
18
+ readonly avatarDefinition?: AvatarDefinition | null;
19
+ /**
20
+ * Selected built-in visual id used with `avatarDefinition`.
21
+ */
22
+ readonly visualId?: AvatarVisualId | null;
23
+ /**
24
+ * Output size in CSS pixels.
25
+ */
26
+ readonly size: number;
27
+ /**
28
+ * Accessible label used for the rendered media.
29
+ */
30
+ readonly alt: string;
31
+ /**
32
+ * Optional CSS class name applied to the rendered element.
33
+ */
34
+ readonly className?: string_css_class;
35
+ /**
36
+ * Optional inline styles forwarded to the rendered element.
37
+ */
38
+ readonly style?: CSSProperties;
39
+ };
40
+ /**
41
+ * Renders either a static image or a deterministic canvas avatar using one common prop shape.
42
+ *
43
+ * @private shared component for avatar media rendering
44
+ */
45
+ export declare function AvatarOrImage(props: AvatarOrImageProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,5 @@
1
1
  export { Avatar } from './Avatar';
2
+ export { AvatarOrImage } from './AvatarOrImage';
2
3
  export { renderAvatarVisual } from './renderAvatarVisual';
3
4
  export { createAvatarDefinitionFromAgentBasicInformation } from './avatarRenderingUtils';
4
5
  export { AVATAR_VISUALS, getAvatarVisualById } from './visuals/avatarVisualRegistry';
@@ -1,3 +1,4 @@
1
+ import type { CSSProperties } from 'react';
1
2
  import type { string_color, string_css_class } from '../../types/typeAliases';
2
3
  import type { AvatarDefinition } from './AvatarDefinition';
3
4
  /**
@@ -5,7 +6,7 @@ import type { AvatarDefinition } from './AvatarDefinition';
5
6
  *
6
7
  * @private shared contract for the avatar rendering system
7
8
  */
8
- export type AvatarVisualId = 'pixel-art' | 'octopus' | 'minecraft';
9
+ export type AvatarVisualId = 'pixel-art' | 'octopus' | 'octopus2' | 'octopus3' | 'ascii-octopus' | 'minecraft' | 'fractal';
9
10
  /**
10
11
  * Derived color palette used by avatar visuals.
11
12
  *
@@ -80,6 +81,10 @@ export type AvatarProps = {
80
81
  * Optional CSS class name applied to the canvas.
81
82
  */
82
83
  readonly className?: string_css_class;
84
+ /**
85
+ * Optional inline style applied to the canvas.
86
+ */
87
+ readonly style?: CSSProperties;
83
88
  };
84
89
  /**
85
90
  * Low-level rendering options for a single canvas frame.
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * AsciiOctopus avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const asciiOctopusAvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Fractal avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const fractalAvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus2 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus2AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus3 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus3AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * One 2D point used by the shared organic octopus geometry helpers.
3
+ *
4
+ * @private helper of octopus avatar visuals
5
+ */
6
+ type Point = {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ };
10
+ /**
11
+ * Shape parameters for the smooth octopus silhouette generator.
12
+ *
13
+ * @private helper of octopus avatar visuals
14
+ */
15
+ type CreateOrganicOctopusBodyPointsOptions = {
16
+ readonly centerX: number;
17
+ readonly centerY: number;
18
+ readonly bodyRadius: number;
19
+ readonly horizontalStretch: number;
20
+ readonly verticalStretch: number;
21
+ readonly mantleLift: number;
22
+ readonly lowerDrop: number;
23
+ readonly tentacleDepth: number;
24
+ readonly wobbleAmplitude: number;
25
+ readonly lobeCount: number;
26
+ readonly shapePhase: number;
27
+ readonly timeMs: number;
28
+ readonly pointCount?: number;
29
+ };
30
+ /**
31
+ * One deterministic ribbon tentacle attached to an organic octopus mantle.
32
+ *
33
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
34
+ */
35
+ export type OrganicTentacleShape = {
36
+ readonly startPoint: Point;
37
+ readonly controlPointOne: Point;
38
+ readonly controlPointTwo: Point;
39
+ readonly endPoint: Point;
40
+ readonly baseWidth: number;
41
+ readonly tipWidth: number;
42
+ readonly colorBias: number;
43
+ readonly highlightBias: number;
44
+ readonly sampleCount: number;
45
+ };
46
+ /**
47
+ * Options for generating deterministic organic octopus tentacles.
48
+ *
49
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
50
+ */
51
+ type CreateOrganicOctopusTentacleShapesOptions = {
52
+ readonly size: number;
53
+ readonly centerX: number;
54
+ readonly centerY: number;
55
+ readonly bodyRadius: number;
56
+ readonly horizontalStretch: number;
57
+ readonly tentacleCount: number;
58
+ readonly shapePhase: number;
59
+ readonly createRandom: (salt: string) => () => number;
60
+ readonly timeMs: number;
61
+ readonly saltPrefix: string;
62
+ };
63
+ /**
64
+ * One sampled ribbon point on an organic octopus tentacle.
65
+ *
66
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
67
+ */
68
+ export type OrganicTentacleRibbonPoint = {
69
+ readonly x: number;
70
+ readonly y: number;
71
+ readonly normalX: number;
72
+ readonly normalY: number;
73
+ readonly width: number;
74
+ readonly progress: number;
75
+ };
76
+ /**
77
+ * Builds a smoothly morphing octopus-like silhouette from deterministic parameters.
78
+ *
79
+ * @param options Shape construction options.
80
+ * @returns Closed-loop body points.
81
+ *
82
+ * @private shared geometry helper of `octopus2AvatarVisual` and `octopus3AvatarVisual`
83
+ */
84
+ export declare function createOrganicOctopusBodyPoints(options: CreateOrganicOctopusBodyPointsOptions): Array<Point>;
85
+ /**
86
+ * Traces a smooth closed path through the provided points.
87
+ *
88
+ * @param context Canvas 2D context.
89
+ * @param points Closed-loop points.
90
+ *
91
+ * @private shared geometry helper of `octopus2AvatarVisual` and `octopus3AvatarVisual`
92
+ */
93
+ export declare function traceSmoothClosedPath(context: CanvasRenderingContext2D, points: ReadonlyArray<Point>): void;
94
+ /**
95
+ * Creates deterministic ribbon tentacles for the organic octopus visuals.
96
+ *
97
+ * @param options Tentacle construction options.
98
+ * @returns Tentacle descriptors.
99
+ *
100
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
101
+ */
102
+ export declare function createOrganicOctopusTentacleShapes(options: CreateOrganicOctopusTentacleShapesOptions): Array<OrganicTentacleShape>;
103
+ /**
104
+ * Samples the cubic tentacle centerline and offsets normals to build a filled ribbon.
105
+ *
106
+ * @param tentacleShape Deterministic tentacle descriptor.
107
+ * @returns Sampled ribbon points.
108
+ *
109
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
110
+ */
111
+ export declare function sampleOrganicTentacleRibbonPoints(tentacleShape: OrganicTentacleShape): Array<OrganicTentacleRibbonPoint>;
112
+ /**
113
+ * Samples one point on a cubic Bezier curve.
114
+ *
115
+ * @param startPoint Curve start point.
116
+ * @param controlPointOne First control point.
117
+ * @param controlPointTwo Second control point.
118
+ * @param endPoint Curve end point.
119
+ * @param progress Sampling progress in the range `[0, 1]`.
120
+ * @returns Sampled point.
121
+ *
122
+ * @private shared geometry helper of `octopus3AvatarVisual`
123
+ */
124
+ export declare function getCubicBezierPoint(startPoint: Point, controlPointOne: Point, controlPointTwo: Point, endPoint: Point, progress: number): Point;
125
+ export {};
@@ -75,7 +75,7 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'onActionButton' | 'on
75
75
  /**
76
76
  * Controls whether assistant replies render as bubbles or article blocks.
77
77
  */
78
- CHAT_VISUAL_MODE?: ChatProps['CHAT_VISUAL_MODE'];
78
+ visualMode?: ChatProps['visualMode'];
79
79
  /**
80
80
  * Called when a tool call chiplet is clicked.
81
81
  */
@@ -46,7 +46,7 @@ export type ChatMessageListProps = {
46
46
  toolTitles?: Record<string, string>;
47
47
  teammates?: ChatProps['teammates'];
48
48
  teamAgentProfiles?: ChatProps['teamAgentProfiles'];
49
- CHAT_VISUAL_MODE?: ChatProps['CHAT_VISUAL_MODE'];
49
+ visualMode?: ChatProps['visualMode'];
50
50
  onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
51
51
  onCitationClick?: (citation: ParsedCitation) => void;
52
52
  soundSystem?: ChatProps['soundSystem'];
@@ -747,7 +747,7 @@ export type ChatProps = {
747
747
  *
748
748
  * @default 'ARTICLE_MODE'
749
749
  */
750
- readonly CHAT_VISUAL_MODE?: ChatVisualMode;
750
+ readonly visualMode?: ChatVisualMode;
751
751
  /**
752
752
  * Visual style of the chat component
753
753
  */
@@ -1,4 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
+ import type { AvatarDefinition } from '../../../avatars/types/AvatarDefinition';
3
+ import type { AvatarVisualId } from '../../../avatars/types/AvatarVisualDefinition';
2
4
  /**
3
5
  * Props for a team modal header profile badge.
4
6
  *
@@ -7,6 +9,8 @@ import { type ReactNode } from 'react';
7
9
  export type TeamHeaderProfileProps = {
8
10
  label: string;
9
11
  avatarSrc?: string | null;
12
+ avatarDefinition?: AvatarDefinition;
13
+ avatarVisualId?: AvatarVisualId;
10
14
  href?: string;
11
15
  fallbackColor?: string;
12
16
  };
@@ -15,7 +19,7 @@ export type TeamHeaderProfileProps = {
15
19
  *
16
20
  * @private component of `<Chat/>`
17
21
  */
18
- export declare function TeamHeaderProfile({ label, avatarSrc, href, fallbackColor }: TeamHeaderProfileProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function TeamHeaderProfile({ label, avatarSrc, avatarDefinition, avatarVisualId, href, fallbackColor, }: TeamHeaderProfileProps): import("react/jsx-runtime").JSX.Element;
19
23
  /**
20
24
  * Props for a self-learning modal avatar.
21
25
  *
@@ -24,6 +28,8 @@ export declare function TeamHeaderProfile({ label, avatarSrc, href, fallbackColo
24
28
  export type SelfLearningAvatarProps = {
25
29
  label: string;
26
30
  avatarSrc?: string | null;
31
+ avatarDefinition?: AvatarDefinition;
32
+ avatarVisualId?: AvatarVisualId;
27
33
  fallbackColor?: string;
28
34
  className?: string;
29
35
  children?: ReactNode;
@@ -33,4 +39,4 @@ export type SelfLearningAvatarProps = {
33
39
  *
34
40
  * @private component of `<Chat/>`
35
41
  */
36
- export declare function SelfLearningAvatar({ label, avatarSrc, fallbackColor, className, children, }: SelfLearningAvatarProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function SelfLearningAvatar({ label, avatarSrc, avatarDefinition, avatarVisualId, fallbackColor, className, children, }: SelfLearningAvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,8 @@ import type { ChatMessage } from '../types/ChatMessage';
8
8
  * - Every streaming chunk / intermediate content update
9
9
  * - `message_typing` lifecycle events before the message is finalized
10
10
  * - Re-renders of an already-notified completed message (idempotent)
11
+ * - Initial mount hydration with preloaded completed chat history
12
+ * - Switching to another chat thread that already contains completed history
11
13
  * - User-originated messages
12
14
  *
13
15
  * @param messages - Current list of chat messages
@@ -1,6 +1,8 @@
1
1
  import type { string_book } from '../../../book-2.0/agent-source/string_book';
2
2
  import type { id, string_color, string_person_fullname, string_url_image } from '../../../types/typeAliases';
3
3
  import { Color } from '../../../utils/color/Color';
4
+ import type { AvatarDefinition } from '../../../avatars/types/AvatarDefinition';
5
+ import type { AvatarVisualId } from '../../../avatars/types/AvatarVisualDefinition';
4
6
  /**
5
7
  * A participant in the chat
6
8
  *
@@ -23,6 +25,14 @@ export type ChatParticipant = {
23
25
  * Profile picture
24
26
  */
25
27
  avatarSrc?: string_url_image;
28
+ /**
29
+ * Deterministic avatar definition used when no static image should be shown.
30
+ */
31
+ avatarDefinition?: AvatarDefinition;
32
+ /**
33
+ * Built-in avatar visual id used with `avatarDefinition`.
34
+ */
35
+ avatarVisualId?: AvatarVisualId;
26
36
  /**
27
37
  * Color associated with the participant
28
38
  */
@@ -1,6 +1,6 @@
1
1
  import type { InitializationStatus } from './boilerplateTemplates';
2
2
  /**
3
- * Ensures `.gitignore` contains the standalone Promptbook coder cache entry.
3
+ * Ensures `.gitignore` contains the standalone Promptbook coder temp and cache entries.
4
4
  *
5
5
  * @private function of `initializeCoderProjectConfiguration`
6
6
  */
@@ -41,7 +41,7 @@ export declare const ADMIN_GITHUB_NAME: string_name;
41
41
  *
42
42
  * @public exported from `@promptbook/core`
43
43
  */
44
- export declare const CLAIM = "Turn your company's scattered knowledge into AI ready books";
44
+ export declare const CLAIM = "Create persistent AI agents that turn your company's scattered knowledge into action";
45
45
  /**
46
46
  * Color of the Promptbook
47
47
  *
@@ -89,7 +89,7 @@ export declare const USER_CHAT_COLOR: import("./utils/take/interfaces/ITakeChain
89
89
  *
90
90
  * @public exported from `@promptbook/core`
91
91
  */
92
- export declare const DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
92
+ export declare const DEFAULT_BOOK_TITLE = "\uD83D\uDC19 Untitled agent";
93
93
  /**
94
94
  * When the title of task is not provided, the default title is used
95
95
  *
@@ -2,6 +2,7 @@ import type { CallChatModelStreamOptions } from '../../execution/LlmExecutionToo
2
2
  import type { ChatPromptResult } from '../../execution/PromptResult';
3
3
  import type { Prompt } from '../../types/Prompt';
4
4
  import type { string_agent_hash, string_agent_name } from '../../types/typeAliases';
5
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
5
6
  import { Agent } from './Agent';
6
7
  import type { RemoteAgentOptions } from './RemoteAgentOptions';
7
8
  /**
@@ -28,6 +29,8 @@ export declare class RemoteAgent extends Agent {
28
29
  toolTitles: Record<string, string>;
29
30
  private _isVoiceCallingEnabled;
30
31
  private _isVoiceTtsSttEnabled;
32
+ isMetaImageExplicit: boolean;
33
+ avatarVisualId: AvatarVisualId | undefined;
31
34
  /**
32
35
  * Indicates whether the remote server allows text-to-speech and speech-to-text.
33
36
  *
@@ -1,3 +1,5 @@
1
+ import type { AvatarDefinition } from '../../avatars/types/AvatarDefinition';
2
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
1
3
  import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
2
4
  import type { string_url, string_url_image } from '../../types/typeAliases';
3
5
  /**
@@ -5,25 +7,67 @@ import type { string_url, string_url_image } from '../../types/typeAliases';
5
7
  *
6
8
  * @private utility of `<Chat/>`
7
9
  */
8
- export type ResolveAgentAvatarImageUrlOptions = {
10
+ export type ResolveAgentAvatarOptions = {
9
11
  /**
10
12
  * Agent metadata used for avatar resolution.
11
13
  */
12
- readonly agent: Pick<AgentBasicInformation, 'agentName' | 'permanentId' | 'meta'>;
14
+ readonly agent: Pick<AgentBasicInformation, 'agentName' | 'agentHash' | 'permanentId' | 'meta'> & {
15
+ /**
16
+ * Optional explicit marker coming from remote profile payloads.
17
+ * When `false`, `meta.image` is treated as the generated static fallback rather than a user-defined `META IMAGE`.
18
+ */
19
+ readonly isMetaImageExplicit?: boolean;
20
+ /**
21
+ * Optional preferred avatar visual id coming from remote profile payloads.
22
+ */
23
+ readonly avatarVisualId?: AvatarVisualId;
24
+ };
13
25
  /**
14
26
  * Optional base URL used to resolve relative meta images and placeholders.
15
27
  */
16
28
  readonly baseUrl?: string_url;
17
29
  };
30
+ /**
31
+ * Backward-compatible alias kept for callers that only need image URLs.
32
+ *
33
+ * @private utility of `<Chat/>`
34
+ */
35
+ export type ResolveAgentAvatarImageUrlOptions = ResolveAgentAvatarOptions;
36
+ /**
37
+ * Default built-in avatar visual used when an agent does not define `META IMAGE`.
38
+ *
39
+ * @private shared avatar contract
40
+ */
41
+ export declare const DEFAULT_AGENT_AVATAR_VISUAL_ID: AvatarVisualId;
42
+ /**
43
+ * Resolved avatar descriptor used by interactive UIs to pick either an image or a live canvas visual.
44
+ *
45
+ * @private shared avatar contract
46
+ */
47
+ export type ResolvedAgentAvatar = {
48
+ readonly type: 'image';
49
+ readonly imageUrl: string_url_image;
50
+ } | {
51
+ readonly type: 'visual';
52
+ readonly avatarDefinition: AvatarDefinition;
53
+ readonly visualId: AvatarVisualId;
54
+ };
18
55
  /**
19
56
  * Resolve the fallback avatar URL for an agent.
20
57
  *
21
58
  * @private utility of `<Chat/>`
22
59
  */
23
- export declare function resolveAgentAvatarFallbackUrl(options: ResolveAgentAvatarImageUrlOptions): string_url_image | null;
60
+ export declare function resolveAgentAvatarFallbackUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
61
+ /**
62
+ * Resolve the best avatar representation for an agent, preferring explicit `META IMAGE`
63
+ * and otherwise returning the default deterministic canvas visual.
64
+ *
65
+ * @private utility of `<Chat/>`
66
+ */
67
+ export declare function resolveAgentAvatar(options: ResolveAgentAvatarOptions): ResolvedAgentAvatar | null;
24
68
  /**
25
- * Resolve the best avatar URL for an agent, preferring META IMAGE and falling back to placeholders.
69
+ * Resolve the best avatar URL for an agent, preferring `META IMAGE` and falling back to the static placeholder route.
26
70
  *
27
71
  * @private utility of `<Chat/>`
28
72
  */
29
- export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarImageUrlOptions): string_url_image | null;
73
+ export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.112.0-44`).
18
+ * It follows semantic versioning (e.g., `0.112.0-46`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.112.0-45",
4
- "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
3
+ "version": "0.112.0-47",
4
+ "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -93,8 +93,9 @@
93
93
  "overrides": {
94
94
  "zod": "$zod"
95
95
  },
96
- "typings": "./esm/typings/src/_packages/types.index.d.ts",
96
+ "types": "./esm/src/_packages/types.index.d.ts",
97
+ "typings": "./esm/src/_packages/types.index.d.ts",
97
98
  "peerDependencies": {
98
- "@promptbook/core": "0.112.0-45"
99
+ "@promptbook/core": "0.112.0-47"
99
100
  }
100
101
  }
@@ -0,0 +1,45 @@
1
+ import type { CSSProperties } from 'react';
2
+ import type { string_css_class, string_url_image } from '../types/typeAliases';
3
+ import type { AvatarDefinition } from './types/AvatarDefinition';
4
+ import type { AvatarVisualId } from './types/AvatarVisualDefinition';
5
+ /**
6
+ * Shared avatar-rendering props for places that may receive either an image URL or a deterministic avatar visual.
7
+ *
8
+ * @private shared component for avatar media rendering
9
+ */
10
+ export type AvatarOrImageProps = {
11
+ /**
12
+ * Explicit image URL to render.
13
+ */
14
+ readonly imageUrl?: string_url_image | null;
15
+ /**
16
+ * Deterministic avatar definition used by built-in visuals.
17
+ */
18
+ readonly avatarDefinition?: AvatarDefinition | null;
19
+ /**
20
+ * Selected built-in visual id used with `avatarDefinition`.
21
+ */
22
+ readonly visualId?: AvatarVisualId | null;
23
+ /**
24
+ * Output size in CSS pixels.
25
+ */
26
+ readonly size: number;
27
+ /**
28
+ * Accessible label used for the rendered media.
29
+ */
30
+ readonly alt: string;
31
+ /**
32
+ * Optional CSS class name applied to the rendered element.
33
+ */
34
+ readonly className?: string_css_class;
35
+ /**
36
+ * Optional inline styles forwarded to the rendered element.
37
+ */
38
+ readonly style?: CSSProperties;
39
+ };
40
+ /**
41
+ * Renders either a static image or a deterministic canvas avatar using one common prop shape.
42
+ *
43
+ * @private shared component for avatar media rendering
44
+ */
45
+ export declare function AvatarOrImage(props: AvatarOrImageProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,5 @@
1
1
  export { Avatar } from './Avatar';
2
+ export { AvatarOrImage } from './AvatarOrImage';
2
3
  export { renderAvatarVisual } from './renderAvatarVisual';
3
4
  export { createAvatarDefinitionFromAgentBasicInformation } from './avatarRenderingUtils';
4
5
  export { AVATAR_VISUALS, getAvatarVisualById } from './visuals/avatarVisualRegistry';
@@ -1,3 +1,4 @@
1
+ import type { CSSProperties } from 'react';
1
2
  import type { string_color, string_css_class } from '../../types/typeAliases';
2
3
  import type { AvatarDefinition } from './AvatarDefinition';
3
4
  /**
@@ -5,7 +6,7 @@ import type { AvatarDefinition } from './AvatarDefinition';
5
6
  *
6
7
  * @private shared contract for the avatar rendering system
7
8
  */
8
- export type AvatarVisualId = 'pixel-art' | 'octopus' | 'minecraft';
9
+ export type AvatarVisualId = 'pixel-art' | 'octopus' | 'octopus2' | 'octopus3' | 'ascii-octopus' | 'minecraft' | 'fractal';
9
10
  /**
10
11
  * Derived color palette used by avatar visuals.
11
12
  *
@@ -80,6 +81,10 @@ export type AvatarProps = {
80
81
  * Optional CSS class name applied to the canvas.
81
82
  */
82
83
  readonly className?: string_css_class;
84
+ /**
85
+ * Optional inline style applied to the canvas.
86
+ */
87
+ readonly style?: CSSProperties;
83
88
  };
84
89
  /**
85
90
  * Low-level rendering options for a single canvas frame.
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * AsciiOctopus avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const asciiOctopusAvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Fractal avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const fractalAvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus2 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus2AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,7 @@
1
+ import type { AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
2
+ /**
3
+ * Octopus3 avatar visual.
4
+ *
5
+ * @private built-in avatar visual
6
+ */
7
+ export declare const octopus3AvatarVisual: AvatarVisualDefinition;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * One 2D point used by the shared organic octopus geometry helpers.
3
+ *
4
+ * @private helper of octopus avatar visuals
5
+ */
6
+ type Point = {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ };
10
+ /**
11
+ * Shape parameters for the smooth octopus silhouette generator.
12
+ *
13
+ * @private helper of octopus avatar visuals
14
+ */
15
+ type CreateOrganicOctopusBodyPointsOptions = {
16
+ readonly centerX: number;
17
+ readonly centerY: number;
18
+ readonly bodyRadius: number;
19
+ readonly horizontalStretch: number;
20
+ readonly verticalStretch: number;
21
+ readonly mantleLift: number;
22
+ readonly lowerDrop: number;
23
+ readonly tentacleDepth: number;
24
+ readonly wobbleAmplitude: number;
25
+ readonly lobeCount: number;
26
+ readonly shapePhase: number;
27
+ readonly timeMs: number;
28
+ readonly pointCount?: number;
29
+ };
30
+ /**
31
+ * One deterministic ribbon tentacle attached to an organic octopus mantle.
32
+ *
33
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
34
+ */
35
+ export type OrganicTentacleShape = {
36
+ readonly startPoint: Point;
37
+ readonly controlPointOne: Point;
38
+ readonly controlPointTwo: Point;
39
+ readonly endPoint: Point;
40
+ readonly baseWidth: number;
41
+ readonly tipWidth: number;
42
+ readonly colorBias: number;
43
+ readonly highlightBias: number;
44
+ readonly sampleCount: number;
45
+ };
46
+ /**
47
+ * Options for generating deterministic organic octopus tentacles.
48
+ *
49
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
50
+ */
51
+ type CreateOrganicOctopusTentacleShapesOptions = {
52
+ readonly size: number;
53
+ readonly centerX: number;
54
+ readonly centerY: number;
55
+ readonly bodyRadius: number;
56
+ readonly horizontalStretch: number;
57
+ readonly tentacleCount: number;
58
+ readonly shapePhase: number;
59
+ readonly createRandom: (salt: string) => () => number;
60
+ readonly timeMs: number;
61
+ readonly saltPrefix: string;
62
+ };
63
+ /**
64
+ * One sampled ribbon point on an organic octopus tentacle.
65
+ *
66
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
67
+ */
68
+ export type OrganicTentacleRibbonPoint = {
69
+ readonly x: number;
70
+ readonly y: number;
71
+ readonly normalX: number;
72
+ readonly normalY: number;
73
+ readonly width: number;
74
+ readonly progress: number;
75
+ };
76
+ /**
77
+ * Builds a smoothly morphing octopus-like silhouette from deterministic parameters.
78
+ *
79
+ * @param options Shape construction options.
80
+ * @returns Closed-loop body points.
81
+ *
82
+ * @private shared geometry helper of `octopus2AvatarVisual` and `octopus3AvatarVisual`
83
+ */
84
+ export declare function createOrganicOctopusBodyPoints(options: CreateOrganicOctopusBodyPointsOptions): Array<Point>;
85
+ /**
86
+ * Traces a smooth closed path through the provided points.
87
+ *
88
+ * @param context Canvas 2D context.
89
+ * @param points Closed-loop points.
90
+ *
91
+ * @private shared geometry helper of `octopus2AvatarVisual` and `octopus3AvatarVisual`
92
+ */
93
+ export declare function traceSmoothClosedPath(context: CanvasRenderingContext2D, points: ReadonlyArray<Point>): void;
94
+ /**
95
+ * Creates deterministic ribbon tentacles for the organic octopus visuals.
96
+ *
97
+ * @param options Tentacle construction options.
98
+ * @returns Tentacle descriptors.
99
+ *
100
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
101
+ */
102
+ export declare function createOrganicOctopusTentacleShapes(options: CreateOrganicOctopusTentacleShapesOptions): Array<OrganicTentacleShape>;
103
+ /**
104
+ * Samples the cubic tentacle centerline and offsets normals to build a filled ribbon.
105
+ *
106
+ * @param tentacleShape Deterministic tentacle descriptor.
107
+ * @returns Sampled ribbon points.
108
+ *
109
+ * @private shared geometry helper of `octopus3AvatarVisual` and `asciiOctopusAvatarVisual`
110
+ */
111
+ export declare function sampleOrganicTentacleRibbonPoints(tentacleShape: OrganicTentacleShape): Array<OrganicTentacleRibbonPoint>;
112
+ /**
113
+ * Samples one point on a cubic Bezier curve.
114
+ *
115
+ * @param startPoint Curve start point.
116
+ * @param controlPointOne First control point.
117
+ * @param controlPointTwo Second control point.
118
+ * @param endPoint Curve end point.
119
+ * @param progress Sampling progress in the range `[0, 1]`.
120
+ * @returns Sampled point.
121
+ *
122
+ * @private shared geometry helper of `octopus3AvatarVisual`
123
+ */
124
+ export declare function getCubicBezierPoint(startPoint: Point, controlPointOne: Point, controlPointTwo: Point, endPoint: Point, progress: number): Point;
125
+ export {};
@@ -75,7 +75,7 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'onActionButton' | 'on
75
75
  /**
76
76
  * Controls whether assistant replies render as bubbles or article blocks.
77
77
  */
78
- CHAT_VISUAL_MODE?: ChatProps['CHAT_VISUAL_MODE'];
78
+ visualMode?: ChatProps['visualMode'];
79
79
  /**
80
80
  * Called when a tool call chiplet is clicked.
81
81
  */
@@ -46,7 +46,7 @@ export type ChatMessageListProps = {
46
46
  toolTitles?: Record<string, string>;
47
47
  teammates?: ChatProps['teammates'];
48
48
  teamAgentProfiles?: ChatProps['teamAgentProfiles'];
49
- CHAT_VISUAL_MODE?: ChatProps['CHAT_VISUAL_MODE'];
49
+ visualMode?: ChatProps['visualMode'];
50
50
  onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
51
51
  onCitationClick?: (citation: ParsedCitation) => void;
52
52
  soundSystem?: ChatProps['soundSystem'];
@@ -747,7 +747,7 @@ export type ChatProps = {
747
747
  *
748
748
  * @default 'ARTICLE_MODE'
749
749
  */
750
- readonly CHAT_VISUAL_MODE?: ChatVisualMode;
750
+ readonly visualMode?: ChatVisualMode;
751
751
  /**
752
752
  * Visual style of the chat component
753
753
  */
@@ -1,4 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
+ import type { AvatarDefinition } from '../../../avatars/types/AvatarDefinition';
3
+ import type { AvatarVisualId } from '../../../avatars/types/AvatarVisualDefinition';
2
4
  /**
3
5
  * Props for a team modal header profile badge.
4
6
  *
@@ -7,6 +9,8 @@ import { type ReactNode } from 'react';
7
9
  export type TeamHeaderProfileProps = {
8
10
  label: string;
9
11
  avatarSrc?: string | null;
12
+ avatarDefinition?: AvatarDefinition;
13
+ avatarVisualId?: AvatarVisualId;
10
14
  href?: string;
11
15
  fallbackColor?: string;
12
16
  };
@@ -15,7 +19,7 @@ export type TeamHeaderProfileProps = {
15
19
  *
16
20
  * @private component of `<Chat/>`
17
21
  */
18
- export declare function TeamHeaderProfile({ label, avatarSrc, href, fallbackColor }: TeamHeaderProfileProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function TeamHeaderProfile({ label, avatarSrc, avatarDefinition, avatarVisualId, href, fallbackColor, }: TeamHeaderProfileProps): import("react/jsx-runtime").JSX.Element;
19
23
  /**
20
24
  * Props for a self-learning modal avatar.
21
25
  *
@@ -24,6 +28,8 @@ export declare function TeamHeaderProfile({ label, avatarSrc, href, fallbackColo
24
28
  export type SelfLearningAvatarProps = {
25
29
  label: string;
26
30
  avatarSrc?: string | null;
31
+ avatarDefinition?: AvatarDefinition;
32
+ avatarVisualId?: AvatarVisualId;
27
33
  fallbackColor?: string;
28
34
  className?: string;
29
35
  children?: ReactNode;
@@ -33,4 +39,4 @@ export type SelfLearningAvatarProps = {
33
39
  *
34
40
  * @private component of `<Chat/>`
35
41
  */
36
- export declare function SelfLearningAvatar({ label, avatarSrc, fallbackColor, className, children, }: SelfLearningAvatarProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function SelfLearningAvatar({ label, avatarSrc, avatarDefinition, avatarVisualId, fallbackColor, className, children, }: SelfLearningAvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,8 @@ import type { ChatMessage } from '../types/ChatMessage';
8
8
  * - Every streaming chunk / intermediate content update
9
9
  * - `message_typing` lifecycle events before the message is finalized
10
10
  * - Re-renders of an already-notified completed message (idempotent)
11
+ * - Initial mount hydration with preloaded completed chat history
12
+ * - Switching to another chat thread that already contains completed history
11
13
  * - User-originated messages
12
14
  *
13
15
  * @param messages - Current list of chat messages
@@ -1,6 +1,8 @@
1
1
  import type { string_book } from '../../../book-2.0/agent-source/string_book';
2
2
  import type { id, string_color, string_person_fullname, string_url_image } from '../../../types/typeAliases';
3
3
  import { Color } from '../../../utils/color/Color';
4
+ import type { AvatarDefinition } from '../../../avatars/types/AvatarDefinition';
5
+ import type { AvatarVisualId } from '../../../avatars/types/AvatarVisualDefinition';
4
6
  /**
5
7
  * A participant in the chat
6
8
  *
@@ -23,6 +25,14 @@ export type ChatParticipant = {
23
25
  * Profile picture
24
26
  */
25
27
  avatarSrc?: string_url_image;
28
+ /**
29
+ * Deterministic avatar definition used when no static image should be shown.
30
+ */
31
+ avatarDefinition?: AvatarDefinition;
32
+ /**
33
+ * Built-in avatar visual id used with `avatarDefinition`.
34
+ */
35
+ avatarVisualId?: AvatarVisualId;
26
36
  /**
27
37
  * Color associated with the participant
28
38
  */
@@ -1,6 +1,6 @@
1
1
  import type { InitializationStatus } from './boilerplateTemplates';
2
2
  /**
3
- * Ensures `.gitignore` contains the standalone Promptbook coder cache entry.
3
+ * Ensures `.gitignore` contains the standalone Promptbook coder temp and cache entries.
4
4
  *
5
5
  * @private function of `initializeCoderProjectConfiguration`
6
6
  */
@@ -41,7 +41,7 @@ export declare const ADMIN_GITHUB_NAME: string_name;
41
41
  *
42
42
  * @public exported from `@promptbook/core`
43
43
  */
44
- export declare const CLAIM = "Turn your company's scattered knowledge into AI ready books";
44
+ export declare const CLAIM = "Create persistent AI agents that turn your company's scattered knowledge into action";
45
45
  /**
46
46
  * Color of the Promptbook
47
47
  *
@@ -89,7 +89,7 @@ export declare const USER_CHAT_COLOR: import("./utils/take/interfaces/ITakeChain
89
89
  *
90
90
  * @public exported from `@promptbook/core`
91
91
  */
92
- export declare const DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
92
+ export declare const DEFAULT_BOOK_TITLE = "\uD83D\uDC19 Untitled agent";
93
93
  /**
94
94
  * When the title of task is not provided, the default title is used
95
95
  *
@@ -2,6 +2,7 @@ import type { CallChatModelStreamOptions } from '../../execution/LlmExecutionToo
2
2
  import type { ChatPromptResult } from '../../execution/PromptResult';
3
3
  import type { Prompt } from '../../types/Prompt';
4
4
  import type { string_agent_hash, string_agent_name } from '../../types/typeAliases';
5
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
5
6
  import { Agent } from './Agent';
6
7
  import type { RemoteAgentOptions } from './RemoteAgentOptions';
7
8
  /**
@@ -28,6 +29,8 @@ export declare class RemoteAgent extends Agent {
28
29
  toolTitles: Record<string, string>;
29
30
  private _isVoiceCallingEnabled;
30
31
  private _isVoiceTtsSttEnabled;
32
+ isMetaImageExplicit: boolean;
33
+ avatarVisualId: AvatarVisualId | undefined;
31
34
  /**
32
35
  * Indicates whether the remote server allows text-to-speech and speech-to-text.
33
36
  *
@@ -1,3 +1,5 @@
1
+ import type { AvatarDefinition } from '../../avatars/types/AvatarDefinition';
2
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
1
3
  import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
2
4
  import type { string_url, string_url_image } from '../../types/typeAliases';
3
5
  /**
@@ -5,25 +7,67 @@ import type { string_url, string_url_image } from '../../types/typeAliases';
5
7
  *
6
8
  * @private utility of `<Chat/>`
7
9
  */
8
- export type ResolveAgentAvatarImageUrlOptions = {
10
+ export type ResolveAgentAvatarOptions = {
9
11
  /**
10
12
  * Agent metadata used for avatar resolution.
11
13
  */
12
- readonly agent: Pick<AgentBasicInformation, 'agentName' | 'permanentId' | 'meta'>;
14
+ readonly agent: Pick<AgentBasicInformation, 'agentName' | 'agentHash' | 'permanentId' | 'meta'> & {
15
+ /**
16
+ * Optional explicit marker coming from remote profile payloads.
17
+ * When `false`, `meta.image` is treated as the generated static fallback rather than a user-defined `META IMAGE`.
18
+ */
19
+ readonly isMetaImageExplicit?: boolean;
20
+ /**
21
+ * Optional preferred avatar visual id coming from remote profile payloads.
22
+ */
23
+ readonly avatarVisualId?: AvatarVisualId;
24
+ };
13
25
  /**
14
26
  * Optional base URL used to resolve relative meta images and placeholders.
15
27
  */
16
28
  readonly baseUrl?: string_url;
17
29
  };
30
+ /**
31
+ * Backward-compatible alias kept for callers that only need image URLs.
32
+ *
33
+ * @private utility of `<Chat/>`
34
+ */
35
+ export type ResolveAgentAvatarImageUrlOptions = ResolveAgentAvatarOptions;
36
+ /**
37
+ * Default built-in avatar visual used when an agent does not define `META IMAGE`.
38
+ *
39
+ * @private shared avatar contract
40
+ */
41
+ export declare const DEFAULT_AGENT_AVATAR_VISUAL_ID: AvatarVisualId;
42
+ /**
43
+ * Resolved avatar descriptor used by interactive UIs to pick either an image or a live canvas visual.
44
+ *
45
+ * @private shared avatar contract
46
+ */
47
+ export type ResolvedAgentAvatar = {
48
+ readonly type: 'image';
49
+ readonly imageUrl: string_url_image;
50
+ } | {
51
+ readonly type: 'visual';
52
+ readonly avatarDefinition: AvatarDefinition;
53
+ readonly visualId: AvatarVisualId;
54
+ };
18
55
  /**
19
56
  * Resolve the fallback avatar URL for an agent.
20
57
  *
21
58
  * @private utility of `<Chat/>`
22
59
  */
23
- export declare function resolveAgentAvatarFallbackUrl(options: ResolveAgentAvatarImageUrlOptions): string_url_image | null;
60
+ export declare function resolveAgentAvatarFallbackUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
61
+ /**
62
+ * Resolve the best avatar representation for an agent, preferring explicit `META IMAGE`
63
+ * and otherwise returning the default deterministic canvas visual.
64
+ *
65
+ * @private utility of `<Chat/>`
66
+ */
67
+ export declare function resolveAgentAvatar(options: ResolveAgentAvatarOptions): ResolvedAgentAvatar | null;
24
68
  /**
25
- * Resolve the best avatar URL for an agent, preferring META IMAGE and falling back to placeholders.
69
+ * Resolve the best avatar URL for an agent, preferring `META IMAGE` and falling back to the static placeholder route.
26
70
  *
27
71
  * @private utility of `<Chat/>`
28
72
  */
29
- export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarImageUrlOptions): string_url_image | null;
73
+ export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.112.0-44`).
18
+ * It follows semantic versioning (e.g., `0.112.0-46`).
19
19
  *
20
20
  * @generated
21
21
  */