@promptbook/remote-server 0.70.0-1 → 0.71.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/README.md +29 -59
- package/esm/index.es.js +24 -13
- package/esm/index.es.js.map +1 -1
- package/esm/typings/promptbook-collection/index.d.ts +0 -3
- package/esm/typings/src/_packages/browser.index.d.ts +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +37 -11
- package/esm/typings/src/_packages/node.index.d.ts +6 -2
- package/esm/typings/src/_packages/types.index.d.ts +40 -20
- package/esm/typings/src/_packages/utils.index.d.ts +4 -4
- package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +2 -2
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
- package/esm/typings/src/cli/main.d.ts +1 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +8 -5
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +3 -7
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +27 -0
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -3
- package/esm/typings/src/commands/FORMAT/formatCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.d.ts +11 -0
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.test.d.ts +4 -0
- package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/TEMPLATE/templateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/URL/urlCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -4
- package/esm/typings/src/config.d.ts +26 -3
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -15
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +2 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +1 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +10 -5
- package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceTools.d.ts +2 -2
- package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceToolsOptions.d.ts +2 -2
- package/esm/typings/src/{knowledge/dialogs → dialogs}/simple-prompt/SimplePromptInterfaceTools.d.ts +4 -4
- package/esm/typings/src/errors/AbstractFormatError.d.ts +11 -0
- package/esm/typings/src/errors/KnowledgeScrapeError.d.ts +9 -0
- package/esm/typings/src/errors/MissingToolsError.d.ts +9 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +3 -3
- package/esm/typings/src/execution/PipelineExecutor.d.ts +1 -0
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +9 -8
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTemplateResult.d.ts +45 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +23 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +29 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +58 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +65 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +74 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +34 -0
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTemplate.d.ts +27 -0
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTemplate.d.ts +30 -0
- package/esm/typings/src/execution/createPipelineExecutor/getSamplesForTemplate.d.ts +10 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +1 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +3 -4
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +14 -15
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +31 -0
- package/esm/typings/src/formats/csv/{ListFormatDefinition.d.ts → CsvFormatDefinition.d.ts} +6 -3
- package/esm/typings/src/formats/csv/CsvFormatError.d.ts +10 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +13 -0
- package/esm/typings/src/formats/index.d.ts +1 -1
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +4 -3
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +19 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromConfigurationFromEnv.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -2
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +8 -1
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +1 -0
- package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +3 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -1
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +2 -1
- package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +3 -0
- package/esm/typings/src/personas/preparePersona.d.ts +3 -3
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +67 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
- package/esm/typings/src/prepare/preparePipeline.d.ts +2 -2
- package/esm/typings/src/prepare/prepareTemplates.d.ts +3 -3
- package/esm/typings/src/scrapers/_common/Converter.d.ts +28 -0
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +71 -0
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +11 -0
- package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.d.ts +4 -4
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +33 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +4 -0
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +10 -0
- package/esm/typings/src/scrapers/document/documentScraper.d.ts +37 -0
- package/esm/typings/src/scrapers/document/documentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document/playground/document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/document-legacy/legacyDocumentScraper.d.ts +37 -0
- package/esm/typings/src/scrapers/document-legacy/legacyDocumentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/index.d.ts +7 -0
- package/esm/typings/src/scrapers/markdown/markdownScraper.d.ts +29 -0
- package/esm/typings/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/pdf/pdfScraper.d.ts +35 -0
- package/esm/typings/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/website/playground/website-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +12 -0
- package/esm/typings/src/scrapers/website/websiteScraper.d.ts +43 -0
- package/esm/typings/src/storage/{files-storage/FilesStorage.d.ts → file-cache-storage/FileCacheStorage.d.ts} +4 -4
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +10 -0
- package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.d.ts +1 -1
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +1 -1
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +1 -1
- package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +9 -2
- package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -0
- package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +3 -3
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +5 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -1
- package/esm/typings/src/types/typeAliases.d.ts +9 -12
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +14 -0
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +17 -0
- package/esm/typings/src/utils/execCommand/IExecCommandOptions.d.ts +23 -0
- package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +10 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +3 -0
- package/esm/typings/src/utils/files/$isDirectoryExisting.d.ts +3 -3
- package/esm/typings/src/utils/files/$isFileExisting.d.ts +3 -3
- package/esm/typings/src/utils/files/$listAllFiles.d.ts +4 -4
- package/esm/typings/src/utils/files/extensionToMimeType.d.ts +8 -0
- package/esm/typings/src/utils/files/getFileExtension.d.ts +8 -0
- package/esm/typings/src/utils/files/getFileExtension.test.d.ts +1 -0
- package/esm/typings/src/utils/organization/{f.d.ts → empty_object.d.ts} +5 -1
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
- package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts} +2 -2
- package/esm/typings/src/utils/parameters/extractParameterNames.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +27 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/{replaceParameters.d.ts → parameters/replaceParameters.d.ts} +2 -2
- package/esm/typings/src/utils/parameters/replaceParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +10 -0
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.test.d.ts +1 -0
- package/package.json +17 -13
- package/umd/index.umd.js +24 -13
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +0 -72
- package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +0 -16
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +0 -37
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +0 -2
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +0 -14
- package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +0 -15
- package/esm/typings/src/prepare/PrepareOptions.d.ts +0 -22
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -10
- /package/esm/typings/src/{knowledge/dialogs → dialogs}/user-interface-execution-tools.test.d.ts +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.test.d.ts +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts → scrapers/markdown/markdownScraper.test.d.ts} +0 -0
- /package/esm/typings/src/{execution/utils/usageToHuman.test.d.ts → scrapers/website/utils/markdownConverter.test.d.ts} +0 -0
- /package/esm/typings/src/{knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts → scrapers/website/websiteScraper.test.d.ts} +0 -0
- /package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.test.d.ts +0 -0
- /package/esm/typings/src/{personas/preparePersona.test.d.ts → utils/execCommand/execCommand.test.d.ts} +0 -0
- /package/esm/typings/src/utils/{extractParameterNames.test.d.ts → execCommand/execCommandNormalizeOptions.test.d.ts} +0 -0
- /package/esm/typings/src/utils/{replaceParameters.test.d.ts → files/extensionToMimeType.test.d.ts} +0 -0
|
@@ -156,7 +156,7 @@ export type string_knowledge_source_content = string_knowledge_source_link | str
|
|
|
156
156
|
*
|
|
157
157
|
* @@@ string_knowledge_source vs string_knowledge_source_link
|
|
158
158
|
*/
|
|
159
|
-
export type string_knowledge_source_link = string_url |
|
|
159
|
+
export type string_knowledge_source_link = string_url | string_filename;
|
|
160
160
|
/**
|
|
161
161
|
* Semantic helper
|
|
162
162
|
*
|
|
@@ -386,6 +386,7 @@ export type string_emails = string;
|
|
|
386
386
|
* - `isValidUuid to check validity
|
|
387
387
|
*
|
|
388
388
|
* For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
|
|
389
|
+
* TODO: [🥬] Make some system for hashes and ids of promptbook
|
|
389
390
|
*/
|
|
390
391
|
export type string_uuid = string & {
|
|
391
392
|
readonly _type: 'uuid';
|
|
@@ -423,37 +424,33 @@ export type string_file_extension = string;
|
|
|
423
424
|
*
|
|
424
425
|
* For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
|
|
425
426
|
*/
|
|
426
|
-
export type
|
|
427
|
+
export type string_absolute_filename = string;
|
|
427
428
|
/**
|
|
428
429
|
* Semantic helper
|
|
429
430
|
*
|
|
430
431
|
* For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
|
|
431
432
|
*/
|
|
432
|
-
export type
|
|
433
|
+
export type string_relative_filename = string;
|
|
433
434
|
/**
|
|
434
435
|
* Semantic helper
|
|
435
436
|
*/
|
|
436
|
-
export type
|
|
437
|
+
export type string_filename = string_absolute_filename | string_relative_filename;
|
|
437
438
|
/**
|
|
438
439
|
* Semantic helper
|
|
439
440
|
*
|
|
440
441
|
* For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
|
|
441
442
|
*/
|
|
442
|
-
export type
|
|
443
|
+
export type string_absolute_dirname = string;
|
|
443
444
|
/**
|
|
444
445
|
* Semantic helper
|
|
445
446
|
*
|
|
446
447
|
* For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
|
|
447
448
|
*/
|
|
448
|
-
export type
|
|
449
|
+
export type string_relative_dirname = string;
|
|
449
450
|
/**
|
|
450
451
|
* Semantic helper
|
|
451
452
|
*/
|
|
452
|
-
export type
|
|
453
|
-
/**
|
|
454
|
-
* Semantic helper
|
|
455
|
-
*/
|
|
456
|
-
export type string_filename = string;
|
|
453
|
+
export type string_dirname = string_absolute_dirname | string_relative_dirname;
|
|
457
454
|
/**
|
|
458
455
|
* Semantic helper
|
|
459
456
|
*
|
|
@@ -592,7 +589,7 @@ export type number_megabytes = number_positive;
|
|
|
592
589
|
export type number_gigabytes = number_positive;
|
|
593
590
|
export type number_terabytes = number_positive;
|
|
594
591
|
/**.
|
|
595
|
-
* TODO: !!! Change "For example" to @example
|
|
592
|
+
* TODO: [main] !!! Change "For example" to @example
|
|
596
593
|
* TODO: !! Change to branded types
|
|
597
594
|
* TODO: Delete type aliases that are not exported or used internally
|
|
598
595
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IExecCommandOptions } from './IExecCommandOptions';
|
|
2
|
+
/**
|
|
3
|
+
* Run one command in a shell
|
|
4
|
+
*
|
|
5
|
+
* Note: There are 2 similar functions in the codebase:
|
|
6
|
+
* - `$execCommand` which runs a single command
|
|
7
|
+
* - `$execCommands` which runs multiple commands
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/node`
|
|
10
|
+
*/
|
|
11
|
+
export declare function $execCommand(options: IExecCommandOptions): Promise<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
14
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run multiple commands in a shell in sequence
|
|
3
|
+
*
|
|
4
|
+
* Note: There are 2 similar functions in the codebase:
|
|
5
|
+
* - `$execCommand` which runs a single command
|
|
6
|
+
* - `$execCommands` which runs multiple commands
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/node`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $execCommands({ commands, cwd, crashOnError, }: {
|
|
11
|
+
readonly commands: string[];
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
readonly crashOnError?: boolean;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
17
|
+
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use sth from type-fest or move this to type helpers
|
|
3
|
+
*/
|
|
4
|
+
type RequiredAndOptional<TBase, TRequired extends keyof TBase, TOptional extends keyof TBase> = Pick<TBase, TRequired> & Partial<Pick<TBase, TOptional>>;
|
|
5
|
+
/**
|
|
6
|
+
* Simple options for `execCommand`
|
|
7
|
+
*
|
|
8
|
+
* TODO: !!!!!! Rename - remove I prefix
|
|
9
|
+
*/
|
|
10
|
+
export type IExecCommandOptions = string | RequiredAndOptional<IExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout'>;
|
|
11
|
+
/**
|
|
12
|
+
* Advanced options for `execCommand`
|
|
13
|
+
*
|
|
14
|
+
* TODO: !!!!!! Rename - remove I prefix
|
|
15
|
+
*/
|
|
16
|
+
export type IExecCommandOptionsAdvanced = {
|
|
17
|
+
readonly command: string;
|
|
18
|
+
readonly args: string[];
|
|
19
|
+
readonly cwd: string;
|
|
20
|
+
readonly crashOnError: boolean;
|
|
21
|
+
readonly timeout: number;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IExecCommandOptions } from './IExecCommandOptions';
|
|
2
|
+
import type { IExecCommandOptionsAdvanced } from './IExecCommandOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Normalize options for `execCommand` and `execCommands`
|
|
5
|
+
*
|
|
6
|
+
* @private internal utility of `execCommand` and `execCommands`
|
|
7
|
+
*/
|
|
8
|
+
export declare function execCommandNormalizeOptions(options: IExecCommandOptions): Pick<IExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & {
|
|
9
|
+
humanReadableCommand: string;
|
|
10
|
+
};
|
|
@@ -6,3 +6,6 @@ import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
|
|
|
6
6
|
* @public exported from `@promptbook/utils`
|
|
7
7
|
*/
|
|
8
8
|
export declare const CountUtils: Record<ExpectationUnit, (text: string) => ExpectationAmount>;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🧠][🤠] This should be probbably as part of `TextFormatDefinition`
|
|
11
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_dirname } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the directory exists
|
|
4
4
|
*
|
|
@@ -6,9 +6,9 @@ import type { string_folder_path } from '../../types/typeAliases';
|
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
8
8
|
*/
|
|
9
|
-
export declare function $isDirectoryExisting(directoryPath:
|
|
9
|
+
export declare function $isDirectoryExisting(directoryPath: string_dirname): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
|
-
* Note: [🟢]
|
|
11
|
+
* Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
12
12
|
* TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
13
13
|
* TODO: [🧠][📂] "directory" vs "folder"
|
|
14
14
|
* TODO: [🖇] What about symlinks?
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the file exists
|
|
4
4
|
*
|
|
@@ -6,9 +6,9 @@ import type { string_file_path } from '../../types/typeAliases';
|
|
|
6
6
|
*
|
|
7
7
|
* @private within the repository
|
|
8
8
|
*/
|
|
9
|
-
export declare function $isFileExisting(
|
|
9
|
+
export declare function $isFileExisting(filename: string_filename): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
|
-
* Note: [🟢]
|
|
11
|
+
* Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
12
12
|
* TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
13
13
|
* TODO: [🖇] What about symlinks?
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { string_dirname } from '../../types/typeAliases';
|
|
2
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Reads all files in the directory
|
|
5
5
|
*
|
|
@@ -10,8 +10,8 @@ import type { string_folder_path } from '../../types/typeAliases';
|
|
|
10
10
|
* @returns List of all files in the directory
|
|
11
11
|
* @private internal function of `createCollectionFromDirectory`
|
|
12
12
|
*/
|
|
13
|
-
export declare function $listAllFiles(path:
|
|
13
|
+
export declare function $listAllFiles(path: string_dirname, isRecursive: boolean): Promise<Array<string_filename>>;
|
|
14
14
|
/**
|
|
15
|
-
* Note: [🟢]
|
|
15
|
+
* Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
|
|
16
16
|
* TODO: [🖇] What about symlinks?
|
|
17
17
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_file_extension } from '../../types/typeAliases';
|
|
2
|
+
import type { string_mime_type } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Convert file extension to mime type
|
|
5
|
+
*
|
|
6
|
+
* @private within the repository
|
|
7
|
+
*/
|
|
8
|
+
export declare function extensionToMimeType(value: string_file_extension): string_mime_type;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { string_filename } from '../../types/typeAliases';
|
|
2
|
+
import type { string_mime_type } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Get the file extension from a file name
|
|
5
|
+
*
|
|
6
|
+
* @private within the repository
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFileExtension(value: string_filename): string_mime_type | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Organizational helper to better mark the place where to really use empty object `{}`
|
|
3
3
|
*
|
|
4
|
+
* Note: There are 2 similar types>
|
|
5
|
+
* - `empty_object` @@@
|
|
6
|
+
* - `just_empty_object` @@@
|
|
7
|
+
*
|
|
4
8
|
* @private within the repository
|
|
5
9
|
*/
|
|
6
|
-
export type
|
|
10
|
+
export type empty_object = {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organizational helper to better @@@@
|
|
3
|
+
*
|
|
4
|
+
* Note: There are 2 similar types>
|
|
5
|
+
* - `empty_object` @@@
|
|
6
|
+
* - `just_empty_object` @@@
|
|
7
|
+
*
|
|
8
|
+
* Note: In most cases, you should use `empty_object`
|
|
9
|
+
*
|
|
10
|
+
* @private within the repository
|
|
11
|
+
*/
|
|
12
|
+
export type just_empty_object = Record<string, never>;
|
package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { string_parameter_name } from '
|
|
2
|
-
import type { string_template } from '
|
|
1
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_template } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Parses the template and returns the list of all parameter names
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
|
+
import type { string_parameter_value } from '../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* @@@
|
|
5
|
+
*/
|
|
6
|
+
type MakeapAvailableToExpectedParametersOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* @@@
|
|
9
|
+
*/
|
|
10
|
+
readonly expectedParameters: Readonly<Record<string_parameter_name, null>>;
|
|
11
|
+
/**
|
|
12
|
+
* @@@
|
|
13
|
+
*/
|
|
14
|
+
readonly availableParameters: Readonly<Record<string_parameter_name, string_parameter_value>>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Maps available parameters to expected parameters
|
|
18
|
+
*
|
|
19
|
+
* The strategy is:
|
|
20
|
+
* 1) @@@
|
|
21
|
+
* 2) @@@
|
|
22
|
+
*
|
|
23
|
+
* @throws {PipelineExecutionError} @@@
|
|
24
|
+
* @private within the repository used in `createPipelineExecutor`
|
|
25
|
+
*/
|
|
26
|
+
export declare function mapAvailableToExpectedParameters(options: MakeapAvailableToExpectedParametersOptions): Readonly<Record<string_parameter_name, string_parameter_value>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Parameters } from '
|
|
2
|
-
import type { string_template } from '
|
|
1
|
+
import type { Parameters } from '../../types/typeAliases';
|
|
2
|
+
import type { string_template } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Replaces parameters in template with values from parameters object
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,6 +22,6 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
22
22
|
export declare function checkSerializableAsJson(name: string_name, value: unknown): void;
|
|
23
23
|
/**
|
|
24
24
|
* TODO: [🧠][🛣] More elegant way to tracking than passing `name`
|
|
25
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
25
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
26
26
|
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
27
27
|
*/
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function isSerializableAsJson(value: unknown): boolean;
|
|
21
21
|
/**
|
|
22
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
22
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
23
23
|
* TODO: [🧠][💺] Can be done this on type-level?
|
|
24
24
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { string_filename } from '../../../types/typeAliases';
|
|
2
2
|
import type { really_unknown } from '../../organization/really_unknown';
|
|
3
3
|
/**
|
|
4
4
|
* Tests if given string is valid URL.
|
|
@@ -6,4 +6,4 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
6
6
|
* Note: This does not check if the file exists only if the path is valid
|
|
7
7
|
* @public exported from `@promptbook/utils`
|
|
8
8
|
*/
|
|
9
|
-
export declare function isValidFilePath(
|
|
9
|
+
export declare function isValidFilePath(filename: really_unknown): filename is string_filename;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Function `validateParameterName` will @@@
|
|
4
|
+
*
|
|
5
|
+
* @param parameterName @@@
|
|
6
|
+
* @returns @@@
|
|
7
|
+
* @throws {ParseError} @@@
|
|
8
|
+
* @private within the repository
|
|
9
|
+
*/
|
|
10
|
+
export declare function validateParameterName(parameterName: string): string_parameter_name;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0-7",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -12,21 +12,25 @@
|
|
|
12
12
|
"Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
|
|
13
13
|
],
|
|
14
14
|
"keywords": [
|
|
15
|
-
"autogpt",
|
|
16
|
-
"openai",
|
|
17
|
-
"gpt-3",
|
|
18
|
-
"gpt-4",
|
|
19
|
-
"chatgpt",
|
|
20
15
|
"ai",
|
|
16
|
+
"llm",
|
|
17
|
+
"prompt",
|
|
18
|
+
"template",
|
|
19
|
+
"language-model",
|
|
20
|
+
"chatgpt",
|
|
21
|
+
"autogpt",
|
|
21
22
|
"machine-learning",
|
|
22
23
|
"natural-language-processing",
|
|
23
24
|
"nlp",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
25
|
+
"openai",
|
|
26
|
+
"gpt-3",
|
|
27
|
+
"gpt-4",
|
|
28
|
+
"gpt-4o",
|
|
29
|
+
"gpt-4o-mini",
|
|
30
|
+
"o1",
|
|
31
|
+
"o1-mini",
|
|
32
|
+
"o1-preview",
|
|
33
|
+
"anthropic"
|
|
30
34
|
],
|
|
31
35
|
"license": "CC-BY-4.0",
|
|
32
36
|
"bugs": {
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"module": "./esm/index.es.js",
|
|
48
52
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
49
53
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.
|
|
54
|
+
"@promptbook/core": "0.71.0-7"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
57
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
/**
|
|
15
15
|
* The version of the Promptbook library
|
|
16
16
|
*/
|
|
17
|
-
var PROMPTBOOK_VERSION = '0.
|
|
18
|
-
// TODO: !!!! List here all the versions and annotate + put into script
|
|
17
|
+
var PROMPTBOOK_VERSION = '0.71.0-6';
|
|
18
|
+
// TODO: [main] !!!! List here all the versions and annotate + put into script
|
|
19
19
|
|
|
20
20
|
/*! *****************************************************************************
|
|
21
21
|
Copyright (c) Microsoft Corporation.
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* TODO: [🧠][🛣] More elegant way to tracking than passing `name`
|
|
328
|
-
* TODO: [🧠] !!! In-memory cache of same values to prevent multiple checks
|
|
328
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
329
329
|
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
330
330
|
*/
|
|
331
331
|
|
|
@@ -361,10 +361,22 @@
|
|
|
361
361
|
'samples',
|
|
362
362
|
'modelName',
|
|
363
363
|
'currentDate',
|
|
364
|
+
// <- TODO: !!!!! list here all command names
|
|
364
365
|
// <- TODO: Add more like 'date', 'modelName',...
|
|
365
366
|
// <- TODO: Add [emoji] + instructions ACRY when adding new reserved parameter
|
|
366
367
|
]);
|
|
367
368
|
// <- TODO: [🧜♂️]
|
|
369
|
+
/**
|
|
370
|
+
* @@@
|
|
371
|
+
*
|
|
372
|
+
* @public exported from `@promptbook/core`
|
|
373
|
+
*/
|
|
374
|
+
Object.freeze({
|
|
375
|
+
delimiter: ',',
|
|
376
|
+
quoteChar: '"',
|
|
377
|
+
newline: '\n',
|
|
378
|
+
skipEmptyLines: true,
|
|
379
|
+
});
|
|
368
380
|
/**
|
|
369
381
|
* @@@
|
|
370
382
|
*
|
|
@@ -604,9 +616,10 @@
|
|
|
604
616
|
});
|
|
605
617
|
Object.defineProperty(MultipleLlmExecutionTools.prototype, "description", {
|
|
606
618
|
get: function () {
|
|
607
|
-
return this.llmExecutionTools
|
|
608
|
-
|
|
609
|
-
.
|
|
619
|
+
return this.llmExecutionTools.map(function (_a, index) {
|
|
620
|
+
var title = _a.title;
|
|
621
|
+
return "".concat(index + 1, ") `").concat(title, "`");
|
|
622
|
+
}).join('\n');
|
|
610
623
|
},
|
|
611
624
|
enumerable: false,
|
|
612
625
|
configurable: true
|
|
@@ -804,9 +817,7 @@
|
|
|
804
817
|
throw new PipelineExecutionError("You have not provided any `LlmExecutionTools`");
|
|
805
818
|
}
|
|
806
819
|
else {
|
|
807
|
-
throw new PipelineExecutionError(spaceTrim__default["default"](function (block) { return "\n You have not provided any `LlmExecutionTools` that support model variant \"".concat(prompt.modelRequirements.modelVariant, "\n\n Available `LlmExecutionTools`:\n ").concat(block(_this.
|
|
808
|
-
.map(function (tools) { return "- ".concat(tools.title, " ").concat(tools.description || ''); })
|
|
809
|
-
.join('\n')), "\n\n "); }));
|
|
820
|
+
throw new PipelineExecutionError(spaceTrim__default["default"](function (block) { return "\n You have not provided any `LlmExecutionTools` that support model variant \"".concat(prompt.modelRequirements.modelVariant, "\"\n\n Available `LlmExecutionTools`:\n ").concat(block(_this.description), "\n\n "); }));
|
|
810
821
|
}
|
|
811
822
|
}
|
|
812
823
|
});
|
|
@@ -1155,10 +1166,10 @@
|
|
|
1155
1166
|
case 1:
|
|
1156
1167
|
_c.trys.push([1, 14, 15, 16]);
|
|
1157
1168
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1158
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: !!! Test
|
|
1169
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1159
1170
|
}
|
|
1160
1171
|
if (isAnonymous === false && !isCollectionModeAllowed) {
|
|
1161
|
-
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: !!! Test
|
|
1172
|
+
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1162
1173
|
}
|
|
1163
1174
|
llmExecutionTools = void 0;
|
|
1164
1175
|
if (!(isAnonymous === true && llmToolsConfiguration !== null)) return [3 /*break*/, 2];
|
|
@@ -1249,10 +1260,10 @@
|
|
|
1249
1260
|
case 1:
|
|
1250
1261
|
_b.trys.push([1, 3, 4, 5]);
|
|
1251
1262
|
if (isAnonymous === true && !isAnonymousModeAllowed) {
|
|
1252
|
-
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: !!! Test
|
|
1263
|
+
throw new PipelineExecutionError("Anonymous mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1253
1264
|
}
|
|
1254
1265
|
if (isAnonymous === false && !isCollectionModeAllowed) {
|
|
1255
|
-
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: !!! Test
|
|
1266
|
+
throw new PipelineExecutionError("Collection mode is not allowed"); // <- TODO: [main] !!! Test
|
|
1256
1267
|
}
|
|
1257
1268
|
llmExecutionTools = void 0;
|
|
1258
1269
|
if (isAnonymous === true) {
|