@promptbook/core 0.112.0-48 → 0.112.0-49

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/esm/index.es.js CHANGED
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-48';
31
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-49';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -0,0 +1,16 @@
1
+ /**
2
+ * One callback registered in the shared avatar animation scheduler.
3
+ *
4
+ * @private utility of the avatar rendering system
5
+ */
6
+ type AvatarAnimationListener = (now: number) => void;
7
+ /**
8
+ * Registers one avatar animation callback in the shared animation loop.
9
+ *
10
+ * @param avatarAnimationListener Frame callback invoked on every animation frame.
11
+ * @returns Cleanup function that unregisters the callback.
12
+ *
13
+ * @private utility of the avatar rendering system
14
+ */
15
+ export declare function retainAvatarAnimationListener(avatarAnimationListener: AvatarAnimationListener): () => void;
16
+ export {};
@@ -15,3 +15,19 @@ export declare function retainAvatarPointerTracking(): () => void;
15
15
  * @private utility of the avatar rendering system
16
16
  */
17
17
  export declare function getAvatarPointerSnapshot(): AvatarPointerSnapshot | null;
18
+ /**
19
+ * Returns the current pointer snapshot version.
20
+ *
21
+ * @returns Monotonic pointer snapshot version.
22
+ *
23
+ * @private utility of the avatar rendering system
24
+ */
25
+ export declare function getAvatarPointerSnapshotVersion(): number;
26
+ /**
27
+ * Returns the current viewport-layout version used to invalidate cached avatar bounds.
28
+ *
29
+ * @returns Monotonic viewport-layout version.
30
+ *
31
+ * @private utility of the avatar rendering system
32
+ */
33
+ export declare function getAvatarViewportLayoutVersion(): number;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One callback observing the viewport visibility of an avatar canvas.
3
+ *
4
+ * @private utility of the avatar rendering system
5
+ */
6
+ type AvatarVisibilityListener = (isVisible: boolean) => void;
7
+ /**
8
+ * Observes one avatar element and notifies the caller when it enters or leaves the viewport.
9
+ *
10
+ * @param element Observed avatar element.
11
+ * @param avatarVisibilityListener Listener notified with the current visibility state.
12
+ * @returns Cleanup function that stops observing the element.
13
+ *
14
+ * @private utility of the avatar rendering system
15
+ */
16
+ export declare function observeAvatarVisibility(element: Element, avatarVisibilityListener: AvatarVisibilityListener): () => void;
17
+ export {};
@@ -1,9 +1,37 @@
1
1
  import type { RenderAvatarVisualOptions } from './types/AvatarVisualDefinition';
2
+ import type { AvatarDefinition } from './types/AvatarDefinition';
3
+ import type { AvatarPalette, AvatarSurfaceStyle, AvatarVisualDefinition, AvatarVisualId } from './types/AvatarVisualDefinition';
4
+ /**
5
+ * Stable render data derived once from the avatar definition, surface, and visual id.
6
+ *
7
+ * @private shared helper for canvas avatar rendering
8
+ */
9
+ export type ResolvedAvatarRenderDefinition = {
10
+ readonly avatarDefinition: AvatarDefinition;
11
+ readonly avatarVisual: AvatarVisualDefinition;
12
+ readonly surface: AvatarSurfaceStyle;
13
+ readonly palette: AvatarPalette;
14
+ readonly createRandom: (salt: string) => () => number;
15
+ };
16
+ /**
17
+ * Resolves the stable avatar render inputs reused across multiple frames.
18
+ *
19
+ * @param options Avatar identity and visual selection.
20
+ * @returns Stable render data ready to be used by `renderAvatarVisual`.
21
+ *
22
+ * @private shared helper for canvas avatar rendering
23
+ */
24
+ export declare function resolveAvatarRenderDefinition(options: {
25
+ readonly avatarDefinition: AvatarDefinition;
26
+ readonly visualId: AvatarVisualId;
27
+ readonly surface?: AvatarSurfaceStyle;
28
+ }): ResolvedAvatarRenderDefinition;
2
29
  /**
3
30
  * Renders one deterministic avatar frame into the provided canvas.
4
31
  *
5
32
  * @param options Rendering options.
33
+ * @param resolvedAvatarRenderDefinition Optional stable render data reused between frames.
6
34
  *
7
35
  * @private shared helper for canvas avatar rendering
8
36
  */
