@promptbook/node 0.101.0-9 โ†’ 0.101.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 (88) hide show
  1. package/README.md +0 -4
  2. package/esm/index.es.js +59 -112
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/components.index.d.ts +14 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +12 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +8 -0
  7. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +11 -4
  8. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +3 -0
  9. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +4 -22
  10. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +1 -26
  11. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +0 -12
  12. package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +0 -24
  13. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +0 -12
  14. package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +0 -12
  15. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -6
  16. package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +0 -12
  17. package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +0 -12
  18. package/esm/typings/src/book-2.0/commitments/META/META.d.ts +0 -6
  19. package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +0 -6
  20. package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +0 -6
  21. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +23 -14
  22. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +2 -14
  23. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +0 -12
  24. package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +0 -12
  25. package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +0 -12
  26. package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +0 -12
  27. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +0 -12
  28. package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +1 -1
  29. package/esm/typings/src/book-2.0/commitments/index.d.ts +1 -1
  30. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -0
  31. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +5 -2
  32. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +3 -0
  33. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +18 -1
  34. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +8 -0
  35. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +2 -15
  36. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +9 -0
  37. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
  38. package/esm/typings/src/book-components/Chat/hooks/index.d.ts +2 -0
  39. package/esm/typings/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +41 -0
  40. package/esm/typings/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +44 -0
  41. package/esm/typings/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -0
  42. package/esm/typings/src/book-components/icons/PauseIcon.d.ts +8 -0
  43. package/esm/typings/src/book-components/icons/PlayIcon.d.ts +8 -0
  44. package/esm/typings/src/execution/PromptResult.d.ts +2 -4
  45. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -2
  46. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +1 -3
  47. package/esm/typings/src/formats/csv/CsvFormatError.d.ts +1 -1
  48. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  49. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -2
  51. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +8 -2
  52. package/esm/typings/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +25 -0
  53. package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +7 -18
  54. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +11 -0
  55. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +2 -1
  56. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +58 -0
  57. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +29 -0
  58. package/esm/typings/src/llm-providers/agent/playground/playground.d.ts +8 -0
  59. package/esm/typings/src/llm-providers/agent/register-configuration.d.ts +11 -0
  60. package/esm/typings/src/llm-providers/agent/register-constructor.d.ts +13 -0
  61. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -8
  62. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -5
  63. package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -0
  64. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +4 -10
  65. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +4 -6
  66. package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +3 -3
  67. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +16 -8
  68. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +3 -8
  69. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +5 -14
  70. package/esm/typings/src/personas/preparePersona.d.ts +1 -0
  71. package/esm/typings/src/remote-server/openapi-types.d.ts +31 -31
  72. package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -2
  73. package/esm/typings/src/types/ModelRequirements.d.ts +2 -4
  74. package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +1 -1
  75. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +1 -1
  76. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +0 -1
  77. package/esm/typings/src/utils/markdown/promptbookifyAiText.d.ts +2 -2
  78. package/esm/typings/src/version.d.ts +1 -1
  79. package/package.json +2 -2
  80. package/umd/index.umd.js +59 -112
  81. package/umd/index.umd.js.map +1 -1
  82. package/esm/typings/src/book-2.0/utils/extractAgentMetadata.d.ts +0 -17
  83. package/esm/typings/src/book-2.0/utils/extractProfileImageFromSystemMessage.d.ts +0 -12
  84. package/esm/typings/src/book-components/Chat/examples/ChatMarkdownDemo.d.ts +0 -16
  85. package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +0 -10
  86. package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +0 -10
  87. package/esm/typings/src/llm-providers/_common/profiles/llmProviderProfiles.d.ts +0 -81
  88. /package/esm/typings/src/llm-providers/_common/{profiles/test/llmProviderProfiles.test.d.ts โ†’ utils/removeUnsupportedModelRequirements.test.d.ts} +0 -0
@@ -15,13 +15,20 @@ import { BookEditor } from '../book-components/BookEditor/BookEditor';
15
15
  import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
16
16
  import { Chat } from '../book-components/Chat/Chat/Chat';
17
17
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
18
+ import { useChatAutoScroll } from '../book-components/Chat/hooks/useChatAutoScroll';
19
+ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
20
+ import { useSendMessageToLlmChat } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
18
21
  import { LlmChat } from '../book-components/Chat/LlmChat/LlmChat';
