@robota-sdk/agent-core 3.0.0-beta.6 → 3.0.0-beta.61
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 +89 -0
- package/README.md +40 -11
- package/dist/browser/index.d.ts +722 -324
- package/dist/browser/index.js +10 -4
- package/dist/node/index.cjs +10 -4
- package/dist/node/index.d.cts +722 -324
- package/dist/node/index.d.ts +722 -324
- package/dist/node/index.js +10 -4
- package/package.json +6 -3
- package/dist/abstracts/abstract-agent.d.ts +0 -56
- package/dist/abstracts/abstract-agent.d.ts.map +0 -1
- package/dist/abstracts/abstract-agent.js +0 -55
- package/dist/abstracts/abstract-agent.js.map +0 -1
- package/dist/abstracts/abstract-ai-provider.d.ts +0 -187
- package/dist/abstracts/abstract-ai-provider.d.ts.map +0 -1
- package/dist/abstracts/abstract-ai-provider.js +0 -252
- package/dist/abstracts/abstract-ai-provider.js.map +0 -1
- package/dist/abstracts/abstract-executor.d.ts +0 -110
- package/dist/abstracts/abstract-executor.d.ts.map +0 -1
- package/dist/abstracts/abstract-executor.js +0 -156
- package/dist/abstracts/abstract-executor.js.map +0 -1
- package/dist/abstracts/abstract-manager.d.ts +0 -42
- package/dist/abstracts/abstract-manager.d.ts.map +0 -1
- package/dist/abstracts/abstract-manager.js +0 -49
- package/dist/abstracts/abstract-manager.js.map +0 -1
- package/dist/abstracts/abstract-module.d.ts +0 -365
- package/dist/abstracts/abstract-module.d.ts.map +0 -1
- package/dist/abstracts/abstract-module.js +0 -474
- package/dist/abstracts/abstract-module.js.map +0 -1
- package/dist/abstracts/abstract-plugin.d.ts +0 -369
- package/dist/abstracts/abstract-plugin.d.ts.map +0 -1
- package/dist/abstracts/abstract-plugin.js +0 -258
- package/dist/abstracts/abstract-plugin.js.map +0 -1
- package/dist/abstracts/abstract-tool.d.ts +0 -175
- package/dist/abstracts/abstract-tool.d.ts.map +0 -1
- package/dist/abstracts/abstract-tool.js +0 -140
- package/dist/abstracts/abstract-tool.js.map +0 -1
- package/dist/abstracts/abstract-workflow-converter.d.ts +0 -136
- package/dist/abstracts/abstract-workflow-converter.d.ts.map +0 -1
- package/dist/abstracts/abstract-workflow-converter.js +0 -252
- package/dist/abstracts/abstract-workflow-converter.js.map +0 -1
- package/dist/abstracts/abstract-workflow-validator.d.ts +0 -203
- package/dist/abstracts/abstract-workflow-validator.d.ts.map +0 -1
- package/dist/abstracts/abstract-workflow-validator.js +0 -447
- package/dist/abstracts/abstract-workflow-validator.js.map +0 -1
- package/dist/abstracts/index.d.ts +0 -6
- package/dist/abstracts/index.d.ts.map +0 -1
- package/dist/abstracts/index.js +0 -9
- package/dist/abstracts/index.js.map +0 -1
- package/dist/agents/constants.d.ts +0 -23
- package/dist/agents/constants.d.ts.map +0 -1
- package/dist/agents/constants.js +0 -22
- package/dist/agents/constants.js.map +0 -1
- package/dist/agents/index.d.ts +0 -1
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js +0 -4
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/robota.test.d.ts +0 -2
- package/dist/agents/robota.test.d.ts.map +0 -1
- package/dist/agents/robota.test.js +0 -416
- package/dist/agents/robota.test.js.map +0 -1
- package/dist/core/robota.d.ts +0 -694
- package/dist/core/robota.d.ts.map +0 -1
- package/dist/core/robota.js +0 -1277
- package/dist/core/robota.js.map +0 -1
- package/dist/executors/local-executor.d.ts +0 -96
- package/dist/executors/local-executor.d.ts.map +0 -1
- package/dist/executors/local-executor.js +0 -197
- package/dist/executors/local-executor.js.map +0 -1
- package/dist/executors/local-executor.test.d.ts +0 -2
- package/dist/executors/local-executor.test.d.ts.map +0 -1
- package/dist/executors/local-executor.test.js +0 -192
- package/dist/executors/local-executor.test.js.map +0 -1
- package/dist/index.d.ts +0 -274
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -235
- package/dist/index.js.map +0 -1
- package/dist/interfaces/agent.d.ts +0 -198
- package/dist/interfaces/agent.d.ts.map +0 -1
- package/dist/interfaces/agent.js +0 -2
- package/dist/interfaces/agent.js.map +0 -1
- package/dist/interfaces/event-service.d.ts +0 -79
- package/dist/interfaces/event-service.d.ts.map +0 -1
- package/dist/interfaces/event-service.js +0 -2
- package/dist/interfaces/event-service.js.map +0 -1
- package/dist/interfaces/executor.d.ts +0 -128
- package/dist/interfaces/executor.d.ts.map +0 -1
- package/dist/interfaces/executor.js +0 -2
- package/dist/interfaces/executor.js.map +0 -1
- package/dist/interfaces/history-module.d.ts +0 -19
- package/dist/interfaces/history-module.d.ts.map +0 -1
- package/dist/interfaces/history-module.js +0 -2
- package/dist/interfaces/history-module.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -13
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -4
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/manager.d.ts +0 -142
- package/dist/interfaces/manager.d.ts.map +0 -1
- package/dist/interfaces/manager.js +0 -2
- package/dist/interfaces/manager.js.map +0 -1
- package/dist/interfaces/messages.d.ts +0 -75
- package/dist/interfaces/messages.d.ts.map +0 -1
- package/dist/interfaces/messages.js +0 -29
- package/dist/interfaces/messages.js.map +0 -1
- package/dist/interfaces/progress-reporting.d.ts +0 -86
- package/dist/interfaces/progress-reporting.d.ts.map +0 -1
- package/dist/interfaces/progress-reporting.js +0 -37
- package/dist/interfaces/progress-reporting.js.map +0 -1
- package/dist/interfaces/provider.d.ts +0 -217
- package/dist/interfaces/provider.d.ts.map +0 -1
- package/dist/interfaces/provider.js +0 -2
- package/dist/interfaces/provider.js.map +0 -1
- package/dist/interfaces/service.d.ts +0 -205
- package/dist/interfaces/service.d.ts.map +0 -1
- package/dist/interfaces/service.js +0 -6
- package/dist/interfaces/service.js.map +0 -1
- package/dist/interfaces/tool.d.ts +0 -248
- package/dist/interfaces/tool.d.ts.map +0 -1
- package/dist/interfaces/tool.js +0 -2
- package/dist/interfaces/tool.js.map +0 -1
- package/dist/interfaces/types.d.ts +0 -71
- package/dist/interfaces/types.d.ts.map +0 -1
- package/dist/interfaces/types.js +0 -33
- package/dist/interfaces/types.js.map +0 -1
- package/dist/interfaces/workflow-converter.d.ts +0 -193
- package/dist/interfaces/workflow-converter.d.ts.map +0 -1
- package/dist/interfaces/workflow-converter.js +0 -11
- package/dist/interfaces/workflow-converter.js.map +0 -1
- package/dist/interfaces/workflow-validator.d.ts +0 -209
- package/dist/interfaces/workflow-validator.d.ts.map +0 -1
- package/dist/interfaces/workflow-validator.js +0 -16
- package/dist/interfaces/workflow-validator.js.map +0 -1
- package/dist/managers/agent-factory.d.ts +0 -132
- package/dist/managers/agent-factory.d.ts.map +0 -1
- package/dist/managers/agent-factory.js +0 -284
- package/dist/managers/agent-factory.js.map +0 -1
- package/dist/managers/agent-factory.test.d.ts +0 -2
- package/dist/managers/agent-factory.test.d.ts.map +0 -1
- package/dist/managers/agent-factory.test.js +0 -249
- package/dist/managers/agent-factory.test.js.map +0 -1
- package/dist/managers/agent-templates.d.ts +0 -84
- package/dist/managers/agent-templates.d.ts.map +0 -1
- package/dist/managers/agent-templates.js +0 -159
- package/dist/managers/agent-templates.js.map +0 -1
- package/dist/managers/ai-provider-manager.d.ts +0 -80
- package/dist/managers/ai-provider-manager.d.ts.map +0 -1
- package/dist/managers/ai-provider-manager.js +0 -226
- package/dist/managers/ai-provider-manager.js.map +0 -1
- package/dist/managers/conversation-history-manager.d.ts +0 -455
- package/dist/managers/conversation-history-manager.d.ts.map +0 -1
- package/dist/managers/conversation-history-manager.js +0 -578
- package/dist/managers/conversation-history-manager.js.map +0 -1
- package/dist/managers/conversation-history-manager.test.d.ts +0 -2
- package/dist/managers/conversation-history-manager.test.d.ts.map +0 -1
- package/dist/managers/conversation-history-manager.test.js +0 -374
- package/dist/managers/conversation-history-manager.test.js.map +0 -1
- package/dist/managers/index.d.ts +0 -8
- package/dist/managers/index.d.ts.map +0 -1
- package/dist/managers/index.js +0 -8
- package/dist/managers/index.js.map +0 -1
- package/dist/managers/module-registry.d.ts +0 -161
- package/dist/managers/module-registry.d.ts.map +0 -1
- package/dist/managers/module-registry.js +0 -519
- package/dist/managers/module-registry.js.map +0 -1
- package/dist/managers/module-type-registry.d.ts +0 -113
- package/dist/managers/module-type-registry.d.ts.map +0 -1
- package/dist/managers/module-type-registry.js +0 -439
- package/dist/managers/module-type-registry.js.map +0 -1
- package/dist/managers/plugins.d.ts +0 -166
- package/dist/managers/plugins.d.ts.map +0 -1
- package/dist/managers/plugins.js +0 -339
- package/dist/managers/plugins.js.map +0 -1
- package/dist/managers/tool-manager.d.ts +0 -70
- package/dist/managers/tool-manager.d.ts.map +0 -1
- package/dist/managers/tool-manager.js +0 -138
- package/dist/managers/tool-manager.js.map +0 -1
- package/dist/managers/tool-manager.test.d.ts +0 -2
- package/dist/managers/tool-manager.test.d.ts.map +0 -1
- package/dist/managers/tool-manager.test.js +0 -186
- package/dist/managers/tool-manager.test.js.map +0 -1
- package/dist/plugins/conversation-history/conversation-history-plugin.d.ts +0 -67
- package/dist/plugins/conversation-history/conversation-history-plugin.d.ts.map +0 -1
- package/dist/plugins/conversation-history/conversation-history-plugin.js +0 -270
- package/dist/plugins/conversation-history/conversation-history-plugin.js.map +0 -1
- package/dist/plugins/conversation-history/index.d.ts +0 -3
- package/dist/plugins/conversation-history/index.d.ts.map +0 -1
- package/dist/plugins/conversation-history/index.js +0 -2
- package/dist/plugins/conversation-history/index.js.map +0 -1
- package/dist/plugins/conversation-history/storages/database-storage.d.ts +0 -19
- package/dist/plugins/conversation-history/storages/database-storage.d.ts.map +0 -1
- package/dist/plugins/conversation-history/storages/database-storage.js +0 -94
- package/dist/plugins/conversation-history/storages/database-storage.js.map +0 -1
- package/dist/plugins/conversation-history/storages/file-storage.d.ts +0 -15
- package/dist/plugins/conversation-history/storages/file-storage.d.ts.map +0 -1
- package/dist/plugins/conversation-history/storages/file-storage.js +0 -94
- package/dist/plugins/conversation-history/storages/file-storage.js.map +0 -1
- package/dist/plugins/conversation-history/storages/index.d.ts +0 -4
- package/dist/plugins/conversation-history/storages/index.d.ts.map +0 -1
- package/dist/plugins/conversation-history/storages/index.js +0 -4
- package/dist/plugins/conversation-history/storages/index.js.map +0 -1
- package/dist/plugins/conversation-history/storages/memory-storage.d.ts +0 -15
- package/dist/plugins/conversation-history/storages/memory-storage.d.ts.map +0 -1
- package/dist/plugins/conversation-history/storages/memory-storage.js +0 -33
- package/dist/plugins/conversation-history/storages/memory-storage.js.map +0 -1
- package/dist/plugins/conversation-history/types.d.ts +0 -61
- package/dist/plugins/conversation-history/types.d.ts.map +0 -1
- package/dist/plugins/conversation-history/types.js +0 -2
- package/dist/plugins/conversation-history/types.js.map +0 -1
- package/dist/plugins/error-handling/context-adapter.d.ts +0 -30
- package/dist/plugins/error-handling/context-adapter.d.ts.map +0 -1
- package/dist/plugins/error-handling/context-adapter.js +0 -41
- package/dist/plugins/error-handling/context-adapter.js.map +0 -1
- package/dist/plugins/error-handling/error-handling-plugin.d.ts +0 -49
- package/dist/plugins/error-handling/error-handling-plugin.d.ts.map +0 -1
- package/dist/plugins/error-handling/error-handling-plugin.js +0 -229
- package/dist/plugins/error-handling/error-handling-plugin.js.map +0 -1
- package/dist/plugins/error-handling/index.d.ts +0 -10
- package/dist/plugins/error-handling/index.d.ts.map +0 -1
- package/dist/plugins/error-handling/index.js +0 -10
- package/dist/plugins/error-handling/index.js.map +0 -1
- package/dist/plugins/error-handling/types.d.ts +0 -73
- package/dist/plugins/error-handling/types.d.ts.map +0 -1
- package/dist/plugins/error-handling/types.js +0 -14
- package/dist/plugins/error-handling/types.js.map +0 -1
- package/dist/plugins/event-emitter/metrics.d.ts +0 -17
- package/dist/plugins/event-emitter/metrics.d.ts.map +0 -1
- package/dist/plugins/event-emitter/metrics.js +0 -17
- package/dist/plugins/event-emitter/metrics.js.map +0 -1
- package/dist/plugins/event-emitter/types.d.ts +0 -112
- package/dist/plugins/event-emitter/types.d.ts.map +0 -1
- package/dist/plugins/event-emitter/types.js +0 -65
- package/dist/plugins/event-emitter/types.js.map +0 -1
- package/dist/plugins/event-emitter-plugin.d.ts +0 -222
- package/dist/plugins/event-emitter-plugin.d.ts.map +0 -1
- package/dist/plugins/event-emitter-plugin.js +0 -432
- package/dist/plugins/event-emitter-plugin.js.map +0 -1
- package/dist/plugins/event-emitter-plugin.test.d.ts +0 -2
- package/dist/plugins/event-emitter-plugin.test.d.ts.map +0 -1
- package/dist/plugins/event-emitter-plugin.test.js +0 -94
- package/dist/plugins/event-emitter-plugin.test.js.map +0 -1
- package/dist/plugins/execution/execution-analytics-plugin.d.ts +0 -129
- package/dist/plugins/execution/execution-analytics-plugin.d.ts.map +0 -1
- package/dist/plugins/execution/execution-analytics-plugin.js +0 -517
- package/dist/plugins/execution/execution-analytics-plugin.js.map +0 -1
- package/dist/plugins/execution/index.d.ts +0 -3
- package/dist/plugins/execution/index.d.ts.map +0 -1
- package/dist/plugins/execution/index.js +0 -2
- package/dist/plugins/execution/index.js.map +0 -1
- package/dist/plugins/execution/types.d.ts +0 -90
- package/dist/plugins/execution/types.d.ts.map +0 -1
- package/dist/plugins/execution/types.js +0 -2
- package/dist/plugins/execution/types.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -10
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -11
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/limits/types.d.ts +0 -61
- package/dist/plugins/limits/types.d.ts.map +0 -1
- package/dist/plugins/limits/types.js +0 -2
- package/dist/plugins/limits/types.js.map +0 -1
- package/dist/plugins/limits-plugin.d.ts +0 -113
- package/dist/plugins/limits-plugin.d.ts.map +0 -1
- package/dist/plugins/limits-plugin.js +0 -380
- package/dist/plugins/limits-plugin.js.map +0 -1
- package/dist/plugins/logging/formatters.d.ts +0 -14
- package/dist/plugins/logging/formatters.d.ts.map +0 -1
- package/dist/plugins/logging/formatters.js +0 -24
- package/dist/plugins/logging/formatters.js.map +0 -1
- package/dist/plugins/logging/index.d.ts +0 -3
- package/dist/plugins/logging/index.d.ts.map +0 -1
- package/dist/plugins/logging/index.js +0 -2
- package/dist/plugins/logging/index.js.map +0 -1
- package/dist/plugins/logging/logging-plugin.d.ts +0 -91
- package/dist/plugins/logging/logging-plugin.d.ts.map +0 -1
- package/dist/plugins/logging/logging-plugin.js +0 -335
- package/dist/plugins/logging/logging-plugin.js.map +0 -1
- package/dist/plugins/logging/storages/console-storage.d.ts +0 -14
- package/dist/plugins/logging/storages/console-storage.d.ts.map +0 -1
- package/dist/plugins/logging/storages/console-storage.js +0 -38
- package/dist/plugins/logging/storages/console-storage.js.map +0 -1
- package/dist/plugins/logging/storages/file-storage.d.ts +0 -14
- package/dist/plugins/logging/storages/file-storage.d.ts.map +0 -1
- package/dist/plugins/logging/storages/file-storage.js +0 -41
- package/dist/plugins/logging/storages/file-storage.js.map +0 -1
- package/dist/plugins/logging/storages/index.d.ts +0 -5
- package/dist/plugins/logging/storages/index.d.ts.map +0 -1
- package/dist/plugins/logging/storages/index.js +0 -5
- package/dist/plugins/logging/storages/index.js.map +0 -1
- package/dist/plugins/logging/storages/remote-storage.d.ts +0 -20
- package/dist/plugins/logging/storages/remote-storage.d.ts.map +0 -1
- package/dist/plugins/logging/storages/remote-storage.js +0 -61
- package/dist/plugins/logging/storages/remote-storage.js.map +0 -1
- package/dist/plugins/logging/storages/silent-storage.d.ts +0 -10
- package/dist/plugins/logging/storages/silent-storage.d.ts.map +0 -1
- package/dist/plugins/logging/storages/silent-storage.js +0 -15
- package/dist/plugins/logging/storages/silent-storage.js.map +0 -1
- package/dist/plugins/logging/types.d.ts +0 -84
- package/dist/plugins/logging/types.d.ts.map +0 -1
- package/dist/plugins/logging/types.js +0 -2
- package/dist/plugins/logging/types.js.map +0 -1
- package/dist/plugins/performance/collectors/system-metrics-collector.d.ts +0 -12
- package/dist/plugins/performance/collectors/system-metrics-collector.d.ts.map +0 -1
- package/dist/plugins/performance/collectors/system-metrics-collector.js +0 -65
- package/dist/plugins/performance/collectors/system-metrics-collector.js.map +0 -1
- package/dist/plugins/performance/index.d.ts +0 -5
- package/dist/plugins/performance/index.d.ts.map +0 -1
- package/dist/plugins/performance/index.js +0 -4
- package/dist/plugins/performance/index.js.map +0 -1
- package/dist/plugins/performance/performance-plugin.d.ts +0 -49
- package/dist/plugins/performance/performance-plugin.d.ts.map +0 -1
- package/dist/plugins/performance/performance-plugin.js +0 -293
- package/dist/plugins/performance/performance-plugin.js.map +0 -1
- package/dist/plugins/performance/storages/index.d.ts +0 -2
- package/dist/plugins/performance/storages/index.d.ts.map +0 -1
- package/dist/plugins/performance/storages/index.js +0 -4
- package/dist/plugins/performance/storages/index.js.map +0 -1
- package/dist/plugins/performance/storages/memory-storage.d.ts +0 -19
- package/dist/plugins/performance/storages/memory-storage.d.ts.map +0 -1
- package/dist/plugins/performance/storages/memory-storage.js +0 -69
- package/dist/plugins/performance/storages/memory-storage.js.map +0 -1
- package/dist/plugins/performance/types.d.ts +0 -154
- package/dist/plugins/performance/types.d.ts.map +0 -1
- package/dist/plugins/performance/types.js +0 -2
- package/dist/plugins/performance/types.js.map +0 -1
- package/dist/plugins/usage/aggregate-usage-stats.d.ts +0 -12
- package/dist/plugins/usage/aggregate-usage-stats.d.ts.map +0 -1
- package/dist/plugins/usage/aggregate-usage-stats.js +0 -115
- package/dist/plugins/usage/aggregate-usage-stats.js.map +0 -1
- package/dist/plugins/usage/index.d.ts +0 -5
- package/dist/plugins/usage/index.d.ts.map +0 -1
- package/dist/plugins/usage/index.js +0 -4
- package/dist/plugins/usage/index.js.map +0 -1
- package/dist/plugins/usage/storages/file-storage.d.ts +0 -22
- package/dist/plugins/usage/storages/file-storage.d.ts.map +0 -1
- package/dist/plugins/usage/storages/file-storage.js +0 -111
- package/dist/plugins/usage/storages/file-storage.js.map +0 -1
- package/dist/plugins/usage/storages/index.d.ts +0 -5
- package/dist/plugins/usage/storages/index.d.ts.map +0 -1
- package/dist/plugins/usage/storages/index.js +0 -5
- package/dist/plugins/usage/storages/index.js.map +0 -1
- package/dist/plugins/usage/storages/memory-storage.d.ts +0 -22
- package/dist/plugins/usage/storages/memory-storage.d.ts.map +0 -1
- package/dist/plugins/usage/storages/memory-storage.js +0 -42
- package/dist/plugins/usage/storages/memory-storage.js.map +0 -1
- package/dist/plugins/usage/storages/remote-storage.d.ts +0 -26
- package/dist/plugins/usage/storages/remote-storage.d.ts.map +0 -1
- package/dist/plugins/usage/storages/remote-storage.js +0 -115
- package/dist/plugins/usage/storages/remote-storage.js.map +0 -1
- package/dist/plugins/usage/storages/silent-storage.d.ts +0 -19
- package/dist/plugins/usage/storages/silent-storage.d.ts.map +0 -1
- package/dist/plugins/usage/storages/silent-storage.js +0 -26
- package/dist/plugins/usage/storages/silent-storage.js.map +0 -1
- package/dist/plugins/usage/types.d.ts +0 -127
- package/dist/plugins/usage/types.d.ts.map +0 -1
- package/dist/plugins/usage/types.js +0 -2
- package/dist/plugins/usage/types.js.map +0 -1
- package/dist/plugins/usage/usage-plugin.d.ts +0 -67
- package/dist/plugins/usage/usage-plugin.d.ts.map +0 -1
- package/dist/plugins/usage/usage-plugin.js +0 -309
- package/dist/plugins/usage/usage-plugin.js.map +0 -1
- package/dist/plugins/webhook/http-client.d.ts +0 -30
- package/dist/plugins/webhook/http-client.d.ts.map +0 -1
- package/dist/plugins/webhook/http-client.js +0 -110
- package/dist/plugins/webhook/http-client.js.map +0 -1
- package/dist/plugins/webhook/index.d.ts +0 -9
- package/dist/plugins/webhook/index.d.ts.map +0 -1
- package/dist/plugins/webhook/index.js +0 -9
- package/dist/plugins/webhook/index.js.map +0 -1
- package/dist/plugins/webhook/transformer.d.ts +0 -63
- package/dist/plugins/webhook/transformer.d.ts.map +0 -1
- package/dist/plugins/webhook/transformer.js +0 -157
- package/dist/plugins/webhook/transformer.js.map +0 -1
- package/dist/plugins/webhook/types.d.ts +0 -183
- package/dist/plugins/webhook/types.d.ts.map +0 -1
- package/dist/plugins/webhook/types.js +0 -2
- package/dist/plugins/webhook/types.js.map +0 -1
- package/dist/plugins/webhook/webhook-plugin.d.ts +0 -92
- package/dist/plugins/webhook/webhook-plugin.d.ts.map +0 -1
- package/dist/plugins/webhook/webhook-plugin.js +0 -328
- package/dist/plugins/webhook/webhook-plugin.js.map +0 -1
- package/dist/schemas/agent-template-schema.d.ts +0 -137
- package/dist/schemas/agent-template-schema.d.ts.map +0 -1
- package/dist/schemas/agent-template-schema.js +0 -87
- package/dist/schemas/agent-template-schema.js.map +0 -1
- package/dist/services/conversation-service/index.d.ts +0 -88
- package/dist/services/conversation-service/index.d.ts.map +0 -1
- package/dist/services/conversation-service/index.js +0 -441
- package/dist/services/conversation-service/index.js.map +0 -1
- package/dist/services/conversation-service/types.d.ts +0 -32
- package/dist/services/conversation-service/types.d.ts.map +0 -1
- package/dist/services/conversation-service/types.js +0 -8
- package/dist/services/conversation-service/types.js.map +0 -1
- package/dist/services/event-service.d.ts +0 -61
- package/dist/services/event-service.d.ts.map +0 -1
- package/dist/services/event-service.js +0 -110
- package/dist/services/event-service.js.map +0 -1
- package/dist/services/event-service.test.d.ts +0 -2
- package/dist/services/event-service.test.d.ts.map +0 -1
- package/dist/services/event-service.test.js +0 -86
- package/dist/services/event-service.test.js.map +0 -1
- package/dist/services/execution-service.d.ts +0 -151
- package/dist/services/execution-service.d.ts.map +0 -1
- package/dist/services/execution-service.js +0 -1262
- package/dist/services/execution-service.js.map +0 -1
- package/dist/services/execution-service.test.d.ts +0 -2
- package/dist/services/execution-service.test.d.ts.map +0 -1
- package/dist/services/execution-service.test.js +0 -338
- package/dist/services/execution-service.test.js.map +0 -1
- package/dist/services/history-module.d.ts +0 -15
- package/dist/services/history-module.d.ts.map +0 -1
- package/dist/services/history-module.js +0 -42
- package/dist/services/history-module.js.map +0 -1
- package/dist/services/in-memory-history-store.d.ts +0 -12
- package/dist/services/in-memory-history-store.d.ts.map +0 -1
- package/dist/services/in-memory-history-store.js +0 -41
- package/dist/services/in-memory-history-store.js.map +0 -1
- package/dist/services/index.d.ts +0 -7
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/index.js +0 -13
- package/dist/services/index.js.map +0 -1
- package/dist/services/task-events.d.ts +0 -6
- package/dist/services/task-events.d.ts.map +0 -1
- package/dist/services/task-events.js +0 -6
- package/dist/services/task-events.js.map +0 -1
- package/dist/services/tool-execution-service.d.ts +0 -74
- package/dist/services/tool-execution-service.d.ts.map +0 -1
- package/dist/services/tool-execution-service.js +0 -189
- package/dist/services/tool-execution-service.js.map +0 -1
- package/dist/services/user-events.d.ts +0 -7
- package/dist/services/user-events.d.ts.map +0 -1
- package/dist/services/user-events.js +0 -6
- package/dist/services/user-events.js.map +0 -1
- package/dist/tools/implementations/function-tool/index.d.ts +0 -9
- package/dist/tools/implementations/function-tool/index.d.ts.map +0 -1
- package/dist/tools/implementations/function-tool/index.js +0 -13
- package/dist/tools/implementations/function-tool/index.js.map +0 -1
- package/dist/tools/implementations/function-tool/schema-converter.d.ts +0 -32
- package/dist/tools/implementations/function-tool/schema-converter.d.ts.map +0 -1
- package/dist/tools/implementations/function-tool/schema-converter.js +0 -164
- package/dist/tools/implementations/function-tool/schema-converter.js.map +0 -1
- package/dist/tools/implementations/function-tool/types.d.ts +0 -72
- package/dist/tools/implementations/function-tool/types.d.ts.map +0 -1
- package/dist/tools/implementations/function-tool/types.js +0 -14
- package/dist/tools/implementations/function-tool/types.js.map +0 -1
- package/dist/tools/implementations/function-tool.d.ts +0 -49
- package/dist/tools/implementations/function-tool.d.ts.map +0 -1
- package/dist/tools/implementations/function-tool.js +0 -223
- package/dist/tools/implementations/function-tool.js.map +0 -1
- package/dist/tools/implementations/index.d.ts +0 -4
- package/dist/tools/implementations/index.d.ts.map +0 -1
- package/dist/tools/implementations/index.js +0 -5
- package/dist/tools/implementations/index.js.map +0 -1
- package/dist/tools/implementations/mcp-tool.d.ts +0 -72
- package/dist/tools/implementations/mcp-tool.d.ts.map +0 -1
- package/dist/tools/implementations/mcp-tool.js +0 -246
- package/dist/tools/implementations/mcp-tool.js.map +0 -1
- package/dist/tools/implementations/openapi-tool.d.ts +0 -56
- package/dist/tools/implementations/openapi-tool.d.ts.map +0 -1
- package/dist/tools/implementations/openapi-tool.js +0 -324
- package/dist/tools/implementations/openapi-tool.js.map +0 -1
- package/dist/tools/implementations/relay-mcp-tool.d.ts +0 -38
- package/dist/tools/implementations/relay-mcp-tool.d.ts.map +0 -1
- package/dist/tools/implementations/relay-mcp-tool.js +0 -46
- package/dist/tools/implementations/relay-mcp-tool.js.map +0 -1
- package/dist/tools/index.d.ts +0 -3
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -4
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/registry/index.d.ts +0 -2
- package/dist/tools/registry/index.d.ts.map +0 -1
- package/dist/tools/registry/index.js +0 -3
- package/dist/tools/registry/index.js.map +0 -1
- package/dist/tools/registry/tool-registry.d.ts +0 -54
- package/dist/tools/registry/tool-registry.d.ts.map +0 -1
- package/dist/tools/registry/tool-registry.js +0 -146
- package/dist/tools/registry/tool-registry.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -155
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -203
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/execution-proxy.d.ts +0 -75
- package/dist/utils/execution-proxy.d.ts.map +0 -1
- package/dist/utils/execution-proxy.js +0 -230
- package/dist/utils/execution-proxy.js.map +0 -1
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -74
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -143
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/message-converter.d.ts +0 -68
- package/dist/utils/message-converter.d.ts.map +0 -1
- package/dist/utils/message-converter.js +0 -87
- package/dist/utils/message-converter.js.map +0 -1
- package/dist/utils/periodic-task.d.ts +0 -14
- package/dist/utils/periodic-task.d.ts.map +0 -1
- package/dist/utils/periodic-task.js +0 -26
- package/dist/utils/periodic-task.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -40
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -162
- package/dist/utils/validation.js.map +0 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -44,12 +44,18 @@ interface IToolCall {
|
|
|
44
44
|
arguments: string;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
/** State of a message in conversation history */
|
|
48
|
+
type TMessageState = 'complete' | 'interrupted';
|
|
47
49
|
/**
|
|
48
50
|
* Base message contract shared by all message variants.
|
|
49
51
|
*/
|
|
50
52
|
interface IBaseMessage {
|
|
53
|
+
/** Unique message identifier */
|
|
54
|
+
id: string;
|
|
51
55
|
/** Message creation timestamp */
|
|
52
56
|
timestamp: Date;
|
|
57
|
+
/** Whether this message is complete or was interrupted */
|
|
58
|
+
state: TMessageState;
|
|
53
59
|
/** Additional metadata */
|
|
54
60
|
metadata?: TUniversalMessageMetadata;
|
|
55
61
|
}
|
|
@@ -81,8 +87,49 @@ interface IToolMessage extends IBaseMessage {
|
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* Universal message union used across the SDK as the canonical contract.
|
|
90
|
+
* Used for AI provider communication. Extracted from IHistoryEntry[] via filtering.
|
|
84
91
|
*/
|
|
85
92
|
type TUniversalMessage = IUserMessage | IAssistantMessage | ISystemMessage | IToolMessage;
|
|
93
|
+
/**
|
|
94
|
+
* Universal history entry — the base type for all records in conversation history.
|
|
95
|
+
*
|
|
96
|
+
* History is a universal timeline that records everything: AI chat messages,
|
|
97
|
+
* system events, skill invocations, permission decisions, etc.
|
|
98
|
+
* AI provider receives only chat entries (filtered and converted to TUniversalMessage).
|
|
99
|
+
* TUI can render any range of entries.
|
|
100
|
+
*
|
|
101
|
+
* - append-only, read-only
|
|
102
|
+
* - category + type for classification (free-form strings, no pre-defined enum)
|
|
103
|
+
* - data holds type-specific structured content
|
|
104
|
+
*/
|
|
105
|
+
interface IHistoryEntry<T = unknown> {
|
|
106
|
+
/** Unique entry identifier */
|
|
107
|
+
id: string;
|
|
108
|
+
/** Entry creation timestamp */
|
|
109
|
+
timestamp: Date;
|
|
110
|
+
/** Top-level classification: 'chat', 'event', etc. */
|
|
111
|
+
category: string;
|
|
112
|
+
/** Sub-classification within category. Free-form, not pre-defined. */
|
|
113
|
+
type: string;
|
|
114
|
+
/** Type-specific structured data */
|
|
115
|
+
data?: T;
|
|
116
|
+
}
|
|
117
|
+
/** Check if a history entry is a chat message (for AI provider filtering). */
|
|
118
|
+
declare function isChatEntry(entry: IHistoryEntry): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Convert a chat history entry to TUniversalMessage for AI provider consumption.
|
|
121
|
+
* Only call on entries where isChatEntry() returns true.
|
|
122
|
+
*/
|
|
123
|
+
declare function chatEntryToMessage(entry: IHistoryEntry): TUniversalMessage;
|
|
124
|
+
/**
|
|
125
|
+
* Convert a TUniversalMessage to an IHistoryEntry for storage.
|
|
126
|
+
*/
|
|
127
|
+
declare function messageToHistoryEntry(message: TUniversalMessage): IHistoryEntry;
|
|
128
|
+
/**
|
|
129
|
+
* Filter history entries and convert chat entries to TUniversalMessage[].
|
|
130
|
+
* Used when passing conversation to AI provider.
|
|
131
|
+
*/
|
|
132
|
+
declare function getMessagesForAPI(history: IHistoryEntry[]): TUniversalMessage[];
|
|
86
133
|
/**
|
|
87
134
|
* Type guards for the canonical TUniversalMessage union.
|
|
88
135
|
*
|
|
@@ -155,6 +202,42 @@ interface IPluginContext {
|
|
|
155
202
|
error?: Error;
|
|
156
203
|
executionContext?: TContextData;
|
|
157
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
|
+
|
|
216
|
+
interface IProviderFunctionCallingCapability {
|
|
217
|
+
supported: boolean;
|
|
218
|
+
reason?: string;
|
|
219
|
+
}
|
|
220
|
+
interface IProviderNativeWebToolCapability {
|
|
221
|
+
supported: boolean;
|
|
222
|
+
enabled: boolean;
|
|
223
|
+
source?: string;
|
|
224
|
+
reason?: string;
|
|
225
|
+
}
|
|
226
|
+
interface IProviderNativeWebToolCapabilities {
|
|
227
|
+
webSearch: IProviderNativeWebToolCapability;
|
|
228
|
+
webFetch: IProviderNativeWebToolCapability;
|
|
229
|
+
}
|
|
230
|
+
interface IProviderCapabilities {
|
|
231
|
+
functionCalling: IProviderFunctionCallingCapability;
|
|
232
|
+
nativeWebTools: IProviderNativeWebToolCapabilities;
|
|
233
|
+
}
|
|
234
|
+
interface IProviderNativeWebToolRequest {
|
|
235
|
+
webSearch?: boolean;
|
|
236
|
+
webFetch?: boolean;
|
|
237
|
+
}
|
|
238
|
+
declare function createDefaultProviderCapabilities(functionCallingSupported: boolean): IProviderCapabilities;
|
|
239
|
+
declare function getProviderCapabilities(provider: IAIProvider): IProviderCapabilities;
|
|
240
|
+
declare function assertProviderNativeWebToolsAvailable(providerName: string, capabilities: IProviderCapabilities, request: IProviderNativeWebToolRequest | undefined): void;
|
|
158
241
|
|
|
159
242
|
/**
|
|
160
243
|
* Reusable type definitions for provider layer
|
|
@@ -187,6 +270,7 @@ interface IToolSchema {
|
|
|
187
270
|
type: 'object';
|
|
188
271
|
properties: Record<string, IParameterSchema>;
|
|
189
272
|
required?: string[];
|
|
273
|
+
additionalProperties?: boolean | IParameterSchema;
|
|
190
274
|
};
|
|
191
275
|
}
|
|
192
276
|
/**
|
|
@@ -283,6 +367,17 @@ interface IProviderSpecificOptions {
|
|
|
283
367
|
* Called for each text chunk as the model generates output.
|
|
284
368
|
*/
|
|
285
369
|
type TTextDeltaCallback = (delta: string) => void;
|
|
370
|
+
type TProviderNativeRawPayloadKind = 'request' | 'response' | 'stream_event';
|
|
371
|
+
type TProviderNativeRawPayload = string | number | boolean | object | null | undefined;
|
|
372
|
+
interface IProviderNativeRawPayloadEvent {
|
|
373
|
+
provider: string;
|
|
374
|
+
apiSurface?: string;
|
|
375
|
+
payloadKind: TProviderNativeRawPayloadKind;
|
|
376
|
+
payload: TProviderNativeRawPayload;
|
|
377
|
+
sequence?: number;
|
|
378
|
+
metadata?: Record<string, TProviderConfigValue>;
|
|
379
|
+
}
|
|
380
|
+
type TProviderNativeRawPayloadCallback = (event: IProviderNativeRawPayloadEvent) => void;
|
|
286
381
|
/**
|
|
287
382
|
* Options for AI provider chat requests
|
|
288
383
|
*/
|
|
@@ -299,6 +394,12 @@ interface IChatOptions extends IProviderSpecificOptions {
|
|
|
299
394
|
* should use streaming internally and call this for each text chunk,
|
|
300
395
|
* while still returning the complete assembled message. */
|
|
301
396
|
onTextDelta?: TTextDeltaCallback;
|
|
397
|
+
/** Callback for provider-owned native SDK request/response/stream payload capture. */
|
|
398
|
+
onProviderNativeRawPayload?: TProviderNativeRawPayloadCallback;
|
|
399
|
+
/** AbortSignal for cancelling the provider call */
|
|
400
|
+
signal?: AbortSignal;
|
|
401
|
+
/** Provider-native hosted web tools requested for this call */
|
|
402
|
+
nativeWebTools?: IProviderNativeWebToolRequest;
|
|
302
403
|
}
|
|
303
404
|
/**
|
|
304
405
|
* Provider-agnostic AI Provider interface
|
|
@@ -340,6 +441,15 @@ interface IAIProvider {
|
|
|
340
441
|
* @returns true if tool calling is supported
|
|
341
442
|
*/
|
|
342
443
|
supportsTools(): boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Report provider-neutral capability state.
|
|
446
|
+
* Providers without native web support can omit this and use default capability helpers.
|
|
447
|
+
*/
|
|
448
|
+
getCapabilities?(): IProviderCapabilities;
|
|
449
|
+
/**
|
|
450
|
+
* Optional generic hook for enabling provider-native hosted web behavior.
|
|
451
|
+
*/
|
|
452
|
+
configureNativeWebTools?(request: IProviderNativeWebToolRequest): IProviderCapabilities;
|
|
343
453
|
/**
|
|
344
454
|
* Validate provider configuration
|
|
345
455
|
* @returns true if configuration is valid
|
|
@@ -481,6 +591,78 @@ interface IEventServiceOwnerBinding {
|
|
|
481
591
|
ownerPath: IOwnerPathSegment[];
|
|
482
592
|
}
|
|
483
593
|
|
|
594
|
+
/**
|
|
595
|
+
* Abstract base for event services.
|
|
596
|
+
* Concrete implementations decide how events are delivered.
|
|
597
|
+
*/
|
|
598
|
+
declare abstract class AbstractEventService implements IEventService {
|
|
599
|
+
private listeners;
|
|
600
|
+
abstract emit(eventType: string, data: IBaseEventData, context?: IEventContext): void;
|
|
601
|
+
subscribe(listener: TEventListener): void;
|
|
602
|
+
unsubscribe(listener: TEventListener): void;
|
|
603
|
+
protected notifyListeners(eventType: string, data: IBaseEventData, context?: IEventContext): void;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Default no-op event service (production-safe).
|
|
607
|
+
* When injected, emit() intentionally does nothing.
|
|
608
|
+
*/
|
|
609
|
+
declare class DefaultEventService extends AbstractEventService {
|
|
610
|
+
emit(_eventType: string, _data: IBaseEventData, _context?: IEventContext): void;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Singleton default event service instance.
|
|
614
|
+
*/
|
|
615
|
+
declare const DEFAULT_ABSTRACT_EVENT_SERVICE: IEventService;
|
|
616
|
+
/**
|
|
617
|
+
* Check if a given service is the default no-op implementation.
|
|
618
|
+
*/
|
|
619
|
+
declare function isDefaultEventService(service: IEventService): boolean;
|
|
620
|
+
/**
|
|
621
|
+
* Compose a full event name from owner prefix and local name.
|
|
622
|
+
* Local names must not contain dots.
|
|
623
|
+
*/
|
|
624
|
+
declare function composeEventName(ownerType: string, localName: string): string;
|
|
625
|
+
/**
|
|
626
|
+
* A scoped event service that always emits with an owner binding applied.
|
|
627
|
+
*/
|
|
628
|
+
declare class StructuredEventService extends AbstractEventService {
|
|
629
|
+
private readonly base;
|
|
630
|
+
private readonly binding;
|
|
631
|
+
constructor(base: IEventService, binding: IEventServiceOwnerBinding);
|
|
632
|
+
emit(eventType: string, data: IBaseEventData, context?: IEventContext): void;
|
|
633
|
+
subscribe(listener: TEventListener): void;
|
|
634
|
+
unsubscribe(listener: TEventListener): void;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Bind an EventService to an explicit owner path.
|
|
638
|
+
* This is the standard entry point for scoped emission (path-only architecture).
|
|
639
|
+
*/
|
|
640
|
+
declare function bindWithOwnerPath(base: IEventService, binding: IEventServiceOwnerBinding): IEventService;
|
|
641
|
+
/**
|
|
642
|
+
* Alias for bindWithOwnerPath for historical call sites.
|
|
643
|
+
* Intentionally forwards to the single authoritative implementation.
|
|
644
|
+
*/
|
|
645
|
+
declare function bindEventServiceOwner(base: IEventService, binding: IEventServiceOwnerBinding): IEventService;
|
|
646
|
+
/**
|
|
647
|
+
* Observable EventService that notifies subscribed listeners.
|
|
648
|
+
*/
|
|
649
|
+
declare class ObservableEventService extends AbstractEventService {
|
|
650
|
+
emit(eventType: string, data: IBaseEventData, context?: IEventContext): void;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
declare const TASK_EVENTS: {
|
|
654
|
+
readonly ASSIGNED: "assigned";
|
|
655
|
+
readonly COMPLETED: "completed";
|
|
656
|
+
};
|
|
657
|
+
declare const TASK_EVENT_PREFIX: "task";
|
|
658
|
+
|
|
659
|
+
declare const USER_EVENTS: {
|
|
660
|
+
readonly MESSAGE: "message";
|
|
661
|
+
readonly INPUT: "input";
|
|
662
|
+
};
|
|
663
|
+
declare const USER_EVENT_PREFIX: "user";
|
|
664
|
+
type TUserEvent = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
665
|
+
|
|
484
666
|
type TToolContextExtensionValue = TUniversalValue | Date | Error | TLoggerData | TContextData | TToolParameters | TToolMetadata;
|
|
485
667
|
/**
|
|
486
668
|
* Tool metadata structure - specific type definition
|
|
@@ -593,57 +775,6 @@ interface IParameterValidationResult {
|
|
|
593
775
|
* Generic tool executor function
|
|
594
776
|
*/
|
|
595
777
|
type TToolExecutor<TParams = TToolParameters, TResult = TUniversalValue> = (parameters: TParams, context?: IToolExecutionContext) => Promise<TResult>;
|
|
596
|
-
/**
|
|
597
|
-
* OpenAPI specification configuration
|
|
598
|
-
*/
|
|
599
|
-
interface IOpenAPIToolConfig {
|
|
600
|
-
/** OpenAPI 3.0 specification */
|
|
601
|
-
spec: {
|
|
602
|
-
openapi: string;
|
|
603
|
-
info: {
|
|
604
|
-
title: string;
|
|
605
|
-
version: string;
|
|
606
|
-
description?: string;
|
|
607
|
-
};
|
|
608
|
-
servers?: Array<{
|
|
609
|
-
url: string;
|
|
610
|
-
description?: string;
|
|
611
|
-
}>;
|
|
612
|
-
paths: Record<string, Record<string, string | number | boolean | Record<string, string | number | boolean>>>;
|
|
613
|
-
components?: Record<string, Record<string, string | number | boolean>>;
|
|
614
|
-
};
|
|
615
|
-
/** Operation ID from the OpenAPI spec */
|
|
616
|
-
operationId: string;
|
|
617
|
-
/** Base URL for API calls */
|
|
618
|
-
baseURL: string;
|
|
619
|
-
/** Authentication configuration */
|
|
620
|
-
auth?: {
|
|
621
|
-
type: 'bearer' | 'apiKey' | 'basic';
|
|
622
|
-
token?: string;
|
|
623
|
-
apiKey?: string;
|
|
624
|
-
header?: string;
|
|
625
|
-
username?: string;
|
|
626
|
-
password?: string;
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* MCP (Model Context Protocol) configuration
|
|
631
|
-
*/
|
|
632
|
-
interface IMCPToolConfig {
|
|
633
|
-
/** MCP server endpoint */
|
|
634
|
-
endpoint: string;
|
|
635
|
-
/** Protocol version */
|
|
636
|
-
version?: string;
|
|
637
|
-
/** Authentication configuration */
|
|
638
|
-
auth?: {
|
|
639
|
-
type: 'bearer' | 'apiKey';
|
|
640
|
-
token: string;
|
|
641
|
-
};
|
|
642
|
-
/** Tool-specific configuration */
|
|
643
|
-
toolConfig?: Record<string, string | number | boolean>;
|
|
644
|
-
/** Timeout in milliseconds */
|
|
645
|
-
timeout?: number;
|
|
646
|
-
}
|
|
647
778
|
/**
|
|
648
779
|
* Base tool interface
|
|
649
780
|
*/
|
|
@@ -707,23 +838,6 @@ interface IToolRegistry {
|
|
|
707
838
|
*/
|
|
708
839
|
clear(): void;
|
|
709
840
|
}
|
|
710
|
-
/**
|
|
711
|
-
* Tool factory interface
|
|
712
|
-
*/
|
|
713
|
-
interface IToolFactory {
|
|
714
|
-
/**
|
|
715
|
-
* Create function tool from schema and function
|
|
716
|
-
*/
|
|
717
|
-
createFunctionTool(schema: IToolSchema, fn: TToolExecutor): IFunctionTool;
|
|
718
|
-
/**
|
|
719
|
-
* Create tool from OpenAPI specification
|
|
720
|
-
*/
|
|
721
|
-
createOpenAPITool(config: IOpenAPIToolConfig): ITool;
|
|
722
|
-
/**
|
|
723
|
-
* Create MCP tool
|
|
724
|
-
*/
|
|
725
|
-
createMCPTool(config: IMCPToolConfig): ITool;
|
|
726
|
-
}
|
|
727
841
|
|
|
728
842
|
declare const EXECUTION_EVENT_NAMES: {
|
|
729
843
|
readonly START: "execution.start";
|
|
@@ -864,6 +978,24 @@ interface ILogger {
|
|
|
864
978
|
* - Inject a real logger explicitly if you want output.
|
|
865
979
|
*/
|
|
866
980
|
declare const SilentLogger: ILogger;
|
|
981
|
+
/**
|
|
982
|
+
* Console logger implementation
|
|
983
|
+
* @internal
|
|
984
|
+
*/
|
|
985
|
+
declare class ConsoleLogger implements ILogger {
|
|
986
|
+
private level?;
|
|
987
|
+
private packageName;
|
|
988
|
+
private sinkLogger;
|
|
989
|
+
constructor(packageName: string, logger?: ILogger);
|
|
990
|
+
debug(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
991
|
+
info(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
992
|
+
warn(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
993
|
+
error(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
994
|
+
log(...args: Array<TUniversalValue | TLoggerData | Error>): void;
|
|
995
|
+
private getLevel;
|
|
996
|
+
private shouldLog;
|
|
997
|
+
private forward;
|
|
998
|
+
}
|
|
867
999
|
/**
|
|
868
1000
|
* Create a named logger instance for a package or module.
|
|
869
1001
|
* Use this to create loggers with a specific name prefix for easy log filtering.
|
|
@@ -1513,6 +1645,7 @@ interface IAgentConfig {
|
|
|
1513
1645
|
responseFormat?: IResponseFormatConfig;
|
|
1514
1646
|
safetySettings?: ISafetySetting[];
|
|
1515
1647
|
timeout?: number;
|
|
1648
|
+
maxExecutionRounds?: number;
|
|
1516
1649
|
retryAttempts?: number;
|
|
1517
1650
|
rateLimiting?: {
|
|
1518
1651
|
enabled?: boolean;
|
|
@@ -1549,7 +1682,20 @@ interface IRunOptions {
|
|
|
1549
1682
|
sessionId?: string;
|
|
1550
1683
|
userId?: string;
|
|
1551
1684
|
metadata?: TMetadata;
|
|
1685
|
+
/** AbortSignal for cancelling execution */
|
|
1686
|
+
signal?: AbortSignal;
|
|
1687
|
+
/** Per-run streaming text callback. Prefer this over mutating provider callback state. */
|
|
1688
|
+
onTextDelta?: TTextDeltaCallback;
|
|
1689
|
+
/** Per-run replay event callback for provider/tool execution boundaries. */
|
|
1690
|
+
onExecutionEvent?: TExecutionEventCallback;
|
|
1691
|
+
/**
|
|
1692
|
+
* Maximum model/tool rounds for this run.
|
|
1693
|
+
* Use 0 for no core round cap.
|
|
1694
|
+
*/
|
|
1695
|
+
maxExecutionRounds?: number;
|
|
1552
1696
|
}
|
|
1697
|
+
type TExecutionEventData = Record<string, unknown>;
|
|
1698
|
+
type TExecutionEventCallback = (event: string, data: TExecutionEventData) => void;
|
|
1553
1699
|
/**
|
|
1554
1700
|
* Generic agent interface with type parameters for enhanced type safety
|
|
1555
1701
|
*
|
|
@@ -1595,6 +1741,97 @@ interface ISafetySetting {
|
|
|
1595
1741
|
[key: string]: TConfigValue;
|
|
1596
1742
|
}
|
|
1597
1743
|
|
|
1744
|
+
interface IProviderConfig$1 {
|
|
1745
|
+
name: string;
|
|
1746
|
+
model: string;
|
|
1747
|
+
apiKey?: string;
|
|
1748
|
+
baseURL?: string;
|
|
1749
|
+
timeout?: number;
|
|
1750
|
+
options?: Record<string, TUniversalValue>;
|
|
1751
|
+
}
|
|
1752
|
+
interface IProviderProfileDefaults {
|
|
1753
|
+
model?: string;
|
|
1754
|
+
apiKey?: string;
|
|
1755
|
+
baseURL?: string;
|
|
1756
|
+
timeout?: number;
|
|
1757
|
+
options?: Record<string, TUniversalValue>;
|
|
1758
|
+
}
|
|
1759
|
+
interface IProviderProfileConfig {
|
|
1760
|
+
type?: string;
|
|
1761
|
+
model?: string;
|
|
1762
|
+
apiKey?: string;
|
|
1763
|
+
baseURL?: string;
|
|
1764
|
+
timeout?: number;
|
|
1765
|
+
options?: Record<string, TUniversalValue>;
|
|
1766
|
+
}
|
|
1767
|
+
interface IProviderProbeResult {
|
|
1768
|
+
ok: boolean;
|
|
1769
|
+
message: string;
|
|
1770
|
+
models?: string[];
|
|
1771
|
+
}
|
|
1772
|
+
type TProviderCredentialField = 'apiKey';
|
|
1773
|
+
type TProviderSetupField = 'baseURL' | 'model' | TProviderCredentialField;
|
|
1774
|
+
type TProviderSetupHelpLinkKind = 'api-key' | 'console' | 'official';
|
|
1775
|
+
interface IProviderCredentialRequirement {
|
|
1776
|
+
anyOf: readonly TProviderCredentialField[];
|
|
1777
|
+
}
|
|
1778
|
+
interface IProviderSetupHelpLink {
|
|
1779
|
+
kind: TProviderSetupHelpLinkKind;
|
|
1780
|
+
label: string;
|
|
1781
|
+
url: string;
|
|
1782
|
+
sourceUrl?: string;
|
|
1783
|
+
lastVerifiedAt?: string;
|
|
1784
|
+
}
|
|
1785
|
+
type TProviderModelCatalogStatus = 'live' | 'generated' | 'fallback' | 'unavailable';
|
|
1786
|
+
type TProviderModelLifecycle = 'active' | 'preview' | 'deprecated' | 'unavailable';
|
|
1787
|
+
type TProviderModelCapability = 'tools' | 'vision' | 'json_schema' | 'reasoning' | 'native_web' | 'streaming';
|
|
1788
|
+
interface IProviderModelCatalogEntry {
|
|
1789
|
+
id: string;
|
|
1790
|
+
displayName: string;
|
|
1791
|
+
aliases?: readonly string[];
|
|
1792
|
+
contextWindow?: number;
|
|
1793
|
+
capabilities?: readonly TProviderModelCapability[];
|
|
1794
|
+
lifecycle?: TProviderModelLifecycle;
|
|
1795
|
+
lastVerifiedAt?: string;
|
|
1796
|
+
sourceUrl?: string;
|
|
1797
|
+
}
|
|
1798
|
+
interface IProviderModelCatalog {
|
|
1799
|
+
status: TProviderModelCatalogStatus;
|
|
1800
|
+
entries?: readonly IProviderModelCatalogEntry[];
|
|
1801
|
+
lastVerifiedAt?: string;
|
|
1802
|
+
sourceUrl?: string;
|
|
1803
|
+
message?: string;
|
|
1804
|
+
}
|
|
1805
|
+
interface IProviderModelCatalogRefreshOptions {
|
|
1806
|
+
profile: IProviderProfileConfig;
|
|
1807
|
+
}
|
|
1808
|
+
type TProviderModelCatalogRefresh = (options: IProviderModelCatalogRefreshOptions) => Promise<IProviderModelCatalog>;
|
|
1809
|
+
interface IProviderSetupStepDefinition {
|
|
1810
|
+
key: TProviderSetupField;
|
|
1811
|
+
title: string;
|
|
1812
|
+
defaultValue?: string;
|
|
1813
|
+
required?: boolean;
|
|
1814
|
+
masked?: boolean;
|
|
1815
|
+
}
|
|
1816
|
+
interface IProviderDefinition {
|
|
1817
|
+
type: string;
|
|
1818
|
+
aliases?: readonly string[];
|
|
1819
|
+
displayName?: string;
|
|
1820
|
+
description?: string;
|
|
1821
|
+
defaults?: IProviderProfileDefaults;
|
|
1822
|
+
modelCatalog?: IProviderModelCatalog;
|
|
1823
|
+
refreshModelCatalog?: TProviderModelCatalogRefresh;
|
|
1824
|
+
setupHelpLinks?: readonly IProviderSetupHelpLink[];
|
|
1825
|
+
setupSteps?: readonly IProviderSetupStepDefinition[];
|
|
1826
|
+
credentialRequirement?: IProviderCredentialRequirement;
|
|
1827
|
+
requiresApiKey?: boolean;
|
|
1828
|
+
createProvider: (config: IProviderConfig$1) => IAIProvider;
|
|
1829
|
+
probeProfile?: (profile: IProviderProfileConfig) => Promise<IProviderProbeResult>;
|
|
1830
|
+
}
|
|
1831
|
+
declare function findProviderDefinition(definitions: readonly IProviderDefinition[], type: string): IProviderDefinition | undefined;
|
|
1832
|
+
declare function formatSupportedProviderTypes(definitions: readonly IProviderDefinition[]): string;
|
|
1833
|
+
declare function getProviderCredentialRequirement(definition: IProviderDefinition | undefined): IProviderCredentialRequirement | undefined;
|
|
1834
|
+
|
|
1598
1835
|
/**
|
|
1599
1836
|
* Provider-agnostic media output reference.
|
|
1600
1837
|
* Providers must not return raw binary payloads in this contract.
|
|
@@ -1818,6 +2055,75 @@ interface IAgentFactory {
|
|
|
1818
2055
|
mergeConfig(base: IAgentConfig, override: Partial<IAgentConfig>): IAgentConfig;
|
|
1819
2056
|
}
|
|
1820
2057
|
|
|
2058
|
+
/**
|
|
2059
|
+
* OpenAPI specification configuration
|
|
2060
|
+
*/
|
|
2061
|
+
interface IOpenAPIToolConfig {
|
|
2062
|
+
/** OpenAPI 3.0 specification */
|
|
2063
|
+
spec: {
|
|
2064
|
+
openapi: string;
|
|
2065
|
+
info: {
|
|
2066
|
+
title: string;
|
|
2067
|
+
version: string;
|
|
2068
|
+
description?: string;
|
|
2069
|
+
};
|
|
2070
|
+
servers?: Array<{
|
|
2071
|
+
url: string;
|
|
2072
|
+
description?: string;
|
|
2073
|
+
}>;
|
|
2074
|
+
paths: Record<string, Record<string, string | number | boolean | Record<string, string | number | boolean>>>;
|
|
2075
|
+
components?: Record<string, Record<string, string | number | boolean>>;
|
|
2076
|
+
};
|
|
2077
|
+
/** Operation ID from the OpenAPI spec */
|
|
2078
|
+
operationId: string;
|
|
2079
|
+
/** Base URL for API calls */
|
|
2080
|
+
baseURL: string;
|
|
2081
|
+
/** Authentication configuration */
|
|
2082
|
+
auth?: {
|
|
2083
|
+
type: 'bearer' | 'apiKey' | 'basic';
|
|
2084
|
+
token?: string;
|
|
2085
|
+
apiKey?: string;
|
|
2086
|
+
header?: string;
|
|
2087
|
+
username?: string;
|
|
2088
|
+
password?: string;
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* MCP (Model Context Protocol) configuration
|
|
2093
|
+
*/
|
|
2094
|
+
interface IMCPToolConfig {
|
|
2095
|
+
/** MCP server endpoint */
|
|
2096
|
+
endpoint: string;
|
|
2097
|
+
/** Protocol version */
|
|
2098
|
+
version?: string;
|
|
2099
|
+
/** Authentication configuration */
|
|
2100
|
+
auth?: {
|
|
2101
|
+
type: 'bearer' | 'apiKey';
|
|
2102
|
+
token: string;
|
|
2103
|
+
};
|
|
2104
|
+
/** Tool-specific configuration */
|
|
2105
|
+
toolConfig?: Record<string, string | number | boolean>;
|
|
2106
|
+
/** Timeout in milliseconds */
|
|
2107
|
+
timeout?: number;
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* Tool factory interface
|
|
2111
|
+
*/
|
|
2112
|
+
interface IToolFactory {
|
|
2113
|
+
/**
|
|
2114
|
+
* Create function tool from schema and function
|
|
2115
|
+
*/
|
|
2116
|
+
createFunctionTool(schema: IToolSchema, fn: TToolExecutor): IFunctionTool;
|
|
2117
|
+
/**
|
|
2118
|
+
* Create tool from OpenAPI specification
|
|
2119
|
+
*/
|
|
2120
|
+
createOpenAPITool(config: IOpenAPIToolConfig): ITool;
|
|
2121
|
+
/**
|
|
2122
|
+
* Create MCP tool
|
|
2123
|
+
*/
|
|
2124
|
+
createMCPTool(config: IMCPToolConfig): ITool;
|
|
2125
|
+
}
|
|
2126
|
+
|
|
1821
2127
|
/**
|
|
1822
2128
|
* Execution step definition for tools that support step-by-step progress reporting
|
|
1823
2129
|
*/
|
|
@@ -2384,72 +2690,13 @@ interface IExecutorAwareProviderConfig {
|
|
|
2384
2690
|
[key: string]: string | number | boolean | IExecutor | undefined;
|
|
2385
2691
|
}
|
|
2386
2692
|
/**
|
|
2387
|
-
* Base AI provider implementation with proper type constraints
|
|
2388
|
-
* All AI providers should extend this class
|
|
2389
|
-
*
|
|
2390
|
-
* ========================================
|
|
2391
|
-
* CRITICAL IMPLEMENTATION GUIDELINES
|
|
2392
|
-
* ========================================
|
|
2393
|
-
*
|
|
2394
|
-
* ALL AI PROVIDER IMPLEMENTATIONS (OpenAI, Anthropic, Google, etc.) MUST:
|
|
2395
|
-
*
|
|
2396
|
-
* 1. EXTEND THIS CLASS:
|
|
2397
|
-
* ```typescript
|
|
2398
|
-
* export class OpenAIProvider extends AbstractAIProvider {
|
|
2399
|
-
* override readonly name = 'openai';
|
|
2400
|
-
* override readonly version = '1.0.0';
|
|
2401
|
-
* ```
|
|
2402
|
-
*
|
|
2403
|
-
* 2. USE IMPORTS FROM @robota-sdk/agent-core:
|
|
2404
|
-
* ```typescript
|
|
2405
|
-
* import { AbstractAIProvider } from '@robota-sdk/agent-core';
|
|
2406
|
-
* import type {
|
|
2407
|
-
* TUniversalMessage,
|
|
2408
|
-
* ChatOptions,
|
|
2409
|
-
* IToolCall,
|
|
2410
|
-
* ToolSchema,
|
|
2411
|
-
* AssistantMessage
|
|
2412
|
-
* } from '@robota-sdk/agent-core';
|
|
2413
|
-
* ```
|
|
2414
|
-
*
|
|
2415
|
-
* 3. USE OVERRIDE KEYWORD FOR ALL INHERITED METHODS:
|
|
2416
|
-
* - override async chat(...)
|
|
2417
|
-
* - override async *chatStream(...)
|
|
2418
|
-
* - override supportsTools()
|
|
2419
|
-
* - override validateConfig()
|
|
2420
|
-
* - override async dispose()
|
|
2421
|
-
*
|
|
2422
|
-
* 4. DO NOT REDEFINE TYPES THAT EXIST IN @robota-sdk/agent-core:
|
|
2423
|
-
* - TUniversalMessage
|
|
2424
|
-
* - ChatOptions
|
|
2425
|
-
* - IToolCall
|
|
2426
|
-
* - ToolSchema
|
|
2427
|
-
* - AssistantMessage
|
|
2428
|
-
* - SystemMessage
|
|
2429
|
-
* - UserMessage
|
|
2430
|
-
* - ToolMessage
|
|
2693
|
+
* Base AI provider implementation with proper type constraints.
|
|
2694
|
+
* All AI providers should extend this class.
|
|
2431
2695
|
*
|
|
2432
|
-
*
|
|
2433
|
-
*
|
|
2434
|
-
* - For regular messages: content can be string or null
|
|
2435
|
-
* - Always preserve null values from API responses
|
|
2696
|
+
* Subclasses MUST: extend this class, use override keyword, call super() in constructor,
|
|
2697
|
+
* not redefine types that exist in agent-core, handle null message content correctly.
|
|
2436
2698
|
*
|
|
2437
|
-
*
|
|
2438
|
-
* ```typescript
|
|
2439
|
-
* constructor(options: IProviderOptions) {
|
|
2440
|
-
* super();
|
|
2441
|
-
* // provider-specific initialization
|
|
2442
|
-
* }
|
|
2443
|
-
* ```
|
|
2444
|
-
*
|
|
2445
|
-
* This ensures ExecutionService can properly identify providers
|
|
2446
|
-
* and prevents type conflicts across the codebase.
|
|
2447
|
-
*
|
|
2448
|
-
* ========================================
|
|
2449
|
-
*
|
|
2450
|
-
* @template TConfig - Provider configuration type (defaults to IProviderConfig for type safety)
|
|
2451
|
-
* @template TUniversalMessage - Message type (defaults to TUniversalMessage for backward compatibility)
|
|
2452
|
-
* @template TResponse - Response type (defaults to TUniversalMessage for backward compatibility)
|
|
2699
|
+
* @template TConfig - Provider configuration type
|
|
2453
2700
|
*/
|
|
2454
2701
|
declare abstract class AbstractAIProvider<TConfig = IProviderConfig> implements IAIProvider {
|
|
2455
2702
|
abstract readonly name: string;
|
|
@@ -2470,6 +2717,15 @@ declare abstract class AbstractAIProvider<TConfig = IProviderConfig> implements
|
|
|
2470
2717
|
* @returns Promise resolving to a response
|
|
2471
2718
|
*/
|
|
2472
2719
|
abstract chat(messages: TUniversalMessage[], options?: IChatOptions): Promise<TUniversalMessage>;
|
|
2720
|
+
/**
|
|
2721
|
+
* Wrap an async iterable to yield to the macrotask queue periodically.
|
|
2722
|
+
* Providers MUST use this when iterating over streaming events to ensure
|
|
2723
|
+
* the main thread event loop stays responsive (ESC abort, Ctrl+C, etc.).
|
|
2724
|
+
*
|
|
2725
|
+
* Usage in provider:
|
|
2726
|
+
* for await (const event of this.streamWithAbort(stream, signal)) { ... }
|
|
2727
|
+
*/
|
|
2728
|
+
protected streamWithAbort<T>(source: AsyncIterable<T>, signal?: AbortSignal): AsyncGenerator<T>;
|
|
2473
2729
|
/**
|
|
2474
2730
|
* Each provider must implement streaming chat using their own native SDK types internally
|
|
2475
2731
|
* @param messages - Array of messages from conversation history
|
|
@@ -2496,30 +2752,24 @@ declare abstract class AbstractAIProvider<TConfig = IProviderConfig> implements
|
|
|
2496
2752
|
* @returns true if tool calling is supported
|
|
2497
2753
|
*/
|
|
2498
2754
|
supportsTools(): boolean;
|
|
2755
|
+
getCapabilities(): IProviderCapabilities;
|
|
2499
2756
|
/**
|
|
2500
2757
|
* Default implementation - providers can override for specific validation
|
|
2501
2758
|
* @returns true if configuration is valid
|
|
2502
2759
|
*/
|
|
2503
2760
|
validateConfig(): boolean;
|
|
2504
|
-
/**
|
|
2505
|
-
* Utility method for validating TUniversalMessage array
|
|
2506
|
-
* @param messages - Messages to validate
|
|
2507
|
-
*/
|
|
2761
|
+
/** Validate that messages is a non-empty array with valid roles. */
|
|
2508
2762
|
protected validateMessages(messages: TUniversalMessage[]): void;
|
|
2509
|
-
/**
|
|
2510
|
-
* Utility method for validating tool schemas
|
|
2511
|
-
* @param tools - Tool schemas to validate
|
|
2512
|
-
*/
|
|
2763
|
+
/** Validate tool schemas. No-ops if tools is undefined. */
|
|
2513
2764
|
protected validateTools(tools?: IToolSchema[]): void;
|
|
2765
|
+
protected validateNativeWebTools(request?: IProviderNativeWebToolRequest): void;
|
|
2514
2766
|
/**
|
|
2515
2767
|
* Execute chat via executor.
|
|
2516
|
-
*
|
|
2517
2768
|
* Subclasses should call this only when an executor is configured.
|
|
2518
2769
|
*/
|
|
2519
2770
|
protected executeViaExecutorOrDirect(messages: TUniversalMessage[], options?: IChatOptions): Promise<TUniversalMessage>;
|
|
2520
2771
|
/**
|
|
2521
2772
|
* Execute streaming chat via executor.
|
|
2522
|
-
*
|
|
2523
2773
|
* Subclasses should call this only when an executor is configured.
|
|
2524
2774
|
*/
|
|
2525
2775
|
protected executeStreamViaExecutorOrDirect(messages: TUniversalMessage[], options?: IChatOptions): AsyncIterable<TUniversalMessage>;
|
|
@@ -2636,55 +2886,26 @@ declare abstract class AbstractExecutor implements IExecutor {
|
|
|
2636
2886
|
protected validateResponse(response: TUniversalMessage): void;
|
|
2637
2887
|
}
|
|
2638
2888
|
|
|
2639
|
-
interface IOpenAIMessage {
|
|
2640
|
-
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
2641
|
-
content: string | null;
|
|
2642
|
-
tool_calls?: {
|
|
2643
|
-
id: string;
|
|
2644
|
-
type: 'function';
|
|
2645
|
-
function: {
|
|
2646
|
-
name: string;
|
|
2647
|
-
arguments: string;
|
|
2648
|
-
};
|
|
2649
|
-
}[];
|
|
2650
|
-
tool_call_id?: string;
|
|
2651
|
-
name?: string;
|
|
2652
|
-
}
|
|
2653
|
-
interface IAnthropicProviderMessage {
|
|
2654
|
-
role: 'user' | 'assistant';
|
|
2655
|
-
content: string;
|
|
2656
|
-
}
|
|
2657
|
-
interface IGoogleProviderMessage {
|
|
2658
|
-
role: 'user' | 'model';
|
|
2659
|
-
parts: {
|
|
2660
|
-
text: string;
|
|
2661
|
-
}[];
|
|
2662
|
-
}
|
|
2663
2889
|
/**
|
|
2664
|
-
* Provider message format
|
|
2890
|
+
* Provider message format type.
|
|
2891
|
+
*
|
|
2892
|
+
* Provider packages own concrete message shapes. Core only carries the generic
|
|
2893
|
+
* conversion hook and never branches on provider names.
|
|
2665
2894
|
*/
|
|
2666
|
-
type TProviderMessage =
|
|
2895
|
+
type TProviderMessage = TUniversalMessage | IUniversalObjectValue;
|
|
2896
|
+
type TMessageFormatConverter<TMessage extends TProviderMessage = TProviderMessage> = (messages: readonly TUniversalMessage[]) => TMessage[];
|
|
2897
|
+
type TMessageConverterRegistry = Readonly<Record<string, TMessageFormatConverter>>;
|
|
2667
2898
|
/**
|
|
2668
2899
|
* Universal message converter utility
|
|
2669
|
-
*
|
|
2900
|
+
*
|
|
2901
|
+
* The converter is registry-based so provider-specific message conversion is
|
|
2902
|
+
* injected by provider packages or callers instead of being hardcoded in core.
|
|
2670
2903
|
*/
|
|
2671
2904
|
declare class MessageConverter {
|
|
2672
2905
|
/**
|
|
2673
|
-
* Convert messages
|
|
2674
|
-
*/
|
|
2675
|
-
static toProviderFormat(messages: TUniversalMessage[], providerName: string): TProviderMessage[];
|
|
2676
|
-
/**
|
|
2677
|
-
* Convert to OpenAI format
|
|
2678
|
-
*/
|
|
2679
|
-
private static toOpenAIFormat;
|
|
2680
|
-
/**
|
|
2681
|
-
* Convert to Anthropic format
|
|
2682
|
-
*/
|
|
2683
|
-
private static toAnthropicFormat;
|
|
2684
|
-
/**
|
|
2685
|
-
* Convert to Google format
|
|
2906
|
+
* Convert messages using an injected converter or converter registry.
|
|
2686
2907
|
*/
|
|
2687
|
-
|
|
2908
|
+
static toProviderFormat(messages: TUniversalMessage[], converter?: TMessageFormatConverter | string, registry?: TMessageConverterRegistry): TProviderMessage[];
|
|
2688
2909
|
/**
|
|
2689
2910
|
* Convert to universal format (no conversion)
|
|
2690
2911
|
*/
|
|
@@ -2730,7 +2951,7 @@ declare class Validator {
|
|
|
2730
2951
|
/**
|
|
2731
2952
|
* Validate API key format (basic check)
|
|
2732
2953
|
*/
|
|
2733
|
-
static validateApiKey(apiKey: string
|
|
2954
|
+
static validateApiKey(apiKey: string): ISimpleValidationResult;
|
|
2734
2955
|
}
|
|
2735
2956
|
declare const validateAgentConfig: typeof Validator.validateAgentConfig;
|
|
2736
2957
|
declare const validateUserInput: typeof Validator.validateUserInput;
|
|
@@ -2919,6 +3140,132 @@ declare function stopPeriodicTask(timer: TTimerId | undefined): void;
|
|
|
2919
3140
|
*/
|
|
2920
3141
|
type TTimerId = ReturnType<typeof setTimeout>;
|
|
2921
3142
|
|
|
3143
|
+
/** Create a user message. */
|
|
3144
|
+
declare function createUserMessage(content: string, options?: {
|
|
3145
|
+
name?: string;
|
|
3146
|
+
metadata?: TUniversalMessageMetadata;
|
|
3147
|
+
parts?: TUniversalMessagePart[];
|
|
3148
|
+
}): IUserMessage;
|
|
3149
|
+
/** Create an assistant message. */
|
|
3150
|
+
declare function createAssistantMessage(content: string | null, options?: {
|
|
3151
|
+
toolCalls?: IToolCall[];
|
|
3152
|
+
metadata?: TUniversalMessageMetadata;
|
|
3153
|
+
parts?: TUniversalMessagePart[];
|
|
3154
|
+
state?: TMessageState;
|
|
3155
|
+
}): IAssistantMessage;
|
|
3156
|
+
/** Create a system message. */
|
|
3157
|
+
declare function createSystemMessage(content: string, options?: {
|
|
3158
|
+
name?: string;
|
|
3159
|
+
metadata?: TUniversalMessageMetadata;
|
|
3160
|
+
parts?: TUniversalMessagePart[];
|
|
3161
|
+
}): ISystemMessage;
|
|
3162
|
+
/** Create a tool message. */
|
|
3163
|
+
declare function createToolMessage(content: string, options: {
|
|
3164
|
+
toolCallId: string;
|
|
3165
|
+
name?: string;
|
|
3166
|
+
metadata?: TUniversalMessageMetadata;
|
|
3167
|
+
parts?: TUniversalMessagePart[];
|
|
3168
|
+
}): IToolMessage;
|
|
3169
|
+
|
|
3170
|
+
/** API message format for provider consumption */
|
|
3171
|
+
interface IProviderApiMessage {
|
|
3172
|
+
role: string;
|
|
3173
|
+
content: string | null;
|
|
3174
|
+
tool_calls?: Array<{
|
|
3175
|
+
id: string;
|
|
3176
|
+
type: 'function';
|
|
3177
|
+
function: {
|
|
3178
|
+
name: string;
|
|
3179
|
+
arguments: string;
|
|
3180
|
+
};
|
|
3181
|
+
}>;
|
|
3182
|
+
tool_call_id?: string;
|
|
3183
|
+
}
|
|
3184
|
+
/**
|
|
3185
|
+
* Conversation store with duplicate prevention and API format conversion.
|
|
3186
|
+
* @public
|
|
3187
|
+
*/
|
|
3188
|
+
declare class ConversationStore implements IConversationHistory {
|
|
3189
|
+
private history;
|
|
3190
|
+
private pendingAssistant;
|
|
3191
|
+
constructor(maxMessages?: number);
|
|
3192
|
+
addMessage(message: TUniversalMessage): void;
|
|
3193
|
+
addUserMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3194
|
+
addAssistantMessage(content: string | null, toolCalls?: IToolCall[], metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3195
|
+
addSystemMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3196
|
+
addToolMessage(content: string, toolCallId: string, toolName?: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3197
|
+
addToolMessageWithId(content: string, toolCallId: string, toolName: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3198
|
+
/** Add a raw history entry (events, etc.) */
|
|
3199
|
+
addEntry(entry: IHistoryEntry): void;
|
|
3200
|
+
/** Get all history entries (universal timeline) */
|
|
3201
|
+
getHistory(): IHistoryEntry[];
|
|
3202
|
+
getMessages(): TUniversalMessage[];
|
|
3203
|
+
getMessagesByRole(role: TUniversalMessageRole): TUniversalMessage[];
|
|
3204
|
+
getRecentMessages(count: number): TUniversalMessage[];
|
|
3205
|
+
getMessageCount(): number;
|
|
3206
|
+
/** Begin a new assistant response. Must be called before provider call.
|
|
3207
|
+
* Ensures pendingAssistant exists so commitAssistant always has data to save. */
|
|
3208
|
+
beginAssistant(): void;
|
|
3209
|
+
/** Append streaming text delta to pending assistant response */
|
|
3210
|
+
appendStreaming(delta: string): void;
|
|
3211
|
+
/** Append a tool call to pending assistant response (deduplicates by id) */
|
|
3212
|
+
appendToolCall(toolCall: IToolCall): void;
|
|
3213
|
+
/**
|
|
3214
|
+
* Commit pending assistant response to history.
|
|
3215
|
+
* Precondition: beginAssistant() must have been called before the provider call.
|
|
3216
|
+
* History is append-only — this always adds a message.
|
|
3217
|
+
*/
|
|
3218
|
+
commitAssistant(state: TMessageState, metadata?: TUniversalMessageMetadata): void;
|
|
3219
|
+
/** Discard pending assistant response without saving */
|
|
3220
|
+
discardPending(): void;
|
|
3221
|
+
/** Returns true if there is accumulated pending assistant state (streaming or tool calls) */
|
|
3222
|
+
hasPendingAssistant(): boolean;
|
|
3223
|
+
/** Get pending assistant content (empty string if no content streamed yet) */
|
|
3224
|
+
getPendingContent(): string;
|
|
3225
|
+
getMessagesForAPI(): IProviderApiMessage[];
|
|
3226
|
+
clear(): void;
|
|
3227
|
+
}
|
|
3228
|
+
|
|
3229
|
+
/** Interface for managing conversation history. @public */
|
|
3230
|
+
interface IConversationHistory {
|
|
3231
|
+
addMessage(message: TUniversalMessage): void;
|
|
3232
|
+
addUserMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3233
|
+
addAssistantMessage(content: string | null, toolCalls?: IToolCall[], metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3234
|
+
addSystemMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3235
|
+
addToolMessageWithId(content: string, toolCallId: string, toolName: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3236
|
+
addEntry(entry: IHistoryEntry): void;
|
|
3237
|
+
getHistory(): IHistoryEntry[];
|
|
3238
|
+
getMessages(): TUniversalMessage[];
|
|
3239
|
+
getMessagesByRole(role: TUniversalMessageRole): TUniversalMessage[];
|
|
3240
|
+
getRecentMessages(count: number): TUniversalMessage[];
|
|
3241
|
+
clear(): void;
|
|
3242
|
+
getMessageCount(): number;
|
|
3243
|
+
}
|
|
3244
|
+
/** Configuration options for ConversationHistory manager */
|
|
3245
|
+
interface IConversationHistoryOptions {
|
|
3246
|
+
maxMessagesPerConversation?: number;
|
|
3247
|
+
maxConversations?: number;
|
|
3248
|
+
}
|
|
3249
|
+
/** Multi-session conversation history manager. @public */
|
|
3250
|
+
declare class ConversationHistory {
|
|
3251
|
+
private conversations;
|
|
3252
|
+
private logger;
|
|
3253
|
+
private readonly maxMessagesPerConversation;
|
|
3254
|
+
private readonly maxConversations;
|
|
3255
|
+
constructor(options?: IConversationHistoryOptions);
|
|
3256
|
+
getConversationStore(conversationId: string): ConversationStore;
|
|
3257
|
+
hasConversation(conversationId: string): boolean;
|
|
3258
|
+
removeConversation(conversationId: string): boolean;
|
|
3259
|
+
clearAll(): void;
|
|
3260
|
+
getStats(): {
|
|
3261
|
+
totalConversations: number;
|
|
3262
|
+
conversationIds: string[];
|
|
3263
|
+
totalMessages: number;
|
|
3264
|
+
};
|
|
3265
|
+
/** @internal */
|
|
3266
|
+
private cleanupOldConversations;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
2922
3269
|
/**
|
|
2923
3270
|
* Local executor that directly delegates to AI provider instances
|
|
2924
3271
|
*
|
|
@@ -3047,7 +3394,6 @@ interface IEventEmitterHierarchicalEventData extends IEventEmitterEventData {
|
|
|
3047
3394
|
actualResult?: IToolResult;
|
|
3048
3395
|
};
|
|
3049
3396
|
}
|
|
3050
|
-
|
|
3051
3397
|
/** Event emitter configuration */
|
|
3052
3398
|
interface IEventEmitterPluginOptions extends IPluginOptions {
|
|
3053
3399
|
events?: TEventName[];
|
|
@@ -3104,17 +3450,49 @@ declare class EventEmitterPlugin extends AbstractPlugin<IEventEmitterPluginOptio
|
|
|
3104
3450
|
off(eventType: TEventName, handlerIdOrListener: string | TEventEmitterListener): boolean;
|
|
3105
3451
|
emit(eventType: TEventName, eventData?: Partial<IEventEmitterEventData>): Promise<void>;
|
|
3106
3452
|
private processEvent;
|
|
3107
|
-
private executeHandler;
|
|
3108
3453
|
flushBuffer(): Promise<void>;
|
|
3109
3454
|
getStats(): IEventEmitterPluginStats;
|
|
3110
3455
|
clearAllListeners(): void;
|
|
3111
3456
|
destroy(): Promise<void>;
|
|
3112
|
-
private validateOptions;
|
|
3113
3457
|
}
|
|
3114
3458
|
|
|
3459
|
+
/**
|
|
3460
|
+
* Configuration and tool management delegate for the Robota agent.
|
|
3461
|
+
*
|
|
3462
|
+
* Extracted from robota.ts to keep the main class under 300 lines.
|
|
3463
|
+
*/
|
|
3464
|
+
|
|
3115
3465
|
/** Agent statistics metadata type */
|
|
3116
3466
|
type TAgentStatsMetadata = Record<string, string | number | boolean | Date | string[]>;
|
|
3117
3467
|
|
|
3468
|
+
/** Shared model configuration shape used in setModel / getModel. */
|
|
3469
|
+
type TModelConfig = {
|
|
3470
|
+
provider: string;
|
|
3471
|
+
model: string;
|
|
3472
|
+
temperature?: number;
|
|
3473
|
+
maxTokens?: number;
|
|
3474
|
+
topP?: number;
|
|
3475
|
+
systemMessage?: string;
|
|
3476
|
+
};
|
|
3477
|
+
/** Return shape of getConfiguration(). */
|
|
3478
|
+
type TConfigurationSnapshot = {
|
|
3479
|
+
version: number;
|
|
3480
|
+
tools: Array<{
|
|
3481
|
+
name: string;
|
|
3482
|
+
parameters?: string[];
|
|
3483
|
+
}>;
|
|
3484
|
+
updatedAt: number;
|
|
3485
|
+
};
|
|
3486
|
+
/** Return shape of getModuleStats(). */
|
|
3487
|
+
type TModuleStats = {
|
|
3488
|
+
totalExecutions: number;
|
|
3489
|
+
successfulExecutions: number;
|
|
3490
|
+
failedExecutions: number;
|
|
3491
|
+
averageExecutionTime: number;
|
|
3492
|
+
lastExecutionTime?: Date;
|
|
3493
|
+
} | undefined;
|
|
3494
|
+
/** Shorthand for the plugin contract type used throughout this class. */
|
|
3495
|
+
type TPlugin = IPluginContract<IPluginOptions, IPluginStats> & IPluginHooks;
|
|
3118
3496
|
/**
|
|
3119
3497
|
* Core AI agent integrating multiple AI providers, tools, and plugins
|
|
3120
3498
|
* into a unified conversational interface.
|
|
@@ -3144,50 +3522,33 @@ declare class Robota extends AbstractAgent<IAgentConfig, IRunOptions, TUniversal
|
|
|
3144
3522
|
private pluginManager;
|
|
3145
3523
|
private configManager;
|
|
3146
3524
|
constructor(config: IAgentConfig);
|
|
3147
|
-
private initDelegates;
|
|
3148
|
-
private emitCreatedEvent;
|
|
3149
3525
|
run(input: string, options?: IRunOptions): Promise<string>;
|
|
3150
3526
|
runStream(input: string, options?: IRunOptions): AsyncGenerator<string, void, undefined>;
|
|
3151
3527
|
private executionDeps;
|
|
3152
3528
|
getHistory(): TUniversalMessage[];
|
|
3529
|
+
getFullHistory(): IHistoryEntry[];
|
|
3530
|
+
addHistoryEntry(entry: IHistoryEntry): void;
|
|
3153
3531
|
clearHistory(): void;
|
|
3532
|
+
injectMessage(role: 'user' | 'assistant' | 'system' | 'tool', content: string, options?: {
|
|
3533
|
+
toolCallId?: string;
|
|
3534
|
+
name?: string;
|
|
3535
|
+
}): void;
|
|
3154
3536
|
updateTools(next: Array<IToolWithEventService>): Promise<{
|
|
3155
3537
|
version: number;
|
|
3156
3538
|
}>;
|
|
3157
3539
|
updateConfiguration(patch: Partial<IAgentConfig>): Promise<{
|
|
3158
3540
|
version: number;
|
|
3159
3541
|
}>;
|
|
3160
|
-
getConfiguration(): Promise<
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
name: string;
|
|
3164
|
-
parameters?: string[];
|
|
3165
|
-
}>;
|
|
3166
|
-
updatedAt: number;
|
|
3167
|
-
}>;
|
|
3168
|
-
setModel(mc: {
|
|
3169
|
-
provider: string;
|
|
3170
|
-
model: string;
|
|
3171
|
-
temperature?: number;
|
|
3172
|
-
maxTokens?: number;
|
|
3173
|
-
topP?: number;
|
|
3174
|
-
systemMessage?: string;
|
|
3175
|
-
}): void;
|
|
3176
|
-
getModel(): {
|
|
3177
|
-
provider: string;
|
|
3178
|
-
model: string;
|
|
3179
|
-
temperature?: number;
|
|
3180
|
-
maxTokens?: number;
|
|
3181
|
-
topP?: number;
|
|
3182
|
-
systemMessage?: string;
|
|
3183
|
-
};
|
|
3542
|
+
getConfiguration(): Promise<TConfigurationSnapshot>;
|
|
3543
|
+
setModel(mc: TModelConfig): void;
|
|
3544
|
+
getModel(): TModelConfig;
|
|
3184
3545
|
registerTool(tool: AbstractTool): void;
|
|
3185
3546
|
unregisterTool(toolName: string): void;
|
|
3186
3547
|
getConfig(): IAgentConfig;
|
|
3187
|
-
addPlugin(plugin:
|
|
3548
|
+
addPlugin(plugin: TPlugin): void;
|
|
3188
3549
|
removePlugin(pluginName: string): boolean;
|
|
3189
|
-
getPlugin(pluginName: string):
|
|
3190
|
-
getPlugins():
|
|
3550
|
+
getPlugin(pluginName: string): TPlugin | undefined;
|
|
3551
|
+
getPlugins(): TPlugin[];
|
|
3191
3552
|
getPluginNames(): string[];
|
|
3192
3553
|
registerModule(module: IModule, options?: {
|
|
3193
3554
|
autoInitialize?: boolean;
|
|
@@ -3210,13 +3571,7 @@ declare class Robota extends AbstractAgent<IAgentConfig, IRunOptions, TUniversal
|
|
|
3210
3571
|
error?: Error;
|
|
3211
3572
|
duration?: number;
|
|
3212
3573
|
}>;
|
|
3213
|
-
getModuleStats(moduleName: string):
|
|
3214
|
-
totalExecutions: number;
|
|
3215
|
-
successfulExecutions: number;
|
|
3216
|
-
failedExecutions: number;
|
|
3217
|
-
averageExecutionTime: number;
|
|
3218
|
-
lastExecutionTime?: Date;
|
|
3219
|
-
} | undefined;
|
|
3574
|
+
getModuleStats(moduleName: string): TModuleStats;
|
|
3220
3575
|
getStats(): {
|
|
3221
3576
|
name: string;
|
|
3222
3577
|
version: string;
|
|
@@ -3235,7 +3590,6 @@ declare class Robota extends AbstractAgent<IAgentConfig, IRunOptions, TUniversal
|
|
|
3235
3590
|
private ensureFullyInitialized;
|
|
3236
3591
|
private doAsyncInit;
|
|
3237
3592
|
private emitAgentEvent;
|
|
3238
|
-
private buildOwnerPath;
|
|
3239
3593
|
}
|
|
3240
3594
|
|
|
3241
3595
|
/**
|
|
@@ -3356,6 +3710,7 @@ interface IAgentLifecycleEvents {
|
|
|
3356
3710
|
/** Called when agent is destroyed */
|
|
3357
3711
|
onDestroy?: (agentId: string) => Promise<void> | void;
|
|
3358
3712
|
}
|
|
3713
|
+
|
|
3359
3714
|
/**
|
|
3360
3715
|
* Agent Factory for creating and managing agents
|
|
3361
3716
|
* Instance-based for isolated agent factory management
|
|
@@ -3429,97 +3784,18 @@ declare class AgentFactory {
|
|
|
3429
3784
|
isValid: boolean;
|
|
3430
3785
|
errors: string[];
|
|
3431
3786
|
};
|
|
3432
|
-
/**
|
|
3433
|
-
* Apply default configuration values
|
|
3434
|
-
*/
|
|
3435
|
-
private applyDefaults;
|
|
3436
|
-
/**
|
|
3437
|
-
* Generate unique agent ID
|
|
3438
|
-
*/
|
|
3439
|
-
private generateAgentId;
|
|
3440
|
-
/**
|
|
3441
|
-
* Update creation statistics
|
|
3442
|
-
*/
|
|
3443
|
-
private updateCreationStats;
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
/**
|
|
3447
|
-
* Conversation session implementations.
|
|
3448
|
-
*
|
|
3449
|
-
* Extracted from conversation-history-manager.ts.
|
|
3450
|
-
*/
|
|
3451
|
-
|
|
3452
|
-
/** API message format for provider consumption */
|
|
3453
|
-
interface IProviderApiMessage {
|
|
3454
|
-
role: string;
|
|
3455
|
-
content: string | null;
|
|
3456
|
-
tool_calls?: Array<{
|
|
3457
|
-
id: string;
|
|
3458
|
-
type: 'function';
|
|
3459
|
-
function: {
|
|
3460
|
-
name: string;
|
|
3461
|
-
arguments: string;
|
|
3462
|
-
};
|
|
3463
|
-
}>;
|
|
3464
|
-
tool_call_id?: string;
|
|
3465
|
-
}
|
|
3466
|
-
/**
|
|
3467
|
-
* Conversation session with duplicate prevention and API format conversion.
|
|
3468
|
-
* @public
|
|
3469
|
-
*/
|
|
3470
|
-
declare class ConversationSession implements IConversationHistory {
|
|
3471
|
-
private history;
|
|
3472
|
-
private toolCallIds;
|
|
3473
|
-
constructor(maxMessages?: number);
|
|
3474
|
-
addMessage(message: TUniversalMessage): void;
|
|
3475
|
-
addUserMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3476
|
-
addAssistantMessage(content: string | null, toolCalls?: IToolCall[], metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3477
|
-
addSystemMessage(content: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3478
|
-
addToolMessage(content: string, toolCallId: string, toolName?: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3479
|
-
addToolMessageWithId(content: string, toolCallId: string, toolName: string, metadata?: TUniversalMessageMetadata, parts?: TUniversalMessagePart[]): void;
|
|
3480
|
-
getMessages(): TUniversalMessage[];
|
|
3481
|
-
getMessagesByRole(role: TUniversalMessageRole): TUniversalMessage[];
|
|
3482
|
-
getRecentMessages(count: number): TUniversalMessage[];
|
|
3483
|
-
getMessageCount(): number;
|
|
3484
|
-
getMessagesForAPI(): IProviderApiMessage[];
|
|
3485
|
-
clear(): void;
|
|
3486
3787
|
}
|
|
3487
3788
|
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
getMessages(): TUniversalMessage[];
|
|
3496
|
-
getMessagesByRole(role: TUniversalMessageRole): TUniversalMessage[];
|
|
3497
|
-
getRecentMessages(count: number): TUniversalMessage[];
|
|
3498
|
-
clear(): void;
|
|
3499
|
-
getMessageCount(): number;
|
|
3500
|
-
}
|
|
3501
|
-
/** Configuration options for ConversationHistory manager */
|
|
3502
|
-
interface IConversationHistoryOptions {
|
|
3503
|
-
maxMessagesPerConversation?: number;
|
|
3504
|
-
maxConversations?: number;
|
|
3505
|
-
}
|
|
3506
|
-
/** Multi-session conversation history manager. @public */
|
|
3507
|
-
declare class ConversationHistory {
|
|
3508
|
-
private conversations;
|
|
3509
|
-
private logger;
|
|
3510
|
-
private readonly maxMessagesPerConversation;
|
|
3511
|
-
private readonly maxConversations;
|
|
3512
|
-
constructor(options?: IConversationHistoryOptions);
|
|
3513
|
-
getConversationSession(conversationId: string): ConversationSession;
|
|
3514
|
-
hasConversation(conversationId: string): boolean;
|
|
3515
|
-
removeConversation(conversationId: string): boolean;
|
|
3516
|
-
clearAll(): void;
|
|
3517
|
-
getStats(): {
|
|
3518
|
-
totalConversations: number;
|
|
3519
|
-
conversationIds: string[];
|
|
3520
|
-
totalMessages: number;
|
|
3789
|
+
interface IAssistantUsageMetadata {
|
|
3790
|
+
inputTokens: number;
|
|
3791
|
+
outputTokens: number;
|
|
3792
|
+
usage: {
|
|
3793
|
+
totalTokens: number;
|
|
3794
|
+
inputTokens: number;
|
|
3795
|
+
outputTokens: number;
|
|
3521
3796
|
};
|
|
3522
3797
|
}
|
|
3798
|
+
declare function collectAssistantUsageMetadata(message: TUniversalMessage): IAssistantUsageMetadata | undefined;
|
|
3523
3799
|
|
|
3524
3800
|
declare class EventHistoryModule implements IEventHistoryModule {
|
|
3525
3801
|
private readonly store;
|
|
@@ -3997,11 +4273,13 @@ interface IExecutionProxyConfig {
|
|
|
3997
4273
|
task?: boolean;
|
|
3998
4274
|
};
|
|
3999
4275
|
}
|
|
4276
|
+
/** Internal target shape for proxy interception */
|
|
4277
|
+
type TExecutionProxyTarget = Record<string, TUniversalValue>;
|
|
4278
|
+
/** Internal args shape for proxy interception */
|
|
4279
|
+
type TExecutionProxyArgs = TUniversalValue[];
|
|
4000
4280
|
/**
|
|
4001
4281
|
* Metadata extractor function type
|
|
4002
4282
|
*/
|
|
4003
|
-
type TExecutionProxyTarget = Record<string, TUniversalValue>;
|
|
4004
|
-
type TExecutionProxyArgs = TUniversalValue[];
|
|
4005
4283
|
type TMetadataExtractor = (target: TExecutionProxyTarget, methodName: string, args: TExecutionProxyArgs) => Record<string, TUniversalValue>;
|
|
4006
4284
|
/**
|
|
4007
4285
|
* Method configuration for proxy
|
|
@@ -4013,6 +4291,7 @@ interface IMethodConfig {
|
|
|
4013
4291
|
extractMetadata?: TMetadataExtractor;
|
|
4014
4292
|
extractResult?: (result: TUniversalValue) => Record<string, TUniversalValue>;
|
|
4015
4293
|
}
|
|
4294
|
+
|
|
4016
4295
|
/**
|
|
4017
4296
|
* ExecutionProxy - Automatic event emission using Proxy pattern
|
|
4018
4297
|
*
|
|
@@ -4129,7 +4408,7 @@ declare function evaluatePermission(toolName: string, toolArgs: TToolArgs, mode:
|
|
|
4129
4408
|
* Permission mode definitions for Robota CLI
|
|
4130
4409
|
*
|
|
4131
4410
|
* Matches Claude Code-compatible permission modes:
|
|
4132
|
-
* - plan: read-only tools only (Read, Glob, Grep auto; Write, Edit, Bash denied)
|
|
4411
|
+
* - plan: read-only tools only (Read, Glob, Grep, WebFetch, WebSearch auto; Write, Edit, Bash denied)
|
|
4133
4412
|
* - default: safe reads auto, writes and bash need approval
|
|
4134
4413
|
* - acceptEdits: reads + writes auto, bash needs approval
|
|
4135
4414
|
* - bypassPermissions: all tools auto
|
|
@@ -4138,7 +4417,7 @@ declare function evaluatePermission(toolName: string, toolArgs: TToolArgs, mode:
|
|
|
4138
4417
|
/**
|
|
4139
4418
|
* Tool names known to the permission system
|
|
4140
4419
|
*/
|
|
4141
|
-
type TKnownToolName = 'Bash' | 'Read' | 'Write' | 'Edit' | 'Glob' | 'Grep';
|
|
4420
|
+
type TKnownToolName = 'Bash' | 'Read' | 'Write' | 'Edit' | 'Glob' | 'Grep' | 'WebFetch' | 'WebSearch';
|
|
4142
4421
|
/**
|
|
4143
4422
|
* Permission mode → tool policy matrix
|
|
4144
4423
|
* Maps each mode to a decision for each known tool.
|
|
@@ -4175,22 +4454,100 @@ interface IContextWindowState {
|
|
|
4175
4454
|
remainingPercentage: number;
|
|
4176
4455
|
}
|
|
4177
4456
|
|
|
4457
|
+
declare const CONTEXT_ESTIMATE_CHARS_PER_TOKEN = 4;
|
|
4458
|
+
interface IContextTokenEstimateOptions {
|
|
4459
|
+
readonly usageFloorTokens?: number;
|
|
4460
|
+
}
|
|
4461
|
+
interface IContextTokenEstimate {
|
|
4462
|
+
readonly usedTokens: number;
|
|
4463
|
+
readonly serializedTokens: number;
|
|
4464
|
+
readonly providerTokens?: number;
|
|
4465
|
+
readonly usageFloorTokens?: number;
|
|
4466
|
+
}
|
|
4467
|
+
declare function estimateSerializedContextTokens(messages: readonly TUniversalMessage[]): number;
|
|
4468
|
+
declare function estimateContextTokensFromMessages(messages: readonly TUniversalMessage[], options?: IContextTokenEstimateOptions): IContextTokenEstimate;
|
|
4469
|
+
|
|
4470
|
+
interface IMessageTokenUsage {
|
|
4471
|
+
readonly inputTokens: number;
|
|
4472
|
+
readonly outputTokens: number;
|
|
4473
|
+
readonly totalTokens?: number;
|
|
4474
|
+
}
|
|
4475
|
+
/** Read normalized provider usage from a universal message when present. */
|
|
4476
|
+
declare function readTokenUsageFromMessage(message: TUniversalMessage): IMessageTokenUsage | undefined;
|
|
4477
|
+
declare function readTokenUsageFromMetadata(metadata: TUniversalMessageMetadata | undefined): IMessageTokenUsage | undefined;
|
|
4478
|
+
|
|
4479
|
+
/**
|
|
4480
|
+
* Claude model definitions — SSOT for model metadata.
|
|
4481
|
+
* Source: https://platform.claude.com/docs/en/about-claude/models/overview
|
|
4482
|
+
*/
|
|
4483
|
+
interface IModelDefinition {
|
|
4484
|
+
/** Human-readable model name */
|
|
4485
|
+
name: string;
|
|
4486
|
+
/** API model identifier */
|
|
4487
|
+
id: string;
|
|
4488
|
+
/** Context window size in tokens */
|
|
4489
|
+
contextWindow: number;
|
|
4490
|
+
/** Maximum output tokens */
|
|
4491
|
+
maxOutput: number;
|
|
4492
|
+
}
|
|
4493
|
+
/**
|
|
4494
|
+
* Known Claude models (4.5+).
|
|
4495
|
+
* Keyed by API model ID for fast lookup.
|
|
4496
|
+
*/
|
|
4497
|
+
declare const CLAUDE_MODELS: Record<string, IModelDefinition>;
|
|
4498
|
+
declare const DEFAULT_CONTEXT_WINDOW = 200000;
|
|
4499
|
+
/** Get context window size for a model ID. Falls back to DEFAULT_CONTEXT_WINDOW. */
|
|
4500
|
+
declare function getModelContextWindow(modelId: string): number;
|
|
4501
|
+
declare const DEFAULT_MAX_OUTPUT = 16384;
|
|
4502
|
+
/** Get max output tokens for a model ID. Falls back to DEFAULT_MAX_OUTPUT. */
|
|
4503
|
+
declare function getModelMaxOutput(modelId: string): number;
|
|
4504
|
+
/** Get human-readable model name for a model ID. Falls back to the ID itself. */
|
|
4505
|
+
declare function getModelName(modelId: string): string;
|
|
4506
|
+
/** Format token count as human-readable (e.g., 200K, 1M, 1.2M). Minimum unit is K. */
|
|
4507
|
+
declare function formatTokenCount(tokens: number): string;
|
|
4508
|
+
|
|
4178
4509
|
/**
|
|
4179
4510
|
* Hook system types — Claude Code compatible event/hook model.
|
|
4180
4511
|
*/
|
|
4181
4512
|
/** Hook lifecycle events */
|
|
4182
|
-
type THookEvent = 'PreToolUse' | 'PostToolUse' | 'SessionStart' | 'Stop' | 'PreCompact' | 'PostCompact';
|
|
4183
|
-
/**
|
|
4184
|
-
|
|
4185
|
-
|
|
4513
|
+
type THookEvent = 'PreToolUse' | 'PostToolUse' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'StopFailure' | 'PreCompact' | 'PostCompact' | 'UserPromptSubmit' | 'SubagentStart' | 'SubagentStop' | 'WorktreeCreate' | 'WorktreeRemove';
|
|
4514
|
+
/** Claude Code compatible session end reasons. */
|
|
4515
|
+
type TSessionEndReason = 'clear' | 'resume' | 'logout' | 'prompt_input_exit' | 'bypass_permissions_disabled' | 'other';
|
|
4516
|
+
/** Command hook — executes a shell command */
|
|
4517
|
+
interface ICommandHookDefinition {
|
|
4186
4518
|
type: 'command';
|
|
4187
4519
|
command: string;
|
|
4520
|
+
timeout?: number;
|
|
4521
|
+
}
|
|
4522
|
+
/** HTTP hook — sends an HTTP request */
|
|
4523
|
+
interface IHttpHookDefinition {
|
|
4524
|
+
type: 'http';
|
|
4525
|
+
url: string;
|
|
4526
|
+
headers?: Record<string, string>;
|
|
4527
|
+
timeout?: number;
|
|
4188
4528
|
}
|
|
4529
|
+
/** Prompt hook — evaluates a prompt via an AI model */
|
|
4530
|
+
interface IPromptHookDefinition {
|
|
4531
|
+
type: 'prompt';
|
|
4532
|
+
prompt: string;
|
|
4533
|
+
model?: string;
|
|
4534
|
+
}
|
|
4535
|
+
/** Agent hook — delegates to a sub-agent */
|
|
4536
|
+
interface IAgentHookDefinition {
|
|
4537
|
+
type: 'agent';
|
|
4538
|
+
agent: string;
|
|
4539
|
+
maxTurns?: number;
|
|
4540
|
+
timeout?: number;
|
|
4541
|
+
}
|
|
4542
|
+
/** Discriminated union of all hook definition types */
|
|
4543
|
+
type IHookDefinition = ICommandHookDefinition | IHttpHookDefinition | IPromptHookDefinition | IAgentHookDefinition;
|
|
4189
4544
|
/** A hook group — matcher + array of hook definitions */
|
|
4190
4545
|
interface IHookGroup {
|
|
4191
4546
|
/** Regex pattern to match tool name (empty string = match all) */
|
|
4192
4547
|
matcher: string;
|
|
4193
4548
|
hooks: IHookDefinition[];
|
|
4549
|
+
/** Environment variables injected into hook child processes for this group */
|
|
4550
|
+
env?: Record<string, string>;
|
|
4194
4551
|
}
|
|
4195
4552
|
/** Complete hooks configuration: event → array of hook groups */
|
|
4196
4553
|
type THooksConfig = Partial<Record<THookEvent, IHookGroup[]>>;
|
|
@@ -4206,6 +4563,28 @@ interface IHookInput {
|
|
|
4206
4563
|
trigger?: 'auto' | 'manual';
|
|
4207
4564
|
/** Compaction summary text (PostCompact only) */
|
|
4208
4565
|
compact_summary?: string;
|
|
4566
|
+
/** User message text (UserPromptSubmit only) */
|
|
4567
|
+
user_message?: string;
|
|
4568
|
+
/** User prompt text — Claude Code compatible alias for user_message (UserPromptSubmit only) */
|
|
4569
|
+
prompt?: string;
|
|
4570
|
+
/** Assistant response text (Stop only) */
|
|
4571
|
+
response?: string;
|
|
4572
|
+
/** Last assistant message text (StopFailure only) */
|
|
4573
|
+
last_assistant_message?: string;
|
|
4574
|
+
/** Stop hook recursion guard (Stop/StopFailure only) */
|
|
4575
|
+
stop_hook_active?: boolean;
|
|
4576
|
+
/** Session end reason (SessionEnd only) */
|
|
4577
|
+
reason?: TSessionEndReason | string;
|
|
4578
|
+
/** Session transcript path when available (SessionEnd/SubagentStop only) */
|
|
4579
|
+
transcript_path?: string;
|
|
4580
|
+
/** Subagent identifier (SubagentStart/SubagentStop only) */
|
|
4581
|
+
agent_id?: string;
|
|
4582
|
+
/** Subagent type/name (SubagentStart/SubagentStop only) */
|
|
4583
|
+
agent_type?: string;
|
|
4584
|
+
/** Subagent transcript path when available (SubagentStop only) */
|
|
4585
|
+
agent_transcript_path?: string;
|
|
4586
|
+
/** Additional environment variables to pass to hook child processes */
|
|
4587
|
+
env?: Record<string, string>;
|
|
4209
4588
|
}
|
|
4210
4589
|
/** Hook execution result */
|
|
4211
4590
|
interface IHookResult {
|
|
@@ -4214,11 +4593,21 @@ interface IHookResult {
|
|
|
4214
4593
|
stdout: string;
|
|
4215
4594
|
stderr: string;
|
|
4216
4595
|
}
|
|
4596
|
+
/** Strategy interface for hook type executors */
|
|
4597
|
+
interface IHookTypeExecutor {
|
|
4598
|
+
/** The hook type this executor handles */
|
|
4599
|
+
type: IHookDefinition['type'];
|
|
4600
|
+
/** Execute a hook definition with the given input */
|
|
4601
|
+
execute(definition: IHookDefinition, input: IHookInput): Promise<IHookResult>;
|
|
4602
|
+
}
|
|
4217
4603
|
|
|
4218
4604
|
/**
|
|
4219
|
-
* Hook runner — executes
|
|
4605
|
+
* Hook runner — executes hooks for lifecycle events using the strategy pattern.
|
|
4606
|
+
*
|
|
4607
|
+
* Dispatches to registered IHookTypeExecutor implementations by definition type.
|
|
4608
|
+
* Default executors: CommandExecutor (shell), HttpExecutor (HTTP POST).
|
|
4220
4609
|
*
|
|
4221
|
-
*
|
|
4610
|
+
* Exit code semantics:
|
|
4222
4611
|
* - 0: allow/proceed
|
|
4223
4612
|
* - 2: block/deny (stderr contains reason)
|
|
4224
4613
|
* - other: proceed (logged as warning)
|
|
@@ -4229,10 +4618,19 @@ interface IHookResult {
|
|
|
4229
4618
|
*
|
|
4230
4619
|
* For PreToolUse: if any hook returns exit code 2, the tool call is blocked.
|
|
4231
4620
|
* Returns { blocked: true, reason: string } if blocked, { blocked: false } otherwise.
|
|
4621
|
+
*
|
|
4622
|
+
* @param config - Hooks configuration mapping events to hook groups
|
|
4623
|
+
* @param event - The lifecycle event being fired
|
|
4624
|
+
* @param input - Hook input data passed to executors
|
|
4625
|
+
* @param executors - Optional array of hook type executors (defaults to command + http)
|
|
4232
4626
|
*/
|
|
4233
|
-
|
|
4627
|
+
/** Result of running hooks for an event. */
|
|
4628
|
+
interface IRunHooksResult {
|
|
4234
4629
|
blocked: boolean;
|
|
4235
4630
|
reason?: string;
|
|
4236
|
-
|
|
4631
|
+
/** Collected stdout from all successful hooks (exit code 0). */
|
|
4632
|
+
stdout: string;
|
|
4633
|
+
}
|
|
4634
|
+
declare function runHooks(config: THooksConfig | undefined, event: THookEvent, input: IHookInput, executors?: IHookTypeExecutor[]): Promise<IRunHooksResult>;
|
|
4237
4635
|
|
|
4238
|
-
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConversationHistory,
|
|
4636
|
+
export { AGENT_EVENTS, AGENT_EVENT_PREFIX, AbstractAIProvider, AbstractAgent, AbstractEventService, AbstractExecutor, AbstractManager, AbstractPlugin, AbstractTool, AgentFactory, AgentTemplates, AuthenticationError, CLAUDE_MODELS, CONTEXT_ESTIMATE_CHARS_PER_TOKEN, CacheIntegrityError, CircuitBreakerOpenError, ConfigurationError, ConsoleLogger, 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 IContextTokenEstimate, type IContextTokenEstimateOptions, 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 IMessageTokenUsage, 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 IProviderCapabilities, type IProviderConfig$1 as IProviderConfig, type IProviderCredentialRequirement, type IProviderDefinition, type IProviderFunctionCallingCapability, type IProviderMediaError, type IProviderModelCatalog, type IProviderModelCatalogEntry, type IProviderModelCatalogRefreshOptions, type IProviderNativeRawPayloadEvent, type IProviderNativeWebToolCapabilities, type IProviderNativeWebToolCapability, type IProviderNativeWebToolRequest, type IProviderOptions, type IProviderProbeResult, type IProviderProfileConfig, type IProviderProfileDefaults, type IProviderRequest, type IProviderSetupHelpLink, 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 TExecutionEventCallback, type TExecutionEventData, 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 TProviderCredentialField, type TProviderLoggingData, type TProviderMediaResult, type TProviderMessage, type TProviderModelCapability, type TProviderModelCatalogRefresh, type TProviderModelCatalogStatus, type TProviderModelLifecycle, type TProviderNativeRawPayload, type TProviderNativeRawPayloadCallback, type TProviderNativeRawPayloadKind, type TProviderOptionValueBase, type TProviderSetupField, type TProviderSetupHelpLinkKind, 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, TypeUtils, UNKNOWN_TOOL_FALLBACK, USER_EVENTS, USER_EVENT_PREFIX, ValidationError, ValidationSeverity, Validator, assertProviderNativeWebToolsAvailable, bindEventServiceOwner, bindWithOwnerPath, chatEntryToMessage, collectAssistantUsageMetadata, composeEventName, createAssistantMessage, createDefaultProviderCapabilities, createExecutionProxy, createLogger, createSystemMessage, createToolMessage, createUserMessage, estimateContextTokensFromMessages, estimateSerializedContextTokens, evaluatePermission, findProviderDefinition, formatSupportedProviderTypes, formatTokenCount, getGlobalLogLevel, getMessagesForAPI, getModelContextWindow, getModelMaxOutput, getModelName, getProviderCapabilities, getProviderCredentialRequirement, getToolEstimatedDuration, getToolExecutionSteps, isAssistantMessage, isChatEntry, isDefaultEventService, isImageGenerationProvider, isProgressReportingTool, isSystemMessage, isToolMessage, isUserMessage, isVideoGenerationProvider, logger, messageToHistoryEntry, readTokenUsageFromMessage, readTokenUsageFromMetadata, runHooks, setGlobalLogLevel, setToolProgressCallback, startPeriodicTask, stopPeriodicTask, validateAgentConfig, validateApiKey, validateModelName, validateProviderName, validateUserInput, withEventEmission };
|