@promptbook/ollama 0.104.0-9 → 0.105.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/esm/index.es.js +276 -110
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/components.index.d.ts +0 -6
  4. package/esm/typings/src/_packages/core.index.d.ts +10 -6
  5. package/esm/typings/src/_packages/types.index.d.ts +8 -0
  6. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  7. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +24 -0
  8. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +16 -2
  9. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.tools.test.d.ts +1 -0
  10. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +1 -1
  11. package/esm/typings/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -1
  12. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +23 -3
  13. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +5 -1
  14. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +5 -1
  15. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +5 -1
  16. package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +6 -2
  17. package/esm/typings/src/book-components/icons/CameraIcon.d.ts +6 -2
  18. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +5 -1
  19. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +5 -1
  20. package/esm/typings/src/book-components/icons/SaveIcon.d.ts +6 -2
  21. package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +1 -1
  22. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +9 -7
  23. package/esm/typings/src/commands/_common/types/Command.d.ts +1 -1
  24. package/esm/typings/src/commitments/IMPORT/IMPORT.d.ts +34 -0
  25. package/esm/typings/src/commitments/META/META_DESCRIPTION.d.ts +41 -0
  26. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +2 -2
  27. package/esm/typings/src/commitments/_base/BookCommitment.d.ts +1 -1
  28. package/esm/typings/src/commitments/index.d.ts +2 -1
  29. package/esm/typings/src/config.d.ts +14 -1
  30. package/esm/typings/src/errors/utils/deserializeError.d.ts +1 -1
  31. package/esm/typings/src/execution/PromptResult.d.ts +24 -1
  32. package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
  34. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
  35. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +1 -1
  36. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +8 -4
  37. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +1 -1
  38. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -1
  39. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +12 -8
  40. package/esm/typings/src/llm-providers/agent/Agent.d.ts +7 -1
  41. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  42. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +5 -0
  43. package/esm/typings/src/llm-providers/openai/utils/mapToolsToOpenAi.d.ts +8 -0
  44. package/esm/typings/src/remote-server/ui/ServerApp.d.ts +5 -1
  45. package/esm/typings/src/scrapers/_common/utils/promptbookFetch.test.d.ts +1 -0
  46. package/esm/typings/src/search-engines/SearchEngine.d.ts +9 -0
  47. package/esm/typings/src/search-engines/SearchResult.d.ts +18 -0
  48. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +15 -0
  49. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +15 -0
  50. package/esm/typings/src/types/LlmToolDefinition.d.ts +27 -0
  51. package/esm/typings/src/types/ModelRequirements.d.ts +13 -0
  52. package/esm/typings/src/types/Prompt.d.ts +13 -0
  53. package/esm/typings/src/types/typeAliasEmoji.d.ts +2 -2
  54. package/esm/typings/src/utils/misc/parseNumber.d.ts +1 -1
  55. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +7 -2
  56. package/esm/typings/src/utils/random/$randomItem.d.ts +1 -1
  57. package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
  58. package/esm/typings/src/utils/validators/url/isValidAgentUrl.d.ts +16 -0
  59. package/esm/typings/src/utils/validators/url/isValidAgentUrl.test.d.ts +1 -0
  60. package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
  61. package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +4 -3
  62. package/esm/typings/src/version.d.ts +1 -1
  63. package/package.json +2 -2
  64. package/umd/index.umd.js +276 -110
  65. package/umd/index.umd.js.map +1 -1
  66. package/esm/typings/servers.d.ts +0 -50
@@ -1,4 +1,5 @@
1
1
  import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformation';
2
+ import type { AgentCapability } from '../book-2.0/agent-source/AgentBasicInformation';
2
3
  import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
3
4
  import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
4
5
  import type { string_book } from '../book-2.0/agent-source/string_book';
@@ -178,6 +179,8 @@ import type { ScraperSourceHandler } from '../scrapers/_common/Scraper';
178
179
  import type { ScraperIntermediateSource } from '../scrapers/_common/ScraperIntermediateSource';