19
22
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
20
23
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
21
24
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
25
+ import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
26
+ import { parseMessageButtons } from '../book-components/Chat/utils/parseMessageButtons';
22
27
  import { renderMarkdown } from '../book-components/Chat/utils/renderMarkdown';
23
28
  import { isMarkdownContent } from '../book-components/Chat/utils/renderMarkdown';
24
29
  import { ArrowIcon } from '../book-components/icons/ArrowIcon';
30
+ import { PauseIcon } from '../book-components/icons/PauseIcon';
31
+ import { PlayIcon } from '../book-components/icons/PlayIcon';
25
32
  import { ResetIcon } from '../book-components/icons/ResetIcon';
26
33
  import { SendIcon } from '../book-components/icons/SendIcon';
27
34
  import { TemplateIcon } from '../book-components/icons/TemplateIcon';
@@ -42,13 +49,20 @@ export { BookEditor };
42
49
  export { DEFAULT_BOOK_FONT_CLASS };
43
50
  export { Chat };
44
51
  export type { ChatProps };
52
+ export { useChatAutoScroll };
53
+ export type { SendMessageToLlmChatFunction };
54
+ export { useSendMessageToLlmChat };
45
55
  export { LlmChat };
46
56
  export type { LlmChatProps };
47
57
  export type { ChatMessage };
48
58
  export type { ChatParticipant };
59
+ export type { MessageButton };
60
+ export { parseMessageButtons };
49
61
  export { renderMarkdown };
50
62
  export { isMarkdownContent };
51
63
  export { ArrowIcon };
64
+ export { PauseIcon };
65
+ export { PlayIcon };
52
66
  export { ResetIcon };
53
67
  export { SendIcon };
54
68
  export { TemplateIcon };
@@ -1,5 +1,6 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
3
+ import { createAgentModelRequirementsWithCommitments } from '../book-2.0/agent-source/createAgentModelRequirementsWithCommitments';
3
4
  import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
4
5
  import { parseParameters } from '../book-2.0/agent-source/parseParameters';
5
6
  import { isValidBook } from '../book-2.0/agent-source/string_book';
@@ -119,8 +120,13 @@ import { createLlmToolsFromConfiguration } from '../llm-providers/_common/regist
119
120
  import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
120
121
  import { countUsage } from '../llm-providers/_common/utils/count-total-usage/countUsage';
121
122
  import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
123
+ import { getSingleLlmExecutionTools } from '../llm-providers/_multiple/getSingleLlmExecutionTools';
122
124
  import { joinLlmExecutionTools } from '../llm-providers/_multiple/joinLlmExecutionTools';
123
125
  import { MultipleLlmExecutionTools } from '../llm-providers/_multiple/MultipleLlmExecutionTools';
126
+ import { AgentLlmExecutionTools } from '../llm-providers/agent/AgentLlmExecutionTools';
127
+ import { createAgentLlmExecutionTools } from '../llm-providers/agent/createAgentLlmExecutionTools';
128
+ import { _AgentMetadata } from '../llm-providers/agent/register-configuration';
129
+ import { _AgentRegistration } from '../llm-providers/agent/register-constructor';
124
130
  import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
125
131
  import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
126
132
  import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
@@ -166,6 +172,7 @@ import { TaskTypes } from '../types/TaskType';
166
172
  import { REMOTE_SERVER_URLS } from '../../servers';
167
173
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
168
174
  export { createAgentModelRequirements };
175
+ export { createAgentModelRequirementsWithCommitments };
169
176
  export { parseAgentSource };
170
177
  export { parseParameters };
171
178
  export { isValidBook };
@@ -285,8 +292,13 @@ export { createLlmToolsFromConfiguration };
285
292
  export { cacheLlmTools };
286
293
  export { countUsage };
287
294
  export { limitTotalUsage };
295
+ export { getSingleLlmExecutionTools };
288
296
  export { joinLlmExecutionTools };
289
297
  export { MultipleLlmExecutionTools };
