art-framework 0.3.5 → 0.3.7

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.d.cts CHANGED
@@ -978,6 +978,8 @@ interface ConversationMessage {
978
978
  declare enum ObservationType {
979
979
  /** The user's inferred intent. */
980
980
  INTENT = "INTENT",
981
+ /** The generated concise thread title. */
982
+ TITLE = "TITLE",
981
983
  /** The agent's step-by-step plan to address the intent. */
982
984
  PLAN = "PLAN",
983
985
  /** The agent's internal monologue or reasoning process. */
@@ -1063,6 +1065,15 @@ interface Observation {
1063
1065
  title: string;
1064
1066
  /**
1065
1067
  * The main data payload of the observation, structure depends on the `type`.
1068
+ *
1069
+ * @remarks
1070
+ * Common content shapes by `type`:
1071
+ * - `TITLE`: `{ title: string }` — a concise thread title (<= 10 words)
1072
+ * - `INTENT`: `{ intent: string }`
1073
+ * - `PLAN`: `{ plan: string; rawOutput?: string }`
1074
+ * - `TOOL_CALL`: `{ toolCalls: ParsedToolCall[] }`
1075
+ * - `TOOL_EXECUTION`: `{ callId: string; toolName: string; status: 'success' | 'error'; output?: any; error?: string }`
1076
+ * - `FINAL_RESPONSE`: `{ message: ConversationMessage; uiMetadata?: object }`
1066
1077
  * @property {any} content
1067
1078
  */
1068
1079
  content: any;
@@ -2834,10 +2845,25 @@ interface OutputParser {
2834
2845
  * @returns A promise resolving to an object containing the extracted intent, plan description, and an array of parsed tool calls.
2835
2846
  * @throws {ARTError} If the output cannot be parsed into the expected structure (typically code `OUTPUT_PARSING_FAILED`).
2836
2847
  */
2848
+ /**
2849
+ * Parses the raw planning LLM output into structured fields.
2850
+ *
2851
+ * @remarks
2852
+ * This method should be resilient to provider-specific wrappers and formats.
2853
+ * Implementations MUST attempt JSON-first parsing and then fall back to parsing
2854
+ * labeled sections. Supported fields:
2855
+ * - `title?`: A concise thread title (<= 10 words), derived from the user's intent and context.
2856
+ * - `intent?`: A short summary of the user's goal.
2857
+ * - `plan?`: A human-readable list/description of steps.
2858
+ * - `toolCalls?`: Structured tool call intents parsed from the output.
2859
+ * - `thoughts?`: Aggregated content extracted from <think> tags when present.
2860
+ */
2837
2861
  parsePlanningOutput(output: string): Promise<{
2862
+ title?: string;
2838
2863
  intent?: string;
2839
2864
  plan?: string;
2840
2865
  toolCalls?: ParsedToolCall[];
2866
+ thoughts?: string;
2841
2867
  }>;
2842
2868
  /**
2843
2869
  * Parses the raw string output from the synthesis LLM call to extract the final, user-facing response content.
@@ -3753,6 +3779,11 @@ declare class PESAgent implements IAgentCore {
3753
3779
  /**
3754
3780
  * Performs the planning phase including LLM call and output parsing.
3755
3781
  * @private
3782
+ *
3783
+ * @remarks
3784
+ * The planning prompt instructs the LLM to produce a concise `title` (<= 10 words)
3785
+ * alongside `intent`, `plan`, and `toolCalls`. After parsing, a `TITLE` observation
3786
+ * is emitted (if present) for UI components to subscribe via `ObservationSocket`.
3756
3787
  */
3757
3788
  private _performPlanning;
3758
3789
  /**
@@ -5236,6 +5267,6 @@ declare const generateUUID: () => string;
5236
5267
  /**
5237
5268
  * The current version of the ART Framework package.
5238
5269
  */
5239
- declare const VERSION = "0.3.3";
5270
+ declare const VERSION = "0.3.7";
5240
5271
 
5241
5272
  export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, 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 LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type PromptManager, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };
package/dist/index.d.ts CHANGED
@@ -978,6 +978,8 @@ interface ConversationMessage {
978
978
  declare enum ObservationType {
979
979
  /** The user's inferred intent. */
980
980
  INTENT = "INTENT",
981
+ /** The generated concise thread title. */
982
+ TITLE = "TITLE",
981
983
  /** The agent's step-by-step plan to address the intent. */
982
984
  PLAN = "PLAN",
983
985
  /** The agent's internal monologue or reasoning process. */
@@ -1063,6 +1065,15 @@ interface Observation {
1063
1065
  title: string;
1064
1066
  /**
1065
1067
  * The main data payload of the observation, structure depends on the `type`.
1068
+ *
1069
+ * @remarks
1070
+ * Common content shapes by `type`:
1071
+ * - `TITLE`: `{ title: string }` — a concise thread title (<= 10 words)
1072
+ * - `INTENT`: `{ intent: string }`
1073
+ * - `PLAN`: `{ plan: string; rawOutput?: string }`
1074
+ * - `TOOL_CALL`: `{ toolCalls: ParsedToolCall[] }`
1075
+ * - `TOOL_EXECUTION`: `{ callId: string; toolName: string; status: 'success' | 'error'; output?: any; error?: string }`
1076
+ * - `FINAL_RESPONSE`: `{ message: ConversationMessage; uiMetadata?: object }`
1066
1077
  * @property {any} content
1067
1078
  */
1068
1079
  content: any;
@@ -2834,10 +2845,25 @@ interface OutputParser {
2834
2845
  * @returns A promise resolving to an object containing the extracted intent, plan description, and an array of parsed tool calls.
2835
2846
  * @throws {ARTError} If the output cannot be parsed into the expected structure (typically code `OUTPUT_PARSING_FAILED`).
2836
2847
  */
2848
+ /**
2849
+ * Parses the raw planning LLM output into structured fields.
2850
+ *
2851
+ * @remarks
2852
+ * This method should be resilient to provider-specific wrappers and formats.
2853
+ * Implementations MUST attempt JSON-first parsing and then fall back to parsing
2854
+ * labeled sections. Supported fields:
2855
+ * - `title?`: A concise thread title (<= 10 words), derived from the user's intent and context.
2856
+ * - `intent?`: A short summary of the user's goal.
2857
+ * - `plan?`: A human-readable list/description of steps.
2858
+ * - `toolCalls?`: Structured tool call intents parsed from the output.
2859
+ * - `thoughts?`: Aggregated content extracted from <think> tags when present.
2860
+ */
2837
2861
  parsePlanningOutput(output: string): Promise<{
2862
+ title?: string;
2838
2863
  intent?: string;
2839
2864
  plan?: string;
2840
2865
  toolCalls?: ParsedToolCall[];
2866
+ thoughts?: string;
2841
2867
  }>;
2842
2868
  /**
2843
2869
  * Parses the raw string output from the synthesis LLM call to extract the final, user-facing response content.
@@ -3753,6 +3779,11 @@ declare class PESAgent implements IAgentCore {
3753
3779
  /**
3754
3780
  * Performs the planning phase including LLM call and output parsing.
3755
3781
  * @private
3782
+ *
3783
+ * @remarks
3784
+ * The planning prompt instructs the LLM to produce a concise `title` (<= 10 words)
3785
+ * alongside `intent`, `plan`, and `toolCalls`. After parsing, a `TITLE` observation
3786
+ * is emitted (if present) for UI components to subscribe via `ObservationSocket`.
3756
3787
  */
3757
3788
  private _performPlanning;
3758
3789
  /**
@@ -5236,6 +5267,6 @@ declare const generateUUID: () => string;
5236
5267
  /**
5237
5268
  * The current version of the ART Framework package.
5238
5269
  */
5239
- declare const VERSION = "0.3.3";
5270
+ declare const VERSION = "0.3.7";
5240
5271
 
5241
5272
  export { type A2AAgentInfo, type A2ATask, type A2ATaskEvent, type A2ATaskFilter, type A2ATaskMetadata, A2ATaskPriority, type A2ATaskResult, A2ATaskSocket, A2ATaskStatus, ARTError, AdapterInstantiationError, type AgentDiscoveryConfig, AgentDiscoveryService, type AgentFinalResponse, type AgentOptions, type AgentPersona, type AgentProps, type AgentState, AnthropicAdapter, type AnthropicAdapterOptions, ApiKeyStrategy, ApiQueueTimeoutError, type ArtInstance, type ArtInstanceConfig, type ArtStandardMessage, type ArtStandardMessageRole, ArtStandardMessageSchema, type ArtStandardPrompt, ArtStandardPromptSchema, AuthManager, type AvailableProviderEntry, CalculatorTool, type CallOptions, type ConversationManager, type ConversationMessage, ConversationSocket, type CreateA2ATaskRequest, DeepSeekAdapter, type DeepSeekAdapterOptions, ErrorCode, type ExecutionContext, type ExecutionMetadata, type FilterOptions, type FormattedPrompt, GeminiAdapter, type GeminiAdapterOptions, GenericOAuthStrategy, type IA2ATaskRepository, type IAgentCore, type IAuthStrategy, 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 LoggerConfig, type ManagedAdapterAccessor, McpClientController, McpManager, type McpManagerConfig, McpProxyTool, type McpResource, type McpResourceTemplate, type McpServerConfig, type McpServerStatus, type McpToolDefinition, type MessageOptions, MessageRole, ModelCapability, type OAuthConfig, type Observation, type ObservationFilter, type ObservationManager, ObservationSocket, ObservationType, OllamaAdapter, type OllamaAdapterOptions, OpenAIAdapter, type OpenAIAdapterOptions, OpenRouterAdapter, type OpenRouterAdapterOptions, type OutputParser, PESAgent, type PKCEOAuthConfig, PKCEOAuthStrategy, type ParsedToolCall, type PromptBlueprint, type PromptContext, type PromptManager, type ProviderAdapter, type ProviderManagerConfig, ProviderManagerImpl, type ReasoningEngine, type RuntimeProviderConfig, type StageSpecificPrompts, StateManager, type StateSavingStrategy, type StorageAdapter, type StreamEvent, type StreamEventTypeFilter, SupabaseStorageAdapter, type SystemPromptMergeStrategy, type SystemPromptOverride, type SystemPromptResolver, type SystemPromptSpec, type SystemPromptsRegistry, type TaskDelegationConfig, TaskDelegationService, type TaskStatusResponse, type ThreadConfig, type ThreadContext, ToolRegistry, type ToolResult, type ToolSchema, type ToolSystem, TypedSocket, UISystem, UnknownProviderError, type UnsubscribeFunction, type UpdateA2ATaskRequest, VERSION, type ZyntopiaOAuthConfig, ZyntopiaOAuthStrategy, createArtInstance, generateUUID };