@promptbook/vercel 0.103.0-45 → 0.103.0-47

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 (59) hide show
  1. package/esm/index.es.js +1 -4
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/servers.d.ts +1 -7
  4. package/esm/typings/src/_packages/components.index.d.ts +4 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +16 -14
  6. package/esm/typings/src/_packages/types.index.d.ts +12 -6
  7. package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +6 -1
  8. package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +1 -1
  9. package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
  10. package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +2 -0
  11. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +2 -0
  12. package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +14 -0
  13. package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.test.d.ts +1 -0
  14. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
  15. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +5 -60
  16. package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +1 -1
  17. package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +1 -1
  18. package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +1 -1
  19. package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +1 -1
  20. package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +1 -5
  21. package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +1 -1
  22. package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +1 -1
  23. package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +1 -1
  24. package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +1 -1
  25. package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +1 -1
  26. package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +1 -1
  27. package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +1 -1
  28. package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +1 -1
  29. package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +1 -1
  30. package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +1 -1
  31. package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +1 -1
  32. package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +1 -1
  33. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +1 -1
  34. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +1 -1
  35. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +1 -1
  36. package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
  37. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
  38. package/esm/typings/src/execution/LlmExecutionTools.d.ts +1 -1
  39. package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
  40. package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -7
  41. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  42. package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +32 -0
  44. package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
  45. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +5 -1
  46. package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
  47. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
  48. package/esm/typings/src/types/typeAliases.d.ts +6 -0
  49. package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
  50. package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +2 -2
  51. package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +1 -1
  52. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
  53. package/esm/typings/src/version.d.ts +1 -1
  54. package/package.json +2 -2
  55. package/umd/index.umd.js +1 -4
  56. package/umd/index.umd.js.map +1 -1
  57. /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
  58. /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
  59. /package/esm/typings/src/{book-2.0/commitments → commitments}/index.d.ts +0 -0
@@ -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,78 +22,24 @@ 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<BehaviorSubject<string_book>>;
32
+ getAgentSource(agentName: string_agent_name): Promise<string_book>;
92
33
  /**
93
34
  * Creates a new agent in the collection
94
35
  *
95
36
  * Note: You can set 'PARENT' in the agent source to inherit from another agent in the collection.
96
37
  */
97
38
  createAgent(agentSource: string_book): Promise<AgentBasicInformation>;
39
+ /**
40
+ * Updates an existing agent in the collection
41
+ */
42
+ updateAgentSource(agentName: string_agent_name, agentSource: string_book): Promise<void>;
98
43
  /**
99
44
  * Deletes an agent from the collection
100
45
  */
@@ -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
@@ -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
  * PERSONA 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
  * RULE 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
  * SAMPLE 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
  * SCENARIO 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
  * STYLE 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 type { CommitmentDefinition } from './CommitmentDefinition';
3
3
  /**
4
4
  * Base implementation of CommitmentDefinition that provides common functionality
@@ -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
  /**
3
3
  * Definition of a commitment that can be applied to agent model requirements
4
4
  *
@@ -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 './BaseCommitmentDefinition';
3
3
  /**
4
4
  * Placeholder commitment definition for commitments that are not yet implemented
@@ -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
  /**
3
3
  * Creates an empty/basic agent model requirements object
4
4
  * This serves as the starting point for the reduce-like pattern
@@ -9,6 +9,8 @@ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
9
9
  * - if it is valid json
10
10
  * - if it is meaningful
11
11
  *
12
+ * Note: [🔂] This function is idempotent.
13
+ *
12
14
  * @param pipeline valid or invalid PipelineJson
13
15
  * @returns the same pipeline if it is logically valid
14
16
  * @throws {PipelineLogicError} on logical error in the pipeline
@@ -9,7 +9,7 @@ import type { ChatPromptResult, CompletionPromptResult, EmbeddingPromptResult }
9
9
  * On its interface it exposes common methods for prompt execution.
10
10
  * Inside (in constructor) it calls OpenAI, Azure, GPU, proxy, cache, logging,...
11
11
  *
12
- * Note: [🦖] There are several different things in Promptbook:
12
+ * !!! Note: [🦖] There are several different things in Promptbook:
13
13
  * - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
14
14
  * - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
15
15
  * - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
@@ -46,6 +46,8 @@ export type ValidatePromptResultResult = {
46
46
  * This function provides a common abstraction for result validation that can be used
47
47
  * by both execution logic and caching logic to ensure consistency.
48
48
  *
49
+ * Note: [🔂] This function is idempotent.
50
+ *
49
51
  * @param options - The validation options including result string, expectations, and format
50
52
  * @returns Validation result with processed string and validity status
51
53
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
@@ -3,11 +3,12 @@ import type { AgentBasicInformation, BookParameter } from '../../book-2.0/agent-
3
3
  import type { string_book } from '../../book-2.0/agent-source/string_book';
4
4
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
5
5
  import type { string_agent_name, string_url_image } from '../../types/typeAliases';
6
+ import { AgentLlmExecutionTools } from './AgentLlmExecutionTools';
6
7
  import type { AgentOptions } from './AgentOptions';
7
8
  /**
8
9
  * Represents one AI Agent
9
10
  *
10
- * Note: [🦖] There are several different things in Promptbook:
11
+ * !!! Note: [🦖] There are several different things in Promptbook:
11
12
  * - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
12
13
  * - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
13
14
  * - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
@@ -15,8 +16,7 @@ import type { AgentOptions } from './AgentOptions';
15
16
  *
16
17
  * @public exported from `@promptbook/core`
17
18
  */