298
+ export { AgentLlmExecutionTools };
299
+ export { createAgentLlmExecutionTools };
300
+ export { _AgentMetadata };
301
+ export { _AgentRegistration };
290
302
  export { _AnthropicClaudeMetadataRegistration };
291
303
  export { _AzureOpenAiMetadataRegistration };
292
304
  export { _DeepseekMetadataRegistration };
@@ -13,9 +13,12 @@ import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/Ava
13
13
  import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
14
14
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
15
15
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
16
+ import type { ChatAutoScrollConfig } from '../book-components/Chat/hooks/useChatAutoScroll';
17
+ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
16
18
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
17
19
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
18
20
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
21
+ import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
19
22
  import type { PipelineCollection } from '../collection/PipelineCollection';
20
23
  import type { Command } from '../commands/_common/types/Command';
21
24
  import type { CommandParser } from '../commands/_common/types/CommandParser';
@@ -93,6 +96,7 @@ import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmTools
93
96
  import type { CacheItem } from '../llm-providers/_common/utils/cache/CacheItem';
94
97
  import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
95
98
  import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
99
+ import type { CreateAgentLlmExecutionToolsOptions } from '../llm-providers/agent/createAgentLlmExecutionTools';
96
100
  import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
97
101
  import type { AnthropicClaudeExecutionToolsNonProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
98
102
  import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
@@ -338,9 +342,12 @@ export type { MockedChatDelayConfig };
338
342
  export type { MockedChatProps };
339
343
  export type { BookEditorProps };
340
344
  export type { ChatProps };
345
+ export type { ChatAutoScrollConfig };
346
+ export type { SendMessageToLlmChatFunction };
341
347
  export type { LlmChatProps };
342
348
  export type { ChatMessage };
343
349
  export type { ChatParticipant };
350
+ export type { MessageButton };
344
351
  export type { PipelineCollection };
345
352
  export type { Command };
346
353
  export type { CommandParser };
@@ -418,6 +425,7 @@ export type { LlmToolsOptions };
418
425
  export type { CacheItem };
419
426
  export type { CacheLlmToolsOptions };
420
427
  export type { LlmExecutionToolsWithTotalUsage };
428
+ export type { CreateAgentLlmExecutionToolsOptions };
421
429
  export type { AnthropicClaudeExecutionToolsOptions };
422
430
  export type { AnthropicClaudeExecutionToolsNonProxiedOptions };
423
431
  export type { AnthropicClaudeExecutionToolsProxiedOptions };
@@ -35,10 +35,17 @@ export type AgentBasicInformation = {
35
35
  */
36
36
  personaDescription: string | null;
37
37
  /**
38
- * Optional profile image URL
39
- * This is the line starting with "META IMAGE"
40
- */
41
- profileImageUrl: string_url_image;
38
+ * Metadata commitments parsed from META lines
39
+ * Each META commitment has the format "META TYPE content"
40
+ * When there are multiple meta commitments of the same type, later overrides earlier
41
+ */
42
+ meta: {
43
+ image?: string_url_image;
44
+ link?: string;
45
+ title?: string;
46
+ description?: string;
47
+ [key: string]: string | undefined;
48
+ };
42
49
  /**
43
50
  * Parameters found in the agent source
44
51
  * Supports two different notations for the same syntax feature:
@@ -35,3 +35,6 @@ export type AgentModelRequirements = {
35
35
  */
36
36
  readonly metadata?: Record<string, TODO_any>;
37
37
  };
38
+ /**
39
+ * TODO: [๐Ÿค] DRY `AgentModelRequirements` and `ModelRequirements`
40
+ */
@@ -1,36 +1,18 @@
1
+ import type { AvailableModel } from '../../execution/AvailableModel';
2
+ import { LlmExecutionTools } from '../../execution/LlmExecutionTools';
1
3
  import type { string_model_name } from '../../types/typeAliases';
2
4
  import type { AgentModelRequirements } from './AgentModelRequirements';
3
5
  import type { string_book } from './string_book';
4
6
  /**
5
7
  * Creates model requirements for an agent based on its source
6
- * Results are cached to improve performance for repeated calls with the same agentSource and modelName
7
8
  *
8
9
  * There are 2 similar functions:
9
10
  * - `parseAgentSource` which is a lightweight parser for agent source, it parses basic information and its purpose is to be quick and synchronous. The commitments there are hardcoded.
10
- * - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronously.
11
+ * - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronous.
11
12
  *
12
13
  * @public exported from `@promptbook/core`
13
14
  */
14
- export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
15
- /**
16
- * Clears the cache for createAgentModelRequirements
17
- * Useful when agent sources are updated and cached results should be invalidated
18
- *
19
- * @private
20
- */
21
- export declare function clearAgentModelRequirementsCache(): void;
22
- /**
23
- * Removes cache entries for a specific agent source (all model variants)
24
- * @param agentSource The agent source to remove from cache
25
- * @private
26
- */
27
- export declare function invalidateAgentModelRequirementsCache(agentSource: string_book): void;
28
- /**
29
- * Gets the current cache size (for debugging/monitoring)
30
- *
31
- * @private
32
- */
33
- export declare function getAgentModelRequirementsCacheSize(): number;
15
+ export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string_model_name, availableModels?: readonly AvailableModel[], llmTools?: LlmExecutionTools): Promise<AgentModelRequirements>;
34
16
  /**
35
17
  * Extracts MCP servers from agent source
36
18
  *
@@ -6,31 +6,6 @@ import type { string_book } from './string_book';
6
6
  * This function uses a reduce-like pattern where each commitment applies its changes
7
7
  * to build the final requirements starting from a basic empty model
8
8
  *
9
- * @private - TODO: [๐Ÿง ] Maybe should be public?
9
+ * @public exported from `@promptbook/core`
10
10
  */
