@promptbook/openai 0.103.0-46 → 0.103.0-48
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.
- package/esm/index.es.js +196 -71
- package/esm/index.es.js.map +1 -1
- package/esm/typings/servers.d.ts +1 -7
- package/esm/typings/src/_packages/components.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +22 -14
- package/esm/typings/src/_packages/types.index.d.ts +14 -6
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +7 -3
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +6 -1
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +14 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.test.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +1 -60
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +57 -32
- package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +1 -5
- package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +1 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +10 -9
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +5 -1
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +1 -1
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +32 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +29 -4
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -2
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +12 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +2 -2
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +1 -1
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +3 -4
- package/umd/index.umd.js +201 -75
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/index.d.ts +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { computeAgentHash } from '../book-2.0/agent-source/computeAgentHash';
|
|
2
3
|
import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
|
|
3
4
|
import { createAgentModelRequirementsWithCommitments } from '../book-2.0/agent-source/createAgentModelRequirementsWithCommitments';
|
|
5
|
+
import { createDefaultAgentName } from '../book-2.0/agent-source/createDefaultAgentName';
|
|
6
|
+
import { normalizeAgentName } from '../book-2.0/agent-source/normalizeAgentName';
|
|
4
7
|
import { PADDING_LINES } from '../book-2.0/agent-source/padBook';
|
|
5
8
|
import { padBook } from '../book-2.0/agent-source/padBook';
|
|
6
9
|
import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
|
|
@@ -8,13 +11,6 @@ import { parseParameters } from '../book-2.0/agent-source/parseParameters';
|
|
|
8
11
|
import { isValidBook } from '../book-2.0/agent-source/string_book';
|
|
9
12
|
import { validateBook } from '../book-2.0/agent-source/string_book';
|
|
10
13
|
import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
|
|
11
|
-
import { createEmptyAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
|
|
12
|
-
import { createBasicAgentModelRequirements } from '../book-2.0/commitments/_base/createEmptyAgentModelRequirements';
|
|
13
|
-
import { NotYetImplementedCommitmentDefinition } from '../book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition';
|
|
14
|
-
import { getCommitmentDefinition } from '../book-2.0/commitments/index';
|
|
15
|
-
import { getAllCommitmentDefinitions } from '../book-2.0/commitments/index';
|
|
16
|
-
import { getAllCommitmentTypes } from '../book-2.0/commitments/index';
|
|
17
|
-
import { isCommitmentSupported } from '../book-2.0/commitments/index';
|
|
18
14
|
import { generatePlaceholderAgentProfileImageUrl } from '../book-2.0/utils/generatePlaceholderAgentProfileImageUrl';
|
|
19
15
|
import { AgentCollectionInSupabase } from '../collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase';
|
|
20
16
|
import { createPipelineCollectionFromJson } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromJson';
|
|
@@ -22,6 +18,13 @@ import { createPipelineCollectionFromPromise } from '../collection/pipeline-coll
|
|
|
22
18
|
import { createPipelineCollectionFromUrl } from '../collection/pipeline-collection/constructors/createPipelineCollectionFromUrl';
|
|
23
19
|
import { createPipelineSubcollection } from '../collection/pipeline-collection/constructors/createPipelineSubcollection';
|
|
24
20
|
import { pipelineCollectionToJson } from '../collection/pipeline-collection/pipelineCollectionToJson';
|
|
21
|
+
import { createEmptyAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
|
|
22
|
+
import { createBasicAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
|
|
23
|
+
import { NotYetImplementedCommitmentDefinition } from '../commitments/_base/NotYetImplementedCommitmentDefinition';
|
|
24
|
+
import { getCommitmentDefinition } from '../commitments/index';
|
|
25
|
+
import { getAllCommitmentDefinitions } from '../commitments/index';
|
|
26
|
+
import { getAllCommitmentTypes } from '../commitments/index';
|
|
27
|
+
import { isCommitmentSupported } from '../commitments/index';
|
|
25
28
|
import { NAME } from '../config';
|
|
26
29
|
import { ADMIN_EMAIL } from '../config';
|
|
27
30
|
import { ADMIN_GITHUB_NAME } from '../config';
|
|
@@ -138,6 +141,7 @@ import { AgentLlmExecutionTools } from '../llm-providers/agent/AgentLlmExecution
|
|
|
138
141
|
import { createAgentLlmExecutionTools } from '../llm-providers/agent/createAgentLlmExecutionTools';
|
|
139
142
|
import { _AgentMetadata } from '../llm-providers/agent/register-configuration';
|
|
140
143
|
import { _AgentRegistration } from '../llm-providers/agent/register-constructor';
|
|
144
|
+
import { RemoteAgent } from '../llm-providers/agent/RemoteAgent';
|
|
141
145
|
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
142
146
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
143
147
|
import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
|
|
@@ -187,8 +191,11 @@ import { aboutPromptbookInformation } from '../utils/misc/aboutPromptbookInforma
|
|
|
187
191
|
import { $generateBookBoilerplate } from '../utils/random/$generateBookBoilerplate';
|
|
188
192
|
import { REMOTE_SERVER_URLS } from '../../servers';
|
|
189
193
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
194
|
+
export { computeAgentHash };
|
|
190
195
|
export { createAgentModelRequirements };
|
|
191
196
|
export { createAgentModelRequirementsWithCommitments };
|
|
197
|
+
export { createDefaultAgentName };
|
|
198
|
+
export { normalizeAgentName };
|
|
192
199
|
export { PADDING_LINES };
|
|
193
200
|
export { padBook };
|
|
194
201
|
export { parseAgentSource };
|
|
@@ -196,13 +203,6 @@ export { parseParameters };
|
|
|
196
203
|
export { isValidBook };
|
|
197
204
|
export { validateBook };
|
|
198
205
|
export { DEFAULT_BOOK };
|
|
199
|
-
export { createEmptyAgentModelRequirements };
|
|
200
|
-
export { createBasicAgentModelRequirements };
|
|
201
|
-
export { NotYetImplementedCommitmentDefinition };
|
|
202
|
-
export { getCommitmentDefinition };
|
|
203
|
-
export { getAllCommitmentDefinitions };
|
|
204
|
-
export { getAllCommitmentTypes };
|
|
205
|
-
export { isCommitmentSupported };
|
|
206
206
|
export { generatePlaceholderAgentProfileImageUrl };
|
|
207
207
|
export { AgentCollectionInSupabase };
|
|
208
208
|
export { createPipelineCollectionFromJson };
|
|
@@ -210,6 +210,13 @@ export { createPipelineCollectionFromPromise };
|
|
|
210
210
|
export { createPipelineCollectionFromUrl };
|
|
211
211
|
export { createPipelineSubcollection };
|
|
212
212
|
export { pipelineCollectionToJson };
|
|
213
|
+
export { createEmptyAgentModelRequirements };
|
|
214
|
+
export { createBasicAgentModelRequirements };
|
|
215
|
+
export { NotYetImplementedCommitmentDefinition };
|
|
216
|
+
export { getCommitmentDefinition };
|
|
217
|
+
export { getAllCommitmentDefinitions };
|
|
218
|
+
export { getAllCommitmentTypes };
|
|
219
|
+
export { isCommitmentSupported };
|
|
213
220
|
export { NAME };
|
|
214
221
|
export { ADMIN_EMAIL };
|
|
215
222
|
export { ADMIN_GITHUB_NAME };
|
|
@@ -326,6 +333,7 @@ export { AgentLlmExecutionTools };
|
|
|
326
333
|
export { createAgentLlmExecutionTools };
|
|
327
334
|
export { _AgentMetadata };
|
|
328
335
|
export { _AgentRegistration };
|
|
336
|
+
export { RemoteAgent };
|
|
329
337
|
export { _AnthropicClaudeMetadataRegistration };
|
|
330
338
|
export { _AzureOpenAiMetadataRegistration };
|
|
331
339
|
export { _DeepseekMetadataRegistration };
|
|
@@ -2,14 +2,12 @@ import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformati
|
|
|
2
2
|
import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
|
|
3
3
|
import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
|
|
4
4
|
import type { string_book } from '../book-2.0/agent-source/string_book';
|
|
5
|
-
import type { BookCommitment } from '../book-2.0/commitments/_base/BookCommitment';
|
|
6
|
-
import type { CommitmentDefinition } from '../book-2.0/commitments/_base/CommitmentDefinition';
|
|
7
|
-
import type { ParsedCommitment } from '../book-2.0/commitments/_base/ParsedCommitment';
|
|
8
5
|
import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChip';
|
|
9
6
|
import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
|
|
10
7
|
import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
|
|
11
8
|
import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
|
|
12
9
|
import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
|
|
10
|
+
import type { AgentChatProps } from '../book-components/Chat/AgentChat/AgentChatProps';
|
|
13
11
|
import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
|
|
14
12
|
import type { ChatAutoScrollConfig } from '../book-components/Chat/hooks/useChatAutoScroll';
|
|
15
13
|
import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
|
|
@@ -55,6 +53,9 @@ import type { SectionCommand } from '../commands/SECTION/SectionCommand';
|
|
|
55
53
|
import type { UrlCommand } from '../commands/URL/UrlCommand';
|
|
56
54
|
import type { ActionCommand } from '../commands/X_ACTION/ActionCommand';
|
|
57
55
|
import type { InstrumentCommand } from '../commands/X_INSTRUMENT/InstrumentCommand';
|
|
56
|
+
import type { BookCommitment } from '../commitments/_base/BookCommitment';
|
|
57
|
+
import type { CommitmentDefinition } from '../commitments/_base/CommitmentDefinition';
|
|
58
|
+
import type { ParsedCommitment } from '../commitments/_base/ParsedCommitment';
|
|
58
59
|
import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';
|
|
59
60
|
import type { renderPipelineMermaidOptions } from '../conversion/prettify/renderPipelineMermaidOptions';
|
|
60
61
|
import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
|
|
@@ -109,6 +110,7 @@ import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/
|
|
|
109
110
|
import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
|
|
110
111
|
import type { AgentOptions } from '../llm-providers/agent/AgentOptions';
|
|
111
112
|
import type { CreateAgentLlmExecutionToolsOptions } from '../llm-providers/agent/CreateAgentLlmExecutionToolsOptions';
|
|
113
|
+
import type { RemoteAgentOptions } from '../llm-providers/agent/RemoteAgentOptions';
|
|
112
114
|
import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
113
115
|
import type { AnthropicClaudeExecutionToolsNonProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
114
116
|
import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
@@ -217,6 +219,7 @@ import type { ReservedParameters } from '../types/typeAliases';
|
|
|
217
219
|
import type { string_title } from '../types/typeAliases';
|
|
218
220
|
import type { string_agent_name } from '../types/typeAliases';
|
|
219
221
|
import type { string_agent_name_in_book } from '../types/typeAliases';
|
|
222
|
+
import type { string_agent_hash } from '../types/typeAliases';
|
|
220
223
|
import type { string_persona_description } from '../types/typeAliases';
|
|
221
224
|
import type { string_model_description } from '../types/typeAliases';
|
|
222
225
|
import type { string_knowledge_source_content } from '../types/typeAliases';
|
|
@@ -246,6 +249,7 @@ import type { string_url } from '../types/typeAliases';
|
|
|
246
249
|
import type { string_promptbook_server_url } from '../types/typeAliases';
|
|
247
250
|
import type { string_base_url } from '../types/typeAliases';
|
|
248
251
|
import type { string_pipeline_root_url } from '../types/typeAliases';
|
|
252
|
+
import type { string_agent_url } from '../types/typeAliases';
|
|
249
253
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
250
254
|
import type { string_pipeline_url_with_task_hash } from '../types/typeAliases';
|
|
251
255
|
import type { string_data_url } from '../types/typeAliases';
|
|
@@ -354,14 +358,12 @@ export type { BookParameter };
|
|
|
354
358
|
export type { AgentBasicInformation };
|
|
355
359
|
export type { AgentModelRequirements };
|
|
356
360
|
export type { string_book };
|
|
357
|
-
export type { BookCommitment };
|
|
358
|
-
export type { CommitmentDefinition };
|
|
359
|
-
export type { ParsedCommitment };
|
|
360
361
|
export type { AvatarChipProps };
|
|
361
362
|
export type { AvatarChipFromSourceProps };
|
|
362
363
|
export type { AvatarProfileProps };
|
|
363
364
|
export type { AvatarProfileFromSourceProps };
|
|
364
365
|
export type { BookEditorProps };
|
|
366
|
+
export type { AgentChatProps };
|
|
365
367
|
export type { ChatProps };
|
|
366
368
|
export type { ChatAutoScrollConfig };
|
|
367
369
|
export type { SendMessageToLlmChatFunction };
|
|
@@ -407,6 +409,9 @@ export type { SectionCommand };
|
|
|
407
409
|
export type { UrlCommand };
|
|
408
410
|
export type { ActionCommand };
|
|
409
411
|
export type { InstrumentCommand };
|
|
412
|
+
export type { BookCommitment };
|
|
413
|
+
export type { CommitmentDefinition };
|
|
414
|
+
export type { ParsedCommitment };
|
|
410
415
|
export type { PrettifyOptions };
|
|
411
416
|
export type { renderPipelineMermaidOptions };
|
|
412
417
|
export type { CallbackInterfaceToolsOptions };
|
|
@@ -461,6 +466,7 @@ export type { CacheLlmToolsOptions };
|
|
|
461
466
|
export type { LlmExecutionToolsWithTotalUsage };
|
|
462
467
|
export type { AgentOptions };
|
|
463
468
|
export type { CreateAgentLlmExecutionToolsOptions };
|
|
469
|
+
export type { RemoteAgentOptions };
|
|
464
470
|
export type { AnthropicClaudeExecutionToolsOptions };
|
|
465
471
|
export type { AnthropicClaudeExecutionToolsNonProxiedOptions };
|
|
466
472
|
export type { AnthropicClaudeExecutionToolsProxiedOptions };
|
|
@@ -569,6 +575,7 @@ export type { ReservedParameters };
|
|
|
569
575
|
export type { string_title };
|
|
570
576
|
export type { string_agent_name };
|
|
571
577
|
export type { string_agent_name_in_book };
|
|
578
|
+
export type { string_agent_hash };
|
|
572
579
|
export type { string_persona_description };
|
|
573
580
|
export type { string_model_description };
|
|
574
581
|
export type { string_knowledge_source_content };
|
|
@@ -598,6 +605,7 @@ export type { string_url };
|
|
|
598
605
|
export type { string_promptbook_server_url };
|
|
599
606
|
export type { string_base_url };
|
|
600
607
|
export type { string_pipeline_root_url };
|
|
608
|
+
export type { string_agent_url };
|
|
601
609
|
export type { string_pipeline_url };
|
|
602
610
|
export type { string_pipeline_url_with_task_hash };
|
|
603
611
|
export type { string_data_url };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { string_agent_name, string_color, string_url_image } from '../../types/typeAliases';
|
|
1
|
+
import type { string_agent_hash, string_agent_name, string_color, string_url_image } from '../../types/typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Unified parameter representation that supports two different notations:
|
|
4
4
|
* 1. @Parameter - single word parameter starting with @
|
|
@@ -28,7 +28,11 @@ export type AgentBasicInformation = {
|
|
|
28
28
|
* Name of the agent
|
|
29
29
|
* This is the first line of the agent source
|
|
30
30
|
*/
|
|
31
|
-
agentName: string_agent_name
|
|
31
|
+
agentName: string_agent_name;
|
|
32
|
+
/**
|
|
33
|
+
* Hash of the agent source for integrity verification
|
|
34
|
+
*/
|
|
35
|
+
agentHash: string_agent_hash;
|
|
32
36
|
/**
|
|
33
37
|
* Optional description of the agent
|
|
34
38
|
* This is the line starting with "PERSONA"
|
|
@@ -53,6 +57,6 @@ export type AgentBasicInformation = {
|
|
|
53
57
|
parameters: BookParameter[];
|
|
54
58
|
};
|
|
55
59
|
/**
|
|
56
|
-
* TODO:
|
|
60
|
+
* TODO: !!!!! Make all properties of `AgentBasicInformation` readonly
|
|
57
61
|
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
58
62
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { string_knowledge_source_link } from '../../types/typeAliases';
|
|
1
2
|
import type { TODO_any } from '../../utils/organization/TODO_any';
|
|
2
3
|
/**
|
|
3
4
|
* Model requirements for an agent
|
|
@@ -16,7 +17,11 @@ export type AgentModelRequirements = {
|
|
|
16
17
|
/**
|
|
17
18
|
* Optional list of MCP servers that the agent can connect to
|
|
18
19
|
*/
|
|
19
|
-
readonly mcpServers?: string
|
|
20
|
+
readonly mcpServers?: ReadonlyArray<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Optional list of knowledge source links that the agent can use
|
|
23
|
+
*/
|
|
24
|
+
readonly knowledgeSources?: ReadonlyArray<string_knowledge_source_link>;
|
|
20
25
|
/**
|
|
21
26
|
* Temperature for the agent's responses, controlling randomness
|
|
22
27
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ParsedCommitment } from '
|
|
1
|
+
import type { ParsedCommitment } from '../../commitments/_base/ParsedCommitment';
|
|
2
|
+
import { string_agent_name } from '../../types/typeAliases';
|
|
2
3
|
/**
|
|
3
4
|
* Result of parsing agent source for commitments
|
|
4
5
|
*
|
|
@@ -8,7 +9,7 @@ export type AgentSourceParseResult = {
|
|
|
8
9
|
/**
|
|
9
10
|
* The agent name (first line)
|
|
10
11
|
*/
|
|
11
|
-
agentName:
|
|
12
|
+
agentName: string_agent_name | null;
|
|
12
13
|
/**
|
|
13
14
|
* All parsed commitments
|
|
14
15
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { string_agent_hash } from '../../types/typeAliases';
|
|
2
|
+
import { string_book } from './string_book';
|
|
3
|
+
/**
|
|
4
|
+
* Computes SHA-256 hash of the agent source
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeAgentHash(agentSource: string_book): string_agent_hash;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { string_agent_name } from '../../types/typeAliases';
|
|
2
|
+
import { string_book } from './string_book';
|
|
3
|
+
/**
|
|
4
|
+
* Creates temporary default agent name based on agent source hash
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/core`
|
|
7
|
+
*/
|
|
8
|
+
export declare function createDefaultAgentName(agentSource: string_book): string_agent_name;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { string_agent_name } from '../../types/typeAliases';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes agent name from arbitrary string to valid agent name
|
|
4
|
+
*
|
|
5
|
+
* Note: [🔂] This function is idempotent.
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeAgentName(rawAgentName: string): string_agent_name;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,4 +6,4 @@ import type { string_book } from './string_book';
|
|
|
6
6
|
*
|
|
7
7
|
* @private internal utility of `parseAgentSource`
|
|
8
8
|
*/
|
|
9
|
-
export declare function parseAgentSourceWithCommitments(agentSource: string_book): AgentSourceParseResult
|
|
9
|
+
export declare function parseAgentSourceWithCommitments(agentSource: string_book): Omit<AgentSourceParseResult, 'agentHash'>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentChatProps } from './AgentChatProps';
|
|
2
|
+
/**
|
|
3
|
+
* AgentChat component that provides chat functionality with LLM integration
|
|
4
|
+
*
|
|
5
|
+
* This component internally manages messages, participants, and task progress,
|
|
6
|
+
* and uses the provided LLM tools to generate responses via `LlmExecutionTools.callChatModel`.
|
|
7
|
+
*
|
|
8
|
+
* Note: There are multiple chat components:
|
|
9
|
+
* - `<Chat/>` renders chat as it is without any logic
|
|
10
|
+
* - `<AgentChat/>` connected to LLM Execution Tools of Promptbook
|
|
11
|
+
*
|
|
12
|
+
* @public exported from `@promptbook/components`
|
|
13
|
+
*/
|
|
14
|
+
export declare function AgentChat(props: AgentChatProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Agent } from '../../../llm-providers/agent/Agent';
|
|
2
|
+
import type { LlmChatProps } from '../LlmChat/LlmChatProps';
|
|
3
|
+
/**
|
|
4
|
+
* Props for AgentChat component, derived from LlmChatProps but with Agent-specific modifications
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/components`
|
|
7
|
+
*/
|
|
8
|
+
export type AgentChatProps = Omit<LlmChatProps, 'thread' | 'llmTools' | 'initialMessages' | 'userParticipantName' | 'llmParticipantName'> & {
|
|
9
|
+
/**
|
|
10
|
+
* The agent to chat with
|
|
11
|
+
*/
|
|
12
|
+
readonly agent: Agent;
|
|
13
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
2
|
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
4
3
|
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
5
4
|
import type { CommonToolsOptions } from '../../../../execution/CommonToolsOptions';
|
|
@@ -23,72 +22,14 @@ export declare class AgentCollectionInSupabase {
|
|
|
23
22
|
* @param options - Options for the collection creation
|
|
24
23
|
*/
|
|
25
24
|
constructor(supabaseClient: SupabaseClient<AgentsDatabaseSchema>, options?: (PrepareAndScrapeOptions & CommonToolsOptions) | undefined);
|
|
26
|
-
/**
|
|
27
|
-
* Cached defined execution tools
|
|
28
|
-
*/
|
|
29
25
|
/**
|
|
30
26
|
* Gets all agents in the collection
|
|
31
27
|
*/
|
|
32
28
|
listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>;
|
|
33
|
-
/**
|
|
34
|
-
* !!!
|
|
35
|
-
* /
|
|
36
|
-
public async spawnAgent(agentName: string_agent_name): Promise<Agent> {
|
|
37
|
-
|
|
38
|
-
// <- TODO: !!! ENOENT: no such file or directory, open 'C:\Users\me\work\ai\promptbook\agents\examples\Asistent pro LŠVP.book
|
|
39
|
-
const { isVerbose = DEFAULT_IS_VERBOSE } = this.options || {};
|
|
40
|
-
const tools = await this.getTools();
|
|
41
|
-
|
|
42
|
-
const agentSourceValue = validateBook(await tools.fs!.readFile(agentSourcePath, 'utf-8'));
|
|
43
|
-
const agentSource = new BehaviorSubject(agentSourceValue);
|
|
44
|
-
|
|
45
|
-
// Note: Write file whenever agent source changes
|
|
46
|
-
agentSource.subscribe(async (newSource) => {
|
|
47
|
-
if (isVerbose) {
|
|
48
|
-
console.info(colors.cyan(`Writing agent source to file ${agentSourcePath}`));
|
|
49
|
-
}
|
|
50
|
-
await forTime(500); // <- TODO: [🙌] !!! Remove
|
|
51
|
-
await tools.fs!.writeFile(agentSourcePath, newSource, 'utf-8');
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// Note: Watch file for external changes
|
|
55
|
-
for await (const event of tools.fs!.watch(agentSourcePath)) {
|
|
56
|
-
// <- TODO: !!!! Solve the memory freeing when the watching is no longer needed
|
|
57
|
-
|
|
58
|
-
if (event.eventType !== 'change') {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (isVerbose) {
|
|
63
|
-
console.info(
|
|
64
|
-
colors.cyan(`Detected external change in agent source file ${agentSourcePath}, reloading`),
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
await forTime(500); // <- TODO: [🙌] !!! Remove
|
|
68
|
-
const newSource = validateBook(await tools.fs!.readFile(agentSourcePath, 'utf-8'));
|
|
69
|
-
agentSource.next(newSource);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// TODO: [🙌] !!!! Debug the infinite loop when file is changed externally and agent source is updated which causes file to be written again
|
|
73
|
-
|
|
74
|
-
const agent = new Agent({
|
|
75
|
-
...this.options,
|
|
76
|
-
agentSource,
|
|
77
|
-
executionTools: this.tools || {},
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
if (isVerbose) {
|
|
81
|
-
console.info(colors.cyan(`Created agent "${agent.agentName}" from source file ${agentSourcePath}`));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return agent;
|
|
85
|
-
* /
|
|
86
|
-
}
|
|
87
|
-
*/
|
|
88
29
|
/**
|
|
89
30
|
* !!!@@@
|
|
90
31
|
*/
|
|
91
|
-
getAgentSource(agentName: string_agent_name): Promise<
|
|
32
|
+
getAgentSource(agentName: string_agent_name): Promise<string_book>;
|
|
92
33
|
/**
|
|
93
34
|
* Creates a new agent in the collection
|
|
94
35
|
*
|
|
@@ -1,65 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTO-GENERATED SUBSET TYPES FROM `/apps/agents-server/src/database/schema.ts`
|
|
3
|
+
* Source of truth: `/apps/agents-server/src/database/schema.sql` *(do not edit table structure here manually)*
|
|
4
|
+
*
|
|
5
|
+
* [💽] Prompt:
|
|
6
|
+
* Re-generate this sub-schema
|
|
7
|
+
* Generate Supabase TypeScript schema which is a subset of `AgentsServerDatabase`
|
|
8
|
+
* containing only tables `Agent` and `AgentHistory`
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This file intentionally omits all other tables (EnvironmentVariable, ChatHistory, ChatFeedback)
|
|
11
|
+
* and any extra schemas (e.g. `graphql_public`) to remain a strict subset.
|
|
12
|
+
*/
|
|
1
13
|
export type Json = string | number | boolean | null | {
|
|
2
14
|
[key: string]: Json | undefined;
|
|
3
15
|
} | Json[];
|
|
4
16
|
export type AgentsDatabaseSchema = {
|
|
5
|
-
graphql_public: {
|
|
6
|
-
Tables: {
|
|
7
|
-
[_ in never]: never;
|
|
8
|
-
};
|
|
9
|
-
Views: {
|
|
10
|
-
[_ in never]: never;
|
|
11
|
-
};
|
|
12
|
-
Functions: {
|
|
13
|
-
graphql: {
|
|
14
|
-
Args: {
|
|
15
|
-
operationName?: string;
|
|
16
|
-
query?: string;
|
|
17
|
-
variables?: Json;
|
|
18
|
-
extensions?: Json;
|
|
19
|
-
};
|
|
20
|
-
Returns: Json;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
Enums: {
|
|
24
|
-
[_ in never]: never;
|
|
25
|
-
};
|
|
26
|
-
CompositeTypes: {
|
|
27
|
-
[_ in never]: never;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
17
|
public: {
|
|
31
18
|
Tables: {
|
|
32
|
-
|
|
19
|
+
Agent: {
|
|
33
20
|
Row: {
|
|
34
21
|
id: number;
|
|
35
22
|
agentName: string;
|
|
36
|
-
agentProfile: Json;
|
|
37
23
|
createdAt: string;
|
|
38
24
|
updatedAt: string | null;
|
|
39
|
-
|
|
25
|
+
agentHash: string;
|
|
26
|
+
agentSource: string;
|
|
27
|
+
agentProfile: Json;
|
|
40
28
|
promptbookEngineVersion: string;
|
|
41
29
|
usage: Json | null;
|
|
42
|
-
|
|
30
|
+
preparedModelRequirements: Json | null;
|
|
31
|
+
preparedExternals: Json | null;
|
|
43
32
|
};
|
|
44
33
|
Insert: {
|
|
45
34
|
id?: number;
|
|
46
35
|
agentName: string;
|
|
47
36
|
createdAt: string;
|
|
48
37
|
updatedAt?: string | null;
|
|
49
|
-
|
|
38
|
+
agentHash: string;
|
|
39
|
+
agentSource: string;
|
|
40
|
+
agentProfile: Json;
|
|
50
41
|
promptbookEngineVersion: string;
|
|
51
42
|
usage?: Json | null;
|
|
52
|
-
|
|
43
|
+
preparedModelRequirements?: Json | null;
|
|
44
|
+
preparedExternals?: Json | null;
|
|
53
45
|
};
|
|
54
46
|
Update: {
|
|
55
47
|
id?: number;
|
|
56
48
|
agentName?: string;
|
|
57
49
|
createdAt?: string;
|
|
58
50
|
updatedAt?: string | null;
|
|
59
|
-
|
|
51
|
+
agentHash?: string;
|
|
52
|
+
agentSource?: string;
|
|
53
|
+
agentProfile?: Json;
|
|
60
54
|
promptbookEngineVersion?: string;
|
|
61
55
|
usage?: Json | null;
|
|
56
|
+
preparedModelRequirements?: Json | null;
|
|
57
|
+
preparedExternals?: Json | null;
|
|
58
|
+
};
|
|
59
|
+
Relationships: [];
|
|
60
|
+
};
|
|
61
|
+
AgentHistory: {
|
|
62
|
+
Row: {
|
|
63
|
+
id: number;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
agentName: string;
|
|
66
|
+
agentHash: string;
|
|
67
|
+
previousAgentHash: string | null;
|
|
68
|
+
agentSource: string;
|
|
69
|
+
promptbookEngineVersion: string;
|
|
70
|
+
};
|
|
71
|
+
Insert: {
|
|
72
|
+
id?: number;
|
|
73
|
+
createdAt: string;
|
|
74
|
+
agentName: string;
|
|
75
|
+
agentHash: string;
|
|
76
|
+
previousAgentHash?: string | null;
|
|
77
|
+
agentSource: string;
|
|
78
|
+
promptbookEngineVersion: string;
|
|
79
|
+
};
|
|
80
|
+
Update: {
|
|
81
|
+
id?: number;
|
|
82
|
+
createdAt?: string;
|
|
83
|
+
agentName?: string;
|
|
84
|
+
agentHash?: string;
|
|
85
|
+
previousAgentHash?: string | null;
|
|
62
86
|
agentSource?: string;
|
|
87
|
+
promptbookEngineVersion?: string;
|
|
63
88
|
};
|
|
64
89
|
Relationships: [];
|
|
65
90
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* ACTION commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* DELETE commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* FORMAT commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* GOAL commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* KNOWLEDGE commitment definition
|
|
@@ -29,10 +29,6 @@ export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinit
|
|
|
29
29
|
*/
|
|
30
30
|
get documentation(): string;
|
|
31
31
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
32
|
-
/**
|
|
33
|
-
* Check if content is a URL
|
|
34
|
-
*/
|
|
35
|
-
private isUrl;
|
|
36
32
|
}
|
|
37
33
|
/**
|
|
38
34
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* MEMORY commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* MESSAGE commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* META commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* META IMAGE commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* META LINK commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* MODEL commitment definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
4
|
* NOTE commitment definition
|