179
180
  import type { JavascriptExecutionToolsOptions } from '../scripting/javascript/JavascriptExecutionToolsOptions';
180
181
  import type { PostprocessingFunction } from '../scripting/javascript/JavascriptExecutionToolsOptions';
182
+ import type { SearchEngine } from '../search-engines/SearchEngine';
183
+ import type { SearchResult } from '../search-engines/SearchResult';
181
184
  import type { PromptbookStorage } from '../storage/_common/PromptbookStorage';
182
185
  import type { FileCacheStorageOptions } from '../storage/file-cache-storage/FileCacheStorageOptions';
183
186
  import type { IndexedDbStorageOptions } from '../storage/local-storage/utils/IndexedDbStorageOptions';
@@ -185,6 +188,7 @@ import type { BookTranspiler } from '../transpilers/_common/BookTranspiler';
185
188
  import type { BookTranspilerOptions } from '../transpilers/_common/BookTranspilerOptions';
186
189
  import type { IntermediateFilesStrategy } from '../types/IntermediateFilesStrategy';
187
190
  import type { LlmCall } from '../types/LlmCall';
191
+ import type { LlmToolDefinition } from '../types/LlmToolDefinition';
188
192
  import type { Message } from '../types/Message';
189
193
  import type { ModelRequirements } from '../types/ModelRequirements';
190
194
  import type { CompletionModelRequirements } from '../types/ModelRequirements';
@@ -367,6 +371,7 @@ import type { ExportJsonOptions } from '../utils/serialization/exportJson';
367
371
  import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
368
372
  import type { string_promptbook_version } from '../version';
369
373
  export type { BookParameter };
374
+ export type { AgentCapability };
370
375
  export type { AgentBasicInformation };
371
376
  export type { AgentModelRequirements };
372
377
  export type { string_book };
@@ -546,6 +551,8 @@ export type { ScraperSourceHandler };
546
551
  export type { ScraperIntermediateSource };
547
552
  export type { JavascriptExecutionToolsOptions };
548
553
  export type { PostprocessingFunction };
554
+ export type { SearchEngine };
555
+ export type { SearchResult };
549
556
  export type { PromptbookStorage };
550
557
  export type { FileCacheStorageOptions };
551
558
  export type { IndexedDbStorageOptions };
@@ -553,6 +560,7 @@ export type { BookTranspiler };
553
560
  export type { BookTranspilerOptions };
554
561
  export type { IntermediateFilesStrategy };
555
562
  export type { LlmCall };
563
+ export type { LlmToolDefinition };
556
564
  export type { Message };
557
565
  export type { ModelRequirements };
558
566
  export type { CompletionModelRequirements };
@@ -83,6 +83,7 @@ import { isValidPromptbookVersion } from '../utils/validators/semanticVersion/is
83
83
  import { isValidSemanticVersion } from '../utils/validators/semanticVersion/isValidSemanticVersion';
84
84
  import { isHostnameOnPrivateNetwork } from '../utils/validators/url/isHostnameOnPrivateNetwork';
85
85
  import { isUrlOnPrivateNetwork } from '../utils/validators/url/isUrlOnPrivateNetwork';
86
+ import { isValidAgentUrl } from '../utils/validators/url/isValidAgentUrl';
86
87
  import { isValidPipelineUrl } from '../utils/validators/url/isValidPipelineUrl';
87
88
  import { isValidUrl } from '../utils/validators/url/isValidUrl';
88
89
  import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
@@ -171,6 +172,7 @@ export { isValidPromptbookVersion };
171
172
  export { isValidSemanticVersion };
172
173
  export { isHostnameOnPrivateNetwork };
173
174
  export { isUrlOnPrivateNetwork };
175
+ export { isValidAgentUrl };
174
176
  export { isValidPipelineUrl };
175
177
  export { isValidUrl };
176
178
  export { isValidUuid };
@@ -23,6 +23,24 @@ export type BookParameter = {
23
23
  */
24
24
  description?: string;
25
25
  };
