@robota-sdk/agent-core 3.0.0-beta.6 → 3.0.0-beta.60
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 +81 -0
- package/README.md +34 -11
- package/dist/browser/index.d.ts +646 -324
- package/dist/browser/index.js +10 -4
- package/dist/node/index.cjs +10 -4
- package/dist/node/index.d.cts +646 -324
- package/dist/node/index.d.ts +646 -324
- package/dist/node/index.js +10 -4
- package/package.json +5 -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
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook HTTP client for sending webhook requests
|
|
3
|
-
* Handles retries, timeouts, and error scenarios
|
|
4
|
-
*/
|
|
5
|
-
import jsSHA from 'jssha';
|
|
6
|
-
/**
|
|
7
|
-
* HTTP client for webhook requests
|
|
8
|
-
*/
|
|
9
|
-
export class WebhookHttpClient {
|
|
10
|
-
logger;
|
|
11
|
-
constructor(logger) {
|
|
12
|
-
this.logger = logger;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Send a single webhook request with retries
|
|
16
|
-
*/
|
|
17
|
-
async sendRequest(request) {
|
|
18
|
-
const { endpoint, payload, attempt } = request;
|
|
19
|
-
const timeout = endpoint.timeout ?? 5000;
|
|
20
|
-
const maxRetries = endpoint.retries ?? 3;
|
|
21
|
-
try {
|
|
22
|
-
// Prepare request body
|
|
23
|
-
const body = JSON.stringify(payload);
|
|
24
|
-
// Prepare headers
|
|
25
|
-
const headers = {
|
|
26
|
-
'Content-Type': 'application/json',
|
|
27
|
-
'User-Agent': 'robota-webhook/1.0.0',
|
|
28
|
-
...endpoint.headers
|
|
29
|
-
};
|
|
30
|
-
// Add signature if secret is provided
|
|
31
|
-
if (endpoint.secret) {
|
|
32
|
-
const signature = this.generateSignature(body, endpoint.secret);
|
|
33
|
-
headers['X-Webhook-Signature'] = signature;
|
|
34
|
-
}
|
|
35
|
-
// Make HTTP request
|
|
36
|
-
const response = await this.makeHttpRequest(endpoint.url, {
|
|
37
|
-
method: 'POST',
|
|
38
|
-
headers,
|
|
39
|
-
body,
|
|
40
|
-
timeout
|
|
41
|
-
});
|
|
42
|
-
if (!response.ok) {
|
|
43
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
44
|
-
}
|
|
45
|
-
this.logger.debug('Webhook sent successfully', {
|
|
46
|
-
url: endpoint.url,
|
|
47
|
-
event: payload.event,
|
|
48
|
-
attempt,
|
|
49
|
-
status: response.status
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
this.logger.error('Webhook request failed', {
|
|
54
|
-
url: endpoint.url,
|
|
55
|
-
event: payload.event,
|
|
56
|
-
attempt,
|
|
57
|
-
error: error instanceof Error ? error.message : String(error)
|
|
58
|
-
});
|
|
59
|
-
// Retry if we haven't exceeded max attempts
|
|
60
|
-
if (attempt < maxRetries) {
|
|
61
|
-
const retryRequest = {
|
|
62
|
-
...request,
|
|
63
|
-
attempt: attempt + 1
|
|
64
|
-
};
|
|
65
|
-
// Exponential backoff
|
|
66
|
-
const delay = Math.min(1000 * Math.pow(2, attempt - 1), 10000);
|
|
67
|
-
await this.delay(delay);
|
|
68
|
-
return this.sendRequest(retryRequest);
|
|
69
|
-
}
|
|
70
|
-
// Max retries exceeded
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Generate HMAC signature for webhook security using jsSHA (browser compatible)
|
|
76
|
-
*/
|
|
77
|
-
generateSignature(body, secret) {
|
|
78
|
-
const shaObj = new jsSHA("SHA-256", "TEXT", {
|
|
79
|
-
hmacKey: { value: secret, format: "TEXT" }
|
|
80
|
-
});
|
|
81
|
-
shaObj.update(body);
|
|
82
|
-
return shaObj.getHash("HEX").toLowerCase();
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Make HTTP request with timeout support
|
|
86
|
-
*/
|
|
87
|
-
async makeHttpRequest(url, options) {
|
|
88
|
-
const controller = new AbortController();
|
|
89
|
-
const timeoutId = setTimeout(() => controller.abort(), options.timeout);
|
|
90
|
-
try {
|
|
91
|
-
const response = await fetch(url, {
|
|
92
|
-
method: options.method,
|
|
93
|
-
headers: options.headers,
|
|
94
|
-
body: options.body,
|
|
95
|
-
signal: controller.signal
|
|
96
|
-
});
|
|
97
|
-
return response;
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
clearTimeout(timeoutId);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Delay utility for retry backoff
|
|
105
|
-
*/
|
|
106
|
-
delay(ms) {
|
|
107
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=http-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../../../src/plugins/webhook/http-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAClB,MAAM,CAAU;IAExB,YAAY,MAAe;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,OAAwB;QACtC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC/C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC;QACzC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;QAEzC,IAAI,CAAC;YACD,uBAAuB;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAErC,kBAAkB;YAClB,MAAM,OAAO,GAA2B;gBACpC,cAAc,EAAE,kBAAkB;gBAClC,YAAY,EAAE,sBAAsB;gBACpC,GAAG,QAAQ,CAAC,OAAO;aACtB,CAAC;YAEF,sCAAsC;YACtC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAA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C,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook plugin exports
|
|
3
|
-
* Centralized export point for all webhook plugin components
|
|
4
|
-
*/
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './transformer';
|
|
7
|
-
export * from './http-client';
|
|
8
|
-
export { WebhookPlugin } from './webhook-plugin';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/webhook/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook plugin exports
|
|
3
|
-
* Centralized export point for all webhook plugin components
|
|
4
|
-
*/
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './transformer';
|
|
7
|
-
export * from './http-client';
|
|
8
|
-
export { WebhookPlugin } from './webhook-plugin';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/webhook/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook data transformation utilities
|
|
3
|
-
* Converts base plugin types to webhook-specific types safely
|
|
4
|
-
*/
|
|
5
|
-
import type { IPluginExecutionContext, IPluginExecutionResult } from '../../abstracts/abstract-plugin';
|
|
6
|
-
import type { TLoggerData } from '../../interfaces/types';
|
|
7
|
-
import type { IWebhookExecutionContext, IWebhookExecutionResult, IWebhookEventData, TWebhookEventName } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* Webhook data transformer utility class
|
|
10
|
-
*/
|
|
11
|
-
export declare class WebhookTransformer {
|
|
12
|
-
/**
|
|
13
|
-
* Convert IPluginExecutionContext to WebhookExecutionContext
|
|
14
|
-
*/
|
|
15
|
-
static contextToWebhook(context: IPluginExecutionContext): IWebhookExecutionContext;
|
|
16
|
-
/**
|
|
17
|
-
* Convert IPluginExecutionResult to WebhookExecutionResult
|
|
18
|
-
*/
|
|
19
|
-
static resultToWebhook(result: IPluginExecutionResult): IWebhookExecutionResult;
|
|
20
|
-
/**
|
|
21
|
-
* Create execution event data
|
|
22
|
-
*/
|
|
23
|
-
static createExecutionData(context: IWebhookExecutionContext, result: IWebhookExecutionResult): IWebhookEventData;
|
|
24
|
-
/**
|
|
25
|
-
* Create conversation event data
|
|
26
|
-
*/
|
|
27
|
-
static createConversationData(context: IWebhookExecutionContext, result: IWebhookExecutionResult): IWebhookEventData;
|
|
28
|
-
/**
|
|
29
|
-
* Create tool execution event data
|
|
30
|
-
*
|
|
31
|
-
* REASON: Tool result structure varies by tool type and provider, needs flexible handling for webhook processing
|
|
32
|
-
* ALTERNATIVES_CONSIDERED:
|
|
33
|
-
* 1. Strict tool result interfaces (breaks tool compatibility)
|
|
34
|
-
* 2. Union types (insufficient for dynamic tool results)
|
|
35
|
-
* 3. Generic constraints (too complex for webhook processing)
|
|
36
|
-
* 4. Interface definitions (too rigid for varied tool results)
|
|
37
|
-
* 5. Type assertions (decreases type safety)
|
|
38
|
-
* TODO: Consider standardized tool result interface across tools
|
|
39
|
-
*/
|
|
40
|
-
static createToolData(context: IWebhookExecutionContext, toolResult: TLoggerData): IWebhookEventData;
|
|
41
|
-
/**
|
|
42
|
-
* Create error event data
|
|
43
|
-
*/
|
|
44
|
-
static createErrorData(context: IWebhookExecutionContext, error: Error): IWebhookEventData;
|
|
45
|
-
/**
|
|
46
|
-
* Safely get property from object (handles index signature issues)
|
|
47
|
-
*
|
|
48
|
-
* REASON: Safe property access for webhook data transformation needs flexible input/output types
|
|
49
|
-
* ALTERNATIVES_CONSIDERED:
|
|
50
|
-
* 1. Strict object types (breaks dynamic property access)
|
|
51
|
-
* 2. Union types (insufficient for property extraction)
|
|
52
|
-
* 3. Generic constraints (too complex for simple property access)
|
|
53
|
-
* 4. Interface definitions (too rigid for dynamic objects)
|
|
54
|
-
* 5. Type assertions (decreases type safety)
|
|
55
|
-
* TODO: Consider typed property access if patterns emerge
|
|
56
|
-
*/
|
|
57
|
-
private static safeGetProperty;
|
|
58
|
-
/**
|
|
59
|
-
* Default payload transformer for webhook events
|
|
60
|
-
*/
|
|
61
|
-
static defaultPayloadTransformer(_event: TWebhookEventName, data: IWebhookEventData): IWebhookEventData;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=transformer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.d.ts","sourceRoot":"","sources":["../../../src/plugins/webhook/transformer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EACR,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EAMjB,iBAAiB,EACpB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,kBAAkB;IAC3B;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,wBAAwB;IAQnF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,sBAAsB,GAAG,uBAAuB;IAc/E;;OAEG;IACH,MAAM,CAAC,mBAAmB,CACtB,OAAO,EAAE,wBAAwB,EACjC,MAAM,EAAE,uBAAuB,GAChC,iBAAiB;IAiBpB;;OAEG;IACH,MAAM,CAAC,sBAAsB,CACzB,OAAO,EAAE,wBAAwB,EACjC,MAAM,EAAE,uBAAuB,GAChC,iBAAiB;IAsBpB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,cAAc,CACjB,OAAO,EAAE,wBAAwB,EACjC,UAAU,EAAE,WAAW,GACxB,iBAAiB;IA0BpB;;OAEG;IACH,MAAM,CAAC,eAAe,CAClB,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,KAAK,GACb,iBAAiB;IAoBpB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAO9B;;OAEG;IACH,MAAM,CAAC,yBAAyB,CAC5B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,iBAAiB,GACxB,iBAAiB;CAIvB"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook data transformation utilities
|
|
3
|
-
* Converts base plugin types to webhook-specific types safely
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Webhook data transformer utility class
|
|
7
|
-
*/
|
|
8
|
-
export class WebhookTransformer {
|
|
9
|
-
/**
|
|
10
|
-
* Convert IPluginExecutionContext to WebhookExecutionContext
|
|
11
|
-
*/
|
|
12
|
-
static contextToWebhook(context) {
|
|
13
|
-
return {
|
|
14
|
-
executionId: context.executionId,
|
|
15
|
-
sessionId: context.sessionId,
|
|
16
|
-
userId: context.userId
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Convert IPluginExecutionResult to WebhookExecutionResult
|
|
21
|
-
*/
|
|
22
|
-
static resultToWebhook(result) {
|
|
23
|
-
return {
|
|
24
|
-
response: result.response,
|
|
25
|
-
content: result.content,
|
|
26
|
-
duration: result.duration,
|
|
27
|
-
tokensUsed: result.tokensUsed,
|
|
28
|
-
toolsExecuted: result.toolsExecuted,
|
|
29
|
-
success: result.success,
|
|
30
|
-
usage: result.usage,
|
|
31
|
-
toolCalls: result.toolCalls,
|
|
32
|
-
error: result.error
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create execution event data
|
|
37
|
-
*/
|
|
38
|
-
static createExecutionData(context, result) {
|
|
39
|
-
const executionData = {
|
|
40
|
-
response: result.response || undefined,
|
|
41
|
-
duration: result.duration || undefined,
|
|
42
|
-
tokensUsed: result.tokensUsed || undefined,
|
|
43
|
-
toolsExecuted: result.toolsExecuted || undefined,
|
|
44
|
-
success: result.success !== undefined ? result.success : undefined
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
executionId: context.executionId,
|
|
48
|
-
sessionId: context.sessionId,
|
|
49
|
-
userId: context.userId,
|
|
50
|
-
result: executionData
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Create conversation event data
|
|
55
|
-
*/
|
|
56
|
-
static createConversationData(context, result) {
|
|
57
|
-
const toolCalls = result.toolCalls?.map(call => ({
|
|
58
|
-
id: call.id || '',
|
|
59
|
-
name: call.name || '',
|
|
60
|
-
arguments: JSON.stringify(call.arguments || {}),
|
|
61
|
-
result: String(call.result || '')
|
|
62
|
-
})) || [];
|
|
63
|
-
const conversationData = {
|
|
64
|
-
response: result.content || result.response || undefined,
|
|
65
|
-
tokensUsed: result.usage?.totalTokens || result.tokensUsed || undefined,
|
|
66
|
-
toolCalls: toolCalls.length > 0 ? toolCalls : undefined
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
executionId: context.executionId,
|
|
70
|
-
sessionId: context.sessionId,
|
|
71
|
-
userId: context.userId,
|
|
72
|
-
conversation: conversationData
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Create tool execution event data
|
|
77
|
-
*
|
|
78
|
-
* REASON: Tool result structure varies by tool type and provider, needs flexible handling for webhook processing
|
|
79
|
-
* ALTERNATIVES_CONSIDERED:
|
|
80
|
-
* 1. Strict tool result interfaces (breaks tool compatibility)
|
|
81
|
-
* 2. Union types (insufficient for dynamic tool results)
|
|
82
|
-
* 3. Generic constraints (too complex for webhook processing)
|
|
83
|
-
* 4. Interface definitions (too rigid for varied tool results)
|
|
84
|
-
* 5. Type assertions (decreases type safety)
|
|
85
|
-
* TODO: Consider standardized tool result interface across tools
|
|
86
|
-
*/
|
|
87
|
-
static createToolData(context, toolResult) {
|
|
88
|
-
// Safely extract tool data from result
|
|
89
|
-
const toolName = this.safeGetProperty(toolResult, 'toolName') || 'unknown';
|
|
90
|
-
const toolId = this.safeGetProperty(toolResult, 'toolId') ||
|
|
91
|
-
this.safeGetProperty(toolResult, 'executionId') || 'unknown';
|
|
92
|
-
const hasError = this.safeGetProperty(toolResult, 'error');
|
|
93
|
-
const duration = this.safeGetProperty(toolResult, 'duration');
|
|
94
|
-
const result = this.safeGetProperty(toolResult, 'result');
|
|
95
|
-
const toolData = {
|
|
96
|
-
name: String(toolName),
|
|
97
|
-
id: String(toolId),
|
|
98
|
-
success: !hasError,
|
|
99
|
-
duration: typeof duration === 'number' ? duration : undefined,
|
|
100
|
-
result: hasError ? undefined : String(result || ''),
|
|
101
|
-
error: hasError ? (hasError instanceof Error ? hasError.message : String(hasError)) : undefined
|
|
102
|
-
};
|
|
103
|
-
return {
|
|
104
|
-
executionId: context.executionId,
|
|
105
|
-
sessionId: context.sessionId,
|
|
106
|
-
userId: context.userId,
|
|
107
|
-
tool: toolData
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Create error event data
|
|
112
|
-
*/
|
|
113
|
-
static createErrorData(context, error) {
|
|
114
|
-
const errorData = {
|
|
115
|
-
message: error instanceof Error ? error.message : String(error),
|
|
116
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
117
|
-
type: error instanceof Error ? error.constructor.name : 'Unknown',
|
|
118
|
-
context: context ? {
|
|
119
|
-
executionId: context.executionId || '',
|
|
120
|
-
sessionId: context.sessionId || '',
|
|
121
|
-
userId: context.userId || ''
|
|
122
|
-
} : undefined
|
|
123
|
-
};
|
|
124
|
-
return {
|
|
125
|
-
executionId: context.executionId,
|
|
126
|
-
sessionId: context.sessionId,
|
|
127
|
-
userId: context.userId,
|
|
128
|
-
error: errorData
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Safely get property from object (handles index signature issues)
|
|
133
|
-
*
|
|
134
|
-
* REASON: Safe property access for webhook data transformation needs flexible input/output types
|
|
135
|
-
* ALTERNATIVES_CONSIDERED:
|
|
136
|
-
* 1. Strict object types (breaks dynamic property access)
|
|
137
|
-
* 2. Union types (insufficient for property extraction)
|
|
138
|
-
* 3. Generic constraints (too complex for simple property access)
|
|
139
|
-
* 4. Interface definitions (too rigid for dynamic objects)
|
|
140
|
-
* 5. Type assertions (decreases type safety)
|
|
141
|
-
* TODO: Consider typed property access if patterns emerge
|
|
142
|
-
*/
|
|
143
|
-
static safeGetProperty(obj, key) {
|
|
144
|
-
if (!obj || typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
return obj[key];
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Default payload transformer for webhook events
|
|
151
|
-
*/
|
|
152
|
-
static defaultPayloadTransformer(_event, data) {
|
|
153
|
-
// Simply return the data as-is for the default transformer
|
|
154
|
-
return data;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=transformer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.js","sourceRoot":"","sources":["../../../src/plugins/webhook/transformer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC3B;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAgC;QACpD,OAAO;YACH,WAAW,EAAE,OAAO,C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AAO,CAAC,CAAC,CAAC;gBACf,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,EAAE;gBAClC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;aAC/B,CAAC,CAAC,CAAC,SAAS;SAChB,CAAC;QAEF,OAAO;YACH,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,SAAS;SACnB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACK,MAAM,CAAC,eAAe,CAAC,GAAgB,EAAE,GAAW;QACxD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACxE,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,yBAAyB,CAC5B,MAAyB,EACzB,IAAuB;QAEvB,2DAA2D;QAC3D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { EXECUTION_EVENTS, EXECUTION_EVENT_PREFIX } from '../../services/execution-service';
|
|
2
|
-
/**
|
|
3
|
-
* Webhook plugin type definitions
|
|
4
|
-
* Clean separation of concerns with domain-specific types
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Webhook event types for different lifecycle events
|
|
8
|
-
*/
|
|
9
|
-
type TExecutionEventName = `${typeof EXECUTION_EVENT_PREFIX}.${typeof EXECUTION_EVENTS[keyof typeof EXECUTION_EVENTS]}`;
|
|
10
|
-
export type TWebhookEventName = TExecutionEventName | 'conversation.complete' | 'tool.executed' | 'error.occurred' | 'custom';
|
|
11
|
-
/**
|
|
12
|
-
* Base webhook context data
|
|
13
|
-
*/
|
|
14
|
-
export interface IWebhookContextData {
|
|
15
|
-
executionId?: string | undefined;
|
|
16
|
-
sessionId?: string | undefined;
|
|
17
|
-
userId?: string | undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Execution result data for webhooks
|
|
21
|
-
*/
|
|
22
|
-
export interface IWebhookExecutionData {
|
|
23
|
-
response?: string | undefined;
|
|
24
|
-
duration?: number | undefined;
|
|
25
|
-
tokensUsed?: number | undefined;
|
|
26
|
-
toolsExecuted?: number | undefined;
|
|
27
|
-
success?: boolean | undefined;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Conversation result data for webhooks
|
|
31
|
-
*/
|
|
32
|
-
export interface IWebhookConversationData {
|
|
33
|
-
response?: string | undefined;
|
|
34
|
-
tokensUsed?: number | undefined;
|
|
35
|
-
toolCalls?: IWebhookToolCallData[] | undefined;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Tool call data for webhooks
|
|
39
|
-
*/
|
|
40
|
-
export interface IWebhookToolCallData {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
arguments: string;
|
|
44
|
-
result: string;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Tool execution data for webhooks
|
|
48
|
-
*/
|
|
49
|
-
export interface IWebhookToolData {
|
|
50
|
-
name: string;
|
|
51
|
-
id: string;
|
|
52
|
-
success: boolean;
|
|
53
|
-
duration?: number | undefined;
|
|
54
|
-
result?: string | undefined;
|
|
55
|
-
error?: string | undefined;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Error data for webhooks
|
|
59
|
-
*/
|
|
60
|
-
export interface IWebhookErrorData {
|
|
61
|
-
message: string;
|
|
62
|
-
stack?: string | undefined;
|
|
63
|
-
context?: Record<string, string | number | boolean> | undefined;
|
|
64
|
-
type?: string | undefined;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Complete webhook event data structure
|
|
68
|
-
*/
|
|
69
|
-
export interface IWebhookEventData extends IWebhookContextData {
|
|
70
|
-
result?: IWebhookExecutionData | undefined;
|
|
71
|
-
conversation?: IWebhookConversationData | undefined;
|
|
72
|
-
tool?: IWebhookToolData | undefined;
|
|
73
|
-
error?: IWebhookErrorData | undefined;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Webhook metadata for additional context
|
|
77
|
-
*/
|
|
78
|
-
export type TWebhookMetadata = Record<string, string | number | boolean | Date | string[]>;
|
|
79
|
-
/**
|
|
80
|
-
* Webhook execution context (simplified from base types)
|
|
81
|
-
*/
|
|
82
|
-
export interface IWebhookExecutionContext {
|
|
83
|
-
executionId?: string | undefined;
|
|
84
|
-
sessionId?: string | undefined;
|
|
85
|
-
userId?: string | undefined;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Webhook execution result (simplified from base types)
|
|
89
|
-
*/
|
|
90
|
-
export interface IWebhookExecutionResult {
|
|
91
|
-
response?: string | undefined;
|
|
92
|
-
content?: string | undefined;
|
|
93
|
-
duration?: number | undefined;
|
|
94
|
-
tokensUsed?: number | undefined;
|
|
95
|
-
toolsExecuted?: number | undefined;
|
|
96
|
-
success?: boolean | undefined;
|
|
97
|
-
usage?: {
|
|
98
|
-
totalTokens?: number | undefined;
|
|
99
|
-
} | undefined;
|
|
100
|
-
toolCalls?: import('../../abstracts/abstract-plugin').IPluginExecutionResult['toolCalls'];
|
|
101
|
-
results?: Array<{
|
|
102
|
-
toolName?: string | undefined;
|
|
103
|
-
toolId?: string | undefined;
|
|
104
|
-
executionId?: string | undefined;
|
|
105
|
-
error?: Error | undefined;
|
|
106
|
-
duration?: number | undefined;
|
|
107
|
-
result?: string | number | boolean | undefined;
|
|
108
|
-
}> | undefined;
|
|
109
|
-
error?: Error | undefined;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Webhook payload structure
|
|
113
|
-
*/
|
|
114
|
-
export interface IWebhookPayload {
|
|
115
|
-
event: TWebhookEventName;
|
|
116
|
-
timestamp: string;
|
|
117
|
-
executionId?: string;
|
|
118
|
-
sessionId?: string;
|
|
119
|
-
userId?: string;
|
|
120
|
-
data: IWebhookEventData;
|
|
121
|
-
metadata?: TWebhookMetadata;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Webhook endpoint configuration
|
|
125
|
-
*/
|
|
126
|
-
export interface IWebhookEndpoint {
|
|
127
|
-
url: string;
|
|
128
|
-
headers?: Record<string, string>;
|
|
129
|
-
events?: TWebhookEventName[];
|
|
130
|
-
retries?: number;
|
|
131
|
-
timeout?: number;
|
|
132
|
-
secret?: string;
|
|
133
|
-
}
|
|
134
|
-
import type { IPluginOptions, IPluginStats } from '../../abstracts/abstract-plugin';
|
|
135
|
-
/**
|
|
136
|
-
* Webhook plugin configuration options
|
|
137
|
-
*/
|
|
138
|
-
export interface IWebhookPluginOptions extends IPluginOptions {
|
|
139
|
-
/** Webhook endpoints */
|
|
140
|
-
endpoints: IWebhookEndpoint[];
|
|
141
|
-
/** Events to send webhooks for */
|
|
142
|
-
events?: TWebhookEventName[];
|
|
143
|
-
/** Default timeout for webhook requests */
|
|
144
|
-
defaultTimeout?: number;
|
|
145
|
-
/** Default retry attempts */
|
|
146
|
-
defaultRetries?: number;
|
|
147
|
-
/** Whether to use async sending */
|
|
148
|
-
async?: boolean;
|
|
149
|
-
/** Maximum concurrent webhook requests */
|
|
150
|
-
maxConcurrency?: number;
|
|
151
|
-
/** Whether to batch webhook requests */
|
|
152
|
-
batching?: {
|
|
153
|
-
enabled: boolean;
|
|
154
|
-
maxSize: number;
|
|
155
|
-
flushInterval: number;
|
|
156
|
-
};
|
|
157
|
-
/** Custom payload transformer */
|
|
158
|
-
payloadTransformer?: (event: TWebhookEventName, data: IWebhookEventData) => IWebhookEventData;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Webhook plugin statistics
|
|
162
|
-
*/
|
|
163
|
-
export interface IWebhookPluginStats extends IPluginStats {
|
|
164
|
-
endpointCount: number;
|
|
165
|
-
queueLength: number;
|
|
166
|
-
batchQueueLength: number;
|
|
167
|
-
activeConcurrency: number;
|
|
168
|
-
supportedEvents: TWebhookEventName[];
|
|
169
|
-
totalSent: number;
|
|
170
|
-
totalErrors: number;
|
|
171
|
-
averageResponseTime: number;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Internal webhook request structure
|
|
175
|
-
*/
|
|
176
|
-
export interface IWebhookRequest {
|
|
177
|
-
endpoint: IWebhookEndpoint;
|
|
178
|
-
payload: IWebhookPayload;
|
|
179
|
-
attempt: number;
|
|
180
|
-
timestamp: Date;
|
|
181
|
-
}
|
|
182
|
-
export {};
|
|
183
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/webhook/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE5F;;;GAGG;AAEH;;GAEG;AACH,KAAK,mBAAmB,GAAG,GAAG,OAAO,sBAAsB,IAAI,OAAO,gBAAgB,CAAC,MAAM,OAAO,gBAAgB,CAAC,EAAE,CAAC;AAExH,MAAM,MAAM,iBAAiB,GACvB,mBAAmB,GACnB,uBAAuB,GACvB,eAAe,GACf,gBAAgB,GAChB,QAAQ,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,G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OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,iCAAiC;IACjC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,KAAK,iBAAiB,CAAC;CACjG;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,iBAAiB,EAAE,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/webhook/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Webhook Plugin - Facade Pattern Implementation
|
|
3
|
-
* Coordinates webhook functionality through clean, separated components
|
|
4
|
-
*/
|
|
5
|
-
import { AbstractPlugin, type IPluginExecutionContext, type IPluginExecutionResult, type IPluginErrorContext } from '../../abstracts/abstract-plugin';
|
|
6
|
-
import type { TWebhookEventName, IWebhookEventData, TWebhookMetadata, IWebhookPluginOptions, IWebhookPluginStats } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Webhook Plugin using Facade Pattern
|
|
9
|
-
* Provides a clean interface for webhook functionality
|
|
10
|
-
*/
|
|
11
|
-
export declare class WebhookPlugin extends AbstractPlugin<IWebhookPluginOptions, IWebhookPluginStats> {
|
|
12
|
-
name: string;
|
|
13
|
-
version: string;
|
|
14
|
-
private pluginOptions;
|
|
15
|
-
private logger;
|
|
16
|
-
private httpClient;
|
|
17
|
-
private requestQueue;
|
|
18
|
-
private batchQueue;
|
|
19
|
-
private activeConcurrency;
|
|
20
|
-
private batchTimer?;
|
|
21
|
-
constructor(options: IWebhookPluginOptions);
|
|
22
|
-
/**
|
|
23
|
-
* After execution completes
|
|
24
|
-
*/
|
|
25
|
-
afterExecution(context: IPluginExecutionContext, result: IPluginExecutionResult): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* After conversation completes
|
|
28
|
-
*/
|
|
29
|
-
afterConversation(context: IPluginExecutionContext, result: IPluginExecutionResult): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* After tool execution
|
|
32
|
-
*
|
|
33
|
-
* REASON: Tool results structure varies by tool type and provider, needs flexible handling for webhook processing
|
|
34
|
-
* ALTERNATIVES_CONSIDERED:
|
|
35
|
-
* 1. Strict tool result interfaces (breaks tool compatibility)
|
|
36
|
-
* 2. Union types (insufficient for dynamic tool results)
|
|
37
|
-
* 3. Generic constraints (too complex for webhook processing)
|
|
38
|
-
* 4. Interface definitions (too rigid for varied tool results)
|
|
39
|
-
* 5. Type assertions (decreases type safety)
|
|
40
|
-
* TODO: Consider standardized tool result interface across tools
|
|
41
|
-
*/
|
|
42
|
-
afterToolExecution(context: IPluginExecutionContext, toolResults: IPluginExecutionResult): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* On error
|
|
45
|
-
*/
|
|
46
|
-
onError(error: Error, context?: IPluginErrorContext): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Send webhook notification
|
|
49
|
-
*/
|
|
50
|
-
sendWebhook(event: TWebhookEventName, data: IWebhookEventData, metadata?: TWebhookMetadata): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Send custom webhook
|
|
53
|
-
*/
|
|
54
|
-
sendCustomWebhook(data: IWebhookEventData, metadata?: TWebhookMetadata): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Send payload to all applicable endpoints
|
|
57
|
-
*/
|
|
58
|
-
private sendToEndpoints;
|
|
59
|
-
/**
|
|
60
|
-
* Process webhook request queue
|
|
61
|
-
*/
|
|
62
|
-
private processQueue;
|
|
63
|
-
/**
|
|
64
|
-
* Get endpoints that should receive the event
|
|
65
|
-
*/
|
|
66
|
-
private getEndpointsForEvent;
|
|
67
|
-
/**
|
|
68
|
-
* Setup event batching
|
|
69
|
-
*/
|
|
70
|
-
private setupBatching;
|
|
71
|
-
/**
|
|
72
|
-
* Flush batched webhooks
|
|
73
|
-
*/
|
|
74
|
-
private flushBatch;
|
|
75
|
-
/**
|
|
76
|
-
* Validate webhook endpoints
|
|
77
|
-
*/
|
|
78
|
-
private validateEndpoints;
|
|
79
|
-
/**
|
|
80
|
-
* Get webhook plugin statistics
|
|
81
|
-
*/
|
|
82
|
-
getStats(): IWebhookPluginStats;
|
|
83
|
-
/**
|
|
84
|
-
* Clear webhook queue
|
|
85
|
-
*/
|
|
86
|
-
clearQueue(): void;
|
|
87
|
-
/**
|
|
88
|
-
* Cleanup on plugin destruction
|
|
89
|
-
*/
|
|
90
|
-
destroy(): Promise<void>;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=webhook-plugin.d.ts.map
|