11
11
  export declare function createAgentModelRequirementsWithCommitments(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
12
- /**
13
- * Cached version of createAgentModelRequirementsWithCommitments
14
- * This maintains the same caching behavior as the original function
15
- *
16
- * @private
17
- */
18
- export declare function createAgentModelRequirementsWithCommitmentsCached(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
19
- /**
20
- * Clears the cache for createAgentModelRequirementsWithCommitments
21
- *
22
- * @private
23
- */
24
- export declare function clearAgentModelRequirementsWithCommitmentsCache(): void;
25
- /**
26
- * Removes cache entries for a specific agent source
27
- *
28
- * @private
29
- */
30
- export declare function invalidateAgentModelRequirementsWithCommitmentsCache(agentSource: string_book): void;
31
- /**
32
- * Gets the current cache size
33
- *
34
- * @private
35
- */
36
- export declare function getAgentModelRequirementsWithCommitmentsCacheSize(): number;
@@ -27,18 +27,6 @@ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition
27
27
  get documentation(): string;
28
28
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
29
29
  }
30
- /**
31
- * Singleton instance of the ACTION commitment definition
32
- *
33
- * @private [๐Ÿช”] Maybe export the commitments through some package
34
- */
35
- export declare const ActionCommitment: ActionCommitmentDefinition;
36
- /**
37
- * Singleton instance of the ACTIONS commitment definition
38
- *
39
- * @private [๐Ÿช”] Maybe export the commitments through some package
40
- */
41
- export declare const ActionsCommitment: ActionCommitmentDefinition;
42
30
  /**
43
31
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
44
32
  */
@@ -30,30 +30,6 @@ export declare class DeleteCommitmentDefinition extends BaseCommitmentDefinition
30
30
  get documentation(): string;
31
31
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
32
  }
33
- /**
34
- * Singleton instances of the DELETE commitment definitions with aliases
35
- *
36
- * @private [๐Ÿช”] Maybe export the commitments through some package
37
- */
38
- export declare const DeleteCommitment: DeleteCommitmentDefinition;
39
- /**
40
- * Singleton instances of the DELETE commitment definitions with aliases
41
- *
42
- * @private [๐Ÿช”] Maybe export the commitments through some package
43
- */
44
- export declare const CancelCommitment: DeleteCommitmentDefinition;
45
- /**
46
- * Singleton instances of the DELETE commitment definitions with aliases
47
- *
48
- * @private [๐Ÿช”] Maybe export the commitments through some package
49
- */
50
- export declare const DiscardCommitment: DeleteCommitmentDefinition;
51
- /**
52
- * Singleton instances of the DELETE commitment definitions with aliases
53
- *
54
- * @private [๐Ÿช”] Maybe export the commitments through some package
55
- */
56
- export declare const RemoveCommitment: DeleteCommitmentDefinition;
57
33
  /**
58
34
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
59
35
  */
