New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

@promptbook/core

Package Overview
Dependencies
Maintainers
1
Versions
577
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@promptbook/core - npm Package Compare versions

Comparing version 0.35.1 to 0.36.1

esm/typings/classes/PromptbookLibrary.d.ts

16

esm/typings/_packages/core.index.d.ts

@@ -1,6 +0,5 @@

import { PromptTemplatePipelineLibrary } from '../classes/PromptTemplatePipelineLibrary';
import { PTBK_VERSION } from '../version';
import { promptTemplatePipelineStringToJson } from '../conversion/promptTemplatePipelineStringToJson';
import { validatePromptTemplatePipelineJson } from '../conversion/validatePromptTemplatePipelineJson';
import { createPtpExecutor } from '../execution/createPtpExecutor';
import { PromptbookLibrary } from '../classes/PromptbookLibrary';
import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
import { validatePromptbookJson } from '../conversion/validatePromptbookJson';
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';

@@ -11,7 +10,8 @@ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';

import { ExecutionTypes } from '../types/ExecutionTypes';
export { ExecutionTypes, PTBK_VERSION, PromptTemplatePipelineLibrary };
import { PROMPTBOOK_VERSION } from '../version';
export { ExecutionTypes, PROMPTBOOK_VERSION, PromptbookLibrary };
export { SimplePromptInterfaceTools };
export { promptTemplatePipelineStringToJson, validatePromptTemplatePipelineJson };
export { promptbookStringToJson, validatePromptbookJson };
export { MockedEchoNaturalExecutionTools };
export { createPtpExecutor };
export { createPromptbookExecutor };
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
import { RemoteServerOptions } from '../execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions';
import { runRemoteServer } from '../execution/plugins/natural-execution-tools/remote/runRemoteServer';
export { RemoteServerOptions, runRemoteServer };
import { startRemoteServer } from '../execution/plugins/natural-execution-tools/remote/startRemoteServer';
export { RemoteServerOptions, startRemoteServer };

@@ -5,3 +5,3 @@ import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';

import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult } from '../execution/PromptResult';
import type { PtpExecutor } from '../execution/PtpExecutor';
import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';

@@ -13,6 +13,6 @@ import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';

import type { Prompt } from '../types/Prompt';
import type { EXPECTATION_UNITS, ExpectationAmount, ExpectationUnit, PromptTemplateJson } from '../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { PromptTemplateParameterJson } from '../types/PromptTemplatePipelineJson/PromptTemplateParameterJson';
import type { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
import type { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
import type { EXPECTATION_UNITS, ExpectationAmount, ExpectationUnit, PromptTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
import type { PromptbookString } from '../types/PromptbookString';
import type { ScriptLanguage } from '../types/ScriptLanguage';

@@ -22,7 +22,7 @@ import type { TaskProgress } from '../types/TaskProgress';

import type { string_char_emoji } from '../types/typeAliasEmoji';
import type { ILicense, IPersonProfile, IRepository, client_id, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptbk_url, string_ptbk_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_xml } from '../types/typeAliases';
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
import { FromtoItems } from '../utils/FromtoItems';
export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ILicense, IPersonProfile, IRepository, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptTemplatePipelineJson, PromptTemplatePipelineString, PtpExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_char_emoji, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptbk_url, string_ptbk_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_xml, };
export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, PromptbookJson, PromptbookString, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, };
/**
* TODO: !!! Filter out all the types that are not used in the library
* TODO: Delete type aliases that are not exported here
*/

@@ -1,2 +0,2 @@

import type { PtpExecutor } from './PtpExecutor';
import type { PromptbookExecutor } from './PromptbookExecutor';
/**

@@ -8,5 +8,5 @@ * Asserts that the execution of a promptnook is successful

*/
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PtpExecutor>>, 'isSuccessful' | 'errors'>): void;
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
/**
* TODO: [🧠] Can this return type be better typed than void
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/

@@ -1,2 +0,2 @@

import type { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
import type { PromptbookLibrary } from '../../../../../classes/PromptbookLibrary';
import type { client_id, string_uri } from '../../../../../types/typeAliases';

@@ -18,7 +18,7 @@ import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';

/**
* Prompt template pipeline library to use
* Promptbook library to use
*
* This is used to checkl validity of the prompt to prevent DDoS
*/
readonly ptbkLibrary: PromptTemplatePipelineLibrary;
readonly library: PromptbookLibrary;
/**

@@ -25,0 +25,0 @@ * Creates natural execution tools for each client

@@ -8,3 +8,3 @@ import type { client_id, string_uri } from '../../../.././types/typeAliases';

/**
* URL of the remote PTP server
* URL of the remote PROMPTBOOK server
* On this server will be connected to the socket.io server

@@ -11,0 +11,0 @@ */