18
- export declare class Agent implements AgentBasicInformation {
19
- private readonly options;
19
+ export declare class Agent extends AgentLlmExecutionTools implements LlmExecutionTools, AgentBasicInformation {
20
20
  /**
21
21
  * Name of the agent
22
22
  */
@@ -41,10 +41,6 @@ export declare class Agent implements AgentBasicInformation {
41
41
  get parameters(): BookParameter[];
42
42
  readonly agentSource: BehaviorSubject<string_book>;
43
43
  constructor(options: AgentOptions);
44
- /**
45
- * Creates LlmExecutionTools which exposes the agent as a model
46
- */
47
- getLlmExecutionTools(): LlmExecutionTools;
48
44
  }
49
45
  /**
50
46
  * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
@@ -10,7 +10,7 @@ import type { CreateAgentLlmExecutionToolsOptions } from './CreateAgentLlmExecut
10
10
  * Execution Tools for calling LLM models with a predefined agent "soul"
11
11
  * This wraps underlying LLM execution tools and applies agent-specific system prompts and requirements
12
12
  *
13
- * Note: [🦖] There are several different things in Promptbook:
13
+ * !!! Note: [🦖] There are several different things in Promptbook:
14
14
  * - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
15
15
  * - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
16
16
  * - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
@@ -1,5 +1,5 @@
1
1
  import type { string_book } from '../../book-2.0/agent-source/string_book';
2
- import { CommonToolsOptions } from '../../execution/CommonToolsOptions';
2
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
3
3
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
4
4
  import { OpenAiAssistantExecutionTools } from '../openai/OpenAiAssistantExecutionTools';
5
5
  /**
@@ -0,0 +1,32 @@
1
+ import type { ChatPromptResult } from '../../execution/PromptResult';
2
+ import type { Prompt } from '../../types/Prompt';
3
+ import { Agent } from './Agent';
4
+ import type { RemoteAgentOptions } from './RemoteAgentOptions';
5
+ /**
6
+ * Represents one AI Agent
7
+ *
8
+ * !!! Note: [🦖] There are several different things in Promptbook:
9
+ * - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
10
+ * !!!! `RemoteAgent`
11
+ * - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
12
+ * - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
13
+ * - `OpenAiAssistantExecutionTools` - which is a specific implementation of `LlmExecutionTools` for OpenAI models with assistant capabilities, recommended for usage in `Agent` or `AgentLlmExecutionTools`
14
+ *
15
+ * @public exported from `@promptbook/core`
16
+ */
17
+ export declare class RemoteAgent extends Agent {
18
+ static connect(options: RemoteAgentOptions): Promise<RemoteAgent>;
19
+ /**
20
+ * The source of the agent
21
+ */
22
+ private agentUrl;
23
+ private constructor();
24
+ /**
25
+ * Calls the agent on agents remote server
26
+ */
27
+ callChatModel(prompt: Prompt): Promise<ChatPromptResult>;
28
+ }
29
+ /**
30
+ * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
31
+ * TODO: !!! Agent on remote server
32
+ */
@@ -0,0 +1,11 @@
1
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
2
+ import type { string_agent_url } from '../../types/typeAliases';
3
+ /**
4
+ * Options for creating a Remote Agent
5
+ */
6
+ export type RemoteAgentOptions = CommonToolsOptions & {
7
+ /**
8
+ * Url of the remote agent
9
+ */
10
+ agentUrl: string_agent_url;
11
+ };
@@ -9,7 +9,7 @@ import { OpenAiExecutionTools } from './OpenAiExecutionTools';
9
9
  *
10
10
  * This is useful for calling OpenAI API with a single assistant, for more wide usage use `OpenAiExecutionTools`.
11
11
  *
12
- * Note: [🦖] There are several different things in Promptbook:
12
+ * !!! Note: [🦖] There are several different things in Promptbook:
13
13
  * - `Agent` - which represents an AI Agent with its source, memories, actions, etc. Agent is a higher-level abstraction which is internally using:
14
14
  * - `LlmExecutionTools` - which wraps one or more LLM models and provides an interface to execute them
15
15
  * - `AgentLlmExecutionTools` - which is a specific implementation of `LlmExecutionTools` that wraps another LlmExecutionTools and applies agent-specific system prompts and requirements
@@ -42,6 +42,10 @@ export declare class OpenAiAssistantExecutionTools extends OpenAiExecutionTools
42
42
  * Instructions for the new assistant
43
43
  */
44
44
  readonly instructions: string_markdown;
45
+ /**
46
+ * Optional list of knowledge source links (URLs or file paths) to attach to the assistant via vector store
47
+ */
48
+ readonly knowledgeSources?: ReadonlyArray<string>;
45
49
  }): Promise<OpenAiAssistantExecutionTools>;