@@ -28,18 +28,6 @@ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition
28
28
  get documentation(): string;
29
29
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
30
30
  }
31
- /**
32
- * Singleton instance of the FORMAT commitment definition
33
- *
34
- * @private [๐Ÿช”] Maybe export the commitments through some package
35
- */
36
- export declare const FormatCommitment: FormatCommitmentDefinition;
37
- /**
38
- * Singleton instance of the FORMATS commitment definition
39
- *
40
- * @private [๐Ÿช”] Maybe export the commitments through some package
41
- */
42
- export declare const FormatsCommitment: FormatCommitmentDefinition;
43
31
  /**
44
32
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
45
33
  */
@@ -28,18 +28,6 @@ export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'
28
28
  get documentation(): string;
29
29
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
30
30
  }
31
- /**
32
- * Singleton instance of the GOAL commitment definition
33
- *
34
- * @private [๐Ÿช”] Maybe export the commitments through some package
35
- */
36
- export declare const GoalCommitment: GoalCommitmentDefinition;
37
- /**
38
- * Singleton instance of the GOALS commitment definition
39
- *
40
- * @private [๐Ÿช”] Maybe export the commitments through some package
41
- */
42
- export declare const GoalsCommitment: GoalCommitmentDefinition;
43
31
  /**
44
32
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
45
33
  */
@@ -34,12 +34,6 @@ export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinit
34
34
  */
35
35
  private isUrl;
36
36
  }
37
- /**
38
- * Singleton instance of the KNOWLEDGE commitment definition !!!!
39
- *
40
- * @private [๐Ÿช”] Maybe export the commitments through some package
41
- */
42
- export declare const KnowledgeCommitment: KnowledgeCommitmentDefinition;
43
37
  /**
44
38
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
45
39
  */
@@ -29,18 +29,6 @@ export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition
29
29
  get documentation(): string;
30
30
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
31
  }
32
- /**
33
- * Singleton instance of the MEMORY commitment definition
34
- *
35
- * @private [๐Ÿช”] Maybe export the commitments through some package
36
- */
37
- export declare const MemoryCommitment: MemoryCommitmentDefinition;
38
- /**
39
- * Singleton instance of the MEMORIES commitment definition
40
- *
41
- * @private [๐Ÿช”] Maybe export the commitments through some package
42
- */
43
- export declare const MemoriesCommitment: MemoryCommitmentDefinition;
44
32
  /**
45
33
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
46
34
  */
@@ -30,18 +30,6 @@ export declare class MessageCommitmentDefinition extends BaseCommitmentDefinitio
30
30
  get documentation(): string;
31
31
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
32
  }
33
- /**
34
- * Singleton instance of the MESSAGE commitment definition
35
- *
36
- * @private [๐Ÿช”] Maybe export the commitments through some package
37
- */
38
- export declare const MessageCommitment: MessageCommitmentDefinition;
39
- /**
40
- * Singleton instance of the MESSAGES commitment definition
41
- *
42
- * @private [๐Ÿช”] Maybe export the commitments through some package
43
- */
44
- export declare const MessagesCommitment: MessageCommitmentDefinition;
45
33
  /**
46
34
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
47
35
  */
