@promptbook/google 0.112.0-46 → 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.
- package/README.md +16 -16
- package/esm/index.es.js +1 -1
- package/esm/src/avatars/AvatarOrImage.d.ts +45 -0
- package/esm/src/avatars/index.d.ts +1 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
- package/esm/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
- package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
- package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/esm/src/config.d.ts +2 -2
- package/esm/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
- package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
- package/esm/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.umd.js +1 -1
- package/umd/src/avatars/AvatarOrImage.d.ts +45 -0
- package/umd/src/avatars/index.d.ts +1 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
- package/umd/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
- package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
- package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/umd/src/config.d.ts +2 -2
- package/umd/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
- package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
- package/umd/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
- 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
|
-
#
|
|
3
|
+
# 🐙 Promptbook: Invisible AI Agents
|
|
4
4
|
|
|
5
|
-
Create persistent AI agents that turn your company's scattered knowledge into action
|
|
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
|
|
|
@@ -253,13 +253,13 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
253
253
|
|
|
254
254
|
## 📖 The Book Whitepaper
|
|
255
255
|
|
|
256
|
-
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
|
|
256
|
+
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.
|
|
257
257
|
|
|
258
258
|
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.
|
|
259
259
|
|
|
260
260
|
The main challenge lies in **managing the context**, providing rules and knowledge, and narrowing the personality.
|
|
261
261
|
|
|
262
|
-
In Promptbook, you define your agents **using simple Books**
|
|
262
|
+
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.
|
|
263
263
|
|
|
264
264
|
<table style="border: 1px solid #777; border-radius: 10px;"><tr><td>
|
|
265
265
|
|
|
@@ -360,7 +360,7 @@ Your job is to provide legal advice and support to the company and its employees
|
|
|
360
360
|
|
|
361
361
|
#### `Use` commitments
|
|
362
362
|
|
|
363
|
-
Use commitments grant the agent real capabilities
|
|
363
|
+
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.
|
|
364
364
|
|
|
365
365
|
These are what turn a chatbot into a persistent agent that actually does work.
|
|
366
366
|
|
|
@@ -409,7 +409,7 @@ Your job is to provide legal advice and support to the company and its employees
|
|
|
409
409
|
|
|
410
410
|
### Promptbook Ecosystem
|
|
411
411
|
|
|
412
|
-
Promptbook is an ecosystem of tools centered around the **Agents Server**
|
|
412
|
+
Promptbook is an ecosystem of tools centered around the **Agents Server** - a production-ready platform for running persistent AI agents.
|
|
413
413
|
|
|
414
414
|
#### Agents Server
|
|
415
415
|
|
|
@@ -431,7 +431,7 @@ The [Promptbook Engine](https://github.com/webgptorg/promptbook) is the open-sou
|
|
|
431
431
|
|
|
432
432
|
## 💜 The Promptbook Project
|
|
433
433
|
|
|
434
|
-
Promptbook project is an ecosystem centered around the **Agents Server**
|
|
434
|
+
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:
|
|
435
435
|
|
|
436
436
|
<table>
|
|
437
437
|
<thead>
|
|
@@ -444,7 +444,7 @@ Promptbook project is an ecosystem centered around the **Agents Server** — a p
|
|
|
444
444
|
<tr>
|
|
445
445
|
<td><a href="https://gallery.ptbk.io/"><strong>⭐ Agents Server</strong></a></td>
|
|
446
446
|
<td>
|
|
447
|
-
The primary way to use Promptbook. A production-ready platform where your AI agents live
|
|
447
|
+
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>.
|
|
448
448
|
</td>
|
|
449
449
|
</tr>
|
|
450
450
|
<tr>
|
|
@@ -534,8 +534,8 @@ For information on reporting security vulnerabilities, see our [Security Policy]
|
|
|
534
534
|
|
|
535
535
|
The fastest way to get started is with the **Agents Server**:
|
|
536
536
|
|
|
537
|
-
- 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)**
|
|
538
|
-
- ☁️ **[Hosted Agents Server](https://gallery.ptbk.io/)**
|
|
537
|
+
- 🐋 **[Docker image](https://hub.docker.com/r/hejny/promptbook/)** - Self-host the Agents Server with full control over your data
|
|
538
|
+
- ☁️ **[Hosted Agents Server](https://gallery.ptbk.io/)** - Start creating agents immediately, no setup required
|
|
539
539
|
|
|
540
540
|
### NPM Packages _(for developers embedding the Engine)_
|
|
541
541
|
|
|
@@ -680,7 +680,7 @@ npx ptbk coder verify
|
|
|
680
680
|
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
681
681
|
| `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/`. |
|
|
682
682
|
| `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. |
|
|
683
|
-
| `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.
|
|
683
|
+
| `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. |
|
|
684
684
|
| `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. |
|
|
685
685
|
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
686
686
|
|
|
@@ -691,7 +691,7 @@ npx ptbk coder verify
|
|
|
691
691
|
| `--agent <name>` | Selects the coding backend. |
|
|
692
692
|
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
693
693
|
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
694
|
-
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries.
|
|
694
|
+
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
|
|
695
695
|
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
696
696
|
| `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
|
|
697
697
|
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
@@ -794,8 +794,8 @@ _Note: This section is not a complete dictionary, more list of general AI / LLM
|
|
|
794
794
|
|
|
795
795
|
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.
|
|
796
796
|
|
|
797
|
-
- **Hosted** at [gallery.ptbk.io](https://gallery.ptbk.io/)
|
|
798
|
-
- **Self-hosted** via [Docker](https://hub.docker.com/r/hejny/promptbook/)
|
|
797
|
+
- **Hosted** at [gallery.ptbk.io](https://gallery.ptbk.io/) - start creating agents immediately
|
|
798
|
+
- **Self-hosted** via [Docker](https://hub.docker.com/r/hejny/promptbook/) - full control over your data and infrastructure
|
|
799
799
|
- **API** for integrating agents into your own applications
|
|
800
800
|
|
|
801
801
|
## 🚂 Promptbook Engine
|
|
@@ -813,7 +813,7 @@ The Engine is the open-source core that powers the Agents Server. If you need to
|
|
|
813
813
|
- When you want agents that **collaborate in teams** and consult each other
|
|
814
814
|
- When you need to **integrate AI agents into your existing applications** via API
|
|
815
815
|
- When you want to **self-host** your AI agents with full control over data and infrastructure
|
|
816
|
-
- When you are writing an app that generates complex things via LLM
|
|
816
|
+
- When you are writing an app that generates complex things via LLM - like **websites, articles, presentations, code, stories, songs**,...
|
|
817
817
|
- When you want to **version** your agent definitions and **test multiple versions**
|
|
818
818
|
- When you want to **log** agent execution and backtrace issues
|
|
819
819
|
|
|
@@ -825,7 +825,7 @@ The Engine is the open-source core that powers the Agents Server. If you need to
|
|
|
825
825
|
- When [OpenAI Assistant (GPTs)](https://help.openai.com/en/articles/8673914-gpts-vs-assistants) is enough for you
|
|
826
826
|
- When you need streaming _(this may be implemented in the future, [see discussion](https://github.com/webgptorg/promptbook/discussions/102))_
|
|
827
827
|
- 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))_
|
|
828
|
-
- When your main focus is on something other than text
|
|
828
|
+
- 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))_
|
|
829
829
|
- When you need to use recursion _([see the discussion](https://github.com/webgptorg/promptbook/discussions/38))_
|
|
830
830
|
|
|
831
831
|
[See more](https://github.com/webgptorg/promptbook/discussions/112)
|
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-
|
|
19
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-47';
|
|
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
|
|
@@ -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' | 'octopus2' | 'minecraft' | 'fractal';
|
|
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,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
|
-
|
|
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
|
-
|
|
49
|
+
visualMode?: ChatProps['visualMode'];
|
|
50
50
|
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
|
|
51
51
|
onCitationClick?: (citation: ParsedCitation) => void;
|
|
52
52
|
soundSystem?: ChatProps['soundSystem'];
|
|
@@ -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
|
|
3
|
+
* Ensures `.gitignore` contains the standalone Promptbook coder temp and cache entries.
|
|
4
4
|
*
|
|
5
5
|
* @private function of `initializeCoderProjectConfiguration`
|
|
6
6
|
*/
|
package/esm/src/config.d.ts
CHANGED
|
@@ -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 = "
|
|
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 = "\
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
73
|
+
export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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-
|
|
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/google",
|
|
3
|
-
"version": "0.112.0-
|
|
4
|
-
"description": "Promptbook:
|
|
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": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"types": "./esm/src/_packages/google.index.d.ts",
|
|
100
100
|
"typings": "./esm/src/_packages/google.index.d.ts",
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"@promptbook/core": "0.112.0-
|
|
102
|
+
"@promptbook/core": "0.112.0-47"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@ai-sdk/google": "1.0.17",
|
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-47';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -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' | 'octopus2' | 'minecraft' | 'fractal';
|
|
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,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
|
-
|
|
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
|
-
|
|
49
|
+
visualMode?: ChatProps['visualMode'];
|
|
50
50
|
onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
|
|
51
51
|
onCitationClick?: (citation: ParsedCitation) => void;
|
|
52
52
|
soundSystem?: ChatProps['soundSystem'];
|
|
@@ -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
|
|
3
|
+
* Ensures `.gitignore` contains the standalone Promptbook coder temp and cache entries.
|
|
4
4
|
*
|
|
5
5
|
* @private function of `initializeCoderProjectConfiguration`
|
|
6
6
|
*/
|
package/umd/src/config.d.ts
CHANGED
|
@@ -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 = "
|
|
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 = "\
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
73
|
+
export declare function resolveAgentAvatarImageUrl(options: ResolveAgentAvatarOptions): string_url_image | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/umd/src/version.d.ts
CHANGED
|
@@ -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-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-46`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|