@promptbook/remote-server 0.114.0-5 → 0.114.0-8
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 +127 -37
- package/esm/index.es.js.map +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 +12 -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/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 +126 -36
- package/umd/index.umd.js.map +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 +12 -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/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/esm/index.es.js
CHANGED
|
@@ -34,7 +34,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
34
34
|
* @generated
|
|
35
35
|
* @see https://github.com/webgptorg/promptbook
|
|
36
36
|
*/
|
|
37
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
37
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-8';
|
|
38
38
|
/**
|
|
39
39
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
40
40
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11575,6 +11575,13 @@ function darken(amount) {
|
|
|
11575
11575
|
}
|
|
11576
11576
|
|
|
11577
11577
|
/* eslint-disable no-magic-numbers */
|
|
11578
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11579
|
+
/**
|
|
11580
|
+
* Default square size used by avatar renderers.
|
|
11581
|
+
*
|
|
11582
|
+
* @private utility of the avatar rendering system
|
|
11583
|
+
*/
|
|
11584
|
+
const DEFAULT_AVATAR_SIZE = 192;
|
|
11578
11585
|
/**
|
|
11579
11586
|
* Corner radius ratio used for the common rounded card frame.
|
|
11580
11587
|
*
|
|
@@ -11945,6 +11952,15 @@ const OUTLINE_GLYPHS = ['#', '%', '@'];
|
|
|
11945
11952
|
* @private helper of `asciiOctopusAvatarVisual`
|
|
11946
11953
|
*/
|
|
11947
11954
|
const ATMOSPHERE_GLYPHS = ['.', ':', "'", '`'];
|
|
11955
|
+
/**
|
|
11956
|
+
* Coordinate space the octopus layout is generated in when it is painted into a terminal.
|
|
11957
|
+
*
|
|
11958
|
+
* The terminal renderer has its own character grid, so the geometry only needs one stable
|
|
11959
|
+
* square coordinate space which the grid is then sampled from.
|
|
11960
|
+
*
|
|
11961
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
11962
|
+
*/
|
|
11963
|
+
const TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE = DEFAULT_AVATAR_SIZE;
|
|
11948
11964
|
/**
|
|
11949
11965
|
* AsciiOctopus avatar visual.
|
|
11950
11966
|
*
|
|
@@ -11961,41 +11977,115 @@ const asciiOctopusAvatarVisual = {
|
|
|
11961
11977
|
const staticRandom = createRandom('ascii-octopus-static');
|
|
11962
11978
|
const gridMetrics = createAsciiGridMetrics(size, gridRandom);
|
|
11963
11979
|
const layout = createAsciiOctopusLayout(size, timeMs, createRandom, staticRandom, interaction);
|
|
11980
|
+
const glyphGrid = createAsciiOctopusGlyphGrid({
|
|
11981
|
+
sampleGrid: gridMetrics,
|
|
11982
|
+
layout,
|
|
11983
|
+
palette,
|
|
11984
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
11985
|
+
timeMs,
|
|
11986
|
+
});
|
|
11964
11987
|
drawAvatarFrame(context, size, palette);
|
|
11965
11988
|
drawAsciiBackdrop(context, size, palette, layout, timeMs);
|
|
11966
11989
|
context.save();
|
|
11967
11990
|
context.font = `600 ${gridMetrics.fontSize}px monospace`;
|
|
11968
11991
|
context.textAlign = 'center';
|
|
11969
11992
|
context.textBaseline = 'middle';
|
|
11970
|
-
// The ASCII renderer samples the morphing octopus field on a low-resolution grid so the shape stays organic
|
|
11971
|
-
// while the glyph layout remains deterministic for the same avatar input.
|
|
11972
|
-
const cellRandom = createRandom('ascii-octopus-cells');
|
|
11973
11993
|
for (let rowIndex = 0; rowIndex < gridMetrics.rowCount; rowIndex++) {
|
|
11974
11994
|
for (let columnIndex = 0; columnIndex < gridMetrics.columnCount; columnIndex++) {
|
|
11975
|
-
const
|
|
11976
|
-
x: gridMetrics.offsetX + columnIndex * gridMetrics.cellWidth,
|
|
11977
|
-
y: gridMetrics.offsetY + rowIndex * gridMetrics.cellHeight,
|
|
11978
|
-
};
|
|
11979
|
-
const noise = cellRandom();
|
|
11980
|
-
const glyphDescriptor = resolveAsciiGlyph({
|
|
11981
|
-
point,
|
|
11982
|
-
layout,
|
|
11983
|
-
palette,
|
|
11984
|
-
cellWidth: gridMetrics.cellWidth,
|
|
11985
|
-
cellHeight: gridMetrics.cellHeight,
|
|
11986
|
-
noise,
|
|
11987
|
-
timeMs,
|
|
11988
|
-
});
|
|
11995
|
+
const glyphDescriptor = glyphGrid[rowIndex][columnIndex];
|
|
11989
11996
|
if (!glyphDescriptor) {
|
|
11990
11997
|
continue;
|
|
11991
11998
|
}
|
|
11999
|
+
const point = resolveAsciiSampleGridPoint(gridMetrics, columnIndex, rowIndex);
|
|
11992
12000
|
context.fillStyle = glyphDescriptor.color;
|
|
11993
12001
|
context.fillText(glyphDescriptor.character, point.x, point.y);
|
|
11994
12002
|
}
|
|
11995
12003
|
}
|
|
11996
12004
|
context.restore();
|
|
11997
12005
|
},
|
|
12006
|
+
renderTerminalText({ columns, rows, palette, createRandom, timeMs, interaction }) {
|
|
12007
|
+
const staticRandom = createRandom('ascii-octopus-static');
|
|
12008
|
+
const layout = createAsciiOctopusLayout(TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE, timeMs, createRandom, staticRandom, interaction);
|
|
12009
|
+
return createAsciiOctopusGlyphGrid({
|
|
12010
|
+
sampleGrid: createAsciiTerminalSampleGrid(columns, rows),
|
|
12011
|
+
layout,
|
|
12012
|
+
palette,
|
|
12013
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
12014
|
+
timeMs,
|
|
12015
|
+
});
|
|
12016
|
+
},
|
|
11998
12017
|
};
|
|
12018
|
+
/**
|
|
12019
|
+
* Resolves the geometry point sampled for one cell of the grid.
|
|
12020
|
+
*
|
|
12021
|
+
* @param sampleGrid Character-cell sampling grid.
|
|
12022
|
+
* @param columnIndex Zero-based cell column.
|
|
12023
|
+
* @param rowIndex Zero-based cell row.
|
|
12024
|
+
* @returns Sampled point in the octopus coordinate space.
|
|
12025
|
+
*
|
|
12026
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12027
|
+
*/
|
|
12028
|
+
function resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex) {
|
|
12029
|
+
return {
|
|
12030
|
+
x: sampleGrid.offsetX + columnIndex * sampleGrid.cellWidth,
|
|
12031
|
+
y: sampleGrid.offsetY + rowIndex * sampleGrid.cellHeight,
|
|
12032
|
+
};
|
|
12033
|
+
}
|
|
12034
|
+
/**
|
|
12035
|
+
* Builds the sampling grid used when the octopus is painted straight into terminal character cells.
|
|
12036
|
+
*
|
|
12037
|
+
* @param columns Available terminal columns.
|
|
12038
|
+
* @param rows Available terminal rows.
|
|
12039
|
+
* @returns Character-cell sampling grid covering the whole octopus coordinate space.
|
|
12040
|
+
*
|
|
12041
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12042
|
+
*/
|
|
12043
|
+
function createAsciiTerminalSampleGrid(columns, rows) {
|
|
12044
|
+
const cellWidth = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / columns;
|
|
12045
|
+
const cellHeight = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / rows;
|
|
12046
|
+
return {
|
|
12047
|
+
cellWidth,
|
|
12048
|
+
cellHeight,
|
|
12049
|
+
columnCount: columns,
|
|
12050
|
+
rowCount: rows,
|
|
12051
|
+
offsetX: cellWidth / 2,
|
|
12052
|
+
offsetY: cellHeight / 2,
|
|
12053
|
+
};
|
|
12054
|
+
}
|
|
12055
|
+
/**
|
|
12056
|
+
* Samples the morphing octopus field into one deterministic grid of ASCII glyphs.
|
|
12057
|
+
*
|
|
12058
|
+
* The field is sampled on a low-resolution grid so the shape stays organic while the glyph
|
|
12059
|
+
* layout remains deterministic for the same avatar input. Both the canvas visual and the
|
|
12060
|
+
* terminal visual share this single sampling pass so they always describe the same octopus.
|
|
12061
|
+
*
|
|
12062
|
+
* @param options Sampling grid, prepared octopus layout, palette, per-cell noise, and animation time.
|
|
12063
|
+
* @returns Resolved glyph of every sampled cell, where `null` means an empty cell.
|
|
12064
|
+
*
|
|
12065
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12066
|
+
*/
|
|
12067
|
+
function createAsciiOctopusGlyphGrid(options) {
|
|
12068
|
+
const { sampleGrid, layout, palette, cellRandom, timeMs } = options;
|
|
12069
|
+
const glyphGrid = [];
|
|
12070
|
+
for (let rowIndex = 0; rowIndex < sampleGrid.rowCount; rowIndex++) {
|
|
12071
|
+
const glyphRow = [];
|
|
12072
|
+
for (let columnIndex = 0; columnIndex < sampleGrid.columnCount; columnIndex++) {
|
|
12073
|
+
const point = resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex);
|
|
12074
|
+
const noise = cellRandom();
|
|
12075
|
+
glyphRow.push(resolveAsciiGlyph({
|
|
12076
|
+
point,
|
|
12077
|
+
layout,
|
|
12078
|
+
palette,
|
|
12079
|
+
cellWidth: sampleGrid.cellWidth,
|
|
12080
|
+
cellHeight: sampleGrid.cellHeight,
|
|
12081
|
+
noise,
|
|
12082
|
+
timeMs,
|
|
12083
|
+
}));
|
|
12084
|
+
}
|
|
12085
|
+
glyphGrid.push(glyphRow);
|
|
12086
|
+
}
|
|
12087
|
+
return glyphGrid;
|
|
12088
|
+
}
|
|
11999
12089
|
/**
|
|
12000
12090
|
* Draws the dark terminal-like glow behind the ASCII octopus.
|
|
12001
12091
|
*
|
|
@@ -31667,28 +31757,28 @@ function parseToolExecutionEnvelope(rawValue) {
|
|
|
31667
31757
|
*/
|
|
31668
31758
|
function buildToolInvocationScript(options) {
|
|
31669
31759
|
const { functionName, functionArgsExpression } = options;
|
|
31670
|
-
return `
|
|
31671
|
-
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
31675
|
-
|
|
31676
|
-
|
|
31677
|
-
|
|
31678
|
-
|
|
31679
|
-
|
|
31760
|
+
return spaceTrim$1((block) => `
|
|
31761
|
+
const args = ${block(functionArgsExpression)};
|
|
31762
|
+
const runtimeContextRaw =
|
|
31763
|
+
typeof ${TOOL_RUNTIME_CONTEXT_PARAMETER} === 'undefined'
|
|
31764
|
+
? undefined
|
|
31765
|
+
: ${TOOL_RUNTIME_CONTEXT_PARAMETER};
|
|
31766
|
+
|
|
31767
|
+
if (runtimeContextRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
31768
|
+
args.${TOOL_RUNTIME_CONTEXT_ARGUMENT} = runtimeContextRaw;
|
|
31769
|
+
}
|
|
31680
31770
|
|
|
31681
|
-
|
|
31682
|
-
|
|
31683
|
-
|
|
31684
|
-
|
|
31771
|
+
const toolProgressTokenRaw =
|
|
31772
|
+
typeof ${TOOL_PROGRESS_TOKEN_PARAMETER} === 'undefined'
|
|
31773
|
+
? undefined
|
|
31774
|
+
: ${TOOL_PROGRESS_TOKEN_PARAMETER};
|
|
31685
31775
|
|
|
31686
|
-
|
|
31687
|
-
|
|
31688
|
-
|
|
31776
|
+
if (toolProgressTokenRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
31777
|
+
args.${TOOL_PROGRESS_TOKEN_ARGUMENT} = toolProgressTokenRaw;
|
|
31778
|
+
}
|
|
31689
31779
|
|
|
31690
|
-
|
|
31691
|
-
|
|
31780
|
+
return await ${functionName}(args);
|
|
31781
|
+
`);
|
|
31692
31782
|
}
|
|
31693
31783
|
|
|
31694
31784
|
/**
|