art-framework 0.2.7 → 0.2.8
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/dist/index.cjs +25 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +25 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -634,6 +634,8 @@ interface ThreadConfig {
|
|
|
634
634
|
enabledTools: string[];
|
|
635
635
|
/** The maximum number of past messages (`ConversationMessage` objects) to retrieve for context. */
|
|
636
636
|
historyLimit: number;
|
|
637
|
+
/** Optional system prompt string to be used for this thread, overriding instance or agent defaults. */
|
|
638
|
+
systemPrompt?: string;
|
|
637
639
|
}
|
|
638
640
|
/**
|
|
639
641
|
* Represents non-configuration state associated with an agent or thread.
|
|
@@ -692,6 +694,8 @@ interface AgentOptions {
|
|
|
692
694
|
stream?: boolean;
|
|
693
695
|
/** Override the prompt template used for this specific call. */
|
|
694
696
|
promptTemplateId?: string;
|
|
697
|
+
/** Optional system prompt string to override thread, instance, or agent defaults for this specific call. */
|
|
698
|
+
systemPrompt?: string;
|
|
695
699
|
}
|
|
696
700
|
/**
|
|
697
701
|
* The final structured response returned by the agent core after processing.
|
|
@@ -966,6 +970,11 @@ interface ArtInstanceConfig {
|
|
|
966
970
|
/** Minimum log level to output. Defaults to 'info'. */
|
|
967
971
|
level?: LogLevel;
|
|
968
972
|
};
|
|
973
|
+
/**
|
|
974
|
+
* Optional default system prompt string to be used for the entire ART instance.
|
|
975
|
+
* This can be overridden at the thread level or at the individual call level.
|
|
976
|
+
*/
|
|
977
|
+
defaultSystemPrompt?: string;
|
|
969
978
|
}
|
|
970
979
|
|
|
971
980
|
type StreamEventTypeFilter = StreamEvent['type'] | Array<StreamEvent['type']>;
|
|
@@ -1435,6 +1444,12 @@ declare function createArtInstance(config: ArtInstanceConfig): Promise<ArtInstan
|
|
|
1435
1444
|
interface PESAgentDependencies {
|
|
1436
1445
|
/** Manages thread configuration and state. */
|
|
1437
1446
|
stateManager: StateManager;
|
|
1447
|
+
/**
|
|
1448
|
+
* Optional default system prompt string provided at the ART instance level.
|
|
1449
|
+
* This serves as a custom prompt part if no thread-specific or call-specific
|
|
1450
|
+
* system prompt is provided. It's appended to the agent's base system prompt.
|
|
1451
|
+
*/
|
|
1452
|
+
instanceDefaultCustomSystemPrompt?: string;
|
|
1438
1453
|
/** Manages conversation history. */
|
|
1439
1454
|
conversationManager: ConversationManager;
|
|
1440
1455
|
/** Registry for available tools. */
|
|
@@ -1468,7 +1483,13 @@ interface PESAgentDependencies {
|
|
|
1468
1483
|
*/
|
|
1469
1484
|
declare class PESAgent implements IAgentCore {
|
|
1470
1485
|
private readonly deps;
|
|
1486
|
+
/** The base system prompt inherent to this agent. */
|
|
1471
1487
|
private readonly defaultSystemPrompt;
|
|
1488
|
+
/**
|
|
1489
|
+
* Stores the instance-level default custom system prompt, passed during construction.
|
|
1490
|
+
* Used in the system prompt hierarchy if no thread or call-level prompt is specified.
|
|
1491
|
+
*/
|
|
1492
|
+
private readonly instanceDefaultCustomSystemPrompt?;
|
|
1472
1493
|
/**
|
|
1473
1494
|
* Creates an instance of the PESAgent.
|
|
1474
1495
|
* @param dependencies - An object containing instances of all required subsystems (managers, registries, etc.).
|
|
@@ -1478,8 +1499,11 @@ declare class PESAgent implements IAgentCore {
|
|
|
1478
1499
|
* Executes the full Plan-Execute-Synthesize cycle for a given user query.
|
|
1479
1500
|
*
|
|
1480
1501
|
* **Workflow:**
|
|
1481
|
-
* 1. **Initiation & Config:** Loads thread configuration
|
|
1482
|
-
*
|
|
1502
|
+
* 1. **Initiation & Config:** Loads thread configuration. Resolves the final system prompt based on a hierarchy:
|
|
1503
|
+
* Call-level (`AgentProps.options.systemPrompt`) > Thread-level (`ThreadConfig.systemPrompt`) >
|
|
1504
|
+
* Instance-level (`ArtInstanceConfig.defaultSystemPrompt` via constructor) > Agent's base prompt.
|
|
1505
|
+
* The resolved custom part is appended to the agent's base prompt.
|
|
1506
|
+
* 2. **Data Gathering:** Gathers history, available tools, the resolved system prompt, and query.
|
|
1483
1507
|
* 3. **Planning Prompt Construction:** Directly constructs the `ArtStandardPrompt` object/array for planning.
|
|
1484
1508
|
* 4. **Planning LLM Call:** Sends the planning prompt object to the `reasoningEngine` (requesting streaming). Consumes the `StreamEvent` stream, buffers the output text, and handles potential errors.
|
|
1485
1509
|
* 5. **Planning Output Parsing:** Parses the buffered planning output text to extract intent, plan, and tool calls using `outputParser.parsePlanningOutput`.
|
|
@@ -2123,6 +2147,6 @@ declare const generateUUID: () => string;
|
|
|
2123
2147
|
*/
|
|
2124
2148
|
|
|
2125
2149
|
/** The current version of the ART Framework package. */
|
|
2126
|
-
declare const VERSION = "0.2.
|
|
2150
|
+
declare const VERSION = "0.2.8";
|
|
2127
2151
|
|
|
2128
2152
|
export { ARTError, AdapterInstantiationError, type AgentFinalResponse, type AgentOptions, type AgentProps, type AgentState, AnthropicAdapter, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, type ConversationSocket, DeepSeekAdapter, ErrorCode, type ExecutionContext, type ExecutionMetadata, type FilterOptions, type FormattedPrompt, GeminiAdapter, type IAgentCore, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type ManagedAdapterAccessor, type MessageOptions, MessageRole, ModelCapability, type Observation, type ObservationFilter, type ObservationManager, type ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, OpenRouterAdapter, type OutputParser, PESAgent, type ParsedToolCall, type PromptContext, type PromptManager, type ProviderAdapter, type ProviderManagerConfig, type ReasoningEngine, type RuntimeProviderConfig, type StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type ThreadConfig, type ThreadContext, type ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, type UISystem, UnknownProviderError, type UnsubscribeFunction, VERSION, createArtInstance, generateUUID };
|
package/dist/index.d.ts
CHANGED
|
@@ -634,6 +634,8 @@ interface ThreadConfig {
|
|
|
634
634
|
enabledTools: string[];
|
|
635
635
|
/** The maximum number of past messages (`ConversationMessage` objects) to retrieve for context. */
|
|
636
636
|
historyLimit: number;
|
|
637
|
+
/** Optional system prompt string to be used for this thread, overriding instance or agent defaults. */
|
|
638
|
+
systemPrompt?: string;
|
|
637
639
|
}
|
|
638
640
|
/**
|
|
639
641
|
* Represents non-configuration state associated with an agent or thread.
|
|
@@ -692,6 +694,8 @@ interface AgentOptions {
|
|
|
692
694
|
stream?: boolean;
|
|
693
695
|
/** Override the prompt template used for this specific call. */
|
|
694
696
|
promptTemplateId?: string;
|
|
697
|
+
/** Optional system prompt string to override thread, instance, or agent defaults for this specific call. */
|
|
698
|
+
systemPrompt?: string;
|
|
695
699
|
}
|
|
696
700
|
/**
|
|
697
701
|
* The final structured response returned by the agent core after processing.
|
|
@@ -966,6 +970,11 @@ interface ArtInstanceConfig {
|
|
|
966
970
|
/** Minimum log level to output. Defaults to 'info'. */
|
|
967
971
|
level?: LogLevel;
|
|
968
972
|
};
|
|
973
|
+
/**
|
|
974
|
+
* Optional default system prompt string to be used for the entire ART instance.
|
|
975
|
+
* This can be overridden at the thread level or at the individual call level.
|
|
976
|
+
*/
|
|
977
|
+
defaultSystemPrompt?: string;
|
|
969
978
|
}
|
|
970
979
|
|
|
971
980
|
type StreamEventTypeFilter = StreamEvent['type'] | Array<StreamEvent['type']>;
|
|
@@ -1435,6 +1444,12 @@ declare function createArtInstance(config: ArtInstanceConfig): Promise<ArtInstan
|
|
|
1435
1444
|
interface PESAgentDependencies {
|
|
1436
1445
|
/** Manages thread configuration and state. */
|
|
1437
1446
|
stateManager: StateManager;
|
|
1447
|
+
/**
|
|
1448
|
+
* Optional default system prompt string provided at the ART instance level.
|
|
1449
|
+
* This serves as a custom prompt part if no thread-specific or call-specific
|
|
1450
|
+
* system prompt is provided. It's appended to the agent's base system prompt.
|
|
1451
|
+
*/
|
|
1452
|
+
instanceDefaultCustomSystemPrompt?: string;
|
|
1438
1453
|
/** Manages conversation history. */
|
|
1439
1454
|
conversationManager: ConversationManager;
|
|
1440
1455
|
/** Registry for available tools. */
|
|
@@ -1468,7 +1483,13 @@ interface PESAgentDependencies {
|
|
|
1468
1483
|
*/
|
|
1469
1484
|
declare class PESAgent implements IAgentCore {
|
|
1470
1485
|
private readonly deps;
|
|
1486
|
+
/** The base system prompt inherent to this agent. */
|
|
1471
1487
|
private readonly defaultSystemPrompt;
|
|
1488
|
+
/**
|
|
1489
|
+
* Stores the instance-level default custom system prompt, passed during construction.
|
|
1490
|
+
* Used in the system prompt hierarchy if no thread or call-level prompt is specified.
|
|
1491
|
+
*/
|
|
1492
|
+
private readonly instanceDefaultCustomSystemPrompt?;
|
|
1472
1493
|
/**
|
|
1473
1494
|
* Creates an instance of the PESAgent.
|
|
1474
1495
|
* @param dependencies - An object containing instances of all required subsystems (managers, registries, etc.).
|
|
@@ -1478,8 +1499,11 @@ declare class PESAgent implements IAgentCore {
|
|
|
1478
1499
|
* Executes the full Plan-Execute-Synthesize cycle for a given user query.
|
|
1479
1500
|
*
|
|
1480
1501
|
* **Workflow:**
|
|
1481
|
-
* 1. **Initiation & Config:** Loads thread configuration
|
|
1482
|
-
*
|
|
1502
|
+
* 1. **Initiation & Config:** Loads thread configuration. Resolves the final system prompt based on a hierarchy:
|
|
1503
|
+
* Call-level (`AgentProps.options.systemPrompt`) > Thread-level (`ThreadConfig.systemPrompt`) >
|
|
1504
|
+
* Instance-level (`ArtInstanceConfig.defaultSystemPrompt` via constructor) > Agent's base prompt.
|
|
1505
|
+
* The resolved custom part is appended to the agent's base prompt.
|
|
1506
|
+
* 2. **Data Gathering:** Gathers history, available tools, the resolved system prompt, and query.
|
|
1483
1507
|
* 3. **Planning Prompt Construction:** Directly constructs the `ArtStandardPrompt` object/array for planning.
|
|
1484
1508
|
* 4. **Planning LLM Call:** Sends the planning prompt object to the `reasoningEngine` (requesting streaming). Consumes the `StreamEvent` stream, buffers the output text, and handles potential errors.
|
|
1485
1509
|
* 5. **Planning Output Parsing:** Parses the buffered planning output text to extract intent, plan, and tool calls using `outputParser.parsePlanningOutput`.
|
|
@@ -2123,6 +2147,6 @@ declare const generateUUID: () => string;
|
|
|
2123
2147
|
*/
|
|
2124
2148
|
|
|
2125
2149
|
/** The current version of the ART Framework package. */
|
|
2126
|
-
declare const VERSION = "0.2.
|
|
2150
|
+
declare const VERSION = "0.2.8";
|
|
2127
2151
|
|
|
2128
2152
|
export { ARTError, AdapterInstantiationError, type AgentFinalResponse, type AgentOptions, type AgentProps, type AgentState, AnthropicAdapter, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, type ConversationSocket, DeepSeekAdapter, ErrorCode, type ExecutionContext, type ExecutionMetadata, type FilterOptions, type FormattedPrompt, GeminiAdapter, type IAgentCore, type IConversationRepository, type IObservationRepository, type IProviderManager, type IStateRepository, type IToolExecutor, type ITypedSocket, InMemoryStorageAdapter, IndexedDBStorageAdapter, type JsonObjectSchema, type JsonSchema, type LLMMetadata, LLMStreamSocket, LocalInstanceBusyError, LocalProviderConflictError, LogLevel, Logger, type ManagedAdapterAccessor, type MessageOptions, MessageRole, ModelCapability, type Observation, type ObservationFilter, type ObservationManager, type ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, OpenRouterAdapter, type OutputParser, PESAgent, type ParsedToolCall, type PromptContext, type PromptManager, type ProviderAdapter, type ProviderManagerConfig, type ReasoningEngine, type RuntimeProviderConfig, type StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type ThreadConfig, type ThreadContext, type ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, type UISystem, UnknownProviderError, type UnsubscribeFunction, VERSION, createArtInstance, generateUUID };
|