@promptbook/remote-server 0.114.0-5 → 0.114.0-7
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/umd/index.umd.js
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* @generated
|
|
51
51
|
* @see https://github.com/webgptorg/promptbook
|
|
52
52
|
*/
|
|
53
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
53
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-7';
|
|
54
54
|
/**
|
|
55
55
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
56
56
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -11591,6 +11591,13 @@
|
|
|
11591
11591
|
}
|
|
11592
11592
|
|
|
11593
11593
|
/* eslint-disable no-magic-numbers */
|
|
11594
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11595
|
+
/**
|
|
11596
|
+
* Default square size used by avatar renderers.
|
|
11597
|
+
*
|
|
11598
|
+
* @private utility of the avatar rendering system
|
|
11599
|
+
*/
|
|
11600
|
+
const DEFAULT_AVATAR_SIZE = 192;
|
|
11594
11601
|
/**
|
|
11595
11602
|
* Corner radius ratio used for the common rounded card frame.
|
|
11596
11603
|
*
|
|
@@ -11961,6 +11968,15 @@
|
|
|
11961
11968
|
* @private helper of `asciiOctopusAvatarVisual`
|
|
11962
11969
|
*/
|
|
11963
11970
|
const ATMOSPHERE_GLYPHS = ['.', ':', "'", '`'];
|
|
11971
|
+
/**
|
|
11972
|
+
* Coordinate space the octopus layout is generated in when it is painted into a terminal.
|
|
11973
|
+
*
|
|
11974
|
+
* The terminal renderer has its own character grid, so the geometry only needs one stable
|
|
11975
|
+
* square coordinate space which the grid is then sampled from.
|
|
11976
|
+
*
|
|
11977
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
11978
|
+
*/
|
|
11979
|
+
const TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE = DEFAULT_AVATAR_SIZE;
|
|
11964
11980
|
/**
|
|
11965
11981
|
* AsciiOctopus avatar visual.
|
|
11966
11982
|
*
|
|
@@ -11977,41 +11993,115 @@
|
|
|
11977
11993
|
const staticRandom = createRandom('ascii-octopus-static');
|
|
11978
11994
|
const gridMetrics = createAsciiGridMetrics(size, gridRandom);
|
|
11979
11995
|
const layout = createAsciiOctopusLayout(size, timeMs, createRandom, staticRandom, interaction);
|
|
11996
|
+
const glyphGrid = createAsciiOctopusGlyphGrid({
|
|
11997
|
+
sampleGrid: gridMetrics,
|
|
11998
|
+
layout,
|
|
11999
|
+
palette,
|
|
12000
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
12001
|
+
timeMs,
|
|
12002
|
+
});
|
|
11980
12003
|
drawAvatarFrame(context, size, palette);
|
|
11981
12004
|
drawAsciiBackdrop(context, size, palette, layout, timeMs);
|
|
11982
12005
|
context.save();
|
|
11983
12006
|
context.font = `600 ${gridMetrics.fontSize}px monospace`;
|
|
11984
12007
|
context.textAlign = 'center';
|
|
11985
12008
|
context.textBaseline = 'middle';
|
|
11986
|
-
// The ASCII renderer samples the morphing octopus field on a low-resolution grid so the shape stays organic
|
|
11987
|
-
// while the glyph layout remains deterministic for the same avatar input.
|
|
11988
|
-
const cellRandom = createRandom('ascii-octopus-cells');
|
|
11989
12009
|
for (let rowIndex = 0; rowIndex < gridMetrics.rowCount; rowIndex++) {
|
|
11990
12010
|
for (let columnIndex = 0; columnIndex < gridMetrics.columnCount; columnIndex++) {
|
|
11991
|
-
const
|
|
11992
|
-
x: gridMetrics.offsetX + columnIndex * gridMetrics.cellWidth,
|
|
11993
|
-
y: gridMetrics.offsetY + rowIndex * gridMetrics.cellHeight,
|
|
11994
|
-
};
|
|
11995
|
-
const noise = cellRandom();
|
|
11996
|
-
const glyphDescriptor = resolveAsciiGlyph({
|
|
11997
|
-
point,
|
|
11998
|
-
layout,
|
|
11999
|
-
palette,
|
|
12000
|
-
cellWidth: gridMetrics.cellWidth,
|
|
12001
|
-
cellHeight: gridMetrics.cellHeight,
|
|
12002
|
-
noise,
|
|
12003
|
-
timeMs,
|
|
12004
|
-
});
|
|
12011
|
+
const glyphDescriptor = glyphGrid[rowIndex][columnIndex];
|
|
12005
12012
|
if (!glyphDescriptor) {
|
|
12006
12013
|
continue;
|
|
12007
12014
|
}
|
|
12015
|
+
const point = resolveAsciiSampleGridPoint(gridMetrics, columnIndex, rowIndex);
|
|
12008
12016
|
context.fillStyle = glyphDescriptor.color;
|
|
12009
12017
|
context.fillText(glyphDescriptor.character, point.x, point.y);
|
|
12010
12018
|
}
|
|
12011
12019
|
}
|
|
12012
12020
|
context.restore();
|
|
12013
12021
|
},
|
|
12022
|
+
renderTerminalText({ columns, rows, palette, createRandom, timeMs, interaction }) {
|
|
12023
|
+
const staticRandom = createRandom('ascii-octopus-static');
|
|
12024
|
+
const layout = createAsciiOctopusLayout(TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE, timeMs, createRandom, staticRandom, interaction);
|
|
12025
|
+
return createAsciiOctopusGlyphGrid({
|
|
12026
|
+
sampleGrid: createAsciiTerminalSampleGrid(columns, rows),
|
|
12027
|
+
layout,
|
|
12028
|
+
palette,
|
|
12029
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
12030
|
+
timeMs,
|
|
12031
|
+
});
|
|
12032
|
+
},
|
|
12014
12033
|
};
|
|
12034
|
+
/**
|
|
12035
|
+
* Resolves the geometry point sampled for one cell of the grid.
|
|
12036
|
+
*
|
|
12037
|
+
* @param sampleGrid Character-cell sampling grid.
|
|
12038
|
+
* @param columnIndex Zero-based cell column.
|
|
12039
|
+
* @param rowIndex Zero-based cell row.
|
|
12040
|
+
* @returns Sampled point in the octopus coordinate space.
|
|
12041
|
+
*
|
|
12042
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12043
|
+
*/
|
|
12044
|
+
function resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex) {
|
|
12045
|
+
return {
|
|
12046
|
+
x: sampleGrid.offsetX + columnIndex * sampleGrid.cellWidth,
|
|
12047
|
+
y: sampleGrid.offsetY + rowIndex * sampleGrid.cellHeight,
|
|
12048
|
+
};
|
|
12049
|
+
}
|
|
12050
|
+
/**
|
|
12051
|
+
* Builds the sampling grid used when the octopus is painted straight into terminal character cells.
|
|
12052
|
+
*
|
|
12053
|
+
* @param columns Available terminal columns.
|
|
12054
|
+
* @param rows Available terminal rows.
|
|
12055
|
+
* @returns Character-cell sampling grid covering the whole octopus coordinate space.
|
|
12056
|
+
*
|
|
12057
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12058
|
+
*/
|
|
12059
|
+
function createAsciiTerminalSampleGrid(columns, rows) {
|
|
12060
|
+
const cellWidth = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / columns;
|
|
12061
|
+
const cellHeight = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / rows;
|
|
12062
|
+
return {
|
|
12063
|
+
cellWidth,
|
|
12064
|
+
cellHeight,
|
|
12065
|
+
columnCount: columns,
|
|
12066
|
+
rowCount: rows,
|
|
12067
|
+
offsetX: cellWidth / 2,
|
|
12068
|
+
offsetY: cellHeight / 2,
|
|
12069
|
+
};
|
|
12070
|
+
}
|
|
12071
|
+
/**
|
|
12072
|
+
* Samples the morphing octopus field into one deterministic grid of ASCII glyphs.
|
|
12073
|
+
*
|
|
12074
|
+
* The field is sampled on a low-resolution grid so the shape stays organic while the glyph
|
|
12075
|
+
* layout remains deterministic for the same avatar input. Both the canvas visual and the
|
|
12076
|
+
* terminal visual share this single sampling pass so they always describe the same octopus.
|
|
12077
|
+
*
|
|
12078
|
+
* @param options Sampling grid, prepared octopus layout, palette, per-cell noise, and animation time.
|
|
12079
|
+
* @returns Resolved glyph of every sampled cell, where `null` means an empty cell.
|
|
12080
|
+
*
|
|
12081
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
12082
|
+
*/
|
|
12083
|
+
function createAsciiOctopusGlyphGrid(options) {
|
|
12084
|
+
const { sampleGrid, layout, palette, cellRandom, timeMs } = options;
|
|
12085
|
+
const glyphGrid = [];
|
|
12086
|
+
for (let rowIndex = 0; rowIndex < sampleGrid.rowCount; rowIndex++) {
|
|
12087
|
+
const glyphRow = [];
|
|
12088
|
+
for (let columnIndex = 0; columnIndex < sampleGrid.columnCount; columnIndex++) {
|
|
12089
|
+
const point = resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex);
|
|
12090
|
+
const noise = cellRandom();
|
|
12091
|
+
glyphRow.push(resolveAsciiGlyph({
|
|
12092
|
+
point,
|
|
12093
|
+
layout,
|
|
12094
|
+
palette,
|
|
12095
|
+
cellWidth: sampleGrid.cellWidth,
|
|
12096
|
+
cellHeight: sampleGrid.cellHeight,
|
|
12097
|
+
noise,
|
|
12098
|
+
timeMs,
|
|
12099
|
+
}));
|
|
12100
|
+
}
|
|
12101
|
+
glyphGrid.push(glyphRow);
|
|
12102
|
+
}
|
|
12103
|
+
return glyphGrid;
|
|
12104
|
+
}
|
|
12015
12105
|
/**
|
|
12016
12106
|
* Draws the dark terminal-like glow behind the ASCII octopus.
|
|
12017
12107
|
*
|
|
@@ -31683,28 +31773,28 @@
|
|
|
31683
31773
|
*/
|
|
31684
31774
|
function buildToolInvocationScript(options) {
|
|
31685
31775
|
const { functionName, functionArgsExpression } = options;
|
|
31686
|
-
return `
|
|
31687
|
-
|
|
31688
|
-
|
|
31689
|
-
|
|
31690
|
-
|
|
31691
|
-
|
|
31776
|
+
return _spaceTrim.spaceTrim((block) => `
|
|
31777
|
+
const args = ${block(functionArgsExpression)};
|
|
31778
|
+
const runtimeContextRaw =
|
|
31779
|
+
typeof ${TOOL_RUNTIME_CONTEXT_PARAMETER} === 'undefined'
|
|
31780
|
+
? undefined
|
|
31781
|
+
: ${TOOL_RUNTIME_CONTEXT_PARAMETER};
|
|
31692
31782
|
|
|
31693
|
-
|
|
31694
|
-
|
|
31695
|
-
|
|
31783
|
+
if (runtimeContextRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
31784
|
+
args.${TOOL_RUNTIME_CONTEXT_ARGUMENT} = runtimeContextRaw;
|
|
31785
|
+
}
|
|
31696
31786
|
|
|
31697
|
-
|
|
31698
|
-
|
|
31699
|
-
|
|
31700
|
-
|
|
31787
|
+
const toolProgressTokenRaw =
|
|
31788
|
+
typeof ${TOOL_PROGRESS_TOKEN_PARAMETER} === 'undefined'
|
|
31789
|
+
? undefined
|
|
31790
|
+
: ${TOOL_PROGRESS_TOKEN_PARAMETER};
|
|
31701
31791
|
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
|
|
31792
|
+
if (toolProgressTokenRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
31793
|
+
args.${TOOL_PROGRESS_TOKEN_ARGUMENT} = toolProgressTokenRaw;
|
|
31794
|
+
}
|
|
31705
31795
|
|
|
31706
|
-
|
|
31707
|
-
|
|
31796
|
+
return await ${functionName}(args);
|
|
31797
|
+
`);
|
|
31708
31798
|
}
|
|
31709
31799
|
|
|
31710
31800
|
/**
|