@promptbook/types 0.112.0-73 → 0.112.0-80

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 (70) hide show
  1. package/README.md +9 -9
  2. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  3. package/esm/src/avatars/visuals/octopus3d2AvatarVisual.d.ts +7 -0
  4. package/esm/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +37 -0
  5. package/esm/src/book-components/Chat/save/_common/chatExportRendering.d.ts +47 -0
  6. package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +12 -0
  7. package/esm/src/book-components/Chat/save/index.d.ts +2 -2
  8. package/esm/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +5 -3
  9. package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +3 -3
  10. package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +1 -1
  11. package/esm/src/cli/cli-commands/agent/agentProjectPaths.d.ts +8 -8
  12. package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -1
  13. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +56 -0
  14. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.test.d.ts +1 -0
  15. package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +7 -0
  16. package/esm/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +7 -0
  17. package/esm/src/cli/cli-commands/agents-server/init.d.ts +9 -0
  18. package/esm/src/cli/cli-commands/agents-server/init.test.d.ts +1 -0
  19. package/esm/src/cli/cli-commands/agents-server/initializeAgentsServerProjectConfiguration.d.ts +17 -0
  20. package/esm/src/cli/cli-commands/agents-server/printAgentsServerInitializationSummary.d.ts +7 -0
  21. package/esm/src/cli/cli-commands/agents-server/run.d.ts +14 -0
  22. package/esm/src/cli/cli-commands/agents-server/run.test.d.ts +1 -0
  23. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +23 -0
  24. package/esm/src/cli/cli-commands/agents-server.d.ts +8 -0
  25. package/esm/src/cli/cli-commands/common/projectInitialization.d.ts +65 -0
  26. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +44 -0
  27. package/esm/src/cli/common/$deprecateCliCommand.d.ts +8 -0
  28. package/esm/src/cli/common/$deprecateCliCommand.test.d.ts +1 -0
  29. package/esm/src/utils/color/Color.d.ts +4 -44
  30. package/esm/src/utils/color/ColorValue.d.ts +55 -0
  31. package/esm/src/utils/color/isHexColorString.d.ts +10 -0
  32. package/esm/src/utils/color/parseColorString.d.ts +11 -0
  33. package/esm/src/version.d.ts +1 -1
  34. package/package.json +2 -2
  35. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
  36. package/umd/src/avatars/visuals/octopus3d2AvatarVisual.d.ts +7 -0
  37. package/umd/src/avatars/visuals/octopus3dAvatarVisualShared.d.ts +37 -0
  38. package/umd/src/book-components/Chat/save/_common/chatExportRendering.d.ts +47 -0
  39. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +12 -0
  40. package/umd/src/book-components/Chat/save/index.d.ts +2 -2
  41. package/umd/src/book-components/Chat/save/markdown/mdSaveFormatDefinition.d.ts +5 -3
  42. package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +3 -3
  43. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +1 -1
  44. package/umd/src/cli/cli-commands/agent/agentProjectPaths.d.ts +8 -8
  45. package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -1
  46. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +56 -0
  47. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.test.d.ts +1 -0
  48. package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.d.ts +7 -0
  49. package/umd/src/cli/cli-commands/agents-server/ensureAgentsServerGitignoreFile.d.ts +7 -0
  50. package/umd/src/cli/cli-commands/agents-server/init.d.ts +9 -0
  51. package/umd/src/cli/cli-commands/agents-server/init.test.d.ts +1 -0
  52. package/umd/src/cli/cli-commands/agents-server/initializeAgentsServerProjectConfiguration.d.ts +17 -0
  53. package/umd/src/cli/cli-commands/agents-server/printAgentsServerInitializationSummary.d.ts +7 -0
  54. package/umd/src/cli/cli-commands/agents-server/run.d.ts +14 -0
  55. package/umd/src/cli/cli-commands/agents-server/run.test.d.ts +1 -0
  56. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +23 -0
  57. package/umd/src/cli/cli-commands/agents-server.d.ts +8 -0
  58. package/umd/src/cli/cli-commands/common/projectInitialization.d.ts +65 -0
  59. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +44 -0
  60. package/umd/src/cli/common/$deprecateCliCommand.d.ts +8 -0
  61. package/umd/src/cli/common/$deprecateCliCommand.test.d.ts +1 -0
  62. package/umd/src/utils/color/Color.d.ts +4 -44
  63. package/umd/src/utils/color/ColorValue.d.ts +55 -0
  64. package/umd/src/utils/color/isHexColorString.d.ts +10 -0
  65. package/umd/src/utils/color/parseColorString.d.ts +11 -0
  66. package/umd/src/version.d.ts +1 -1
  67. package/esm/src/cli/cli-commands/coder/appendBlock.d.ts +0 -6
  68. package/esm/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +0 -6
  69. package/umd/src/cli/cli-commands/coder/appendBlock.d.ts +0 -6
  70. package/umd/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +0 -6
