@promptbook/editable 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 +11 -11
- 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 +11 -11
- 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/editable`
|
|
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
|
@@ -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.105.0
|
|
20
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0';
|
|
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
|
|
@@ -1875,7 +1875,7 @@ const TextFormatParser = {
|
|
|
1875
1875
|
subvalueName: 'LINE',
|
|
1876
1876
|
async mapValues(options) {
|
|
1877
1877
|
const { value, mapCallback, onProgress } = options;
|
|
1878
|
-
const lines = value.split(
|
|
1878
|
+
const lines = value.split(/\r?\n/);
|
|
1879
1879
|
const mappedLines = await Promise.all(lines.map((lineContent, lineNumber, array) =>
|
|
1880
1880
|
// TODO: [🧠] Maybe option to skip empty line
|
|
1881
1881
|
/* not await */ mapCallback({
|
|
@@ -3415,7 +3415,7 @@ function isValidFilePath(filename) {
|
|
|
3415
3415
|
if (typeof filename !== 'string') {
|
|
3416
3416
|
return false;
|
|
3417
3417
|
}
|
|
3418
|
-
if (filename.split(
|
|
3418
|
+
if (filename.split(/\r?\n/).length > 1) {
|
|
3419
3419
|
return false;
|
|
3420
3420
|
}
|
|
3421
3421
|
// Normalize slashes early so heuristics can detect path-like inputs
|
|
@@ -4718,7 +4718,7 @@ function getParserForCommand(command) {
|
|
|
4718
4718
|
Command ${command.type} parser is not found
|
|
4719
4719
|
|
|
4720
4720
|
${block(JSON.stringify(command, null, 4)
|
|
4721
|
-
.split(
|
|
4721
|
+
.split(/\r?\n/)
|
|
4722
4722
|
.map((line) => `> ${line}`)
|
|
4723
4723
|
.join('\n'))}
|
|
4724
4724
|
`));
|
|
@@ -4916,7 +4916,7 @@ function padBook(content) {
|
|
|
4916
4916
|
if (!content) {
|
|
4917
4917
|
return '\n'.repeat(PADDING_LINES);
|
|
4918
4918
|
}
|
|
4919
|
-
const lines = content.split(
|
|
4919
|
+
const lines = content.split(/\r?\n/);
|
|
4920
4920
|
let trailingEmptyLines = 0;
|
|
4921
4921
|
for (let i = lines.length - 1; i >= 0; i--) {
|
|
4922
4922
|
const line = lines[i];
|
|
@@ -4950,7 +4950,7 @@ function isValidEmail(email) {
|
|
|
4950
4950
|
if (typeof email !== 'string') {
|
|
4951
4951
|
return false;
|
|
4952
4952
|
}
|
|
4953
|
-
if (email.split(
|
|
4953
|
+
if (email.split(/\r?\n/).length > 1) {
|
|
4954
4954
|
return false;
|
|
4955
4955
|
}
|
|
4956
4956
|
return /^.+@.+\..+$/.test(email);
|
|
@@ -5008,7 +5008,7 @@ function isFlatPipeline(pipelineString) {
|
|
|
5008
5008
|
pipelineString = removeMarkdownComments(pipelineString);
|
|
5009
5009
|
pipelineString = spaceTrim$2(pipelineString);
|
|
5010
5010
|
const isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
|
|
5011
|
-
//const isLastLineReturnStatement = pipelineString.split(
|
|
5011
|
+
//const isLastLineReturnStatement = pipelineString.split(/\r?\n/).pop()!.split('`').join('').startsWith('->');
|
|
5012
5012
|
const isBacktickBlockUsed = pipelineString.includes('```');
|
|
5013
5013
|
const isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
|
|
5014
5014
|
const isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
|
|
@@ -5033,7 +5033,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5033
5033
|
return pipelineString;
|
|
5034
5034
|
}
|
|
5035
5035
|
pipelineString = spaceTrim$2(pipelineString);
|
|
5036
|
-
const pipelineStringLines = pipelineString.split(
|
|
5036
|
+
const pipelineStringLines = pipelineString.split(/\r?\n/);
|
|
5037
5037
|
const potentialReturnStatement = pipelineStringLines.pop();
|
|
5038
5038
|
let returnStatement;
|
|
5039
5039
|
if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
|
|
@@ -5047,7 +5047,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5047
5047
|
}
|
|
5048
5048
|
const prompt = spaceTrim$2(pipelineStringLines.join('\n'));
|
|
5049
5049
|
let quotedPrompt;
|
|
5050
|
-
if (prompt.split(
|
|
5050
|
+
if (prompt.split(/\r?\n/).length <= 1) {
|
|
5051
5051
|
quotedPrompt = `> ${prompt}`;
|
|
5052
5052
|
}
|
|
5053
5053
|
else {
|
|
@@ -5081,7 +5081,7 @@ function deflatePipeline(pipelineString) {
|
|
|
5081
5081
|
function addPipelineCommand(options) {
|
|
5082
5082
|
const { commandString, pipelineString } = options;
|
|
5083
5083
|
const deflatedPipelineString = deflatePipeline(pipelineString);
|
|
5084
|
-
const lines = deflatedPipelineString.split(
|
|
5084
|
+
const lines = deflatedPipelineString.split(/\r?\n/);
|
|
5085
5085
|
const newLines = [];
|
|
5086
5086
|
let isCommandAdded = false;
|
|
5087
5087
|
for (const line of lines) {
|
|
@@ -5139,7 +5139,7 @@ function addPipelineCommand(options) {
|
|
|
5139
5139
|
*/
|
|
5140
5140
|
function removePipelineCommand(options) {
|
|
5141
5141
|
const { command, pipelineString } = options;
|
|
5142
|
-
const lines = pipelineString.split(
|
|
5142
|
+
const lines = pipelineString.split(/\r?\n/);
|
|
5143
5143
|
// TODO: [🧽] DRY
|
|
5144
5144
|
let currentType = 'MARKDOWN';
|
|
5145
5145
|
const newLines = [];
|