@@ -51,12 +51,6 @@ export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`
51
51
  */
52
52
  isKnownMetaType(metaType: string): boolean;
53
53
  }
54
- /**
55
- * Singleton instance of the META commitment definition
56
- *
57
- * @private [๐Ÿช”] Maybe export the commitments through some package
58
- */
59
- export declare const MetaCommitment: MetaCommitmentDefinition;
60
54
  /**
61
55
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
62
56
  */
@@ -33,12 +33,6 @@ export declare class MetaImageCommitmentDefinition extends BaseCommitmentDefinit
33
33
  */
34
34
  extractProfileImageUrl(content: string): string | null;
35
35
  }
36
- /**
37
- * Singleton instance of the META IMAGE commitment definition
38
- *
39
- * @private [๐Ÿช”] Maybe export the commitments through some package
40
- */
41
- export declare const MetaImageCommitment: MetaImageCommitmentDefinition;
42
36
  /**
43
37
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
44
38
  */
@@ -45,12 +45,6 @@ export declare class MetaLinkCommitmentDefinition extends BaseCommitmentDefiniti
45
45
  */
46
46
  isValidUrl(content: string): boolean;
47
47
  }
48
- /**
49
- * Singleton instance of the META LINK commitment definition
50
- *
51
- * @private [๐Ÿช”] Maybe export the commitments through some package
52
- */
53
- export declare const MetaLinkCommitment: MetaLinkCommitmentDefinition;
54
48
  /**
55
49
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
56
50
  */
@@ -4,16 +4,25 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
4
4
  * MODEL commitment definition
5
5
  *
6
6
  * The MODEL commitment specifies which AI model to use and can also set
7
- * model-specific parameters like temperature, topP, and topK.
7
+ * model-specific parameters like temperature, topP, topK, and maxTokens.
8
8
  *
9
- * Example usage in agent source:
9
+ * Supports multiple syntax variations:
10
10
  *
11
+ * Single-line format:
11
12
  * ```book
12
13
  * MODEL gpt-4
13
14
  * MODEL claude-3-opus temperature=0.3
14
15
  * MODEL gpt-3.5-turbo temperature=0.8 topP=0.9
