@promptbook/types 0.103.0-42 → 0.103.0-44

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.
Files changed (88) hide show
  1. package/README.md +6 -18
  2. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  3. package/esm/typings/src/_packages/node.index.d.ts +0 -2
  4. package/esm/typings/src/_packages/types.index.d.ts +22 -0
  5. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  6. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -4
  7. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +1 -1
  8. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +1 -0
  9. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
  10. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  11. package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
  12. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
  13. package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +1 -1
  14. package/esm/typings/src/book-components/Qr/useQrCode.d.ts +1 -1
  15. package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +1 -1
  16. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
  17. package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -1
  18. package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -1
  19. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +1 -1
  20. package/esm/typings/src/cli/cli-commands/login.d.ts +1 -1
  21. package/esm/typings/src/cli/cli-commands/make.d.ts +1 -1
  22. package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -1
  23. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  24. package/esm/typings/src/cli/cli-commands/start-agents-server.d.ts +1 -1
  25. package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  26. package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -1
  27. package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +1 -1
  28. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +2 -29
  29. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +107 -0
  30. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +129 -0
  31. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  32. package/esm/typings/src/config.d.ts +1 -1
  33. package/esm/typings/src/errors/0-index.d.ts +3 -0
  34. package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
  35. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
  36. package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +1 -1
  37. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +1 -1
  38. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
  40. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
  41. package/esm/typings/src/llm-providers/agent/Agent.d.ts +5 -2
  42. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +4 -2
  44. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +4 -3
  45. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -1
  46. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  47. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  49. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
  50. package/esm/typings/src/remote-server/startAgentServer.d.ts +2 -2
  51. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +0 -19
  52. package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +1 -1
  53. package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +5 -1
  54. package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +1 -1
  55. package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -1
  56. package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +4 -1
  57. package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +1 -1
  58. package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +4 -1
  59. package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
  60. package/esm/typings/src/types/typeAliases.d.ts +19 -1
  61. package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
  62. package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
  63. package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
  64. package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
  65. package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
  66. package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
  67. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
  68. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +1 -1
  69. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +1 -1
  70. package/esm/typings/src/utils/files/$induceBookDownload.d.ts +2 -2
  71. package/esm/typings/src/utils/files/$induceFileDownload.d.ts +2 -2
  72. package/esm/typings/src/utils/files/ObjectUrl.d.ts +1 -1
  73. package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +6 -0
  74. package/esm/typings/src/utils/organization/$side_effect.d.ts +1 -1
  75. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +25 -0
  76. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
  77. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
  78. package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
  79. package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
  80. package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
  81. package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +1 -1
  82. package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
  83. package/esm/typings/src/version.d.ts +1 -1
  84. package/package.json +2 -2
  85. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.d.ts +0 -89
  86. package/esm/typings/src/collection/agent-collection/constructors/AgentCollectionInDirectory.test.d.ts +0 -1
  87. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +0 -1
  88. package/esm/typings/src/execution/utils/logLlmCall.d.ts +0 -8
