@robota-sdk/agent-core 3.0.0-beta.56 → 3.0.0-beta.58
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/CHANGELOG.md +16 -0
- package/README.md +14 -0
- package/dist/browser/index.d.ts +28 -38
- package/dist/browser/index.js +7 -7
- package/dist/node/index.cjs +7 -7
- package/dist/node/index.d.cts +28 -38
- package/dist/node/index.d.ts +28 -38
- package/dist/node/index.js +7 -7
- package/package.json +1 -1
package/dist/node/index.d.cts
CHANGED
|
@@ -202,16 +202,6 @@ interface IPluginContext {
|
|
|
202
202
|
error?: Error;
|
|
203
203
|
executionContext?: TContextData;
|
|
204
204
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Type utility functions for safe type checking and validation
|
|
207
|
-
* @internal
|
|
208
|
-
*/
|
|
209
|
-
declare const TypeUtils: {
|
|
210
|
-
isPrimitive: (value: TUniversalValue) => value is TPrimitiveValue;
|
|
211
|
-
isArray: (value: TUniversalValue) => value is TUniversalArrayValue;
|
|
212
|
-
isObject: (value: TUniversalValue) => value is IUniversalObjectValue;
|
|
213
|
-
isUniversalValue: (value: TUniversalValue) => value is TUniversalValue;
|
|
214
|
-
};
|
|
215
205
|
|
|
216
206
|
/**
|
|
217
207
|
* Reusable type definitions for provider layer
|
|
@@ -928,24 +918,6 @@ interface ILogger {
|
|
|
928
918
|
* - Inject a real logger explicitly if you want output.
|
|
929
919
|
*/
|
|
930
920
|
declare const SilentLogger: ILogger;
|
|
931
|
-
/**
|
|
932
|
-
* Console logger implementation
|
|
933
|
-
* @internal
|
|
934
|
-
*/
|
|
935
|
-
declare class ConsoleLogger implements ILogger {
|
|
936
|
-
private level?;
|
|
937
|
-
private packageName;
|
|
938
|
-
private sinkLogger;
|
|
939
|
-
constructor(packageName: string, logger?: ILogger);
|
|
940
|
-
debug(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
941
|
-
info(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
942
|
-
warn(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
943
|
-
error(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
944
|
-
log(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
945
|
-
private getLevel;
|
|
946
|
-
private shouldLog;
|
|
947
|
-
private forward;
|
|
948
|
-
}
|
|
949
921
|
/**
|
|
950
922
|
* Create a named logger instance for a package or module.
|
|
951
923
|
* Use this to create loggers with a specific name prefix for easy log filtering.
|
|
@@ -1595,6 +1567,7 @@ interface IAgentConfig {
|
|
|
1595
1567
|
responseFormat?: IResponseFormatConfig;
|
|
1596
1568
|
safetySettings?: ISafetySetting[];
|
|
1597
1569
|
timeout?: number;
|
|
1570
|
+
maxExecutionRounds?: number;
|
|
1598
1571
|
retryAttempts?: number;
|
|
1599
1572
|
rateLimiting?: {
|
|
1600
1573
|
enabled?: boolean;
|
|
@@ -1635,7 +1608,16 @@ interface IRunOptions {
|
|
|
1635
1608
|
signal?: AbortSignal;
|
|
1636
1609
|
/** Per-run streaming text callback. Prefer this over mutating provider callback state. */
|
|
1637
1610
|
onTextDelta?: TTextDeltaCallback;
|
|
1611
|
+
/** Per-run replay event callback for provider/tool execution boundaries. */
|
|
1612
|
+
onExecutionEvent?: TExecutionEventCallback;
|
|
1613
|
+
/**
|
|
1614
|
+
* Maximum model/tool rounds for this run.
|
|
1615
|
+
* Use 0 for no core round cap.
|
|
1616
|
+
*/
|
|
1617
|
+
maxExecutionRounds?: number;
|
|
1638
1618
|
}
|
|
1619
|
+
type TExecutionEventData = Record<string, unknown>;
|
|
1620
|
+
type TExecutionEventCallback = (event: string, data: TExecutionEventData) => void;
|
|
1639
1621
|
/**
|
|
1640
1622
|
* Generic agent interface with type parameters for enhanced type safety
|
|
1641
1623
|
*
|
|
@@ -1687,12 +1669,14 @@ interface IProviderConfig$1 {
|
|
|
1687
1669
|
apiKey?: string;
|
|
1688
1670
|
baseURL?: string;
|
|
1689
1671
|
timeout?: number;
|
|
1672
|
+
options?: Record<string, TUniversalValue>;
|
|
1690
1673
|
}
|
|
1691
1674
|
interface IProviderProfileDefaults {
|
|
1692
1675
|
model?: string;
|
|
1693
1676
|
apiKey?: string;
|
|
1694
1677
|
baseURL?: string;
|
|
1695
1678
|
timeout?: number;
|
|
1679
|
+
options?: Record<string, TUniversalValue>;
|
|
1696
1680
|
}
|
|
1697
1681
|
interface IProviderProfileConfig {
|
|
1698
1682
|
type?: string;
|
|
@@ -1700,6 +1684,7 @@ interface IProviderProfileConfig {
|
|
|
1700
1684
|
apiKey?: string;
|
|
1701
1685
|
baseURL?: string;
|
|
1702
1686
|
timeout?: number;
|
|
1687
|
+
options?: Record<string, TUniversalValue>;
|
|
1703
1688
|
}
|
|
1704
1689
|
interface IProviderProbeResult {
|
|
1705
1690
|
ok: boolean;
|
|
@@ -1716,6 +1701,9 @@ interface IProviderSetupStepDefinition {
|
|
|
1716
1701
|
}
|
|
1717
1702
|
interface IProviderDefinition {
|
|
1718
1703
|
type: string;
|
|
1704
|
+
aliases?: readonly string[];
|
|
1705
|
+
displayName?: string;
|
|
1706
|
+
description?: string;
|
|
1719
1707
|
defaults?: IProviderProfileDefaults;
|
|
1720
1708
|
setupSteps?: readonly IProviderSetupStepDefinition[];
|
|
1721
1709
|
requiresApiKey?: boolean;
|
|
@@ -3078,7 +3066,6 @@ interface IProviderApiMessage {
|
|
|
3078
3066
|
*/
|
|
3079
3067
|
declare class ConversationStore implements IConversationHistory {
|
|
3080
3068
|
private history;
|
|
3081
|
-
private toolCallIds;
|
|
3082
3069
|
private pendingAssistant;
|
|
3083
3070
|
constructor(maxMessages?: number);
|
|
3084
3071
|
addMessage(message: TUniversalMessage): void;
|
|
@@ -3154,8 +3141,6 @@ declare class ConversationHistory {
|
|
|
3154
3141
|
conversationIds: string[];
|
|
3155
3142
|
totalMessages: number;
|
|
3156
3143
|
};
|
|
3157
|
-
/** @internal */
|
|
3158
|
-
private cleanupOldConversations;
|
|
3159
3144
|
}
|
|
3160
3145
|
|
|
3161
3146
|
/**
|
|
@@ -3348,12 +3333,6 @@ declare class EventEmitterPlugin extends AbstractPlugin<IEventEmitterPluginOptio
|
|
|
3348
3333
|
destroy(): Promise<void>;
|
|
3349
3334
|
}
|
|
3350
3335
|
|
|
3351
|
-
/**
|
|
3352
|
-
* Configuration and tool management delegate for the Robota agent.
|
|
3353
|
-
*
|
|
3354
|
-
* Extracted from robota.ts to keep the main class under 300 lines.
|
|
3355
|
-
*/
|
|
3356
|
-
|
|
3357
3336
|
/** Agent statistics metadata type */
|
|
3358
3337
|
type TAgentStatsMetadata = Record<string, string | number | boolean | Date | string[]>;
|
|
3359
3338
|
|
|
@@ -3678,6 +3657,17 @@ declare class AgentFactory {
|
|
|
3678
3657
|
};
|
|
3679
3658
|
}
|
|
3680
3659
|
|
|
3660
|
+
interface IAssistantUsageMetadata {
|
|
3661
|
+
inputTokens: number;
|
|
3662
|
+
outputTokens: number;
|
|
3663
|
+
usage: {
|
|
3664
|
+
totalTokens: number;
|
|
3665
|
+
inputTokens: number;
|
|
3666
|
+
outputTokens: number;
|
|
3667
|
+
};
|
|
3668
|
+
}
|
|
3669
|
+
declare function collectAssistantUsageMetadata(message: TUniversalMessage): IAssistantUsageMetadata | undefined;
|
|
3670
|
+
|
|
3681
3671
|
declare class EventHistoryModule implements IEventHistoryModule {
|
|
3682
3672
|
private readonly store;
|
|
3683
3673
|
private readonly listener;
|
|
@@ -4492,4 +4482,4 @@ interface IRunHooksResult {
|
|
|
4492
4482
|
}
|
|
4493
4483
|
declare function runHooks(config: THooksConfig | undefined, event: THookEvent, input: IHookInput, executors?: IHookTypeExecutor[]): Promise<IRunHooksResult>;
|
|
4494
4484
|
|
|
4495
|
-
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CLAUDE_MODELS, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError,
|
|
4485
|
+
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CLAUDE_MODELS, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConversationHistory, ConversationStore, DEFAULT_ABSTRACT_EVENT_SERVICE, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT, DefaultEventService, EVENT_EMITTER_EVENTS, EXECUTION_EVENTS, EXECUTION_EVENT_PREFIX, ErrorUtils, EventEmitterPlugin, EventHistoryModule, ExecutionProxy, type IAIProvider, type IAIProviderInstance, type IAIProviderManager, type IAbstractTool, type IAbstractToolOptions, type IAgent, type IAgentConfig, type IAgentCreationOptions, type IAgentCreationStats, type IAgentEventData, type IAgentFactory, type IAgentFactoryOptions, type IAgentHookDefinition, type IAgentLifecycleEvents, type IAgentTemplate, type IAssistantMessage, type IAssistantUsageMetadata, type IBaseEventData, type IBaseMessage, type ICacheEntry, type ICacheKey, type ICacheOptions, type ICacheStats, type ICacheStorage, type IChatExecutionRequest, type IChatOptions, type ICommandHookDefinition, type IConfigValidationResult, type IContextOptions, type IContextTokenUsage, type IContextWindowState, type IConversationContext, type IConversationResponse, type IConversationService, type IConversationServiceOptions, type IEventContext, type IEventEmitterEventData, type IEventEmitterHierarchicalEventData, type IEventEmitterMetrics, type IEventEmitterMetricsSnapshot, type IEventEmitterPlugin, type IEventEmitterPluginOptions, type IEventHistoryModule, type IEventHistoryRecord, type IEventHistorySnapshot, type IEventObjectValue, type IEventService, type IEventServiceOwnerBinding, type IExecutionEventData, type IExecutionService, type IExecutionServiceOptions, type IExecutor, type IExecutorAwareProviderConfig, type IFunctionTool, type IHistoryEntry, type IHookDefinition, type IHookGroup, type IHookInput, type IHookResult, type IHookTypeExecutor, type IHttpHookDefinition, type IImageComposeRequest, type IImageEditRequest, type IImageGenerationProvider, type IImageGenerationRequest, type IImageGenerationResult, type IInlineImageInputSource, type IInlineImageMessagePart, type ILocalExecutorConfig, type ILogger, type IMCPToolConfig, type IMediaOutputRef, type IModelDefinition, type IOpenAPIToolConfig, type IOwnerPathSegment, type IParameterSchema, type IParameterValidationResult, type IPermissionLists, type IPlugin, type IPluginConfig, type IPluginContext, type IPluginContract, type IPluginData, type IPluginErrorContext, type IPluginExecutionContext, type IPluginExecutionResult, type IPluginHooks, type IPluginOptions, type IPluginStats, type IProgressReportingTool, type IPromptHookDefinition, type IProviderConfig$1 as IProviderConfig, type IProviderDefinition, type IProviderMediaError, type IProviderOptions, type IProviderProbeResult, type IProviderProfileConfig, type IProviderProfileDefaults, type IProviderRequest, type IProviderSetupStepDefinition, type IProviderSpecificOptions, type IRawProviderResponse, type IRemoteExecutorConfig, type IRunOptions, type ISimpleValidationResult, type IStreamExecutionRequest, type IStreamingChunk, type ISystemMessage, type ITemplateApplicationResult, type ITextMessagePart, type ITokenUsage, type ITool, type IToolCall, type IToolContract, type IToolEventData, type IToolExecutionContext, type IToolExecutionRequest, type IToolExecutionResult, type IToolExecutionService, type IToolExecutionStep, type IToolFactory, type IToolManager, type IToolMessage, type IToolRegistry, type IToolResult, type IToolSchema, type IToolWithEventService, type IUniversalObjectValue, type IUriImageInputSource, type IUriImageMessagePart, type IUserMessage, type IUtilLogEntry, type IValidationIssue, type IValidationOptions, type IValidationResult, type IVideoGenerationProvider, type IVideoGenerationRequest, type IVideoJobAccepted, type IVideoJobSnapshot, type IWorkflowConfig, type IWorkflowConversionOptions, type IWorkflowConversionResult, type IWorkflowConverter, type IWorkflowData, type IWorkflowMetadata, type IWorkflowValidator, InMemoryEventEmitterMetrics, LocalExecutor, MODE_POLICY, MessageConverter, ModelNotAvailableError, NetworkError, ObservableEventService, PluginCategory, PluginError, PluginPriority, ProviderError, RateLimitError, Robota, RobotaError, SilentLogger, StorageError, StructuredEventService, TASK_EVENTS, TASK_EVENT_PREFIX, type TAgentCreationMetadata, type TComplexConfigValue, type TConfigData, type TConfigValue, type TContextData, type TConversationContextMetadata, type TErrorContextData, type TErrorExternalInput, type TEventEmitterListener, type TEventExtensionValue, type TEventListener, type TEventLoggerData, type TEventName, type TEventUniversalValue, type TExecutionEventName, type TExecutionMetadata, type THookEvent, type THooksConfig, type TImageInputSource, type TJSONSchemaEnum, type TJSONSchemaKind, type TKnownToolName, type TLoggerData, type TManagerToolParameters, type TMessageConverterRegistry, type TMessageFormatConverter, type TMessageState, type TMetadata, type TMetadataValue, TOOL_EVENTS, TOOL_EVENT_PREFIX, type TParameterDefaultValue, type TPermissionDecision, type TPermissionMode, type TPrimitiveValue, type TProviderConfigValue, type TProviderLoggingData, type TProviderMediaResult, type TProviderMessage, type TProviderOptionValueBase, type TProviderSetupField, TRUST_TO_MODE, type TResponseMetadata, type TSessionEndReason, type TTextDeltaCallback, type TTimerId, type TToolArgs, type TToolExecutionFunction, type TToolExecutionParameters, type TToolExecutor, type TToolMetadata, type TToolParameters, type TToolProgressCallback, type TTrustLevel, type TUniversalArrayValue, type TUniversalMessage, type TUniversalMessageMetadata, type TUniversalMessagePart, type TUniversalMessageRole, type TUniversalValue, type TUserEvent, type TUtilLogLevel, ToolExecutionError, UNKNOWN_TOOL_FALLBACK, USER_EVENTS, USER_EVENT_PREFIX, ValidationError, ValidationSeverity, Validator, bindEventServiceOwner, bindWithOwnerPath, chatEntryToMessage, collectAssistantUsageMetadata, composeEventName, createAssistantMessage, createExecutionProxy, createLogger, createSystemMessage, createToolMessage, createUserMessage, evaluatePermission, findProviderDefinition, formatSupportedProviderTypes, formatTokenCount, getGlobalLogLevel, getMessagesForAPI, getModelContextWindow, getModelMaxOutput, getModelName, getToolEstimatedDuration, getToolExecutionSteps, isAssistantMessage, isChatEntry, isDefaultEventService, isImageGenerationProvider, isProgressReportingTool, isSystemMessage, isToolMessage, isUserMessage, isVideoGenerationProvider, logger, messageToHistoryEntry, runHooks, setGlobalLogLevel, setToolProgressCallback, startPeriodicTask, stopPeriodicTask, validateAgentConfig, validateApiKey, validateModelName, validateProviderName, validateUserInput, withEventEmission };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -202,16 +202,6 @@ interface IPluginContext {
|
|
|
202
202
|
error?: Error;
|
|
203
203
|
executionContext?: TContextData;
|
|
204
204
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Type utility functions for safe type checking and validation
|
|
207
|
-
* @internal
|
|
208
|
-
*/
|
|
209
|
-
declare const TypeUtils: {
|
|
210
|
-
isPrimitive: (value: TUniversalValue) => value is TPrimitiveValue;
|
|
211
|
-
isArray: (value: TUniversalValue) => value is TUniversalArrayValue;
|
|
212
|
-
isObject: (value: TUniversalValue) => value is IUniversalObjectValue;
|
|
213
|
-
isUniversalValue: (value: TUniversalValue) => value is TUniversalValue;
|
|
214
|
-
};
|
|
215
205
|
|
|
216
206
|
/**
|
|
217
207
|
* Reusable type definitions for provider layer
|
|
@@ -928,24 +918,6 @@ interface ILogger {
|
|
|
928
918
|
* - Inject a real logger explicitly if you want output.
|
|
929
919
|
*/
|
|
930
920
|
declare const SilentLogger: ILogger;
|
|
931
|
-
/**
|
|
932
|
-
* Console logger implementation
|
|
933
|
-
* @internal
|
|
934
|
-
*/
|
|
935
|
-
declare class ConsoleLogger implements ILogger {
|
|
936
|
-
private level?;
|
|
937
|
-
private packageName;
|
|
938
|
-
private sinkLogger;
|
|
939
|
-
constructor(packageName: string, logger?: ILogger);
|
|
940
|
-
debug(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
941
|
-
info(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
942
|
-
warn(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
943
|
-
error(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
944
|
-
log(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
945
|
-
private getLevel;
|
|
946
|
-
private shouldLog;
|
|
947
|
-
private forward;
|
|
948
|
-
}
|
|
949
921
|
/**
|
|
950
922
|
* Create a named logger instance for a package or module.
|
|
951
923
|
* Use this to create loggers with a specific name prefix for easy log filtering.
|
|
@@ -1595,6 +1567,7 @@ interface IAgentConfig {
|
|
|
1595
1567
|
responseFormat?: IResponseFormatConfig;
|
|
1596
1568
|
safetySettings?: ISafetySetting[];
|
|
1597
1569
|
timeout?: number;
|
|
1570
|
+
maxExecutionRounds?: number;
|
|
1598
1571
|
retryAttempts?: number;
|
|
1599
1572
|
rateLimiting?: {
|
|
1600
1573
|
enabled?: boolean;
|
|
@@ -1635,7 +1608,16 @@ interface IRunOptions {
|
|
|
1635
1608
|
signal?: AbortSignal;
|
|
1636
1609
|
/** Per-run streaming text callback. Prefer this over mutating provider callback state. */
|
|
1637
1610
|
onTextDelta?: TTextDeltaCallback;
|
|
1611
|
+
/** Per-run replay event callback for provider/tool execution boundaries. */
|
|
1612
|
+
onExecutionEvent?: TExecutionEventCallback;
|
|
1613
|
+
/**
|
|
1614
|
+
* Maximum model/tool rounds for this run.
|
|
1615
|
+
* Use 0 for no core round cap.
|
|
1616
|
+
*/
|
|
1617
|
+
maxExecutionRounds?: number;
|
|
1638
1618
|
}
|
|
1619
|
+
type TExecutionEventData = Record<string, unknown>;
|
|
1620
|
+
type TExecutionEventCallback = (event: string, data: TExecutionEventData) => void;
|
|
1639
1621
|
/**
|
|
1640
1622
|
* Generic agent interface with type parameters for enhanced type safety
|
|
1641
1623
|
*
|
|
@@ -1687,12 +1669,14 @@ interface IProviderConfig$1 {
|
|
|
1687
1669
|
apiKey?: string;
|
|
1688
1670
|
baseURL?: string;
|
|
1689
1671
|
timeout?: number;
|
|
1672
|
+
options?: Record<string, TUniversalValue>;
|
|
1690
1673
|
}
|
|
1691
1674
|
interface IProviderProfileDefaults {
|
|
1692
1675
|
model?: string;
|
|
1693
1676
|
apiKey?: string;
|
|
1694
1677
|
baseURL?: string;
|
|
1695
1678
|
timeout?: number;
|
|
1679
|
+
options?: Record<string, TUniversalValue>;
|
|
1696
1680
|
}
|
|
1697
1681
|
interface IProviderProfileConfig {
|
|
1698
1682
|
type?: string;
|
|
@@ -1700,6 +1684,7 @@ interface IProviderProfileConfig {
|
|
|
1700
1684
|
apiKey?: string;
|
|
1701
1685
|
baseURL?: string;
|
|
1702
1686
|
timeout?: number;
|
|
1687
|
+
options?: Record<string, TUniversalValue>;
|
|
1703
1688
|
}
|
|
1704
1689
|
interface IProviderProbeResult {
|
|
1705
1690
|
ok: boolean;
|
|
@@ -1716,6 +1701,9 @@ interface IProviderSetupStepDefinition {
|
|
|
1716
1701
|
}
|
|
1717
1702
|
interface IProviderDefinition {
|
|
1718
1703
|
type: string;
|
|
1704
|
+
aliases?: readonly string[];
|
|
1705
|
+
displayName?: string;
|
|
1706
|
+
description?: string;
|
|
1719
1707
|
defaults?: IProviderProfileDefaults;
|
|
1720
1708
|
setupSteps?: readonly IProviderSetupStepDefinition[];
|
|
1721
1709
|
requiresApiKey?: boolean;
|
|
@@ -3078,7 +3066,6 @@ interface IProviderApiMessage {
|
|
|
3078
3066
|
*/
|
|
3079
3067
|
declare class ConversationStore implements IConversationHistory {
|
|
3080
3068
|
private history;
|
|
3081
|
-
private toolCallIds;
|
|
3082
3069
|
private pendingAssistant;
|
|
3083
3070
|
constructor(maxMessages?: number);
|
|
3084
3071
|
addMessage(message: TUniversalMessage): void;
|
|
@@ -3154,8 +3141,6 @@ declare class ConversationHistory {
|
|
|
3154
3141
|
conversationIds: string[];
|
|
3155
3142
|
totalMessages: number;
|
|
3156
3143
|
};
|
|
3157
|
-
/** @internal */
|
|
3158
|
-
private cleanupOldConversations;
|
|
3159
3144
|
}
|
|
3160
3145
|
|
|
3161
3146
|
/**
|
|
@@ -3348,12 +3333,6 @@ declare class EventEmitterPlugin extends AbstractPlugin<IEventEmitterPluginOptio
|
|
|
3348
3333
|
destroy(): Promise<void>;
|
|
3349
3334
|
}
|
|
3350
3335
|
|
|
3351
|
-
/**
|
|
3352
|
-
* Configuration and tool management delegate for the Robota agent.
|
|
3353
|
-
*
|
|
3354
|
-
* Extracted from robota.ts to keep the main class under 300 lines.
|
|
3355
|
-
*/
|
|
3356
|
-
|
|
3357
3336
|
/** Agent statistics metadata type */
|
|
3358
3337
|
type TAgentStatsMetadata = Record<string, string | number | boolean | Date | string[]>;
|
|
3359
3338
|
|
|
@@ -3678,6 +3657,17 @@ declare class AgentFactory {
|
|
|
3678
3657
|
};
|
|
3679
3658
|
}
|
|
3680
3659
|
|
|
3660
|
+
interface IAssistantUsageMetadata {
|
|
3661
|
+
inputTokens: number;
|
|
3662
|
+
outputTokens: number;
|
|
3663
|
+
usage: {
|
|
3664
|
+
totalTokens: number;
|
|
3665
|
+
inputTokens: number;
|
|
3666
|
+
outputTokens: number;
|
|
3667
|
+
};
|
|
3668
|
+
}
|
|
3669
|
+
declare function collectAssistantUsageMetadata(message: TUniversalMessage): IAssistantUsageMetadata | undefined;
|
|
3670
|
+
|
|
3681
3671
|
declare class EventHistoryModule implements IEventHistoryModule {
|
|
3682
3672
|
private readonly store;
|
|
3683
3673
|
private readonly listener;
|
|
@@ -4492,4 +4482,4 @@ interface IRunHooksResult {
|
|
|
4492
4482
|
}
|
|
4493
4483
|
declare function runHooks(config: THooksConfig | undefined, event: THookEvent, input: IHookInput, executors?: IHookTypeExecutor[]): Promise<IRunHooksResult>;
|
|
4494
4484
|
|
|
4495
|
-
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CLAUDE_MODELS, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError,
|
|
4485
|
+
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CLAUDE_MODELS, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConversationHistory, ConversationStore, DEFAULT_ABSTRACT_EVENT_SERVICE, DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_OUTPUT, DefaultEventService, EVENT_EMITTER_EVENTS, EXECUTION_EVENTS, EXECUTION_EVENT_PREFIX, ErrorUtils, EventEmitterPlugin, EventHistoryModule, ExecutionProxy, type IAIProvider, type IAIProviderInstance, type IAIProviderManager, type IAbstractTool, type IAbstractToolOptions, type IAgent, type IAgentConfig, type IAgentCreationOptions, type IAgentCreationStats, type IAgentEventData, type IAgentFactory, type IAgentFactoryOptions, type IAgentHookDefinition, type IAgentLifecycleEvents, type IAgentTemplate, type IAssistantMessage, type IAssistantUsageMetadata, type IBaseEventData, type IBaseMessage, type ICacheEntry, type ICacheKey, type ICacheOptions, type ICacheStats, type ICacheStorage, type IChatExecutionRequest, type IChatOptions, type ICommandHookDefinition, type IConfigValidationResult, type IContextOptions, type IContextTokenUsage, type IContextWindowState, type IConversationContext, type IConversationResponse, type IConversationService, type IConversationServiceOptions, type IEventContext, type IEventEmitterEventData, type IEventEmitterHierarchicalEventData, type IEventEmitterMetrics, type IEventEmitterMetricsSnapshot, type IEventEmitterPlugin, type IEventEmitterPluginOptions, type IEventHistoryModule, type IEventHistoryRecord, type IEventHistorySnapshot, type IEventObjectValue, type IEventService, type IEventServiceOwnerBinding, type IExecutionEventData, type IExecutionService, type IExecutionServiceOptions, type IExecutor, type IExecutorAwareProviderConfig, type IFunctionTool, type IHistoryEntry, type IHookDefinition, type IHookGroup, type IHookInput, type IHookResult, type IHookTypeExecutor, type IHttpHookDefinition, type IImageComposeRequest, type IImageEditRequest, type IImageGenerationProvider, type IImageGenerationRequest, type IImageGenerationResult, type IInlineImageInputSource, type IInlineImageMessagePart, type ILocalExecutorConfig, type ILogger, type IMCPToolConfig, type IMediaOutputRef, type IModelDefinition, type IOpenAPIToolConfig, type IOwnerPathSegment, type IParameterSchema, type IParameterValidationResult, type IPermissionLists, type IPlugin, type IPluginConfig, type IPluginContext, type IPluginContract, type IPluginData, type IPluginErrorContext, type IPluginExecutionContext, type IPluginExecutionResult, type IPluginHooks, type IPluginOptions, type IPluginStats, type IProgressReportingTool, type IPromptHookDefinition, type IProviderConfig$1 as IProviderConfig, type IProviderDefinition, type IProviderMediaError, type IProviderOptions, type IProviderProbeResult, type IProviderProfileConfig, type IProviderProfileDefaults, type IProviderRequest, type IProviderSetupStepDefinition, type IProviderSpecificOptions, type IRawProviderResponse, type IRemoteExecutorConfig, type IRunOptions, type ISimpleValidationResult, type IStreamExecutionRequest, type IStreamingChunk, type ISystemMessage, type ITemplateApplicationResult, type ITextMessagePart, type ITokenUsage, type ITool, type IToolCall, type IToolContract, type IToolEventData, type IToolExecutionContext, type IToolExecutionRequest, type IToolExecutionResult, type IToolExecutionService, type IToolExecutionStep, type IToolFactory, type IToolManager, type IToolMessage, type IToolRegistry, type IToolResult, type IToolSchema, type IToolWithEventService, type IUniversalObjectValue, type IUriImageInputSource, type IUriImageMessagePart, type IUserMessage, type IUtilLogEntry, type IValidationIssue, type IValidationOptions, type IValidationResult, type IVideoGenerationProvider, type IVideoGenerationRequest, type IVideoJobAccepted, type IVideoJobSnapshot, type IWorkflowConfig, type IWorkflowConversionOptions, type IWorkflowConversionResult, type IWorkflowConverter, type IWorkflowData, type IWorkflowMetadata, type IWorkflowValidator, InMemoryEventEmitterMetrics, LocalExecutor, MODE_POLICY, MessageConverter, ModelNotAvailableError, NetworkError, ObservableEventService, PluginCategory, PluginError, PluginPriority, ProviderError, RateLimitError, Robota, RobotaError, SilentLogger, StorageError, StructuredEventService, TASK_EVENTS, TASK_EVENT_PREFIX, type TAgentCreationMetadata, type TComplexConfigValue, type TConfigData, type TConfigValue, type TContextData, type TConversationContextMetadata, type TErrorContextData, type TErrorExternalInput, type TEventEmitterListener, type TEventExtensionValue, type TEventListener, type TEventLoggerData, type TEventName, type TEventUniversalValue, type TExecutionEventName, type TExecutionMetadata, type THookEvent, type THooksConfig, type TImageInputSource, type TJSONSchemaEnum, type TJSONSchemaKind, type TKnownToolName, type TLoggerData, type TManagerToolParameters, type TMessageConverterRegistry, type TMessageFormatConverter, type TMessageState, type TMetadata, type TMetadataValue, TOOL_EVENTS, TOOL_EVENT_PREFIX, type TParameterDefaultValue, type TPermissionDecision, type TPermissionMode, type TPrimitiveValue, type TProviderConfigValue, type TProviderLoggingData, type TProviderMediaResult, type TProviderMessage, type TProviderOptionValueBase, type TProviderSetupField, TRUST_TO_MODE, type TResponseMetadata, type TSessionEndReason, type TTextDeltaCallback, type TTimerId, type TToolArgs, type TToolExecutionFunction, type TToolExecutionParameters, type TToolExecutor, type TToolMetadata, type TToolParameters, type TToolProgressCallback, type TTrustLevel, type TUniversalArrayValue, type TUniversalMessage, type TUniversalMessageMetadata, type TUniversalMessagePart, type TUniversalMessageRole, type TUniversalValue, type TUserEvent, type TUtilLogLevel, ToolExecutionError, UNKNOWN_TOOL_FALLBACK, USER_EVENTS, USER_EVENT_PREFIX, ValidationError, ValidationSeverity, Validator, bindEventServiceOwner, bindWithOwnerPath, chatEntryToMessage, collectAssistantUsageMetadata, composeEventName, createAssistantMessage, createExecutionProxy, createLogger, createSystemMessage, createToolMessage, createUserMessage, evaluatePermission, findProviderDefinition, formatSupportedProviderTypes, formatTokenCount, getGlobalLogLevel, getMessagesForAPI, getModelContextWindow, getModelMaxOutput, getModelName, getToolEstimatedDuration, getToolExecutionSteps, isAssistantMessage, isChatEntry, isDefaultEventService, isImageGenerationProvider, isProgressReportingTool, isSystemMessage, isToolMessage, isUserMessage, isVideoGenerationProvider, logger, messageToHistoryEntry, runHooks, setGlobalLogLevel, setToolProgressCallback, startPeriodicTask, stopPeriodicTask, validateAgentConfig, validateApiKey, validateModelName, validateProviderName, validateUserInput, withEventEmission };
|