@@ -0,0 +1,65 @@
1
+ /**
2
+ * File status returned by project configuration bootstrapping helpers.
3
+ *
4
+ * @private internal utility of Promptbook CLI project initialization
5
+ */
6
+ export type ProjectInitializationStatus = 'created' | 'updated' | 'unchanged';
7
+ /**
8
+ * Minimal environment variable descriptor used for additive `.env` initialization.
9
+ *
10
+ * @private internal utility of Promptbook CLI project initialization
11
+ */
12
+ export type ProjectEnvVariableDefinition = {
13
+ readonly name: string;
14
+ };
15
+ /**
16
+ * Result of one additive `.env` initialization attempt.
17
+ *
18
+ * @private internal utility of Promptbook CLI project initialization
19
+ */
20
+ export type EnsureProjectEnvFileResult = {
21
+ readonly envFileStatus: ProjectInitializationStatus;
22
+ readonly initializedEnvVariableNames: ReadonlyArray<string>;
23
+ };
24
+ /**
25
+ * Options required to append missing variables into a project `.env`.
26
+ */
27
+ type EnsureProjectEnvFileOptions<TEnvVariable extends ProjectEnvVariableDefinition> = {
28
+ readonly projectPath: string;
29
+ readonly emptyFileContent: string;
30
+ readonly envVariables: ReadonlyArray<TEnvVariable>;
31
+ readonly buildMissingEnvVariablesBlock: (envVariables: ReadonlyArray<TEnvVariable>) => string;
32
+ };
33
+ /**
34
+ * Options required to append missing rules into a project `.gitignore`.
35
+ */
36
+ type EnsureProjectGitignoreFileOptions = {
37
+ readonly projectPath: string;
38
+ readonly blockHeader: string;
39
+ readonly rules: ReadonlyArray<string>;
40
+ };
41
+ /**
42
+ * Ensures `.env` exists and appends only still-missing variable definitions.
43
+ *
44
+ * @private internal utility of Promptbook CLI project initialization
45
+ */
46
+ export declare function ensureProjectEnvFile<TEnvVariable extends ProjectEnvVariableDefinition>({ projectPath, emptyFileContent, envVariables, buildMissingEnvVariablesBlock, }: EnsureProjectEnvFileOptions<TEnvVariable>): Promise<EnsureProjectEnvFileResult>;
47
+ /**
48
+ * Ensures `.gitignore` contains all required project initialization rules.
49
+ *
50
+ * @private internal utility of Promptbook CLI project initialization
51
+ */
52
+ export declare function ensureProjectGitignoreFile({ projectPath, blockHeader, rules, }: EnsureProjectGitignoreFileOptions): Promise<ProjectInitializationStatus>;
53
+ /**
54
+ * Reads one text file when it exists, otherwise returns `undefined`.
55
+ *
56
+ * @private internal utility of Promptbook CLI project initialization
57
+ */
58
+ export declare function readTextFileIfExists(path: string): Promise<string | undefined>;
59
+ /**
60
+ * Appends one text block to existing file content while preserving readable newlines.
61
+ *
62
+ * @private internal utility of Promptbook CLI project initialization
63
+ */
64
+ export declare function appendBlock(currentContent: string, blockToAppend: string): string;
65
+ export {};
@@ -6,6 +6,24 @@ import type { ThinkingLevel } from '../coder/ThinkingLevel';
6
6
  * @private internal utility of `promptbookCli`
