@promptbook/remote-client 0.105.0-8 → 0.105.0
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 +0 -4
- package/esm/index.es.js +15 -15
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/browser.index.d.ts +2 -0
- package/esm/typings/src/_packages/components.index.d.ts +20 -0
- package/esm/typings/src/_packages/core.index.d.ts +21 -11
- package/esm/typings/src/_packages/node.index.d.ts +2 -0
- package/esm/typings/src/_packages/openai.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +32 -2
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +10 -1
- package/esm/typings/src/book-2.0/agent-source/parseTeamCommitment.d.ts +28 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/AgentChip/AgentChip.d.ts +67 -0
- package/esm/typings/src/book-components/Chat/AgentChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +33 -1
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +87 -6
- package/esm/typings/src/book-components/Chat/Chat/ChatSoundToggle.d.ts +23 -0
- package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -0
- package/esm/typings/src/book-components/Chat/LlmChat/FriendlyErrorMessage.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
- package/esm/typings/src/book-components/Chat/SourceChip/SourceChip.d.ts +35 -0
- package/esm/typings/src/book-components/Chat/SourceChip/index.d.ts +2 -0
- package/esm/typings/src/book-components/Chat/effects/ChatEffectsSystem.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/components/HeartsEffect.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/configs/defaultEffectConfigs.d.ts +7 -0
- package/esm/typings/src/book-components/Chat/effects/index.d.ts +18 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffect.d.ts +20 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectConfig.d.ts +21 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectType.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/effects/types/ChatEffectsSystemProps.d.ts +32 -0
- package/esm/typings/src/book-components/Chat/effects/utils/detectEffects.d.ts +12 -0
- package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +34 -6
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +8 -0
- package/esm/typings/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +12 -0
- package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +40 -0
- package/esm/typings/src/book-components/Chat/utils/loadAgentProfile.d.ts +69 -0
- package/esm/typings/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +53 -0
- package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.d.ts +11 -0
- package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +64 -0
- package/esm/typings/src/book-components/icons/EmailIcon.d.ts +15 -0
- package/esm/typings/src/commitments/TEAM/TEAM.d.ts +45 -0
- package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.d.ts +44 -0
- package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +19 -1
- package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +22 -0
- package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +13 -0
- package/esm/typings/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +48 -0
- package/esm/typings/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +11 -0
- package/esm/typings/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +18 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +46 -0
- package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +5 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +6 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
- package/esm/typings/src/commitments/_common/commitmentToolFunctions.d.ts +26 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentDefinitions.d.ts +8 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentTypes.d.ts +8 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForBrowser.d.ts +9 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +13 -0
- package/esm/typings/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +7 -0
- package/esm/typings/src/commitments/_common/getCommitmentDefinition.d.ts +10 -0
- package/esm/typings/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +17 -0
- package/esm/typings/src/commitments/_common/isCommitmentSupported.d.ts +9 -0
- package/esm/typings/src/commitments/index.d.ts +5 -58
- package/esm/typings/src/config.d.ts +6 -0
- package/esm/typings/src/constants.d.ts +129 -0
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +5 -4
- package/esm/typings/src/execution/PromptResult.d.ts +2 -19
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +15 -1
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +6 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +5 -0
- package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAgentExecutionTools.d.ts +43 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +4 -2
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/createOpenAiAgentExecutionTools.d.ts +11 -0
- package/esm/typings/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +7 -0
- package/esm/typings/src/pipeline/prompt-notation.d.ts +27 -2
- package/esm/typings/src/pipeline/prompt-notation.test.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideScriptingForNode.d.ts +1 -0
- package/esm/typings/src/search-engines/SearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +1 -1
- package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +1 -1
- package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +3 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +6 -0
- package/esm/typings/src/types/Prompt.d.ts +12 -0
- package/esm/typings/src/types/ToolCall.d.ts +37 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -2
- package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
- package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
- package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +1 -3
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -2
- package/esm/typings/src/utils/misc/linguisticHash.d.ts +4 -1
- package/esm/typings/src/utils/parameters/templateParameters.d.ts +1 -2
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/wizard.d.ts +1 -4
- package/package.json +2 -2
- package/umd/index.umd.js +15 -15
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -27,10 +27,6 @@ Turn your company's scattered knowledge into AI ready Books
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
<blockquote style="color: #ff8811">
|
|
31
|
-
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
32
|
-
</blockquote>
|
|
33
|
-
|
|
34
30
|
## 📦 Package `@promptbook/remote-client`
|
|
35
31
|
|
|
36
32
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
package/esm/index.es.js
CHANGED
|
@@ -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.105.0
|
|
23
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0';
|
|
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
|
|
@@ -1670,7 +1670,7 @@ function isValidFilePath(filename) {
|
|
|
1670
1670
|
if (typeof filename !== 'string') {
|
|
1671
1671
|
return false;
|
|
1672
1672
|
}
|
|
1673
|
-
if (filename.split(
|
|
1673
|
+
if (filename.split(/\r?\n/).length > 1) {
|
|
1674
1674
|
return false;
|
|
1675
1675
|
}
|
|
1676
1676
|
// Normalize slashes early so heuristics can detect path-like inputs
|
|
@@ -3028,7 +3028,7 @@ const TextFormatParser = {
|
|
|
3028
3028
|
subvalueName: 'LINE',
|
|
3029
3029
|
async mapValues(options) {
|
|
3030
3030
|
const { value, mapCallback, onProgress } = options;
|
|
3031
|
-
const lines = value.split(
|
|
3031
|
+
const lines = value.split(/\r?\n/);
|
|
3032
3032
|
const mappedLines = await Promise.all(lines.map((lineContent, lineNumber, array) =>
|
|
3033
3033
|
// TODO: [🧠] Maybe option to skip empty line
|
|
3034
3034
|
/* not await */ mapCallback({
|
|
@@ -5141,7 +5141,7 @@ function getParserForCommand(command) {
|
|
|
5141
5141
|
Command ${command.type} parser is not found
|
|
5142
5142
|
|
|
5143
5143
|
${block(JSON.stringify(command, null, 4)
|
|
5144
|
-
.split(
|
|
5144
|
+
.split(/\r?\n/)
|
|
5145
5145
|
.map((line) => `> ${line}`)
|
|
5146
5146
|
.join('\n'))}
|
|
5147
5147
|
`));
|
|
@@ -5567,7 +5567,7 @@ function isValidEmail(email) {
|
|
|
5567
5567
|
if (typeof email !== 'string') {
|
|
5568
5568
|
return false;
|
|
5569
5569
|
}
|
|
5570
|
-
if (email.split(
|
|
5570
|
+
if (email.split(/\r?\n/).length > 1) {
|
|
5571
5571
|
return false;
|
|
5572
5572
|
}
|
|
5573
5573
|
return /^.+@.+\..+$/.test(email);
|
|
@@ -5629,7 +5629,7 @@ function padBook(content) {
|
|
|
5629
5629
|
if (!content) {
|
|
5630
5630
|
return '\n'.repeat(PADDING_LINES);
|
|
5631
5631
|
}
|
|
5632
|
-
const lines = content.split(
|
|
5632
|
+
const lines = content.split(/\r?\n/);
|
|
5633
5633
|
let trailingEmptyLines = 0;
|
|
5634
5634
|
for (let i = lines.length - 1; i >= 0; i--) {
|
|
5635
5635
|
const line = lines[i];
|
|
@@ -5675,7 +5675,7 @@ function isFlatPipeline(pipelineString) {
|
|
|
5675
5675
|
pipelineString = removeMarkdownComments(pipelineString);
|
|
5676
5676
|
pipelineString = spaceTrim$2(pipelineString);
|
|
5677
5677
|
const isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
|
|
5678
|
-
//const isLastLineReturnStatement = pipelineString.split(
|
|
5678
|
+
//const isLastLineReturnStatement = pipelineString.split(/\r?\n/).pop()!.split('`').join('').startsWith('->');
|
|
5679
5679
|
const isBacktickBlockUsed = pipelineString.includes('```');
|
|
5680
5680
|
const isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
|
|
5681
5681
|
const isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
|
|
@@ -5700,7 +5700,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5700
5700
|
return pipelineString;
|
|
5701
5701
|
}
|
|
5702
5702
|
pipelineString = spaceTrim$2(pipelineString);
|
|
5703
|
-
const pipelineStringLines = pipelineString.split(
|
|
5703
|
+
const pipelineStringLines = pipelineString.split(/\r?\n/);
|
|
5704
5704
|
const potentialReturnStatement = pipelineStringLines.pop();
|
|
5705
5705
|
let returnStatement;
|
|
5706
5706
|
if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
|
|
@@ -5714,7 +5714,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5714
5714
|
}
|
|
5715
5715
|
const prompt = spaceTrim$2(pipelineStringLines.join('\n'));
|
|
5716
5716
|
let quotedPrompt;
|
|
5717
|
-
if (prompt.split(
|
|
5717
|
+
if (prompt.split(/\r?\n/).length <= 1) {
|
|
5718
5718
|
quotedPrompt = `> ${prompt}`;
|
|
5719
5719
|
}
|
|
5720
5720
|
else {
|
|
@@ -5753,7 +5753,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5753
5753
|
* @public exported from `@promptbook/markdown-utils`
|
|
5754
5754
|
*/
|
|
5755
5755
|
function extractAllListItemsFromMarkdown(markdown) {
|
|
5756
|
-
const lines = markdown.split(
|
|
5756
|
+
const lines = markdown.split(/\r?\n/);
|
|
5757
5757
|
const listItems = [];
|
|
5758
5758
|
let isInCodeBlock = false;
|
|
5759
5759
|
for (const line of lines) {
|
|
@@ -5796,7 +5796,7 @@ function capitalize(word) {
|
|
|
5796
5796
|
*/
|
|
5797
5797
|
function extractAllBlocksFromMarkdown(markdown) {
|
|
5798
5798
|
const codeBlocks = [];
|
|
5799
|
-
const lines = markdown.split(
|
|
5799
|
+
const lines = markdown.split(/\r?\n/);
|
|
5800
5800
|
// Note: [0] Ensure that the last block notated by gt > will be closed
|
|
5801
5801
|
lines.push('');
|
|
5802
5802
|
let currentCodeBlock = null;
|
|
@@ -5884,7 +5884,7 @@ function extractOneBlockFromMarkdown(markdown) {
|
|
|
5884
5884
|
*/
|
|
5885
5885
|
function parseMarkdownSection(value) {
|
|
5886
5886
|
var _a, _b;
|
|
5887
|
-
const lines = value.split(
|
|
5887
|
+
const lines = value.split(/\r?\n/);
|
|
5888
5888
|
if (!lines[0].startsWith('#')) {
|
|
5889
5889
|
throw new ParseError('Markdown section must start with heading');
|
|
5890
5890
|
}
|
|
@@ -5909,7 +5909,7 @@ function parseMarkdownSection(value) {
|
|
|
5909
5909
|
* @public exported from `@promptbook/markdown-utils`
|
|
5910
5910
|
*/
|
|
5911
5911
|
function splitMarkdownIntoSections(markdown) {
|
|
5912
|
-
const lines = markdown.split(
|
|
5912
|
+
const lines = markdown.split(/\r?\n/);
|
|
5913
5913
|
const sections = [];
|
|
5914
5914
|
// TODO: [🧽] DRY
|
|
5915
5915
|
let currentType = 'MARKDOWN';
|
|
@@ -6221,7 +6221,7 @@ function parsePipeline(pipelineString) {
|
|
|
6221
6221
|
// ==============
|
|
6222
6222
|
// Note: 1️⃣◽1️⃣ Remove #!shebang and comments
|
|
6223
6223
|
if (pipelineString.startsWith('#!')) {
|
|
6224
|
-
const [shebangLine, ...restLines] = pipelineString.split(
|
|
6224
|
+
const [shebangLine, ...restLines] = pipelineString.split(/\r?\n/);
|
|
6225
6225
|
if (!(shebangLine || '').includes('ptbk')) {
|
|
6226
6226
|
throw new ParseError(spaceTrim$1((block) => `
|
|
6227
6227
|
It seems that you try to parse a book file which has non-standard shebang line for book files:
|
|
@@ -6423,7 +6423,7 @@ function parsePipeline(pipelineString) {
|
|
|
6423
6423
|
content,
|
|
6424
6424
|
// <- TODO: [🍙] Some standard order of properties
|
|
6425
6425
|
};
|
|
6426
|
-
const lastLine = section.content.split(
|
|
6426
|
+
const lastLine = section.content.split(/\r?\n/).pop();
|
|
6427
6427
|
const resultingParameterNameMatch = /^->\s*\{(?<resultingParamName>[a-z0-9_]+)\}/im.exec(lastLine);
|
|
6428
6428
|
if (resultingParameterNameMatch &&
|
|
6429
6429
|
resultingParameterNameMatch.groups !== undefined &&
|