@promptbook/javascript 0.114.0-4 → 0.114.0-6
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 +3 -3
- package/esm/index.es.js +1 -1
- package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +5 -3
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/esm/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/esm/src/utils/misc/debounce.d.ts +4 -2
- package/esm/src/utils/misc/debounce.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +5 -3
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/verify.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/umd/src/cli/cli-commands/common/{harness/$resolveLatestHarnessVersion.d.ts → npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/umd/src/utils/misc/debounce.d.ts +4 -2
- package/umd/src/utils/misc/debounce.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/esm/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.test.d.ts → npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -451,7 +451,7 @@ Or you can install them separately:
|
|
|
451
451
|
|
|
452
452
|
Promptbook Coder is **not another standalone coding model**. It is an orchestration layer over coding agents such as **GitHub Copilot**, **OpenAI Codex**, **Claude Code**, **Opencode**, **Cline**, and **Gemini CLI**. The difference is that Promptbook Coder adds a repeatable repository workflow on top of them:
|
|
453
453
|
|
|
454
|
-
- prompt files with explicit statuses like `[ ]`, `[x]`, and `[-]`
|
|
454
|
+
- prompt files with explicit statuses like `[ ]`, `[^]`, `[x]`, and `[-]`
|
|
455
455
|
- automatic selection of the next runnable task, including priority support
|
|
456
456
|
- optional shared repo context loaded from a file such as `AGENTS.md`
|
|
457
457
|
- automatic `git add`, commit, and push after each successful prompt
|
|
@@ -466,11 +466,11 @@ In short: tools like Claude Code, Codex, or GitHub Copilot are the **engines**;
|
|
|
466
466
|
1. `ptbk coder init` prepares the project for the coder workflow, seeds project-owned generic templates in `prompts/templates/`, creates a starter `AGENTS.md` context file, adds helper `npm run coder:*` scripts, ensures `.gitignore` ignores `/.promptbook`, and configures VS Code prompt screenshots in `prompts/screenshots/`.
|
|
467
467
|
2. `ptbk coder generate-boilerplates` creates prompt files in `prompts/`.
|
|
468
468
|
3. You replace placeholder `@@@` sections with real coding tasks.
|
|
469
|
-
4. `ptbk coder run` sends the next ready `[ ]` prompt to the selected coding agent.
|
|
469
|
+
4. `ptbk coder run` sends the next ready `[ ]` prompt to the selected coding agent and immediately marks it as in progress `[^]`, naming the harness, the model and the step which is running.
|
|
470
470
|
5. Promptbook Coder marks the prompt as done `[x]`, records runner metadata, then stages, commits, and pushes the resulting changes.
|
|
471
471
|
6. `ptbk coder verify` reviews completed prompts, archives finished files to `prompts/done/`, and appends a repair prompt when more work is needed.
|
|
472
472
|
|
|
473
|
-
Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treated as not fully written, and prompts with more `!` markers have higher priority.
|
|
473
|
+
Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treated as not fully written, and prompts with more `!` markers have higher priority. A prompt left as `[^]` was interrupted in the middle of its implementation — the in-progress status is never reverted, so a killed or crashed coder always leaves that signal behind.
|
|
474
474
|
|
|
475
475
|
#### Features
|
|
476
476
|
|
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-6';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AsciiArtColorDepth } from '../utils/ascii-art/convertImageDataToAsciiArt';
|
|
2
|
+
import type { ResolvedAvatarRenderDefinition } from './renderAvatarVisual';
|
|
3
|
+
import type { AvatarDefinition } from './types/AvatarDefinition';
|
|
4
|
+
import type { AvatarSurfaceStyle, AvatarVisualId, AvatarVisualTerminalTextGrid } from './types/AvatarVisualDefinition';
|
|
5
|
+
/**
|
|
6
|
+
* Options shared by the terminal-text avatar renderers.
|
|
7
|
+
*
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export type RenderAvatarVisualTerminalTextOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Stable visual identity of the rendered agent avatar.
|
|
13
|
+
*/
|
|
14
|
+
readonly avatarDefinition: AvatarDefinition;
|
|
15
|
+
/**
|
|
16
|
+
* Built-in avatar visual to render, the same one used on the website.
|
|
17
|
+
*/
|
|
18
|
+
readonly visualId: AvatarVisualId;
|
|
19
|
+
/**
|
|
20
|
+
* Surface used to derive the avatar palette.
|
|
21
|
+
*
|
|
22
|
+
* @default 'framed'
|
|
23
|
+
*/
|
|
24
|
+
readonly surface?: AvatarSurfaceStyle;
|
|
25
|
+
/**
|
|
26
|
+
* Output width in terminal character cells.
|
|
27
|
+
*/
|
|
28
|
+
readonly columns: number;
|
|
29
|
+
/**
|
|
30
|
+
* Output height in terminal character cells.
|
|
31
|
+
*/
|
|
32
|
+
readonly rows: number;
|
|
33
|
+
/**
|
|
34
|
+
* Animation timestamp for animated visuals.
|
|
35
|
+
*/
|
|
36
|
+
readonly timeMs: number;
|
|
37
|
+
/**
|
|
38
|
+
* Optional stable render data reused across frames.
|
|
39
|
+
*/
|
|
40
|
+
readonly resolvedAvatarRenderDefinition?: ResolvedAvatarRenderDefinition;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Options for `renderAvatarVisualTerminalTextLines`.
|
|
44
|
+
*
|
|
45
|
+
* @private within the repository
|
|
46
|
+
*/
|
|
47
|
+
export type RenderAvatarVisualTerminalTextLinesOptions = RenderAvatarVisualTerminalTextOptions & {
|
|
48
|
+
/**
|
|
49
|
+
* Color depth of the emitted ANSI escape codes.
|
|
50
|
+
*
|
|
51
|
+
* @default 'TRUE_COLOR'
|
|
52
|
+
*/
|
|
53
|
+
readonly colorDepth?: AsciiArtColorDepth;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Renders one frame of a character-based avatar visual straight into terminal character cells.
|
|
57
|
+
*
|
|
58
|
+
* Visuals which are themselves made of characters, for example `AsciiOctopus`, lose their identity
|
|
59
|
+
* when they are rasterized onto a canvas and converted back into half-block ASCII art - every glyph
|
|
60
|
+
* is averaged away into a colored blob. Such visuals expose `renderTerminalText`, which paints the
|
|
61
|
+
* terminal grid directly and is used instead of the raster pipeline.
|
|
62
|
+
*
|
|
63
|
+
* The square avatar is centered inside the requested grid the same way `renderAvatarVisualAsciiArt`
|
|
64
|
+
* centers the avatar canvas inside a wider terminal frame.
|
|
65
|
+
*
|
|
66
|
+
* @param options Avatar identity, visual selection, and output grid size.
|
|
67
|
+
* @returns Grid of `rows` rows of `columns` cells, or `null` when the visual has no terminal renderer.
|
|
68
|
+
*
|
|
69
|
+
* @private within the repository
|
|
70
|
+
*/
|
|
71
|
+
export declare function renderAvatarVisualTerminalTextGrid(options: RenderAvatarVisualTerminalTextOptions): AvatarVisualTerminalTextGrid | null;
|
|
72
|
+
/**
|
|
73
|
+
* Renders one frame of a character-based avatar visual into ANSI-colored terminal lines.
|
|
74
|
+
*
|
|
75
|
+
* @param options Avatar identity, visual selection, output grid size, and ANSI color depth.
|
|
76
|
+
* @returns One ANSI-colored string per output row, or `null` when the visual has no terminal renderer.
|
|
77
|
+
*
|
|
78
|
+
* @private within the repository
|
|
79
|
+
*/
|
|
80
|
+
export declare function renderAvatarVisualTerminalTextLines(options: RenderAvatarVisualTerminalTextLinesOptions): ReadonlyArray<string> | null;
|
|
@@ -72,6 +72,52 @@ export type AvatarVisualRenderContext = {
|
|
|
72
72
|
* @private shared contract for the avatar rendering system
|
|
73
73
|
*/
|
|
74
74
|
export type AvatarVisual = (context: AvatarVisualRenderContext) => void;
|
|
75
|
+
/**
|
|
76
|
+
* One painted character cell of a terminal-text avatar frame.
|
|
77
|
+
*
|
|
78
|
+
* @private shared contract for the avatar rendering system
|
|
79
|
+
*/
|
|
80
|
+
export type AvatarVisualTerminalTextCell = {
|
|
81
|
+
/**
|
|
82
|
+
* Single character painted in the cell.
|
|
83
|
+
*/
|
|
84
|
+
readonly character: string;
|
|
85
|
+
/**
|
|
86
|
+
* Color of the character as a CSS color string, optionally with an alpha channel.
|
|
87
|
+
*/
|
|
88
|
+
readonly color: string_color;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* One rendered terminal-text avatar frame as a grid of character cells.
|
|
92
|
+
*
|
|
93
|
+
* Rows are ordered top to bottom, cells left to right, and `null` leaves the terminal background visible.
|
|
94
|
+
*
|
|
95
|
+
* @private shared contract for the avatar rendering system
|
|
96
|
+
*/
|
|
97
|
+
export type AvatarVisualTerminalTextGrid = ReadonlyArray<ReadonlyArray<AvatarVisualTerminalTextCell | null>>;
|
|
98
|
+
/**
|
|
99
|
+
* Rendering context forwarded to a terminal-text avatar visual.
|
|
100
|
+
*
|
|
101
|
+
* Unlike `AvatarVisualRenderContext` this carries no canvas, because the visual paints
|
|
102
|
+
* character cells of a fixed terminal grid instead of pixels.
|
|
103
|
+
*
|
|
104
|
+
* @private shared contract for the avatar rendering system
|
|
105
|
+
*/
|
|
106
|
+
export type AvatarVisualTerminalTextRenderContext = {
|
|
107
|
+
readonly columns: number;
|
|
108
|
+
readonly rows: number;
|
|
109
|
+
readonly timeMs: number;
|
|
110
|
+
readonly avatarDefinition: AvatarDefinition;
|
|
111
|
+
readonly palette: AvatarPalette;
|
|
112
|
+
readonly createRandom: (salt: string) => () => number;
|
|
113
|
+
readonly interaction: AvatarInteractionState;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Signature of one terminal-text avatar visual renderer.
|
|
117
|
+
*
|
|
118
|
+
* @private shared contract for the avatar rendering system
|
|
119
|
+
*/
|
|
120
|
+
export type AvatarVisualTerminalText = (context: AvatarVisualTerminalTextRenderContext) => AvatarVisualTerminalTextGrid;
|
|
75
121
|
/**
|
|
76
122
|
* Metadata and renderer for one built-in avatar visual.
|
|
77
123
|
*
|
|
@@ -84,6 +130,14 @@ export type AvatarVisualDefinition = {
|
|
|
84
130
|
readonly isAnimated: boolean;
|
|
85
131
|
readonly supportsPointerTracking?: boolean;
|
|
86
132
|
readonly render: AvatarVisual;
|
|
133
|
+
/**
|
|
134
|
+
* Optional native terminal renderer of visuals which are themselves made of characters.
|
|
135
|
+
*
|
|
136
|
+
* Character-based visuals lose their identity when they are rasterized onto a canvas and
|
|
137
|
+
* converted back into half-block ASCII art, so they paint the terminal character grid directly.
|
|
138
|
+
* Visuals without this renderer are rasterized through `renderAvatarVisualAsciiArt` instead.
|
|
139
|
+
*/
|
|
140
|
+
readonly renderTerminalText?: AvatarVisualTerminalText;
|
|
87
141
|
};
|
|
88
142
|
/**
|
|
89
143
|
* Props of the shared `<Avatar/>` component.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relative directory for an active TEAM conversation workspace.
|
|
3
|
+
*
|
|
4
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
5
|
+
*/
|
|
6
|
+
export declare const AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH: string;
|
|
7
|
+
/**
|
|
8
|
+
* Relative directory where completed TEAM conversation transcripts are retained.
|
|
9
|
+
*
|
|
10
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
11
|
+
*/
|
|
12
|
+
export declare const AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name of the JSON manifest that describes one TEAM conversation workspace.
|
|
15
|
+
*
|
|
16
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
17
|
+
*/
|
|
18
|
+
export declare const AGENT_TEAM_CONVERSATION_MANIFEST_FILE_NAME = "team.json";
|
|
19
|
+
/**
|
|
20
|
+
* Name of the read-only teammate-source directory inside one TEAM workspace.
|
|
21
|
+
*
|
|
22
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
23
|
+
*/
|
|
24
|
+
export declare const AGENT_TEAMMATE_SOURCES_DIRECTORY_NAME = "teammates";
|
|
25
|
+
/**
|
|
26
|
+
* One primary agent represented in a TEAM workspace manifest.
|
|
27
|
+
*
|
|
28
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
29
|
+
*/
|
|
30
|
+
export type AgentTeamConversationPrimaryAgent = {
|
|
31
|
+
readonly permanentId: string;
|
|
32
|
+
readonly agentName: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* One local teammate made available to the coding harness for a single user turn.
|
|
36
|
+
*
|
|
37
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
38
|
+
*/
|
|
39
|
+
export type AgentTeamConversationTeammate = {
|
|
40
|
+
readonly permanentId: string;
|
|
41
|
+
readonly agentName: string;
|
|
42
|
+
readonly url: string;
|
|
43
|
+
readonly instructions: string;
|
|
44
|
+
readonly sourceFileName: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Persisted roster snapshot for the optional TEAM workspace of one queued message.
|
|
48
|
+
*
|
|
49
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
50
|
+
*/
|
|
51
|
+
export type AgentTeamConversationWorkspaceManifest = {
|
|
52
|
+
readonly version: 1;
|
|
53
|
+
readonly primaryAgent: AgentTeamConversationPrimaryAgent;
|
|
54
|
+
readonly teammates: ReadonlyArray<AgentTeamConversationTeammate>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Creates the stable directory name that belongs to one queued `.book` message.
|
|
58
|
+
*
|
|
59
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
60
|
+
*/
|
|
61
|
+
export declare function createAgentTeamConversationWorkspaceDirectoryName(messageFileName: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Creates the relative active workspace path for one queued message.
|
|
64
|
+
*
|
|
65
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
66
|
+
*/
|
|
67
|
+
export declare function createAgentTeamConversationWorkspacePath(messageFileName: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Creates the relative completed-workspace path for one queued message.
|
|
70
|
+
*
|
|
71
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
72
|
+
*/
|
|
73
|
+
export declare function createFinishedAgentTeamConversationWorkspacePath(messageFileName: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Creates the source-snapshot file name for one teammate.
|
|
76
|
+
*
|
|
77
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
78
|
+
*/
|
|
79
|
+
export declare function createAgentTeamTeammateSourceFileName(teammatePermanentId: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* Checks whether unknown JSON has the minimum shape required for a TEAM workspace manifest.
|
|
82
|
+
*
|
|
83
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
84
|
+
*/
|
|
85
|
+
export declare function isAgentTeamConversationWorkspaceManifest(value: unknown): value is AgentTeamConversationWorkspaceManifest;
|
|
@@ -591,8 +591,9 @@ export type ChatProps = {
|
|
|
591
591
|
progress?: number;
|
|
592
592
|
}>;
|
|
593
593
|
/**
|
|
594
|
-
*
|
|
595
|
-
*
|
|
594
|
+
* Optional content displayed in the chat header above the message list.
|
|
595
|
+
*
|
|
596
|
+
* If not provided, the header row is not rendered.
|
|
596
597
|
*/
|
|
597
598
|
readonly children?: ReactNode;
|
|
598
599
|
/**
|
|
@@ -26,10 +26,12 @@ export type MarkdownInlineReference = {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly href: string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Optional URL prefixes which also identify this reference in the authored markdown.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* A markdown link or a bare URL pointing to one of these prefixes is rendered as the same chip
|
|
32
|
+
* as the `[[reference]]` token. Both absolute URLs (for example `https://project.example.com`)
|
|
33
|
+
* and application paths (for example `/agents/agent/projects/website`) are supported; a path
|
|
34
|
+
* prefix matches on any host so that both relative and absolute links are recognized.
|
|
33
35
|
*/
|
|
34
36
|
readonly sourceHrefPrefixes?: ReadonlyArray<string>;
|
|
35
37
|
/**
|
|
@@ -12,7 +12,7 @@ export type BoilerplateCount = {
|
|
|
12
12
|
* Number of prompts written into each generated file.
|
|
13
13
|
*
|
|
14
14
|
* Note: More than one prompt per file is an advanced option - each prompt is one separate
|
|
15
|
-
* coding task separated by
|
|
15
|
+
* coding task separated by `---`, with all prompts in the file sharing its fresh emoji tag.
|
|
16
16
|
*/
|
|
17
17
|
readonly promptsPerFileCount: number;
|
|
18
18
|
};
|
|
@@ -10,7 +10,7 @@ import type { BoilerplateCount } from './boilerplateCount';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function $initializeCoderGenerateBoilerplatesCommand(program: Program): $side_effect;
|
|
12
12
|
/**
|
|
13
|
-
* Generates boilerplate prompt files with unique emoji
|
|
13
|
+
* Generates boilerplate prompt files with one unique emoji tag per file.
|
|
14
14
|
*
|
|
15
15
|
* @private internal function of `generatePromptBoilerplate` command
|
|
16
16
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Asks the user in the terminal whether
|
|
2
|
+
* Asks the user in the terminal whether an npm package should be installed or updated now.
|
|
3
3
|
*
|
|
4
4
|
* Note: `$` is used to indicate that this function is not a pure function - it reads the answer from stdin
|
|
5
5
|
*
|
|
6
6
|
* @returns `true` when the user confirms, `false` when the user declines or the terminal is not interactive
|
|
7
7
|
* @private internal utility of `promptbookCli`
|
|
8
8
|
*/
|
|
9
|
-
export declare function $
|
|
9
|
+
export declare function $askForNpmPackageInstallationApproval(question: string): Promise<boolean>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { HarnessDefinition } from './HarnessDefinition';
|
|
2
1
|
/**
|
|
3
|
-
* Reads the newest version of
|
|
2
|
+
* Reads the newest version of one npm package.
|
|
4
3
|
*
|
|
5
4
|
* Note: `$` is used to indicate that this function is not a pure function - it queries the npm registry
|
|
6
5
|
*
|
|
7
6
|
* @returns The newest published version or `null` when the registry could not be reached
|
|
8
7
|
* @private internal utility of `promptbookCli`
|
|
9
8
|
*/
|
|
10
|
-
export declare function $
|
|
9
|
+
export declare function $resolveLatestNpmPackageVersion(npmPackageName: string): Promise<string | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts an npm package version from raw command output.
|
|
3
|
+
*
|
|
4
|
+
* Both npm and CLI commands may emit unrelated warnings before the version. CLI commands use the first matching token;
|
|
5
|
+
* npm registry commands can opt into the last matching token because npm warnings commonly precede their JSON output.
|
|
6
|
+
*
|
|
7
|
+
* @returns The parsed version or `null` when the output contains no version
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractNpmPackageVersionFromOutput(output: string, { isLastMatchPreferred }?: {
|
|
11
|
+
readonly isLastMatchPreferred?: boolean;
|
|
12
|
+
}): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares an installed npm package version with the newest published version.
|
|
3
|
+
*
|
|
4
|
+
* Only the numeric `major.minor.patch` segments are compared and pre-release suffixes are ignored,
|
|
5
|
+
* so a package installed from a pre-release build of the newest version is not reported as outdated.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function isNpmPackageVersionOutdated(installedVersion: string, latestVersion: string): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PromptbookCliInstallationStatus } from './PromptbookCliInstallationStatus';
|
|
2
|
+
/**
|
|
3
|
+
* Checks every local and global Promptbook CLI installation against the newest npm version.
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads installed packages and queries npm
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `promptbookCli`
|
|
8
|
+
*/
|
|
9
|
+
export declare function $checkPromptbookCliInstallations(): Promise<ReadonlyArray<PromptbookCliInstallationStatus>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks local and global Promptbook CLI installations before an interactive coder run and offers to update them.
|
|
3
|
+
*
|
|
4
|
+
* Once an update is approved, the caller must stop the current run and let the user start a fresh process. A local
|
|
5
|
+
* npm update can modify `package.json` and a lockfile, which would make the coder's working-tree preflight fail;
|
|
6
|
+
* more importantly, this Node.js process has already loaded the old CLI implementation.
|
|
7
|
+
*
|
|
8
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads package manifests, queries npm,
|
|
9
|
+
* asks the user, and may install npm packages
|
|
10
|
+
*
|
|
11
|
+
* @returns `true` when an update was approved and the current coder run should stop
|
|
12
|
+
* @private internal utility of `promptbookCli`
|
|
13
|
+
*/
|
|
14
|
+
export declare function $ensurePromptbookCliInstallations(): Promise<boolean>;
|
package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PromptbookCliInstallation } from './PromptbookCliInstallation';
|
|
2
|
+
/**
|
|
3
|
+
* Finds every locally or globally installed Promptbook CLI package which can be updated.
|
|
4
|
+
*
|
|
5
|
+
* A local package must be declared directly in the current project's `package.json`; transitive packages are not
|
|
6
|
+
* updated because this command must not change dependencies chosen by another package.
|
|
7
|
+
*
|
|
8
|
+
* Note: `$` is used to indicate that this function is not a pure function - it reads package manifests and runs npm
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `promptbookCli`
|
|
11
|
+
*/
|
|
12
|
+
export declare function $resolvePromptbookCliInstallations(): Promise<ReadonlyArray<PromptbookCliInstallation>>;
|
package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PromptbookCliInstallationStatus } from './PromptbookCliInstallationStatus';
|
|
2
|
+
/**
|
|
3
|
+
* Updates one Promptbook CLI package in its existing local or global location.
|
|
4
|
+
*
|
|
5
|
+
* Note: `$` is used to indicate that this function is not a pure function - it installs an npm package
|
|
6
|
+
*
|
|
7
|
+
* @returns `true` when the package update succeeds, `false` when it fails
|
|
8
|
+
* @private internal utility of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $updatePromptbookCliInstallation(status: PromptbookCliInstallationStatus): Promise<boolean>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Npm packages which provide an executable Promptbook CLI.
|
|
3
|
+
*
|
|
4
|
+
* `ptbk` is the preferred package and forwards to `@promptbook/cli`; the latter can also be installed directly.
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `promptbookCli`
|
|
7
|
+
*/
|
|
8
|
+
export declare const PROMPTBOOK_CLI_NPM_PACKAGE_NAMES: readonly ["ptbk", "@promptbook/cli"];
|
|
9
|
+
/**
|
|
10
|
+
* Npm package which provides an executable Promptbook CLI.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `promptbookCli`
|
|
13
|
+
*/
|
|
14
|
+
export type PromptbookCliNpmPackageName = (typeof PROMPTBOOK_CLI_NPM_PACKAGE_NAMES)[number];
|
|
15
|
+
/**
|
|
16
|
+
* Place where one Promptbook CLI package is installed.
|
|
17
|
+
*
|
|
18
|
+
* @private internal utility of `promptbookCli`
|
|
19
|
+
*/
|
|
20
|
+
export type PromptbookCliInstallationLocation = 'local-dependency' | 'local-development-dependency' | 'global';
|
|
21
|
+
/**
|
|
22
|
+
* One installed Promptbook CLI package that can be updated.
|
|
23
|
+
*
|
|
24
|
+
* @private internal utility of `promptbookCli`
|
|
25
|
+
*/
|
|
26
|
+
export type PromptbookCliInstallation = {
|
|
27
|
+
/**
|
|
28
|
+
* Npm package that provides the CLI.
|
|
29
|
+
*/
|
|
30
|
+
readonly npmPackageName: PromptbookCliNpmPackageName;
|
|
31
|
+
/**
|
|
32
|
+
* Version from the package's installed `package.json`.
|
|
33
|
+
*/
|
|
34
|
+
readonly installedVersion: string;
|
|
35
|
+
/**
|
|
36
|
+
* Local manifest section or global npm installation containing the package.
|
|
37
|
+
*/
|
|
38
|
+
readonly installationLocation: PromptbookCliInstallationLocation;
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PromptbookCliInstallation } from './PromptbookCliInstallation';
|
|
2
|
+
/**
|
|
3
|
+
* Result of comparing one installed Promptbook CLI package with the newest published version.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export type PromptbookCliInstallationState = 'up-to-date' | 'outdated' | 'unknown';
|
|
8
|
+
/**
|
|
9
|
+
* Version status of one Promptbook CLI installation.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export type PromptbookCliInstallationStatus = {
|
|
14
|
+
/**
|
|
15
|
+
* Installed CLI package being checked.
|
|
16
|
+
*/
|
|
17
|
+
readonly installation: PromptbookCliInstallation;
|
|
18
|
+
/**
|
|
19
|
+
* Result of comparing the installed version with the newest published version.
|
|
20
|
+
*/
|
|
21
|
+
readonly installationState: PromptbookCliInstallationState;
|
|
22
|
+
/**
|
|
23
|
+
* Newest published package version, or `null` when npm could not be reached.
|
|
24
|
+
*/
|
|
25
|
+
readonly latestVersion: string | null;
|
|
26
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromptbookCliInstallation } from './PromptbookCliInstallation';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the npm command that updates one existing Promptbook CLI installation.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildPromptbookCliInstallCommand(installation: PromptbookCliInstallation): string;
|
package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromptbookCliInstallationStatus } from './PromptbookCliInstallationStatus';
|
|
2
|
+
/**
|
|
3
|
+
* Formats the warning shown when one or more Promptbook CLI installations are outdated.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `promptbookCli`
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatPromptbookCliInstallationWarning(statuses: ReadonlyArray<PromptbookCliInstallationStatus>): string;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Claude Code `--output-format stream-json`) into a live runtime log file next to the queued
|
|
6
6
|
* message. This helper extracts the most recent natural-language assistant narration so the
|
|
7
7
|
* durable chat can show what the agent is doing right now instead of a generic thinking
|
|
8
|
-
* placeholder. Only
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* placeholder. Only concrete, safe activity is surfaced; raw tool payloads, JSON envelopes,
|
|
9
|
+
* and private reasoning are intentionally ignored. When no concrete activity is known, this
|
|
10
|
+
* resolves to `null` so the caller keeps the browser's rotating generic thinking state.
|
|
11
11
|
*
|
|
12
12
|
* @param logText - Raw runtime log content.
|
|
13
13
|
* @returns Latest human-readable activity snippet, or `null` when none can be resolved.
|
|
@@ -75,9 +75,12 @@ export type CreateTerminalAgentAvatarVisualOptions = {
|
|
|
75
75
|
*/
|
|
76
76
|
readonly colorDepth?: AsciiArtColorDepth;
|
|
77
77
|
/**
|
|
78
|
-
* Platform-specific canvas factory used to rasterize
|
|
78
|
+
* Platform-specific canvas factory used to rasterize pixel-based visuals.
|
|
79
|
+
*
|
|
80
|
+
* Character-based visuals such as `AsciiOctopus` paint the terminal grid directly, so they
|
|
81
|
+
* render without any canvas; a pixel-based visual renders an empty frame when it is missing.
|
|
79
82
|
*/
|
|
80
|
-
readonly createCanvas
|
|
83
|
+
readonly createCanvas?: CreateCanvasForAsciiArt;
|
|
81
84
|
};
|
|
82
85
|
/**
|
|
83
86
|
* Resolves the built-in avatar visual selected for terminal rendering of one agent source.
|
|
@@ -62,6 +62,12 @@ export type ConvertImageDataToAsciiArtOptions = {
|
|
|
62
62
|
*/
|
|
63
63
|
readonly alphaThreshold?: number;
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Default alpha channel value below which a cell is rendered as terminal background.
|
|
67
|
+
*
|
|
68
|
+
* @private within the repository
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEFAULT_ALPHA_THRESHOLD = 32;
|
|
65
71
|
/**
|
|
66
72
|
* Converts raw RGBA image pixels into colored ASCII art for ANSI terminals.
|
|
67
73
|
*
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AsciiArtColorDepth } from './convertImageDataToAsciiArt';
|
|
2
|
+
/**
|
|
3
|
+
* ANSI escape sequence that resets all colors and attributes.
|
|
4
|
+
*
|
|
5
|
+
* @private within the repository
|
|
6
|
+
*/
|
|
7
|
+
export declare const ANSI_RESET = "\u001B[0m";
|
|
8
|
+
/**
|
|
9
|
+
* One opaque 24-bit color which should be written into an ANSI escape sequence.
|
|
10
|
+
*
|
|
11
|
+
* @private within the repository
|
|
12
|
+
*/
|
|
13
|
+
export type AnsiRgbColor = {
|
|
14
|
+
/**
|
|
15
|
+
* Red channel in the range `[0, 255]`.
|
|
16
|
+
*/
|
|
17
|
+
readonly red: number;
|
|
18
|
+
/**
|
|
19
|
+
* Green channel in the range `[0, 255]`.
|
|
20
|
+
*/
|
|
21
|
+
readonly green: number;
|
|
22
|
+
/**
|
|
23
|
+
* Blue channel in the range `[0, 255]`.
|
|
24
|
+
*/
|
|
25
|
+
readonly blue: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Creates the ANSI escape code that sets the foreground color of following characters.
|
|
29
|
+
*
|
|
30
|
+
* @param color Color painted onto the characters.
|
|
31
|
+
* @param colorDepth Color depth supported by the target terminal.
|
|
32
|
+
* @returns ANSI escape sequence.
|
|
33
|
+
*
|
|
34
|
+
* @private within the repository
|
|
35
|
+
*/
|
|
36
|
+
export declare function createAnsiForegroundColorCode(color: AnsiRgbColor, colorDepth: AsciiArtColorDepth): string;
|
|
37
|
+
/**
|
|
38
|
+
* Creates the ANSI escape code that sets the background color of following characters.
|
|
39
|
+
*
|
|
40
|
+
* @param color Color painted behind the characters.
|
|
41
|
+
* @param colorDepth Color depth supported by the target terminal.
|
|
42
|
+
* @returns ANSI escape sequence.
|
|
43
|
+
*
|
|
44
|
+
* @private within the repository
|
|
45
|
+
*/
|
|
46
|
+
export declare function createAnsiBackgroundColorCode(color: AnsiRgbColor, colorDepth: AsciiArtColorDepth): string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { TODO_any } from '../organization/TODO_any';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates a debounced function that runs after calls have been quiet for the given delay.
|
|
4
4
|
*
|
|
5
5
|
* @public exported from `@promptbook/utils`
|
|
6
6
|
*/
|
|
7
|
-
export declare function debounce<T extends (...args: TODO_any[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void
|
|
7
|
+
export declare function debounce<T extends (...args: TODO_any[]) => void>(fn: T, delay: number): ((...args: Parameters<T>) => void) & {
|
|
8
|
+
cancel: () => void;
|
|
9
|
+
};
|
|
@@ -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.114.0-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.114.0-5`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|