7
7
  */
8
8
  export declare const PROMPT_RUNNER_AGENT_NAMES: readonly ["openai-codex", "github-copilot", "cline", "claude-code", "opencode", "gemini"];
9
+ /**
10
+ * Environment variable used as the default runner identifier when `--agent` is omitted.
11
+ *
12
+ * @private internal utility of `promptbookCli`
13
+ */
14
+ export declare const PTBK_AGENT_ENV = "PTBK_AGENT";
15
+ /**
16
+ * Environment variable used as the default runner model when `--model` is omitted.
17
+ *
18
+ * @private internal utility of `promptbookCli`
19
+ */
20
+ export declare const PTBK_MODEL_ENV = "PTBK_MODEL";
21
+ /**
22
+ * Environment variable used as the default runner thinking level when `--thinking-level` is omitted.
23
+ *
24
+ * @private internal utility of `promptbookCli`
25
+ */
26
+ export declare const PTBK_THINKING_LEVEL_ENV = "PTBK_THINKING_LEVEL";
9
27
  /**
10
28
  * Runner identifier supported by Promptbook CLI agent orchestration commands.
11
29
  *
@@ -29,6 +47,12 @@ export type PromptRunnerCliOptions = {
29
47
  readonly autoPush: boolean;
30
48
  readonly autoPull: boolean;
31
49
  };
50
+ /**
51
+ * Commander option bag for runner selection plus terminal/runtime switches shared with server orchestration.
52
+ *
53
+ * @private internal utility of `promptbookCli`
54
+ */
55
+ export type PromptRunnerSelectionCliOptions = Pick<PromptRunnerCliOptions, 'agent' | 'model' | 'ui' | 'thinkingLevel' | 'allowCredits'>;
32
56
  /**
33
57
  * Normalized runner options used by runner-backed CLI commands.
34
58
  *
@@ -46,6 +70,12 @@ export type NormalizedPromptRunnerCliOptions = {
46
70
  readonly autoPush: boolean;
47
71
  readonly autoPull: boolean;
48
72
  };
73
+ /**
74
+ * Normalized runner selection plus terminal/runtime switches shared with server orchestration.
75
+ *
76
+ * @private internal utility of `promptbookCli`
77
+ */
78
+ export type NormalizedPromptRunnerSelectionCliOptions = Pick<NormalizedPromptRunnerCliOptions, 'agentName' | 'model' | 'noUi' | 'thinkingLevel' | 'allowCredits'>;
49
79
  /**
50
80
  * Description block shared by runner-backed CLI commands.
51
81
  *
@@ -70,6 +100,12 @@ export declare const PROMPT_RUNNER_MODEL_OPTION_DESCRIPTION: string;
70
100
  * @private internal utility of `promptbookCli`
71
101
  */
72
102
  export declare function addPromptRunnerSelectionOptions(command: Program): void;
