@promptbook/remote-client 0.112.0-64 → 0.112.0-66
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 +90 -10
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +0 -2
- package/esm/src/_packages/core.index.d.ts +2 -2
- package/esm/src/_packages/types.index.d.ts +0 -2
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
- package/esm/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
- package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
- package/esm/src/config.d.ts +3 -3
- package/esm/src/formfactors/index.d.ts +2 -2
- package/esm/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
- package/esm/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
- package/esm/src/utils/files/getPromptbookTempPath.d.ts +24 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +93 -13
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +0 -2
- package/umd/src/_packages/core.index.d.ts +2 -2
- package/umd/src/_packages/types.index.d.ts +0 -2
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
- package/umd/src/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts +1 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
- package/umd/src/config.d.ts +3 -3
- package/umd/src/formfactors/index.d.ts +2 -2
- package/umd/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
- package/umd/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
- package/umd/src/utils/files/getPromptbookTempPath.d.ts +24 -0
- package/umd/src/utils/files/getPromptbookTempPath.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- /package/esm/src/{commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts} +0 -0
- /package/{umd/src/commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → esm/src/utils/files/getPromptbookTempPath.test.d.ts} +0 -0
package/esm/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
2
|
import { randomBytes } from 'crypto';
|
|
3
|
+
import { posix, basename } from 'path';
|
|
3
4
|
import { io } from 'socket.io-client';
|
|
4
5
|
import { SHA256 } from 'crypto-js';
|
|
5
6
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
6
7
|
import { parse, unparse } from 'papaparse';
|
|
7
|
-
import { basename } from 'path';
|
|
8
8
|
|
|
9
9
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
10
10
|
/**
|
|
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
20
20
|
* @generated
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-66';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1231,6 +1231,29 @@ function saturate(amount) {
|
|
|
1231
1231
|
}
|
|
1232
1232
|
// TODO: Maybe implement by mix+hsl
|
|
1233
1233
|
|
|
1234
|
+
/**
|
|
1235
|
+
* Relative directory name without the `./` prefix for Git ignore rules and glob patterns.
|
|
1236
|
+
*
|
|
1237
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1238
|
+
*/
|
|
1239
|
+
const PROMPTBOOK_TEMP_DIRECTORY_NAME = '.promptbook';
|
|
1240
|
+
/**
|
|
1241
|
+
* Builds one project-relative path inside the shared Promptbook working directory.
|
|
1242
|
+
*
|
|
1243
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1244
|
+
*/
|
|
1245
|
+
function getPromptbookTempPath(...pathSegments) {
|
|
1246
|
+
return `./${getPromptbookTempPosixPath(...pathSegments)}`;
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Builds one POSIX path fragment inside the shared Promptbook working directory for globs and generated text files.
|
|
1250
|
+
*
|
|
1251
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1252
|
+
*/
|
|
1253
|
+
function getPromptbookTempPosixPath(...pathSegments) {
|
|
1254
|
+
return posix.join(PROMPTBOOK_TEMP_DIRECTORY_NAME, ...pathSegments);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1234
1257
|
/**
|
|
1235
1258
|
* Returns the same value that is passed as argument.
|
|
1236
1259
|
* No side effects.
|
|
@@ -1357,6 +1380,31 @@ const CONNECTION_TIMEOUT_MS = 7 * 1000;
|
|
|
1357
1380
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
1358
1381
|
*/
|
|
1359
1382
|
const CONNECTION_RETRIES_LIMIT = 5;
|
|
1383
|
+
// <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
|
|
1384
|
+
/**
|
|
1385
|
+
* Where to store the temporary downloads
|
|
1386
|
+
*
|
|
1387
|
+
* Note: When the folder does not exist, it is created recursively
|
|
1388
|
+
*
|
|
1389
|
+
* @public exported from `@promptbook/core`
|
|
1390
|
+
*/
|
|
1391
|
+
getPromptbookTempPath('download-cache');
|
|
1392
|
+
/**
|
|
1393
|
+
* Where to store the cache of executions for promptbook CLI
|
|
1394
|
+
*
|
|
1395
|
+
* Note: When the folder does not exist, it is created recursively
|
|
1396
|
+
*
|
|
1397
|
+
* @public exported from `@promptbook/core`
|
|
1398
|
+
*/
|
|
1399
|
+
getPromptbookTempPath('execution-cache');
|
|
1400
|
+
/**
|
|
1401
|
+
* Where to store the scrape cache
|
|
1402
|
+
*
|
|
1403
|
+
* Note: When the folder does not exist, it is created recursively
|
|
1404
|
+
*
|
|
1405
|
+
* @public exported from `@promptbook/core`
|
|
1406
|
+
*/
|
|
1407
|
+
getPromptbookTempPath('scrape-cache');
|
|
1360
1408
|
// <- TODO: [🧜♂️]
|
|
1361
1409
|
/**
|
|
1362
1410
|
* Default settings for parsing and generating CSV files in Promptbook.
|
|
@@ -4069,8 +4117,10 @@ const ImageGeneratorFormfactorDefinition = {
|
|
|
4069
4117
|
*/
|
|
4070
4118
|
const MatcherFormfactorDefinition = {
|
|
4071
4119
|
name: 'EXPERIMENTAL_MATCHER',
|
|
4072
|
-
description: `
|
|
4073
|
-
|
|
4120
|
+
description: spaceTrim$1(`
|
|
4121
|
+
An evaluation system that determines whether content meets specific criteria or patterns.
|
|
4122
|
+
Used for content validation, quality assessment, and intelligent filtering tasks. Currently in experimental phase.
|
|
4123
|
+
`),
|
|
4074
4124
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/177`,
|
|
4075
4125
|
pipelineInterface: {
|
|
4076
4126
|
inputParameters: [
|
|
@@ -4127,9 +4177,11 @@ const SheetsFormfactorDefinition = {
|
|
|
4127
4177
|
*/
|
|
4128
4178
|
const TranslatorFormfactorDefinition = {
|
|
4129
4179
|
name: 'TRANSLATOR',
|
|
4130
|
-
description: `
|
|
4131
|
-
|
|
4132
|
-
|
|
4180
|
+
description: spaceTrim$1(`
|
|
4181
|
+
A text transformation system that converts input content into different forms,
|
|
4182
|
+
including language translations, paraphrasing, style conversions, and tone adjustments.
|
|
4183
|
+
This form factor takes one input and produces one transformed output.
|
|
4184
|
+
`),
|
|
4133
4185
|
documentationUrl: `https://github.com/webgptorg/promptbook/discussions/175`,
|
|
4134
4186
|
pipelineInterface: {
|
|
4135
4187
|
inputParameters: [
|
|
@@ -5535,12 +5587,21 @@ const QuickChatbotHla = {
|
|
|
5535
5587
|
// <- TODO: [🧠] Make this dynamic, async, prepare-phase HLAs
|
|
5536
5588
|
],
|
|
5537
5589
|
});
|
|
5538
|
-
// TODO: Use spaceTrim in multiline strings
|
|
5539
5590
|
$pipelineJson.tasks.push({
|
|
5540
5591
|
taskType: 'PROMPT_TASK',
|
|
5541
5592
|
name: 'create-an-answer',
|
|
5542
5593
|
title: 'Create an answer',
|
|
5543
|
-
content:
|
|
5594
|
+
content: spaceTrim$1(`
|
|
5595
|
+
Write a response to the user message:
|
|
5596
|
+
|
|
5597
|
+
**Question from user**
|
|
5598
|
+
|
|
5599
|
+
> {userMessage}
|
|
5600
|
+
|
|
5601
|
+
**Previous conversation**
|
|
5602
|
+
|
|
5603
|
+
> {previousConversationSummary}
|
|
5604
|
+
`),
|
|
5544
5605
|
resultingParameterName: 'chatbotResponse',
|
|
5545
5606
|
personaName,
|
|
5546
5607
|
dependentParameterNames: [
|
|
@@ -5552,7 +5613,26 @@ const QuickChatbotHla = {
|
|
|
5552
5613
|
taskType: 'PROMPT_TASK',
|
|
5553
5614
|
name: 'summarize-the-conversation',
|
|
5554
5615
|
title: 'Summarize the conversation',
|
|
5555
|
-
content:
|
|
5616
|
+
content: spaceTrim$1(`
|
|
5617
|
+
Summarize the conversation in a few words:
|
|
5618
|
+
|
|
5619
|
+
## Rules
|
|
5620
|
+
|
|
5621
|
+
- Summarise the text of the conversation in a few words
|
|
5622
|
+
- Convert the text to its basic idea
|
|
5623
|
+
- Imagine you are writing the headline or subject line of an email
|
|
5624
|
+
- Respond with a few words of summary only
|
|
5625
|
+
|
|
5626
|
+
## Conversation
|
|
5627
|
+
|
|
5628
|
+
**User:**
|
|
5629
|
+
|
|
5630
|
+
> {userMessage}
|
|
5631
|
+
|
|
5632
|
+
**You:**
|
|
5633
|
+
|
|
5634
|
+
> {chatbotResponse}
|
|
5635
|
+
`),
|
|
5556
5636
|
resultingParameterName: 'conversationSummary',
|
|
5557
5637
|
personaName,
|
|
5558
5638
|
expectations: {
|