@promptbook/cli 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.
Files changed (54) hide show
  1. package/README.md +16 -16
  2. package/esm/index.es.js +689 -250
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +13 -1
  5. package/esm/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +13 -0
  6. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -1
  7. package/esm/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +8 -2
  8. package/esm/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +36 -0
  9. package/esm/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +51 -0
  10. package/esm/src/avatars/AvatarOrImage.d.ts +45 -0
  11. package/esm/src/avatars/index.d.ts +1 -0
  12. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
  13. package/esm/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
  14. package/esm/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
  15. package/esm/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
  16. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  17. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  18. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
  19. package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
  20. package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
  21. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
  22. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  23. package/esm/src/config.d.ts +2 -2
  24. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
  25. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
  26. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
  27. package/esm/src/version.d.ts +1 -1
  28. package/package.json +4 -2
  29. package/umd/index.umd.js +688 -249
  30. package/umd/index.umd.js.map +1 -1
  31. package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +13 -1
  32. package/umd/scripts/run-codex-prompts/ui/buildCoderRunOctopusVisual.d.ts +13 -0
  33. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -1
  34. package/umd/scripts/run-codex-prompts/ui/coderRunUiRefresh.d.ts +8 -2
  35. package/umd/scripts/run-codex-prompts/ui/coderRunUiText.d.ts +36 -0
  36. package/umd/scripts/utils/emojiTags/scanEmojiTagUsage.d.ts +51 -0
  37. package/umd/src/avatars/AvatarOrImage.d.ts +45 -0
  38. package/umd/src/avatars/index.d.ts +1 -0
  39. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +6 -1
  40. package/umd/src/avatars/visuals/asciiOctopusAvatarVisual.d.ts +7 -0
  41. package/umd/src/avatars/visuals/octopus3AvatarVisual.d.ts +7 -0
  42. package/umd/src/avatars/visuals/octopusAvatarVisualShared.d.ts +125 -0
  43. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -1
  44. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  45. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
  46. package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +8 -2
  47. package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +2 -0
  48. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +10 -0
  49. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  50. package/umd/src/config.d.ts +2 -2
  51. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +3 -0
  52. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +49 -5
  53. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.test.d.ts +1 -0
  54. package/umd/src/version.d.ts +1 -1
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Pause lifecycle of `ptbk coder run`.
3
+ */
4
+ export type CoderRunPauseState = 'RUNNING' | 'PAUSING' | 'PAUSED';
5
+ /**
6
+ * Result of toggling the pause hotkey state.
7
+ */
8
+ export type CoderRunPauseToggleResult = 'REQUESTED_PAUSE' | 'CANCELLED_PAUSE' | 'RESUMED';
9
+ /**
10
+ * Applies the same three-state toggle used by the `P` hotkey.
11
+ */
12
+ export declare function togglePauseState(): CoderRunPauseToggleResult;
1
13
  /**
2
14
  * Listens for the "p" key to pause and resume.
3
15
  */