103
+ /**
104
+ * Registers shared runner terminal/runtime flags on a command.
105
+ *
106
+ * @private internal utility of `promptbookCli`
107
+ */
108
+ export declare function addPromptRunnerRuntimeOptions(command: Program): void;
73
109
  /**
74
110
  * Registers shared runner execution flags on a command.
75
111
  *
@@ -84,3 +120,11 @@ export declare function addPromptRunnerExecutionOptions(command: Program): void;
84
120
  export declare function normalizePromptRunnerCliOptions(cliOptions: PromptRunnerCliOptions, options: {
85
121
  readonly isAgentRequired: boolean;
86
122
  }): NormalizedPromptRunnerCliOptions;
123
+ /**
124
+ * Converts Commander runner selection/runtime flags into the normalized runner shape.
125
+ *
126
+ * @private internal utility of `promptbookCli`
127
+ */
128
+ export declare function normalizePromptRunnerSelectionCliOptions(cliOptions: PromptRunnerSelectionCliOptions, options: {
129
+ readonly isAgentRequired: boolean;
130
+ }): NormalizedPromptRunnerSelectionCliOptions;
@@ -0,0 +1,8 @@
1
+ import { Command } from 'commander';
2
+ import type { $side_effect } from '../../utils/organization/$side_effect';
3
+ /**
4
+ * Marks one CLI command as deprecated while keeping it available for existing callers.
5
+ *
6
+ * @private utility of CLI
7
+ */
8
+ export declare function $deprecateCliCommand(command: Command, deprecationMessage: string): $side_effect;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import type { string_color } from '../../types/string_person_fullname';
2
2
  import type { string_url_image } from '../../types/string_url_image';
3
3
  import type { WithTake } from '../take/interfaces/ITakeChain';
4
4
  import { CSS_COLORS } from './css-colors';
5
+ import { ColorValue } from './ColorValue';
5
6
  /**
6
7
  * Color object represents an RGB color with alpha channel
7
8
  *
@@ -9,11 +10,7 @@ import { CSS_COLORS } from './css-colors';
9
10
  *
10
11
  * @public exported from `@promptbook/color`
11
12
  */