9
- export declare function renderAvatarVisual(options: RenderAvatarVisualOptions): void;
37
+ export declare function renderAvatarVisual(options: RenderAvatarVisualOptions, resolvedAvatarRenderDefinition?: ResolvedAvatarRenderDefinition): void;
@@ -4,10 +4,10 @@ import { Color } from '../../../_packages/color.index';
4
4
  import { SpeechRecognition } from '../../../types/SpeechRecognition';
5
5
  import type { string_href } from '../../../types/typeAliases';
6
6
  import { string_color } from '../../../types/typeAliases';
7
+ import type { AgentChipData } from '../AgentChip/AgentChip';
7
8
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
8
9
  import type { ChatMessage } from '../types/ChatMessage';
9
10
  import type { ChatParticipant } from '../types/ChatParticipant';
10
- import type { AgentChipData } from '../AgentChip/AgentChip';
11
11
  /**
12
12
  * Response data returned by the optional `onFeedback` handler.
13
13
  *
@@ -749,9 +749,9 @@ export type ChatProps = {
749
749
  */
750
750
  readonly visualMode?: ChatVisualMode;
751
751
  /**
752
- * Visual style of the chat component
752
+ * Layout of the chat component
753
753
  */
754
- readonly visual: 'STANDALONE' | 'FULL_PAGE';
754
+ readonly layout: 'STANDALONE' | 'FULL_PAGE';
755
755
  /**
756
756
  * Optional array of effect configurations for chat animations
757
757
  * When provided, enables visual effects (confetti, hearts, etc.) based on emojis in messages
@@ -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-47`).
18
+ * It follows semantic versioning (e.g., `0.112.0-48`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/core",
3
- "version": "0.112.0-48",
3
+ "version": "0.112.0-49",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -27,7 +27,7 @@
27
27
  * @generated
28
28
  * @see https://github.com/webgptorg/promptbook
29
29
  */
30
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-48';
30
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-49';
31
31
  /**
32
32
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
33
33
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -0,0 +1,16 @@
1
+ /**
2
+ * One callback registered in the shared avatar animation scheduler.
3
+ *
4
+ * @private utility of the avatar rendering system
5
+ */
6
+ type AvatarAnimationListener = (now: number) => void;
7
+ /**
8
+ * Registers one avatar animation callback in the shared animation loop.
9
+ *
10
+ * @param avatarAnimationListener Frame callback invoked on every animation frame.
11
+ * @returns Cleanup function that unregisters the callback.
12
+ *
13
+ * @private utility of the avatar rendering system
14
+ */
15
+ export declare function retainAvatarAnimationListener(avatarAnimationListener: AvatarAnimationListener): () => void;
16
+ export {};
@@ -15,3 +15,19 @@ export declare function retainAvatarPointerTracking(): () => void;
15
15
  * @private utility of the avatar rendering system
16
16
  */
17
17
  export declare function getAvatarPointerSnapshot(): AvatarPointerSnapshot | null;
18
+ /**
19
+ * Returns the current pointer snapshot version.
20
+ *
21
+ * @returns Monotonic pointer snapshot version.
22
+ *
23
+ * @private utility of the avatar rendering system
24
+ */
25
+ export declare function getAvatarPointerSnapshotVersion(): number;
26
+ /**
27
+ * Returns the current viewport-layout version used to invalidate cached avatar bounds.
28
+ *
29
+ * @returns Monotonic viewport-layout version.
30
+ *
31
+ * @private utility of the avatar rendering system
32
+ */
33
+ export declare function getAvatarViewportLayoutVersion(): number;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One callback observing the viewport visibility of an avatar canvas.
3
+ *
4
+ * @private utility of the avatar rendering system
5
+ */
6
+ type AvatarVisibilityListener = (isVisible: boolean) => void;
7
+ /**
8
+ * Observes one avatar element and notifies the caller when it enters or leaves the viewport.
9
+ *
10
+ * @param element Observed avatar element.
11
+ * @param avatarVisibilityListener Listener notified with the current visibility state.
12
+ * @returns Cleanup function that stops observing the element.
13
+ *
14
+ * @private utility of the avatar rendering system
15
+ */
16
+ export declare function observeAvatarVisibility(element: Element, avatarVisibilityListener: AvatarVisibilityListener): () => void;
17
+ export {};
@@ -1,9 +1,37 @@
1
1
  import type { RenderAvatarVisualOptions } from './types/AvatarVisualDefinition';
