@promptbook/fake-llm 0.105.0-14 → 0.105.0-16

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 (26) hide show
  1. package/esm/index.es.js +506 -17
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/core.index.d.ts +10 -0
  4. package/esm/typings/src/_packages/types.index.d.ts +6 -0
  5. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +1 -1
  6. package/esm/typings/src/book-2.0/agent-source/parseTeamCommitment.d.ts +28 -0
  7. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +2 -7
  8. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +1 -6
  9. package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -0
  10. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +10 -37
  11. package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +2 -5
  12. package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +64 -0
  13. package/esm/typings/src/book-components/icons/SettingsIcon.d.ts +11 -0
  14. package/esm/typings/src/commitments/TEAM/TEAM.d.ts +45 -0
  15. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +1 -0
  16. package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +2 -0
  17. package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
  18. package/esm/typings/src/commitments/index.d.ts +2 -1
  19. package/esm/typings/src/constants.d.ts +125 -0
  20. package/esm/typings/src/execution/PromptResult.d.ts +2 -19
  21. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -0
  22. package/esm/typings/src/types/ToolCall.d.ts +37 -0
  23. package/esm/typings/src/version.d.ts +1 -1
  24. package/package.json +4 -2
  25. package/umd/index.umd.js +509 -19
  26. package/umd/index.umd.js.map +1 -1
@@ -75,6 +75,11 @@ import { MODEL_TRUST_LEVELS } from '../constants';
75
75
  import { MODEL_ORDERS } from '../constants';
76
76
  import { ORDER_OF_PIPELINE_JSON } from '../constants';
77
77
  import { RESERVED_PARAMETER_NAMES } from '../constants';
78
+ import { LIMITS } from '../constants';
79
+ import { TIME_INTERVALS } from '../constants';
80
+ import { NETWORK_LIMITS } from '../constants';
81
+ import { COLOR_CONSTANTS } from '../constants';
82
+ import { HTTP_STATUS_CODES } from '../constants';
78
83
  import { compilePipeline } from '../conversion/compilePipeline';
79
84
  import { parsePipeline } from '../conversion/parsePipeline';
80
85
  import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
@@ -275,6 +280,11 @@ export { MODEL_TRUST_LEVELS };
275
280
  export { MODEL_ORDERS };
276
281
  export { ORDER_OF_PIPELINE_JSON };
277
282
  export { RESERVED_PARAMETER_NAMES };
283
+ export { LIMITS };
284
+ export { TIME_INTERVALS };
285
+ export { NETWORK_LIMITS };
286
+ export { COLOR_CONSTANTS };
287
+ export { HTTP_STATUS_CODES };
278
288
  export { compilePipeline };
279
289
  export { parsePipeline };
280
290
  export { pipelineJsonToString };
@@ -17,9 +17,11 @@ import type { MockedChatDelayConfig } from '../book-components/Chat/MockedChat/M
17
17
  import type { MockedChatProps } from '../book-components/Chat/MockedChat/MockedChat';
18
18
  import type { ChatSaveFormatDefinition } from '../book-components/Chat/save/_common/ChatSaveFormatDefinition';
19
19
  import type { string_chat_format_name } from '../book-components/Chat/save/_common/string_chat_format_name';
20
+ import type { ChatToolCall } from '../book-components/Chat/types/ChatMessage';
20
21
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
21
22
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
22
23
  import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
24
+ import type { TeamToolResult } from '../book-components/Chat/utils/toolCallParsing';
23
25
  import type { QrCodeOptions } from '../book-components/Qr/useQrCode';
24
26
  import type { AgentCollection } from '../collection/agent-collection/AgentCollection';
25
27
  import type { AgentCollectionInSupabaseOptions } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions';
@@ -213,6 +215,7 @@ import type { SpeechRecognitionStartOptions } from '../types/SpeechRecognition';
213
215
  import type { SpeechRecognitionState } from '../types/SpeechRecognition';
214
216
  import type { SpeechRecognitionEvent } from '../types/SpeechRecognition';
215
217
  import type { TaskType } from '../types/TaskType';
218
+ import type { ToolCall } from '../types/ToolCall';
216
219
  import type { string_char_emoji } from '../types/typeAliasEmoji';
217
220
  import type { string_business_category_name } from '../types/typeAliases';
218
221
  import type { string_model_name } from '../types/typeAliases';
@@ -397,9 +400,11 @@ export type { MockedChatDelayConfig };
397
400
  export type { MockedChatProps };