26
+ /**
27
+ * Capability of the agent
28
+ * This is parsed from commitments like USE BROWSER, USE SEARCH ENGINE, KNOWLEDGE, etc.
29
+ */
30
+ export type AgentCapability = {
31
+ /**
32
+ * The type of the capability
33
+ */
34
+ type: 'browser' | 'search-engine' | 'knowledge';
35
+ /**
36
+ * The label to display for this capability
37
+ */
38
+ label: string;
39
+ /**
40
+ * The name of the icon to display for this capability
41
+ */
42
+ iconName: string;
43
+ };
26
44
  export type AgentBasicInformation = {
27
45
  /**
28
46
  * Name of the agent
@@ -55,6 +73,7 @@ export type AgentBasicInformation = {
55
73
  */
56
74
  meta: {
57
75
  fullname?: string;
76
+ description?: string;
58
77
  image?: string_url_image;
59
78
  font?: string_fonts;
60
79
  color?: string_color;
@@ -72,6 +91,11 @@ export type AgentBasicInformation = {
72
91
  * - {parameterName} or {parameter with multiple words} or {parameterName: description text}
73
92
  */
74
93
  parameters: BookParameter[];
94
+ /**
95
+ * Capabilities of the agent
96
+ * This is parsed from commitments like USE BROWSER, USE SEARCH ENGINE, KNOWLEDGE, etc.
97
+ */
98
+ capabilities: AgentCapability[];
75
99
  };
76
100
  /**
77
101
  * TODO: [🐱‍🚀] Make all properties of `AgentBasicInformation` readonly
@@ -1,4 +1,5 @@
1
- import type { string_knowledge_source_link } from '../../types/typeAliases';
1
+ import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
2
+ import type { string_agent_url, string_knowledge_source_link } from '../../types/typeAliases';
2
3
  import type { TODO_any } from '../../utils/organization/TODO_any';
3
4
  /**
4
5
  * Model requirements for an agent
@@ -20,8 +21,17 @@ export type AgentModelRequirements = {
20
21
  readonly mcpServers?: ReadonlyArray<string>;
21
22
  /**
22
23
  * Optional link to the parent agent from which this agent inherits
24
+ *
25
+ * Note: [🆓] There are several cases what the agent ancestor could be:
26
+ * - 1) `parentAgentUrl` is `string_agent_url` valid agent URL
27
+ * - 2) `parentAgentUrl` is explicitly `null` (forcefully no parent)
28
+ * - 3) `parentAgentUrl` is not defined `undefined`, the default ancestor agent, Adam, will be used
23
29
  */
24
- readonly parentAgentUrl?: string_knowledge_source_link;
30
+ readonly parentAgentUrl?: string_agent_url | null;
31
+ /**
32
+ * List of imported agent URLs
33
+ */
34
+ readonly importedAgentUrls?: ReadonlyArray<string_agent_url>;
25
35
  /**
26
36
  * Optional list of knowledge source links that the agent can use
27
37
  */
@@ -45,6 +55,10 @@ export type AgentModelRequirements = {
45
55
  * Top-k sampling value for the agent's responses
46
56
  */
47
57
  readonly topK?: number;
58
+ /**
59
+ * Tools available for the agent
60
+ */
61
+ readonly tools?: ReadonlyArray<LlmToolDefinition>;
48
62
  /**
49
63
  * Arbitrary metadata storage for commitments
50
64
  * Each commitment can store its own data here
@@ -7,7 +7,7 @@ import type { string_agent_name, string_agent_permanent_id, string_url, string_u
7
7
  *
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
- export declare function generatePlaceholderAgentProfileImageUrl(agentIdOrName: string_agent_permanent_id | string_agent_name, agentsServerUrl?: URL | string_url): string_url_image;
10
+ export declare function generatePlaceholderAgentProfileImageUrl(agentIdOrName: string_agent_permanent_id | string_agent_name, agentsServerUrl: URL | string_url): string_url_image;
11
11
  /**
12
12
  * TODO: [🤹] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
13
13
  */
@@ -3,4 +3,4 @@ import { CHAT_SAVE_FORMATS } from '../index';
3
3
  * Supported chat export formatNames
4
4
  * @public exported from `@promptbook/components`
5
5
  */
6
- export type string_chat_format_name = typeof CHAT_SAVE_FORMATS[number]['formatName'];
6
+ export type string_chat_format_name = (typeof CHAT_SAVE_FORMATS)[number]['formatName'];
@@ -1,7 +1,10 @@
1
1
  import { Message } from '../../../types/Message';
2
2
  import type { id, string_markdown } from '../../../types/typeAliases';
3
3
  /**
4
- * A message in the chat
4
+ * Represents a single message within a chat interface.
5
+ *
6
+ * This type extends the base `Message` type by omitting internal routing fields
7
+ * and adding chat-specific properties like markdown content and generation status.
5
8
  *
6
9
  * @public exported from `@promptbook/components`
7
10
  */
@@ -23,13 +26,30 @@ export type ChatMessage = Omit<Message<id>, 'direction' | 'recipients' | 'thread
23
26
  */
24
27
  isComplete?: boolean;
25
28
  /**
26
- * @@@
29
+ * The expected answer for the message (used for testing or validation)
27
30
  */
28
31
  expectedAnswer?: string;
29
32
  /**
30
- * @@@
33
+ * Indicates if the message was sent via a voice call
31
34
  */
32
35
  isVoiceCall?: boolean;
36
+ /**
37
+ * Optional file attachments
38
+ */
39
+ attachments?: Array<{
40
+ /**
41
+ * The name of the file
42
+ */
43
+ name: string;
44
+ /**
45
+ * The type of the file
46
+ */
47
+ type: string;
48
+ /**
49
+ * The URL where the file is stored
50
+ */
51
+ url: string;
52
+ }>;
33
53
  };
34
54
  /**
35
55
  * TODO: Make all fields readonly
@@ -7,8 +7,12 @@ type DropdownProps = {
7
7
  }>;
8
8
  };
9
9
  /**
10
- * @@@
10
+ * A dropdown menu component that displays a list of actions.
11
11
  *
12
+ * The menu is toggled by a hamburger menu button. When an action is selected,
13
+ * the menu automatically closes.
14
+ *
15
+ * @param props - Contains an array of actions with icons, names, and click handlers
12
16
  * @private internal subcomponent used by various components
13
17
  */
14
18
  export declare function Dropdown({ actions }: DropdownProps): import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,12 @@ type HamburgerMenuProps = {
4
4
  className?: string;
5
5
  };
6
6
  /**
7
- * @@@
7
+ * An animated hamburger menu button component.
8
8
  *
9
+ * This component renders a 3-bar hamburger icon that animates into an "X" when
10
+ * the menu is open.
11
+ *
12
+ * @param props - Contains the open state, an optional click handler, and optional className
9
13
  * @private Internal component
10
14
  */
11
15
  export declare function HamburgerMenu({ isOpen, onClick, className }: HamburgerMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,11 @@
1
1
  import { SVGProps } from 'react';
2
2
  /**
3
- * @@@
3
+ * Renders an information/about icon.
4
4
  *
5
+ * This icon is typically used in UI elements that provide additional information
6
+ * or "about" details to the user.
7
+ *
8
+ * @param props - SVG properties augmented with an optional `size`
5
9
  * @private internal subcomponent used by various components
6
10
  */
7
11
  export declare function AboutIcon(props: SVGProps<SVGSVGElement> & {
@@ -3,9 +3,13 @@ type AttachmentIconProps = {
3
3
  color?: string;
4
4
  };
5
5
  /**
6
- * @@@
6
+ * Renders an attachment icon.
7
7
  *
8
- * @public exported from `@promptbook/components`
8
+ * This icon is typically used in chat interfaces to indicate the ability to
9
+ * upload or view files associated with a message.
10
+ *
11
+ * @param props - SVG properties augmented with an optional `size`
12
+ * @private internal subcomponent used by various components
9
13
  */
10
14
  export declare function AttachmentIcon({ size, color }: AttachmentIconProps): import("react/jsx-runtime").JSX.Element;
11
15
  export {};
@@ -3,9 +3,13 @@ type CameraIconProps = {
3
3
  color?: string;
4
4
  };
5
5
  /**
6
- * @@@
6
+ * Renders a camera icon.
7
7
  *
8
- * @public exported from `@promptbook/components`
8
+ * This icon is typically used in buttons or inputs that trigger image capture
9
+ * or selection.
10
+ *
11
+ * @param props - SVG properties augmented with an optional `size`
12
+ * @private internal subcomponent used by various components
9
13
  */
10
14
  export declare function CameraIcon({ size, color }: CameraIconProps): import("react/jsx-runtime").JSX.Element;
11
15
  export {};
@@ -1,7 +1,11 @@
1
1
  import { SVGProps } from 'react';
2
2
  /**
3
- * @@@
3
+ * Renders a download icon.
4
4
  *
5
+ * This icon is typically used in buttons or links that trigger the downloading
6
+ * of files or assets.
7
+ *
8
+ * @param props - SVG properties augmented with an optional `size`
5
9
  * @private internal subcomponent used by various components
6
10
  */
7
11
  export declare function DownloadIcon(props: SVGProps<SVGSVGElement> & {
@@ -1,7 +1,11 @@
1
1
  import { SVGProps } from 'react';
2
2
  /**
3
- * @@@
3
+ * Renders a menu icon.
4
4
  *
5
+ * This icon is typically used in buttons that toggle the visibility of
6
+ * navigation menus or dropdowns.
7
+ *
8
+ * @param props - SVG properties augmented with an optional `size`
5
9
  * @private internal subcomponent used by various components
6
10
  */
7
11
  export declare function MenuIcon(props: SVGProps<SVGSVGElement> & {
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
2
  /**
3
- * @@@
3
+ * Renders a save icon.
4
4
  *
5
- * @public exported from `@promptbook/components`
5
+ * This icon is typically used in buttons that trigger the saving of data,
6
+ * configurations, or agent sources.
7
+ *
8
+ * @param props - SVG properties augmented with an optional `size`
9
+ * @private internal subcomponent used by various components
6
10
  */
7
11
  export declare function SaveIcon({ size, color, ...props }: {
8
12
  size?: number;
@@ -1,4 +1,4 @@
1
- import { AgentCollectionInSupabase } from './constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
1
+ import type { AgentCollectionInSupabase } from './constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
2
2
  /**
3
3
  * Collection that groups together multiple AI Agents
4
4
  *
@@ -5,9 +5,12 @@ import type { string_agent_name, string_agent_permanent_id } from '../../../../t
5
5
  import { AgentCollectionInSupabaseOptions } from './AgentCollectionInSupabaseOptions';
6
6
  import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
7
7
  /**
8
- * Agent collection stored in Supabase table
8
+ * Agent collection stored in a Supabase table.
9
9
  *
10
- * Note: This object can work both from Node.js and browser environment depending on the Supabase client provided
10
+ * This class provides a way to manage a collection of agents (pipelines) using Supabase
11
+ * as the storage backend. It supports listing, creating, updating, and soft-deleting agents.
12
+ *
13
+ * Note: This object can work both from Node.js and browser environment depending on the Supabase client provided.
11
14
  *
12
15
  * @public exported from `@promptbook/core`
13
16
  * <- TODO: [🐱‍🚀] Move to `@promptbook/supabase` package
@@ -16,9 +19,8 @@ export declare class AgentCollectionInSupabase {
16
19
  private readonly supabaseClient;
17
20
  readonly options?: AgentCollectionInSupabaseOptions | undefined;
18
21
  /**
19
- * @param rootPath - path to the directory with agents
20
- * @param tools - Execution tools to be used in [🐱‍🚀] `Agent` itself and listing the agents
21
- * @param options - Options for the collection creation
22
+ * @param supabaseClient - The initialized Supabase client
23
+ * @param options - Configuration options for the collection (e.g., table prefix, verbosity)
22
24
  */
23
25
  constructor(supabaseClient: SupabaseClient<AgentsDatabaseSchema>, options?: AgentCollectionInSupabaseOptions | undefined);
24
26
  /**
@@ -26,11 +28,11 @@ export declare class AgentCollectionInSupabase {
26
28
  */
27
29
  listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>;
28
30
  /**
29
- * [🐱‍🚀]@@@
31
+ * Retrieves the permanent ID of an agent by its name or permanent ID.
30
32
  */
31
33
  getAgentPermanentId(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_agent_permanent_id>;
32
34
  /**
33
- * [🐱‍🚀]@@@
35
+ * Retrieves the source code of an agent by its name or permanent ID.
34
36
  */
35
37
  getAgentSource(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_book>;
36
38
  /**
@@ -3,4 +3,4 @@ import { COMMANDS } from '../../index';
3
3
  * Command is one piece of the book file section which adds some logic to the task or the whole pipeline.
4
4
  * It is parsed from the markdown from ul/ol items - one command per one item.
5
5
  */
6
- export type Command = ReturnType<typeof COMMANDS[number]['parse']>;
6
+ export type Command = ReturnType<(typeof COMMANDS)[number]['parse']>;
@@ -0,0 +1,34 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * IMPORT commitment definition
5
+ *
6
+ * The IMPORT commitment tells the agent to import content from another agent at the current location.
7
+ *
8
+ * Example usage in agent source:
9
+ *
10
+ * ```book
11
+ * IMPORT https://s6.ptbk.io/benjamin-white
12
+ * ```
13
+ *
14
+ * @private [🪔] Maybe export the commitments through some package
15
+ */
16
+ export declare class ImportCommitmentDefinition extends BaseCommitmentDefinition<'IMPORT' | 'IMPORTS'> {
17
+ constructor(type?: 'IMPORT' | 'IMPORTS');
18
+ /**
19
+ * Short one-line description of IMPORT.
20
+ */
21
+ get description(): string;
22
+ /**
23
+ * Icon for this commitment.
24
+ */
25
+ get icon(): string;
26
+ /**
27
+ * Markdown documentation for IMPORT commitment.
28
+ */
29
+ get documentation(): string;
30
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
+ }
32
+ /**
33
+ * Note: [💞] Ignore a discrepancy between file name and entity name
34
+ */
@@ -0,0 +1,41 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * META DESCRIPTION commitment definition
5
+ *
6
+ * The META DESCRIPTION commitment sets the agent's meta description for the profile page.
7
+ * This commitment is special because it doesn't affect the system message,
8
+ * but is handled separately in the parsing logic.
9
+ *
10
+ * Example usage in agent source:
11
+ *
12
+ * ```book
13
+ * META DESCRIPTION An AI assistant specialized in business tasks
14
+ * ```
15
+ *
16
+ * @private [🪔] Maybe export the commitments through some package
17
+ */
18
+ export declare class MetaDescriptionCommitmentDefinition extends BaseCommitmentDefinition<'META DESCRIPTION'> {
19
+ constructor();
20
+ /**
21
+ * Short one-line description of META DESCRIPTION.
22
+ */
23
+ get description(): string;
24
+ /**
25
+ * Icon for this commitment.
26
+ */
27
+ get icon(): string;
28
+ /**
29
+ * Markdown documentation for META DESCRIPTION commitment.
30
+ */
31
+ get documentation(): string;
32
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
33
+ /**
34
+ * Extracts the meta description from the content
35
+ * This is used by the parsing logic
36
+ */
37
+ extractMetaDescription(content: string): string | null;
38
+ }
39
+ /**
40
+ * Note: [💞] Ignore a discrepancy between file name and entity name
41
+ */
@@ -6,13 +6,13 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
6
6
  * The `USE SEARCH ENGINE` commitment indicates that the agent should utilize a search engine tool
7
7
  * to access and retrieve up-to-date information from the internet when necessary.
8
8
  *
9
- * The content following `USE SEARCH ENGINE` is ignored (similar to NOTE).
9
+ * The content following `USE SEARCH ENGINE` is an arbitrary text that the agent should know (e.g. search scope or instructions).
10
10
  *
11
11
  * Example usage in agent source:
12
12
  *
13
13
  * ```book
14
14
  * USE SEARCH ENGINE
15
- * USE SEARCH ENGINE This will be ignored
15
+ * USE SEARCH ENGINE Hledej informace o Přemyslovcích
16
16
  * ```
17
17
  *
18
18
  * @private [🪔] Maybe export the commitments through some package
@@ -2,4 +2,4 @@ import { COMMITMENT_REGISTRY } from '../index';
2
2
  /**
3
3
  * All available book commitment types
4
4
  */
5
- export type BookCommitment = typeof COMMITMENT_REGISTRY[number]['type'];
5
+ export type BookCommitment = (typeof COMMITMENT_REGISTRY)[number]['type'];
@@ -7,6 +7,7 @@ import { DeleteCommitmentDefinition } from './DELETE/DELETE';
7
7
  import { DictionaryCommitmentDefinition } from './DICTIONARY/DICTIONARY';
8
8
  import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
9
9
  import { FromCommitmentDefinition } from './FROM/FROM';
10
+ import { ImportCommitmentDefinition } from './IMPORT/IMPORT';
10
11
  import { GoalCommitmentDefinition } from './GOAL/GOAL';
11
12
  import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
12
13
  import { LanguageCommitmentDefinition } from './LANGUAGE/LANGUAGE';
@@ -40,7 +41,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
40
41
  *
41
42
  * @private Use functions to access commitments instead of this array directly
42
43
  */
43
- export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
44
+ export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
44
45
  /**
45
46
  * Gets a commitment definition by its type
46
47
  * @param type The commitment type to look up
@@ -1,6 +1,6 @@
1
1
  import type { CsvSettings } from './formats/csv/CsvSettings';
2
2
  import type { IntermediateFilesStrategy } from './types/IntermediateFilesStrategy';
3
- import type { string_app_id, string_email, string_name, string_promptbook_server_url } from './types/typeAliases';
3
+ import type { string_app_id, string_email, string_legal_entity, string_name, string_promptbook_server_url } from './types/typeAliases';
4
4
  import { Color } from './utils/color/Color';
5
5
  /**
6
6
  * Warning message for the generated sections and files files
@@ -22,6 +22,12 @@ export declare const NAME = "Promptbook";
22
22
  * @public exported from `@promptbook/core`
23
23
  */
24
24
  export declare const ADMIN_EMAIL: string_email;
25
+ /**
26
+ * Email of the responsible person
27
+ *
28
+ * @public exported from `@promptbook/core`
29
+ */
30
+ export declare const PROMPTBOOK_LEGAL_ENTITY: string_legal_entity;
25
31
  /**
26
32
  * Name of the responsible person for the Promptbook on GitHub
27
33
  *
@@ -207,6 +213,12 @@ export declare const DEFAULT_INTERMEDIATE_FILES_STRATEGY: IntermediateFilesStrat
207
213
  * @public exported from `@promptbook/core`
208
214
  */
209
215
  export declare const DEFAULT_MAX_PARALLEL_COUNT = 5;
216
+ /**
217
+ * The maximum depth to which recursion can occur
218
+ *
219
+ * @public exported from `@promptbook/core`
220
+ */
221
+ export declare const DEFAULT_MAX_RECURSION = 10;
210
222
  /**
211
223
  * The maximum number of attempts to execute LLM task before giving up
212
224
  *
@@ -295,6 +307,7 @@ export declare const MOMENT_ARG_THRESHOLDS: {
295
307
  /**
296
308
  * Default remote server URL for the Promptbook
297
309
  *
310
+ * @deprecated TODO: !!! Deprecate all things related to pipelines and pipelines server
298
311
  * @public exported from `@promptbook/core`
299
312
  */
300
313
  export declare const DEFAULT_REMOTE_SERVER_URL: string_promptbook_server_url;
@@ -4,4 +4,4 @@ import type { ErrorJson } from './ErrorJson';
4
4
  *
5
5
  * @public exported from `@promptbook/utils`
6
6
  */
7
- export declare function deserializeError(error: ErrorJson): Error;
7
+ export declare function deserializeError(error: ErrorJson, isStackAddedToMessage?: boolean): Error;
@@ -1,4 +1,5 @@
1
1
  import type { string_date_iso8601, string_model_name, string_prompt } from '../types/typeAliases';
2
+ import type { TODO_any } from '../utils/organization/TODO_any';
2
3
  import type { TODO_object } from '../utils/organization/TODO_object';
3
4
  import type { EmbeddingVector } from './EmbeddingVector';
4
5
  import type { Usage } from './Usage';
@@ -21,7 +22,29 @@ export type CompletionPromptResult = CommonPromptResult;
21
22
  *
22
23
  * Note: [🚉] This is fully serializable as JSON
23
24
  */
24
- export type ChatPromptResult = CommonPromptResult & {};
25
+ export type ChatPromptResult = CommonPromptResult & {
26
+ /**
27
+ * Optional tool calls made during the execution
28
+ */
29
+ readonly toolCalls?: ReadonlyArray<{
30
+ /**
31
+ * Name of the tool
32
+ */
33
+ readonly name: string;
34
+ /**
35
+ * Arguments of the tool call
36
+ */
37
+ readonly arguments: string;
38
+ /**
39
+ * Result of the tool call
40
+ */
41
+ readonly result: string;
42
+ /**
43
+ * Raw tool call from the model
44
+ */
45
+ readonly rawToolCall: TODO_any;
46
+ }>;
47
+ };
25
48
  /**
26
49
  * Image prompt result
27
50
  *
@@ -7,4 +7,4 @@ import { FORMFACTOR_DEFINITIONS } from '../index';
7
7
  * Note: [🚉] This is fully serializable as JSON
8
8
  * @see https://github.com/webgptorg/promptbook/discussions/172
9
9
  */
10
- export type FormfactorDefinition = typeof FORMFACTOR_DEFINITIONS[number];
10
+ export type FormfactorDefinition = (typeof FORMFACTOR_DEFINITIONS)[number];
@@ -21,7 +21,7 @@ export declare function $provideLlmToolsForTestingAndScriptsAndPlayground(option
21
21
  export {};
22
22
  /**
23
23
  * Note: [⚪] This should never be in any released package
24
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
24
+ * TODO: [👷‍♂️] Write a comprehensive manual about the construction of LLM tools
25
25
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
26
26
  * TODO: [®] DRY Register logi
27
27
  */
@@ -51,7 +51,7 @@ export declare function $provideLlmToolsForWizardOrCli(options?: ProvideLlmTools
51
51
  export {};
52
52
  /**
53
53
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
54
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
54
+ * TODO: [👷‍♂️] Write a comprehensive manual about the construction of LLM tools
55
55
  * TODO: [🥃] Allow `ptbk make` without llm tools
56
56
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
57
57
  * TODO: [®] DRY Register logic
@@ -17,6 +17,6 @@ export type LlmExecutionToolsWithTotalUsage = LlmExecutionTools & {
17
17
  spending(): Observable<Usage>;
18
18
  };
19
19
  /**
20
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
20
+ * TODO: [👷‍♂️] Write a comprehensive manual about the construction of LLM tools
21
21
  * Note: [🥫] Not using getter `get totalUsage` but `getTotalUsage` to allow this object to be proxied
22
22
  */