@promptbook/remote-server 0.18.0 → 0.19.1

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.
@@ -16,5 +16,8 @@ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineStr
16
16
  import { ScriptLanguage } from '../types/ScriptLanguage';
17
17
  import { TaskProgress } from '../types/TaskProgress';
18
18
  import { string_char_emoji } from '../types/typeAliasEmoji';
19
- import { ILicense, IPersonProfile, IRepository, 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_wallpaper_id, string_xml, uuid, uuid_first_segment } from '../types/typeAliases';
20
- export { CommonExecutionToolsOptions, ExecutionTools, ExecutionType, ILicense, IPersonProfile, IRepository, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptTemplatePipelineJson, PromptTemplatePipelineString, PtpExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, 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_wallpaper_id, string_xml, uuid, uuid_first_segment, };
19
+ import { 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';
20
+ export { CommonExecutionToolsOptions, ExecutionTools, ExecutionType, 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, };
21
+ /**
22
+ * TODO: !!! Filter out all the types that are not used in the library
23
+ */
@@ -1,4 +1,4 @@
1
- import { string_uri, uuid } from '../../../.././types/typeAliases';
1
+ import type { client_id, string_uri } from '../../../.././types/typeAliases';
2
2
  import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
3
  /**
4
4
  * Options for RemoteNaturalExecutionTools
@@ -19,5 +19,5 @@ export interface RemoteNaturalExecutionToolsOptions extends CommonExecutionTools
19
19
  /**
20
20
  * Your client ID
21
21
  */
22
- readonly clientId: uuid;
22
+ readonly clientId: client_id;
23
23
  }
@@ -1,5 +1,5 @@
1
- import { uuid } from '../../../../.././types/typeAliases';
2
- import { Prompt } from '../../../../../types/Prompt';
1
+ import type { client_id } from '../../../../.././types/typeAliases';
2
+ import type { Prompt } from '../../../../../types/Prompt';
3
3
  /**
4
4
  * Socket.io progress for remote text generation
5
5
  *
@@ -9,7 +9,7 @@ export interface Ptps_Request {
9
9
  /**
10
10
  * Client responsible for the requests
11
11
  */
12
- readonly clientId: uuid;
12
+ readonly clientId: client_id;
13
13
  /**
14
14
  * The Prompt to execute
15
15
  */