398
401
  export type { ChatSaveFormatDefinition };
399
402
  export type { string_chat_format_name };
403
+ export type { ChatToolCall };
400
404
  export type { ChatMessage };
401
405
  export type { ChatParticipant };
402
406
  export type { MessageButton };
407
+ export type { TeamToolResult };
403
408
  export type { QrCodeOptions };
404
409
  export type { AgentCollection };
405
410
  export type { AgentCollectionInSupabaseOptions };
@@ -593,6 +598,7 @@ export type { SpeechRecognitionStartOptions };
593
598
  export type { SpeechRecognitionState };
594
599
  export type { SpeechRecognitionEvent };
595
600
  export type { TaskType };
601
+ export type { ToolCall };
596
602
  export type { string_char_emoji };
597
603
  export type { string_business_category_name };
598
604
  export type { string_model_name };
@@ -31,7 +31,7 @@ export type AgentCapability = {
31
31
  /**
32
32
  * The type of the capability
33
33
  */
34
- type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import' | 'image-generator';
34
+ type: 'browser' | 'search-engine' | 'knowledge' | 'time' | 'inheritance' | 'import' | 'image-generator' | 'team';
35
35
  /**
36
36
  * The label to display for this capability
37
37
  */
@@ -0,0 +1,28 @@
1
+ import type { string_agent_url } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed TEAM teammate entry.
4
+ *
5
+ * @private
6
+ */
7
+ export type TeamTeammate = {
8
+ url: string_agent_url;
9
+ label: string;
10
+ instructions: string;
11
+ };
12
+ /**
13
+ * Options for parsing TEAM commitment content.
14
+ *
15
+ * @private
16
+ */
17
+ export type ParseTeamCommitmentOptions = {
18
+ strict?: boolean;
19
+ };
20
+ /**
21
+ * Parses TEAM commitment content into teammates with instructions.
22
+ *
23
+ * @private
24
+ */
25
+ export declare function parseTeamCommitmentContent(content: string, options?: ParseTeamCommitmentOptions): TeamTeammate[];
26
+ /**
27
+ * Note: [💞] Ignore a discrepancy between file name and entity name
28
+ */
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { id } from '../../../types/typeAliases';
3
- import type { TODO_any } from '../../../utils/organization/TODO_any';
4
3
  import type { ChatMessage } from '../types/ChatMessage';
5
4
  import type { ChatParticipant } from '../types/ChatParticipant';
6
5
  import type { ChatProps } from './ChatProps';
@@ -42,16 +41,12 @@ type ChatMessageItemProps = Pick<ChatProps, 'onMessage' | 'participants'> & {
42
41
  /**
43
42
  * Called when a tool call chiplet is clicked.
44
43
  */
45
- onToolCallClick?: (toolCall: {
46
- name: string;
47
- arguments?: TODO_any;
48
- result?: TODO_any;
49
- }) => void;
44
+ onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
50
45
  };
51
46
  /**
52
47
  * Renders a single chat message item with avatar, content, buttons, and rating.
53
48
  *
54
49
  * @private internal subcomponent of `<Chat>` component
55
50
  */
56
- export declare const ChatMessageItem: import("react").MemoExoticComponent<({ message, participant, participants, isLastMessage, onMessage, setExpandedMessageId, isExpanded, currentRating, handleRating, mode, isCopyButtonEnabled, isFeedbackEnabled, onCopy, onCreateAgent, toolTitles, onToolCallClick, }: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
51
+ export declare const ChatMessageItem: import("react").MemoExoticComponent<(props: ChatMessageItemProps) => import("react/jsx-runtime").JSX.Element>;
57
52
  export {};
@@ -3,7 +3,6 @@ import type { Promisable } from 'type-fest';
3
3
  import { Color } from '../../../_packages/color.index';
4
4
  import { SpeechRecognition } from '../../../types/SpeechRecognition';
5
5
  import { string_color } from '../../../types/typeAliases';
6
- import type { TODO_any } from '../../../utils/organization/TODO_any';
7
6
  import type { string_chat_format_name } from '../save/_common/string_chat_format_name';
8
7
  import type { ChatMessage } from '../types/ChatMessage';
9
8
  import type { ChatParticipant } from '../types/ChatParticipant';
@@ -198,11 +197,7 @@ export type ChatProps = {
198
197
  /**
199
198
  * Called when a tool call chiplet is clicked.
200
199
  */
201
- onToolCallClick?: (toolCall: {
202
- name: string;
203
- arguments?: TODO_any;
204
- result?: TODO_any;
205
- }) => void;
200
+ onToolCallClick?: (toolCall: NonNullable<ChatMessage['toolCalls']>[number]) => void;
206
201
  /**
207
202
  * Visual style of the chat component
208
203
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Renders a nice clock icon with a specific time.
3
+ *
4
+ * @private internal subcomponent of `<Chat>` component
5
+ */
6
+ export declare function ClockIcon({ date, size }: {
7
+ date: Date;
8
+ size?: number;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { Message } from '../../../types/Message';
2
+ import type { ToolCall } from '../../../types/ToolCall';
2
3
  import type { id, string_markdown } from '../../../types/typeAliases';
3
- import type { TODO_any } from '../../../utils/organization/TODO_any';
4
+ export type ChatToolCall = ToolCall;
4
5
  /**
5
6
  * Represents a single message within a chat interface.
6
7
  *
@@ -37,45 +38,17 @@ export type ChatMessage = Omit<Message<id>, 'direction' | 'recipients' | 'thread
37
38
  /**
38
39
  * Optional tool calls made during the execution
39
40
  */
40
- readonly ongoingToolCalls?: ReadonlyArray<{
41
- /**
42
- * Name of the tool
43
- */
44
- readonly name: string;
45
- /**
46
- * Arguments for the tool call
47
- */
48
- readonly arguments?: string | Record<string, TODO_any>;
49
- /**
50
- * Result of the tool call
51
- */
52
- readonly result?: TODO_any;
53
- /**
54
- * Raw tool call from the model
55
- */
56
- readonly rawToolCall?: TODO_any;
57
- }>;
41
+ readonly ongoingToolCalls?: ReadonlyArray<ChatToolCall>;
42
+ /**
43
+ * Optional tool calls used to produce this message.
44
+ */
45
+ readonly toolCalls?: ReadonlyArray<ChatToolCall>;
58
46
  /**
59
47
  * Optional tool calls that have been completed
48
+ *
49
+ * @deprecated Use `toolCalls` instead.
60
50
  */
61
- readonly completedToolCalls?: ReadonlyArray<{
62
- /**
63
- * Name of the tool
64
- */
65
- readonly name: string;
66
- /**
67
- * Arguments for the tool call
68
- */
69
- readonly arguments?: string | Record<string, TODO_any>;
70
- /**
71
- * Result of the tool call
72
- */
73
- readonly result?: TODO_any;
74
- /**
75
- * Raw tool call from the model
76
- */
77
- readonly rawToolCall?: TODO_any;
78
- }>;
51
+ readonly completedToolCalls?: ReadonlyArray<ChatToolCall>;
79
52
  /**
80
53
  * Optional file attachments
81
54
  */
@@ -1,4 +1,4 @@
1
- import type { TODO_any } from '../../../utils/organization/TODO_any';
1
+ import type { ToolCall } from '../../../types/ToolCall';
2
2
  /**
3
3
  * Utility to format tool call information for user-friendly display.
4
4
  */
@@ -16,7 +16,4 @@ export declare const TOOL_TITLES: Record<string, {
16
16
  *
17
17
  * @private [🧠] Maybe public?
18
18
  */
19
- export declare function getToolCallChipletText(toolCall: {
20
- name: string;
21
- arguments?: string | Record<string, TODO_any>;
22
- }): string;
19
+ export declare function getToolCallChipletText(toolCall: ToolCall): string;
@@ -0,0 +1,64 @@
1
+ import type { ToolCall } from '../../../types/ToolCall';
2
+ import type { TODO_any } from '../../../utils/organization/TODO_any';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @private utility of `<Chat/>` component
7
+ */
8
+ export declare function parseToolCallArguments(toolCall: Pick<ToolCall, 'arguments'>): Record<string, TODO_any>;
9
+ /**
10
+ * @@@
11
+ *
12
+ * @private utility of `<Chat/>` component
13
+ */
14
+ export declare function parseToolCallResult(result: ToolCall['result']): TODO_any;
15
+ type SearchResultsExtraction = {
16
+ results: Array<TODO_any>;
17
+ rawText: string | null;
18
+ };
19
+ export type TeamToolResult = {
20
+ teammate?: {
21
+ url?: string;
22
+ label?: string;
23
+ instructions?: string;
24
+ toolName?: string;
25
+ };
26
+ request?: string;
27
+ response?: string;
28
+ error?: string | null;
29
+ conversation?: Array<{
30
+ sender?: string;
31
+ name?: string;
32
+ role?: string;
33
+ content?: string;
34
+ }>;
35
+ };
36
+ /**
37
+ * @@@
38
+ *
39
+ * @private utility of `<Chat/>` component
40
+ */
41
+ export declare function extractSearchResults(resultRaw: TODO_any): SearchResultsExtraction;
42
+ /**
43
+ * @@@
44
+ *
45
+ * @private utility of `<Chat/>` component
46
+ */
47
+ export declare function parseTeamToolResult(resultRaw: TODO_any): TeamToolResult | null;
48
+ /**
49
+ * @@@
50
+ *
51
+ * @private utility of `<Chat/>` component
52
+ */
53
+ export declare function getToolCallTimestamp(toolCall: Pick<ToolCall, 'createdAt'>): Date | null;
54
+ /**
55
+ * @@@
56
+ *
57
+ * @private utility of `<Chat/>` component
58
+ */
59
+ export declare function getToolCallResultDate(result: ToolCall['result']): Date | null;
60
+ export {};
61
+ /**
62
+ * Note: [💞] Ignore a discrepancy between file name and entity name
63
+ * <- TODO: But maybe split into multiple files later?
64
+ */
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * Renders a settings (gear) icon.
4
+ *
5
+ * @param props - SVG properties augmented with an optional `size`
6
+ * @private internal subcomponent used by various components
7
+ */
8
+ export declare function SettingsIcon({ size, color, ...props }: {
9
+ size?: number;
10
+ color?: string;
11
+ } & React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { string_javascript_name } from '../../_packages/types.index';
2
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
3
+ import { ToolFunction } from '../../scripting/javascript/JavascriptExecutionToolsOptions';
4
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
5
+ /**
6
+ * TEAM commitment definition
7
+ *
8
+ * The `TEAM` commitment defines teammates that the agent can consult via tools.
9
+ *
10
+ * Example usage in agent source:
11
+ *
12
+ * ```book
13
+ * TEAM https://agents.ptbk.ik/agents/joe-green
14
+ * TEAM You can talk with http://localhost:4440/agents/GMw67JN8TXxN7y to discuss the legal aspects.
15
+ * ```
16
+ *
17
+ * @private [??] Maybe export the commitments through some package
18
+ */
19
+ export declare class TeamCommitmentDefinition extends BaseCommitmentDefinition<'TEAM'> {
20
+ constructor();
21
+ /**
22
+ * Short one-line description of TEAM.
23
+ */
24
+ get description(): string;
25
+ /**
26
+ * Icon for this commitment.
27
+ */
28
+ get icon(): string;
29
+ /**
30
+ * Markdown documentation for TEAM commitment.
31
+ */
32
+ get documentation(): string;
33
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
34
+ /**
35
+ * Gets human-readable titles for tool functions provided by this commitment.
36
+ */
37
+ getToolTitles(): Record<string_javascript_name, string>;
38
+ /**
39
+ * Gets tool function implementations for teammate tools.
40
+ */
41
+ getToolFunctions(): Record<string_javascript_name, ToolFunction>;
42
+ }
43
+ /**
44
+ * Note: [💞] Ignore a discrepancy between file name and entity name
45
+ */
@@ -21,6 +21,7 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
21
21
  */
22
22
  export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
23
23
  constructor();
24
+ get requiresContent(): boolean;
24
25
  /**
25
26
  * Short one-line description of USE SEARCH ENGINE.
26
27
  */
@@ -11,12 +11,14 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
11
11
  *
12
12
  * ```book
13
13
  * USE TIME
14
+ * USE TIME Prefer the user's local timezone.
14
15
  * ```
15
16
  *
16
17
  * @private [🪔] Maybe export the commitments through some package
17
18
  */
18
19
  export declare class UseTimeCommitmentDefinition extends BaseCommitmentDefinition<'USE TIME'> {
19
20
  constructor();
21
+ get requiresContent(): boolean;
20
22
  /**
21
23
  * Short one-line description of USE TIME.
22
24
  */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @private utility for commitments
5
+ */
6
+ export declare function formatOptionalInstructionBlock(label: string, content: string): string;
@@ -31,6 +31,7 @@ import { RuleCommitmentDefinition } from './RULE/RULE';
31
31
  import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
32
32
  import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
33
33
  import { StyleCommitmentDefinition } from './STYLE/STYLE';
34
+ import { TeamCommitmentDefinition } from './TEAM/TEAM';
34
35
  import { UseCommitmentDefinition } from './USE/USE';
35
36
  import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
36
37
  import { UseImageGeneratorCommitmentDefinition } from './USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR';
@@ -45,7 +46,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
45
46
  *
46
47
  * @private Use functions to access commitments instead of this array directly
47
48
  */
48
- 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, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
49
+ 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, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseTimeCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
49
50
  /**
50
51
  * Gets a commitment definition by its type
51
52
  * @param type The commitment type to look up
@@ -71,6 +71,131 @@ export declare const RESERVED_PARAMETER_RESTRICTED: string;
71
71
  * @public exported from `@promptbook/core`
72
72
  */
73
73
  export declare const RESERVED_PARAMETER_NAMES: readonly ["content", "context", "knowledge", "examples", "modelName", "currentDate"];
74
+ /**
75
+ * Limits for IDs, names, and other strings
76
+ *
77
+ * @public exported from `@promptbook/core`
78
+ */
79
+ export declare const LIMITS: {
80
+ /**
81
+ * Minimum length of a name (e.g. agent name, persona name)
82
+ */
83
+ readonly NAME_MIN_LENGTH: 3;
84
+ /**
85
+ * Recommended maximum length of a name
86
+ */
87
+ readonly NAME_MAX_LENGTH: 20;
88
+ /**
89
+ * Maximum length of a short description or a hash
90
+ */
91
+ readonly SHORT_TEXT_MAX_LENGTH: 30;
92
+ /**
93
+ * Gone
94
+ */
95
+ readonly GONE: 410;
96
+ /**
97
+ * Gateway timeout
98
+ */
99
+ readonly GATEWAY_TIMEOUT: 504;
100
+ /**
101
+ * Too many requests
102
+ */
103
+ readonly TOO_MANY_REQUESTS: 429;
104
+ /**
105
+ * Maximum length of a file path segment
106
+ */
107
+ readonly FILE_PATH_SEGMENT_MAX_LENGTH: 8;
108
+ /**
109
+ * Default length of a short name (e.g. for default agent names)
110
+ */
111
+ readonly SHORT_NAME_LENGTH: 6;
112
+ };
113
+ /**
114
+ * Common time intervals in milliseconds
115
+ *
116
+ * @public exported from `@promptbook/core`
117
+ */
118
+ export declare const TIME_INTERVALS: {
119
+ /**
120
+ * One second in milliseconds
121
+ */
122
+ readonly SECOND: 1000;
123
+ /**
124
+ * Two seconds in milliseconds
125
+ */
126
+ readonly TWO_SECONDS: 2000;
127
+ /**
128
+ * One minute in milliseconds
129
+ */
130
+ readonly MINUTE: 60000;
131
+ /**
132
+ * Thirty seconds in milliseconds
133
+ */
134
+ readonly THIRTY_SECONDS: 30000;
135
+ /**
136
+ * Five seconds in milliseconds
137
+ */
138
+ readonly FIVE_SECONDS: 5000;
139
+ };
140
+ /**
141
+ * Common ports and network limits
142
+ *
143
+ * @public exported from `@promptbook/core`
144
+ */
145
+ export declare const NETWORK_LIMITS: {
146
+ /**
147
+ * Maximum valid port number
148
+ */
149
+ readonly MAX_PORT: 65535;
150
+ };
151
+ /**
152
+ * Common color and image constants
153
+ *
154
+ * @public exported from `@promptbook/core`
155
+ */
156
+ export declare const COLOR_CONSTANTS: {
157
+ /**
158
+ * Maximum value for a color channel (0-255)
159
+ */
160
+ readonly MAX_CHANNEL_VALUE: 255;
161
+ /**
162
+ * Number of possible colors in 24-bit color (0xFFFFFF)
163
+ */
164
+ readonly MAX_24BIT_COLOR: 16777215;
165
+ /**
166
+ * Base for hexadecimal strings
167
+ */
168
+ readonly HEX_BASE: 16;
169
+ /**
170
+ * Length of a hex color without alpha (e.g. "FF0000")
171
+ */
172
+ readonly HEX_COLOR_LENGTH: 6;
173
+ /**
174
+ * Full circle in degrees
175
+ */
176
+ readonly FULL_CIRCLE_DEGREES: 360;
177
+ /**
178
+ * Half circle in degrees
179
+ */
180
+ readonly HALF_CIRCLE_DEGREES: 180;
181
+ };
182
+ /**
183
+ * HTTP Status Codes
184
+ *
185
+ * @public exported from `@promptbook/core`
186
+ */
187
+ export declare const HTTP_STATUS_CODES: {
188
+ readonly OK: 200;
189
+ readonly CREATED: 201;
190
+ readonly BAD_REQUEST: 400;
191
+ readonly UNAUTHORIZED: 401;
192
+ readonly NOT_FOUND: 404;
193
+ readonly INTERNAL_SERVER_ERROR: 500;
194
+ readonly BAD_GATEWAY: 502;
195
+ readonly SERVICE_UNAVAILABLE: 503;
196
+ readonly GATEWAY_TIMEOUT: 504;
197
+ readonly TOO_MANY_REQUESTS: 429;
198
+ };
74
199
  /**
75
200
  * Note: [💞] Ignore a discrepancy between file name and entity name
76
201
  */
@@ -1,5 +1,5 @@
1
+ import type { ToolCall } from '../types/ToolCall';
1
2
  import type { string_date_iso8601, string_model_name, string_prompt } from '../types/typeAliases';
2
- import type { TODO_any } from '../utils/organization/TODO_any';
3
3
  import type { TODO_object } from '../utils/organization/TODO_object';
4
4
  import type { EmbeddingVector } from './EmbeddingVector';
5
5
  import type { Usage } from './Usage';
@@ -26,24 +26,7 @@ export type ChatPromptResult = CommonPromptResult & {
26
26
  /**
27
27
  * Optional tool calls made during the execution
28
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
- }>;
29
+ readonly toolCalls?: ReadonlyArray<ToolCall>;
47
30
  };
48
31
  /**
49
32
  * Image prompt result
@@ -94,6 +94,7 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
94
94
  static isOpenAiAssistantExecutionTools(llmExecutionTools: LlmExecutionTools): llmExecutionTools is OpenAiAssistantExecutionTools;
95
95
  }
96
96
  /**
97
+ * TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
97
98
  * TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
98
99
  * TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
99
100
  * TODO: Maybe make custom OpenAiError
@@ -0,0 +1,37 @@
1
+ import type { string_date_iso8601 } from './typeAliases';
2
+ import type { TODO_any } from '../utils/organization/TODO_any';
3
+ /**
4
+ * Represents a single tool call with its inputs, outputs, and timing.
5
+ *
6
+ * Note: This is fully serializable as JSON.
7
+ */
8
+ export type ToolCall = {
9
+ /**
10
+ * Name of the tool.
11
+ */
12
+ readonly name: string;
13
+ /**
14
+ * Arguments for the tool call.
15
+ */
16
+ readonly arguments?: string | Record<string, TODO_any>;
17
+ /**
18
+ * Result of the tool call.
19
+ */
20
+ readonly result?: TODO_any;
21
+ /**
22
+ * Raw tool call payload from the model.
23
+ */
24
+ readonly rawToolCall?: TODO_any;
25
+ /**
26
+ * Timestamp when the tool call was initiated.
27
+ */
28
+ readonly createdAt?: string_date_iso8601;
29
+ /**
30
+ * Errors thrown during tool execution.
31
+ */
32
+ readonly errors?: ReadonlyArray<TODO_any>;
33
+ /**
34
+ * Warnings reported during tool execution.
35
+ */
36
+ readonly warnings?: ReadonlyArray<TODO_any>;
37
+ };
@@ -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.105.0-13`).
18
+ * It follows semantic versioning (e.g., `0.105.0-15`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/fake-llm",
3
- "version": "0.105.0-14",
3
+ "version": "0.105.0-16",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -96,11 +96,13 @@
96
96
  "module": "./esm/index.es.js",
97
97
  "typings": "./esm/typings/src/_packages/fake-llm.index.d.ts",
98
98
  "peerDependencies": {
99
- "@promptbook/core": "0.105.0-14"
99
+ "@promptbook/core": "0.105.0-16"
100
100
  },
101
101
  "dependencies": {
102
102
  "crypto": "1.0.1",
103
+ "crypto-js": "4.2.0",
103
104
  "lorem-ipsum": "2.0.8",
105
+ "moment": "2.30.1",
104
106
  "spacetrim": "0.11.60",
105
107
  "waitasecond": "1.11.160"
106
108
  }