@robota-sdk/agent-core 3.0.0-beta.1
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 +180 -0
- package/LICENSE +21 -0
- package/README.md +230 -0
- package/dist/abstracts/abstract-agent.d.ts +56 -0
- package/dist/abstracts/abstract-agent.d.ts.map +1 -0
- package/dist/abstracts/abstract-agent.js +55 -0
- package/dist/abstracts/abstract-agent.js.map +1 -0
- package/dist/abstracts/abstract-ai-provider.d.ts +187 -0
- package/dist/abstracts/abstract-ai-provider.d.ts.map +1 -0
- package/dist/abstracts/abstract-ai-provider.js +252 -0
- package/dist/abstracts/abstract-ai-provider.js.map +1 -0
- package/dist/abstracts/abstract-executor.d.ts +110 -0
- package/dist/abstracts/abstract-executor.d.ts.map +1 -0
- package/dist/abstracts/abstract-executor.js +156 -0
- package/dist/abstracts/abstract-executor.js.map +1 -0
- package/dist/abstracts/abstract-manager.d.ts +42 -0
- package/dist/abstracts/abstract-manager.d.ts.map +1 -0
- package/dist/abstracts/abstract-manager.js +49 -0
- package/dist/abstracts/abstract-manager.js.map +1 -0
- package/dist/abstracts/abstract-module.d.ts +365 -0
- package/dist/abstracts/abstract-module.d.ts.map +1 -0
- package/dist/abstracts/abstract-module.js +474 -0
- package/dist/abstracts/abstract-module.js.map +1 -0
- package/dist/abstracts/abstract-plugin.d.ts +369 -0
- package/dist/abstracts/abstract-plugin.d.ts.map +1 -0
- package/dist/abstracts/abstract-plugin.js +258 -0
- package/dist/abstracts/abstract-plugin.js.map +1 -0
- package/dist/abstracts/abstract-tool.d.ts +175 -0
- package/dist/abstracts/abstract-tool.d.ts.map +1 -0
- package/dist/abstracts/abstract-tool.js +140 -0
- package/dist/abstracts/abstract-tool.js.map +1 -0
- package/dist/abstracts/abstract-workflow-converter.d.ts +136 -0
- package/dist/abstracts/abstract-workflow-converter.d.ts.map +1 -0
- package/dist/abstracts/abstract-workflow-converter.js +252 -0
- package/dist/abstracts/abstract-workflow-converter.js.map +1 -0
- package/dist/abstracts/abstract-workflow-validator.d.ts +203 -0
- package/dist/abstracts/abstract-workflow-validator.d.ts.map +1 -0
- package/dist/abstracts/abstract-workflow-validator.js +447 -0
- package/dist/abstracts/abstract-workflow-validator.js.map +1 -0
- package/dist/abstracts/index.d.ts +6 -0
- package/dist/abstracts/index.d.ts.map +1 -0
- package/dist/abstracts/index.js +9 -0
- package/dist/abstracts/index.js.map +1 -0
- package/dist/agents/constants.d.ts +23 -0
- package/dist/agents/constants.d.ts.map +1 -0
- package/dist/agents/constants.js +22 -0
- package/dist/agents/constants.js.map +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +4 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/robota.test.d.ts +2 -0
- package/dist/agents/robota.test.d.ts.map +1 -0
- package/dist/agents/robota.test.js +416 -0
- package/dist/agents/robota.test.js.map +1 -0
- package/dist/browser/builtin-templates.json +107 -0
- package/dist/browser/index.d.ts +4237 -0
- package/dist/browser/index.js +4 -0
- package/dist/core/robota.d.ts +694 -0
- package/dist/core/robota.d.ts.map +1 -0
- package/dist/core/robota.js +1277 -0
- package/dist/core/robota.js.map +1 -0
- package/dist/executors/local-executor.d.ts +96 -0
- package/dist/executors/local-executor.d.ts.map +1 -0
- package/dist/executors/local-executor.js +197 -0
- package/dist/executors/local-executor.js.map +1 -0
- package/dist/executors/local-executor.test.d.ts +2 -0
- package/dist/executors/local-executor.test.d.ts.map +1 -0
- package/dist/executors/local-executor.test.js +192 -0
- package/dist/executors/local-executor.test.js.map +1 -0
- package/dist/index.d.ts +274 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +235 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/agent.d.ts +198 -0
- package/dist/interfaces/agent.d.ts.map +1 -0
- package/dist/interfaces/agent.js +2 -0
- package/dist/interfaces/agent.js.map +1 -0
- package/dist/interfaces/event-service.d.ts +79 -0
- package/dist/interfaces/event-service.d.ts.map +1 -0
- package/dist/interfaces/event-service.js +2 -0
- package/dist/interfaces/event-service.js.map +1 -0
- package/dist/interfaces/executor.d.ts +128 -0
- package/dist/interfaces/executor.d.ts.map +1 -0
- package/dist/interfaces/executor.js +2 -0
- package/dist/interfaces/executor.js.map +1 -0
- package/dist/interfaces/history-module.d.ts +19 -0
- package/dist/interfaces/history-module.d.ts.map +1 -0
- package/dist/interfaces/history-module.js +2 -0
- package/dist/interfaces/history-module.js.map +1 -0
- package/dist/interfaces/index.d.ts +13 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +4 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/manager.d.ts +142 -0
- package/dist/interfaces/manager.d.ts.map +1 -0
- package/dist/interfaces/manager.js +2 -0
- package/dist/interfaces/manager.js.map +1 -0
- package/dist/interfaces/messages.d.ts +75 -0
- package/dist/interfaces/messages.d.ts.map +1 -0
- package/dist/interfaces/messages.js +29 -0
- package/dist/interfaces/messages.js.map +1 -0
- package/dist/interfaces/progress-reporting.d.ts +86 -0
- package/dist/interfaces/progress-reporting.d.ts.map +1 -0
- package/dist/interfaces/progress-reporting.js +37 -0
- package/dist/interfaces/progress-reporting.js.map +1 -0
- package/dist/interfaces/provider.d.ts +217 -0
- package/dist/interfaces/provider.d.ts.map +1 -0
- package/dist/interfaces/provider.js +2 -0
- package/dist/interfaces/provider.js.map +1 -0
- package/dist/interfaces/service.d.ts +205 -0
- package/dist/interfaces/service.d.ts.map +1 -0
- package/dist/interfaces/service.js +6 -0
- package/dist/interfaces/service.js.map +1 -0
- package/dist/interfaces/tool.d.ts +248 -0
- package/dist/interfaces/tool.d.ts.map +1 -0
- package/dist/interfaces/tool.js +2 -0
- package/dist/interfaces/tool.js.map +1 -0
- package/dist/interfaces/types.d.ts +71 -0
- package/dist/interfaces/types.d.ts.map +1 -0
- package/dist/interfaces/types.js +33 -0
- package/dist/interfaces/types.js.map +1 -0
- package/dist/interfaces/workflow-converter.d.ts +193 -0
- package/dist/interfaces/workflow-converter.d.ts.map +1 -0
- package/dist/interfaces/workflow-converter.js +11 -0
- package/dist/interfaces/workflow-converter.js.map +1 -0
- package/dist/interfaces/workflow-validator.d.ts +209 -0
- package/dist/interfaces/workflow-validator.d.ts.map +1 -0
- package/dist/interfaces/workflow-validator.js +16 -0
- package/dist/interfaces/workflow-validator.js.map +1 -0
- package/dist/managers/agent-factory.d.ts +132 -0
- package/dist/managers/agent-factory.d.ts.map +1 -0
- package/dist/managers/agent-factory.js +284 -0
- package/dist/managers/agent-factory.js.map +1 -0
- package/dist/managers/agent-factory.test.d.ts +2 -0
- package/dist/managers/agent-factory.test.d.ts.map +1 -0
- package/dist/managers/agent-factory.test.js +249 -0
- package/dist/managers/agent-factory.test.js.map +1 -0
- package/dist/managers/agent-templates.d.ts +84 -0
- package/dist/managers/agent-templates.d.ts.map +1 -0
- package/dist/managers/agent-templates.js +159 -0
- package/dist/managers/agent-templates.js.map +1 -0
- package/dist/managers/ai-provider-manager.d.ts +80 -0
- package/dist/managers/ai-provider-manager.d.ts.map +1 -0
- package/dist/managers/ai-provider-manager.js +226 -0
- package/dist/managers/ai-provider-manager.js.map +1 -0
- package/dist/managers/conversation-history-manager.d.ts +455 -0
- package/dist/managers/conversation-history-manager.d.ts.map +1 -0
- package/dist/managers/conversation-history-manager.js +578 -0
- package/dist/managers/conversation-history-manager.js.map +1 -0
- package/dist/managers/conversation-history-manager.test.d.ts +2 -0
- package/dist/managers/conversation-history-manager.test.d.ts.map +1 -0
- package/dist/managers/conversation-history-manager.test.js +374 -0
- package/dist/managers/conversation-history-manager.test.js.map +1 -0
- package/dist/managers/index.d.ts +8 -0
- package/dist/managers/index.d.ts.map +1 -0
- package/dist/managers/index.js +8 -0
- package/dist/managers/index.js.map +1 -0
- package/dist/managers/module-registry.d.ts +161 -0
- package/dist/managers/module-registry.d.ts.map +1 -0
- package/dist/managers/module-registry.js +519 -0
- package/dist/managers/module-registry.js.map +1 -0
- package/dist/managers/module-type-registry.d.ts +113 -0
- package/dist/managers/module-type-registry.d.ts.map +1 -0
- package/dist/managers/module-type-registry.js +439 -0
- package/dist/managers/module-type-registry.js.map +1 -0
- package/dist/managers/plugins.d.ts +166 -0
- package/dist/managers/plugins.d.ts.map +1 -0
- package/dist/managers/plugins.js +339 -0
- package/dist/managers/plugins.js.map +1 -0
- package/dist/managers/tool-manager.d.ts +70 -0
- package/dist/managers/tool-manager.d.ts.map +1 -0
- package/dist/managers/tool-manager.js +138 -0
- package/dist/managers/tool-manager.js.map +1 -0
- package/dist/managers/tool-manager.test.d.ts +2 -0
- package/dist/managers/tool-manager.test.d.ts.map +1 -0
- package/dist/managers/tool-manager.test.js +186 -0
- package/dist/managers/tool-manager.test.js.map +1 -0
- package/dist/node/builtin-templates.json +107 -0
- package/dist/node/index.cjs +4 -0
- package/dist/node/index.d.cts +4237 -0
- package/dist/node/index.d.ts +4237 -0
- package/dist/node/index.js +4 -0
- package/dist/plugins/conversation-history/conversation-history-plugin.d.ts +67 -0
- package/dist/plugins/conversation-history/conversation-history-plugin.d.ts.map +1 -0
- package/dist/plugins/conversation-history/conversation-history-plugin.js +270 -0
- package/dist/plugins/conversation-history/conversation-history-plugin.js.map +1 -0
- package/dist/plugins/conversation-history/index.d.ts +3 -0
- package/dist/plugins/conversation-history/index.d.ts.map +1 -0
- package/dist/plugins/conversation-history/index.js +2 -0
- package/dist/plugins/conversation-history/index.js.map +1 -0
- package/dist/plugins/conversation-history/storages/database-storage.d.ts +19 -0
- package/dist/plugins/conversation-history/storages/database-storage.d.ts.map +1 -0
- package/dist/plugins/conversation-history/storages/database-storage.js +94 -0
- package/dist/plugins/conversation-history/storages/database-storage.js.map +1 -0
- package/dist/plugins/conversation-history/storages/file-storage.d.ts +15 -0
- package/dist/plugins/conversation-history/storages/file-storage.d.ts.map +1 -0
- package/dist/plugins/conversation-history/storages/file-storage.js +94 -0
- package/dist/plugins/conversation-history/storages/file-storage.js.map +1 -0
- package/dist/plugins/conversation-history/storages/index.d.ts +4 -0
- package/dist/plugins/conversation-history/storages/index.d.ts.map +1 -0
- package/dist/plugins/conversation-history/storages/index.js +4 -0
- package/dist/plugins/conversation-history/storages/index.js.map +1 -0
- package/dist/plugins/conversation-history/storages/memory-storage.d.ts +15 -0
- package/dist/plugins/conversation-history/storages/memory-storage.d.ts.map +1 -0
- package/dist/plugins/conversation-history/storages/memory-storage.js +33 -0
- package/dist/plugins/conversation-history/storages/memory-storage.js.map +1 -0
- package/dist/plugins/conversation-history/types.d.ts +61 -0
- package/dist/plugins/conversation-history/types.d.ts.map +1 -0
- package/dist/plugins/conversation-history/types.js +2 -0
- package/dist/plugins/conversation-history/types.js.map +1 -0
- package/dist/plugins/error-handling/context-adapter.d.ts +30 -0
- package/dist/plugins/error-handling/context-adapter.d.ts.map +1 -0
- package/dist/plugins/error-handling/context-adapter.js +41 -0
- package/dist/plugins/error-handling/context-adapter.js.map +1 -0
- package/dist/plugins/error-handling/error-handling-plugin.d.ts +49 -0
- package/dist/plugins/error-handling/error-handling-plugin.d.ts.map +1 -0
- package/dist/plugins/error-handling/error-handling-plugin.js +229 -0
- package/dist/plugins/error-handling/error-handling-plugin.js.map +1 -0
- package/dist/plugins/error-handling/index.d.ts +10 -0
- package/dist/plugins/error-handling/index.d.ts.map +1 -0
- package/dist/plugins/error-handling/index.js +10 -0
- package/dist/plugins/error-handling/index.js.map +1 -0
- package/dist/plugins/error-handling/types.d.ts +73 -0
- package/dist/plugins/error-handling/types.d.ts.map +1 -0
- package/dist/plugins/error-handling/types.js +14 -0
- package/dist/plugins/error-handling/types.js.map +1 -0
- package/dist/plugins/event-emitter/metrics.d.ts +17 -0
- package/dist/plugins/event-emitter/metrics.d.ts.map +1 -0
- package/dist/plugins/event-emitter/metrics.js +17 -0
- package/dist/plugins/event-emitter/metrics.js.map +1 -0
- package/dist/plugins/event-emitter/types.d.ts +112 -0
- package/dist/plugins/event-emitter/types.d.ts.map +1 -0
- package/dist/plugins/event-emitter/types.js +65 -0
- package/dist/plugins/event-emitter/types.js.map +1 -0
- package/dist/plugins/event-emitter-plugin.d.ts +222 -0
- package/dist/plugins/event-emitter-plugin.d.ts.map +1 -0
- package/dist/plugins/event-emitter-plugin.js +432 -0
- package/dist/plugins/event-emitter-plugin.js.map +1 -0
- package/dist/plugins/event-emitter-plugin.test.d.ts +2 -0
- package/dist/plugins/event-emitter-plugin.test.d.ts.map +1 -0
- package/dist/plugins/event-emitter-plugin.test.js +94 -0
- package/dist/plugins/event-emitter-plugin.test.js.map +1 -0
- package/dist/plugins/execution/execution-analytics-plugin.d.ts +129 -0
- package/dist/plugins/execution/execution-analytics-plugin.d.ts.map +1 -0
- package/dist/plugins/execution/execution-analytics-plugin.js +517 -0
- package/dist/plugins/execution/execution-analytics-plugin.js.map +1 -0
- package/dist/plugins/execution/index.d.ts +3 -0
- package/dist/plugins/execution/index.d.ts.map +1 -0
- package/dist/plugins/execution/index.js +2 -0
- package/dist/plugins/execution/index.js.map +1 -0
- package/dist/plugins/execution/types.d.ts +90 -0
- package/dist/plugins/execution/types.d.ts.map +1 -0
- package/dist/plugins/execution/types.js +2 -0
- package/dist/plugins/execution/types.js.map +1 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +11 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/limits/types.d.ts +61 -0
- package/dist/plugins/limits/types.d.ts.map +1 -0
- package/dist/plugins/limits/types.js +2 -0
- package/dist/plugins/limits/types.js.map +1 -0
- package/dist/plugins/limits-plugin.d.ts +113 -0
- package/dist/plugins/limits-plugin.d.ts.map +1 -0
- package/dist/plugins/limits-plugin.js +380 -0
- package/dist/plugins/limits-plugin.js.map +1 -0
- package/dist/plugins/logging/formatters.d.ts +14 -0
- package/dist/plugins/logging/formatters.d.ts.map +1 -0
- package/dist/plugins/logging/formatters.js +24 -0
- package/dist/plugins/logging/formatters.js.map +1 -0
- package/dist/plugins/logging/index.d.ts +3 -0
- package/dist/plugins/logging/index.d.ts.map +1 -0
- package/dist/plugins/logging/index.js +2 -0
- package/dist/plugins/logging/index.js.map +1 -0
- package/dist/plugins/logging/logging-plugin.d.ts +91 -0
- package/dist/plugins/logging/logging-plugin.d.ts.map +1 -0
- package/dist/plugins/logging/logging-plugin.js +335 -0
- package/dist/plugins/logging/logging-plugin.js.map +1 -0
- package/dist/plugins/logging/storages/console-storage.d.ts +14 -0
- package/dist/plugins/logging/storages/console-storage.d.ts.map +1 -0
- package/dist/plugins/logging/storages/console-storage.js +38 -0
- package/dist/plugins/logging/storages/console-storage.js.map +1 -0
- package/dist/plugins/logging/storages/file-storage.d.ts +14 -0
- package/dist/plugins/logging/storages/file-storage.d.ts.map +1 -0
- package/dist/plugins/logging/storages/file-storage.js +41 -0
- package/dist/plugins/logging/storages/file-storage.js.map +1 -0
- package/dist/plugins/logging/storages/index.d.ts +5 -0
- package/dist/plugins/logging/storages/index.d.ts.map +1 -0
- package/dist/plugins/logging/storages/index.js +5 -0
- package/dist/plugins/logging/storages/index.js.map +1 -0
- package/dist/plugins/logging/storages/remote-storage.d.ts +20 -0
- package/dist/plugins/logging/storages/remote-storage.d.ts.map +1 -0
- package/dist/plugins/logging/storages/remote-storage.js +61 -0
- package/dist/plugins/logging/storages/remote-storage.js.map +1 -0
- package/dist/plugins/logging/storages/silent-storage.d.ts +10 -0
- package/dist/plugins/logging/storages/silent-storage.d.ts.map +1 -0
- package/dist/plugins/logging/storages/silent-storage.js +15 -0
- package/dist/plugins/logging/storages/silent-storage.js.map +1 -0
- package/dist/plugins/logging/types.d.ts +84 -0
- package/dist/plugins/logging/types.d.ts.map +1 -0
- package/dist/plugins/logging/types.js +2 -0
- package/dist/plugins/logging/types.js.map +1 -0
- package/dist/plugins/performance/collectors/system-metrics-collector.d.ts +12 -0
- package/dist/plugins/performance/collectors/system-metrics-collector.d.ts.map +1 -0
- package/dist/plugins/performance/collectors/system-metrics-collector.js +65 -0
- package/dist/plugins/performance/collectors/system-metrics-collector.js.map +1 -0
- package/dist/plugins/performance/index.d.ts +5 -0
- package/dist/plugins/performance/index.d.ts.map +1 -0
- package/dist/plugins/performance/index.js +4 -0
- package/dist/plugins/performance/index.js.map +1 -0
- package/dist/plugins/performance/performance-plugin.d.ts +49 -0
- package/dist/plugins/performance/performance-plugin.d.ts.map +1 -0
- package/dist/plugins/performance/performance-plugin.js +293 -0
- package/dist/plugins/performance/performance-plugin.js.map +1 -0
- package/dist/plugins/performance/storages/index.d.ts +2 -0
- package/dist/plugins/performance/storages/index.d.ts.map +1 -0
- package/dist/plugins/performance/storages/index.js +4 -0
- package/dist/plugins/performance/storages/index.js.map +1 -0
- package/dist/plugins/performance/storages/memory-storage.d.ts +19 -0
- package/dist/plugins/performance/storages/memory-storage.d.ts.map +1 -0
- package/dist/plugins/performance/storages/memory-storage.js +69 -0
- package/dist/plugins/performance/storages/memory-storage.js.map +1 -0
- package/dist/plugins/performance/types.d.ts +154 -0
- package/dist/plugins/performance/types.d.ts.map +1 -0
- package/dist/plugins/performance/types.js +2 -0
- package/dist/plugins/performance/types.js.map +1 -0
- package/dist/plugins/usage/aggregate-usage-stats.d.ts +12 -0
- package/dist/plugins/usage/aggregate-usage-stats.d.ts.map +1 -0
- package/dist/plugins/usage/aggregate-usage-stats.js +115 -0
- package/dist/plugins/usage/aggregate-usage-stats.js.map +1 -0
- package/dist/plugins/usage/index.d.ts +5 -0
- package/dist/plugins/usage/index.d.ts.map +1 -0
- package/dist/plugins/usage/index.js +4 -0
- package/dist/plugins/usage/index.js.map +1 -0
- package/dist/plugins/usage/storages/file-storage.d.ts +22 -0
- package/dist/plugins/usage/storages/file-storage.d.ts.map +1 -0
- package/dist/plugins/usage/storages/file-storage.js +111 -0
- package/dist/plugins/usage/storages/file-storage.js.map +1 -0
- package/dist/plugins/usage/storages/index.d.ts +5 -0
- package/dist/plugins/usage/storages/index.d.ts.map +1 -0
- package/dist/plugins/usage/storages/index.js +5 -0
- package/dist/plugins/usage/storages/index.js.map +1 -0
- package/dist/plugins/usage/storages/memory-storage.d.ts +22 -0
- package/dist/plugins/usage/storages/memory-storage.d.ts.map +1 -0
- package/dist/plugins/usage/storages/memory-storage.js +42 -0
- package/dist/plugins/usage/storages/memory-storage.js.map +1 -0
- package/dist/plugins/usage/storages/remote-storage.d.ts +26 -0
- package/dist/plugins/usage/storages/remote-storage.d.ts.map +1 -0
- package/dist/plugins/usage/storages/remote-storage.js +115 -0
- package/dist/plugins/usage/storages/remote-storage.js.map +1 -0
- package/dist/plugins/usage/storages/silent-storage.d.ts +19 -0
- package/dist/plugins/usage/storages/silent-storage.d.ts.map +1 -0
- package/dist/plugins/usage/storages/silent-storage.js +26 -0
- package/dist/plugins/usage/storages/silent-storage.js.map +1 -0
- package/dist/plugins/usage/types.d.ts +127 -0
- package/dist/plugins/usage/types.d.ts.map +1 -0
- package/dist/plugins/usage/types.js +2 -0
- package/dist/plugins/usage/types.js.map +1 -0
- package/dist/plugins/usage/usage-plugin.d.ts +67 -0
- package/dist/plugins/usage/usage-plugin.d.ts.map +1 -0
- package/dist/plugins/usage/usage-plugin.js +309 -0
- package/dist/plugins/usage/usage-plugin.js.map +1 -0
- package/dist/plugins/webhook/http-client.d.ts +30 -0
- package/dist/plugins/webhook/http-client.d.ts.map +1 -0
- package/dist/plugins/webhook/http-client.js +110 -0
- package/dist/plugins/webhook/http-client.js.map +1 -0
- package/dist/plugins/webhook/index.d.ts +9 -0
- package/dist/plugins/webhook/index.d.ts.map +1 -0
- package/dist/plugins/webhook/index.js +9 -0
- package/dist/plugins/webhook/index.js.map +1 -0
- package/dist/plugins/webhook/transformer.d.ts +63 -0
- package/dist/plugins/webhook/transformer.d.ts.map +1 -0
- package/dist/plugins/webhook/transformer.js +157 -0
- package/dist/plugins/webhook/transformer.js.map +1 -0
- package/dist/plugins/webhook/types.d.ts +183 -0
- package/dist/plugins/webhook/types.d.ts.map +1 -0
- package/dist/plugins/webhook/types.js +2 -0
- package/dist/plugins/webhook/types.js.map +1 -0
- package/dist/plugins/webhook/webhook-plugin.d.ts +92 -0
- package/dist/plugins/webhook/webhook-plugin.d.ts.map +1 -0
- package/dist/plugins/webhook/webhook-plugin.js +328 -0
- package/dist/plugins/webhook/webhook-plugin.js.map +1 -0
- package/dist/schemas/agent-template-schema.d.ts +137 -0
- package/dist/schemas/agent-template-schema.d.ts.map +1 -0
- package/dist/schemas/agent-template-schema.js +87 -0
- package/dist/schemas/agent-template-schema.js.map +1 -0
- package/dist/services/conversation-service/index.d.ts +88 -0
- package/dist/services/conversation-service/index.d.ts.map +1 -0
- package/dist/services/conversation-service/index.js +441 -0
- package/dist/services/conversation-service/index.js.map +1 -0
- package/dist/services/conversation-service/types.d.ts +32 -0
- package/dist/services/conversation-service/types.d.ts.map +1 -0
- package/dist/services/conversation-service/types.js +8 -0
- package/dist/services/conversation-service/types.js.map +1 -0
- package/dist/services/event-service.d.ts +61 -0
- package/dist/services/event-service.d.ts.map +1 -0
- package/dist/services/event-service.js +110 -0
- package/dist/services/event-service.js.map +1 -0
- package/dist/services/event-service.test.d.ts +2 -0
- package/dist/services/event-service.test.d.ts.map +1 -0
- package/dist/services/event-service.test.js +86 -0
- package/dist/services/event-service.test.js.map +1 -0
- package/dist/services/execution-service.d.ts +151 -0
- package/dist/services/execution-service.d.ts.map +1 -0
- package/dist/services/execution-service.js +1262 -0
- package/dist/services/execution-service.js.map +1 -0
- package/dist/services/execution-service.test.d.ts +2 -0
- package/dist/services/execution-service.test.d.ts.map +1 -0
- package/dist/services/execution-service.test.js +338 -0
- package/dist/services/execution-service.test.js.map +1 -0
- package/dist/services/history-module.d.ts +15 -0
- package/dist/services/history-module.d.ts.map +1 -0
- package/dist/services/history-module.js +42 -0
- package/dist/services/history-module.js.map +1 -0
- package/dist/services/in-memory-history-store.d.ts +12 -0
- package/dist/services/in-memory-history-store.d.ts.map +1 -0
- package/dist/services/in-memory-history-store.js +41 -0
- package/dist/services/in-memory-history-store.js.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +13 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/task-events.d.ts +6 -0
- package/dist/services/task-events.d.ts.map +1 -0
- package/dist/services/task-events.js +6 -0
- package/dist/services/task-events.js.map +1 -0
- package/dist/services/tool-execution-service.d.ts +74 -0
- package/dist/services/tool-execution-service.d.ts.map +1 -0
- package/dist/services/tool-execution-service.js +189 -0
- package/dist/services/tool-execution-service.js.map +1 -0
- package/dist/services/user-events.d.ts +7 -0
- package/dist/services/user-events.d.ts.map +1 -0
- package/dist/services/user-events.js +6 -0
- package/dist/services/user-events.js.map +1 -0
- package/dist/tools/implementations/function-tool/index.d.ts +9 -0
- package/dist/tools/implementations/function-tool/index.d.ts.map +1 -0
- package/dist/tools/implementations/function-tool/index.js +13 -0
- package/dist/tools/implementations/function-tool/index.js.map +1 -0
- package/dist/tools/implementations/function-tool/schema-converter.d.ts +32 -0
- package/dist/tools/implementations/function-tool/schema-converter.d.ts.map +1 -0
- package/dist/tools/implementations/function-tool/schema-converter.js +164 -0
- package/dist/tools/implementations/function-tool/schema-converter.js.map +1 -0
- package/dist/tools/implementations/function-tool/types.d.ts +72 -0
- package/dist/tools/implementations/function-tool/types.d.ts.map +1 -0
- package/dist/tools/implementations/function-tool/types.js +14 -0
- package/dist/tools/implementations/function-tool/types.js.map +1 -0
- package/dist/tools/implementations/function-tool.d.ts +49 -0
- package/dist/tools/implementations/function-tool.d.ts.map +1 -0
- package/dist/tools/implementations/function-tool.js +223 -0
- package/dist/tools/implementations/function-tool.js.map +1 -0
- package/dist/tools/implementations/index.d.ts +4 -0
- package/dist/tools/implementations/index.d.ts.map +1 -0
- package/dist/tools/implementations/index.js +5 -0
- package/dist/tools/implementations/index.js.map +1 -0
- package/dist/tools/implementations/mcp-tool.d.ts +72 -0
- package/dist/tools/implementations/mcp-tool.d.ts.map +1 -0
- package/dist/tools/implementations/mcp-tool.js +246 -0
- package/dist/tools/implementations/mcp-tool.js.map +1 -0
- package/dist/tools/implementations/openapi-tool.d.ts +56 -0
- package/dist/tools/implementations/openapi-tool.d.ts.map +1 -0
- package/dist/tools/implementations/openapi-tool.js +324 -0
- package/dist/tools/implementations/openapi-tool.js.map +1 -0
- package/dist/tools/implementations/relay-mcp-tool.d.ts +38 -0
- package/dist/tools/implementations/relay-mcp-tool.d.ts.map +1 -0
- package/dist/tools/implementations/relay-mcp-tool.js +46 -0
- package/dist/tools/implementations/relay-mcp-tool.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry/index.d.ts +2 -0
- package/dist/tools/registry/index.d.ts.map +1 -0
- package/dist/tools/registry/index.js +3 -0
- package/dist/tools/registry/index.js.map +1 -0
- package/dist/tools/registry/tool-registry.d.ts +54 -0
- package/dist/tools/registry/tool-registry.d.ts.map +1 -0
- package/dist/tools/registry/tool-registry.js +146 -0
- package/dist/tools/registry/tool-registry.js.map +1 -0
- package/dist/utils/errors.d.ts +155 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +203 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/execution-proxy.d.ts +75 -0
- package/dist/utils/execution-proxy.d.ts.map +1 -0
- package/dist/utils/execution-proxy.js +230 -0
- package/dist/utils/execution-proxy.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +74 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +143 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/message-converter.d.ts +68 -0
- package/dist/utils/message-converter.d.ts.map +1 -0
- package/dist/utils/message-converter.js +87 -0
- package/dist/utils/message-converter.js.map +1 -0
- package/dist/utils/periodic-task.d.ts +14 -0
- package/dist/utils/periodic-task.d.ts.map +1 -0
- package/dist/utils/periodic-task.js +26 -0
- package/dist/utils/periodic-task.js.map +1 -0
- package/dist/utils/validation.d.ts +40 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +162 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +101 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# @robota-sdk/agent-core
|
|
2
|
+
|
|
3
|
+
## 2.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add environment-specific builds and conditional exports for optimal browser compatibility
|
|
8
|
+
|
|
9
|
+
This update introduces major build optimizations for better browser performance:
|
|
10
|
+
|
|
11
|
+
## 🚀 Environment-Specific Builds
|
|
12
|
+
- **Node.js builds**: `dist/node/` with full ESM and CJS support
|
|
13
|
+
- **Browser builds**: `dist/browser/` with optimized ESM bundles
|
|
14
|
+
- **Automatic selection**: Bundlers automatically choose the right build
|
|
15
|
+
|
|
16
|
+
## 📦 Bundle Size Optimizations
|
|
17
|
+
- **team package**: 36% smaller browser bundles (37.52KB → 24.12KB)
|
|
18
|
+
- **sessions package**: 48% smaller browser bundles (10.64KB → 5.55KB)
|
|
19
|
+
- **Tree-shaking**: Eliminates Node.js-specific code from browser builds
|
|
20
|
+
- **Production optimizations**: Removes console logs and debug code in browser builds
|
|
21
|
+
|
|
22
|
+
## 🔧 Conditional Exports
|
|
23
|
+
|
|
24
|
+
All packages now support conditional exports for seamless environment detection:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"exports": {
|
|
29
|
+
"node": "./dist/node/index.js",
|
|
30
|
+
"browser": "./dist/browser/index.js",
|
|
31
|
+
"default": "./dist/node/index.js"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🌐 Enhanced Browser Support
|
|
37
|
+
- **Zero breaking changes**: Existing code continues to work unchanged
|
|
38
|
+
- **Better performance**: Optimized bundles for faster loading
|
|
39
|
+
- **Smaller footprint**: Reduced JavaScript bundle sizes for web applications
|
|
40
|
+
- **Universal API**: Same API works across all environments
|
|
41
|
+
|
|
42
|
+
This update completes the browser compatibility optimization phase, making Robota SDK production-ready for web applications with optimal performance characteristics.
|
|
43
|
+
|
|
44
|
+
## 2.0.8
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- # Model Configuration Refactoring
|
|
49
|
+
|
|
50
|
+
## 🚀 **Breaking Changes**
|
|
51
|
+
|
|
52
|
+
### **Provider Interface Simplification**
|
|
53
|
+
- **OpenAI Provider**: Removed `model`, `temperature`, `maxTokens`, `topP` from provider options
|
|
54
|
+
- **Anthropic Provider**: Removed `model`, `temperature`, `maxTokens` from provider options
|
|
55
|
+
- **Google Provider**: Removed `model`, `temperature`, `maxTokens` from provider options
|
|
56
|
+
- **All Providers**: `client` is now optional, automatically created from `apiKey`
|
|
57
|
+
|
|
58
|
+
### **Centralized Model Configuration**
|
|
59
|
+
- Model configuration is now exclusively handled through `defaultModel` in Robota constructor
|
|
60
|
+
- Providers are simplified to handle only connection-related settings
|
|
61
|
+
- Runtime model switching via `setModel()` method is now the recommended approach
|
|
62
|
+
|
|
63
|
+
## ✨ **Improvements**
|
|
64
|
+
|
|
65
|
+
### **Simplified Provider Creation**
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
// Before
|
|
69
|
+
const provider = new OpenAIProvider({
|
|
70
|
+
client: openaiClient,
|
|
71
|
+
model: 'gpt-3.5-turbo',
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// After
|
|
75
|
+
const provider = new OpenAIProvider({
|
|
76
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### **Enhanced Validation**
|
|
81
|
+
- Added strict validation for required model configuration
|
|
82
|
+
- Removed default model fallbacks to prevent ambiguous behavior
|
|
83
|
+
- Clear error messages when model is not specified
|
|
84
|
+
|
|
85
|
+
### **Documentation Updates**
|
|
86
|
+
- Updated all README files with new usage patterns
|
|
87
|
+
- Regenerated API documentation
|
|
88
|
+
- Updated all example files (11 examples)
|
|
89
|
+
|
|
90
|
+
## 🔧 **Migration Guide**
|
|
91
|
+
1. **Remove model settings from Provider constructors**
|
|
92
|
+
2. **Use `apiKey` instead of `client` injection (recommended)**
|
|
93
|
+
3. **Ensure `defaultModel` is properly configured in Robota constructor**
|
|
94
|
+
4. **Update any hardcoded model references to use runtime switching**
|
|
95
|
+
|
|
96
|
+
## 🎯 **Benefits**
|
|
97
|
+
- **Eliminates configuration confusion** - Single source of truth for models
|
|
98
|
+
- **Simplifies provider setup** - Just provide API credentials
|
|
99
|
+
- **Enables better runtime control** - Centralized model management
|
|
100
|
+
- **Improves consistency** - All providers follow same pattern
|
|
101
|
+
|
|
102
|
+
## 2.0.7
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- Browser compatibility improvements
|
|
107
|
+
- feat: Implement SimpleLogger system to replace direct console usage for better browser compatibility
|
|
108
|
+
- feat: Centralize SimpleLogger in @robota-sdk/agent-core package and export for other packages
|
|
109
|
+
- feat: Add support for silent and stderr-only logging modes via SilentLogger and StderrLogger
|
|
110
|
+
- refactor: Update all packages (@robota-sdk/agent-provider-openai, @robota-sdk/agent-provider-anthropic, etc.) to use centralized SimpleLogger
|
|
111
|
+
- chore: Add ESLint rules to prevent direct console usage while allowing legitimate cases
|
|
112
|
+
- fix: Remove unused AIProvider import from examples to clean up warnings
|
|
113
|
+
|
|
114
|
+
These changes ensure the SDK works properly in browser environments by removing Node.js-specific console behavior while maintaining full backward compatibility.
|
|
115
|
+
|
|
116
|
+
## 2.0.6
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Add browser compatibility by removing Node.js dependencies
|
|
121
|
+
- Replace NodeJS.Timeout with cross-platform TimerId type
|
|
122
|
+
- Remove process.env dependency from logger configuration
|
|
123
|
+
- Replace Node.js crypto module with jsSHA library for webhook signatures
|
|
124
|
+
- Update OpenAI stream handlers to work in browser environments
|
|
125
|
+
- Maintain 100% backward compatibility with existing Node.js applications
|
|
126
|
+
|
|
127
|
+
This update enables Robota SDK to run seamlessly in both Node.js and browser environments without breaking changes.
|
|
128
|
+
|
|
129
|
+
## 2.0.5
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- ## 🎯 TypeScript Declaration File Optimization
|
|
134
|
+
|
|
135
|
+
## 2.0.4
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- 9f17ac6: Restore README.md files and prevent deletion during build process
|
|
140
|
+
|
|
141
|
+
## 2.0.3
|
|
142
|
+
|
|
143
|
+
## 2.0.2
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Fix npm package documentation by ensuring README.md files are included
|
|
148
|
+
|
|
149
|
+
## 2.0.1
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- Remove unused dependencies from agents and sessions packages
|
|
154
|
+
|
|
155
|
+
## 2.0.0
|
|
156
|
+
|
|
157
|
+
### Major Changes
|
|
158
|
+
|
|
159
|
+
- a3a464c: # Robota SDK v2.0.0-rc.1 - Unified Architecture
|
|
160
|
+
|
|
161
|
+
## 🚀 Major Changes
|
|
162
|
+
|
|
163
|
+
### New Unified Core
|
|
164
|
+
- **@robota-sdk/agent-core**: New unified core package consolidating all functionality
|
|
165
|
+
- **Zero `any` types**: Complete TypeScript type safety across all packages
|
|
166
|
+
- **Provider-agnostic design**: Seamless switching between OpenAI, Anthropic, and Google
|
|
167
|
+
|
|
168
|
+
### Key Features
|
|
169
|
+
- **Multi-Provider Support**: Dynamic provider switching with type safety
|
|
170
|
+
- **Advanced Function Calling**: Type-safe tool system with Zod validation
|
|
171
|
+
- **Real-time Streaming**: Improved streaming with proper error handling
|
|
172
|
+
- **Task Delegation**: Improved delegated workflow support
|
|
173
|
+
- **Plugin Architecture**: Comprehensive plugin system with facade pattern
|
|
174
|
+
|
|
175
|
+
### Breaking Changes
|
|
176
|
+
- `@robota-sdk/core` functionality moved to `@robota-sdk/agent-core`
|
|
177
|
+
- Redesigned provider interfaces with generic type parameters
|
|
178
|
+
- Updated agent configuration format
|
|
179
|
+
|
|
180
|
+
Complete architecture overhaul focused on type safety and developer experience.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Robota Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# @robota-sdk/agent-core
|
|
2
|
+
|
|
3
|
+
The comprehensive AI agent framework with type-safe architecture and advanced plugin system.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `@robota-sdk/agent-core` package is the unified core of the Robota SDK, providing a complete AI agent system with advanced capabilities for conversation management, tool execution, and extensible plugin architecture.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @robota-sdk/agent-core
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @robota-sdk/agent-core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { Robota } from '@robota-sdk/agent-core';
|
|
21
|
+
import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
|
|
22
|
+
|
|
23
|
+
const openaiProvider = new OpenAIProvider({ apiKey: 'sk-...' });
|
|
24
|
+
|
|
25
|
+
const agent = new Robota({
|
|
26
|
+
name: 'MyAgent',
|
|
27
|
+
aiProviders: [openaiProvider],
|
|
28
|
+
defaultModel: {
|
|
29
|
+
provider: 'openai',
|
|
30
|
+
model: 'gpt-4',
|
|
31
|
+
systemMessage: 'You are a helpful assistant.',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const response = await agent.run('Hello, world!');
|
|
36
|
+
console.log(response);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Browser Quick Start
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { Robota, LoggingPlugin, UsagePlugin } from '@robota-sdk/agent-core';
|
|
43
|
+
import { OpenAIProvider } from '@robota-sdk/agent-provider-openai';
|
|
44
|
+
|
|
45
|
+
const openaiProvider = new OpenAIProvider({
|
|
46
|
+
apiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY, // or proxy endpoint
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Browser-optimized configuration
|
|
50
|
+
const agent = new Robota({
|
|
51
|
+
name: 'BrowserAgent',
|
|
52
|
+
aiProviders: [openaiProvider],
|
|
53
|
+
defaultModel: {
|
|
54
|
+
provider: 'openai',
|
|
55
|
+
model: 'gpt-3.5-turbo',
|
|
56
|
+
},
|
|
57
|
+
plugins: [
|
|
58
|
+
new LoggingPlugin({ strategy: 'console' }), // Console logging
|
|
59
|
+
new UsagePlugin({ strategy: 'memory' }), // Memory storage
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const response = await agent.run('Hello from browser!');
|
|
64
|
+
console.log(response);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Key Features
|
|
68
|
+
|
|
69
|
+
### 🌐 Cross-Platform Compatibility
|
|
70
|
+
|
|
71
|
+
- **Universal Runtime Support**: Works seamlessly in Node.js, browsers, and WebWorkers
|
|
72
|
+
- **Zero Breaking Changes**: Existing Node.js code runs unchanged in browsers
|
|
73
|
+
- **Pure JavaScript Implementation**: No Node.js-specific dependencies in core functionality
|
|
74
|
+
- **Browser-Optimized Storage**: Memory-based alternatives for file system operations
|
|
75
|
+
- **Secure API Patterns**: Proxy server support for secure browser deployments
|
|
76
|
+
|
|
77
|
+
### 🤖 Agent System
|
|
78
|
+
|
|
79
|
+
- **Type-Safe Architecture**: Full TypeScript support with generic type parameters
|
|
80
|
+
- **Robota Class**: Complete AI agent implementation with conversation + tool system + plugin integration
|
|
81
|
+
- **Stateless Service Layer**: ConversationService, ToolExecutionService, ExecutionService for business logic
|
|
82
|
+
- **Manager Layer**: AIProviders, Tools, AgentFactory, Plugins, ConversationHistory for resource management
|
|
83
|
+
- **Parallel Tool Execution**: Concurrent multi-tool calling support
|
|
84
|
+
|
|
85
|
+
### 🌊 Streaming Response System
|
|
86
|
+
|
|
87
|
+
- **Real-time Streaming**: Full streaming support across all AI providers
|
|
88
|
+
- **Modular Architecture**: Separate streaming/parsing logic for each provider
|
|
89
|
+
- **Provider Support**: OpenAI, Anthropic, Google with dedicated stream handlers
|
|
90
|
+
|
|
91
|
+
### 🔧 Tool System
|
|
92
|
+
|
|
93
|
+
- **Type-Safe Tools**: `BaseTool<TParameters, TResult>` with compile-time type checking
|
|
94
|
+
- **ToolRegistry**: Schema storage and validation system
|
|
95
|
+
- **Function Tools**: Zod schema-based function tool implementation
|
|
96
|
+
- **OpenAPI/MCP Support**: Basic structure for extensibility
|
|
97
|
+
|
|
98
|
+
## Recent Updates
|
|
99
|
+
|
|
100
|
+
- Tool execution results preserve `executionId` mappings for both success and failure to keep deterministic ordering.
|
|
101
|
+
|
|
102
|
+
### 🔌 Plugin System
|
|
103
|
+
|
|
104
|
+
Eight core plugins with type-safe configuration and BasePluginOptions integration:
|
|
105
|
+
|
|
106
|
+
- **ConversationHistoryPlugin**: Comprehensive conversation storage with support for memory, file, and database backends. Features auto-save, batch processing, and configurable limits.
|
|
107
|
+
- **UsagePlugin**: Advanced usage analytics including token counting, cost calculation, aggregated statistics, and multiple storage strategies (memory/file/remote).
|
|
108
|
+
- **LoggingPlugin**: Multi-level logging system with console, file, and remote endpoints. Supports custom formatters, batch processing, and structured logging.
|
|
109
|
+
- **PerformancePlugin**: Real-time performance monitoring including execution time tracking, memory usage, CPU metrics, and customizable performance thresholds.
|
|
110
|
+
- **ErrorHandlingPlugin**: Robust error management with multiple strategies (simple, exponential-backoff, circuit-breaker, silent) and custom error handlers.
|
|
111
|
+
- **LimitsPlugin**: Advanced rate limiting with token bucket, sliding window, and fixed window strategies. Supports cost tracking and custom calculators.
|
|
112
|
+
- **EventEmitterPlugin**: Comprehensive event system with async/sync event handling, filtering, buffering, and lifecycle event tracking.
|
|
113
|
+
- **WebhookPlugin**: HTTP webhook notifications with batch processing, retry logic, custom transformers, and concurrent request management.
|
|
114
|
+
|
|
115
|
+
#### Plugin Features
|
|
116
|
+
|
|
117
|
+
- **Type Safety**: All plugins extend BasePluginOptions for consistent configuration
|
|
118
|
+
- **Lifecycle Integration**: Automatic integration with agent lifecycle events
|
|
119
|
+
- **Resource Management**: Built-in cleanup and resource optimization
|
|
120
|
+
- **Performance Monitoring**: All plugins include built-in statistics and monitoring
|
|
121
|
+
- **Error Resilience**: Graceful error handling across all plugin operations
|
|
122
|
+
|
|
123
|
+
#### Plugin Control and Configuration
|
|
124
|
+
|
|
125
|
+
- **Clear Disable Options**: Every plugin provides multiple ways to disable functionality
|
|
126
|
+
- **No Arbitrary Decisions**: Plugins avoid making policy decisions without explicit configuration
|
|
127
|
+
- **Explicit Configuration**: All automatic behaviors can be controlled through configuration
|
|
128
|
+
- **Silent Modes**: Most plugins support 'silent' strategies for performance-critical scenarios
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// Complete plugin disable
|
|
132
|
+
const agent = new Robota({
|
|
133
|
+
plugins: [], // No plugins
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Selective plugin disable
|
|
137
|
+
const agent = new Robota({
|
|
138
|
+
plugins: [
|
|
139
|
+
new LoggingPlugin({ strategy: 'silent', enabled: false }),
|
|
140
|
+
new LimitsPlugin({ strategy: 'none' }),
|
|
141
|
+
new UsagePlugin({ strategy: 'silent' }),
|
|
142
|
+
],
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### Plugin Documentation
|
|
147
|
+
|
|
148
|
+
- **[Plugin Guide](./docs/PLUGINS.md)**: Unified plugin behavior and configuration guide
|
|
149
|
+
|
|
150
|
+
### 🔒 Type Safety Features
|
|
151
|
+
|
|
152
|
+
- **Generic Type Parameters**: `BaseAgent<TConfig, TContext, TMessage>`
|
|
153
|
+
- **Provider Agnostic**: Dynamic provider registration with type safety
|
|
154
|
+
- **Extended RunContext**: Provider-specific options with type preservation
|
|
155
|
+
- **Plugin Type Parameters**: `BasePlugin<TOptions, TStats>` for specialized configurations
|
|
156
|
+
|
|
157
|
+
## Architecture
|
|
158
|
+
|
|
159
|
+
### Core Abstraction Layers
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
BaseAgent<TConfig, TContext, TMessage> (Abstract Class)
|
|
163
|
+
└── Robota (Implementation - AI conversation + tool system + plugins)
|
|
164
|
+
|
|
165
|
+
BaseAIProvider<TConfig, TMessage, TResponse>
|
|
166
|
+
├── OpenAIProvider (via @robota-sdk/agent-provider-openai)
|
|
167
|
+
├── AnthropicProvider (via @robota-sdk/agent-provider-anthropic)
|
|
168
|
+
└── GoogleProvider (via @robota-sdk/agent-provider-google)
|
|
169
|
+
|
|
170
|
+
BaseTool<TParameters, TResult>
|
|
171
|
+
├── FunctionTool (Zod schema-based)
|
|
172
|
+
├── OpenAPITool (API specification-based)
|
|
173
|
+
└── MCPTool (Model Context Protocol)
|
|
174
|
+
|
|
175
|
+
BasePlugin<TOptions, TStats>
|
|
176
|
+
├── Core Plugins (8 essential plugins)
|
|
177
|
+
└── Custom Plugins (User-defined extensions)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Module Structure
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
packages/agents/src/
|
|
184
|
+
├── abstracts/ # Abstract base classes with type parameters
|
|
185
|
+
├── interfaces/ # Type-safe interface definitions
|
|
186
|
+
├── agents/ # Main agent system
|
|
187
|
+
│ ├── managers/ # Resource managers
|
|
188
|
+
│ ├── services/ # Stateless business logic
|
|
189
|
+
│ └── tools/ # Tool system
|
|
190
|
+
├── plugins/ # Plugin system with Facade pattern
|
|
191
|
+
└── utils/ # Core utilities
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Development
|
|
195
|
+
|
|
196
|
+
See [Development Guide](./docs/DEVELOPMENT.md) for development guidelines.
|
|
197
|
+
|
|
198
|
+
## API Reference
|
|
199
|
+
|
|
200
|
+
See [api.md](api.md) for complete API documentation.
|
|
201
|
+
|
|
202
|
+
## Architecture Guide
|
|
203
|
+
|
|
204
|
+
See [Architecture](./docs/ARCHITECTURE.md) for detailed architecture information.
|
|
205
|
+
|
|
206
|
+
## Examples
|
|
207
|
+
|
|
208
|
+
- [Basic Usage](../../../docs/examples/basic-usage.md)
|
|
209
|
+
- [Browser Usage](../../../docs/examples/browser-usage.md) 🌐
|
|
210
|
+
- [Tool Integration](../../../docs/examples/tool-integration.md)
|
|
211
|
+
- [Plugin Development](../../../docs/examples/plugin-development.md)
|
|
212
|
+
- [Streaming Responses](../../../docs/examples/streaming.md)
|
|
213
|
+
|
|
214
|
+
## Package Compatibility
|
|
215
|
+
|
|
216
|
+
### Integrated Packages
|
|
217
|
+
|
|
218
|
+
- **@robota-sdk/agent-provider-openai**: Complete agents standard migration
|
|
219
|
+
- **@robota-sdk/agent-provider-anthropic**: Complete agents standard migration
|
|
220
|
+
- **@robota-sdk/agent-provider-google**: Complete agents standard migration
|
|
221
|
+
- **@robota-sdk/agent-team**: assignTask MCP tool collection (team creation removed)
|
|
222
|
+
|
|
223
|
+
### Deprecated Packages
|
|
224
|
+
|
|
225
|
+
- **@robota-sdk/core**: Deprecated - functionality moved to agents
|
|
226
|
+
- **@robota-sdk/agent-tools**: Deprecated - functionality moved to agents
|
|
227
|
+
|
|
228
|
+
## License
|
|
229
|
+
|
|
230
|
+
MIT
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Abstract Agent Base Class
|
|
3
|
+
*
|
|
4
|
+
* 🎯 ABSTRACT CLASS - DO NOT DEPEND ON CONCRETE IMPLEMENTATIONS
|
|
5
|
+
*
|
|
6
|
+
* This class defines the foundational lifecycle for agent implementations.
|
|
7
|
+
* Subclasses provide provider/tool-specific behavior while inheriting the
|
|
8
|
+
* shared guarantees around initialization, history, and disposal.
|
|
9
|
+
*/
|
|
10
|
+
import type { IAgent, IAgentConfig, TUniversalMessage, IRunOptions } from '../interfaces/agent';
|
|
11
|
+
export declare abstract class AbstractAgent<TConfig = IAgentConfig, TContext = IRunOptions, TMessage = TUniversalMessage> implements IAgent<TConfig, TContext, TMessage> {
|
|
12
|
+
protected history: TMessage[];
|
|
13
|
+
protected isInitialized: boolean;
|
|
14
|
+
protected config?: TConfig;
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the agent (subclass responsibility)
|
|
17
|
+
*/
|
|
18
|
+
protected abstract initialize(): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Configure the agent with type-safe configuration
|
|
21
|
+
*/
|
|
22
|
+
configure(config: TConfig): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Run agent with user input and type-safe context
|
|
25
|
+
*/
|
|
26
|
+
abstract run(input: string, context?: TContext): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Run agent with streaming response and type-safe context
|
|
29
|
+
*/
|
|
30
|
+
abstract runStream(input: string, context?: TContext): AsyncGenerator<string, void, never>;
|
|
31
|
+
/**
|
|
32
|
+
* Get conversation history with type-safe messages
|
|
33
|
+
*/
|
|
34
|
+
getHistory(): TMessage[];
|
|
35
|
+
/**
|
|
36
|
+
* Clear conversation history
|
|
37
|
+
*/
|
|
38
|
+
clearHistory(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Add message to history
|
|
41
|
+
*/
|
|
42
|
+
protected addMessage(message: TMessage): void;
|
|
43
|
+
/**
|
|
44
|
+
* Validate user input
|
|
45
|
+
*/
|
|
46
|
+
protected validateInput(input: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Ensure agent is initialized before running
|
|
49
|
+
*/
|
|
50
|
+
protected ensureInitialized(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Cleanup resources
|
|
53
|
+
*/
|
|
54
|
+
dispose(): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=abstract-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-agent.d.ts","sourceRoot":"","sources":["../../src/abstracts/abstract-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEhG,8BAAsB,aAAa,CAC/B,OAAO,GAAG,YAAY,EACtB,QAAQ,GAAG,WAAW,EACtB,QAAQ,GAAG,iBAAiB,CAC9B,YAAW,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;IAC5C,SAAS,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAM;IACnC,SAAS,CAAC,aAAa,UAAS;IAChC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9C;;OAEG;IACG,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/C;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAEhE;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC;IAE1F;;OAEG;IACH,UAAU,IAAI,QAAQ,EAAE;IAIxB;;OAEG;IACH,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,GAAG,IAAI;IAI7C;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM5C;;OAEG;cACa,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOlD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAIjC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export class AbstractAgent {
|
|
2
|
+
history = [];
|
|
3
|
+
isInitialized = false;
|
|
4
|
+
config;
|
|
5
|
+
/**
|
|
6
|
+
* Configure the agent with type-safe configuration
|
|
7
|
+
*/
|
|
8
|
+
async configure(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
await this.ensureInitialized();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get conversation history with type-safe messages
|
|
14
|
+
*/
|
|
15
|
+
getHistory() {
|
|
16
|
+
return [...this.history];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Clear conversation history
|
|
20
|
+
*/
|
|
21
|
+
clearHistory() {
|
|
22
|
+
this.history = [];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Add message to history
|
|
26
|
+
*/
|
|
27
|
+
addMessage(message) {
|
|
28
|
+
this.history.push(message);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Validate user input
|
|
32
|
+
*/
|
|
33
|
+
validateInput(input) {
|
|
34
|
+
if (!input || typeof input !== 'string') {
|
|
35
|
+
throw new Error('Input must be a non-empty string');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Ensure agent is initialized before running
|
|
40
|
+
*/
|
|
41
|
+
async ensureInitialized() {
|
|
42
|
+
if (!this.isInitialized) {
|
|
43
|
+
await this.initialize();
|
|
44
|
+
this.isInitialized = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Cleanup resources
|
|
49
|
+
*/
|
|
50
|
+
async dispose() {
|
|
51
|
+
this.clearHistory();
|
|
52
|
+
this.isInitialized = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=abstract-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-agent.js","sourceRoot":"","sources":["../../src/abstracts/abstract-agent.ts"],"names":[],"mappings":"AAWA,MAAM,OAAgB,aAAa;IAKrB,OAAO,GAAe,EAAE,CAAC;IACzB,aAAa,GAAG,KAAK,CAAC;IACtB,MAAM,CAAW;IAO3B;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,MAAe;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACnC,CAAC;IAYD;;OAEG;IACH,UAAU;QACN,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,YAAY;QACR,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACO,UAAU,CAAC,OAAiB;QAClC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,KAAa;QACjC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,iBAAiB;QAC7B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC9B,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACT,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC/B,CAAC;CACJ"}
|