46
50
  /**
47
51
  * Discriminant for type guards
@@ -3,6 +3,8 @@ import type { PipelineString } from './PipelineString';
3
3
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
4
4
  * It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
5
5
  *
6
+ * Note: [🔂] This function is idempotent.
7
+ *
6
8
  * @param {string} pipelineString the candidate for a pipeline string
7
9
  * @returns {PipelineString} the same string as input, but validated as valid
8
10
  * @throws {ParseError} if the string is not a valid pipeline string
@@ -21,4 +21,5 @@ export type PromptbookStorage<TItem> = {
21
21
  };
22
22
  /**
23
23
  * TODO: [💺] Constrain `TItem` to [🚉] JSON-serializable objects only in type level
24
+ * TODO: [☹️] Unite the storages
24
25
  */
@@ -360,6 +360,12 @@ export type string_base_url = string;
360
360
  * For example `"https://promptbook.studio/webgpt/"`
361
361
  */
362
362
  export type string_pipeline_root_url = string;
363
+ /**
364
+ * Semantic helper
365
+ *
366
+ * For example `"https://s6.ptbk.io/agents/agent-007"`
367
+ */
368
+ export type string_agent_url = string;
363
369
  /**
364
370
  * Semantic helper
365
371
  *
@@ -9,6 +9,3 @@
9
9
  * @private util of `@promptbook/color`
10
10
  */
11
11
  export declare function checkChannelValue(channelName: string, value: number): asserts value is number;
12
- /**
13
- * TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
14
- */
@@ -1,7 +1,7 @@
1
1
  import type { PartialDeep } from 'type-fest';
2
2
  import type { AgentBasicInformation } from '../../book-2.0/agent-source/AgentBasicInformation';
3
- import { string_book } from '../../book-2.0/agent-source/string_book';
4
- import { string_agent_name_in_book } from '../../types/typeAliases';
3
+ import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import type { string_agent_name_in_book } from '../../types/typeAliases';
5
5
  type GenerateBookBoilerplateOptions = PartialDeep<Omit<AgentBasicInformation, 'parameters'>> & {
6
6
  /**
7
7
  * Name of the parent agent to inherit from
@@ -1,4 +1,4 @@
1
- import { string_color, string_person_fullname } from '../../types/typeAliases';
1
+ import type { string_color, string_person_fullname } from '../../types/typeAliases';
2
2
  export type RandomFullnameWithColorResult = {
3
3
  fullname: string_person_fullname;
4
4
  color: string_color;
@@ -3,6 +3,8 @@ import type { string_parameter_name } from '../../../types/typeAliases';
3
3
  * Function `validateParameterName` will normalize and validate a parameter name for use in pipelines.
4
4
  * It removes diacritics, emojis, and quotes, normalizes to camelCase, and checks for reserved names and invalid characters.
5
5
  *
6
+ * Note: [🔂] This function is idempotent.
7
+ *
6
8
  * @param parameterName The parameter name to validate and normalize.
7
9
  * @returns The validated and normalized parameter name.
8
10
  * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.103.0-44`).
18
+ * It follows semantic versioning (e.g., `0.103.0-46`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/vercel",
3
- "version": "0.103.0-45",
3
+ "version": "0.103.0-47",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -94,7 +94,7 @@
94
94
  "module": "./esm/index.es.js",
95
95
  "typings": "./esm/typings/src/_packages/vercel.index.d.ts",
96
96
  "peerDependencies": {
97
- "@promptbook/core": "0.103.0-45"
97
+ "@promptbook/core": "0.103.0-47"
98
98
  },
99
99
  "dependencies": {
100
100
  "colors": "^1.4.0",
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-45';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-47';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -825,9 +825,6 @@
825
825
  throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
826
826
  }
827
827
  }
828
- /**
829
- * TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
830
- */
831
828
 
832
829
  /**
833
830
  * Color object represents an RGB color with alpha channel