@@ -17,7 +29,7 @@ export declare function checkPause(options?: {
17
29
  /**
18
30
  * Returns the current pause state for external consumers such as the terminal UI.
19
31
  */
20
- export declare function getPauseState(): 'RUNNING' | 'PAUSING' | 'PAUSED';
32
+ export declare function getPauseState(): CoderRunPauseState;
21
33
  /**
22
34
  * Requests a pause from an external controller (e.g. the Ink UI).
23
35
  */
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Options for the horizontal octopus brand illustration.
3
+ */
4
+ export type BuildCoderRunOctopusVisualOptions = {
5
+ readonly totalWidth: number;
6
+ readonly animationFrame: number;
7
+ };
8
+ /**
9
+ * Builds the horizontal octopus illustration shown above the coder-run dashboard.
10
+ *
11
+ * @private internal utility of coder run UI
12
+ */
13
+ export declare function buildCoderRunOctopusVisual(options: BuildCoderRunOctopusVisualOptions): readonly string[];
@@ -1,13 +1,15 @@
1
+ import type { CoderRunPauseState } from '../common/waitForPause';
1
2
  import type { CoderRunConfig, CoderRunPhase, CoderRunProgressSnapshot } from './CoderRunUiState';
2
3
  /**
3
4
  * Shared pause-state shape between the renderer and the frame builder.
4
5
  */
5
- export type CoderRunPauseState = 'RUNNING' | 'PAUSING' | 'PAUSED';
6
+ export type { CoderRunPauseState };
6
7
  /**
7
8
  * Snapshot consumed by the pure coder-run frame builder.
8
9
  */
9
10
  export type BuildCoderRunUiFrameOptions = {
10
11
  readonly terminalWidth: number;
12
+ readonly animationFrame: number;
11
13
  readonly spinner: string;
12
14
  readonly pauseState: CoderRunPauseState;
13
15
  readonly config: CoderRunConfig;
@@ -1,11 +1,17 @@
1
- import type { CoderRunPauseState } from './buildCoderRunUiFrame';
1
+ import type { CoderRunPauseState } from '../common/waitForPause';
2
2
  import type { CoderRunPhase } from './CoderRunUiState';
3
3
  /**
4
4
  * Refresh cadence used only while the rich coder UI needs animated updates.
5
5
  *
6
6
  * @private internal constant of coder run UI
7
7
  */
8
- export declare const ACTIVE_CODER_RUN_UI_REFRESH_INTERVAL_MS = 1000;
8
+ export declare const ACTIVE_CODER_RUN_UI_REFRESH_INTERVAL_MS = 300;
9
+ /**
10
+ * Returns whether the rich coder UI should keep animating on its own.
11
+ *
12
+ * @private internal utility of coder run UI
13
+ */
14
+ export declare function isCoderRunUiAutoRefreshing(phase: CoderRunPhase, pauseState: CoderRunPauseState): boolean;
9
15
  /**
10
16
  * Returns the automatic refresh interval for the current UI state.
11
17
  *
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Centers an ANSI-colored line within the available frame width.
3
+ *
4
+ * @private internal utility of coder run UI
5
+ */
6
+ export declare function centerAnsiText(text: string, width: number): string;
7
+ /**
8
+ * Pads or truncates a possibly ANSI-colored line to the target visible width.
9
+ *
10
+ * @private internal utility of coder run UI
11
+ */
12
+ export declare function padAnsiText(text: string, width: number): string;
13
+ /**
14
+ * Truncates a possibly ANSI-colored line to the target visible width.
15
+ *
16
+ * @private internal utility of coder run UI
17
+ */
18
+ export declare function fitAnsiText(text: string, width: number): string;
19
+ /**
20
+ * Truncates a plain-text line to the target width with an ellipsis.
21
+ *
22
+ * @private internal utility of coder run UI
23
+ */
24
+ export declare function fitPlainText(text: string, width: number): string;
25
+ /**
26
+ * Measures visible string width by stripping ANSI escape codes.
27
+ *
28
+ * @private internal utility of coder run UI
29
+ */
30
+ export declare function visibleLength(text: string): number;
31
+ /**
32
+ * Strips ANSI escape codes from a string.
33
+ *
34
+ * @private internal utility of coder run UI
35
+ */
36
+ export declare function stripAnsi(text: string): string;
@@ -0,0 +1,51 @@
1
+ import type { string_char_emoji } from '../../../src/types/typeAliasEmoji';
2
+ /**
3
+ * Options controlling one repository emoji-tag scan.
4
+ */
5
+ export type EmojiTagScanOptions = {
6
+ /**
7
+ * Candidate emojis that may appear inside bracketed tags.
8
+ */
9
+ readonly candidateEmojis: ReadonlySet<string_char_emoji>;
10
+ /**
11
+ * Root directory to scan (defaults to `process.cwd()`).
12
+ */
13
+ readonly rootDir?: string;
14
+ /**
15
+ * Glob patterns to include when scanning for tags.
16
+ */
17
+ readonly includeGlobs?: ReadonlyArray<string>;
18
+ /**
19
+ * Glob patterns to ignore when scanning for tags.
20
+ */
21
+ readonly ignoreGlobs?: ReadonlyArray<string>;
22
+ /**
23
+ * Exact prefix expected before the emoji inside the brackets.
24
+ */
25
+ readonly tagPrefix?: string;
26
+ /**
27
+ * Optional error handler for best-effort scans that should skip unreadable files.
28
+ */
29
+ readonly onFileError?: (error: Error, filePath: string) => void;
30
+ };
31
+ /**
32
+ * Result of one repository emoji-tag scan.
33
+ */
34
+ export type EmojiTagScanResult = {
35
+ /**
36
+ * Emojis already used inside matching bracketed tags.
37
+ */
38
+ readonly usedEmojis: ReadonlySet<string_char_emoji>;
39
+ /**
40
+ * Number of files whose content had to be read during this run.
41
+ */
42
+ readonly scannedFileCount: number;
43
+ /**
44
+ * Number of files satisfied purely from the persisted cache.
45
+ */
46
+ readonly reusedFileCount: number;
47
+ };
48
+ /**
49
+ * Scans repository files for bracketed emoji tags while reusing per-file cache entries for unchanged files.
50
+ */
51
+ export declare function scanEmojiTagUsage(options: EmojiTagScanOptions): Promise<EmojiTagScanResult>;
@@ -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,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
+ * 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-45`).
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/cli",
3
- "version": "0.112.0-46",
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": {
@@ -102,6 +102,7 @@
102
102
  "@azure/openai": "1.0.0-beta.13",
103
103
  "@mozilla/readability": "0.6.0",
104
104
  "@openai/agents": "0.4.12",
105
+ "@supabase/supabase-js": "2.81.1",
105
106
  "bottleneck": "2.19.5",
106
107
  "colors": "1.4.0",
107
108
  "commander": "12.0.0",
@@ -121,6 +122,7 @@
121
122
  "pg": "8.16.3",
122
123
  "prompts": "2.4.2",
123
124
  "react": "18.2.0",
125
+ "react-dom": "18.2.0",
124
126
  "rxjs": "7.8.2",
125
127
  "showdown": "2.1.0",
126
128
  "socket.io": "4.8.3",