2
+ import type { AvatarDefinition } from './types/AvatarDefinition';
3
+ import type { AvatarPalette, AvatarSurfaceStyle, AvatarVisualDefinition, AvatarVisualId } from './types/AvatarVisualDefinition';
4
+ /**
5
+ * Stable render data derived once from the avatar definition, surface, and visual id.
6
+ *
7
+ * @private shared helper for canvas avatar rendering
8
+ */
9
+ export type ResolvedAvatarRenderDefinition = {
10
+ readonly avatarDefinition: AvatarDefinition;
11
+ readonly avatarVisual: AvatarVisualDefinition;
12
+ readonly surface: AvatarSurfaceStyle;
13
+ readonly palette: AvatarPalette;
14
+ readonly createRandom: (salt: string) => () => number;
15
+ };
16
+ /**
17
+ * Resolves the stable avatar render inputs reused across multiple frames.
18
+ *
19
+ * @param options Avatar identity and visual selection.
20
+ * @returns Stable render data ready to be used by `renderAvatarVisual`.
21
+ *
22
+ * @private shared helper for canvas avatar rendering
23
+ */
24
+ export declare function resolveAvatarRenderDefinition(options: {
25
+ readonly avatarDefinition: AvatarDefinition;
26
+ readonly visualId: AvatarVisualId;
27
+ readonly surface?: AvatarSurfaceStyle;
28
+ }): ResolvedAvatarRenderDefinition;
2
29
  /**
3
30
  * Renders one deterministic avatar frame into the provided canvas.
4
31
  *
5
32
  * @param options Rendering options.
33
+ * @param resolvedAvatarRenderDefinition Optional stable render data reused between frames.
6
34
  *
7
35
  * @private shared helper for canvas avatar rendering
8
36
  */
9
- export declare function renderAvatarVisual(options: RenderAvatarVisualOptions): void;
37
+ export declare function renderAvatarVisual(options: RenderAvatarVisualOptions, resolvedAvatarRenderDefinition?: ResolvedAvatarRenderDefinition): void;
@@ -4,10 +4,10 @@ import { Color } from '../../../_packages/color.index';
4
4
  import { SpeechRecognition } from '../../../types/SpeechRecognition';
5
5
  import type { string_href } from '../../../types/typeAliases';
6
6
  import { string_color } from '../../../types/typeAliases';
7
+ import type { AgentChipData } from '../AgentChip/AgentChip';
7
8
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
8
9
  import type { ChatMessage } from '../types/ChatMessage';
9
10
  import type { ChatParticipant } from '../types/ChatParticipant';
10
- import type { AgentChipData } from '../AgentChip/AgentChip';
11
11
  /**
12
12
  * Response data returned by the optional `onFeedback` handler.
13
13
  *
@@ -749,9 +749,9 @@ export type ChatProps = {
749
749
  */
750
750
  readonly visualMode?: ChatVisualMode;
751
751
  /**
752
- * Visual style of the chat component
752
+ * Layout of the chat component
753
753
  */
754
- readonly visual: 'STANDALONE' | 'FULL_PAGE';
754
+ readonly layout: 'STANDALONE' | 'FULL_PAGE';
755
755
  /**
756
756
  * Optional array of effect configurations for chat animations
757
757
  * When provided, enables visual effects (confetti, hearts, etc.) based on emojis in messages
@@ -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-47`).
18
+ * It follows semantic versioning (e.g., `0.112.0-48`).
19
19
  *
20
20
  * @generated
21
21
  */