@capybara-hq/kernel 0.1.0-rc.0 → 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/bootstrap.json +10 -6
- 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 -193
- 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 +16 -1
- package/dist/config/schema.js +54 -7
- 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 -62
- 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/queue.js +3 -2
- 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 +2 -0
- package/dist/errors.js +2 -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 -120
- 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 +96 -42
- package/dist/extensions/bootstrap.js +303 -155
- 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 +52 -47
- 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 +19 -12
- package/dist/index.js +13 -8
- 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 -241
- 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-config.d.ts +9 -0
- package/dist/log-config.js +27 -0
- package/dist/log-context.d.ts +34 -0
- package/dist/log-context.js +44 -0
- package/dist/log-loki.d.ts +34 -0
- package/dist/log-loki.js +145 -0
- package/dist/log.d.ts +41 -10
- package/dist/log.js +91 -17
- 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/net/public-address.js +3 -2
- 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 -136
- 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 -225
- 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 -99
- 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 +7 -4
- package/dist/tools/builtins/sandbox/common.js +5 -3
- 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 +11 -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
|
@@ -1,63 +1,34 @@
|
|
|
1
|
-
|
|
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
|
+
var EvalRunsService_1;
|
|
11
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
2
12
|
import { sql } from "kysely";
|
|
3
|
-
import { paramIssues } from "../agents/
|
|
4
|
-
import { normalizeStoredDefinition, } from "../agents/definition.js";
|
|
13
|
+
import { normalizeStoredDefinition, paramIssues, } from "../agents/definition.js";
|
|
5
14
|
import { effectiveDefinition, NO_SELECTION, selectionAt, } from "../conversations/selection.js";
|
|
6
15
|
import { ApiError } from "../errors.js";
|
|
7
16
|
import { audit } from "../identity/audit.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
17
|
+
import { SettingsService } from "../identity/settings.js";
|
|
18
|
+
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
19
|
+
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
20
|
+
import { TransactionHost } from "../infra/database/transaction-host.js";
|
|
21
|
+
import { Transactional } from "../infra/database/transactional.decorator.js";
|
|
22
|
+
import { LockService } from "../infra/lock/lock.service.js";
|
|
23
|
+
import { costOf, PricesService, priceKey } from "../models/prices.js";
|
|
24
|
+
import { ModelPurposesService } from "../models/purposes.js";
|
|
25
|
+
import { OrgLock } from "../orgs/org-lock.js";
|
|
26
|
+
import { ProviderListError, ProviderRegistry } from "../runtime/providers.js";
|
|
27
|
+
import { ACTIVE_EVAL_STATUSES, EvalBudget, usageTokens } from "./budget.js";
|
|
28
|
+
import { EvalJobs } from "./jobs.js";
|
|
13
29
|
import { judgeOverheadTokens } from "./judge.js";
|
|
14
30
|
import { candidateModel } from "./step-replay.js";
|
|
15
|
-
|
|
16
|
-
export const EVAL_QUEUE_NAME = "cap-kernel-evals";
|
|
17
|
-
/** 每个用例一个任务(C7;不含 `:`)。 */
|
|
18
|
-
export const evalJobId = (runId, caseId) => `eval-${runId}-${caseId}`;
|
|
19
|
-
/** 评测队列(生产方):懒建连接;`close()` 关闭。 */
|
|
20
|
-
export class EvalQueue {
|
|
21
|
-
redisUrl;
|
|
22
|
-
log;
|
|
23
|
-
queue;
|
|
24
|
-
conn;
|
|
25
|
-
closed = false;
|
|
26
|
-
constructor(redisUrl, log) {
|
|
27
|
-
this.redisUrl = redisUrl;
|
|
28
|
-
this.log = log;
|
|
29
|
-
}
|
|
30
|
-
get() {
|
|
31
|
-
if (this.closed)
|
|
32
|
-
throw new Error("eval queue is closed");
|
|
33
|
-
if (!this.queue) {
|
|
34
|
-
this.conn = bullConnection(this.redisUrl, this.log);
|
|
35
|
-
this.queue = new Queue(EVAL_QUEUE_NAME, { connection: this.conn });
|
|
36
|
-
this.queue.on("error", (err) => this.log.error("eval queue error", { err }));
|
|
37
|
-
}
|
|
38
|
-
return this.queue;
|
|
39
|
-
}
|
|
40
|
-
async enqueue(jobs) {
|
|
41
|
-
await this.get().addBulk(jobs.map((data) => ({
|
|
42
|
-
name: "case",
|
|
43
|
-
data,
|
|
44
|
-
opts: {
|
|
45
|
-
jobId: evalJobId(data.runId, data.caseId),
|
|
46
|
-
// 处理函数外的暂时故障(PG / Redis):指数退避重试,不让整个用例一次失败。
|
|
47
|
-
// 结果按认领号写入,重做不会重复写结果
|
|
48
|
-
attempts: 3,
|
|
49
|
-
backoff: { type: "exponential", delay: 1000 },
|
|
50
|
-
removeOnComplete: true,
|
|
51
|
-
removeOnFail: 1000,
|
|
52
|
-
},
|
|
53
|
-
})));
|
|
54
|
-
}
|
|
55
|
-
async close() {
|
|
56
|
-
this.closed = true;
|
|
57
|
-
await this.queue?.close().catch(() => { });
|
|
58
|
-
this.conn?.disconnect();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
31
|
+
export { EVAL_QUEUE_NAME, evalJobId } from "./jobs.js";
|
|
61
32
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
62
33
|
const setNotFound = () => new ApiError("eval.set_not_found", "Eval set not found");
|
|
63
34
|
const runNotFound = () => new ApiError("eval.run_not_found", "Eval run not found");
|
|
@@ -180,10 +151,25 @@ const resultsViewedKey = (runId, accountId) => `capk:eval-results-viewed:${runId
|
|
|
180
151
|
* 评测运行(D5、C7):估算、启动(校验候选、预建结果、每个用例入队一个任务)、查看、结果分页、取消。
|
|
181
152
|
* 执行在 `evals/worker.ts`。写操作在事务里锁组织行并复核角色(`evals.manage`)。
|
|
182
153
|
*/
|
|
183
|
-
|
|
154
|
+
let EvalRunsService = EvalRunsService_1 = class EvalRunsService {
|
|
155
|
+
txHost;
|
|
184
156
|
d;
|
|
185
|
-
constructor(
|
|
186
|
-
this.
|
|
157
|
+
constructor(kdb, orgLock, locks, config, registry, prices, settings, queue, budget, purposes, txHost) {
|
|
158
|
+
this.txHost = txHost;
|
|
159
|
+
this.d = {
|
|
160
|
+
orgLock,
|
|
161
|
+
get db() {
|
|
162
|
+
return kdb.db;
|
|
163
|
+
},
|
|
164
|
+
locks,
|
|
165
|
+
config,
|
|
166
|
+
registry,
|
|
167
|
+
prices,
|
|
168
|
+
settings,
|
|
169
|
+
queue,
|
|
170
|
+
budget,
|
|
171
|
+
purposes,
|
|
172
|
+
};
|
|
187
173
|
}
|
|
188
174
|
async liveSet(orgId, setId) {
|
|
189
175
|
if (!UUID.test(setId))
|
|
@@ -330,7 +316,7 @@ export class EvalRunsService {
|
|
|
330
316
|
async judgePricing(orgId, rubric, judge) {
|
|
331
317
|
if (!judge)
|
|
332
318
|
return null;
|
|
333
|
-
const configured = this.d.config().evals.judgeMaxOutputTokens;
|
|
319
|
+
const configured = this.d.config.get().evals.judgeMaxOutputTokens;
|
|
334
320
|
let target;
|
|
335
321
|
try {
|
|
336
322
|
target = await this.d.purposes.resolve(orgId, "eval");
|
|
@@ -394,13 +380,13 @@ export class EvalRunsService {
|
|
|
394
380
|
* 集合的 agent 已删除 → `agent.not_found`(删除 agent 会取消它的运行;之后再估算 / 启动只会建出全部跳过的运行)。
|
|
395
381
|
* 在事务里调用时 FOR SHARE,与删除 agent 互斥。
|
|
396
382
|
*/
|
|
397
|
-
async assertAgentLive(
|
|
398
|
-
let q = db
|
|
383
|
+
async assertAgentLive(agentId, forShare = false) {
|
|
384
|
+
let q = this.d.db
|
|
399
385
|
.selectFrom("agents")
|
|
400
386
|
.select("id")
|
|
401
387
|
.where("id", "=", agentId)
|
|
402
388
|
.where("deleted_at", "is", null);
|
|
403
|
-
if (
|
|
389
|
+
if (forShare)
|
|
404
390
|
q = q.forShare();
|
|
405
391
|
if (!(await q.executeTakeFirst())) {
|
|
406
392
|
throw new ApiError("agent.not_found", "The agent of this eval set was deleted");
|
|
@@ -408,7 +394,7 @@ export class EvalRunsService {
|
|
|
408
394
|
}
|
|
409
395
|
async estimate(orgId, setId, input) {
|
|
410
396
|
const set = await this.liveSet(orgId, setId);
|
|
411
|
-
await this.assertAgentLive(
|
|
397
|
+
await this.assertAgentLive(set.agent_id);
|
|
412
398
|
const caps = this.tokenCaps(input.tokenCap);
|
|
413
399
|
const versionDef = await this.checkCandidate(set.agent_id, input.candidate);
|
|
414
400
|
const plans = await this.plan(setId, input.mode, input.candidate, versionDef);
|
|
@@ -417,7 +403,7 @@ export class EvalRunsService {
|
|
|
417
403
|
}
|
|
418
404
|
/** token 上限:给了就校验 [1, `evals.maxTokenCap`],缺省 `evals.defaultTokenCap`(D5)。 */
|
|
419
405
|
tokenCaps(tokenCap) {
|
|
420
|
-
const { defaultTokenCap, maxTokenCap } = this.d.config().evals;
|
|
406
|
+
const { defaultTokenCap, maxTokenCap } = this.d.config.get().evals;
|
|
421
407
|
const effectiveTokenCap = tokenCap ?? defaultTokenCap;
|
|
422
408
|
if (!Number.isInteger(effectiveTokenCap) ||
|
|
423
409
|
effectiveTokenCap < 1 ||
|
|
@@ -433,7 +419,7 @@ export class EvalRunsService {
|
|
|
433
419
|
*/
|
|
434
420
|
async start(orgId, actor, setId, input, actorTokenId) {
|
|
435
421
|
const set = await this.liveSet(orgId, setId);
|
|
436
|
-
await this.assertAgentLive(
|
|
422
|
+
await this.assertAgentLive(set.agent_id);
|
|
437
423
|
const tokenCap = this.tokenCaps(input.tokenCap).effectiveTokenCap;
|
|
438
424
|
const versionDef = await this.checkCandidate(set.agent_id, input.candidate);
|
|
439
425
|
if (input.judge)
|
|
@@ -448,97 +434,103 @@ export class EvalRunsService {
|
|
|
448
434
|
if (firstProblem) {
|
|
449
435
|
throw candidateInvalid(firstProblem.message, firstProblem.details ?? []);
|
|
450
436
|
}
|
|
451
|
-
const { runId, plans } = await this.
|
|
452
|
-
await lockOrgAndAuthorize(trx, orgId, actor, "evals.manage");
|
|
453
|
-
// 与删除用例(锁集合行 FOR UPDATE)互斥:之后读到的用例在提交前不会被删
|
|
454
|
-
const locked = await trx
|
|
455
|
-
.selectFrom("eval_sets")
|
|
456
|
-
.select("id")
|
|
457
|
-
.where("id", "=", setId)
|
|
458
|
-
.where("org_id", "=", orgId)
|
|
459
|
-
.where("deleted_at", "is", null)
|
|
460
|
-
.forShare()
|
|
461
|
-
.executeTakeFirst();
|
|
462
|
-
if (!locked)
|
|
463
|
-
throw setNotFound();
|
|
464
|
-
await this.assertAgentLive(trx, set.agent_id);
|
|
465
|
-
const alive = new Set((await trx
|
|
466
|
-
.selectFrom("eval_cases")
|
|
467
|
-
.select("id")
|
|
468
|
-
.where("set_id", "=", setId)
|
|
469
|
-
.where("id", "in", planned.map((p) => p.caseId))
|
|
470
|
-
.execute()).map((r) => r.id));
|
|
471
|
-
const plans = planned.filter((p) => alive.has(p.caseId));
|
|
472
|
-
if (plans.length === 0) {
|
|
473
|
-
throw new ApiError("eval.nothing_to_replay", "The eval set has nothing to replay");
|
|
474
|
-
}
|
|
475
|
-
const estimate = await this.summarize(plans, judge);
|
|
476
|
-
const run = await trx
|
|
477
|
-
.insertInto("eval_runs")
|
|
478
|
-
.values({
|
|
479
|
-
org_id: orgId,
|
|
480
|
-
set_id: setId,
|
|
481
|
-
mode: input.mode,
|
|
482
|
-
candidate: JSON.stringify(input.candidate),
|
|
483
|
-
judge: input.judge,
|
|
484
|
-
token_cap: String(tokenCap),
|
|
485
|
-
cases_total: plans.length,
|
|
486
|
-
estimate: JSON.stringify(estimate),
|
|
487
|
-
created_by: actor,
|
|
488
|
-
})
|
|
489
|
-
.returning("id")
|
|
490
|
-
.executeTakeFirstOrThrow();
|
|
491
|
-
// 候选不合法的用例:结果直接记错误(计入进度,不入队)
|
|
492
|
-
const rows = plans.flatMap((p) => p.results.map((r) => ({
|
|
493
|
-
run_id: run.id,
|
|
494
|
-
case_id: p.caseId,
|
|
495
|
-
org_id: orgId,
|
|
496
|
-
step: r.step,
|
|
497
|
-
model_call_seq: r.modelCallSeq,
|
|
498
|
-
...(p.problem !== null && {
|
|
499
|
-
status: "error",
|
|
500
|
-
error: JSON.stringify(p.problem),
|
|
501
|
-
}),
|
|
502
|
-
})));
|
|
503
|
-
for (let i = 0; i < rows.length; i += INSERT_CHUNK) {
|
|
504
|
-
await trx
|
|
505
|
-
.insertInto("eval_results")
|
|
506
|
-
.values(rows.slice(i, i + INSERT_CHUNK))
|
|
507
|
-
.execute();
|
|
508
|
-
}
|
|
509
|
-
await audit(trx, {
|
|
510
|
-
actorAccountId: actor,
|
|
511
|
-
...(actorTokenId !== undefined && { actorTokenId }),
|
|
512
|
-
orgId,
|
|
513
|
-
action: "eval.run_started",
|
|
514
|
-
target: run.id,
|
|
515
|
-
detail: { setId, mode: input.mode, judge: input.judge, tokenCap, cases: plans.length },
|
|
516
|
-
});
|
|
517
|
-
await recountCases(trx, run.id);
|
|
518
|
-
return { runId: run.id, plans: plans.filter((p) => p.problem === null) };
|
|
519
|
-
});
|
|
437
|
+
const { runId, plans } = await this.startIn(orgId, actor, setId, set.agent_id, input, tokenCap, planned, judge, actorTokenId);
|
|
520
438
|
try {
|
|
521
439
|
await this.d.queue.enqueue(plans.map((p) => ({ runId, caseId: p.caseId, orgId })));
|
|
522
440
|
}
|
|
523
441
|
catch (e) {
|
|
524
|
-
await this.
|
|
525
|
-
await trx
|
|
526
|
-
.updateTable("eval_runs")
|
|
527
|
-
.set({ status: "failed", finished_at: sql `now()` })
|
|
528
|
-
.where("id", "=", runId)
|
|
529
|
-
.execute();
|
|
530
|
-
await trx
|
|
531
|
-
.updateTable("eval_results")
|
|
532
|
-
.set({ status: "skipped", updated_at: sql `now()` })
|
|
533
|
-
.where("run_id", "=", runId)
|
|
534
|
-
.where("status", "=", "pending")
|
|
535
|
-
.execute();
|
|
536
|
-
await recountCases(trx, runId);
|
|
537
|
-
});
|
|
442
|
+
await this.failStartIn(runId);
|
|
538
443
|
throw e;
|
|
539
444
|
}
|
|
540
445
|
return this.get(orgId, runId);
|
|
541
446
|
}
|
|
447
|
+
/** The run row and its pending results, in a transaction of their own (enqueued after the commit). */
|
|
448
|
+
async startIn(orgId, actor, setId, agentId, input, tokenCap, planned, judge, actorTokenId) {
|
|
449
|
+
const db = this.d.db;
|
|
450
|
+
await this.d.orgLock.lockAndAuthorize(orgId, actor, "evals.manage");
|
|
451
|
+
// 与删除用例(锁集合行 FOR UPDATE)互斥:之后读到的用例在提交前不会被删
|
|
452
|
+
const locked = await db
|
|
453
|
+
.selectFrom("eval_sets")
|
|
454
|
+
.select("id")
|
|
455
|
+
.where("id", "=", setId)
|
|
456
|
+
.where("org_id", "=", orgId)
|
|
457
|
+
.where("deleted_at", "is", null)
|
|
458
|
+
.forShare()
|
|
459
|
+
.executeTakeFirst();
|
|
460
|
+
if (!locked)
|
|
461
|
+
throw setNotFound();
|
|
462
|
+
await this.assertAgentLive(agentId, true);
|
|
463
|
+
const alive = new Set((await db
|
|
464
|
+
.selectFrom("eval_cases")
|
|
465
|
+
.select("id")
|
|
466
|
+
.where("set_id", "=", setId)
|
|
467
|
+
.where("id", "in", planned.map((p) => p.caseId))
|
|
468
|
+
.execute()).map((r) => r.id));
|
|
469
|
+
const plans = planned.filter((p) => alive.has(p.caseId));
|
|
470
|
+
if (plans.length === 0) {
|
|
471
|
+
throw new ApiError("eval.nothing_to_replay", "The eval set has nothing to replay");
|
|
472
|
+
}
|
|
473
|
+
const estimate = await this.summarize(plans, judge);
|
|
474
|
+
const run = await db
|
|
475
|
+
.insertInto("eval_runs")
|
|
476
|
+
.values({
|
|
477
|
+
org_id: orgId,
|
|
478
|
+
set_id: setId,
|
|
479
|
+
mode: input.mode,
|
|
480
|
+
candidate: JSON.stringify(input.candidate),
|
|
481
|
+
judge: input.judge,
|
|
482
|
+
token_cap: String(tokenCap),
|
|
483
|
+
cases_total: plans.length,
|
|
484
|
+
estimate: JSON.stringify(estimate),
|
|
485
|
+
created_by: actor,
|
|
486
|
+
})
|
|
487
|
+
.returning("id")
|
|
488
|
+
.executeTakeFirstOrThrow();
|
|
489
|
+
// 候选不合法的用例:结果直接记错误(计入进度,不入队)
|
|
490
|
+
const rows = plans.flatMap((p) => p.results.map((r) => ({
|
|
491
|
+
run_id: run.id,
|
|
492
|
+
case_id: p.caseId,
|
|
493
|
+
org_id: orgId,
|
|
494
|
+
step: r.step,
|
|
495
|
+
model_call_seq: r.modelCallSeq,
|
|
496
|
+
...(p.problem !== null && {
|
|
497
|
+
status: "error",
|
|
498
|
+
error: JSON.stringify(p.problem),
|
|
499
|
+
}),
|
|
500
|
+
})));
|
|
501
|
+
for (let i = 0; i < rows.length; i += INSERT_CHUNK) {
|
|
502
|
+
await db
|
|
503
|
+
.insertInto("eval_results")
|
|
504
|
+
.values(rows.slice(i, i + INSERT_CHUNK))
|
|
505
|
+
.execute();
|
|
506
|
+
}
|
|
507
|
+
await audit(db, {
|
|
508
|
+
actorAccountId: actor,
|
|
509
|
+
...(actorTokenId !== undefined && { actorTokenId }),
|
|
510
|
+
orgId,
|
|
511
|
+
action: "eval.run_started",
|
|
512
|
+
target: run.id,
|
|
513
|
+
detail: { setId, mode: input.mode, judge: input.judge, tokenCap, cases: plans.length },
|
|
514
|
+
});
|
|
515
|
+
await this.d.budget.recountCases(run.id);
|
|
516
|
+
return { runId: run.id, plans: plans.filter((p) => p.problem === null) };
|
|
517
|
+
}
|
|
518
|
+
/** The enqueue failed: the run is `failed`, its pending results `skipped`. */
|
|
519
|
+
async failStartIn(runId) {
|
|
520
|
+
const db = this.d.db;
|
|
521
|
+
await db
|
|
522
|
+
.updateTable("eval_runs")
|
|
523
|
+
.set({ status: "failed", finished_at: sql `now()` })
|
|
524
|
+
.where("id", "=", runId)
|
|
525
|
+
.execute();
|
|
526
|
+
await db
|
|
527
|
+
.updateTable("eval_results")
|
|
528
|
+
.set({ status: "skipped", updated_at: sql `now()` })
|
|
529
|
+
.where("run_id", "=", runId)
|
|
530
|
+
.where("status", "=", "pending")
|
|
531
|
+
.execute();
|
|
532
|
+
await this.d.budget.recountCases(runId);
|
|
533
|
+
}
|
|
542
534
|
/** 各运行的汇总(只算已结束的)。 */
|
|
543
535
|
async summaries(rows) {
|
|
544
536
|
const finished = rows
|
|
@@ -620,7 +612,7 @@ export class EvalRunsService {
|
|
|
620
612
|
if (!r)
|
|
621
613
|
throw runNotFound();
|
|
622
614
|
const sums = await this.summaries([r]);
|
|
623
|
-
return
|
|
615
|
+
return EvalRunsService_1.toView(r, sums.get(r.id) ?? null);
|
|
624
616
|
}
|
|
625
617
|
async listForSet(orgId, setId) {
|
|
626
618
|
await this.liveSet(orgId, setId);
|
|
@@ -633,25 +625,22 @@ export class EvalRunsService {
|
|
|
633
625
|
.orderBy("id", "desc")
|
|
634
626
|
.execute();
|
|
635
627
|
const sums = await this.summaries(rows);
|
|
636
|
-
return rows.map((r) =>
|
|
628
|
+
return rows.map((r) => EvalRunsService_1.toView(r, sums.get(r.id) ?? null));
|
|
637
629
|
}
|
|
638
630
|
/**
|
|
639
631
|
* 查看结果的审计 `eval.results_viewed`(结果里有回放出来的对话内容):每位查看者每次运行每小时一条——Redis
|
|
640
632
|
* `SET NX EX` 去重(多副本共享),轻量轮询因此不会刷审计。Redis 不可用时照写(宁多不漏)。
|
|
641
633
|
*/
|
|
642
634
|
async viewed(orgId, runId, actor, actorTokenId) {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
catch {
|
|
650
|
-
first = true;
|
|
651
|
-
}
|
|
652
|
-
if (!first)
|
|
653
|
-
return;
|
|
635
|
+
let first = true;
|
|
636
|
+
try {
|
|
637
|
+
first = await this.d.locks.lease(resultsViewedKey(runId, actor), "1", RESULTS_VIEWED_TTL_SECONDS * 1000);
|
|
638
|
+
}
|
|
639
|
+
catch {
|
|
640
|
+
first = true;
|
|
654
641
|
}
|
|
642
|
+
if (!first)
|
|
643
|
+
return;
|
|
655
644
|
await audit(this.d.db, {
|
|
656
645
|
actorAccountId: actor,
|
|
657
646
|
...(actorTokenId !== undefined && { actorTokenId }),
|
|
@@ -749,35 +738,7 @@ export class EvalRunsService {
|
|
|
749
738
|
if (!UUID.test(runId))
|
|
750
739
|
throw runNotFound();
|
|
751
740
|
await this.get(orgId, runId);
|
|
752
|
-
await this.
|
|
753
|
-
await lockOrgAndAuthorize(trx, orgId, actor, "evals.manage");
|
|
754
|
-
const r = await trx
|
|
755
|
-
.updateTable("eval_runs")
|
|
756
|
-
.set({ status: "cancelled", finished_at: sql `now()` })
|
|
757
|
-
.where("id", "=", runId)
|
|
758
|
-
.where("org_id", "=", orgId)
|
|
759
|
-
.where("status", "in", [...ACTIVE_EVAL_STATUSES])
|
|
760
|
-
.executeTakeFirst();
|
|
761
|
-
if (Number(r.numUpdatedRows) === 0) {
|
|
762
|
-
throw new ApiError("eval.run_finished", "The eval run has already finished");
|
|
763
|
-
}
|
|
764
|
-
await trx
|
|
765
|
-
.updateTable("eval_results")
|
|
766
|
-
.set({ status: "skipped", updated_at: sql `now()` })
|
|
767
|
-
.where("run_id", "=", runId)
|
|
768
|
-
.where("status", "=", "pending")
|
|
769
|
-
.execute();
|
|
770
|
-
await skipPendingJudges(trx, runId);
|
|
771
|
-
// 尚未开始的用例此刻已全部结束:进度立即反映(在途的用例做完后由 worker 再重算)
|
|
772
|
-
await recountCases(trx, runId);
|
|
773
|
-
await audit(trx, {
|
|
774
|
-
actorAccountId: actor,
|
|
775
|
-
...(actorTokenId !== undefined && { actorTokenId }),
|
|
776
|
-
orgId,
|
|
777
|
-
action: "eval.run_cancelled",
|
|
778
|
-
target: runId,
|
|
779
|
-
});
|
|
780
|
-
});
|
|
741
|
+
await this.cancelIn(orgId, actor, runId, actorTokenId);
|
|
781
742
|
return this.get(orgId, runId);
|
|
782
743
|
}
|
|
783
744
|
/**
|
|
@@ -787,50 +748,100 @@ export class EvalRunsService {
|
|
|
787
748
|
async label(orgId, actor, resultId, input, actorTokenId) {
|
|
788
749
|
if (!UUID.test(resultId))
|
|
789
750
|
throw resultNotFound();
|
|
790
|
-
const row = await this.
|
|
791
|
-
await lockOrgAndAuthorize(trx, orgId, actor, "evals.manage");
|
|
792
|
-
// 先锁住这条结果、读出原标注(写进审计)
|
|
793
|
-
const before = await trx
|
|
794
|
-
.selectFrom("eval_results")
|
|
795
|
-
.select("label")
|
|
796
|
-
.where("id", "=", resultId)
|
|
797
|
-
.where("org_id", "=", orgId)
|
|
798
|
-
.forUpdate()
|
|
799
|
-
.executeTakeFirst();
|
|
800
|
-
if (!before)
|
|
801
|
-
throw resultNotFound();
|
|
802
|
-
const cleared = input.label === null;
|
|
803
|
-
const r = await trx
|
|
804
|
-
.updateTable("eval_results")
|
|
805
|
-
.set({
|
|
806
|
-
label: input.label,
|
|
807
|
-
label_note: cleared ? null : (input.note ?? null),
|
|
808
|
-
labeled_by: cleared ? null : actor,
|
|
809
|
-
labeled_at: cleared ? null : sql `now()`,
|
|
810
|
-
updated_at: sql `now()`,
|
|
811
|
-
})
|
|
812
|
-
.where("id", "=", resultId)
|
|
813
|
-
.where("org_id", "=", orgId)
|
|
814
|
-
.where((eb) => eb.exists(eb
|
|
815
|
-
.selectFrom("eval_runs as er")
|
|
816
|
-
.innerJoin("eval_sets as es", "es.id", "er.set_id")
|
|
817
|
-
.select("er.id")
|
|
818
|
-
.whereRef("er.id", "=", "eval_results.run_id")
|
|
819
|
-
.where("es.deleted_at", "is", null)))
|
|
820
|
-
.returningAll()
|
|
821
|
-
.executeTakeFirst();
|
|
822
|
-
if (!r)
|
|
823
|
-
throw resultNotFound();
|
|
824
|
-
await audit(trx, {
|
|
825
|
-
actorAccountId: actor,
|
|
826
|
-
...(actorTokenId !== undefined && { actorTokenId }),
|
|
827
|
-
orgId,
|
|
828
|
-
action: "eval.result_labeled",
|
|
829
|
-
target: resultId,
|
|
830
|
-
detail: { runId: r.run_id, label: input.label, previousLabel: before.label },
|
|
831
|
-
});
|
|
832
|
-
return r;
|
|
833
|
-
});
|
|
751
|
+
const row = await this.labelIn(orgId, actor, resultId, input, actorTokenId);
|
|
834
752
|
return resultView(row);
|
|
835
753
|
}
|
|
836
|
-
|
|
754
|
+
async cancelIn(orgId, actor, runId, actorTokenId) {
|
|
755
|
+
await this.d.orgLock.lockAndAuthorize(orgId, actor, "evals.manage");
|
|
756
|
+
const r = await this.d.db
|
|
757
|
+
.updateTable("eval_runs")
|
|
758
|
+
.set({ status: "cancelled", finished_at: sql `now()` })
|
|
759
|
+
.where("id", "=", runId)
|
|
760
|
+
.where("org_id", "=", orgId)
|
|
761
|
+
.where("status", "in", [...ACTIVE_EVAL_STATUSES])
|
|
762
|
+
.executeTakeFirst();
|
|
763
|
+
if (Number(r.numUpdatedRows) === 0) {
|
|
764
|
+
throw new ApiError("eval.run_finished", "The eval run has already finished");
|
|
765
|
+
}
|
|
766
|
+
// 尚未开始的用例此刻已全部结束:进度立即反映(在途的用例做完后由 worker 再重算)
|
|
767
|
+
await this.d.budget.skipRun(runId);
|
|
768
|
+
await audit(this.d.db, {
|
|
769
|
+
actorAccountId: actor,
|
|
770
|
+
...(actorTokenId !== undefined && { actorTokenId }),
|
|
771
|
+
orgId,
|
|
772
|
+
action: "eval.run_cancelled",
|
|
773
|
+
target: runId,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
async labelIn(orgId, actor, resultId, input, actorTokenId) {
|
|
777
|
+
await this.d.orgLock.lockAndAuthorize(orgId, actor, "evals.manage");
|
|
778
|
+
// 先锁住这条结果、读出原标注(写进审计)
|
|
779
|
+
const before = await this.d.db
|
|
780
|
+
.selectFrom("eval_results")
|
|
781
|
+
.select("label")
|
|
782
|
+
.where("id", "=", resultId)
|
|
783
|
+
.where("org_id", "=", orgId)
|
|
784
|
+
.forUpdate()
|
|
785
|
+
.executeTakeFirst();
|
|
786
|
+
if (!before)
|
|
787
|
+
throw resultNotFound();
|
|
788
|
+
const cleared = input.label === null;
|
|
789
|
+
const r = await this.d.db
|
|
790
|
+
.updateTable("eval_results")
|
|
791
|
+
.set({
|
|
792
|
+
label: input.label,
|
|
793
|
+
label_note: cleared ? null : (input.note ?? null),
|
|
794
|
+
labeled_by: cleared ? null : actor,
|
|
795
|
+
labeled_at: cleared ? null : sql `now()`,
|
|
796
|
+
updated_at: sql `now()`,
|
|
797
|
+
})
|
|
798
|
+
.where("id", "=", resultId)
|
|
799
|
+
.where("org_id", "=", orgId)
|
|
800
|
+
.where((eb) => eb.exists(eb
|
|
801
|
+
.selectFrom("eval_runs as er")
|
|
802
|
+
.innerJoin("eval_sets as es", "es.id", "er.set_id")
|
|
803
|
+
.select("er.id")
|
|
804
|
+
.whereRef("er.id", "=", "eval_results.run_id")
|
|
805
|
+
.where("es.deleted_at", "is", null)))
|
|
806
|
+
.returningAll()
|
|
807
|
+
.executeTakeFirst();
|
|
808
|
+
if (!r)
|
|
809
|
+
throw resultNotFound();
|
|
810
|
+
await audit(this.d.db, {
|
|
811
|
+
actorAccountId: actor,
|
|
812
|
+
...(actorTokenId !== undefined && { actorTokenId }),
|
|
813
|
+
orgId,
|
|
814
|
+
action: "eval.result_labeled",
|
|
815
|
+
target: resultId,
|
|
816
|
+
detail: { runId: r.run_id, label: input.label, previousLabel: before.label },
|
|
817
|
+
});
|
|
818
|
+
return r;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
__decorate([
|
|
822
|
+
Transactional({ propagation: "requires_new" })
|
|
823
|
+
], EvalRunsService.prototype, "startIn", null);
|
|
824
|
+
__decorate([
|
|
825
|
+
Transactional({ propagation: "requires_new" })
|
|
826
|
+
], EvalRunsService.prototype, "failStartIn", null);
|
|
827
|
+
__decorate([
|
|
828
|
+
Transactional({ propagation: "requires_new" })
|
|
829
|
+
], EvalRunsService.prototype, "cancelIn", null);
|
|
830
|
+
__decorate([
|
|
831
|
+
Transactional({ propagation: "requires_new" })
|
|
832
|
+
], EvalRunsService.prototype, "labelIn", null);
|
|
833
|
+
EvalRunsService = EvalRunsService_1 = __decorate([
|
|
834
|
+
Injectable(),
|
|
835
|
+
__param(0, Inject(KernelDb)),
|
|
836
|
+
__param(1, Inject(OrgLock)),
|
|
837
|
+
__param(2, Inject(LockService)),
|
|
838
|
+
__param(3, Inject(KernelConfigService)),
|
|
839
|
+
__param(4, Inject(ProviderRegistry)),
|
|
840
|
+
__param(5, Inject(PricesService)),
|
|
841
|
+
__param(6, Inject(SettingsService)),
|
|
842
|
+
__param(7, Inject(EvalJobs)),
|
|
843
|
+
__param(8, Inject(EvalBudget)),
|
|
844
|
+
__param(9, Inject(ModelPurposesService)),
|
|
845
|
+
__param(10, Inject(TransactionHost))
|
|
846
|
+
], EvalRunsService);
|
|
847
|
+
export { EvalRunsService };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { type Principal } from "../identity/principal.js";
|
|
3
3
|
import { type OrgContext } from "../orgs/org.guard.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type EvalCaseDetail, type EvalCaseView, type EvalSetDetail, EvalSetsService, type EvalSetView } from "./sets.service.js";
|
|
5
5
|
declare const CreateBody: z.ZodObject<{
|
|
6
6
|
agentId: z.ZodString;
|
|
7
7
|
name: z.ZodString;
|
|
@@ -7,12 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { Controller, Delete, Get, HttpCode, Inject, Param, Patch, Post } from "@nestjs/common";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
import { EVAL_SETS } from "../http/tokens.js";
|
|
13
|
-
import { ZodPipe } from "../http/zod.pipe.js";
|
|
14
12
|
import { CurrentPrincipal, patTokenId, requireUser, } from "../identity/principal.js";
|
|
13
|
+
import { createZodDto } from "../infra/validation/create-zod-dto.js";
|
|
14
|
+
import { ZBody } from "../infra/validation/zod-params.js";
|
|
15
15
|
import { CurrentOrg, OrgAction } from "../orgs/org.guard.js";
|
|
16
|
+
import { EvalSetsService, } from "./sets.service.js";
|
|
16
17
|
const NAME = z.string().trim().min(1).max(200);
|
|
17
18
|
const DESCRIPTION = z.string().max(2000);
|
|
18
19
|
const RUBRIC = z.string().min(1).max(20_000);
|
|
@@ -43,6 +44,14 @@ const SampleBody = z
|
|
|
43
44
|
minToolCalls: z.number().int().min(0).max(1000).optional(),
|
|
44
45
|
})
|
|
45
46
|
.strict();
|
|
47
|
+
class CreateBodyDto extends createZodDto(CreateBody, "EvalSetCreateBody") {
|
|
48
|
+
}
|
|
49
|
+
class PatchBodyDto extends createZodDto(PatchBody, "EvalSetPatchBody") {
|
|
50
|
+
}
|
|
51
|
+
class AddCaseBodyDto extends createZodDto(AddCaseBody, "EvalSetAddCaseBody") {
|
|
52
|
+
}
|
|
53
|
+
class SampleBodyDto extends createZodDto(SampleBody, "EvalSetSampleBody") {
|
|
54
|
+
}
|
|
46
55
|
/**
|
|
47
56
|
* 评测集与用例(`/api/v1/orgs/:orgId/eval-sets`):全部 `evals.manage`(admin 起、只给人)。
|
|
48
57
|
* 用例详情返回快照还原的轨迹,每次写审计 `trajectory.viewed`。
|
|
@@ -111,7 +120,7 @@ __decorate([
|
|
|
111
120
|
OrgAction("evals.manage"),
|
|
112
121
|
__param(0, CurrentPrincipal()),
|
|
113
122
|
__param(1, CurrentOrg()),
|
|
114
|
-
__param(2,
|
|
123
|
+
__param(2, ZBody(CreateBodyDto))
|
|
115
124
|
], EvalSetsController.prototype, "create", null);
|
|
116
125
|
__decorate([
|
|
117
126
|
Get(),
|
|
@@ -132,7 +141,7 @@ __decorate([
|
|
|
132
141
|
__param(0, CurrentPrincipal()),
|
|
133
142
|
__param(1, CurrentOrg()),
|
|
134
143
|
__param(2, Param("setId")),
|
|
135
|
-
__param(3,
|
|
144
|
+
__param(3, ZBody(PatchBodyDto))
|
|
136
145
|
], EvalSetsController.prototype, "update", null);
|
|
137
146
|
__decorate([
|
|
138
147
|
Delete(":setId"),
|
|
@@ -148,7 +157,7 @@ __decorate([
|
|
|
148
157
|
__param(0, CurrentPrincipal()),
|
|
149
158
|
__param(1, CurrentOrg()),
|
|
150
159
|
__param(2, Param("setId")),
|
|
151
|
-
__param(3,
|
|
160
|
+
__param(3, ZBody(AddCaseBodyDto))
|
|
152
161
|
], EvalSetsController.prototype, "addCase", null);
|
|
153
162
|
__decorate([
|
|
154
163
|
Post(":setId/cases/sample"),
|
|
@@ -157,7 +166,7 @@ __decorate([
|
|
|
157
166
|
__param(0, CurrentPrincipal()),
|
|
158
167
|
__param(1, CurrentOrg()),
|
|
159
168
|
__param(2, Param("setId")),
|
|
160
|
-
__param(3,
|
|
169
|
+
__param(3, ZBody(SampleBodyDto))
|
|
161
170
|
], EvalSetsController.prototype, "sample", null);
|
|
162
171
|
__decorate([
|
|
163
172
|
Get(":setId/cases/:caseId"),
|
|
@@ -178,6 +187,6 @@ __decorate([
|
|
|
178
187
|
], EvalSetsController.prototype, "removeCase", null);
|
|
179
188
|
EvalSetsController = __decorate([
|
|
180
189
|
Controller("api/v1/orgs/:orgId/eval-sets"),
|
|
181
|
-
__param(0, Inject(
|
|
190
|
+
__param(0, Inject(EvalSetsService))
|
|
182
191
|
], EvalSetsController);
|
|
183
192
|
export { EvalSetsController };
|