@ductape/sdk 0.1.7 → 0.1.8
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/package.json +4 -2
- package/dist/agents/agent-context.d.ts +0 -100
- package/dist/agents/agent-context.js +0 -604
- package/dist/agents/agent-context.js.map +0 -1
- package/dist/agents/agent-executor.d.ts +0 -180
- package/dist/agents/agent-executor.js +0 -715
- package/dist/agents/agent-executor.js.map +0 -1
- package/dist/agents/agents.service.d.ts +0 -310
- package/dist/agents/agents.service.js +0 -1255
- package/dist/agents/agents.service.js.map +0 -1
- package/dist/agents/index.d.ts +0 -55
- package/dist/agents/index.js +0 -110
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/memory-manager.d.ts +0 -182
- package/dist/agents/memory-manager.js +0 -383
- package/dist/agents/memory-manager.js.map +0 -1
- package/dist/agents/tool-registry.d.ts +0 -141
- package/dist/agents/tool-registry.js +0 -355
- package/dist/agents/tool-registry.js.map +0 -1
- package/dist/agents/types/agents.types.d.ts +0 -1240
- package/dist/agents/types/agents.types.js +0 -12
- package/dist/agents/types/agents.types.js.map +0 -1
- package/dist/agents/types/index.d.ts +0 -6
- package/dist/agents/types/index.js +0 -23
- package/dist/agents/types/index.js.map +0 -1
- package/dist/agents/vector-store-adapter.d.ts +0 -108
- package/dist/agents/vector-store-adapter.js +0 -213
- package/dist/agents/vector-store-adapter.js.map +0 -1
- package/dist/api/services/appApi.service.d.ts +0 -78
- package/dist/api/services/appApi.service.js +0 -303
- package/dist/api/services/appApi.service.js.map +0 -1
- package/dist/api/services/logsApi.service.d.ts +0 -62
- package/dist/api/services/logsApi.service.js +0 -67
- package/dist/api/services/logsApi.service.js.map +0 -1
- package/dist/api/services/pricingApi.service.d.ts +0 -10
- package/dist/api/services/pricingApi.service.js +0 -34
- package/dist/api/services/pricingApi.service.js.map +0 -1
- package/dist/api/services/processorApi.service.d.ts +0 -927
- package/dist/api/services/processorApi.service.js +0 -787
- package/dist/api/services/processorApi.service.js.map +0 -1
- package/dist/api/services/productsApi.service.d.ts +0 -150
- package/dist/api/services/productsApi.service.js +0 -279
- package/dist/api/services/productsApi.service.js.map +0 -1
- package/dist/api/services/resilienceApi.service.d.ts +0 -106
- package/dist/api/services/resilienceApi.service.js +0 -224
- package/dist/api/services/resilienceApi.service.js.map +0 -1
- package/dist/api/services/secretsApi.service.d.ts +0 -51
- package/dist/api/services/secretsApi.service.js +0 -126
- package/dist/api/services/secretsApi.service.js.map +0 -1
- package/dist/api/services/userApi.service.d.ts +0 -10
- package/dist/api/services/userApi.service.js +0 -20
- package/dist/api/services/userApi.service.js.map +0 -1
- package/dist/api/services/webhooksApi.service.d.ts +0 -14
- package/dist/api/services/webhooksApi.service.js +0 -65
- package/dist/api/services/webhooksApi.service.js.map +0 -1
- package/dist/api/services/workflowApi.service.d.ts +0 -199
- package/dist/api/services/workflowApi.service.js +0 -201
- package/dist/api/services/workflowApi.service.js.map +0 -1
- package/dist/api/services/workspaceApi.service.d.ts +0 -20
- package/dist/api/services/workspaceApi.service.js +0 -54
- package/dist/api/services/workspaceApi.service.js.map +0 -1
- package/dist/api/urls.d.ts +0 -136
- package/dist/api/urls.js +0 -185
- package/dist/api/urls.js.map +0 -1
- package/dist/api/utils/auth.utils.d.ts +0 -10
- package/dist/api/utils/auth.utils.js +0 -24
- package/dist/api/utils/auth.utils.js.map +0 -1
- package/dist/api/utils/cache.utils.d.ts +0 -3
- package/dist/api/utils/cache.utils.js +0 -18
- package/dist/api/utils/cache.utils.js.map +0 -1
- package/dist/api/utils/strings.utils.d.ts +0 -7
- package/dist/api/utils/strings.utils.js +0 -64
- package/dist/api/utils/strings.utils.js.map +0 -1
- package/dist/apps/services/app.service.d.ts +0 -126
- package/dist/apps/services/app.service.js +0 -1436
- package/dist/apps/services/app.service.js.map +0 -1
- package/dist/apps/utils/auth-context-manager.d.ts +0 -137
- package/dist/apps/utils/auth-context-manager.js +0 -248
- package/dist/apps/utils/auth-context-manager.js.map +0 -1
- package/dist/apps/utils/credential-manager.d.ts +0 -128
- package/dist/apps/utils/credential-manager.js +0 -199
- package/dist/apps/utils/credential-manager.js.map +0 -1
- package/dist/apps/utils/index.d.ts +0 -10
- package/dist/apps/utils/index.js +0 -54
- package/dist/apps/utils/index.js.map +0 -1
- package/dist/apps/utils/input-helpers.d.ts +0 -67
- package/dist/apps/utils/input-helpers.js +0 -185
- package/dist/apps/utils/input-helpers.js.map +0 -1
- package/dist/apps/utils/input-resolver.d.ts +0 -165
- package/dist/apps/utils/input-resolver.js +0 -477
- package/dist/apps/utils/input-resolver.js.map +0 -1
- package/dist/apps/utils/oauth-manager.d.ts +0 -196
- package/dist/apps/utils/oauth-manager.js +0 -429
- package/dist/apps/utils/oauth-manager.js.map +0 -1
- package/dist/apps/utils/objects.utils.d.ts +0 -4
- package/dist/apps/utils/objects.utils.js +0 -59
- package/dist/apps/utils/objects.utils.js.map +0 -1
- package/dist/apps/utils/string.utils.d.ts +0 -9
- package/dist/apps/utils/string.utils.js +0 -89
- package/dist/apps/utils/string.utils.js.map +0 -1
- package/dist/apps/validators/index.d.ts +0 -17
- package/dist/apps/validators/index.js +0 -39
- package/dist/apps/validators/index.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.app.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.app.validator.js +0 -43
- package/dist/apps/validators/joi-validators/create.app.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +0 -72
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +0 -81
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js +0 -64
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appBody.validators.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appBody.validators.js +0 -44
- package/dist/apps/validators/joi-validators/create.appBody.validators.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js +0 -45
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js +0 -50
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js +0 -47
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +0 -60
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js +0 -48
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/sample.validator.d.ts +0 -6
- package/dist/apps/validators/joi-validators/sample.validator.js +0 -65
- package/dist/apps/validators/joi-validators/sample.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.app.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.app.validator.js +0 -66
- package/dist/apps/validators/joi-validators/update.app.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +0 -76
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +0 -57
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js +0 -52
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js +0 -45
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js +0 -50
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js +0 -47
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +0 -59
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js +0 -48
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js +0 -60
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
- package/dist/bin.d.ts +0 -26
- package/dist/bin.js +0 -28
- package/dist/bin.js.map +0 -1
- package/dist/brokers/brokers.service.d.ts +0 -438
- package/dist/brokers/brokers.service.js +0 -1294
- package/dist/brokers/brokers.service.js.map +0 -1
- package/dist/brokers/index.d.ts +0 -46
- package/dist/brokers/index.js +0 -83
- package/dist/brokers/index.js.map +0 -1
- package/dist/brokers/types/index.d.ts +0 -569
- package/dist/brokers/types/index.js +0 -8
- package/dist/brokers/types/index.js.map +0 -1
- package/dist/brokers/utils/broker.util.d.ts +0 -33
- package/dist/brokers/utils/broker.util.js +0 -125
- package/dist/brokers/utils/broker.util.js.map +0 -1
- package/dist/brokers/utils/providers/aws-sqs.service.d.ts +0 -16
- package/dist/brokers/utils/providers/aws-sqs.service.js +0 -71
- package/dist/brokers/utils/providers/aws-sqs.service.js.map +0 -1
- package/dist/brokers/utils/providers/google-pubsub.service.d.ts +0 -16
- package/dist/brokers/utils/providers/google-pubsub.service.js +0 -43
- package/dist/brokers/utils/providers/google-pubsub.service.js.map +0 -1
- package/dist/brokers/utils/providers/index.d.ts +0 -6
- package/dist/brokers/utils/providers/index.js +0 -16
- package/dist/brokers/utils/providers/index.js.map +0 -1
- package/dist/brokers/utils/providers/kafka.service.d.ts +0 -23
- package/dist/brokers/utils/providers/kafka.service.js +0 -131
- package/dist/brokers/utils/providers/kafka.service.js.map +0 -1
- package/dist/brokers/utils/providers/nats.service.d.ts +0 -18
- package/dist/brokers/utils/providers/nats.service.js +0 -63
- package/dist/brokers/utils/providers/nats.service.js.map +0 -1
- package/dist/brokers/utils/providers/rabbitmq.service.d.ts +0 -25
- package/dist/brokers/utils/providers/rabbitmq.service.js +0 -138
- package/dist/brokers/utils/providers/rabbitmq.service.js.map +0 -1
- package/dist/brokers/utils/providers/redis.service.d.ts +0 -18
- package/dist/brokers/utils/providers/redis.service.js +0 -93
- package/dist/brokers/utils/providers/redis.service.js.map +0 -1
- package/dist/cache/cache.manager.d.ts +0 -308
- package/dist/cache/cache.manager.js +0 -900
- package/dist/cache/cache.manager.js.map +0 -1
- package/dist/cache/cache.service.d.ts +0 -192
- package/dist/cache/cache.service.js +0 -596
- package/dist/cache/cache.service.js.map +0 -1
- package/dist/cache/index.d.ts +0 -52
- package/dist/cache/index.js +0 -81
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/types/index.d.ts +0 -112
- package/dist/cache/types/index.js +0 -6
- package/dist/cache/types/index.js.map +0 -1
- package/dist/clients/apps.client.d.ts +0 -4
- package/dist/clients/apps.client.js +0 -31
- package/dist/clients/apps.client.js.map +0 -1
- package/dist/clients/email.client.d.ts +0 -4
- package/dist/clients/email.client.js +0 -29
- package/dist/clients/email.client.js.map +0 -1
- package/dist/clients/expo.client.d.ts +0 -3
- package/dist/clients/expo.client.js +0 -28
- package/dist/clients/expo.client.js.map +0 -1
- package/dist/clients/function.client.d.ts +0 -3
- package/dist/clients/function.client.js +0 -27
- package/dist/clients/function.client.js.map +0 -1
- package/dist/clients/http.client.d.ts +0 -3
- package/dist/clients/http.client.js +0 -27
- package/dist/clients/http.client.js.map +0 -1
- package/dist/clients/logs.client.d.ts +0 -4
- package/dist/clients/logs.client.js +0 -34
- package/dist/clients/logs.client.js.map +0 -1
- package/dist/clients/pricing.client.d.ts +0 -4
- package/dist/clients/pricing.client.js +0 -34
- package/dist/clients/pricing.client.js.map +0 -1
- package/dist/clients/products.client.d.ts +0 -3
- package/dist/clients/products.client.js +0 -32
- package/dist/clients/products.client.js.map +0 -1
- package/dist/clients/users.client.d.ts +0 -4
- package/dist/clients/users.client.js +0 -34
- package/dist/clients/users.client.js.map +0 -1
- package/dist/clients/webhooks.client.d.ts +0 -4
- package/dist/clients/webhooks.client.js +0 -34
- package/dist/clients/webhooks.client.js.map +0 -1
- package/dist/clients/workspace.client.d.ts +0 -7
- package/dist/clients/workspace.client.js +0 -39
- package/dist/clients/workspace.client.js.map +0 -1
- package/dist/database/actions/action-manager.d.ts +0 -170
- package/dist/database/actions/action-manager.js +0 -465
- package/dist/database/actions/action-manager.js.map +0 -1
- package/dist/database/actions/index.d.ts +0 -6
- package/dist/database/actions/index.js +0 -13
- package/dist/database/actions/index.js.map +0 -1
- package/dist/database/adapters/adapter.factory.d.ts +0 -62
- package/dist/database/adapters/adapter.factory.js +0 -97
- package/dist/database/adapters/adapter.factory.js.map +0 -1
- package/dist/database/adapters/base.adapter.d.ts +0 -423
- package/dist/database/adapters/base.adapter.js +0 -260
- package/dist/database/adapters/base.adapter.js.map +0 -1
- package/dist/database/adapters/cassandra.adapter.d.ts +0 -92
- package/dist/database/adapters/cassandra.adapter.js +0 -1091
- package/dist/database/adapters/cassandra.adapter.js.map +0 -1
- package/dist/database/adapters/dynamodb.adapter.d.ts +0 -110
- package/dist/database/adapters/dynamodb.adapter.js +0 -1564
- package/dist/database/adapters/dynamodb.adapter.js.map +0 -1
- package/dist/database/adapters/index.d.ts +0 -11
- package/dist/database/adapters/index.js +0 -27
- package/dist/database/adapters/index.js.map +0 -1
- package/dist/database/adapters/mariadb.adapter.d.ts +0 -100
- package/dist/database/adapters/mariadb.adapter.js +0 -247
- package/dist/database/adapters/mariadb.adapter.js.map +0 -1
- package/dist/database/adapters/mongodb.adapter.d.ts +0 -121
- package/dist/database/adapters/mongodb.adapter.js +0 -1284
- package/dist/database/adapters/mongodb.adapter.js.map +0 -1
- package/dist/database/adapters/mysql.adapter.d.ts +0 -86
- package/dist/database/adapters/mysql.adapter.js +0 -1371
- package/dist/database/adapters/mysql.adapter.js.map +0 -1
- package/dist/database/adapters/postgresql.adapter.d.ts +0 -90
- package/dist/database/adapters/postgresql.adapter.js +0 -1487
- package/dist/database/adapters/postgresql.adapter.js.map +0 -1
- package/dist/database/databases.service.d.ts +0 -1496
- package/dist/database/databases.service.js +0 -3294
- package/dist/database/databases.service.js.map +0 -1
- package/dist/database/index.d.ts +0 -46
- package/dist/database/index.js +0 -109
- package/dist/database/index.js.map +0 -1
- package/dist/database/migrations/index.d.ts +0 -6
- package/dist/database/migrations/index.js +0 -12
- package/dist/database/migrations/index.js.map +0 -1
- package/dist/database/migrations/migration-engine.d.ts +0 -136
- package/dist/database/migrations/migration-engine.js +0 -1421
- package/dist/database/migrations/migration-engine.js.map +0 -1
- package/dist/database/operators/aggregation-builder.d.ts +0 -67
- package/dist/database/operators/aggregation-builder.js +0 -841
- package/dist/database/operators/aggregation-builder.js.map +0 -1
- package/dist/database/operators/index.d.ts +0 -7
- package/dist/database/operators/index.js +0 -15
- package/dist/database/operators/index.js.map +0 -1
- package/dist/database/operators/query-builder.d.ts +0 -69
- package/dist/database/operators/query-builder.js +0 -447
- package/dist/database/operators/query-builder.js.map +0 -1
- package/dist/database/presave/decrypt.d.ts +0 -25
- package/dist/database/presave/decrypt.js +0 -146
- package/dist/database/presave/decrypt.js.map +0 -1
- package/dist/database/presave/index.d.ts +0 -9
- package/dist/database/presave/index.js +0 -18
- package/dist/database/presave/index.js.map +0 -1
- package/dist/database/presave/presave-processor.d.ts +0 -148
- package/dist/database/presave/presave-processor.js +0 -702
- package/dist/database/presave/presave-processor.js.map +0 -1
- package/dist/database/schema/index.d.ts +0 -7
- package/dist/database/schema/index.js +0 -13
- package/dist/database/schema/index.js.map +0 -1
- package/dist/database/schema/schema-manager.d.ts +0 -258
- package/dist/database/schema/schema-manager.js +0 -638
- package/dist/database/schema/schema-manager.js.map +0 -1
- package/dist/database/transactions/index.d.ts +0 -6
- package/dist/database/transactions/index.js +0 -13
- package/dist/database/transactions/index.js.map +0 -1
- package/dist/database/transactions/transaction-manager.d.ts +0 -113
- package/dist/database/transactions/transaction-manager.js +0 -344
- package/dist/database/transactions/transaction-manager.js.map +0 -1
- package/dist/database/triggers/index.d.ts +0 -7
- package/dist/database/triggers/index.js +0 -14
- package/dist/database/triggers/index.js.map +0 -1
- package/dist/database/triggers/trigger-processor.d.ts +0 -239
- package/dist/database/triggers/trigger-processor.js +0 -1034
- package/dist/database/triggers/trigger-processor.js.map +0 -1
- package/dist/database/types/action.interface.d.ts +0 -148
- package/dist/database/types/action.interface.js +0 -6
- package/dist/database/types/action.interface.js.map +0 -1
- package/dist/database/types/aggregation.interface.d.ts +0 -185
- package/dist/database/types/aggregation.interface.js +0 -6
- package/dist/database/types/aggregation.interface.js.map +0 -1
- package/dist/database/types/connection.interface.d.ts +0 -137
- package/dist/database/types/connection.interface.js +0 -6
- package/dist/database/types/connection.interface.js.map +0 -1
- package/dist/database/types/dashboard.interface.d.ts +0 -74
- package/dist/database/types/dashboard.interface.js +0 -7
- package/dist/database/types/dashboard.interface.js.map +0 -1
- package/dist/database/types/enums.d.ts +0 -195
- package/dist/database/types/enums.js +0 -244
- package/dist/database/types/enums.js.map +0 -1
- package/dist/database/types/index.d.ts +0 -15
- package/dist/database/types/index.js +0 -31
- package/dist/database/types/index.js.map +0 -1
- package/dist/database/types/migration.interface.d.ts +0 -686
- package/dist/database/types/migration.interface.js +0 -9
- package/dist/database/types/migration.interface.js.map +0 -1
- package/dist/database/types/presave.interface.d.ts +0 -292
- package/dist/database/types/presave.interface.js +0 -60
- package/dist/database/types/presave.interface.js.map +0 -1
- package/dist/database/types/query.interface.d.ts +0 -205
- package/dist/database/types/query.interface.js +0 -6
- package/dist/database/types/query.interface.js.map +0 -1
- package/dist/database/types/schema.interface.d.ts +0 -412
- package/dist/database/types/schema.interface.js +0 -6
- package/dist/database/types/schema.interface.js.map +0 -1
- package/dist/database/types/transaction.interface.d.ts +0 -84
- package/dist/database/types/transaction.interface.js +0 -6
- package/dist/database/types/transaction.interface.js.map +0 -1
- package/dist/database/types/trigger.interface.d.ts +0 -612
- package/dist/database/types/trigger.interface.js +0 -121
- package/dist/database/types/trigger.interface.js.map +0 -1
- package/dist/database/types/write.interface.d.ts +0 -216
- package/dist/database/types/write.interface.js +0 -6
- package/dist/database/types/write.interface.js.map +0 -1
- package/dist/database/utils/database-error.d.ts +0 -96
- package/dist/database/utils/database-error.js +0 -221
- package/dist/database/utils/database-error.js.map +0 -1
- package/dist/database/utils/index.d.ts +0 -6
- package/dist/database/utils/index.js +0 -11
- package/dist/database/utils/index.js.map +0 -1
- package/dist/graph/adapters/adapter.factory.d.ts +0 -47
- package/dist/graph/adapters/adapter.factory.js +0 -77
- package/dist/graph/adapters/adapter.factory.js.map +0 -1
- package/dist/graph/adapters/arangodb.adapter.d.ts +0 -86
- package/dist/graph/adapters/arangodb.adapter.js +0 -1588
- package/dist/graph/adapters/arangodb.adapter.js.map +0 -1
- package/dist/graph/adapters/base.adapter.d.ts +0 -264
- package/dist/graph/adapters/base.adapter.js +0 -156
- package/dist/graph/adapters/base.adapter.js.map +0 -1
- package/dist/graph/adapters/index.d.ts +0 -11
- package/dist/graph/adapters/index.js +0 -21
- package/dist/graph/adapters/index.js.map +0 -1
- package/dist/graph/adapters/memgraph.adapter.d.ts +0 -110
- package/dist/graph/adapters/memgraph.adapter.js +0 -1452
- package/dist/graph/adapters/memgraph.adapter.js.map +0 -1
- package/dist/graph/adapters/neo4j.adapter.d.ts +0 -81
- package/dist/graph/adapters/neo4j.adapter.js +0 -1317
- package/dist/graph/adapters/neo4j.adapter.js.map +0 -1
- package/dist/graph/adapters/neptune.adapter.d.ts +0 -82
- package/dist/graph/adapters/neptune.adapter.js +0 -1369
- package/dist/graph/adapters/neptune.adapter.js.map +0 -1
- package/dist/graph/graphs.service.d.ts +0 -617
- package/dist/graph/graphs.service.js +0 -2594
- package/dist/graph/graphs.service.js.map +0 -1
- package/dist/graph/index.d.ts +0 -57
- package/dist/graph/index.js +0 -77
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/transactions/index.d.ts +0 -4
- package/dist/graph/transactions/index.js +0 -9
- package/dist/graph/transactions/index.js.map +0 -1
- package/dist/graph/transactions/transaction-manager.d.ts +0 -61
- package/dist/graph/transactions/transaction-manager.js +0 -126
- package/dist/graph/transactions/transaction-manager.js.map +0 -1
- package/dist/graph/types/connection.interface.d.ts +0 -149
- package/dist/graph/types/connection.interface.js +0 -9
- package/dist/graph/types/connection.interface.js.map +0 -1
- package/dist/graph/types/enums.d.ts +0 -101
- package/dist/graph/types/enums.js +0 -114
- package/dist/graph/types/enums.js.map +0 -1
- package/dist/graph/types/index.d.ts +0 -13
- package/dist/graph/types/index.js +0 -20
- package/dist/graph/types/index.js.map +0 -1
- package/dist/graph/types/node.interface.d.ts +0 -248
- package/dist/graph/types/node.interface.js +0 -9
- package/dist/graph/types/node.interface.js.map +0 -1
- package/dist/graph/types/query.interface.d.ts +0 -175
- package/dist/graph/types/query.interface.js +0 -9
- package/dist/graph/types/query.interface.js.map +0 -1
- package/dist/graph/types/relationship.interface.d.ts +0 -207
- package/dist/graph/types/relationship.interface.js +0 -9
- package/dist/graph/types/relationship.interface.js.map +0 -1
- package/dist/graph/types/schema.interface.d.ts +0 -295
- package/dist/graph/types/schema.interface.js +0 -9
- package/dist/graph/types/schema.interface.js.map +0 -1
- package/dist/graph/types/transaction.interface.d.ts +0 -55
- package/dist/graph/types/transaction.interface.js +0 -9
- package/dist/graph/types/transaction.interface.js.map +0 -1
- package/dist/graph/types/traversal.interface.d.ts +0 -181
- package/dist/graph/types/traversal.interface.js +0 -9
- package/dist/graph/types/traversal.interface.js.map +0 -1
- package/dist/graph/utils/graph-error.d.ts +0 -71
- package/dist/graph/utils/graph-error.js +0 -142
- package/dist/graph/utils/graph-error.js.map +0 -1
- package/dist/graph/utils/index.d.ts +0 -4
- package/dist/graph/utils/index.js +0 -9
- package/dist/graph/utils/index.js.map +0 -1
- package/dist/imports/imports.repo.d.ts +0 -0
- package/dist/imports/imports.repo.js +0 -1
- package/dist/imports/imports.repo.js.map +0 -1
- package/dist/imports/imports.service.d.ts +0 -23
- package/dist/imports/imports.service.js +0 -71
- package/dist/imports/imports.service.js.map +0 -1
- package/dist/imports/imports.types.d.ts +0 -350
- package/dist/imports/imports.types.js +0 -33
- package/dist/imports/imports.types.js.map +0 -1
- package/dist/imports/openAPI3.0.types.d.ts +0 -52
- package/dist/imports/openAPI3.0.types.js +0 -3
- package/dist/imports/openAPI3.0.types.js.map +0 -1
- package/dist/imports/repos/openApi.repo.d.ts +0 -6
- package/dist/imports/repos/openApi.repo.js +0 -422
- package/dist/imports/repos/openApi.repo.js.map +0 -1
- package/dist/imports/repos/postmanV21.repo.d.ts +0 -14
- package/dist/imports/repos/postmanV21.repo.js +0 -257
- package/dist/imports/repos/postmanV21.repo.js.map +0 -1
- package/dist/imports/utils/imports.utils.d.ts +0 -80
- package/dist/imports/utils/imports.utils.js +0 -114
- package/dist/imports/utils/imports.utils.js.map +0 -1
- package/dist/imports/validators/index.d.ts +0 -0
- package/dist/imports/validators/index.js +0 -1
- package/dist/imports/validators/index.js.map +0 -1
- package/dist/imports/validators/joi-validators/postmanV21.validator.d.ts +0 -5
- package/dist/imports/validators/joi-validators/postmanV21.validator.js +0 -96
- package/dist/imports/validators/joi-validators/postmanV21.validator.js.map +0 -1
- package/dist/index.d.ts +0 -4021
- package/dist/index.js +0 -5895
- package/dist/index.js.map +0 -1
- package/dist/init.interface.d.ts +0 -407
- package/dist/init.interface.js +0 -3
- package/dist/init.interface.js.map +0 -1
- package/dist/inputs/inputs.repo.d.ts +0 -7
- package/dist/inputs/inputs.repo.js +0 -16
- package/dist/inputs/inputs.repo.js.map +0 -1
- package/dist/inputs/inputs.service.d.ts +0 -61
- package/dist/inputs/inputs.service.js +0 -468
- package/dist/inputs/inputs.service.js.map +0 -1
- package/dist/inputs/utils/inputs.utils.create.d.ts +0 -11
- package/dist/inputs/utils/inputs.utils.create.js +0 -273
- package/dist/inputs/utils/inputs.utils.create.js.map +0 -1
- package/dist/inputs/validators/inputs.validator.parse.d.ts +0 -4
- package/dist/inputs/validators/inputs.validator.parse.js +0 -53
- package/dist/inputs/validators/inputs.validator.parse.js.map +0 -1
- package/dist/jobs/index.d.ts +0 -38
- package/dist/jobs/index.js +0 -50
- package/dist/jobs/index.js.map +0 -1
- package/dist/jobs/jobs.service.d.ts +0 -154
- package/dist/jobs/jobs.service.js +0 -491
- package/dist/jobs/jobs.service.js.map +0 -1
- package/dist/jobs/jobs.state.d.ts +0 -113
- package/dist/jobs/jobs.state.js +0 -447
- package/dist/jobs/jobs.state.js.map +0 -1
- package/dist/jobs/types.d.ts +0 -449
- package/dist/jobs/types.js +0 -74
- package/dist/jobs/types.js.map +0 -1
- package/dist/logs/logs.repo.d.ts +0 -6
- package/dist/logs/logs.repo.js +0 -12
- package/dist/logs/logs.repo.js.map +0 -1
- package/dist/logs/logs.service.d.ts +0 -30
- package/dist/logs/logs.service.js +0 -89
- package/dist/logs/logs.service.js.map +0 -1
- package/dist/logs/logs.types.d.ts +0 -85
- package/dist/logs/logs.types.js +0 -52
- package/dist/logs/logs.types.js.map +0 -1
- package/dist/logs/utils/logs.utils.create.d.ts +0 -0
- package/dist/logs/utils/logs.utils.create.js +0 -1
- package/dist/logs/utils/logs.utils.create.js.map +0 -1
- package/dist/logs/utils/logs.utils.errors.d.ts +0 -2
- package/dist/logs/utils/logs.utils.errors.js +0 -8
- package/dist/logs/utils/logs.utils.errors.js.map +0 -1
- package/dist/models/index.d.ts +0 -6
- package/dist/models/index.js +0 -11
- package/dist/models/index.js.map +0 -1
- package/dist/models/models.service.d.ts +0 -137
- package/dist/models/models.service.js +0 -195
- package/dist/models/models.service.js.map +0 -1
- package/dist/notifications/index.d.ts +0 -13
- package/dist/notifications/index.js +0 -26
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/notifications.service.d.ts +0 -268
- package/dist/notifications/notifications.service.js +0 -907
- package/dist/notifications/notifications.service.js.map +0 -1
- package/dist/notifications/types/index.d.ts +0 -4
- package/dist/notifications/types/index.js +0 -21
- package/dist/notifications/types/index.js.map +0 -1
- package/dist/notifications/types/notifications.types.d.ts +0 -454
- package/dist/notifications/types/notifications.types.js +0 -51
- package/dist/notifications/types/notifications.types.js.map +0 -1
- package/dist/parsers/index.d.ts +0 -3
- package/dist/parsers/index.js +0 -27
- package/dist/parsers/index.js.map +0 -1
- package/dist/parsers/pipelines/postman.pipelines.d.ts +0 -15
- package/dist/parsers/pipelines/postman.pipelines.js +0 -103
- package/dist/parsers/pipelines/postman.pipelines.js.map +0 -1
- package/dist/parsers/types/postman.types.d.ts +0 -200
- package/dist/parsers/types/postman.types.js +0 -3
- package/dist/parsers/types/postman.types.js.map +0 -1
- package/dist/parsers/utils/postman.utils.d.ts +0 -12
- package/dist/parsers/utils/postman.utils.js +0 -116
- package/dist/parsers/utils/postman.utils.js.map +0 -1
- package/dist/parsers/validators/postman-auth.validators.d.ts +0 -10
- package/dist/parsers/validators/postman-auth.validators.js +0 -127
- package/dist/parsers/validators/postman-auth.validators.js.map +0 -1
- package/dist/parsers/validators/postman-request.validators.d.ts +0 -13
- package/dist/parsers/validators/postman-request.validators.js +0 -139
- package/dist/parsers/validators/postman-request.validators.js.map +0 -1
- package/dist/parsers/validators/postman-response.validators.d.ts +0 -13
- package/dist/parsers/validators/postman-response.validators.js +0 -150
- package/dist/parsers/validators/postman-response.validators.js.map +0 -1
- package/dist/parsers/validators/postman-variable.validators.d.ts +0 -14
- package/dist/parsers/validators/postman-variable.validators.js +0 -163
- package/dist/parsers/validators/postman-variable.validators.js.map +0 -1
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +0 -1
- package/dist/pricing/pricing.repo.js.map +0 -1
- package/dist/pricing/pricing.service.d.ts +0 -24
- package/dist/pricing/pricing.service.js +0 -51
- package/dist/pricing/pricing.service.js.map +0 -1
- package/dist/pricing/pricing.types.d.ts +0 -76
- package/dist/pricing/pricing.types.js +0 -21
- package/dist/pricing/pricing.types.js.map +0 -1
- package/dist/pricing/utils/string.utils.d.ts +0 -1
- package/dist/pricing/utils/string.utils.js +0 -9
- package/dist/pricing/utils/string.utils.js.map +0 -1
- package/dist/processor/repos/mongo.repo.d.ts +0 -39
- package/dist/processor/repos/mongo.repo.js +0 -260
- package/dist/processor/repos/mongo.repo.js.map +0 -1
- package/dist/processor/repos/postgres.repo.d.ts +0 -31
- package/dist/processor/repos/postgres.repo.js +0 -185
- package/dist/processor/repos/postgres.repo.js.map +0 -1
- package/dist/processor/repos/sms.repo.d.ts +0 -39
- package/dist/processor/repos/sms.repo.js +0 -124
- package/dist/processor/repos/sms.repo.js.map +0 -1
- package/dist/processor/services/processor.service.d.ts +0 -465
- package/dist/processor/services/processor.service.js +0 -5343
- package/dist/processor/services/processor.service.js.map +0 -1
- package/dist/processor/services/request.service.d.ts +0 -36
- package/dist/processor/services/request.service.js +0 -304
- package/dist/processor/services/request.service.js.map +0 -1
- package/dist/processor/types/request.types.d.ts +0 -14
- package/dist/processor/types/request.types.js +0 -3
- package/dist/processor/types/request.types.js.map +0 -1
- package/dist/processor/utils/processor.utils.d.ts +0 -104
- package/dist/processor/utils/processor.utils.js +0 -1066
- package/dist/processor/utils/processor.utils.js.map +0 -1
- package/dist/processor/utils/request.utils.d.ts +0 -20
- package/dist/processor/utils/request.utils.js +0 -113
- package/dist/processor/utils/request.utils.js.map +0 -1
- package/dist/processor/utils/storage.util.d.ts +0 -8
- package/dist/processor/utils/storage.util.js +0 -106
- package/dist/processor/utils/storage.util.js.map +0 -1
- package/dist/products/services/products.service.d.ts +0 -577
- package/dist/products/services/products.service.js +0 -5845
- package/dist/products/services/products.service.js.map +0 -1
- package/dist/products/utils/crypt.utils.d.ts +0 -1
- package/dist/products/utils/crypt.utils.js +0 -17
- package/dist/products/utils/crypt.utils.js.map +0 -1
- package/dist/products/utils/functions.utils.d.ts +0 -13
- package/dist/products/utils/functions.utils.js +0 -294
- package/dist/products/utils/functions.utils.js.map +0 -1
- package/dist/products/utils/objects.utils.d.ts +0 -13
- package/dist/products/utils/objects.utils.js +0 -89
- package/dist/products/utils/objects.utils.js.map +0 -1
- package/dist/products/utils/string.utils.d.ts +0 -12
- package/dist/products/utils/string.utils.js +0 -168
- package/dist/products/utils/string.utils.js.map +0 -1
- package/dist/products/validators/index.d.ts +0 -33
- package/dist/products/validators/index.js +0 -75
- package/dist/products/validators/index.js.map +0 -1
- package/dist/products/validators/joi-validators/create.html.validator.d.ts +0 -2
- package/dist/products/validators/joi-validators/create.html.validator.js +0 -55
- package/dist/products/validators/joi-validators/create.html.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +0 -266
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productApp.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productApp.validator.js +0 -61
- package/dist/products/validators/joi-validators/create.productApp.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productCache.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productCache.validator.js +0 -46
- package/dist/products/validators/joi-validators/create.productCache.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabase.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +0 -77
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +0 -7
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +0 -194
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js +0 -63
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productEnv.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +0 -45
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFallback.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productFallback.validator.js +0 -64
- package/dist/products/validators/joi-validators/create.productFallback.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFeature.validator.d.ts +0 -14
- package/dist/products/validators/joi-validators/create.productFeature.validator.js +0 -140
- package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFunction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productFunction.validator.js +0 -57
- package/dist/products/validators/joi-validators/create.productFunction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +0 -89
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +0 -58
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productJob.validator.d.ts +0 -12
- package/dist/products/validators/joi-validators/create.productJob.validator.js +0 -60
- package/dist/products/validators/joi-validators/create.productJob.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +0 -52
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +0 -193
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productModel.validator.js +0 -132
- package/dist/products/validators/joi-validators/create.productModel.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotification.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +0 -241
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +0 -57
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotifications.validator.d.ts +0 -0
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js +0 -1
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productQuota.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productQuota.validator.js +0 -67
- package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productStorage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +0 -158
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productVector.validator.js +0 -136
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.products.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.products.validator.js +0 -43
- package/dist/products/validators/joi-validators/create.products.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.requestAction.validator.d.ts +0 -2
- package/dist/products/validators/joi-validators/create.requestAction.validator.js +0 -45
- package/dist/products/validators/joi-validators/create.requestAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +0 -48
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js +0 -48
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +0 -103
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productApp.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productApp.validator.js +0 -42
- package/dist/products/validators/joi-validators/update.productApp.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productCache.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productCache.validator.js +0 -45
- package/dist/products/validators/joi-validators/update.productCache.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabase.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js +0 -76
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +0 -79
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js +0 -64
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productEnv.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +0 -46
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFallback.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFallback.validator.js +0 -60
- package/dist/products/validators/joi-validators/update.productFallback.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFeature.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFeature.validator.js +0 -53
- package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFunction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFunction.validator.js +0 -41
- package/dist/products/validators/joi-validators/update.productFunction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +0 -88
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productJob.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productJob.validator.js +0 -50
- package/dist/products/validators/joi-validators/update.productJob.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +0 -52
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productNotification.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productNotification.validator.js +0 -47
- package/dist/products/validators/joi-validators/update.productNotification.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +0 -58
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productQuota.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productQuota.validator.js +0 -64
- package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +0 -48
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +0 -1
- package/dist/resilience/fallback.service.d.ts +0 -141
- package/dist/resilience/fallback.service.js +0 -766
- package/dist/resilience/fallback.service.js.map +0 -1
- package/dist/resilience/healthcheck.service.d.ts +0 -163
- package/dist/resilience/healthcheck.service.js +0 -1012
- package/dist/resilience/healthcheck.service.js.map +0 -1
- package/dist/resilience/index.d.ts +0 -104
- package/dist/resilience/index.js +0 -140
- package/dist/resilience/index.js.map +0 -1
- package/dist/resilience/quota.service.d.ts +0 -83
- package/dist/resilience/quota.service.js +0 -518
- package/dist/resilience/quota.service.js.map +0 -1
- package/dist/resilience/resilience.service.d.ts +0 -98
- package/dist/resilience/resilience.service.js +0 -560
- package/dist/resilience/resilience.service.js.map +0 -1
- package/dist/resilience/types/index.d.ts +0 -513
- package/dist/resilience/types/index.js +0 -29
- package/dist/resilience/types/index.js.map +0 -1
- package/dist/secrets/index.d.ts +0 -10
- package/dist/secrets/index.js +0 -33
- package/dist/secrets/index.js.map +0 -1
- package/dist/secrets/secrets.resolver.d.ts +0 -52
- package/dist/secrets/secrets.resolver.js +0 -236
- package/dist/secrets/secrets.resolver.js.map +0 -1
- package/dist/secrets/secrets.service.d.ts +0 -93
- package/dist/secrets/secrets.service.js +0 -246
- package/dist/secrets/secrets.service.js.map +0 -1
- package/dist/secrets/secrets.types.d.ts +0 -188
- package/dist/secrets/secrets.types.js +0 -87
- package/dist/secrets/secrets.types.js.map +0 -1
- package/dist/sessions/index.d.ts +0 -50
- package/dist/sessions/index.js +0 -96
- package/dist/sessions/index.js.map +0 -1
- package/dist/sessions/sessions.helper.d.ts +0 -88
- package/dist/sessions/sessions.helper.js +0 -190
- package/dist/sessions/sessions.helper.js.map +0 -1
- package/dist/sessions/sessions.resolver.d.ts +0 -188
- package/dist/sessions/sessions.resolver.js +0 -603
- package/dist/sessions/sessions.resolver.js.map +0 -1
- package/dist/sessions/sessions.service.d.ts +0 -194
- package/dist/sessions/sessions.service.js +0 -988
- package/dist/sessions/sessions.service.js.map +0 -1
- package/dist/sessions/types/index.d.ts +0 -344
- package/dist/sessions/types/index.js +0 -6
- package/dist/sessions/types/index.js.map +0 -1
- package/dist/storage/index.d.ts +0 -66
- package/dist/storage/index.js +0 -99
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/storage.service.d.ts +0 -177
- package/dist/storage/storage.service.js +0 -905
- package/dist/storage/storage.service.js.map +0 -1
- package/dist/storage/types/index.d.ts +0 -270
- package/dist/storage/types/index.js +0 -6
- package/dist/storage/types/index.js.map +0 -1
- package/dist/storage/utils/storage.util.d.ts +0 -62
- package/dist/storage/utils/storage.util.js +0 -593
- package/dist/storage/utils/storage.util.js.map +0 -1
- package/dist/types/actions.types.d.ts +0 -0
- package/dist/types/actions.types.js +0 -1
- package/dist/types/actions.types.js.map +0 -1
- package/dist/types/appBuilder.types.d.ts +0 -316
- package/dist/types/appBuilder.types.js +0 -3
- package/dist/types/appBuilder.types.js.map +0 -1
- package/dist/types/database.types.d.ts +0 -9
- package/dist/types/database.types.js +0 -3
- package/dist/types/database.types.js.map +0 -1
- package/dist/types/enums.d.ts +0 -231
- package/dist/types/enums.js +0 -261
- package/dist/types/enums.js.map +0 -1
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.js +0 -29
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.types.d.ts +0 -30
- package/dist/types/index.types.js +0 -9
- package/dist/types/index.types.js.map +0 -1
- package/dist/types/inputs.types.d.ts +0 -114
- package/dist/types/inputs.types.js +0 -44
- package/dist/types/inputs.types.js.map +0 -1
- package/dist/types/logs.types.d.ts +0 -19
- package/dist/types/logs.types.js +0 -8
- package/dist/types/logs.types.js.map +0 -1
- package/dist/types/pricing.types.d.ts +0 -4
- package/dist/types/pricing.types.js +0 -3
- package/dist/types/pricing.types.js.map +0 -1
- package/dist/types/processor.types.d.ts +0 -602
- package/dist/types/processor.types.js +0 -19
- package/dist/types/processor.types.js.map +0 -1
- package/dist/types/productsBuilder.types.d.ts +0 -1566
- package/dist/types/productsBuilder.types.js +0 -303
- package/dist/types/productsBuilder.types.js.map +0 -1
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +0 -1
- package/dist/types/request-tracker.interface.js.map +0 -1
- package/dist/types/requests.types.d.ts +0 -8
- package/dist/types/requests.types.js +0 -3
- package/dist/types/requests.types.js.map +0 -1
- package/dist/types/workspaces.types.d.ts +0 -28
- package/dist/types/workspaces.types.js +0 -4
- package/dist/types/workspaces.types.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.js +0 -5
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -109
- package/dist/utils/index.js.map +0 -1
- package/dist/vector/actions/action-manager.d.ts +0 -140
- package/dist/vector/actions/action-manager.js +0 -356
- package/dist/vector/actions/action-manager.js.map +0 -1
- package/dist/vector/adapters/base.adapter.d.ts +0 -169
- package/dist/vector/adapters/base.adapter.js +0 -218
- package/dist/vector/adapters/base.adapter.js.map +0 -1
- package/dist/vector/adapters/index.d.ts +0 -10
- package/dist/vector/adapters/index.js +0 -19
- package/dist/vector/adapters/index.js.map +0 -1
- package/dist/vector/adapters/memory.adapter.d.ts +0 -85
- package/dist/vector/adapters/memory.adapter.js +0 -505
- package/dist/vector/adapters/memory.adapter.js.map +0 -1
- package/dist/vector/adapters/pinecone.adapter.d.ts +0 -52
- package/dist/vector/adapters/pinecone.adapter.js +0 -433
- package/dist/vector/adapters/pinecone.adapter.js.map +0 -1
- package/dist/vector/adapters/qdrant.adapter.d.ts +0 -56
- package/dist/vector/adapters/qdrant.adapter.js +0 -442
- package/dist/vector/adapters/qdrant.adapter.js.map +0 -1
- package/dist/vector/adapters/weaviate.adapter.d.ts +0 -68
- package/dist/vector/adapters/weaviate.adapter.js +0 -661
- package/dist/vector/adapters/weaviate.adapter.js.map +0 -1
- package/dist/vector/index.d.ts +0 -36
- package/dist/vector/index.js +0 -70
- package/dist/vector/index.js.map +0 -1
- package/dist/vector/types/action.interface.d.ts +0 -195
- package/dist/vector/types/action.interface.js +0 -100
- package/dist/vector/types/action.interface.js.map +0 -1
- package/dist/vector/types/connection.interface.d.ts +0 -151
- package/dist/vector/types/connection.interface.js +0 -8
- package/dist/vector/types/connection.interface.js.map +0 -1
- package/dist/vector/types/embedding.interface.d.ts +0 -144
- package/dist/vector/types/embedding.interface.js +0 -8
- package/dist/vector/types/embedding.interface.js.map +0 -1
- package/dist/vector/types/enums.d.ts +0 -104
- package/dist/vector/types/enums.js +0 -113
- package/dist/vector/types/enums.js.map +0 -1
- package/dist/vector/types/index.d.ts +0 -11
- package/dist/vector/types/index.js +0 -23
- package/dist/vector/types/index.js.map +0 -1
- package/dist/vector/types/vector.interface.d.ts +0 -315
- package/dist/vector/types/vector.interface.js +0 -8
- package/dist/vector/types/vector.interface.js.map +0 -1
- package/dist/vector/utils/index.d.ts +0 -6
- package/dist/vector/utils/index.js +0 -11
- package/dist/vector/utils/index.js.map +0 -1
- package/dist/vector/utils/vector-error.d.ts +0 -69
- package/dist/vector/utils/vector-error.js +0 -116
- package/dist/vector/utils/vector-error.js.map +0 -1
- package/dist/vector/vector-database.service.d.ts +0 -484
- package/dist/vector/vector-database.service.js +0 -1002
- package/dist/vector/vector-database.service.js.map +0 -1
- package/dist/vector/vector.service.d.ts +0 -283
- package/dist/vector/vector.service.js +0 -544
- package/dist/vector/vector.service.js.map +0 -1
- package/dist/warehouse/executor/index.d.ts +0 -5
- package/dist/warehouse/executor/index.js +0 -12
- package/dist/warehouse/executor/index.js.map +0 -1
- package/dist/warehouse/executor/joins/index.d.ts +0 -5
- package/dist/warehouse/executor/joins/index.js +0 -11
- package/dist/warehouse/executor/joins/index.js.map +0 -1
- package/dist/warehouse/executor/joins/join-executor.d.ts +0 -101
- package/dist/warehouse/executor/joins/join-executor.js +0 -493
- package/dist/warehouse/executor/joins/join-executor.js.map +0 -1
- package/dist/warehouse/executor/joins/semantic-join.d.ts +0 -64
- package/dist/warehouse/executor/joins/semantic-join.js +0 -241
- package/dist/warehouse/executor/joins/semantic-join.js.map +0 -1
- package/dist/warehouse/executor/single-source-executor.d.ts +0 -155
- package/dist/warehouse/executor/single-source-executor.js +0 -573
- package/dist/warehouse/executor/single-source-executor.js.map +0 -1
- package/dist/warehouse/index.d.ts +0 -79
- package/dist/warehouse/index.js +0 -111
- package/dist/warehouse/index.js.map +0 -1
- package/dist/warehouse/parser/index.d.ts +0 -4
- package/dist/warehouse/parser/index.js +0 -10
- package/dist/warehouse/parser/index.js.map +0 -1
- package/dist/warehouse/parser/query-parser.d.ts +0 -181
- package/dist/warehouse/parser/query-parser.js +0 -415
- package/dist/warehouse/parser/query-parser.js.map +0 -1
- package/dist/warehouse/registry/data-source-registry.d.ts +0 -207
- package/dist/warehouse/registry/data-source-registry.js +0 -396
- package/dist/warehouse/registry/data-source-registry.js.map +0 -1
- package/dist/warehouse/registry/index.d.ts +0 -4
- package/dist/warehouse/registry/index.js +0 -9
- package/dist/warehouse/registry/index.js.map +0 -1
- package/dist/warehouse/transactions/index.d.ts +0 -4
- package/dist/warehouse/transactions/index.js +0 -9
- package/dist/warehouse/transactions/index.js.map +0 -1
- package/dist/warehouse/transactions/saga-orchestrator.d.ts +0 -92
- package/dist/warehouse/transactions/saga-orchestrator.js +0 -383
- package/dist/warehouse/transactions/saga-orchestrator.js.map +0 -1
- package/dist/warehouse/types/index.d.ts +0 -9
- package/dist/warehouse/types/index.js +0 -33
- package/dist/warehouse/types/index.js.map +0 -1
- package/dist/warehouse/types/join.interface.d.ts +0 -225
- package/dist/warehouse/types/join.interface.js +0 -87
- package/dist/warehouse/types/join.interface.js.map +0 -1
- package/dist/warehouse/types/query.interface.d.ts +0 -232
- package/dist/warehouse/types/query.interface.js +0 -9
- package/dist/warehouse/types/query.interface.js.map +0 -1
- package/dist/warehouse/types/transaction.interface.d.ts +0 -236
- package/dist/warehouse/types/transaction.interface.js +0 -74
- package/dist/warehouse/types/transaction.interface.js.map +0 -1
- package/dist/warehouse/types/where.interface.d.ts +0 -208
- package/dist/warehouse/types/where.interface.js +0 -89
- package/dist/warehouse/types/where.interface.js.map +0 -1
- package/dist/warehouse/warehouse.service.d.ts +0 -200
- package/dist/warehouse/warehouse.service.js +0 -470
- package/dist/warehouse/warehouse.service.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -30
- package/dist/workflows/index.js +0 -64
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/types/index.d.ts +0 -6
- package/dist/workflows/types/index.js +0 -23
- package/dist/workflows/types/index.js.map +0 -1
- package/dist/workflows/types/workflows.types.d.ts +0 -1095
- package/dist/workflows/types/workflows.types.js +0 -13
- package/dist/workflows/types/workflows.types.js.map +0 -1
- package/dist/workflows/workflow-builder.d.ts +0 -70
- package/dist/workflows/workflow-builder.js +0 -353
- package/dist/workflows/workflow-builder.js.map +0 -1
- package/dist/workflows/workflow-executor.d.ts +0 -289
- package/dist/workflows/workflow-executor.js +0 -2467
- package/dist/workflows/workflow-executor.js.map +0 -1
- package/dist/workflows/workflows.service.d.ts +0 -412
- package/dist/workflows/workflows.service.js +0 -2233
- package/dist/workflows/workflows.service.js.map +0 -1
|
@@ -1,1255 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Agents Service
|
|
4
|
-
*
|
|
5
|
-
* Main service class for agentic workflows operations.
|
|
6
|
-
* Provides CRUD operations and execution for Ductape Agents.
|
|
7
|
-
*
|
|
8
|
-
* Agentic workflows extend Ductape's workflow engine to support AI-driven,
|
|
9
|
-
* autonomous multi-step processes where an LLM dynamically decides the
|
|
10
|
-
* next action based on observations and reasoning.
|
|
11
|
-
*/
|
|
12
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
-
}
|
|
18
|
-
Object.defineProperty(o, k2, desc);
|
|
19
|
-
}) : (function(o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
}));
|
|
23
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
-
}) : function(o, v) {
|
|
26
|
-
o["default"] = v;
|
|
27
|
-
});
|
|
28
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
-
var ownKeys = function(o) {
|
|
30
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
-
var ar = [];
|
|
32
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
-
return ar;
|
|
34
|
-
};
|
|
35
|
-
return ownKeys(o);
|
|
36
|
-
};
|
|
37
|
-
return function (mod) {
|
|
38
|
-
if (mod && mod.__esModule) return mod;
|
|
39
|
-
var result = {};
|
|
40
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
-
__setModuleDefault(result, mod);
|
|
42
|
-
return result;
|
|
43
|
-
};
|
|
44
|
-
})();
|
|
45
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
-
};
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.agentsService = exports.AgentsService = exports.AgentError = void 0;
|
|
50
|
-
const crypto_1 = require("crypto");
|
|
51
|
-
const products_service_1 = __importDefault(require("../products/services/products.service"));
|
|
52
|
-
const processor_service_1 = __importDefault(require("../processor/services/processor.service"));
|
|
53
|
-
const logs_service_1 = __importDefault(require("../logs/logs.service"));
|
|
54
|
-
const logs_types_1 = require("../logs/logs.types");
|
|
55
|
-
const processor_utils_1 = require("../processor/utils/processor.utils");
|
|
56
|
-
const productsBuilder_types_1 = require("../types/productsBuilder.types");
|
|
57
|
-
const tool_registry_1 = require("./tool-registry");
|
|
58
|
-
const agent_executor_1 = require("./agent-executor");
|
|
59
|
-
const quota_service_1 = require("../resilience/quota.service");
|
|
60
|
-
const fallback_service_1 = require("../resilience/fallback.service");
|
|
61
|
-
const healthcheck_service_1 = require("../resilience/healthcheck.service");
|
|
62
|
-
const secrets_1 = require("../secrets");
|
|
63
|
-
/**
|
|
64
|
-
* Error class for agent-related errors
|
|
65
|
-
*/
|
|
66
|
-
class AgentError extends Error {
|
|
67
|
-
constructor(message, code, details) {
|
|
68
|
-
super(message);
|
|
69
|
-
this.code = code;
|
|
70
|
-
this.details = details;
|
|
71
|
-
this.name = 'AgentError';
|
|
72
|
-
}
|
|
73
|
-
static configurationError(message) {
|
|
74
|
-
return new AgentError(message, 'CONFIGURATION_ERROR');
|
|
75
|
-
}
|
|
76
|
-
static validationError(message, details) {
|
|
77
|
-
return new AgentError(message, 'VALIDATION_ERROR', details);
|
|
78
|
-
}
|
|
79
|
-
static notFoundError(message) {
|
|
80
|
-
return new AgentError(message, 'NOT_FOUND');
|
|
81
|
-
}
|
|
82
|
-
static executionError(message, details) {
|
|
83
|
-
return new AgentError(message, 'EXECUTION_ERROR', details);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.AgentError = AgentError;
|
|
87
|
-
/**
|
|
88
|
-
* Main Agents Service class
|
|
89
|
-
* Provides unified interface for agent management and execution
|
|
90
|
-
*/
|
|
91
|
-
class AgentsService {
|
|
92
|
-
/**
|
|
93
|
-
* Create a new AgentsService instance
|
|
94
|
-
* @param config - Optional configuration for authentication and workspace context
|
|
95
|
-
*/
|
|
96
|
-
constructor(config) {
|
|
97
|
-
/** Service configuration */
|
|
98
|
-
this.config = null;
|
|
99
|
-
/** ProductBuilder instances cache (keyed by product tag) */
|
|
100
|
-
this.productBuilders = new Map();
|
|
101
|
-
/** Local agent definitions */
|
|
102
|
-
this.localAgents = new Map();
|
|
103
|
-
/** Tool registries per agent */
|
|
104
|
-
this.toolRegistries = new Map();
|
|
105
|
-
/** Active executors (for status/signal handling) */
|
|
106
|
-
this.activeExecutors = new Map();
|
|
107
|
-
/** LogService instance for logging operations */
|
|
108
|
-
this.logService = null;
|
|
109
|
-
/** Current product ID for logging */
|
|
110
|
-
this.productId = '';
|
|
111
|
-
this.config = config || null;
|
|
112
|
-
this._privateKey = config ? config.private_key : '';
|
|
113
|
-
}
|
|
114
|
-
// ==================== CONFIGURATION ====================
|
|
115
|
-
/**
|
|
116
|
-
* Update service configuration
|
|
117
|
-
*/
|
|
118
|
-
updateConfig(config) {
|
|
119
|
-
this.config = config;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Get service configuration
|
|
123
|
-
*/
|
|
124
|
-
getConfig() {
|
|
125
|
-
return this.config;
|
|
126
|
-
}
|
|
127
|
-
// ==================== PRODUCT BUILDER MANAGEMENT ====================
|
|
128
|
-
/**
|
|
129
|
-
* Create a new ProductBuilder instance
|
|
130
|
-
*/
|
|
131
|
-
createNewProductBuilder() {
|
|
132
|
-
if (!this.config) {
|
|
133
|
-
throw AgentError.configurationError('AgentsService not configured. Please provide config when initializing.');
|
|
134
|
-
}
|
|
135
|
-
return new products_service_1.default({
|
|
136
|
-
workspace_id: this.config.workspace_id,
|
|
137
|
-
public_key: this.config.public_key,
|
|
138
|
-
user_id: this.config.user_id,
|
|
139
|
-
token: this.config.token,
|
|
140
|
-
env_type: this.config.env_type,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get or create a ProductBuilder instance for the given product tag
|
|
145
|
-
*/
|
|
146
|
-
async getProductBuilder(productTag) {
|
|
147
|
-
let builder = this.productBuilders.get(productTag);
|
|
148
|
-
if (!builder) {
|
|
149
|
-
builder = this.createNewProductBuilder();
|
|
150
|
-
await builder.initializeProductByTag(productTag);
|
|
151
|
-
this.productBuilders.set(productTag, builder);
|
|
152
|
-
this.productId = builder.fetchProductId() || '';
|
|
153
|
-
}
|
|
154
|
-
return builder;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Initialize logging service
|
|
158
|
-
*/
|
|
159
|
-
initializeLogService() {
|
|
160
|
-
var _a;
|
|
161
|
-
if (!this.logService && this.config) {
|
|
162
|
-
this.logService = new logs_service_1.default({
|
|
163
|
-
product_id: this.productId,
|
|
164
|
-
workspace_id: this.config.workspace_id,
|
|
165
|
-
public_key: this.config.public_key,
|
|
166
|
-
user_id: this.config.user_id,
|
|
167
|
-
token: this.config.token,
|
|
168
|
-
env_type: this.config.env_type,
|
|
169
|
-
workspace_private_key: (_a = this._privateKey) !== null && _a !== void 0 ? _a : undefined,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Create a new ProcessorService instance
|
|
175
|
-
*/
|
|
176
|
-
createNewProcessor() {
|
|
177
|
-
if (!this.config) {
|
|
178
|
-
throw AgentError.configurationError('AgentsService not configured. Please provide config when initializing.');
|
|
179
|
-
}
|
|
180
|
-
return new processor_service_1.default({
|
|
181
|
-
workspace_id: this.config.workspace_id,
|
|
182
|
-
public_key: this.config.public_key,
|
|
183
|
-
user_id: this.config.user_id,
|
|
184
|
-
token: this.config.token,
|
|
185
|
-
env_type: this.config.env_type,
|
|
186
|
-
redis_client: this.config.redis_client,
|
|
187
|
-
private_key: this._privateKey,
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Create a resilience service wrapper for agent operations
|
|
192
|
-
*/
|
|
193
|
-
createResilienceService() {
|
|
194
|
-
if (!this.config) {
|
|
195
|
-
return undefined;
|
|
196
|
-
}
|
|
197
|
-
const serviceConfig = {
|
|
198
|
-
workspace_id: this.config.workspace_id,
|
|
199
|
-
public_key: this.config.public_key,
|
|
200
|
-
user_id: this.config.user_id,
|
|
201
|
-
token: this.config.token,
|
|
202
|
-
env_type: this.config.env_type,
|
|
203
|
-
private_key: this._privateKey,
|
|
204
|
-
access_key: this.config.access_key,
|
|
205
|
-
};
|
|
206
|
-
// Create individual services
|
|
207
|
-
const quotaService = new quota_service_1.QuotaService(serviceConfig);
|
|
208
|
-
const fallbackService = new fallback_service_1.FallbackService(serviceConfig);
|
|
209
|
-
const healthcheckService = new healthcheck_service_1.HealthcheckService(serviceConfig);
|
|
210
|
-
// Return a wrapper that delegates to the appropriate service
|
|
211
|
-
return {
|
|
212
|
-
async runQuota(options) {
|
|
213
|
-
return quotaService.run({
|
|
214
|
-
product: options.product,
|
|
215
|
-
env: options.env,
|
|
216
|
-
tag: options.tag,
|
|
217
|
-
input: options.input,
|
|
218
|
-
session: options.session,
|
|
219
|
-
});
|
|
220
|
-
},
|
|
221
|
-
async runFallback(options) {
|
|
222
|
-
return fallbackService.run({
|
|
223
|
-
product: options.product,
|
|
224
|
-
env: options.env,
|
|
225
|
-
tag: options.tag,
|
|
226
|
-
input: options.input,
|
|
227
|
-
session: options.session,
|
|
228
|
-
});
|
|
229
|
-
},
|
|
230
|
-
async checkHealth(options) {
|
|
231
|
-
return healthcheckService.getStatus({
|
|
232
|
-
product: options.product,
|
|
233
|
-
env: options.env,
|
|
234
|
-
tag: options.tag,
|
|
235
|
-
});
|
|
236
|
-
},
|
|
237
|
-
async getQuotaStatus(options) {
|
|
238
|
-
// This would need to be implemented in QuotaService
|
|
239
|
-
// For now, return basic status
|
|
240
|
-
return {
|
|
241
|
-
tag: options.tag,
|
|
242
|
-
totalQuota: undefined,
|
|
243
|
-
usedQuota: undefined,
|
|
244
|
-
remainingQuota: undefined,
|
|
245
|
-
providers: [],
|
|
246
|
-
};
|
|
247
|
-
},
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Get context services for agent execution
|
|
252
|
-
*/
|
|
253
|
-
getContextServices(resilienceConfig) {
|
|
254
|
-
return {
|
|
255
|
-
config: this.config,
|
|
256
|
-
processorService: this.createNewProcessor(),
|
|
257
|
-
resilienceService: this.createResilienceService(),
|
|
258
|
-
resilienceConfig,
|
|
259
|
-
// Note: These services would be injected from the main Ductape class
|
|
260
|
-
// databaseService, graphService, storageService, brokersService
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
// ==================== AGENT DEFINITION ====================
|
|
264
|
-
/**
|
|
265
|
-
* Define a new agent and optionally persist to database
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```ts
|
|
269
|
-
* // Define and persist to database
|
|
270
|
-
* const agent = await ductape.agents.define({
|
|
271
|
-
* product: 'my-product',
|
|
272
|
-
* tag: 'customer-support',
|
|
273
|
-
* name: 'Customer Support Agent',
|
|
274
|
-
* model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' },
|
|
275
|
-
* systemPrompt: 'You are a helpful customer support agent...',
|
|
276
|
-
* tools: [
|
|
277
|
-
* {
|
|
278
|
-
* tag: 'lookup-order',
|
|
279
|
-
* description: 'Look up order details',
|
|
280
|
-
* parameters: { orderId: { type: 'string', description: 'Order ID' } },
|
|
281
|
-
* handler: async (ctx, params) => ctx.database.query({ ... }),
|
|
282
|
-
* },
|
|
283
|
-
* ],
|
|
284
|
-
* });
|
|
285
|
-
* ```
|
|
286
|
-
*/
|
|
287
|
-
async define(options) {
|
|
288
|
-
var _a;
|
|
289
|
-
// Validate required fields
|
|
290
|
-
if (!options.tag) {
|
|
291
|
-
throw AgentError.validationError('Agent tag is required');
|
|
292
|
-
}
|
|
293
|
-
if (!options.name) {
|
|
294
|
-
throw AgentError.validationError('Agent name is required');
|
|
295
|
-
}
|
|
296
|
-
if (!options.model) {
|
|
297
|
-
throw AgentError.validationError('Agent model configuration is required');
|
|
298
|
-
}
|
|
299
|
-
if (!options.systemPrompt) {
|
|
300
|
-
throw AgentError.validationError('Agent system prompt is required');
|
|
301
|
-
}
|
|
302
|
-
// Create tool registry
|
|
303
|
-
const toolRegistry = new tool_registry_1.ToolRegistry();
|
|
304
|
-
if (options.tools && options.tools.length > 0) {
|
|
305
|
-
toolRegistry.registerMany(options.tools);
|
|
306
|
-
}
|
|
307
|
-
// Store tool registry (with handlers for local execution)
|
|
308
|
-
this.toolRegistries.set(options.tag, toolRegistry);
|
|
309
|
-
// Get tool schemas (without handlers for storage)
|
|
310
|
-
const toolSchemas = toolRegistry.getSchemas();
|
|
311
|
-
// Create defined agent (without handlers for storage)
|
|
312
|
-
const definedAgent = {
|
|
313
|
-
tag: options.tag,
|
|
314
|
-
name: options.name,
|
|
315
|
-
description: options.description,
|
|
316
|
-
model: options.model,
|
|
317
|
-
modelConfig: options.modelConfig,
|
|
318
|
-
systemPrompt: options.systemPrompt,
|
|
319
|
-
toolSchemas,
|
|
320
|
-
termination: options.termination,
|
|
321
|
-
memory: options.memory,
|
|
322
|
-
humanInLoop: options.humanInLoop,
|
|
323
|
-
streaming: options.streaming,
|
|
324
|
-
inputSchema: options.inputSchema,
|
|
325
|
-
envs: options.envs,
|
|
326
|
-
resilience: options.resilience,
|
|
327
|
-
};
|
|
328
|
-
// Store locally
|
|
329
|
-
this.localAgents.set(options.tag, definedAgent);
|
|
330
|
-
// If product is specified, persist to database
|
|
331
|
-
if (options.product) {
|
|
332
|
-
try {
|
|
333
|
-
const productBuilder = await this.getProductBuilder(options.product);
|
|
334
|
-
// Convert to IProductAgent format for storage
|
|
335
|
-
const productAgent = {
|
|
336
|
-
tag: options.tag,
|
|
337
|
-
name: options.name,
|
|
338
|
-
description: options.description,
|
|
339
|
-
model: options.model, // Model is a tag reference to product-level model config
|
|
340
|
-
modelConfig: options.modelConfig,
|
|
341
|
-
systemPrompt: options.systemPrompt,
|
|
342
|
-
tools: toolSchemas.map((schema) => ({
|
|
343
|
-
tag: schema.tag,
|
|
344
|
-
name: schema.name,
|
|
345
|
-
description: schema.description,
|
|
346
|
-
parameters: schema.parameters,
|
|
347
|
-
requiresConfirmation: schema.requiresConfirmation,
|
|
348
|
-
costEstimate: schema.costEstimate,
|
|
349
|
-
timeout: schema.timeout,
|
|
350
|
-
retries: schema.retries,
|
|
351
|
-
})),
|
|
352
|
-
termination: options.termination ? {
|
|
353
|
-
maxIterations: options.termination.maxIterations,
|
|
354
|
-
maxTokens: options.termination.maxTokens,
|
|
355
|
-
timeout: typeof options.termination.timeout === 'string'
|
|
356
|
-
? parseInt(options.termination.timeout)
|
|
357
|
-
: options.termination.timeout,
|
|
358
|
-
allowManualStop: options.termination.allowManualStop,
|
|
359
|
-
} : undefined,
|
|
360
|
-
memory: options.memory ? {
|
|
361
|
-
shortTerm: options.memory.shortTerm,
|
|
362
|
-
longTerm: options.memory.longTerm,
|
|
363
|
-
} : undefined,
|
|
364
|
-
humanInLoop: options.humanInLoop ? {
|
|
365
|
-
enabled: options.humanInLoop.enabled,
|
|
366
|
-
alwaysRequireApproval: options.humanInLoop.alwaysRequireApproval,
|
|
367
|
-
approvalTimeout: typeof options.humanInLoop.approvalTimeout === 'string'
|
|
368
|
-
? parseInt(options.humanInLoop.approvalTimeout)
|
|
369
|
-
: options.humanInLoop.approvalTimeout,
|
|
370
|
-
approvalWebhook: options.humanInLoop.approvalWebhook,
|
|
371
|
-
approvalBroker: options.humanInLoop.approvalBroker,
|
|
372
|
-
} : undefined,
|
|
373
|
-
streaming: options.streaming ? {
|
|
374
|
-
enabled: options.streaming.enabled,
|
|
375
|
-
events: options.streaming.events,
|
|
376
|
-
webhook: options.streaming.webhook,
|
|
377
|
-
broker: options.streaming.broker,
|
|
378
|
-
} : undefined,
|
|
379
|
-
inputSchema: options.inputSchema,
|
|
380
|
-
envs: (_a = options.envs) === null || _a === void 0 ? void 0 : _a.map((env) => ({
|
|
381
|
-
slug: env.slug,
|
|
382
|
-
active: env.active,
|
|
383
|
-
model: env.model, // Model tag override for this environment
|
|
384
|
-
modelConfig: env.modelConfig,
|
|
385
|
-
toolOverrides: env.toolOverrides,
|
|
386
|
-
})),
|
|
387
|
-
resilience: options.resilience,
|
|
388
|
-
};
|
|
389
|
-
await productBuilder.createAgent(productAgent);
|
|
390
|
-
}
|
|
391
|
-
catch (error) {
|
|
392
|
-
// Log but don't fail - agent is still stored locally
|
|
393
|
-
console.warn(`Failed to persist agent to database: ${error}`);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return definedAgent;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Register a defined agent with a product (persists to database)
|
|
400
|
-
*
|
|
401
|
-
* @example
|
|
402
|
-
* ```ts
|
|
403
|
-
* await ductape.agents.register('my-product', agent);
|
|
404
|
-
* ```
|
|
405
|
-
*/
|
|
406
|
-
async register(product, agent) {
|
|
407
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
408
|
-
const process_id = (0, processor_utils_1.generateObjectId)();
|
|
409
|
-
// Initialize logging
|
|
410
|
-
await this.getProductBuilder(product);
|
|
411
|
-
this.initializeLogService();
|
|
412
|
-
const baseLogs = {
|
|
413
|
-
product_tag: product,
|
|
414
|
-
workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '',
|
|
415
|
-
env: '',
|
|
416
|
-
process_id,
|
|
417
|
-
type: logs_types_1.LogEventTypes.WORKFLOW,
|
|
418
|
-
parent_tag: agent.tag,
|
|
419
|
-
data: { agent: agent.tag, operation: 'register' },
|
|
420
|
-
};
|
|
421
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
|
|
422
|
-
try {
|
|
423
|
-
const productBuilder = await this.getProductBuilder(product);
|
|
424
|
-
// Convert to IProductAgent format and persist to database
|
|
425
|
-
const productAgent = {
|
|
426
|
-
tag: agent.tag,
|
|
427
|
-
name: agent.name,
|
|
428
|
-
description: agent.description,
|
|
429
|
-
model: agent.model, // Model is a tag reference to product-level model config
|
|
430
|
-
modelConfig: agent.modelConfig,
|
|
431
|
-
systemPrompt: agent.systemPrompt,
|
|
432
|
-
tools: agent.toolSchemas.map((schema) => ({
|
|
433
|
-
tag: schema.tag,
|
|
434
|
-
name: schema.name,
|
|
435
|
-
description: schema.description,
|
|
436
|
-
parameters: schema.parameters,
|
|
437
|
-
requiresConfirmation: schema.requiresConfirmation,
|
|
438
|
-
costEstimate: schema.costEstimate,
|
|
439
|
-
timeout: schema.timeout,
|
|
440
|
-
retries: schema.retries,
|
|
441
|
-
})),
|
|
442
|
-
termination: agent.termination ? {
|
|
443
|
-
maxIterations: agent.termination.maxIterations,
|
|
444
|
-
maxTokens: agent.termination.maxTokens,
|
|
445
|
-
timeout: typeof agent.termination.timeout === 'string'
|
|
446
|
-
? parseInt(agent.termination.timeout)
|
|
447
|
-
: agent.termination.timeout,
|
|
448
|
-
allowManualStop: agent.termination.allowManualStop,
|
|
449
|
-
} : undefined,
|
|
450
|
-
memory: agent.memory ? {
|
|
451
|
-
shortTerm: agent.memory.shortTerm,
|
|
452
|
-
longTerm: agent.memory.longTerm,
|
|
453
|
-
} : undefined,
|
|
454
|
-
humanInLoop: agent.humanInLoop ? {
|
|
455
|
-
enabled: agent.humanInLoop.enabled,
|
|
456
|
-
alwaysRequireApproval: agent.humanInLoop.alwaysRequireApproval,
|
|
457
|
-
approvalTimeout: typeof agent.humanInLoop.approvalTimeout === 'string'
|
|
458
|
-
? parseInt(agent.humanInLoop.approvalTimeout)
|
|
459
|
-
: agent.humanInLoop.approvalTimeout,
|
|
460
|
-
approvalWebhook: agent.humanInLoop.approvalWebhook,
|
|
461
|
-
approvalBroker: agent.humanInLoop.approvalBroker,
|
|
462
|
-
} : undefined,
|
|
463
|
-
streaming: agent.streaming ? {
|
|
464
|
-
enabled: agent.streaming.enabled,
|
|
465
|
-
events: agent.streaming.events,
|
|
466
|
-
webhook: agent.streaming.webhook,
|
|
467
|
-
broker: agent.streaming.broker,
|
|
468
|
-
} : undefined,
|
|
469
|
-
inputSchema: agent.inputSchema,
|
|
470
|
-
envs: (_c = agent.envs) === null || _c === void 0 ? void 0 : _c.map((env) => ({
|
|
471
|
-
slug: env.slug,
|
|
472
|
-
active: env.active,
|
|
473
|
-
model: env.model, // Model tag override for this environment
|
|
474
|
-
modelConfig: env.modelConfig,
|
|
475
|
-
toolOverrides: env.toolOverrides,
|
|
476
|
-
})),
|
|
477
|
-
resilience: agent.resilience,
|
|
478
|
-
};
|
|
479
|
-
await productBuilder.createAgent(productAgent);
|
|
480
|
-
// Also store locally for immediate execution
|
|
481
|
-
this.localAgents.set(agent.tag, agent);
|
|
482
|
-
(_d = this.logService) === null || _d === void 0 ? void 0 : _d.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - success', successful_execution: true, status: logs_types_1.LogEventStatus.SUCCESS }));
|
|
483
|
-
(_e = this.logService) === null || _e === void 0 ? void 0 : _e.publish();
|
|
484
|
-
}
|
|
485
|
-
catch (error) {
|
|
486
|
-
(_f = this.logService) === null || _f === void 0 ? void 0 : _f.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent register - failed', failed_execution: true, data: { agent: agent.tag, operation: 'register', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
|
|
487
|
-
await ((_g = this.logService) === null || _g === void 0 ? void 0 : _g.publish());
|
|
488
|
-
throw AgentError.executionError(`Failed to register agent: ${error}`, { agent: agent.tag });
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
// ==================== AGENT EXECUTION ====================
|
|
492
|
-
/**
|
|
493
|
-
* Run an agent
|
|
494
|
-
*
|
|
495
|
-
* @example
|
|
496
|
-
* ```ts
|
|
497
|
-
* const result = await ductape.agents.run({
|
|
498
|
-
* product: 'my-product',
|
|
499
|
-
* env: 'production',
|
|
500
|
-
* tag: 'customer-support',
|
|
501
|
-
* input: {
|
|
502
|
-
* ticketId: 'TICKET-123',
|
|
503
|
-
* message: 'I need help with my order',
|
|
504
|
-
* },
|
|
505
|
-
* });
|
|
506
|
-
* ```
|
|
507
|
-
*/
|
|
508
|
-
async run(options) {
|
|
509
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
|
|
510
|
-
const process_id = (0, processor_utils_1.generateObjectId)();
|
|
511
|
-
const startTime = Date.now();
|
|
512
|
-
// Session log fields (will be populated if session is provided)
|
|
513
|
-
let sessionLogFields = {};
|
|
514
|
-
let resolvedOptions = options;
|
|
515
|
-
// Initialize logging
|
|
516
|
-
const productBuilder = await this.getProductBuilder(options.product);
|
|
517
|
-
this.initializeLogService();
|
|
518
|
-
// Process session if provided - verify and resolve $Session{} references
|
|
519
|
-
if (options.session) {
|
|
520
|
-
const privateKey = productBuilder.fetchPrivateKey();
|
|
521
|
-
if (privateKey) {
|
|
522
|
-
const { processSessionForExecution } = await Promise.resolve().then(() => __importStar(require('../sessions')));
|
|
523
|
-
const sessionResult = await processSessionForExecution(options.session, privateKey, options, options.env, {
|
|
524
|
-
fetchSessionSelector: async (sessionTag) => {
|
|
525
|
-
const sessionConfig = await productBuilder.fetchSession(sessionTag);
|
|
526
|
-
return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
|
|
527
|
-
},
|
|
528
|
-
});
|
|
529
|
-
if (sessionResult.error) {
|
|
530
|
-
throw AgentError.executionError(`Session validation failed: ${sessionResult.error}`);
|
|
531
|
-
}
|
|
532
|
-
resolvedOptions = sessionResult.input;
|
|
533
|
-
sessionLogFields = sessionResult.logFields;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
const baseLogs = Object.assign({ product_tag: options.product, workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '', env: options.env, process_id, type: logs_types_1.LogEventTypes.WORKFLOW, parent_tag: options.tag, data: { agent: options.tag, operation: 'run' } }, sessionLogFields);
|
|
537
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
|
|
538
|
-
try {
|
|
539
|
-
// Get agent definition - first check local, then fetch from database
|
|
540
|
-
let agent = this.localAgents.get(resolvedOptions.tag);
|
|
541
|
-
let toolRegistry = this.toolRegistries.get(resolvedOptions.tag);
|
|
542
|
-
if (!agent) {
|
|
543
|
-
// Try to fetch from database
|
|
544
|
-
const storedAgent = await productBuilder.fetchAgent(resolvedOptions.tag);
|
|
545
|
-
if (!storedAgent) {
|
|
546
|
-
throw AgentError.notFoundError(`Agent '${resolvedOptions.tag}' not found`);
|
|
547
|
-
}
|
|
548
|
-
// Convert IProductAgent to IDefinedAgent
|
|
549
|
-
agent = this.convertProductAgentToDefinedAgent(storedAgent);
|
|
550
|
-
// Store locally for future use
|
|
551
|
-
this.localAgents.set(resolvedOptions.tag, agent);
|
|
552
|
-
// Create tool registry from stored schemas (without handlers)
|
|
553
|
-
toolRegistry = new tool_registry_1.ToolRegistry();
|
|
554
|
-
// Note: Tools from database won't have handlers - they need handlerRef or runtime registration
|
|
555
|
-
for (const tool of storedAgent.tools || []) {
|
|
556
|
-
toolRegistry.register({
|
|
557
|
-
tag: tool.tag,
|
|
558
|
-
name: tool.name,
|
|
559
|
-
description: tool.description,
|
|
560
|
-
parameters: tool.parameters,
|
|
561
|
-
requiresConfirmation: tool.requiresConfirmation,
|
|
562
|
-
costEstimate: tool.costEstimate,
|
|
563
|
-
timeout: tool.timeout,
|
|
564
|
-
retries: tool.retries,
|
|
565
|
-
// Handler will need to be resolved from handlerRef or provided at runtime
|
|
566
|
-
handler: tool.handlerRef
|
|
567
|
-
? this.createHandlerFromRef(tool.handlerRef, resolvedOptions.product, resolvedOptions.env)
|
|
568
|
-
: async () => { throw new Error(`No handler for tool '${tool.tag}'. Provide handlerRef or register handler at runtime.`); },
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
this.toolRegistries.set(resolvedOptions.tag, toolRegistry);
|
|
572
|
-
}
|
|
573
|
-
if (!toolRegistry) {
|
|
574
|
-
throw AgentError.notFoundError(`Tool registry for agent '${resolvedOptions.tag}' not found`);
|
|
575
|
-
}
|
|
576
|
-
// Resolve model config from the model tag
|
|
577
|
-
const modelConfig = await productBuilder.fetchModel(agent.model);
|
|
578
|
-
if (!modelConfig) {
|
|
579
|
-
throw AgentError.notFoundError(`Model '${agent.model}' not found`);
|
|
580
|
-
}
|
|
581
|
-
// Find the env-specific config
|
|
582
|
-
const envConfig = modelConfig.envs.find(e => e.slug === resolvedOptions.env);
|
|
583
|
-
if (!envConfig) {
|
|
584
|
-
throw AgentError.configurationError(`Model '${agent.model}' has no configuration for environment '${resolvedOptions.env}'`);
|
|
585
|
-
}
|
|
586
|
-
// Decrypt API key using product private key, or resolve secret reference
|
|
587
|
-
const privateKey = productBuilder.fetchPrivateKey();
|
|
588
|
-
let apiKey = envConfig.apiKey;
|
|
589
|
-
if (apiKey) {
|
|
590
|
-
// Check if it's a secret reference
|
|
591
|
-
if ((0, secrets_1.isSecretReference)(apiKey).isSecret) {
|
|
592
|
-
const secretsService = (0, secrets_1.getSecretsService)();
|
|
593
|
-
if (secretsService) {
|
|
594
|
-
const resolved = await secretsService.resolve(apiKey, { env: resolvedOptions.env });
|
|
595
|
-
apiKey = resolved.value;
|
|
596
|
-
}
|
|
597
|
-
else {
|
|
598
|
-
throw AgentError.configurationError(`Model API key contains secret reference '${apiKey}' but secrets service is not initialized. ` +
|
|
599
|
-
`Please ensure the Ductape client is properly initialized.`);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
else if (privateKey) {
|
|
603
|
-
// Try to decrypt if it's not a secret reference
|
|
604
|
-
try {
|
|
605
|
-
const { decrypt } = await Promise.resolve().then(() => __importStar(require('../processor/utils/processor.utils')));
|
|
606
|
-
apiKey = decrypt(apiKey, privateKey);
|
|
607
|
-
}
|
|
608
|
-
catch (e) {
|
|
609
|
-
// If decryption fails, try using the key as-is (might be unencrypted in dev)
|
|
610
|
-
console.warn('Failed to decrypt model API key, using as-is');
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
// Also resolve any secret references in baseUrl
|
|
615
|
-
let baseUrl = envConfig.baseUrl;
|
|
616
|
-
if (baseUrl && (0, secrets_1.isSecretReference)(baseUrl).isSecret) {
|
|
617
|
-
const secretsService = (0, secrets_1.getSecretsService)();
|
|
618
|
-
if (secretsService) {
|
|
619
|
-
const resolved = await secretsService.resolve(baseUrl, { env: resolvedOptions.env });
|
|
620
|
-
baseUrl = resolved.value;
|
|
621
|
-
}
|
|
622
|
-
else {
|
|
623
|
-
throw AgentError.configurationError(`Model baseUrl contains secret reference but secrets service is not initialized.`);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
// Get environment-specific agent config if available
|
|
627
|
-
const agentEnvConfig = (_c = agent.envs) === null || _c === void 0 ? void 0 : _c.find(e => e.slug === resolvedOptions.env);
|
|
628
|
-
// Build the resolved LLM config with overrides
|
|
629
|
-
// Precedence: model entity < agent.modelConfig < agentEnvConfig.modelConfig < resolvedOptions.modelConfig
|
|
630
|
-
const resolvedModelConfig = {
|
|
631
|
-
provider: modelConfig.provider,
|
|
632
|
-
model: modelConfig.model,
|
|
633
|
-
// Start with model entity values, then apply overrides
|
|
634
|
-
temperature: (_j = (_g = (_e = (_d = resolvedOptions.modelConfig) === null || _d === void 0 ? void 0 : _d.temperature) !== null && _e !== void 0 ? _e : (_f = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _f === void 0 ? void 0 : _f.temperature) !== null && _g !== void 0 ? _g : (_h = agent.modelConfig) === null || _h === void 0 ? void 0 : _h.temperature) !== null && _j !== void 0 ? _j : modelConfig.temperature,
|
|
635
|
-
maxTokens: (_q = (_o = (_l = (_k = resolvedOptions.modelConfig) === null || _k === void 0 ? void 0 : _k.maxTokens) !== null && _l !== void 0 ? _l : (_m = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _m === void 0 ? void 0 : _m.maxTokens) !== null && _o !== void 0 ? _o : (_p = agent.modelConfig) === null || _p === void 0 ? void 0 : _p.maxTokens) !== null && _q !== void 0 ? _q : modelConfig.maxTokens,
|
|
636
|
-
topP: (_w = (_u = (_s = (_r = resolvedOptions.modelConfig) === null || _r === void 0 ? void 0 : _r.topP) !== null && _s !== void 0 ? _s : (_t = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _t === void 0 ? void 0 : _t.topP) !== null && _u !== void 0 ? _u : (_v = agent.modelConfig) === null || _v === void 0 ? void 0 : _v.topP) !== null && _w !== void 0 ? _w : modelConfig.topP,
|
|
637
|
-
stopSequences: (_2 = (_0 = (_y = (_x = resolvedOptions.modelConfig) === null || _x === void 0 ? void 0 : _x.stopSequences) !== null && _y !== void 0 ? _y : (_z = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _z === void 0 ? void 0 : _z.stopSequences) !== null && _0 !== void 0 ? _0 : (_1 = agent.modelConfig) === null || _1 === void 0 ? void 0 : _1.stopSequences) !== null && _2 !== void 0 ? _2 : modelConfig.stopSequences,
|
|
638
|
-
timeout: (_8 = (_6 = (_4 = (_3 = resolvedOptions.modelConfig) === null || _3 === void 0 ? void 0 : _3.timeout) !== null && _4 !== void 0 ? _4 : (_5 = agentEnvConfig === null || agentEnvConfig === void 0 ? void 0 : agentEnvConfig.modelConfig) === null || _5 === void 0 ? void 0 : _5.timeout) !== null && _6 !== void 0 ? _6 : (_7 = agent.modelConfig) === null || _7 === void 0 ? void 0 : _7.timeout) !== null && _8 !== void 0 ? _8 : modelConfig.timeout,
|
|
639
|
-
apiKey,
|
|
640
|
-
baseUrl,
|
|
641
|
-
};
|
|
642
|
-
// Create executor with resolved model config
|
|
643
|
-
const executor = new agent_executor_1.AgentExecutor(agent, toolRegistry, this.getContextServices(agent.resilience), resolvedOptions, (0, agent_executor_1.createLLMProvider)(resolvedModelConfig), resolvedModelConfig);
|
|
644
|
-
// Store executor for signal handling
|
|
645
|
-
const executionId = executor.getState().execution_id;
|
|
646
|
-
this.activeExecutors.set(executionId, executor);
|
|
647
|
-
// Execute agent
|
|
648
|
-
const result = await executor.execute();
|
|
649
|
-
// Cleanup
|
|
650
|
-
this.activeExecutors.delete(executionId);
|
|
651
|
-
(_9 = this.logService) === null || _9 === void 0 ? void 0 : _9.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - success', successful_execution: result.status === 'completed', failed_execution: result.status === 'failed', data: {
|
|
652
|
-
agent: resolvedOptions.tag,
|
|
653
|
-
operation: 'run',
|
|
654
|
-
execution_id: result.execution_id,
|
|
655
|
-
iterations: result.iterations,
|
|
656
|
-
status: result.status,
|
|
657
|
-
}, status: result.status === 'completed' ? logs_types_1.LogEventStatus.SUCCESS : logs_types_1.LogEventStatus.FAIL }));
|
|
658
|
-
(_10 = this.logService) === null || _10 === void 0 ? void 0 : _10.publish();
|
|
659
|
-
return result;
|
|
660
|
-
}
|
|
661
|
-
catch (error) {
|
|
662
|
-
(_11 = this.logService) === null || _11 === void 0 ? void 0 : _11.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent run - failed', failed_execution: true, data: { agent: resolvedOptions.tag, operation: 'run', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
|
|
663
|
-
await ((_12 = this.logService) === null || _12 === void 0 ? void 0 : _12.publish());
|
|
664
|
-
throw AgentError.executionError(`Failed to run agent: ${error}`, { agent: resolvedOptions.tag });
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
// ==================== DISPATCH (SCHEDULED EXECUTION) ====================
|
|
668
|
-
/**
|
|
669
|
-
* Dispatch an agent for scheduled or deferred execution
|
|
670
|
-
*
|
|
671
|
-
* @example
|
|
672
|
-
* ```ts
|
|
673
|
-
* const job = await ductape.agents.dispatch({
|
|
674
|
-
* product: 'my-product',
|
|
675
|
-
* env: 'production',
|
|
676
|
-
* agent: 'daily-report-agent',
|
|
677
|
-
* input: { reportType: 'daily' },
|
|
678
|
-
* schedule: { cron: '0 9 * * *' }, // Daily at 9 AM
|
|
679
|
-
* });
|
|
680
|
-
* ```
|
|
681
|
-
*/
|
|
682
|
-
async dispatch(options) {
|
|
683
|
-
var _a, _b, _c, _d, _e, _f;
|
|
684
|
-
const process_id = (0, processor_utils_1.generateObjectId)();
|
|
685
|
-
const processorService = this.createNewProcessor();
|
|
686
|
-
const productBuilder = await this.getProductBuilder(options.product);
|
|
687
|
-
const schedule = options.schedule || {};
|
|
688
|
-
const startAt = typeof schedule.start_at === 'string'
|
|
689
|
-
? new Date(schedule.start_at).getTime()
|
|
690
|
-
: schedule.start_at || Date.now();
|
|
691
|
-
const jobTag = `agent:${options.agent}`;
|
|
692
|
-
// Initialize logging
|
|
693
|
-
this.initializeLogService();
|
|
694
|
-
const baseLogs = {
|
|
695
|
-
product_tag: options.product,
|
|
696
|
-
workspace_id: ((_a = this.config) === null || _a === void 0 ? void 0 : _a.workspace_id) || '',
|
|
697
|
-
env: options.env,
|
|
698
|
-
process_id,
|
|
699
|
-
type: logs_types_1.LogEventTypes.WORKFLOW,
|
|
700
|
-
parent_tag: options.agent,
|
|
701
|
-
data: { agent: options.agent, operation: 'dispatch' },
|
|
702
|
-
};
|
|
703
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - initiated', status: logs_types_1.LogEventStatus.PROCESSING }));
|
|
704
|
-
try {
|
|
705
|
-
// Check if job exists, if not create it
|
|
706
|
-
const existingJob = await productBuilder.fetchJob(jobTag);
|
|
707
|
-
if (!existingJob) {
|
|
708
|
-
await productBuilder.createJob({
|
|
709
|
-
tag: jobTag,
|
|
710
|
-
name: `Agent: ${options.agent}`,
|
|
711
|
-
description: `Auto-created job for agent ${options.agent}`,
|
|
712
|
-
type: productsBuilder_types_1.JobEventTypes.ACTION, // Agent executions are actions
|
|
713
|
-
app: options.agent,
|
|
714
|
-
event: 'execute',
|
|
715
|
-
executions: 0,
|
|
716
|
-
intervals: schedule.every || 0,
|
|
717
|
-
start_at: startAt,
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
const jobInput = {
|
|
721
|
-
product: options.product,
|
|
722
|
-
env: options.env,
|
|
723
|
-
event: jobTag,
|
|
724
|
-
input: options.input,
|
|
725
|
-
retries: options.retries || 0,
|
|
726
|
-
start_at: startAt,
|
|
727
|
-
session: options.session,
|
|
728
|
-
cache: options.cache,
|
|
729
|
-
repeat: schedule.cron || schedule.every
|
|
730
|
-
? {
|
|
731
|
-
cron: schedule.cron,
|
|
732
|
-
every: schedule.every,
|
|
733
|
-
limit: schedule.limit,
|
|
734
|
-
endDate: schedule.endDate,
|
|
735
|
-
tz: schedule.tz,
|
|
736
|
-
}
|
|
737
|
-
: undefined,
|
|
738
|
-
};
|
|
739
|
-
await processorService.processJob(jobInput);
|
|
740
|
-
const isRecurring = !!(schedule.cron || schedule.every);
|
|
741
|
-
let nextRunAt;
|
|
742
|
-
if (isRecurring && schedule.every) {
|
|
743
|
-
nextRunAt = startAt + schedule.every;
|
|
744
|
-
}
|
|
745
|
-
const job_id = (0, crypto_1.randomUUID)();
|
|
746
|
-
(_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - success', successful_execution: true, data: { agent: options.agent, operation: 'dispatch', job_id }, status: logs_types_1.LogEventStatus.SUCCESS }));
|
|
747
|
-
(_d = this.logService) === null || _d === void 0 ? void 0 : _d.publish();
|
|
748
|
-
return {
|
|
749
|
-
job_id,
|
|
750
|
-
status: startAt > Date.now() ? 'scheduled' : 'queued',
|
|
751
|
-
scheduled_at: startAt,
|
|
752
|
-
recurring: isRecurring,
|
|
753
|
-
next_run_at: nextRunAt,
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
catch (error) {
|
|
757
|
-
(_e = this.logService) === null || _e === void 0 ? void 0 : _e.add(Object.assign(Object.assign({}, baseLogs), { message: 'Agent dispatch - failed', failed_execution: true, data: { agent: options.agent, operation: 'dispatch', error: String(error) }, status: logs_types_1.LogEventStatus.FAIL }));
|
|
758
|
-
await ((_f = this.logService) === null || _f === void 0 ? void 0 : _f.publish());
|
|
759
|
-
throw error;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
// ==================== SIGNALS ====================
|
|
763
|
-
/**
|
|
764
|
-
* Send a signal to a running agent
|
|
765
|
-
*
|
|
766
|
-
* @example
|
|
767
|
-
* ```ts
|
|
768
|
-
* // Stop an agent
|
|
769
|
-
* await ductape.agents.signal({
|
|
770
|
-
* product: 'my-product',
|
|
771
|
-
* env: 'production',
|
|
772
|
-
* execution_id: 'exec-123',
|
|
773
|
-
* signal: 'stop',
|
|
774
|
-
* });
|
|
775
|
-
*
|
|
776
|
-
* // Approve a tool call
|
|
777
|
-
* await ductape.agents.signal({
|
|
778
|
-
* product: 'my-product',
|
|
779
|
-
* env: 'production',
|
|
780
|
-
* execution_id: 'exec-123',
|
|
781
|
-
* signal: 'approve',
|
|
782
|
-
* payload: { toolCallId: 'tc-456' },
|
|
783
|
-
* });
|
|
784
|
-
* ```
|
|
785
|
-
*/
|
|
786
|
-
async signal(options) {
|
|
787
|
-
const executor = this.activeExecutors.get(options.execution_id);
|
|
788
|
-
if (!executor) {
|
|
789
|
-
throw AgentError.notFoundError(`Agent execution '${options.execution_id}' not found or not active`);
|
|
790
|
-
}
|
|
791
|
-
switch (options.signal) {
|
|
792
|
-
case 'stop':
|
|
793
|
-
executor.handleStop();
|
|
794
|
-
break;
|
|
795
|
-
case 'pause':
|
|
796
|
-
executor.handlePause();
|
|
797
|
-
break;
|
|
798
|
-
case 'resume':
|
|
799
|
-
executor.handleResume();
|
|
800
|
-
break;
|
|
801
|
-
case 'approve':
|
|
802
|
-
executor.handleApproval(true, options.payload);
|
|
803
|
-
break;
|
|
804
|
-
case 'reject':
|
|
805
|
-
executor.handleApproval(false);
|
|
806
|
-
break;
|
|
807
|
-
default:
|
|
808
|
-
throw AgentError.validationError(`Unknown signal: ${options.signal}`);
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
// ==================== STATUS ====================
|
|
812
|
-
/**
|
|
813
|
-
* Get the status of an agent execution
|
|
814
|
-
*
|
|
815
|
-
* @example
|
|
816
|
-
* ```ts
|
|
817
|
-
* const status = await ductape.agents.status({
|
|
818
|
-
* product: 'my-product',
|
|
819
|
-
* env: 'production',
|
|
820
|
-
* execution_id: 'exec-123',
|
|
821
|
-
* });
|
|
822
|
-
* ```
|
|
823
|
-
*/
|
|
824
|
-
async status(options) {
|
|
825
|
-
const executor = this.activeExecutors.get(options.execution_id);
|
|
826
|
-
if (!executor) {
|
|
827
|
-
// Could query from database for completed executions
|
|
828
|
-
return null;
|
|
829
|
-
}
|
|
830
|
-
return executor.getState();
|
|
831
|
-
}
|
|
832
|
-
/**
|
|
833
|
-
* List agent executions
|
|
834
|
-
*
|
|
835
|
-
* @example
|
|
836
|
-
* ```ts
|
|
837
|
-
* const executions = await ductape.agents.list({
|
|
838
|
-
* product: 'my-product',
|
|
839
|
-
* env: 'production',
|
|
840
|
-
* agent: 'customer-support',
|
|
841
|
-
* status: 'completed',
|
|
842
|
-
* limit: 10,
|
|
843
|
-
* });
|
|
844
|
-
* ```
|
|
845
|
-
*/
|
|
846
|
-
async list(options) {
|
|
847
|
-
// For now, return active executions
|
|
848
|
-
// In production, would query from database
|
|
849
|
-
const executions = [];
|
|
850
|
-
for (const [executionId, executor] of this.activeExecutors) {
|
|
851
|
-
const state = executor.getState();
|
|
852
|
-
// Apply filters
|
|
853
|
-
if (options.agent && state.agent_tag !== options.agent) {
|
|
854
|
-
continue;
|
|
855
|
-
}
|
|
856
|
-
if (options.status) {
|
|
857
|
-
const statuses = Array.isArray(options.status) ? options.status : [options.status];
|
|
858
|
-
if (!statuses.includes(state.status)) {
|
|
859
|
-
continue;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
executions.push({
|
|
863
|
-
execution_id: state.execution_id,
|
|
864
|
-
agent_tag: state.agent_tag,
|
|
865
|
-
status: state.status,
|
|
866
|
-
startedAt: state.startedAt,
|
|
867
|
-
completedAt: state.status !== 'running' ? state.updatedAt : undefined,
|
|
868
|
-
iterations: state.iteration,
|
|
869
|
-
usage: state.usage,
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
// Pagination
|
|
873
|
-
const page = options.page || 1;
|
|
874
|
-
const limit = options.limit || 10;
|
|
875
|
-
const start = (page - 1) * limit;
|
|
876
|
-
const paginatedExecutions = executions.slice(start, start + limit);
|
|
877
|
-
return {
|
|
878
|
-
executions: paginatedExecutions,
|
|
879
|
-
total: executions.length,
|
|
880
|
-
page,
|
|
881
|
-
limit,
|
|
882
|
-
};
|
|
883
|
-
}
|
|
884
|
-
// ==================== TOOL MANAGEMENT ====================
|
|
885
|
-
/**
|
|
886
|
-
* Add a tool to an agent
|
|
887
|
-
*
|
|
888
|
-
* @example
|
|
889
|
-
* ```ts
|
|
890
|
-
* await ductape.agents.addTool('customer-support', {
|
|
891
|
-
* tag: 'new-tool',
|
|
892
|
-
* description: 'A new tool',
|
|
893
|
-
* parameters: { ... },
|
|
894
|
-
* handler: async (ctx, params) => { ... },
|
|
895
|
-
* });
|
|
896
|
-
* ```
|
|
897
|
-
*/
|
|
898
|
-
addTool(agentTag, tool) {
|
|
899
|
-
const registry = this.toolRegistries.get(agentTag);
|
|
900
|
-
if (!registry) {
|
|
901
|
-
throw AgentError.notFoundError(`Agent '${agentTag}' not found`);
|
|
902
|
-
}
|
|
903
|
-
registry.register(tool);
|
|
904
|
-
// Update agent definition
|
|
905
|
-
const agent = this.localAgents.get(agentTag);
|
|
906
|
-
if (agent) {
|
|
907
|
-
agent.toolSchemas = registry.getSchemas();
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Remove a tool from an agent
|
|
912
|
-
*/
|
|
913
|
-
removeTool(agentTag, toolTag) {
|
|
914
|
-
const registry = this.toolRegistries.get(agentTag);
|
|
915
|
-
if (!registry) {
|
|
916
|
-
return false;
|
|
917
|
-
}
|
|
918
|
-
const removed = registry.unregister(toolTag);
|
|
919
|
-
// Update agent definition
|
|
920
|
-
if (removed) {
|
|
921
|
-
const agent = this.localAgents.get(agentTag);
|
|
922
|
-
if (agent) {
|
|
923
|
-
agent.toolSchemas = registry.getSchemas();
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
return removed;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Get tools for an agent
|
|
930
|
-
*/
|
|
931
|
-
getTools(agentTag) {
|
|
932
|
-
const registry = this.toolRegistries.get(agentTag);
|
|
933
|
-
if (!registry) {
|
|
934
|
-
return [];
|
|
935
|
-
}
|
|
936
|
-
return registry.getSchemas();
|
|
937
|
-
}
|
|
938
|
-
// ==================== AGENT AS TOOL ====================
|
|
939
|
-
/**
|
|
940
|
-
* Convert an agent into a tool that can be used by another agent
|
|
941
|
-
*
|
|
942
|
-
* This enables multi-agent orchestration where a "manager" agent can
|
|
943
|
-
* delegate tasks to specialized agents.
|
|
944
|
-
*
|
|
945
|
-
* @example
|
|
946
|
-
* ```ts
|
|
947
|
-
* // Define specialized agents
|
|
948
|
-
* const researchAgent = await ductape.agents.define({
|
|
949
|
-
* tag: 'research-agent',
|
|
950
|
-
* name: 'Research Agent',
|
|
951
|
-
* // ...
|
|
952
|
-
* });
|
|
953
|
-
*
|
|
954
|
-
* const writerAgent = await ductape.agents.define({
|
|
955
|
-
* tag: 'writer-agent',
|
|
956
|
-
* name: 'Writer Agent',
|
|
957
|
-
* // ...
|
|
958
|
-
* });
|
|
959
|
-
*
|
|
960
|
-
* // Create a manager agent that can delegate to specialists
|
|
961
|
-
* const managerAgent = await ductape.agents.define({
|
|
962
|
-
* tag: 'manager-agent',
|
|
963
|
-
* name: 'Project Manager',
|
|
964
|
-
* tools: [
|
|
965
|
-
* ductape.agents.asTool({
|
|
966
|
-
* agentTag: 'research-agent',
|
|
967
|
-
* product: 'my-product',
|
|
968
|
-
* options: {
|
|
969
|
-
* toolDescription: 'Delegate research tasks to the research specialist',
|
|
970
|
-
* },
|
|
971
|
-
* }),
|
|
972
|
-
* ductape.agents.asTool({
|
|
973
|
-
* agentTag: 'writer-agent',
|
|
974
|
-
* product: 'my-product',
|
|
975
|
-
* options: {
|
|
976
|
-
* toolDescription: 'Delegate writing tasks to the writing specialist',
|
|
977
|
-
* },
|
|
978
|
-
* }),
|
|
979
|
-
* ],
|
|
980
|
-
* });
|
|
981
|
-
* ```
|
|
982
|
-
*/
|
|
983
|
-
asTool(definition) {
|
|
984
|
-
const { agentTag, product, env, options = {} } = definition;
|
|
985
|
-
// Get the agent definition to extract metadata
|
|
986
|
-
const agent = this.localAgents.get(agentTag);
|
|
987
|
-
// Build input schema - either from options or use a generic input schema
|
|
988
|
-
const inputSchema = options.inputSchema || {
|
|
989
|
-
task: {
|
|
990
|
-
type: 'string',
|
|
991
|
-
description: 'The task or instruction to give to the agent',
|
|
992
|
-
required: true,
|
|
993
|
-
},
|
|
994
|
-
context: {
|
|
995
|
-
type: 'object',
|
|
996
|
-
description: 'Additional context or data to pass to the agent',
|
|
997
|
-
},
|
|
998
|
-
};
|
|
999
|
-
// Create the tool
|
|
1000
|
-
const tool = {
|
|
1001
|
-
tag: options.toolTag || `agent:${agentTag}`,
|
|
1002
|
-
name: options.toolName || (agent === null || agent === void 0 ? void 0 : agent.name) || agentTag,
|
|
1003
|
-
description: options.toolDescription ||
|
|
1004
|
-
(agent === null || agent === void 0 ? void 0 : agent.description) ||
|
|
1005
|
-
`Delegate task to the ${agentTag} agent`,
|
|
1006
|
-
parameters: inputSchema,
|
|
1007
|
-
requiresConfirmation: options.requiresConfirmation,
|
|
1008
|
-
timeout: options.timeout,
|
|
1009
|
-
retries: options.retries,
|
|
1010
|
-
handler: async (ctx, params) => {
|
|
1011
|
-
var _a;
|
|
1012
|
-
// Transform input if transformer provided
|
|
1013
|
-
const input = options.inputTransform
|
|
1014
|
-
? options.inputTransform(params)
|
|
1015
|
-
: params;
|
|
1016
|
-
// Build the input message for the sub-agent
|
|
1017
|
-
const inputMessage = typeof input === 'string'
|
|
1018
|
-
? input
|
|
1019
|
-
: input.task ||
|
|
1020
|
-
JSON.stringify(input);
|
|
1021
|
-
// Run the sub-agent
|
|
1022
|
-
// When delegating to sub-agent, append agent tag to session for traceability
|
|
1023
|
-
const subAgentSession = ctx.session ? `${ctx.session}:${agentTag}` : undefined;
|
|
1024
|
-
const result = await this.run({
|
|
1025
|
-
product,
|
|
1026
|
-
env: env || ctx.env,
|
|
1027
|
-
tag: agentTag,
|
|
1028
|
-
input: typeof inputMessage === 'string' ? { message: inputMessage } : inputMessage,
|
|
1029
|
-
session: subAgentSession,
|
|
1030
|
-
});
|
|
1031
|
-
// Transform output if transformer provided
|
|
1032
|
-
if (options.outputTransform) {
|
|
1033
|
-
return options.outputTransform(result);
|
|
1034
|
-
}
|
|
1035
|
-
// Return full details or just output based on options
|
|
1036
|
-
if (options.includeDetails) {
|
|
1037
|
-
return {
|
|
1038
|
-
agent: agentTag,
|
|
1039
|
-
status: result.status,
|
|
1040
|
-
output: result.output,
|
|
1041
|
-
iterations: result.iterations,
|
|
1042
|
-
toolCalls: (_a = result.toolCalls) === null || _a === void 0 ? void 0 : _a.map((tc) => ({
|
|
1043
|
-
tool: tc.tool,
|
|
1044
|
-
success: tc.success,
|
|
1045
|
-
})),
|
|
1046
|
-
executionTime: result.executionTime,
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
// Default: return just the output
|
|
1050
|
-
return result.output;
|
|
1051
|
-
},
|
|
1052
|
-
};
|
|
1053
|
-
return tool;
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Create an agent tool from a handlerRef string
|
|
1057
|
-
*
|
|
1058
|
-
* @example
|
|
1059
|
-
* ```ts
|
|
1060
|
-
* // In tool definition
|
|
1061
|
-
* {
|
|
1062
|
-
* tag: 'delegate-research',
|
|
1063
|
-
* handlerRef: 'agent:research-agent',
|
|
1064
|
-
* }
|
|
1065
|
-
* ```
|
|
1066
|
-
*/
|
|
1067
|
-
createAgentToolFromRef(handlerRef, product, env) {
|
|
1068
|
-
// Parse handlerRef: "agent:agent-tag" or "agent:agent-tag:options"
|
|
1069
|
-
const parts = handlerRef.split(':');
|
|
1070
|
-
if (parts[0] !== 'agent') {
|
|
1071
|
-
throw AgentError.validationError(`Invalid agent handlerRef format: ${handlerRef}. Expected "agent:agent-tag"`);
|
|
1072
|
-
}
|
|
1073
|
-
const agentTag = parts[1];
|
|
1074
|
-
return async (ctx, params) => {
|
|
1075
|
-
const input = typeof params === 'string'
|
|
1076
|
-
? params
|
|
1077
|
-
: params.task || JSON.stringify(params);
|
|
1078
|
-
// When delegating to sub-agent, append agent tag to session for traceability
|
|
1079
|
-
const subAgentSession = ctx.session ? `${ctx.session}:${agentTag}` : undefined;
|
|
1080
|
-
const result = await this.run({
|
|
1081
|
-
product,
|
|
1082
|
-
env,
|
|
1083
|
-
tag: agentTag,
|
|
1084
|
-
input: typeof input === 'string' ? { message: input } : input,
|
|
1085
|
-
session: subAgentSession,
|
|
1086
|
-
});
|
|
1087
|
-
return result.output;
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
// ==================== UTILITIES ====================
|
|
1091
|
-
/**
|
|
1092
|
-
* Get a defined agent by tag
|
|
1093
|
-
*/
|
|
1094
|
-
getAgent(tag) {
|
|
1095
|
-
return this.localAgents.get(tag);
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
* List all defined agents
|
|
1099
|
-
*/
|
|
1100
|
-
listAgents() {
|
|
1101
|
-
return Array.from(this.localAgents.values());
|
|
1102
|
-
}
|
|
1103
|
-
/**
|
|
1104
|
-
* Delete an agent definition
|
|
1105
|
-
*/
|
|
1106
|
-
deleteAgent(tag) {
|
|
1107
|
-
this.toolRegistries.delete(tag);
|
|
1108
|
-
return this.localAgents.delete(tag);
|
|
1109
|
-
}
|
|
1110
|
-
/**
|
|
1111
|
-
* Clear all agent definitions
|
|
1112
|
-
*/
|
|
1113
|
-
clearAll() {
|
|
1114
|
-
this.localAgents.clear();
|
|
1115
|
-
this.toolRegistries.clear();
|
|
1116
|
-
this.activeExecutors.clear();
|
|
1117
|
-
}
|
|
1118
|
-
// ==================== PRIVATE HELPERS ====================
|
|
1119
|
-
/**
|
|
1120
|
-
* Convert a stored IProductAgent to IDefinedAgent format
|
|
1121
|
-
*/
|
|
1122
|
-
convertProductAgentToDefinedAgent(storedAgent) {
|
|
1123
|
-
var _a;
|
|
1124
|
-
return {
|
|
1125
|
-
tag: storedAgent.tag,
|
|
1126
|
-
name: storedAgent.name,
|
|
1127
|
-
description: storedAgent.description,
|
|
1128
|
-
model: storedAgent.model, // Model tag reference - resolved at runtime
|
|
1129
|
-
modelConfig: storedAgent.modelConfig,
|
|
1130
|
-
systemPrompt: storedAgent.systemPrompt,
|
|
1131
|
-
toolSchemas: (storedAgent.tools || []).map((tool) => ({
|
|
1132
|
-
tag: tool.tag,
|
|
1133
|
-
name: tool.name,
|
|
1134
|
-
description: tool.description,
|
|
1135
|
-
parameters: tool.parameters,
|
|
1136
|
-
requiresConfirmation: tool.requiresConfirmation,
|
|
1137
|
-
costEstimate: tool.costEstimate,
|
|
1138
|
-
timeout: tool.timeout,
|
|
1139
|
-
retries: tool.retries,
|
|
1140
|
-
})),
|
|
1141
|
-
termination: storedAgent.termination ? {
|
|
1142
|
-
maxIterations: storedAgent.termination.maxIterations,
|
|
1143
|
-
maxTokens: storedAgent.termination.maxTokens,
|
|
1144
|
-
timeout: storedAgent.termination.timeout,
|
|
1145
|
-
allowManualStop: storedAgent.termination.allowManualStop,
|
|
1146
|
-
} : undefined,
|
|
1147
|
-
memory: storedAgent.memory ? {
|
|
1148
|
-
shortTerm: storedAgent.memory.shortTerm,
|
|
1149
|
-
longTerm: storedAgent.memory.longTerm,
|
|
1150
|
-
} : undefined,
|
|
1151
|
-
humanInLoop: storedAgent.humanInLoop ? {
|
|
1152
|
-
enabled: storedAgent.humanInLoop.enabled,
|
|
1153
|
-
alwaysRequireApproval: storedAgent.humanInLoop.alwaysRequireApproval,
|
|
1154
|
-
approvalTimeout: storedAgent.humanInLoop.approvalTimeout,
|
|
1155
|
-
approvalWebhook: storedAgent.humanInLoop.approvalWebhook,
|
|
1156
|
-
approvalBroker: storedAgent.humanInLoop.approvalBroker,
|
|
1157
|
-
} : undefined,
|
|
1158
|
-
streaming: storedAgent.streaming ? {
|
|
1159
|
-
enabled: storedAgent.streaming.enabled,
|
|
1160
|
-
events: storedAgent.streaming.events,
|
|
1161
|
-
webhook: storedAgent.streaming.webhook,
|
|
1162
|
-
broker: storedAgent.streaming.broker,
|
|
1163
|
-
} : undefined,
|
|
1164
|
-
inputSchema: storedAgent.inputSchema,
|
|
1165
|
-
envs: (_a = storedAgent.envs) === null || _a === void 0 ? void 0 : _a.map((env) => ({
|
|
1166
|
-
slug: env.slug,
|
|
1167
|
-
active: env.active,
|
|
1168
|
-
model: env.model, // Model tag override - resolved at runtime
|
|
1169
|
-
modelConfig: env.modelConfig,
|
|
1170
|
-
toolOverrides: env.toolOverrides,
|
|
1171
|
-
})),
|
|
1172
|
-
resilience: storedAgent.resilience,
|
|
1173
|
-
};
|
|
1174
|
-
}
|
|
1175
|
-
/**
|
|
1176
|
-
* Create a handler function from a handlerRef string
|
|
1177
|
-
* Format: "type:tag:event" (e.g., "action:payment-app:process-payment", "feature:checkout-flow")
|
|
1178
|
-
*/
|
|
1179
|
-
createHandlerFromRef(handlerRef, product, env) {
|
|
1180
|
-
const parts = handlerRef.split(':');
|
|
1181
|
-
const type = parts[0];
|
|
1182
|
-
const tag = parts[1];
|
|
1183
|
-
const event = parts[2];
|
|
1184
|
-
return async (ctx, params) => {
|
|
1185
|
-
switch (type) {
|
|
1186
|
-
case 'action':
|
|
1187
|
-
return ctx.action.run({
|
|
1188
|
-
app: tag,
|
|
1189
|
-
event,
|
|
1190
|
-
input: params,
|
|
1191
|
-
});
|
|
1192
|
-
case 'feature':
|
|
1193
|
-
return ctx.feature.run({
|
|
1194
|
-
feature: tag,
|
|
1195
|
-
input: params,
|
|
1196
|
-
});
|
|
1197
|
-
case 'database':
|
|
1198
|
-
return ctx.database.execute({
|
|
1199
|
-
database: tag,
|
|
1200
|
-
event,
|
|
1201
|
-
input: params,
|
|
1202
|
-
});
|
|
1203
|
-
case 'graph':
|
|
1204
|
-
return ctx.graph.execute({
|
|
1205
|
-
graph: tag,
|
|
1206
|
-
action: event,
|
|
1207
|
-
input: params,
|
|
1208
|
-
});
|
|
1209
|
-
case 'storage':
|
|
1210
|
-
return ctx.storage.upload({
|
|
1211
|
-
storage: tag,
|
|
1212
|
-
event,
|
|
1213
|
-
input: params,
|
|
1214
|
-
});
|
|
1215
|
-
case 'notification':
|
|
1216
|
-
await ctx.notification.send({
|
|
1217
|
-
notification: tag,
|
|
1218
|
-
event,
|
|
1219
|
-
input: params,
|
|
1220
|
-
});
|
|
1221
|
-
return { success: true };
|
|
1222
|
-
case 'publish':
|
|
1223
|
-
await ctx.messaging.produce({
|
|
1224
|
-
event: `${tag}:${event}`,
|
|
1225
|
-
message: (params || {}),
|
|
1226
|
-
});
|
|
1227
|
-
return { success: true };
|
|
1228
|
-
case 'agent':
|
|
1229
|
-
// Delegate to another agent
|
|
1230
|
-
// Format: "agent:agent-tag"
|
|
1231
|
-
const input = typeof params === 'string'
|
|
1232
|
-
? params
|
|
1233
|
-
: params.task || JSON.stringify(params);
|
|
1234
|
-
// When delegating to sub-agent, append agent tag to session for traceability
|
|
1235
|
-
const subAgentSession = ctx.session ? `${ctx.session}:${tag}` : undefined;
|
|
1236
|
-
const result = await this.run({
|
|
1237
|
-
product,
|
|
1238
|
-
env,
|
|
1239
|
-
tag,
|
|
1240
|
-
input: typeof input === 'string' ? { message: input } : input,
|
|
1241
|
-
session: subAgentSession,
|
|
1242
|
-
});
|
|
1243
|
-
return result.output;
|
|
1244
|
-
default:
|
|
1245
|
-
throw new Error(`Unknown handler type: ${type}`);
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
exports.AgentsService = AgentsService;
|
|
1251
|
-
// Export singleton instance for convenience
|
|
1252
|
-
exports.agentsService = new AgentsService();
|
|
1253
|
-
// Default export
|
|
1254
|
-
exports.default = AgentsService;
|
|
1255
|
-
//# sourceMappingURL=agents.service.js.map
|