12
- export declare class Color {
13
- readonly red: number;
14
- readonly green: number;
15
- readonly blue: number;
16
- readonly alpha: number;
13
+ export declare class Color extends ColorValue {
17
14
  /**
18
15
  * Creates a new Color instance from miscellaneous formats
19
16
  * - It can receive Color instance and just return the same instance
@@ -117,43 +114,6 @@ export declare class Color {
117
114
  * @param alpha number from 0 (transparent) to 255 (opaque)
118
115
  */
119
116
  private constructor();
120
- /**
121
- * Shortcut for `red` property
122
- * Number from 0 to 255
123
- * @alias red
124
- */
125
- get r(): number;
126
- /**
127
- * Shortcut for `green` property
128
- * Number from 0 to 255
129
- * @alias green
130
- */
131
- get g(): number;
132
- /**
133
- * Shortcut for `blue` property
134
- * Number from 0 to 255
135
- * @alias blue
136
- */
137
- get b(): number;
138
- /**
139
- * Shortcut for `alpha` property
140
- * Number from 0 (transparent) to 255 (opaque)
141
- * @alias alpha
142
- */
143
- get a(): number;
144
- /**
145
- * Shortcut for `alpha` property
146
- * Number from 0 (transparent) to 255 (opaque)
147
- * @alias alpha
148
- */
149
- get opacity(): number;
150
- /**
151
- * Shortcut for 1-`alpha` property
152
- */
153
- get transparency(): number;
154
- clone(): WithTake<Color>;
155
- toString(): string_color;
156
- toHex(): string_color;
157
- toRgb(): string_color;
158
- toHsl(): string_color;
117
+ protected createColor(red: number, green: number, blue: number, alpha: number): Color;
118
+ private static fromColorChannels;
159
119
  }
@@ -0,0 +1,55 @@
1
+ import type { string_color } from '../../types/string_person_fullname';
2
+ import type { WithTake } from '../take/interfaces/ITakeChain';
3
+ import type { Color } from './Color';
4
+ /**
5
+ * Shared immutable channel storage and serialization helpers for `Color`.
6
+ *
7
+ * @private base class of Color
8
+ */
9
+ export declare abstract class ColorValue {
10
+ readonly red: number;
11
+ readonly green: number;
12
+ readonly blue: number;
13
+ readonly alpha: number;
14
+ protected constructor(red: number, green: number, blue: number, alpha?: number);
15
+ /**
16
+ * Shortcut for `red` property
17
+ * Number from 0 to 255
18
+ * @alias red
19
+ */
20
+ get r(): number;
21
+ /**
22
+ * Shortcut for `green` property
23
+ * Number from 0 to 255
24
+ * @alias green
25
+ */
26
+ get g(): number;
27
+ /**
28
+ * Shortcut for `blue` property
29
+ * Number from 0 to 255
30
+ * @alias blue
31
+ */
32
+ get b(): number;
33
+ /**
34
+ * Shortcut for `alpha` property
35
+ * Number from 0 (transparent) to 255 (opaque)
36
+ * @alias alpha
37
+ */
38
+ get a(): number;
39
+ /**
40
+ * Shortcut for `alpha` property
41
+ * Number from 0 (transparent) to 255 (opaque)
42
+ * @alias alpha
43
+ */
44
+ get opacity(): number;
45
+ /**
46
+ * Shortcut for 1-`alpha` property
47
+ */
48
+ get transparency(): number;
49
+ clone(): WithTake<Color>;
50
+ toString(): string_color;
51
+ toHex(): string_color;
52
+ toRgb(): string_color;
53
+ toHsl(): string_color;
54
+ protected abstract createColor(red: number, green: number, blue: number, alpha: number): Color;
55
+ }
@@ -0,0 +1,10 @@
1
+ import type { string_color } from '../../types/string_person_fullname';
2
+ /**
3
+ * Checks if the given value is a valid hex color string
4
+ *
5
+ * @param value - value to check
6
+ * @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
7
+ *
8
+ * @private function of Color
9
+ */
10
+ export declare function isHexColorString(value: unknown): value is string_color;
@@ -0,0 +1,11 @@
1
+ import type { string_color } from '../../types/string_person_fullname';
2
+ import type { ColorChannelSet } from './parsers/ColorChannelSet';
3
+ /**
4
+ * Parses a supported color string into RGBA channels.
5
+ *
6
+ * @param color as a string for example `#009edd`, `rgb(0,158,221)`, `rgb(0%,62%,86.7%)`, `hsl(197.1,100%,43.3%)`, `red`, `darkgrey`,...
7
+ * @returns RGBA channel values.
8
+ *
9
+ * @private function of Color
10
+ */
11
+ export declare function parseColorString(color: string_color): ColorChannelSet;
@@ -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-72`).
18
+ * It follows semantic versioning (e.g., `0.112.0-79`).
19
19
  *
20
20
  * @generated
21
21
  */
@@ -1,6 +0,0 @@
1
- /**
2
- * Appends one text block to existing file content while preserving readable newlines.
3
- *
4
- * @private function of `initializeCoderProjectConfiguration`
5
- */
6
- export declare function appendBlock(currentContent: string, blockToAppend: string): string;
@@ -1,6 +0,0 @@
1
- /**
2
- * Reads one text file when it exists, otherwise returns `undefined`.
3
- *
4
- * @private function of `initializeCoderProjectConfiguration`
5
- */
6
- export declare function readTextFileIfExists(path: string): Promise<string | undefined>;
@@ -1,6 +0,0 @@
1
- /**
2
- * Appends one text block to existing file content while preserving readable newlines.
3
- *
4
- * @private function of `initializeCoderProjectConfiguration`
5
- */
6
- export declare function appendBlock(currentContent: string, blockToAppend: string): string;
@@ -1,6 +0,0 @@
1
- /**
2
- * Reads one text file when it exists, otherwise returns `undefined`.
3
- *
4
- * @private function of `initializeCoderProjectConfiguration`
5
- */
6
- export declare function readTextFileIfExists(path: string): Promise<string | undefined>;