@promptbook/color 0.113.0-10 → 0.113.0-11

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
@@ -14,7 +14,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
14
14
  * @generated
15
15
  * @see https://github.com/webgptorg/promptbook
16
16
  */
17
- const PROMPTBOOK_ENGINE_VERSION = '0.113.0-10';
17
+ const PROMPTBOOK_ENGINE_VERSION = '0.113.0-11';
18
18
  /**
19
19
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
20
20
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -0,0 +1,94 @@
1
+ import { type CreateCanvasForAsciiArt } from '../../avatars/renderAvatarVisualAsciiArt';
2
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
3
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import type { AsciiArtColorDepth } from '../ascii-art/convertImageDataToAsciiArt';
5
+ /**
6
+ * Output width of the terminal agent avatar visual in character cells.
7
+ *
8
+ * @private shared helper for terminal avatar rendering
9
+ */
10
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_COLUMNS = 48;
11
+ /**
12
+ * Output height of the terminal agent avatar visual in character cells.
13
+ *
14
+ * @private shared helper for terminal avatar rendering
15
+ */
16
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_ROWS = 12;
17
+ /**
18
+ * Refresh cadence used while a terminal agent avatar visual is animated.
19
+ *
20
+ * @private shared helper for terminal avatar rendering
21
+ */
22
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_REFRESH_INTERVAL_MS = 300;
23
+ /**
24
+ * Options passed when rendering one animated terminal avatar frame.
25
+ *
26
+ * @private shared helper for terminal avatar rendering
27
+ */
28
+ export type TerminalAgentAvatarVisualFrameOptions = {
29
+ /**
30
+ * Current animation time forwarded to the shared avatar renderer.
31
+ */
32
+ readonly animationTimeMs: number;
33
+ };
34
+ /**
35
+ * Runtime renderer for an agent avatar visual shown in a terminal.
36
+ *
37
+ * @private shared helper for terminal avatar rendering
38
+ */
39
+ export type TerminalAgentAvatarVisual = {
40
+ /**
41
+ * Whether the selected built-in visual changes over time.
42
+ */
43
+ readonly isAnimated: boolean;
44
+ /**
45
+ * Renders one ANSI ASCII-art frame for the current terminal timestamp.
46
+ */
47
+ readonly renderFrame: (options: TerminalAgentAvatarVisualFrameOptions) => ReadonlyArray<string>;
48
+ };
49
+ /**
50
+ * Options for creating a terminal avatar visual renderer from an agent book source.
51
+ *
52
+ * @private shared helper for terminal avatar rendering
53
+ */
54
+ export type CreateTerminalAgentAvatarVisualOptions = {
55
+ /**
56
+ * Source of the agent book whose metadata controls avatar identity.
57
+ */
58
+ readonly agentSource: string_book;
59
+ /**
60
+ * Built-in avatar visual used when the agent does not declare `META AVATAR` or `META VISUAL`.
61
+ */
62
+ readonly defaultAvatarVisualId?: AvatarVisualId;
63
+ /**
64
+ * Color depth of the emitted ANSI escape codes.
65
+ */
66
+ readonly colorDepth?: AsciiArtColorDepth;
67
+ /**
68
+ * Platform-specific canvas factory used to rasterize the visual.
69
+ */
70
+ readonly createCanvas: CreateCanvasForAsciiArt;
71
+ };
72
+ /**
73
+ * Resolves the built-in avatar visual selected for terminal rendering of one agent source.
74
+ *
75
+ * @param agentSource Source of the agent book.
76
+ * @param defaultAvatarVisualId Built-in fallback used when the source does not declare an avatar visual.
77
+ * @returns Supported built-in avatar visual id.
78
+ *
79
+ * @private shared helper for terminal avatar rendering
80
+ */
81
+ export declare function resolveTerminalAgentAvatarVisualId(agentSource: string_book, defaultAvatarVisualId?: AvatarVisualId): AvatarVisualId;
82
+ /**
83
+ * Creates an ANSI ASCII-art avatar renderer for terminal UIs.
84
+ *
85
+ * The agent's avatar visual is resolved the same way as on the website: `META AVATAR`
86
+ * / `META VISUAL` wins, then the provided fallback visual, then the shared default visual.
87
+ * The terminal variant uses a transparent horizontal canvas instead of the website's framed square surface.
88
+ *
89
+ * @param options Agent source, canvas factory, and optional terminal color settings.
90
+ * @returns Runtime terminal avatar visual renderer.
91
+ *
92
+ * @private shared helper for terminal avatar rendering
93
+ */
94
+ export declare function createTerminalAgentAvatarVisual(options: CreateTerminalAgentAvatarVisualOptions): TerminalAgentAvatarVisual;
@@ -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.113.0-9`).
18
+ * It follows semantic versioning (e.g., `0.113.0-10`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/color",
3
- "version": "0.113.0-10",
3
+ "version": "0.113.0-11",
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,
@@ -95,7 +95,7 @@
95
95
  "types": "./esm/src/_packages/color.index.d.ts",
96
96
  "typings": "./esm/src/_packages/color.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.113.0-10"
98
+ "@promptbook/core": "0.113.0-11"
99
99
  },
100
100
  "dependencies": {
101
101
  "spacetrim": "0.11.60"
package/umd/index.umd.js CHANGED
@@ -18,7 +18,7 @@
18
18
  * @generated
19
19
  * @see https://github.com/webgptorg/promptbook
20
20
  */
21
- const PROMPTBOOK_ENGINE_VERSION = '0.113.0-10';
21
+ const PROMPTBOOK_ENGINE_VERSION = '0.113.0-11';
22
22
  /**
23
23
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
24
24
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -0,0 +1,94 @@
1
+ import { type CreateCanvasForAsciiArt } from '../../avatars/renderAvatarVisualAsciiArt';
2
+ import type { AvatarVisualId } from '../../avatars/types/AvatarVisualDefinition';
3
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import type { AsciiArtColorDepth } from '../ascii-art/convertImageDataToAsciiArt';
5
+ /**
6
+ * Output width of the terminal agent avatar visual in character cells.
7
+ *
8
+ * @private shared helper for terminal avatar rendering
9
+ */
10
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_COLUMNS = 48;
11
+ /**
12
+ * Output height of the terminal agent avatar visual in character cells.
13
+ *
14
+ * @private shared helper for terminal avatar rendering
15
+ */
16
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_ROWS = 12;
17
+ /**
18
+ * Refresh cadence used while a terminal agent avatar visual is animated.
19
+ *
20
+ * @private shared helper for terminal avatar rendering
21
+ */
22
+ export declare const TERMINAL_AGENT_AVATAR_VISUAL_REFRESH_INTERVAL_MS = 300;
23
+ /**
24
+ * Options passed when rendering one animated terminal avatar frame.
25
+ *
26
+ * @private shared helper for terminal avatar rendering
27
+ */
28
+ export type TerminalAgentAvatarVisualFrameOptions = {
29
+ /**
30
+ * Current animation time forwarded to the shared avatar renderer.
31
+ */
32
+ readonly animationTimeMs: number;
33
+ };
34
+ /**
35
+ * Runtime renderer for an agent avatar visual shown in a terminal.
36
+ *
37
+ * @private shared helper for terminal avatar rendering
38
+ */
39
+ export type TerminalAgentAvatarVisual = {
40
+ /**
41
+ * Whether the selected built-in visual changes over time.
42
+ */
43
+ readonly isAnimated: boolean;
44
+ /**
45
+ * Renders one ANSI ASCII-art frame for the current terminal timestamp.
46
+ */
47
+ readonly renderFrame: (options: TerminalAgentAvatarVisualFrameOptions) => ReadonlyArray<string>;
48
+ };
49
+ /**
50
+ * Options for creating a terminal avatar visual renderer from an agent book source.
51
+ *
52
+ * @private shared helper for terminal avatar rendering
53
+ */
54
+ export type CreateTerminalAgentAvatarVisualOptions = {
55
+ /**
56
+ * Source of the agent book whose metadata controls avatar identity.
57
+ */
58
+ readonly agentSource: string_book;
59
+ /**
60
+ * Built-in avatar visual used when the agent does not declare `META AVATAR` or `META VISUAL`.
61
+ */
62
+ readonly defaultAvatarVisualId?: AvatarVisualId;
63
+ /**
64
+ * Color depth of the emitted ANSI escape codes.
65
+ */
66
+ readonly colorDepth?: AsciiArtColorDepth;
67
+ /**
68
+ * Platform-specific canvas factory used to rasterize the visual.
69
+ */
70
+ readonly createCanvas: CreateCanvasForAsciiArt;
71
+ };
72
+ /**
73
+ * Resolves the built-in avatar visual selected for terminal rendering of one agent source.
74
+ *
75
+ * @param agentSource Source of the agent book.
76
+ * @param defaultAvatarVisualId Built-in fallback used when the source does not declare an avatar visual.
77
+ * @returns Supported built-in avatar visual id.
78
+ *
79
+ * @private shared helper for terminal avatar rendering
80
+ */
81
+ export declare function resolveTerminalAgentAvatarVisualId(agentSource: string_book, defaultAvatarVisualId?: AvatarVisualId): AvatarVisualId;
82
+ /**
83
+ * Creates an ANSI ASCII-art avatar renderer for terminal UIs.
84
+ *
85
+ * The agent's avatar visual is resolved the same way as on the website: `META AVATAR`
86
+ * / `META VISUAL` wins, then the provided fallback visual, then the shared default visual.
87
+ * The terminal variant uses a transparent horizontal canvas instead of the website's framed square surface.
88
+ *
89
+ * @param options Agent source, canvas factory, and optional terminal color settings.
90
+ * @returns Runtime terminal avatar visual renderer.
91
+ *
92
+ * @private shared helper for terminal avatar rendering
93
+ */
94
+ export declare function createTerminalAgentAvatarVisual(options: CreateTerminalAgentAvatarVisualOptions): TerminalAgentAvatarVisual;
@@ -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.113.0-9`).
18
+ * It follows semantic versioning (e.g., `0.113.0-10`).
19
19
  *
20
20
  * @generated
21
21
  */