15
16
  * ```
16
17
  *
18
+ * Multi-line named parameter format:
19
+ * ```book
20
+ * MODEL NAME gpt-4
21
+ * MODEL TEMPERATURE 0.7
22
+ * MODEL TOP_P 0.9
23
+ * MODEL MAX_TOKENS 2048
24
+ * ```
25
+ *
17
26
  * @private [๐Ÿช”] Maybe export the commitments through some package
18
27
  */
19
28
  export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL' | 'MODELS'> {
@@ -27,19 +36,19 @@ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<
27
36
  */
28
37
  get documentation(): string;
29
38
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
39
+ /**
40
+ * Check if the first part is a known named parameter
41
+ */
42
+ private isNamedParameter;
43
+ /**
44
+ * Parse the new named parameter format: "MODEL TEMPERATURE 0.7"
45
+ */
46
+ private parseNamedParameter;
47
+ /**
48
+ * Parse the legacy format: "MODEL gpt-4 temperature=0.3 topP=0.9"
49
+ */
50
+ private parseLegacyFormat;
30
51
  }
31
- /**
32
- * Singleton instance of the MODEL commitment definition
33
- *
34
- * @private [๐Ÿช”] Maybe export the commitments through some package
35
- */
36
- export declare const ModelCommitment: ModelCommitmentDefinition;
37
- /**
38
- * Singleton instance of the MODELS commitment definition
39
- *
40
- * @private [๐Ÿช”] Maybe export the commitments through some package
41
- */
42
- export declare const ModelsCommitment: ModelCommitmentDefinition;
43
52
  /**
44
53
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
45
54
  */
@@ -26,8 +26,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
26
26
  *
27
27
  * @private [๐Ÿช”] Maybe export the commitments through some package
28
28
  */
29
- export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES'> {
30
- constructor(type?: 'NOTE' | 'NOTES');
29
+ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE'> {
30
+ constructor(type?: 'NOTE' | 'NOTES' | 'COMMENT' | 'NONCE');
31
31
  /**
32
32
  * Short one-line description of NOTE.
33
33
  */
@@ -38,18 +38,6 @@ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'
38
38
  get documentation(): string;
39
39
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
40
40
  }
41
- /**
42
- * Singleton instance of the NOTE commitment definition
43
- *
44
- * @private [๐Ÿช”] Maybe export the commitments through some package
45
- */
46
- export declare const NoteCommitment: NoteCommitmentDefinition;
47
- /**
48
- * Singleton instance of the NOTES commitment definition
49
- *
50
- * @private [๐Ÿช”] Maybe export the commitments through some package
51
- */
52
- export declare const NotesCommitment: NoteCommitmentDefinition;
53
41
  /**
54
42
  * [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
55
43
  */
@@ -35,18 +35,6 @@ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinitio
35
35
  get documentation(): string;
36
36
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
37
37
  }
38
- /**
39
- * Singleton instance of the PERSONA commitment definition
40
- *
41
- * @private [๐Ÿช”] Maybe export the commitments through some package
42
- */
43
- export declare const PersonaCommitment: PersonaCommitmentDefinition;
44
- /**
45
- * Singleton instance of the PERSONAE commitment definition
46
- *
47
- * @private [๐Ÿช”] Maybe export the commitments through some package
48
- */
49
- export declare const PersonaeCommitment: PersonaCommitmentDefinition;
50
38
  /**
51
39
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
52
40
  */
@@ -27,18 +27,6 @@ export declare class RuleCommitmentDefinition extends BaseCommitmentDefinition<'
27
27
  get documentation(): string;
28
28
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
29
29
  }
30
- /**
31
- * Singleton instances of the RULE commitment definitions
32
- *
33
- * @private [๐Ÿช”] Maybe export the commitments through some package
34
- */
35
- export declare const RuleCommitment: RuleCommitmentDefinition;
36
- /**
37
- * Singleton instances of the RULE commitment definitions
38
- *
39
- * @private [๐Ÿช”] Maybe export the commitments through some package
40
- */
41
- export declare const RulesCommitment: RuleCommitmentDefinition;
42
30
  /**
43
31
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
44
32
  */
@@ -27,18 +27,6 @@ export declare class SampleCommitmentDefinition extends BaseCommitmentDefinition
27
27
  get documentation(): string;
28
28
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
29
29
  }
30
- /**
31
- * Singleton instances of the SAMPLE commitment definitions
32
- *
33
- * @private [๐Ÿช”] Maybe export the commitments through some package
34
- */
35
- export declare const SampleCommitment: SampleCommitmentDefinition;
36
- /**
37
- * Singleton instances of the SAMPLE commitment definitions
38
- *
39
- * @private [๐Ÿช”] Maybe export the commitments through some package
40
- */
41
- export declare const ExampleCommitment: SampleCommitmentDefinition;
42
30
  /**
43
31
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
44
32
  */
@@ -29,18 +29,6 @@ export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefiniti
29
29
  get documentation(): string;
30
30
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
31
  }
32
- /**
33
- * Singleton instance of the SCENARIO commitment definition
34
- *
35
- * @private [๐Ÿช”] Maybe export the commitments through some package
36
- */
37
- export declare const ScenarioCommitment: ScenarioCommitmentDefinition;
38
- /**
39
- * Singleton instance of the SCENARIOS commitment definition
40
- *
41
- * @private [๐Ÿช”] Maybe export the commitments through some package
42
- */
43
- export declare const ScenariosCommitment: ScenarioCommitmentDefinition;
44
32
  /**
45
33
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
46
34
  */
@@ -27,18 +27,6 @@ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<
27
27
  get documentation(): string;
28
28
  applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
29
29
  }
30
- /**
31
- * Singleton instance of the STYLE commitment definition
32
- *
33
- * @private [๐Ÿช”] Maybe export the commitments through some package
34
- */
35
- export declare const StyleCommitment: StyleCommitmentDefinition;
36
- /**
37
- * Singleton instance of the STYLES commitment definition
38
- *
39
- * @private [๐Ÿช”] Maybe export the commitments through some package
40
- */
41
- export declare const StylesCommitment: StyleCommitmentDefinition;
42
30
  /**
43
31
  * [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
44
32
  */
@@ -15,5 +15,5 @@ export declare function createEmptyAgentModelRequirements(): AgentModelRequireme
15
15
  */
16
16
  export declare function createBasicAgentModelRequirements(agentName: string | null): AgentModelRequirements;
17
17
  /**
18
- * TODO: !!! Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
18
+ * TODO: [๐Ÿค] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
19
19
  */
@@ -23,7 +23,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
23
23
  *
24
24
  * @private Use functions to access commitments instead of this array directly
25
25
  */
26
- export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
26
+ export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
27
27
  /**
28
28
  * Gets a commitment definition by its type
29
29
  * @param type The commitment type to look up
@@ -8,3 +8,6 @@ import { string_agent_name, string_url_image } from '../../types/typeAliases';
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare function generatePlaceholderAgentProfileImageUrl(agentName?: string_agent_name): string_url_image;
11
+ /**
12
+ * TODO: [๐Ÿคน] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
13
+ */