@capybara-hq/kernel 0.1.0-rc.1 → 0.1.0-rc.2
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/dist/admin/admin.controller.d.ts +17 -17
- package/dist/admin/admin.controller.js +43 -26
- package/dist/admin/admin.module.d.ts +3 -0
- package/dist/admin/admin.module.js +22 -0
- package/dist/admin/extensions.controller.d.ts +14 -14
- package/dist/admin/extensions.controller.js +30 -17
- package/dist/admin/setup-lock.d.ts +16 -0
- package/dist/admin/setup-lock.js +47 -0
- package/dist/admin/setup.controller.d.ts +8 -8
- package/dist/admin/setup.controller.js +27 -25
- package/dist/admin/setup.service.d.ts +19 -27
- package/dist/admin/setup.service.js +61 -61
- package/dist/agents/agent-lookup.d.ts +53 -0
- package/dist/agents/agent-lookup.js +179 -0
- package/dist/agents/agents.controller.d.ts +1 -1
- package/dist/agents/agents.controller.js +14 -8
- package/dist/agents/agents.module.d.ts +7 -0
- package/dist/agents/agents.module.js +41 -0
- package/dist/agents/agents.service.d.ts +39 -58
- package/dist/agents/agents.service.js +261 -329
- package/dist/agents/definition.d.ts +8 -0
- package/dist/agents/definition.js +8 -0
- package/dist/agents/models.controller.d.ts +1 -1
- package/dist/agents/models.controller.js +2 -2
- package/dist/agents/templates.controller.d.ts +1 -1
- package/dist/agents/templates.controller.js +2 -2
- package/dist/agents/templates.d.ts +6 -8
- package/dist/agents/templates.js +20 -4
- package/dist/app.d.ts +93 -0
- package/dist/app.js +150 -0
- package/dist/catalog/admin-catalog.controller.d.ts +3 -3
- package/dist/catalog/admin-catalog.controller.js +27 -13
- package/dist/catalog/catalog-content.d.ts +185 -0
- package/dist/catalog/catalog-content.js +323 -0
- package/dist/catalog/catalog-items.d.ts +186 -0
- package/dist/catalog/catalog-items.js +410 -0
- package/dist/catalog/catalog.module.d.ts +14 -0
- package/dist/catalog/catalog.module.js +71 -0
- package/dist/catalog/catalog.service.d.ts +34 -188
- package/dist/catalog/catalog.service.js +155 -489
- package/dist/catalog/cli.d.ts +3 -2
- package/dist/catalog/cli.js +13 -31
- package/dist/catalog/job-ids.d.ts +15 -0
- package/dist/catalog/job-ids.js +15 -0
- package/dist/catalog/jobs.d.ts +27 -0
- package/dist/catalog/jobs.js +70 -0
- package/dist/catalog/locks.d.ts +24 -0
- package/dist/catalog/locks.js +63 -0
- package/dist/catalog/marketplaces.controller.d.ts +4 -4
- package/dist/catalog/marketplaces.controller.js +22 -11
- package/dist/catalog/marketplaces.service.d.ts +30 -13
- package/dist/catalog/marketplaces.service.js +330 -256
- package/dist/catalog/org-catalog.controller.d.ts +4 -3
- package/dist/catalog/org-catalog.controller.js +29 -14
- package/dist/catalog/org-catalog.service.d.ts +32 -198
- package/dist/catalog/org-catalog.service.js +159 -400
- package/dist/catalog/plugin-import.d.ts +73 -34
- package/dist/catalog/plugin-import.js +356 -217
- package/dist/catalog/plugin-install.d.ts +83 -41
- package/dist/catalog/plugin-install.js +421 -269
- package/dist/catalog/plugin-upgrade.d.ts +59 -4
- package/dist/catalog/plugin-upgrade.js +407 -282
- package/dist/catalog/requests.service.d.ts +27 -15
- package/dist/catalog/requests.service.js +201 -145
- package/dist/catalog/upgrade-targets.d.ts +4 -7
- package/dist/channels/actions.d.ts +6 -4
- package/dist/channels/actions.js +1 -1
- package/dist/channels/cards.d.ts +2 -2
- package/dist/channels/channels.module.d.ts +40 -0
- package/dist/channels/channels.module.js +128 -0
- package/dist/channels/connections.controller.d.ts +1 -1
- package/dist/channels/connections.controller.js +11 -6
- package/dist/channels/connections.service.d.ts +43 -21
- package/dist/channels/connections.service.js +236 -131
- package/dist/channels/inbound.d.ts +34 -38
- package/dist/channels/inbound.js +107 -41
- package/dist/channels/job-ids.d.ts +10 -0
- package/dist/channels/job-ids.js +10 -0
- package/dist/channels/jobs.d.ts +85 -0
- package/dist/channels/jobs.js +157 -0
- package/dist/channels/outbound.d.ts +60 -82
- package/dist/channels/outbound.js +165 -194
- package/dist/channels/supervisor.d.ts +88 -46
- package/dist/channels/supervisor.js +230 -132
- package/dist/channels/threads.d.ts +29 -8
- package/dist/channels/threads.js +71 -13
- package/dist/channels/webhook.d.ts +20 -14
- package/dist/channels/webhook.js +51 -20
- package/dist/config/load.d.ts +3 -2
- package/dist/config/load.js +3 -2
- package/dist/config/nacos-source.js +11 -2
- package/dist/config/schema.d.ts +1 -0
- package/dist/config/schema.js +10 -4
- package/dist/conversations/access.d.ts +29 -0
- package/dist/conversations/access.js +86 -0
- package/dist/conversations/artifacts.d.ts +10 -10
- package/dist/conversations/artifacts.js +35 -9
- package/dist/conversations/attachments.controller.d.ts +1 -1
- package/dist/conversations/attachments.controller.js +8 -6
- package/dist/conversations/attachments.module.d.ts +7 -0
- package/dist/conversations/attachments.module.js +25 -0
- package/dist/conversations/attachments.service.d.ts +30 -22
- package/dist/conversations/attachments.service.js +119 -46
- package/dist/conversations/conversations.controller.d.ts +8 -7
- package/dist/conversations/conversations.controller.js +59 -29
- package/dist/conversations/conversations.module.d.ts +8 -0
- package/dist/conversations/conversations.module.js +69 -0
- package/dist/conversations/conversations.service.d.ts +40 -38
- package/dist/conversations/conversations.service.js +130 -140
- package/dist/conversations/event-log.d.ts +28 -18
- package/dist/conversations/event-log.js +74 -27
- package/dist/conversations/files.d.ts +10 -10
- package/dist/conversations/files.js +37 -11
- package/dist/conversations/idem-keys.d.ts +5 -0
- package/dist/conversations/idem-keys.js +5 -0
- package/dist/conversations/job-ids.d.ts +6 -0
- package/dist/conversations/job-ids.js +6 -0
- package/dist/conversations/outputs-read.d.ts +11 -11
- package/dist/conversations/outputs-read.js +31 -7
- package/dist/conversations/queue.d.ts +48 -56
- package/dist/conversations/queue.js +13 -289
- package/dist/conversations/queue.service.d.ts +60 -0
- package/dist/conversations/queue.service.js +343 -0
- package/dist/conversations/sandbox-status.d.ts +13 -10
- package/dist/conversations/sandbox-status.js +36 -8
- package/dist/conversations/titles.d.ts +71 -24
- package/dist/conversations/titles.js +159 -63
- package/dist/ctx/bus.js +9 -3
- package/dist/ctx/create-ctx.d.ts +6 -0
- package/dist/ctx/create-ctx.js +7 -9
- package/dist/ctx/lock.d.ts +7 -3
- package/dist/ctx/lock.js +9 -20
- package/dist/ctx/secrets.d.ts +10 -2
- package/dist/ctx/secrets.js +7 -3
- package/dist/db/kernel-schema.d.ts +2 -2
- package/dist/db/pool.d.ts +5 -0
- package/dist/db/pool.js +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/errors.js +1 -0
- package/dist/evals/budget.d.ts +42 -21
- package/dist/evals/budget.js +114 -62
- package/dist/evals/evals.module.d.ts +31 -0
- package/dist/evals/evals.module.js +114 -0
- package/dist/evals/jobs.d.ts +20 -0
- package/dist/evals/jobs.js +45 -0
- package/dist/evals/run-replay.d.ts +56 -8
- package/dist/evals/run-replay.js +140 -80
- package/dist/evals/runs.controller.d.ts +1 -1
- package/dist/evals/runs.controller.js +17 -8
- package/dist/evals/runs.service.d.ts +23 -45
- package/dist/evals/runs.service.js +245 -234
- package/dist/evals/sets.controller.d.ts +1 -1
- package/dist/evals/sets.controller.js +17 -8
- package/dist/evals/sets.service.d.ts +22 -6
- package/dist/evals/sets.service.js +248 -194
- package/dist/evals/snapshot.d.ts +2 -2
- package/dist/evals/step-replay.d.ts +2 -2
- package/dist/evals/step-replay.js +1 -1
- package/dist/evals/trajectory.controller.d.ts +1 -1
- package/dist/evals/trajectory.controller.js +11 -7
- package/dist/evals/trajectory.service.d.ts +5 -4
- package/dist/evals/trajectory.service.js +30 -7
- package/dist/evals/worker.d.ts +44 -27
- package/dist/evals/worker.js +220 -121
- package/dist/extensions/admin-ops.d.ts +61 -33
- package/dist/extensions/admin-ops.js +248 -154
- package/dist/extensions/admin-view.d.ts +38 -27
- package/dist/extensions/admin-view.js +126 -55
- package/dist/extensions/approvals.d.ts +12 -8
- package/dist/extensions/approvals.js +73 -46
- package/dist/extensions/blobs.d.ts +27 -10
- package/dist/extensions/blobs.js +111 -45
- package/dist/extensions/bootstrap.d.ts +58 -31
- package/dist/extensions/bootstrap.js +175 -121
- package/dist/extensions/cli.d.ts +20 -10
- package/dist/extensions/cli.js +41 -96
- package/dist/extensions/config-issues.d.ts +7 -0
- package/dist/extensions/config-issues.js +31 -0
- package/dist/extensions/deployment-config-store.d.ts +49 -0
- package/dist/extensions/deployment-config-store.js +133 -0
- package/dist/extensions/deployment-config.d.ts +58 -67
- package/dist/extensions/deployment-config.js +202 -230
- package/dist/extensions/enabled.d.ts +5 -5
- package/dist/extensions/extensions.module.d.ts +8 -0
- package/dist/extensions/extensions.module.js +77 -0
- package/dist/extensions/hooks.d.ts +3 -2
- package/dist/extensions/hooks.js +1 -1
- package/dist/extensions/host.d.ts +72 -68
- package/dist/extensions/host.js +191 -152
- package/dist/extensions/installs.d.ts +49 -16
- package/dist/extensions/installs.js +128 -32
- package/dist/extensions/job-ids.d.ts +6 -0
- package/dist/extensions/job-ids.js +6 -0
- package/dist/extensions/lifecycle-topics.d.ts +18 -0
- package/dist/extensions/lifecycle-topics.js +18 -0
- package/dist/extensions/lifecycle.d.ts +35 -47
- package/dist/extensions/lifecycle.js +103 -39
- package/dist/extensions/locks.d.ts +33 -0
- package/dist/extensions/locks.js +86 -0
- package/dist/extensions/migrate-lock.d.ts +3 -4
- package/dist/extensions/org-config.controller.d.ts +1 -1
- package/dist/extensions/org-config.controller.js +8 -5
- package/dist/extensions/org-config.d.ts +48 -46
- package/dist/extensions/org-config.js +284 -226
- package/dist/extensions/registry.d.ts +50 -2
- package/dist/extensions/registry.js +89 -4
- package/dist/extensions/sources.d.ts +12 -8
- package/dist/extensions/sources.js +34 -13
- package/dist/files/files.module.d.ts +3 -0
- package/dist/files/files.module.js +22 -0
- package/dist/files/previewers.controller.d.ts +7 -2
- package/dist/files/previewers.controller.js +17 -9
- package/dist/files/previewers.d.ts +13 -18
- package/dist/files/previewers.js +83 -36
- package/dist/http/adapter.d.ts +3 -0
- package/dist/http/adapter.js +25 -0
- package/dist/http/api.module.d.ts +3 -110
- package/dist/http/api.module.js +47 -355
- package/dist/http/app.d.ts +11 -15
- package/dist/http/app.js +17 -62
- package/dist/http/error-filter.module.d.ts +5 -0
- package/dist/http/error-filter.module.js +18 -0
- package/dist/http/error.filter.js +2 -2
- package/dist/identity/accounts.d.ts +82 -29
- package/dist/identity/accounts.js +294 -175
- package/dist/identity/api-tokens.d.ts +11 -7
- package/dist/identity/api-tokens.js +71 -44
- package/dist/identity/audit.d.ts +7 -4
- package/dist/identity/audit.js +5 -1
- package/dist/identity/auth.controller.d.ts +11 -10
- package/dist/identity/auth.controller.js +31 -25
- package/dist/identity/auth.guard.d.ts +3 -3
- package/dist/identity/auth.guard.js +6 -4
- package/dist/identity/binding.d.ts +9 -11
- package/dist/identity/binding.js +41 -13
- package/dist/identity/enterprise-admin.d.ts +18 -12
- package/dist/identity/enterprise-admin.js +67 -13
- package/dist/identity/external-identity-lock.d.ts +17 -0
- package/dist/identity/external-identity-lock.js +39 -0
- package/dist/identity/external.d.ts +19 -15
- package/dist/identity/external.js +163 -125
- package/dist/identity/identity.module.d.ts +6 -0
- package/dist/identity/identity.module.js +56 -0
- package/dist/identity/me.controller.d.ts +16 -15
- package/dist/identity/me.controller.js +37 -31
- package/dist/identity/sessions.d.ts +12 -10
- package/dist/identity/sessions.js +74 -42
- package/dist/identity/settings.d.ts +20 -14
- package/dist/identity/settings.js +85 -57
- package/dist/identity/sso.controller.d.ts +7 -7
- package/dist/identity/sso.controller.js +13 -9
- package/dist/identity/sso.d.ts +9 -12
- package/dist/identity/sso.js +54 -24
- package/dist/inbox/inbox.module.d.ts +3 -0
- package/dist/inbox/inbox.module.js +22 -0
- package/dist/inbox/inbox.service.d.ts +7 -9
- package/dist/inbox/inbox.service.js +32 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.js +9 -6
- package/dist/infra/cache/cache.module.d.ts +3 -0
- package/dist/infra/cache/cache.module.js +16 -0
- package/dist/infra/cache/cache.service.d.ts +21 -0
- package/dist/infra/cache/cache.service.js +80 -0
- package/dist/infra/cache/cacheable.decorator.d.ts +32 -0
- package/dist/infra/cache/cacheable.decorator.js +83 -0
- package/dist/infra/cli/kernel-cli.module.d.ts +66 -0
- package/dist/infra/cli/kernel-cli.module.js +165 -0
- package/dist/infra/close-within.d.ts +15 -0
- package/dist/infra/close-within.js +36 -0
- package/dist/infra/config/config.module.d.ts +13 -0
- package/dist/infra/config/config.module.js +39 -0
- package/dist/infra/config/kernel-config.service.d.ts +25 -0
- package/dist/infra/config/kernel-config.service.js +126 -0
- package/dist/infra/database/after-commit.d.ts +6 -0
- package/dist/infra/database/after-commit.js +9 -0
- package/dist/infra/database/database.module.d.ts +25 -0
- package/dist/infra/database/database.module.js +90 -0
- package/dist/infra/database/kernel-db.d.ts +22 -0
- package/dist/infra/database/kernel-db.js +65 -0
- package/dist/infra/database/transaction-host.d.ts +50 -0
- package/dist/infra/database/transaction-host.js +125 -0
- package/dist/infra/database/transactional.decorator.d.ts +15 -0
- package/dist/infra/database/transactional.decorator.js +27 -0
- package/dist/infra/database/xact-lock.d.ts +17 -0
- package/dist/infra/database/xact-lock.js +43 -0
- package/dist/infra/events/kernel-events.d.ts +96 -0
- package/dist/infra/events/kernel-events.js +65 -0
- package/dist/infra/health/health.controller.d.ts +26 -0
- package/dist/infra/health/health.controller.js +104 -0
- package/dist/infra/health/health.module.d.ts +9 -0
- package/dist/infra/health/health.module.js +24 -0
- package/dist/infra/health/health.options.d.ts +10 -0
- package/dist/infra/health/health.options.js +15 -0
- package/dist/infra/health/shutdown-state.d.ts +6 -0
- package/dist/infra/health/shutdown-state.js +2 -0
- package/dist/infra/lifecycle/graceful-shutdown.module.d.ts +6 -0
- package/dist/infra/lifecycle/graceful-shutdown.module.js +23 -0
- package/dist/infra/lifecycle/graceful-shutdown.service.d.ts +70 -0
- package/dist/infra/lifecycle/graceful-shutdown.service.js +135 -0
- package/dist/infra/lifecycle/process-guards.d.ts +52 -0
- package/dist/infra/lifecycle/process-guards.js +86 -0
- package/dist/infra/lifecycle/shutdown-signals.d.ts +30 -0
- package/dist/infra/lifecycle/shutdown-signals.js +48 -0
- package/dist/infra/lock/key-template.d.ts +13 -0
- package/dist/infra/lock/key-template.js +46 -0
- package/dist/infra/lock/lock.module.d.ts +3 -0
- package/dist/infra/lock/lock.module.js +16 -0
- package/dist/infra/lock/lock.service.d.ts +120 -0
- package/dist/infra/lock/lock.service.js +343 -0
- package/dist/infra/lock/shared-lease.d.ts +44 -0
- package/dist/infra/lock/shared-lease.js +121 -0
- package/dist/infra/lock/with-lock.decorator.d.ts +28 -0
- package/dist/infra/lock/with-lock.decorator.js +49 -0
- package/dist/infra/logging/logging.module.d.ts +16 -0
- package/dist/infra/logging/logging.module.js +34 -0
- package/dist/infra/queue/configured-processor.d.ts +18 -0
- package/dist/infra/queue/configured-processor.js +23 -0
- package/dist/infra/queue/job-failure.d.ts +18 -0
- package/dist/infra/queue/job-failure.js +26 -0
- package/dist/infra/queue/queue-shutdown.d.ts +27 -0
- package/dist/infra/queue/queue-shutdown.js +81 -0
- package/dist/infra/queue/queue.module.d.ts +16 -0
- package/dist/infra/queue/queue.module.js +61 -0
- package/dist/infra/queue/redis-connection.d.ts +7 -0
- package/dist/infra/queue/redis-connection.js +18 -0
- package/dist/infra/queue/retired-schedulers.d.ts +7 -0
- package/dist/infra/queue/retired-schedulers.js +9 -0
- package/dist/infra/queue/run-job.d.ts +16 -0
- package/dist/infra/queue/run-job.js +19 -0
- package/dist/infra/redis/redis.module.d.ts +24 -0
- package/dist/infra/redis/redis.module.js +87 -0
- package/dist/infra/schedule/cron-tick.d.ts +12 -0
- package/dist/infra/schedule/cron-tick.js +25 -0
- package/dist/infra/schedule/locked-cron.decorator.d.ts +27 -0
- package/dist/infra/schedule/locked-cron.decorator.js +53 -0
- package/dist/infra/schedule/locked-interval.d.ts +69 -0
- package/dist/infra/schedule/locked-interval.js +190 -0
- package/dist/infra/schedule/locked-tick.d.ts +90 -0
- package/dist/infra/schedule/locked-tick.js +137 -0
- package/dist/infra/schedule/schedule.module.d.ts +8 -0
- package/dist/infra/schedule/schedule.module.js +27 -0
- package/dist/infra/schedule/scheduled-runs.d.ts +69 -0
- package/dist/infra/schedule/scheduled-runs.js +163 -0
- package/dist/infra/swagger/swagger.d.ts +16 -0
- package/dist/infra/swagger/swagger.js +31 -0
- package/dist/infra/throttler/credential-throttler.d.ts +35 -0
- package/dist/infra/throttler/credential-throttler.js +77 -0
- package/dist/infra/throttler/named-throttlers.d.ts +31 -0
- package/dist/infra/throttler/named-throttlers.js +119 -0
- package/dist/infra/throttler/redis-throttler-storage.d.ts +38 -0
- package/dist/infra/throttler/redis-throttler-storage.js +130 -0
- package/dist/infra/throttler/throttler.guard.d.ts +23 -0
- package/dist/infra/throttler/throttler.guard.js +68 -0
- package/dist/infra/throttler/throttler.module.d.ts +15 -0
- package/dist/infra/throttler/throttler.module.js +53 -0
- package/dist/infra/tokens.d.ts +15 -0
- package/dist/infra/tokens.js +15 -0
- package/dist/infra/validation/create-zod-dto.d.ts +23 -0
- package/dist/infra/validation/create-zod-dto.js +35 -0
- package/dist/infra/validation/parse-with-zod.d.ts +7 -0
- package/dist/infra/validation/parse-with-zod.js +12 -0
- package/dist/infra/validation/validation.module.d.ts +3 -0
- package/dist/infra/validation/validation.module.js +16 -0
- package/dist/infra/validation/zod-params.d.ts +7 -0
- package/dist/infra/validation/zod-params.js +42 -0
- package/dist/infra/validation/zod-validation.pipe.d.ts +11 -0
- package/dist/infra/validation/zod-validation.pipe.js +31 -0
- package/dist/kernel.d.ts +9 -244
- package/dist/kernel.js +8 -1305
- package/dist/kernel.module.d.ts +17 -0
- package/dist/kernel.module.js +136 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +140 -0
- package/dist/lifecycle/kernel-lifecycle.js +451 -0
- package/dist/lifecycle/tokens.d.ts +3 -0
- package/dist/lifecycle/tokens.js +3 -0
- package/dist/log-context.d.ts +2 -0
- package/dist/log-context.js +4 -0
- package/dist/models/models.module.d.ts +3 -0
- package/dist/models/models.module.js +24 -0
- package/dist/models/prices.d.ts +8 -2
- package/dist/models/prices.js +65 -37
- package/dist/models/purposes.controller.d.ts +1 -1
- package/dist/models/purposes.controller.js +5 -6
- package/dist/models/purposes.d.ts +35 -13
- package/dist/models/purposes.js +101 -51
- package/dist/orgs/directory-sync.controller.d.ts +1 -1
- package/dist/orgs/directory-sync.controller.js +2 -2
- package/dist/orgs/directory-sync.d.ts +61 -31
- package/dist/orgs/directory-sync.js +212 -125
- package/dist/orgs/invitations.controller.d.ts +8 -8
- package/dist/orgs/invitations.controller.js +27 -26
- package/dist/orgs/invitations.service.d.ts +12 -9
- package/dist/orgs/invitations.service.js +130 -92
- package/dist/orgs/job-ids.d.ts +8 -0
- package/dist/orgs/job-ids.js +8 -0
- package/dist/orgs/members.service.d.ts +19 -12
- package/dist/orgs/members.service.js +161 -117
- package/dist/orgs/offboarding.d.ts +54 -57
- package/dist/orgs/offboarding.js +161 -71
- package/dist/orgs/org-lock.d.ts +28 -19
- package/dist/orgs/org-lock.js +81 -35
- package/dist/orgs/org.guard.d.ts +1 -1
- package/dist/orgs/org.guard.js +2 -2
- package/dist/orgs/orgs.controller.d.ts +13 -13
- package/dist/orgs/orgs.controller.js +29 -17
- package/dist/orgs/orgs.module.d.ts +6 -0
- package/dist/orgs/orgs.module.js +68 -0
- package/dist/orgs/orgs.service.d.ts +30 -19
- package/dist/orgs/orgs.service.js +139 -86
- package/dist/orgs/settings.controller.d.ts +1 -1
- package/dist/orgs/settings.controller.js +8 -6
- package/dist/orgs/settings.service.d.ts +14 -8
- package/dist/orgs/settings.service.js +75 -46
- package/dist/overrides.d.ts +56 -0
- package/dist/overrides.js +30 -0
- package/dist/roles/gateway-role.d.ts +43 -0
- package/dist/roles/gateway-role.js +98 -0
- package/dist/roles/gateway.module.d.ts +8 -0
- package/dist/roles/gateway.module.js +28 -0
- package/dist/roles/worker-role.d.ts +63 -0
- package/dist/roles/worker-role.js +144 -0
- package/dist/roles/worker.module.d.ts +14 -0
- package/dist/roles/worker.module.js +90 -0
- package/dist/runtime/abort.js +19 -2
- package/dist/runtime/checkpointer.d.ts +8 -3
- package/dist/runtime/checkpointer.js +87 -55
- package/dist/runtime/conversation-lock.d.ts +20 -11
- package/dist/runtime/conversation-lock.js +62 -72
- package/dist/runtime/hook-calls.d.ts +3 -3
- package/dist/runtime/hook-calls.js +1 -6
- package/dist/runtime/job-ids.d.ts +10 -0
- package/dist/runtime/job-ids.js +10 -0
- package/dist/runtime/langgraph-loop.js +1 -1
- package/dist/runtime/loop.d.ts +7 -0
- package/dist/runtime/loop.js +14 -0
- package/dist/runtime/maintenance-queue.d.ts +10 -0
- package/dist/runtime/maintenance-queue.js +10 -0
- package/dist/runtime/maintenance.d.ts +45 -74
- package/dist/runtime/maintenance.js +139 -137
- package/dist/runtime/model-call.d.ts +7 -4
- package/dist/runtime/model-call.js +24 -57
- package/dist/runtime/providers.d.ts +17 -6
- package/dist/runtime/providers.js +66 -25
- package/dist/runtime/quota.d.ts +17 -3
- package/dist/runtime/quota.js +27 -2
- package/dist/runtime/retired-schedulers.d.ts +7 -0
- package/dist/runtime/retired-schedulers.js +31 -0
- package/dist/runtime/run-control.d.ts +33 -0
- package/dist/runtime/run-control.js +77 -0
- package/dist/runtime/run-finish.d.ts +26 -17
- package/dist/runtime/run-finish.js +98 -51
- package/dist/runtime/run-jobs.d.ts +48 -0
- package/dist/runtime/run-jobs.js +95 -0
- package/dist/runtime/run-processors.d.ts +60 -0
- package/dist/runtime/run-processors.js +185 -0
- package/dist/runtime/run-queue.d.ts +32 -57
- package/dist/runtime/run-queue.js +291 -295
- package/dist/runtime/run-steps.d.ts +39 -0
- package/dist/runtime/run-steps.js +96 -0
- package/dist/runtime/run-worker.d.ts +121 -75
- package/dist/runtime/run-worker.js +340 -226
- package/dist/runtime/runtime.module.d.ts +10 -0
- package/dist/runtime/runtime.module.js +112 -0
- package/dist/runtime/step-log.d.ts +40 -0
- package/dist/runtime/step-log.js +94 -0
- package/dist/runtime/stream.controller.d.ts +5 -8
- package/dist/runtime/stream.controller.js +14 -12
- package/dist/runtime/stream.d.ts +24 -6
- package/dist/runtime/stream.js +78 -7
- package/dist/runtime/subagents/child.d.ts +3 -44
- package/dist/runtime/subagents/child.js +0 -79
- package/dist/runtime/subagents/definition.d.ts +4 -4
- package/dist/runtime/subagents/definition.js +2 -2
- package/dist/runtime/subagents/dispatch.d.ts +87 -6
- package/dist/runtime/subagents/dispatch.js +135 -140
- package/dist/runtime/subagents/limits.d.ts +9 -4
- package/dist/runtime/subagents/limits.js +4 -2
- package/dist/runtime/subagents/org-agents.d.ts +4 -4
- package/dist/runtime/subagents/org-agents.js +1 -1
- package/dist/runtime/subagents/progress.d.ts +2 -2
- package/dist/runtime/subagents/roster.d.ts +3 -3
- package/dist/runtime/subagents/roster.js +1 -1
- package/dist/runtime/subagents/skill-fork.d.ts +6 -7
- package/dist/runtime/subagents/skill-fork.js +16 -5
- package/dist/runtime/subagents/subagents.service.d.ts +40 -0
- package/dist/runtime/subagents/subagents.service.js +101 -0
- package/dist/runtime/usage-report.d.ts +94 -52
- package/dist/runtime/usage-report.js +200 -100
- package/dist/runtime/waits.d.ts +125 -57
- package/dist/runtime/waits.js +431 -208
- package/dist/sandbox/job-ids.d.ts +10 -0
- package/dist/sandbox/job-ids.js +10 -0
- package/dist/sandbox/jobs.d.ts +41 -0
- package/dist/sandbox/jobs.js +113 -0
- package/dist/sandbox/leases.d.ts +39 -31
- package/dist/sandbox/leases.js +117 -257
- package/dist/sandbox/providers.d.ts +19 -0
- package/dist/sandbox/providers.js +38 -0
- package/dist/sandbox/sandbox.module.d.ts +8 -0
- package/dist/sandbox/sandbox.module.js +30 -0
- package/dist/sandbox/sandbox.service.d.ts +24 -29
- package/dist/sandbox/sandbox.service.js +106 -75
- package/dist/skills/catalog.d.ts +33 -20
- package/dist/skills/catalog.js +96 -53
- package/dist/skills/changes.controller.d.ts +4 -4
- package/dist/skills/changes.controller.js +15 -9
- package/dist/skills/changes.service.d.ts +28 -18
- package/dist/skills/changes.service.js +421 -364
- package/dist/skills/invocable.controller.d.ts +1 -1
- package/dist/skills/invocable.controller.js +8 -5
- package/dist/skills/invoke.d.ts +16 -15
- package/dist/skills/invoke.js +48 -17
- package/dist/skills/skills.controller.d.ts +1 -1
- package/dist/skills/skills.controller.js +11 -6
- package/dist/skills/skills.module.d.ts +6 -0
- package/dist/skills/skills.module.js +30 -0
- package/dist/skills/skills.service.d.ts +47 -30
- package/dist/skills/skills.service.js +221 -158
- package/dist/storage/job-ids.d.ts +6 -0
- package/dist/storage/job-ids.js +6 -0
- package/dist/storage/purge.d.ts +22 -7
- package/dist/storage/purge.js +55 -3
- package/dist/storage/storage.module.d.ts +6 -0
- package/dist/storage/storage.module.js +23 -0
- package/dist/storage/storage.service.d.ts +18 -4
- package/dist/storage/storage.service.js +44 -3
- package/dist/tools/approvals.controller.d.ts +1 -1
- package/dist/tools/approvals.controller.js +12 -8
- package/dist/tools/approvals.service.d.ts +27 -25
- package/dist/tools/approvals.service.js +324 -258
- package/dist/tools/breaker.d.ts +2 -2
- package/dist/tools/breaker.js +21 -3
- package/dist/tools/builtins/ask-user.d.ts +2 -2
- package/dist/tools/builtins/ask-user.js +1 -1
- package/dist/tools/builtins/builtin-tools.d.ts +21 -0
- package/dist/tools/builtins/builtin-tools.js +80 -0
- package/dist/tools/builtins/read-tool-output.d.ts +2 -2
- package/dist/tools/builtins/read-tool-output.js +1 -1
- package/dist/tools/builtins/sandbox/bash.js +2 -2
- package/dist/tools/builtins/sandbox/common.d.ts +2 -1
- package/dist/tools/builtins/sandbox/deliver.js +2 -2
- package/dist/tools/builtins/sandbox/edit.js +1 -1
- package/dist/tools/builtins/sandbox/glob.js +2 -2
- package/dist/tools/builtins/sandbox/grep.js +2 -2
- package/dist/tools/builtins/sandbox/read.js +1 -1
- package/dist/tools/builtins/sandbox/write.js +1 -1
- package/dist/tools/builtins/skill-load.d.ts +3 -3
- package/dist/tools/builtins/skill-load.js +1 -1
- package/dist/tools/canonical-json.d.ts +6 -0
- package/dist/tools/canonical-json.js +16 -0
- package/dist/tools/connector-content.controller.d.ts +1 -1
- package/dist/tools/connector-content.controller.js +11 -6
- package/dist/tools/connector-content.d.ts +12 -15
- package/dist/tools/connector-content.js +53 -18
- package/dist/tools/connectors.controller.d.ts +1 -1
- package/dist/tools/connectors.controller.js +21 -10
- package/dist/tools/connectors.service.d.ts +31 -13
- package/dist/tools/connectors.service.js +434 -344
- package/dist/tools/credentials.d.ts +17 -20
- package/dist/tools/credentials.js +55 -34
- package/dist/tools/drift.d.ts +29 -41
- package/dist/tools/drift.js +111 -79
- package/dist/tools/info.d.ts +12 -9
- package/dist/tools/info.js +33 -7
- package/dist/tools/job-ids.d.ts +13 -0
- package/dist/tools/job-ids.js +15 -0
- package/dist/tools/jobs.d.ts +24 -0
- package/dist/tools/jobs.js +69 -0
- package/dist/tools/oauth/flow-paths.d.ts +16 -0
- package/dist/tools/oauth/flow-paths.js +38 -0
- package/dist/tools/oauth/flow.d.ts +30 -30
- package/dist/tools/oauth/flow.js +109 -81
- package/dist/tools/oauth/oauth.controller.d.ts +3 -3
- package/dist/tools/oauth/oauth.controller.js +12 -9
- package/dist/tools/oauth/tokens.d.ts +11 -3
- package/dist/tools/oauth/tokens.js +15 -14
- package/dist/tools/outputs.d.ts +13 -4
- package/dist/tools/outputs.js +47 -3
- package/dist/tools/pipeline.d.ts +62 -46
- package/dist/tools/pipeline.js +145 -64
- package/dist/tools/policy.d.ts +2 -2
- package/dist/tools/questions.controller.d.ts +1 -1
- package/dist/tools/questions.controller.js +8 -5
- package/dist/tools/questions.service.d.ts +25 -24
- package/dist/tools/questions.service.js +201 -142
- package/dist/tools/registry.d.ts +30 -20
- package/dist/tools/registry.js +73 -37
- package/dist/tools/specs.d.ts +5 -4
- package/dist/tools/specs.js +3 -1
- package/dist/tools/tools.module.d.ts +10 -0
- package/dist/tools/tools.module.js +91 -0
- package/dist/ui/call-extension.d.ts +16 -0
- package/dist/ui/call-extension.js +38 -0
- package/dist/ui/embed-token.d.ts +9 -5
- package/dist/ui/embed-token.js +34 -6
- package/dist/ui/ui-stream.d.ts +22 -17
- package/dist/ui/ui-stream.js +72 -12
- package/dist/ui/ui.module.d.ts +7 -0
- package/dist/ui/ui.module.js +28 -0
- package/dist/ui/views.controller.d.ts +14 -12
- package/dist/ui/views.controller.js +32 -25
- package/dist/ui/views.d.ts +9 -57
- package/dist/ui/views.js +43 -45
- package/package.json +9 -2
- package/dist/http/health.controller.d.ts +0 -26
- package/dist/http/health.controller.js +0 -79
- package/dist/http/tokens.d.ts +0 -131
- package/dist/http/tokens.js +0 -131
- package/dist/http/zod.pipe.d.ts +0 -8
- package/dist/http/zod.pipe.js +0 -14
- package/dist/identity/rate-limit.d.ts +0 -55
- package/dist/identity/rate-limit.js +0 -121
- package/dist/sandbox/lifecycle.d.ts +0 -21
- package/dist/sandbox/lifecycle.js +0 -68
- /package/dist/http/{gateway.module.d.ts → gateway-routes.d.ts} +0 -0
- /package/dist/http/{gateway.module.js → gateway-routes.js} +0 -0
package/dist/channels/inbound.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
};
|
|
1
10
|
import { randomUUID } from "node:crypto";
|
|
11
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
12
|
+
import { ConversationsService } from "../conversations/conversations.service.js";
|
|
2
13
|
import { ApiError } from "../errors.js";
|
|
14
|
+
import { IdentityBinding } from "../identity/binding.js";
|
|
15
|
+
import { ExternalIdentities } from "../identity/external.js";
|
|
16
|
+
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
17
|
+
import { LockService } from "../infra/lock/lock.service.js";
|
|
18
|
+
import { KERNEL_LOGGER, REDIS } from "../infra/tokens.js";
|
|
19
|
+
import { DirectorySync } from "../orgs/directory-sync.js";
|
|
3
20
|
import { readOrgSettings } from "../orgs/settings.service.js";
|
|
4
21
|
import { parseSlashCommand } from "../skills/invoke.js";
|
|
22
|
+
import { ApprovalsService } from "../tools/approvals.service.js";
|
|
23
|
+
import { QuestionsService } from "../tools/questions.service.js";
|
|
5
24
|
import { ChannelCardActions } from "./actions.js";
|
|
6
|
-
import {
|
|
25
|
+
import { ChannelConnections } from "./connections.service.js";
|
|
26
|
+
import { ChannelJobs, idempotencyKey, inboundJobId } from "./jobs.js";
|
|
7
27
|
import { phrase } from "./phrases.js";
|
|
8
|
-
import {
|
|
28
|
+
import { AnonymousGuests, archiveThread, findThread, insertThread, threadKeyOf, } from "./threads.js";
|
|
9
29
|
/** 入站消息去重键的保留时长(秒):平台在这段时间内重投同一条消息只处理一次。 */
|
|
10
30
|
export const MESSAGE_DEDUPE_TTL_SECONDS = 86_400;
|
|
11
31
|
/** Dedupe key states: the enqueue is running (`pending`) or has succeeded (`done`). */
|
|
@@ -13,11 +33,6 @@ export const DEDUPE_PENDING = "pending";
|
|
|
13
33
|
export const DEDUPE_DONE = "done";
|
|
14
34
|
/** A `pending` key outlives a crashed enqueuer only this long, then redeliveries enqueue again. */
|
|
15
35
|
export const DEDUPE_PENDING_TTL_SECONDS = 60;
|
|
16
|
-
/** Deletes KEYS[1] only while it still holds ARGV[1] (a failed enqueue must not drop `done`). */
|
|
17
|
-
const DEL_IF_PENDING = `if redis.call("GET", KEYS[1]) == ARGV[1] then
|
|
18
|
-
return redis.call("DEL", KEYS[1])
|
|
19
|
-
end
|
|
20
|
-
return 0`;
|
|
21
36
|
/** 入站消息去重键(Redis 键,不是队列名 / job id,可以含 `:`)。 */
|
|
22
37
|
export const messageDedupeKey = (connectionId, messageId) => `capk:channel-msg:${connectionId}:${messageId}`;
|
|
23
38
|
/** 带平台事件 id 的卡片点击的去重键(Ruling A26,Redis 键,可以含 `:`)。 */
|
|
@@ -47,17 +62,47 @@ export const actionDedupeKey = (connectionId, eventId) => `capk:channel-act:${co
|
|
|
47
62
|
* 边界(已接受):同一 chat 的连续消息由不同任务并发处理,极少数情况下写入顺序可能与平台顺序不同;
|
|
48
63
|
* 处理在写入用户消息之后失败而重试时,固定话术 / 卡片回复可能再发一次。
|
|
49
64
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
let ChannelInbound = class ChannelInbound {
|
|
66
|
+
kdb;
|
|
67
|
+
redis;
|
|
68
|
+
locks;
|
|
69
|
+
connections;
|
|
70
|
+
conversations;
|
|
71
|
+
external;
|
|
72
|
+
binding;
|
|
73
|
+
directorySync;
|
|
74
|
+
jobs;
|
|
75
|
+
guests;
|
|
76
|
+
log;
|
|
52
77
|
actions;
|
|
53
|
-
constructor(
|
|
54
|
-
|
|
78
|
+
constructor(kdb, redis,
|
|
79
|
+
/** The two-state dedupe markers (`lease` / `holderOf` / `releaseIf`; keys unchanged). */
|
|
80
|
+
locks, connections, conversations, external, binding,
|
|
81
|
+
/** 通讯录同步的投递(按 (组织, 插件) 每分钟去重的维护队列任务)。 */
|
|
82
|
+
directorySync,
|
|
83
|
+
/** The channel queue: inbound jobs (`onEvent` only dedupes and enqueues) and deliveries. */
|
|
84
|
+
jobs,
|
|
85
|
+
/** 卡片操作:审批决定与提问回答(授权由这两个服务按点击者映射到的账号判定)。 */
|
|
86
|
+
approvals, questions, guests, log) {
|
|
87
|
+
this.kdb = kdb;
|
|
88
|
+
this.redis = redis;
|
|
89
|
+
this.locks = locks;
|
|
90
|
+
this.connections = connections;
|
|
91
|
+
this.conversations = conversations;
|
|
92
|
+
this.external = external;
|
|
93
|
+
this.binding = binding;
|
|
94
|
+
this.directorySync = directorySync;
|
|
95
|
+
this.jobs = jobs;
|
|
96
|
+
this.guests = guests;
|
|
97
|
+
this.log = log;
|
|
55
98
|
this.actions = new ChannelCardActions({
|
|
56
|
-
db
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
99
|
+
get db() {
|
|
100
|
+
return kdb.db;
|
|
101
|
+
},
|
|
102
|
+
connections,
|
|
103
|
+
approvals,
|
|
104
|
+
questions,
|
|
105
|
+
outbound: jobs,
|
|
61
106
|
resolveSpeaker: (...args) => this.resolveSpeaker(...args),
|
|
62
107
|
});
|
|
63
108
|
}
|
|
@@ -70,7 +115,7 @@ export class ChannelInbound {
|
|
|
70
115
|
if (e.type === "card_action") {
|
|
71
116
|
if (e.eventId === undefined) {
|
|
72
117
|
// 平台没给事件 id:无法识别重投,每次都处理(重复的审批 / 回答由服务回「已处理」)
|
|
73
|
-
await this.
|
|
118
|
+
await this.jobs.enqueueInbound(connectionId, e, `inbound-${connectionId}-a${randomUUID()}`);
|
|
74
119
|
return;
|
|
75
120
|
}
|
|
76
121
|
return this.dedupeAndEnqueue(connectionId, e, actionDedupeKey(connectionId, e.eventId), inboundJobId(connectionId, `act:${e.eventId}`));
|
|
@@ -89,10 +134,9 @@ export class ChannelInbound {
|
|
|
89
134
|
* not create a second run; it means a redelivery is never acked before the job is really queued.
|
|
90
135
|
*/
|
|
91
136
|
async dedupeAndEnqueue(connectionId, e, key, jobId) {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const state = await redis.get(key);
|
|
137
|
+
const fresh = await this.locks.lease(key, DEDUPE_PENDING, DEDUPE_PENDING_TTL_SECONDS * 1000);
|
|
138
|
+
if (!fresh) {
|
|
139
|
+
const state = await this.locks.holderOf(key);
|
|
96
140
|
// Ack only a known-queued event ("1" = key from the pre-two-state code during a rolling
|
|
97
141
|
// upgrade); pending, or a key that vanished meanwhile (failed attempt, TTL), enqueues again
|
|
98
142
|
if (state === DEDUPE_DONE || state === "1")
|
|
@@ -101,20 +145,21 @@ export class ChannelInbound {
|
|
|
101
145
|
// Accepted edge: if the completed-job cap evicts the original job within the pending window,
|
|
102
146
|
// the re-add below runs the event twice (a duplicate run, never a loss)
|
|
103
147
|
try {
|
|
104
|
-
await
|
|
148
|
+
await this.jobs.enqueueInbound(connectionId, e, jobId);
|
|
105
149
|
}
|
|
106
150
|
catch (err) {
|
|
107
|
-
|
|
151
|
+
// a failed enqueue must not drop `done` (compare-and-delete)
|
|
152
|
+
await this.locks.releaseIf(key, DEDUPE_PENDING).catch(() => { });
|
|
108
153
|
throw err;
|
|
109
154
|
}
|
|
110
|
-
await redis.set(key, DEDUPE_DONE, "EX", MESSAGE_DEDUPE_TTL_SECONDS);
|
|
155
|
+
await this.redis.set(key, DEDUPE_DONE, "EX", MESSAGE_DEDUPE_TTL_SECONDS);
|
|
111
156
|
}
|
|
112
157
|
/** 入站任务的处理(worker 上执行;失败抛错由队列重试)。 */
|
|
113
158
|
async handle(connectionId, e) {
|
|
114
159
|
if (e.type === "directory_changed") {
|
|
115
|
-
const row = await this.
|
|
160
|
+
const row = await this.connections.row(connectionId);
|
|
116
161
|
if (row?.status === "active" && row.pluginEnabled) {
|
|
117
|
-
await this.
|
|
162
|
+
await this.directorySync.enqueue(row.orgId, row.plugin);
|
|
118
163
|
}
|
|
119
164
|
return;
|
|
120
165
|
}
|
|
@@ -125,7 +170,8 @@ export class ChannelInbound {
|
|
|
125
170
|
await this.message(connectionId, e);
|
|
126
171
|
}
|
|
127
172
|
async message(connectionId, e) {
|
|
128
|
-
const
|
|
173
|
+
const db = this.kdb.db;
|
|
174
|
+
const connections = this.connections;
|
|
129
175
|
const row = await connections.row(connectionId);
|
|
130
176
|
// 连接停用、组织已删除或插件在该组织停用(停用广播与长连接断开之间仍可能有事件到达):什么都不做
|
|
131
177
|
if (row?.status !== "active" || !row.pluginEnabled)
|
|
@@ -161,7 +207,7 @@ export class ChannelInbound {
|
|
|
161
207
|
if (conversationId === undefined) {
|
|
162
208
|
let created;
|
|
163
209
|
try {
|
|
164
|
-
created = (await this.
|
|
210
|
+
created = (await this.conversations.create(row.orgId, accountId, row.agentId)).id;
|
|
165
211
|
}
|
|
166
212
|
catch (err) {
|
|
167
213
|
if (err instanceof ApiError && err.code === "agent.not_found") {
|
|
@@ -190,7 +236,7 @@ export class ChannelInbound {
|
|
|
190
236
|
// best-effort (batch 5 review m4): a failed note must not fail the job before the thread
|
|
191
237
|
// is bound for the agent's reply below
|
|
192
238
|
if (posted.skillNotRun) {
|
|
193
|
-
await reply("skillNotRun").catch((err) => this.
|
|
239
|
+
await reply("skillNotRun").catch((err) => this.log.warn("cannot send the skill-not-run note", {
|
|
194
240
|
connectionId,
|
|
195
241
|
messageId: e.messageId,
|
|
196
242
|
err,
|
|
@@ -219,7 +265,7 @@ export class ChannelInbound {
|
|
|
219
265
|
updated_at: new Date(),
|
|
220
266
|
}))
|
|
221
267
|
.execute();
|
|
222
|
-
await this.
|
|
268
|
+
await this.jobs.enqueue(conversationId);
|
|
223
269
|
}
|
|
224
270
|
/**
|
|
225
271
|
* Posts the person's message: `/name args` as a skill invocation when the kernel accepts it, else
|
|
@@ -233,7 +279,11 @@ export class ChannelInbound {
|
|
|
233
279
|
let skillNotRun = false;
|
|
234
280
|
if (cmd !== null) {
|
|
235
281
|
try {
|
|
236
|
-
const event = await this.
|
|
282
|
+
const event = await this.conversations.postUserMessage(orgId, conversationId, accountId, {
|
|
283
|
+
...input,
|
|
284
|
+
text: cmd.args,
|
|
285
|
+
skill: { name: cmd.name },
|
|
286
|
+
});
|
|
237
287
|
return { event, skillNotRun };
|
|
238
288
|
}
|
|
239
289
|
catch (err) {
|
|
@@ -243,7 +293,7 @@ export class ChannelInbound {
|
|
|
243
293
|
}
|
|
244
294
|
if (err.code === "validation_failed") {
|
|
245
295
|
skillNotRun = true;
|
|
246
|
-
this.
|
|
296
|
+
this.log.info("IM skill invocation posted as text", {
|
|
247
297
|
conversationId,
|
|
248
298
|
skill: cmd.name,
|
|
249
299
|
reason: err.message,
|
|
@@ -251,7 +301,7 @@ export class ChannelInbound {
|
|
|
251
301
|
}
|
|
252
302
|
}
|
|
253
303
|
}
|
|
254
|
-
const event = await this.
|
|
304
|
+
const event = await this.conversations.postUserMessage(orgId, conversationId, accountId, input);
|
|
255
305
|
return { event, skillNotRun };
|
|
256
306
|
}
|
|
257
307
|
/**
|
|
@@ -260,9 +310,8 @@ export class ChannelInbound {
|
|
|
260
310
|
* `threadAccount` 为话题行记的账号(匿名访客为 null)。
|
|
261
311
|
*/
|
|
262
312
|
async resolveSpeaker(connectionId, row, sender, isGroup, locale, reply) {
|
|
263
|
-
const { db } = this.deps;
|
|
264
313
|
const source = `${row.plugin}:${sender.tenantId}`;
|
|
265
|
-
const bound = await this.
|
|
314
|
+
const bound = await this.external.findAccount(source, sender.externalId);
|
|
266
315
|
if (bound !== undefined && (await this.isActiveMember(row.orgId, bound))) {
|
|
267
316
|
return { accountId: bound, threadAccount: bound };
|
|
268
317
|
}
|
|
@@ -273,7 +322,7 @@ export class ChannelInbound {
|
|
|
273
322
|
await reply("anonymousNotAllowed");
|
|
274
323
|
return undefined;
|
|
275
324
|
}
|
|
276
|
-
return { accountId: await
|
|
325
|
+
return { accountId: await this.guests.ensure(row.orgId), threadAccount: null };
|
|
277
326
|
}
|
|
278
327
|
if (bound !== undefined) {
|
|
279
328
|
await reply("notMember");
|
|
@@ -285,7 +334,7 @@ export class ChannelInbound {
|
|
|
285
334
|
}
|
|
286
335
|
let url;
|
|
287
336
|
try {
|
|
288
|
-
url = await this.
|
|
337
|
+
url = await this.binding.createBindToken({
|
|
289
338
|
connectionId,
|
|
290
339
|
identity: {
|
|
291
340
|
source,
|
|
@@ -298,7 +347,7 @@ export class ChannelInbound {
|
|
|
298
347
|
});
|
|
299
348
|
}
|
|
300
349
|
catch (err) {
|
|
301
|
-
this.
|
|
350
|
+
this.log.warn("cannot create channel bind link", { connectionId, err });
|
|
302
351
|
await reply("bindUnavailable");
|
|
303
352
|
return undefined;
|
|
304
353
|
}
|
|
@@ -307,7 +356,7 @@ export class ChannelInbound {
|
|
|
307
356
|
}
|
|
308
357
|
/** 账号是该组织成员且账号未停用。 */
|
|
309
358
|
async isActiveMember(orgId, accountId) {
|
|
310
|
-
const r = await this.
|
|
359
|
+
const r = await this.kdb
|
|
311
360
|
.selectFrom("memberships")
|
|
312
361
|
.innerJoin("accounts", "accounts.id", "memberships.account_id")
|
|
313
362
|
.select("memberships.role")
|
|
@@ -319,7 +368,7 @@ export class ChannelInbound {
|
|
|
319
368
|
}
|
|
320
369
|
/** 连接绑定的 agent 未删除且可见范围为「全组织」(匿名访客只能用这种 agent)。 */
|
|
321
370
|
async agentVisibleToOrg(orgId, agentId) {
|
|
322
|
-
const r = await this.
|
|
371
|
+
const r = await this.kdb
|
|
323
372
|
.selectFrom("agents")
|
|
324
373
|
.select("id")
|
|
325
374
|
.where("id", "=", agentId)
|
|
@@ -329,4 +378,21 @@ export class ChannelInbound {
|
|
|
329
378
|
.executeTakeFirst();
|
|
330
379
|
return r !== undefined;
|
|
331
380
|
}
|
|
332
|
-
}
|
|
381
|
+
};
|
|
382
|
+
ChannelInbound = __decorate([
|
|
383
|
+
Injectable(),
|
|
384
|
+
__param(0, Inject(KernelDb)),
|
|
385
|
+
__param(1, Inject(REDIS)),
|
|
386
|
+
__param(2, Inject(LockService)),
|
|
387
|
+
__param(3, Inject(ChannelConnections)),
|
|
388
|
+
__param(4, Inject(ConversationsService)),
|
|
389
|
+
__param(5, Inject(ExternalIdentities)),
|
|
390
|
+
__param(6, Inject(IdentityBinding)),
|
|
391
|
+
__param(7, Inject(DirectorySync)),
|
|
392
|
+
__param(8, Inject(ChannelJobs)),
|
|
393
|
+
__param(9, Inject(ApprovalsService)),
|
|
394
|
+
__param(10, Inject(QuestionsService)),
|
|
395
|
+
__param(11, Inject(AnonymousGuests)),
|
|
396
|
+
__param(12, Inject(KERNEL_LOGGER))
|
|
397
|
+
], ChannelInbound);
|
|
398
|
+
export { ChannelInbound };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The channel gateway check's job name and the maintenance job scheduler id it had before it
|
|
3
|
+
* became a `@LockedCron` job: an upgraded deployment still has the
|
|
4
|
+
* scheduler in Redis, so the worker removes it at start (`RETIRED_SCHEDULER_IDS`). A leaf module:
|
|
5
|
+
* the maintenance worker imports it without the channel providers.
|
|
6
|
+
*/
|
|
7
|
+
/** The gateway check's job name (`@LockedCron`). */
|
|
8
|
+
export declare const GATEWAY_CHECK_JOB = "channel-gateway-check";
|
|
9
|
+
/** The gateway check's old scheduler (every minute). */
|
|
10
|
+
export declare const GATEWAY_CHECK_SCHEDULER_ID = "channel-gateway-check-every";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The channel gateway check's job name and the maintenance job scheduler id it had before it
|
|
3
|
+
* became a `@LockedCron` job: an upgraded deployment still has the
|
|
4
|
+
* scheduler in Redis, so the worker removes it at start (`RETIRED_SCHEDULER_IDS`). A leaf module:
|
|
5
|
+
* the maintenance worker imports it without the channel providers.
|
|
6
|
+
*/
|
|
7
|
+
/** The gateway check's job name (`@LockedCron`). */
|
|
8
|
+
export const GATEWAY_CHECK_JOB = "channel-gateway-check";
|
|
9
|
+
/** The gateway check's old scheduler (every minute). */
|
|
10
|
+
export const GATEWAY_CHECK_SCHEDULER_ID = "channel-gateway-check-every";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { InboundEvent, Logger } from "@capybara-hq/plugin-sdk";
|
|
2
|
+
import { type OnApplicationShutdown } from "@nestjs/common";
|
|
3
|
+
import type { Queue } from "bullmq";
|
|
4
|
+
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
5
|
+
import { KernelEvents } from "../infra/events/kernel-events.js";
|
|
6
|
+
/** 渠道队列(出站投递与入站任务,不含 `:`),只在 worker 角色上消费。 */
|
|
7
|
+
export declare const CHANNEL_QUEUE_NAME = "cap-kernel-channels";
|
|
8
|
+
/** 投递任务名。 */
|
|
9
|
+
export declare const DELIVER_JOB = "deliver";
|
|
10
|
+
/** 投递任务 id(不含 `:`):同一会话、同一日志位置只排一个任务。 */
|
|
11
|
+
export declare const deliverJobId: (conversationId: string, seq: number) => string;
|
|
12
|
+
/**
|
|
13
|
+
* 结束后复核排的任务 id:每次唯一(带随机后缀,不含 `:`)。不能复用 `deliver-<会话>-<seq>`——同 id 的任务
|
|
14
|
+
* 可能正因锁被占而即将直接结束,BullMQ 会把新任务去重进它,于是没人投递。
|
|
15
|
+
*/
|
|
16
|
+
export declare const followUpJobId: (conversationId: string, seq: number) => string;
|
|
17
|
+
/**
|
|
18
|
+
* 发给插件的幂等键(Ruling A15):把逻辑键(如 `<会话>-<seq>`)做 sha256,取 base64url 的前 32 个字符——
|
|
19
|
+
* 稳定、只含 `[A-Za-z0-9_-]`,满足常见平台的长度限制。
|
|
20
|
+
*/
|
|
21
|
+
export declare function idempotencyKey(raw: string): string;
|
|
22
|
+
/** 可重试失败(限流、5xx、网络、超时)的总尝试次数。 */
|
|
23
|
+
export declare const DELIVER_ATTEMPTS = 8;
|
|
24
|
+
export interface DeliverJobData {
|
|
25
|
+
conversationId: string;
|
|
26
|
+
}
|
|
27
|
+
/** 入站任务(Ruling A21):插件 `onEvent` 收到的事件,原样排进队列由 worker 处理。 */
|
|
28
|
+
export interface InboundJobData {
|
|
29
|
+
connectionId: string;
|
|
30
|
+
event: InboundEvent;
|
|
31
|
+
}
|
|
32
|
+
export type ChannelJobData = DeliverJobData | InboundJobData;
|
|
33
|
+
/** 入站任务名。 */
|
|
34
|
+
export declare const INBOUND_JOB = "inbound";
|
|
35
|
+
/**
|
|
36
|
+
* BullMQ 优先级(数字越小越先):入站任务先于出站投递任务——投递任务可能占着并发槽等输出,
|
|
37
|
+
* 用户发来的消息不能排在它们后面。
|
|
38
|
+
*/
|
|
39
|
+
export declare const INBOUND_PRIORITY = 1;
|
|
40
|
+
export declare const DELIVER_PRIORITY = 10;
|
|
41
|
+
/** 入站任务的总尝试次数(处理失败由 BullMQ 指数退避重试:1s、2s、4s、8s)。 */
|
|
42
|
+
export declare const INBOUND_ATTEMPTS = 5;
|
|
43
|
+
/**
|
|
44
|
+
* 入站消息的任务 id(不含 `:`):`inbound-<连接>-<sha256(消息 id) 的 base64url 前 22 位>`。同一条消息只排一个任务
|
|
45
|
+
* (已完成的任务保留一段时间,期间重复入队被 BullMQ 忽略)。
|
|
46
|
+
*/
|
|
47
|
+
export declare const inboundJobId: (connectionId: string, messageId: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* The producer side of the channel queue `cap-kernel-channels` (any role): delivery jobs for a
|
|
50
|
+
* conversation with an IM target, inbound jobs (Ruling A21), and the catch-up of a connection that
|
|
51
|
+
* can deliver again. Its consumer is {@link ChannelOutbound} through the `@Processor` of the worker
|
|
52
|
+
* role. Delivery jobs follow the kernel's domain events (spec §3b): every published log advance
|
|
53
|
+
* (`conversation.event-appended`), a run starting here (`run.started`), a stopped wait
|
|
54
|
+
* (`run.wait-stopped`), a decided approval and an answered question (their cards change). Each is
|
|
55
|
+
* lost-tolerant: the next append enqueues again, and a finished delivery job re-checks the log.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ChannelJobs implements OnApplicationShutdown {
|
|
58
|
+
private readonly db;
|
|
59
|
+
private readonly queue;
|
|
60
|
+
private readonly log;
|
|
61
|
+
/** Stopped (the stop's channel-outbound phase): enqueues do nothing, inbound enqueues throw. */
|
|
62
|
+
private closed;
|
|
63
|
+
private readonly unsubscribe;
|
|
64
|
+
constructor(db: KernelDb, queue: Queue<ChannelJobData>, events: Pick<KernelEvents, "on">, log: Pick<Logger, "warn" | "error">);
|
|
65
|
+
/** Unsubscribes after the stop phases: events emitted while they drain are still handled. */
|
|
66
|
+
onApplicationShutdown(): void;
|
|
67
|
+
/** 会话有 IM 投递目标时排一个出站任务,不等入队完成;失败只记日志。 */
|
|
68
|
+
private enqueueSoon;
|
|
69
|
+
/** 会话有 IM 投递目标时投递一个出站任务(同一日志位置重复调用只排一个);已关闭时什么都不做。 */
|
|
70
|
+
enqueue(conversationId: string, opts?: {
|
|
71
|
+
followUp?: boolean;
|
|
72
|
+
}): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* 排一个入站任务(Ruling A21,同一队列 `cap-kernel-channels`):处理失败按 {@link INBOUND_ATTEMPTS} 次指数退避重试。
|
|
75
|
+
* 已关闭时抛错(调用方据此让插件不确认、由平台重投)。
|
|
76
|
+
*/
|
|
77
|
+
enqueueInbound(connectionId: string, event: InboundEvent, jobId: string): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* 连接重新可投递(轮换了凭据 / 重新启用):给该连接投递进度落后于会话日志的会话各排一个出站任务,
|
|
80
|
+
* 补投停用或凭据失效期间落下的内容(不必等下一条消息)。
|
|
81
|
+
*/
|
|
82
|
+
resumeConnection(connectionId: string): Promise<void>;
|
|
83
|
+
/** No more jobs from this process (the stop's channel-outbound phase). Idempotent. */
|
|
84
|
+
close(): void;
|
|
85
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
};
|
|
10
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
11
|
+
import { getQueueToken } from "@nestjs/bullmq";
|
|
12
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
13
|
+
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
14
|
+
import { KernelEvents } from "../infra/events/kernel-events.js";
|
|
15
|
+
import { KERNEL_LOGGER } from "../infra/tokens.js";
|
|
16
|
+
/** 渠道队列(出站投递与入站任务,不含 `:`),只在 worker 角色上消费。 */
|
|
17
|
+
export const CHANNEL_QUEUE_NAME = "cap-kernel-channels";
|
|
18
|
+
/** 投递任务名。 */
|
|
19
|
+
export const DELIVER_JOB = "deliver";
|
|
20
|
+
/** 投递任务 id(不含 `:`):同一会话、同一日志位置只排一个任务。 */
|
|
21
|
+
export const deliverJobId = (conversationId, seq) => `deliver-${conversationId}-${seq}`;
|
|
22
|
+
/**
|
|
23
|
+
* 结束后复核排的任务 id:每次唯一(带随机后缀,不含 `:`)。不能复用 `deliver-<会话>-<seq>`——同 id 的任务
|
|
24
|
+
* 可能正因锁被占而即将直接结束,BullMQ 会把新任务去重进它,于是没人投递。
|
|
25
|
+
*/
|
|
26
|
+
export const followUpJobId = (conversationId, seq) => `deliver-${conversationId}-${seq}-f${randomUUID().slice(0, 8)}`;
|
|
27
|
+
/**
|
|
28
|
+
* 发给插件的幂等键(Ruling A15):把逻辑键(如 `<会话>-<seq>`)做 sha256,取 base64url 的前 32 个字符——
|
|
29
|
+
* 稳定、只含 `[A-Za-z0-9_-]`,满足常见平台的长度限制。
|
|
30
|
+
*/
|
|
31
|
+
export function idempotencyKey(raw) {
|
|
32
|
+
return createHash("sha256").update(raw).digest("base64url").slice(0, 32);
|
|
33
|
+
}
|
|
34
|
+
/** 可重试失败(限流、5xx、网络、超时)的总尝试次数。 */
|
|
35
|
+
export const DELIVER_ATTEMPTS = 8;
|
|
36
|
+
/** 入站任务名。 */
|
|
37
|
+
export const INBOUND_JOB = "inbound";
|
|
38
|
+
/**
|
|
39
|
+
* BullMQ 优先级(数字越小越先):入站任务先于出站投递任务——投递任务可能占着并发槽等输出,
|
|
40
|
+
* 用户发来的消息不能排在它们后面。
|
|
41
|
+
*/
|
|
42
|
+
export const INBOUND_PRIORITY = 1;
|
|
43
|
+
export const DELIVER_PRIORITY = 10;
|
|
44
|
+
/** 入站任务的总尝试次数(处理失败由 BullMQ 指数退避重试:1s、2s、4s、8s)。 */
|
|
45
|
+
export const INBOUND_ATTEMPTS = 5;
|
|
46
|
+
const INBOUND_BACKOFF_MS = 1000;
|
|
47
|
+
/**
|
|
48
|
+
* 入站消息的任务 id(不含 `:`):`inbound-<连接>-<sha256(消息 id) 的 base64url 前 22 位>`。同一条消息只排一个任务
|
|
49
|
+
* (已完成的任务保留一段时间,期间重复入队被 BullMQ 忽略)。
|
|
50
|
+
*/
|
|
51
|
+
export const inboundJobId = (connectionId, messageId) => `inbound-${connectionId}-${createHash("sha256").update(messageId).digest("base64url").slice(0, 22)}`;
|
|
52
|
+
/**
|
|
53
|
+
* The producer side of the channel queue `cap-kernel-channels` (any role): delivery jobs for a
|
|
54
|
+
* conversation with an IM target, inbound jobs (Ruling A21), and the catch-up of a connection that
|
|
55
|
+
* can deliver again. Its consumer is {@link ChannelOutbound} through the `@Processor` of the worker
|
|
56
|
+
* role. Delivery jobs follow the kernel's domain events (spec §3b): every published log advance
|
|
57
|
+
* (`conversation.event-appended`), a run starting here (`run.started`), a stopped wait
|
|
58
|
+
* (`run.wait-stopped`), a decided approval and an answered question (their cards change). Each is
|
|
59
|
+
* lost-tolerant: the next append enqueues again, and a finished delivery job re-checks the log.
|
|
60
|
+
*/
|
|
61
|
+
let ChannelJobs = class ChannelJobs {
|
|
62
|
+
db;
|
|
63
|
+
queue;
|
|
64
|
+
log;
|
|
65
|
+
/** Stopped (the stop's channel-outbound phase): enqueues do nothing, inbound enqueues throw. */
|
|
66
|
+
closed = false;
|
|
67
|
+
unsubscribe;
|
|
68
|
+
constructor(db, queue, events, log) {
|
|
69
|
+
this.db = db;
|
|
70
|
+
this.queue = queue;
|
|
71
|
+
this.log = log;
|
|
72
|
+
queue.on("error", (err) => this.log.error("channel outbound queue error", { err }));
|
|
73
|
+
const soon = ({ conversationId }) => this.enqueueSoon(conversationId);
|
|
74
|
+
this.unsubscribe = [
|
|
75
|
+
events.on("conversation.event-appended", soon),
|
|
76
|
+
events.on("run.started", soon),
|
|
77
|
+
events.on("run.wait-stopped", soon),
|
|
78
|
+
events.on("approval.decided", soon),
|
|
79
|
+
events.on("question.answered", soon),
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
/** Unsubscribes after the stop phases: events emitted while they drain are still handled. */
|
|
83
|
+
onApplicationShutdown() {
|
|
84
|
+
for (const off of this.unsubscribe)
|
|
85
|
+
off();
|
|
86
|
+
}
|
|
87
|
+
/** 会话有 IM 投递目标时排一个出站任务,不等入队完成;失败只记日志。 */
|
|
88
|
+
enqueueSoon(conversationId) {
|
|
89
|
+
this.enqueue(conversationId).catch((err) => this.log.warn("cannot enqueue channel delivery", { conversationId, err }));
|
|
90
|
+
}
|
|
91
|
+
/** 会话有 IM 投递目标时投递一个出站任务(同一日志位置重复调用只排一个);已关闭时什么都不做。 */
|
|
92
|
+
async enqueue(conversationId, opts = {}) {
|
|
93
|
+
if (this.closed)
|
|
94
|
+
return;
|
|
95
|
+
const row = await this.db
|
|
96
|
+
.selectFrom("channel_deliveries")
|
|
97
|
+
.innerJoin("conversations", "conversations.id", "channel_deliveries.conversation_id")
|
|
98
|
+
.select("conversations.last_seq")
|
|
99
|
+
.where("channel_deliveries.conversation_id", "=", conversationId)
|
|
100
|
+
.executeTakeFirst();
|
|
101
|
+
if (!row || this.closed)
|
|
102
|
+
return;
|
|
103
|
+
await this.queue.add(DELIVER_JOB, { conversationId }, {
|
|
104
|
+
jobId: opts.followUp
|
|
105
|
+
? followUpJobId(conversationId, Number(row.last_seq))
|
|
106
|
+
: deliverJobId(conversationId, Number(row.last_seq)),
|
|
107
|
+
attempts: DELIVER_ATTEMPTS,
|
|
108
|
+
backoff: { type: "deliver" },
|
|
109
|
+
priority: DELIVER_PRIORITY,
|
|
110
|
+
removeOnComplete: true,
|
|
111
|
+
removeOnFail: true,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 排一个入站任务(Ruling A21,同一队列 `cap-kernel-channels`):处理失败按 {@link INBOUND_ATTEMPTS} 次指数退避重试。
|
|
116
|
+
* 已关闭时抛错(调用方据此让插件不确认、由平台重投)。
|
|
117
|
+
*/
|
|
118
|
+
async enqueueInbound(connectionId, event, jobId) {
|
|
119
|
+
if (this.closed)
|
|
120
|
+
throw new Error("channel outbound queue is closed");
|
|
121
|
+
await this.queue.add(INBOUND_JOB, { connectionId, event }, {
|
|
122
|
+
jobId,
|
|
123
|
+
attempts: INBOUND_ATTEMPTS,
|
|
124
|
+
priority: INBOUND_PRIORITY,
|
|
125
|
+
backoff: { type: "exponential", delay: INBOUND_BACKOFF_MS },
|
|
126
|
+
removeOnComplete: { age: 3600, count: 1000 },
|
|
127
|
+
removeOnFail: { age: 86_400 },
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* 连接重新可投递(轮换了凭据 / 重新启用):给该连接投递进度落后于会话日志的会话各排一个出站任务,
|
|
132
|
+
* 补投停用或凭据失效期间落下的内容(不必等下一条消息)。
|
|
133
|
+
*/
|
|
134
|
+
async resumeConnection(connectionId) {
|
|
135
|
+
const rows = await this.db
|
|
136
|
+
.selectFrom("channel_deliveries")
|
|
137
|
+
.innerJoin("conversations", "conversations.id", "channel_deliveries.conversation_id")
|
|
138
|
+
.select("channel_deliveries.conversation_id")
|
|
139
|
+
.where("channel_deliveries.connection_id", "=", connectionId)
|
|
140
|
+
.whereRef("channel_deliveries.last_seq", "<", "conversations.last_seq")
|
|
141
|
+
.execute();
|
|
142
|
+
for (const r of rows)
|
|
143
|
+
await this.enqueue(r.conversation_id, { followUp: true });
|
|
144
|
+
}
|
|
145
|
+
/** No more jobs from this process (the stop's channel-outbound phase). Idempotent. */
|
|
146
|
+
close() {
|
|
147
|
+
this.closed = true;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
ChannelJobs = __decorate([
|
|
151
|
+
Injectable(),
|
|
152
|
+
__param(0, Inject(KernelDb)),
|
|
153
|
+
__param(1, Inject(getQueueToken(CHANNEL_QUEUE_NAME))),
|
|
154
|
+
__param(2, Inject(KernelEvents)),
|
|
155
|
+
__param(3, Inject(KERNEL_LOGGER))
|
|
156
|
+
], ChannelJobs);
|
|
157
|
+
export { ChannelJobs };
|