@@ -0,0 +1,25 @@
1
+ import type { PartialDeep } from 'type-fest';
2
+ import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
3
+ import { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import { string_agent_name_in_book } from '../../types/typeAliases';
5
+ type GenerateBookBoilerplateOptions = PartialDeep<Omit<AgentBasicInformation, 'parameters'>> & {
6
+ /**
7
+ * Name of the parent agent to inherit from
8
+ *
9
+ * @default 'Adam'
10
+ */
11
+ parentAgentName?: string_agent_name_in_book;
12
+ };
13
+ /**
14
+ * Generates boilerplate for a new agent book
15
+ *
16
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
17
+ * Note: This function is using cryptographically secure components internally
18
+ *
19
+ * @public exported from `@promptbook/core`
20
+ */
21
+ export declare function $generateBookBoilerplate(options?: GenerateBookBoilerplateOptions): string_book;
22
+ export {};
23
+ /**
24
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
25
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @@@@
3
+ *
4
+ * @private internal helper function
5
+ */
6
+ export declare function $randomAgentPersona(): string;
7
+ /**
8
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
9
+ */
@@ -0,0 +1,13 @@
1
+ import { string_color, string_person_fullname } from '../../types/typeAliases';
2
+ export type RandomFullnameWithColorResult = {
3
+ fullname: string_person_fullname;
4
+ color: string_color;
5
+ };
6
+ /**
7
+ *
8
+ * @private internal helper function
9
+ */
10
+ export declare function $randomFullnameWithColor(): RandomFullnameWithColorResult;
11
+ /**
12
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
13
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Pick random item from the received array
3
+ *
4
+ * @private internal helper function
5
+ */
6
+ export declare function $randomItem<TItem>(...items: Array<TItem>): TItem;
7
+ /**
8
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
9
+ */
@@ -8,3 +8,6 @@ import type { number_seed } from '../../types/typeAliases';
8
8
  * @private internal helper function
9
9
  */
10
10
  export declare function $randomSeed(): number_seed;
11
+ /**
12
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
13
+ */
@@ -2,6 +2,7 @@ import type { string_token } from '../../types/typeAliases';
2
2
  /**
3
3
  * Generates random token
4
4
  *
5
+ * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
5
6
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
6
7
  *
7
8
  * @private internal helper function
@@ -9,5 +10,6 @@ import type { string_token } from '../../types/typeAliases';
9
10
  */
10
11
  export declare function $randomToken(randomness: number): string_token;
11
12
  /**
13
+ * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
12
14
  * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
13
15
  */
@@ -1,5 +1,5 @@
1
1
  import type { ReadonlyDeep } from 'type-fest';
2
- import { $side_effect } from '../organization/$side_effect';
2
+ import type { $side_effect } from '../organization/$side_effect';
3
3
  /**
4
4
  * Freezes the given object and all its nested objects recursively
5
5
  *
@@ -1,5 +1,5 @@
1
- import { string_javascript } from '../../types/typeAliases';
2
- import { TODO_any } from '../organization/TODO_any';
1
+ import type { string_javascript } from '../../types/typeAliases';
2
+ import type { TODO_any } from '../organization/TODO_any';
3
3
  type SerializeToPromptbookJavascriptReturn = {
4
4
  /**
5
5
  * Array of import statements required for the `value` to work
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.103.0-41`).
18
+ * It follows semantic versioning (e.g., `0.103.0-43`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.103.0-42",
3
+ "version": "0.103.0-44",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -92,6 +92,6 @@
92
92
  },
93
93
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
94
94
  "peerDependencies": {
95
- "@promptbook/core": "0.103.0-42"
95
+ "@promptbook/core": "0.103.0-44"
96
96
  }
97
97
  }
@@ -1,89 +0,0 @@
1
- import { Agent } from '../../../_packages/core.index';
2
- import { CommonToolsOptions, string_book } from '../../../_packages/types.index';
3
- import type { ExecutionTools } from '../../../execution/ExecutionTools';
4
- import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
5
- import type { string_agent_name, string_dirname } from '../../../types/typeAliases';
6
- import type { AgentCollection } from '../AgentCollection';
7
- /**
8
- * Options for `createAgentCollectionFromDirectory` function
9
- *
10
- * Note: `rootDirname` is not needed because it is the folder in which `.book` or `.book` file is located
11
- * This is not same as `path` which is the first argument of `createAgentCollectionFromDirectory` - it can be a subfolder
12
- */
13
- type CreateAgentCollectionInDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & CommonToolsOptions & {
14
- /**
15
- * If true, the directory is searched recursively for pipelines
16
- *
17
- * @default true
18
- */
19
- isRecursive?: boolean;
20
- /**
21
- * If true, directory will be scanned only when needed not during the construction
22
- *
23
- * @default false
24
- */
25
- isLazyLoaded?: boolean;
26
- /**
27
- * If true, whole collection creation crashes on error in any pipeline
28
- * If true and isLazyLoaded is true, the error is thrown on first access to the pipeline
29
- *
30
- * @default true
31
- */
32
- isCrashedOnError?: boolean;
33
- };
34
- /**
35
- * Agent collection stored in directory
36
- *
37
- * Note: Works only in Node.js environment because it reads the file system
38
- *
39
- * @public exported from `@promptbook/node`
40
- */
41
- export declare class AgentCollectionInDirectory implements AgentCollection {
42
- readonly rootPath: string_dirname;
43
- private readonly tools?;
44
- readonly options?: CreateAgentCollectionInDirectoryOptions | undefined;
45
- /**
46
- * @param rootPath - path to the directory with agents
47
- * @param tools - Execution tools to be used in `Agent` itself and listing the agents
48
- * @param options - Options for the collection creation
49
- */
50
- constructor(rootPath: string_dirname, tools?: Pick<ExecutionTools, "llm" | "fs" | "scrapers"> | undefined, options?: CreateAgentCollectionInDirectoryOptions | undefined);
51
- /**
52
- * Cached defined execution tools
53
- */
54
- private _definedTools;
55
- /**
56
- * Gets or creates execution tools for the collection
57
- */
58
- private getTools;
59
- /**
60
- * Gets all agents in the collection
61
- */
62
- listAgents(): Promise<ReadonlyArray<string_agent_name>>;
63
- /**
64
- * Get one agent by its name
65
- *
66
- * Note: Agents are existing independently of you getting them or not, you can get the same agent multiple times.
67
- * Note: Agents are changed by interacting with `Agent` objects directly. Only creation and deletion is done via the collection.
68
- */
69
- getAgentByName(agentName: string_agent_name): Promise<Agent>;
70
- /**
71
- * Deletes an agent from the collection
72
- *
73
- * Note: When you want delete an agent by name, first get the agent using `getAgentByName` and then pass it to `deleteAgent`.
74
- */
75
- deleteAgent(agent: Agent): Promise<void>;
76
- /**
77
- * Creates a new agent in the collection
78
- *
79
- * Note: You can set 'PARENT' in the agent source to inherit from another agent in the collection.
80
- */
81
- createAgent(agentSource: string_book): Promise<Agent>;
82
- }
83
- export {};
84
- /**
85
- * TODO: [🧠][🚙] `AgentXxx` vs `AgentsXxx` naming convention
86
- * TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
87
- * TODO: [🧠] Maybe add option `isImmutable`
88
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
89
- */
@@ -1,8 +0,0 @@
1
- import type { LlmCall } from '../../types/LlmCall';
2
- import type { ExecutionPromptReportJson } from '../execution-report/ExecutionPromptReportJson';
3
- /**
4
- * Logs an LLM call with the given report.
5
- *
6
- * @private internal utility of `createPipelineExecutor`
7
- */
8
- export declare function logLlmCall(logLlmCall: (llmCall: LlmCall) => void, report: ExecutionPromptReportJson): void;