import type { string_markdown_text, string_name, string_version } from '.././types/typeAliases';
import type { ExecutionType } from './ExecutionTypes';
import type { ModelRequirements } from './ModelRequirements';
import type { ExpectationAmount, ExpectationUnit } from './PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount, ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
/**

@@ -9,22 +9,22 @@ * Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.

*/
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
/**
* PtpVersion command tells which version is .ptp file using
* PromptbookVersion command tells which version is .promptbook file using
*
* - It is used for backward compatibility
* - It is defined per whole .ptp file in the header
* - It is defined per whole .promptbook file in the header
*/
export interface PtbkUrlCommand {
readonly type: 'PTBK_URL';
readonly ptbkUrl: URL;
export interface PromptbookUrlCommand {
readonly type: 'PROMPTBOOK_URL';
readonly promptbookUrl: URL;
}
/**
* PtpVersion command tells which version is .ptp file using
* PromptbookVersion command tells which version is .promptbook file using
*
* - It is used for backward compatibility
* - It is defined per whole .ptp file in the header
* - It is defined per whole .promptbook file in the header
*/
export interface PtbkVersionCommand {
readonly type: 'PTBK_VERSION';
readonly ptbkVersion: string_version;
export interface PromptbookVersionCommand {
readonly type: 'PROMPTBOOK_VERSION';
readonly promptbookVersion: string_version;
}

@@ -31,0 +31,0 @@ /**

import type { PromptResult } from '../../execution/PromptResult';
import type { Prompt } from '../Prompt';
import type { string_ptbk_url, string_version } from '../typeAliases';
import type { string_promptbook_url, string_version } from '../typeAliases';
/**

@@ -16,19 +16,19 @@ * ExecutionReport is result of executing one promptbook

/**
* Unique identifier of the ptp from ptp which was executed
* Unique identifier of the promptbook from promptbook which was executed
*/
readonly ptbkUrl?: string_ptbk_url;
readonly promptbookUrl?: string_promptbook_url;
/**
* Title of from ptp which was executed
* Title of from promptbook which was executed
*/
readonly title?: string;
/**
* Version from ptp which was executed
* Version from promptbook which was executed
*/
readonly ptbkUsedVersion: string_version;
readonly promptbookUsedVersion: string_version;
/**
* Version from ptp which was requested by promptbook
* Version from promptbook which was requested by promptbook
*/
readonly ptbkRequestedVersion?: string_version;
readonly promptbookRequestedVersion?: string_version;
/**
* Description of the ptp which was executed
* Description of the promptbook which was executed
*/

@@ -43,3 +43,3 @@ readonly description?: string;

*/
prompt: Omit<Prompt, 'ptbkUrl' | 'parameters'>;
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
/**

@@ -46,0 +46,0 @@ * Result of the prompt execution (if not failed during LLM execution)

@@ -5,5 +5,5 @@ /**

* There are three types of parameters:
* - **INPUT PARAMETERs** are required to execute the prompt template pipeline.
* - **Intermediate parameters** are used internally in the prompt template pipeline.
* - **OUTPUT PARAMETERs** are not used internally in the prompt template pipeline, but are returned as the result of the prompt template pipeline execution.
* - **INPUT PARAMETERs** are required to execute the pipeline.
* - **Intermediate parameters** are used internally in the pipeline.
* - **OUTPUT PARAMETERs** are not used internally in the pipeline, but are returned as the result of the pipeline execution.
*

@@ -10,0 +10,0 @@ * @see https://github.com/webgptorg/promptbook#parameters

@@ -1,2 +0,2 @@

import type { string_name, string_prompt, string_ptbk_url_with_hashtemplate, string_title } from '.././types/typeAliases';
import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';
import type { ModelRequirements } from './ModelRequirements';

@@ -27,11 +27,11 @@ /**

/**
* Unique identifier of the prompt template pipeline with specific template name as hash
* Unique identifier of the promptbook with specific template name as hash
*
* @example https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
* @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
*/
readonly ptbkUrl: string_ptbk_url_with_hashtemplate;
readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
/**
* Parameters used in the prompt
*
* Note: This is redundant (same information is in ptbkUrl+content) but useful for logging and debugging
* Note: This is redundant (same information is in promptbookUrl+content) but useful for logging and debugging
*/

@@ -38,0 +38,0 @@ readonly parameters: Record<string_name, string>;

import { ExecutionType } from './ExecutionTypes';
import { string_markdown_text, string_name } from './typeAliases';
/**
* TaskProgress represents the progress of a PromptTemplatePipeline execution.
* TaskProgress represents the progress of a Promptbook execution.
*/

@@ -6,0 +6,0 @@ export interface TaskProgress {

@@ -182,11 +182,11 @@ /**

*
* For example `"https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
*/
export type string_ptbk_url = string;
export type string_promptbook_url = string;
/**
* Semantic helper
*
* For example `"https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
*/
export type string_ptbk_url_with_hashtemplate = string;
export type string_promptbook_url_with_hashtemplate = string;
/**

@@ -193,0 +193,0 @@ * Semantic helper

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of characters in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of lines in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of pages in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of paragraphs in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of sentences in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of words in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount, ExpectationUnit } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount, ExpectationUnit } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Index of all counter functions

@@ -5,2 +5,2 @@ import type { string_version } from './types/typeAliases';

*/
export declare const PTBK_VERSION: string_version;
export declare const PROMPTBOOK_VERSION: string_version;
{
"name": "@promptbook/core",
"version": "0.35.1",
"version": "0.36.1",
"description": "Library to supercharge your use of large language models",

@@ -5,0 +5,0 @@ "private": false,

@@ -1,2 +0,2 @@

# πŸ“– Prompt template pipelines
# πŸ“– Promptbook

@@ -3,0 +3,0 @@ Library to supercharge your use of large language models

@@ -1,6 +0,5 @@

import { PromptTemplatePipelineLibrary } from '../classes/PromptTemplatePipelineLibrary';
import { PTBK_VERSION } from '../version';
import { promptTemplatePipelineStringToJson } from '../conversion/promptTemplatePipelineStringToJson';
import { validatePromptTemplatePipelineJson } from '../conversion/validatePromptTemplatePipelineJson';
import { createPtpExecutor } from '../execution/createPtpExecutor';
import { PromptbookLibrary } from '../classes/PromptbookLibrary';
import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
import { validatePromptbookJson } from '../conversion/validatePromptbookJson';
import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';

@@ -11,7 +10,8 @@ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';

import { ExecutionTypes } from '../types/ExecutionTypes';
export { ExecutionTypes, PTBK_VERSION, PromptTemplatePipelineLibrary };
import { PROMPTBOOK_VERSION } from '../version';
export { ExecutionTypes, PROMPTBOOK_VERSION, PromptbookLibrary };
export { SimplePromptInterfaceTools };
export { promptTemplatePipelineStringToJson, validatePromptTemplatePipelineJson };
export { promptbookStringToJson, validatePromptbookJson };
export { MockedEchoNaturalExecutionTools };
export { createPtpExecutor };
export { createPromptbookExecutor };
export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
import { RemoteServerOptions } from '../execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions';
import { runRemoteServer } from '../execution/plugins/natural-execution-tools/remote/runRemoteServer';
export { RemoteServerOptions, runRemoteServer };
import { startRemoteServer } from '../execution/plugins/natural-execution-tools/remote/startRemoteServer';
export { RemoteServerOptions, startRemoteServer };

@@ -5,3 +5,3 @@ import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';

import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult } from '../execution/PromptResult';
import type { PtpExecutor } from '../execution/PtpExecutor';
import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';

@@ -13,6 +13,6 @@ import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';

import type { Prompt } from '../types/Prompt';
import type { EXPECTATION_UNITS, ExpectationAmount, ExpectationUnit, PromptTemplateJson } from '../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { PromptTemplateParameterJson } from '../types/PromptTemplatePipelineJson/PromptTemplateParameterJson';
import type { PromptTemplatePipelineJson } from '../types/PromptTemplatePipelineJson/PromptTemplatePipelineJson';
import type { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineString';
import type { EXPECTATION_UNITS, ExpectationAmount, ExpectationUnit, PromptTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';
import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
import type { PromptbookString } from '../types/PromptbookString';
import type { ScriptLanguage } from '../types/ScriptLanguage';

@@ -22,7 +22,7 @@ import type { TaskProgress } from '../types/TaskProgress';

import type { string_char_emoji } from '../types/typeAliasEmoji';
import type { ILicense, IPersonProfile, IRepository, client_id, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptbk_url, string_ptbk_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_xml } from '../types/typeAliases';
import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
import { FromtoItems } from '../utils/FromtoItems';
export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ILicense, IPersonProfile, IRepository, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptTemplatePipelineJson, PromptTemplatePipelineString, PtpExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, number_bytes, number_days, number_gigabytes, number_hours, number_integer, number_kilobytes, number_likeness, number_megabytes, number_miliseconds, number_minutes, number_months, number_negative, number_percent, number_positive, number_seconds, number_terabytes, number_weeks, number_years, string_attribute, string_attribute_value_scope, string_business_category_name, string_char, string_char_emoji, string_chat_prompt, string_color, string_completion_prompt, string_css, string_css_class, string_css_property, string_css_selector, string_css_value, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_license_token, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_page, string_password, string_person_fullname, string_person_profile, string_pgp_key, string_prompt, string_protocol, string_ptbk_url, string_ptbk_url_with_hashtemplate, string_script, string_sha256, string_ssh_key, string_svg, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_translate_name, string_translate_name_not_normalized, string_uri, string_uri_part, string_uriid, string_url, string_url_image, string_version, string_version_dependency, string_xml, };
export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, PromptbookJson, PromptbookString, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, };
/**
* TODO: !!! Filter out all the types that are not used in the library
* TODO: Delete type aliases that are not exported here
*/

@@ -1,2 +0,2 @@

import type { PtpExecutor } from './PtpExecutor';
import type { PromptbookExecutor } from './PromptbookExecutor';
/**

@@ -8,5 +8,5 @@ * Asserts that the execution of a promptnook is successful

*/
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PtpExecutor>>, 'isSuccessful' | 'errors'>): void;
export declare function assertsExecutionSuccessful(executionResult: Pick<Awaited<ReturnType<PromptbookExecutor>>, 'isSuccessful' | 'errors'>): void;
/**
* TODO: [🧠] Can this return type be better typed than void
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/
export {};
/**
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPtpExecutor.test.ts"
* TODO: [🧠] What should be name of this test "MockedEchoExecutionTools.test.ts" or "createPromptbookExecutor.test.ts"
*/

@@ -1,2 +0,2 @@

import type { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
import type { PromptbookLibrary } from '../../../../../classes/PromptbookLibrary';
import type { client_id, string_uri } from '../../../../../types/typeAliases';

@@ -18,7 +18,7 @@ import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';

/**
* Prompt template pipeline library to use
* Promptbook library to use
*
* This is used to checkl validity of the prompt to prevent DDoS
*/
readonly ptbkLibrary: PromptTemplatePipelineLibrary;
readonly library: PromptbookLibrary;
/**

@@ -25,0 +25,0 @@ * Creates natural execution tools for each client

@@ -8,3 +8,3 @@ import type { client_id, string_uri } from '../../../.././types/typeAliases';

/**
* URL of the remote PTP server
* URL of the remote PROMPTBOOK server
* On this server will be connected to the socket.io server

@@ -11,0 +11,0 @@ */

import type { string_markdown_text, string_name, string_version } from '.././types/typeAliases';
import type { ExecutionType } from './ExecutionTypes';
import type { ModelRequirements } from './ModelRequirements';
import type { ExpectationAmount, ExpectationUnit } from './PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount, ExpectationUnit } from './PromptbookJson/PromptTemplateJson';
/**

@@ -9,22 +9,22 @@ * Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.

*/
export type Command = PtbkUrlCommand | PtbkVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
export type Command = PromptbookUrlCommand | PromptbookVersionCommand | ExecuteCommand | ModelCommand | JokerCommand | ParameterCommand | PostprocessCommand | ExpectCommand;
/**
* PtpVersion command tells which version is .ptp file using
* PromptbookVersion command tells which version is .promptbook file using
*
* - It is used for backward compatibility
* - It is defined per whole .ptp file in the header
* - It is defined per whole .promptbook file in the header
*/
export interface PtbkUrlCommand {
readonly type: 'PTBK_URL';
readonly ptbkUrl: URL;
export interface PromptbookUrlCommand {
readonly type: 'PROMPTBOOK_URL';
readonly promptbookUrl: URL;
}
/**
* PtpVersion command tells which version is .ptp file using
* PromptbookVersion command tells which version is .promptbook file using
*
* - It is used for backward compatibility
* - It is defined per whole .ptp file in the header
* - It is defined per whole .promptbook file in the header
*/
export interface PtbkVersionCommand {
readonly type: 'PTBK_VERSION';
readonly ptbkVersion: string_version;
export interface PromptbookVersionCommand {
readonly type: 'PROMPTBOOK_VERSION';
readonly promptbookVersion: string_version;
}

@@ -31,0 +31,0 @@ /**

import type { PromptResult } from '../../execution/PromptResult';
import type { Prompt } from '../Prompt';
import type { string_ptbk_url, string_version } from '../typeAliases';
import type { string_promptbook_url, string_version } from '../typeAliases';
/**

@@ -16,19 +16,19 @@ * ExecutionReport is result of executing one promptbook

/**
* Unique identifier of the ptp from ptp which was executed
* Unique identifier of the promptbook from promptbook which was executed
*/
readonly ptbkUrl?: string_ptbk_url;
readonly promptbookUrl?: string_promptbook_url;
/**
* Title of from ptp which was executed
* Title of from promptbook which was executed
*/
readonly title?: string;
/**
* Version from ptp which was executed
* Version from promptbook which was executed
*/
readonly ptbkUsedVersion: string_version;
readonly promptbookUsedVersion: string_version;
/**
* Version from ptp which was requested by promptbook
* Version from promptbook which was requested by promptbook
*/
readonly ptbkRequestedVersion?: string_version;
readonly promptbookRequestedVersion?: string_version;
/**
* Description of the ptp which was executed
* Description of the promptbook which was executed
*/

@@ -43,3 +43,3 @@ readonly description?: string;

*/
prompt: Omit<Prompt, 'ptbkUrl' | 'parameters'>;
prompt: Omit<Prompt, 'promptbookUrl' | 'parameters'>;
/**

@@ -46,0 +46,0 @@ * Result of the prompt execution (if not failed during LLM execution)

@@ -5,5 +5,5 @@ /**

* There are three types of parameters:
* - **INPUT PARAMETERs** are required to execute the prompt template pipeline.
* - **Intermediate parameters** are used internally in the prompt template pipeline.
* - **OUTPUT PARAMETERs** are not used internally in the prompt template pipeline, but are returned as the result of the prompt template pipeline execution.
* - **INPUT PARAMETERs** are required to execute the pipeline.
* - **Intermediate parameters** are used internally in the pipeline.
* - **OUTPUT PARAMETERs** are not used internally in the pipeline, but are returned as the result of the pipeline execution.
*

@@ -10,0 +10,0 @@ * @see https://github.com/webgptorg/promptbook#parameters

@@ -1,2 +0,2 @@

import type { string_name, string_prompt, string_ptbk_url_with_hashtemplate, string_title } from '.././types/typeAliases';
import type { string_name, string_prompt, string_promptbook_url_with_hashtemplate, string_title } from '.././types/typeAliases';
import type { ModelRequirements } from './ModelRequirements';

@@ -27,11 +27,11 @@ /**

/**
* Unique identifier of the prompt template pipeline with specific template name as hash
* Unique identifier of the promptbook with specific template name as hash
*
* @example https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
* @example https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords
*/
readonly ptbkUrl: string_ptbk_url_with_hashtemplate;
readonly promptbookUrl: string_promptbook_url_with_hashtemplate;
/**
* Parameters used in the prompt
*
* Note: This is redundant (same information is in ptbkUrl+content) but useful for logging and debugging
* Note: This is redundant (same information is in promptbookUrl+content) but useful for logging and debugging
*/

@@ -38,0 +38,0 @@ readonly parameters: Record<string_name, string>;

import { ExecutionType } from './ExecutionTypes';
import { string_markdown_text, string_name } from './typeAliases';
/**
* TaskProgress represents the progress of a PromptTemplatePipeline execution.
* TaskProgress represents the progress of a Promptbook execution.
*/

@@ -6,0 +6,0 @@ export interface TaskProgress {

@@ -182,11 +182,11 @@ /**

*
* For example `"https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15"`
*/
export type string_ptbk_url = string;
export type string_promptbook_url = string;
/**
* Semantic helper
*
* For example `"https://ptbk.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
* For example `"https://promptbook.webgpt.com/cs/write-website-content.ptbk.md@v2.4.15#keywords"`
*/
export type string_ptbk_url_with_hashtemplate = string;
export type string_promptbook_url_with_hashtemplate = string;
/**

@@ -193,0 +193,0 @@ * Semantic helper

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of characters in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of lines in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of pages in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of paragraphs in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of sentences in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Counts number of words in the text

@@ -1,2 +0,2 @@

import type { ExpectationAmount, ExpectationUnit } from '../../types/PromptTemplatePipelineJson/PromptTemplateJson';
import type { ExpectationAmount, ExpectationUnit } from '../../types/PromptbookJson/PromptTemplateJson';
/**

@@ -3,0 +3,0 @@ * Index of all counter functions

@@ -5,2 +5,2 @@ import type { string_version } from './types/typeAliases';

*/
export declare const PTBK_VERSION: string_version;
export declare const PROMPTBOOK_VERSION: string_version;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc