@promptbook/pdf 0.105.0-9 → 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 +13 -13
- 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 +13 -13
- 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/pdf`
|
|
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
|
@@ -24,7 +24,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
24
24
|
* @generated
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.105.0
|
|
27
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.105.0';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1649,7 +1649,7 @@ function isValidFilePath(filename) {
|
|
|
1649
1649
|
if (typeof filename !== 'string') {
|
|
1650
1650
|
return false;
|
|
1651
1651
|
}
|
|
1652
|
-
if (filename.split(
|
|
1652
|
+
if (filename.split(/\r?\n/).length > 1) {
|
|
1653
1653
|
return false;
|
|
1654
1654
|
}
|
|
1655
1655
|
// Normalize slashes early so heuristics can detect path-like inputs
|
|
@@ -1851,7 +1851,7 @@ function isValidEmail(email) {
|
|
|
1851
1851
|
if (typeof email !== 'string') {
|
|
1852
1852
|
return false;
|
|
1853
1853
|
}
|
|
1854
|
-
if (email.split(
|
|
1854
|
+
if (email.split(/\r?\n/).length > 1) {
|
|
1855
1855
|
return false;
|
|
1856
1856
|
}
|
|
1857
1857
|
return /^.+@.+\..+$/.test(email);
|
|
@@ -4828,7 +4828,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
4828
4828
|
|
|
4829
4829
|
The source:
|
|
4830
4830
|
${block(knowledgeSource.knowledgeSourceContent
|
|
4831
|
-
.split(
|
|
4831
|
+
.split(/\r?\n/)
|
|
4832
4832
|
.map((line) => `> ${line}`)
|
|
4833
4833
|
.join('\n'))}
|
|
4834
4834
|
|
|
@@ -4844,7 +4844,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
|
4844
4844
|
|
|
4845
4845
|
The source:
|
|
4846
4846
|
> ${block(knowledgeSource.knowledgeSourceContent
|
|
4847
|
-
.split(
|
|
4847
|
+
.split(/\r?\n/)
|
|
4848
4848
|
.map((line) => `> ${line}`)
|
|
4849
4849
|
.join('\n'))}
|
|
4850
4850
|
|
|
@@ -5545,7 +5545,7 @@ const TextFormatParser = {
|
|
|
5545
5545
|
subvalueName: 'LINE',
|
|
5546
5546
|
async mapValues(options) {
|
|
5547
5547
|
const { value, mapCallback, onProgress } = options;
|
|
5548
|
-
const lines = value.split(
|
|
5548
|
+
const lines = value.split(/\r?\n/);
|
|
5549
5549
|
const mappedLines = await Promise.all(lines.map((lineContent, lineNumber, array) =>
|
|
5550
5550
|
// TODO: [🧠] Maybe option to skip empty line
|
|
5551
5551
|
/* not await */ mapCallback({
|
|
@@ -5750,7 +5750,7 @@ function templateParameters(template, parameters) {
|
|
|
5750
5750
|
parameterValue = parameterValue.replace(/[{}]/g, '\\$&');
|
|
5751
5751
|
if (parameterValue.includes('\n') && /^\s*\W{0,3}\s*$/.test(precol)) {
|
|
5752
5752
|
parameterValue = parameterValue
|
|
5753
|
-
.split(
|
|
5753
|
+
.split(/\r?\n/)
|
|
5754
5754
|
.map((line, index) => (index === 0 ? line : `${precol}${line}`))
|
|
5755
5755
|
.join('\n');
|
|
5756
5756
|
}
|
|
@@ -5786,7 +5786,7 @@ function templateParameters(template, parameters) {
|
|
|
5786
5786
|
*/
|
|
5787
5787
|
function extractAllBlocksFromMarkdown(markdown) {
|
|
5788
5788
|
const codeBlocks = [];
|
|
5789
|
-
const lines = markdown.split(
|
|
5789
|
+
const lines = markdown.split(/\r?\n/);
|
|
5790
5790
|
// Note: [0] Ensure that the last block notated by gt > will be closed
|
|
5791
5791
|
lines.push('');
|
|
5792
5792
|
let currentCodeBlock = null;
|
|
@@ -5921,7 +5921,7 @@ function countLines(text) {
|
|
|
5921
5921
|
}
|
|
5922
5922
|
text = text.replace('\r\n', '\n');
|
|
5923
5923
|
text = text.replace('\r', '\n');
|
|
5924
|
-
const lines = text.split(
|
|
5924
|
+
const lines = text.split(/\r?\n/);
|
|
5925
5925
|
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
5926
5926
|
}
|
|
5927
5927
|
/**
|
|
@@ -6396,13 +6396,13 @@ async function executeAttempts(options) {
|
|
|
6396
6396
|
return `
|
|
6397
6397
|
Attempt ${failure.attemptIndex + 1}:
|
|
6398
6398
|
Error ${((_a = failure.error) === null || _a === void 0 ? void 0 : _a.name) || ''}:
|
|
6399
|
-
${block((_b = failure.error) === null || _b === void 0 ? void 0 : _b.message.split(
|
|
6399
|
+
${block((_b = failure.error) === null || _b === void 0 ? void 0 : _b.message.split(/\r?\n/).map((line) => `> ${line}`).join('\n'))}
|
|
6400
6400
|
|
|
6401
6401
|
Result:
|
|
6402
6402
|
${block(failure.result === null
|
|
6403
6403
|
? 'null'
|
|
6404
6404
|
: spaceTrim$1(failure.result)
|
|
6405
|
-
.split(
|
|
6405
|
+
.split(/\r?\n/)
|
|
6406
6406
|
.map((line) => `> ${line}`)
|
|
6407
6407
|
.join('\n'))}
|
|
6408
6408
|
`;
|
|
@@ -6417,7 +6417,7 @@ async function executeAttempts(options) {
|
|
|
6417
6417
|
|
|
6418
6418
|
The Prompt:
|
|
6419
6419
|
${block((((_a = $ongoingTaskResult.$prompt) === null || _a === void 0 ? void 0 : _a.content) || '')
|
|
6420
|
-
.split(
|
|
6420
|
+
.split(/\r?\n/)
|
|
6421
6421
|
.map((line) => `> ${line}`)
|
|
6422
6422
|
.join('\n'))}
|
|
6423
6423
|
|
|
@@ -7088,7 +7088,7 @@ async function executePipeline(options) {
|
|
|
7088
7088
|
${block(pipelineIdentification)}
|
|
7089
7089
|
|
|
7090
7090
|
${block(JSON.stringify(newOngoingResult, null, 4)
|
|
7091
|
-
.split(
|
|
7091
|
+
.split(/\r?\n/)
|
|
7092
7092
|
.map((line) => `> ${line}`)
|
|
7093
7093
|
.join('\n'))}
|
|
7094
7094
|
`));
|