@@ -1,7 +1,7 @@
1
- import { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
2
- import { string_uri, uuid } from '../../../../../types/typeAliases';
3
- import { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
4
- import { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
1
+ import type { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
2
+ import type { client_id, string_uri } from '../../../../../types/typeAliases';
3
+ import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
4
+ import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
5
5
  export interface RemoteServerOptions extends CommonExecutionToolsOptions {
6
6
  /**
7
7
  * Port on which the server will listen
@@ -23,5 +23,5 @@ export interface RemoteServerOptions extends CommonExecutionToolsOptions {
23
23
  /**
24
24
  * Creates natural execution tools for each client
25
25
  */
26
- createNaturalExecutionTools(clientId: uuid): NaturalExecutionTools;
26
+ createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
27
27
  }
@@ -10,5 +10,8 @@
10
10
  * @see https://github.com/webgptorg/promptbook#prompt-template-pipeline
11
11
  */
12
12
  export type PromptTemplatePipelineString = string & {
13
- readonly __type: 'PromptTemplatePipeline';
13
+ readonly _type: 'PromptTemplatePipeline';
14
14
  };
15
+ /**
16
+ * TODO: !! Better validation (validatePromptTemplatePipelineString) or remove branded type and make it just string
17
+ */
@@ -247,32 +247,11 @@ export type string_host = string;
247
247
  */
248
248
  export type string_email = string;
249
249
  /**
250
- * Branded type for UUIDs version 4
251
- * This will not allow to pass some random string where should be only a valid UUID
252
- *
253
- * Use utils:
254
- * - `randomUuid` to generate
255
- * - `isValidUuid to check validity
256
- *
257
- * For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
250
+ * Branded type client id
258
251
  */
259
- export type uuid = string & {
260
- readonly __type: 'UUID';
252
+ export type client_id = string & {
253
+ readonly _type: 'client_id';
261
254
  };
262
- /**
263
- * Semantic helper
264
- *
265
- * For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
266
- */
267
- export type string_wallpaper_id = uuid | string_uriid;
268
- /**
269
- * Semantic helper
270
- * UUID with only the first part of the UUID
271
- *
272
- *
273
- * For example `"5a0a153d"`
274
- */
275
- export type uuid_first_segment = string;
276
255
  /**
277
256
  * Semantic helper
278
257
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -38,7 +38,7 @@
38
38
  "spacetrim": "0.9.2"
39
39
  },
40
40
  "peerDependencies": {
41
- "@promptbook/core": "0.18.0"
41
+ "@promptbook/core": "0.19.1"
42
42
  },
43
43
  "main": "./umd/index.umd.js",
44
44
  "module": "./esm/index.es.js",
@@ -16,5 +16,8 @@ import { PromptTemplatePipelineString } from '../types/PromptTemplatePipelineStr
16
16
  import { ScriptLanguage } from '../types/ScriptLanguage';
17
17
  import { TaskProgress } from '../types/TaskProgress';
18
18
  import { string_char_emoji } from '../types/typeAliasEmoji';
19
- import { ILicense, IPersonProfile, IRepository, 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_wallpaper_id, string_xml, uuid, uuid_first_segment } from '../types/typeAliases';
20
- export { CommonExecutionToolsOptions, ExecutionTools, ExecutionType, ILicense, IPersonProfile, IRepository, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptTemplatePipelineJson, PromptTemplatePipelineString, PtpExecutor, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, 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_wallpaper_id, string_xml, uuid, uuid_first_segment, };
19
+ import { 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';
20
+ export { CommonExecutionToolsOptions, ExecutionTools, ExecutionType, 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, };
21
+ /**
22
+ * TODO: !!! Filter out all the types that are not used in the library
23
+ */
@@ -1,4 +1,4 @@
1
- import { string_uri, uuid } from '../../../.././types/typeAliases';
1
+ import type { client_id, string_uri } from '../../../.././types/typeAliases';
2
2
  import { CommonExecutionToolsOptions } from '../../../CommonExecutionToolsOptions';
3
3
  /**
4
4
  * Options for RemoteNaturalExecutionTools
@@ -19,5 +19,5 @@ export interface RemoteNaturalExecutionToolsOptions extends CommonExecutionTools
19
19
  /**
20
20
  * Your client ID
21
21
  */
22
- readonly clientId: uuid;
22
+ readonly clientId: client_id;
23
23
  }
@@ -1,5 +1,5 @@
1
- import { uuid } from '../../../../.././types/typeAliases';
2
- import { Prompt } from '../../../../../types/Prompt';
1
+ import type { client_id } from '../../../../.././types/typeAliases';
2
+ import type { Prompt } from '../../../../../types/Prompt';
3
3
  /**
4
4
  * Socket.io progress for remote text generation
5
5
  *
@@ -9,7 +9,7 @@ export interface Ptps_Request {
9
9
  /**
10
10
  * Client responsible for the requests
11
11
  */
12
- readonly clientId: uuid;
12
+ readonly clientId: client_id;
13
13
  /**
14
14
  * The Prompt to execute
15
15
  */
@@ -1,7 +1,7 @@
1
- import { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
2
- import { string_uri, uuid } from '../../../../../types/typeAliases';
3
- import { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
4
- import { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
1
+ import type { PromptTemplatePipelineLibrary } from '../../../../../classes/PromptTemplatePipelineLibrary';
2
+ import type { client_id, string_uri } from '../../../../../types/typeAliases';
3
+ import type { CommonExecutionToolsOptions } from '../../../../CommonExecutionToolsOptions';
4
+ import type { NaturalExecutionTools } from '../../../../NaturalExecutionTools';
5
5
  export interface RemoteServerOptions extends CommonExecutionToolsOptions {
6
6
  /**
7
7
  * Port on which the server will listen
@@ -23,5 +23,5 @@ export interface RemoteServerOptions extends CommonExecutionToolsOptions {
23
23
  /**
24
24
  * Creates natural execution tools for each client
25
25
  */
26
- createNaturalExecutionTools(clientId: uuid): NaturalExecutionTools;
26
+ createNaturalExecutionTools(clientId: client_id): NaturalExecutionTools;
27
27
  }
@@ -10,5 +10,8 @@
10
10
  * @see https://github.com/webgptorg/promptbook#prompt-template-pipeline
11
11
  */
12
12
  export type PromptTemplatePipelineString = string & {
13
- readonly __type: 'PromptTemplatePipeline';
13
+ readonly _type: 'PromptTemplatePipeline';
14
14
  };
15
+ /**
16
+ * TODO: !! Better validation (validatePromptTemplatePipelineString) or remove branded type and make it just string
17
+ */
@@ -247,32 +247,11 @@ export type string_host = string;
247
247
  */
248
248
  export type string_email = string;
249
249
  /**
250
- * Branded type for UUIDs version 4
251
- * This will not allow to pass some random string where should be only a valid UUID
252
- *
253
- * Use utils:
254
- * - `randomUuid` to generate
255
- * - `isValidUuid to check validity
256
- *
257
- * For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
250
+ * Branded type client id
258
251
  */
259
- export type uuid = string & {
260
- readonly __type: 'UUID';
252
+ export type client_id = string & {
253
+ readonly _type: 'client_id';
261
254
  };
262
- /**
263
- * Semantic helper
264
- *
265
- * For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
266
- */
267
- export type string_wallpaper_id = uuid | string_uriid;
268
- /**
269
- * Semantic helper
270
- * UUID with only the first part of the UUID
271
- *
272
- *
273
- * For example `"5a0a153d"`
274
- */
275
- export type uuid_first_segment = string;
276
255
  /**
277
256
  * Semantic helper
278
257
  *