@capybara-hq/kernel 0.1.0-rc.5 → 0.1.0-rc.7
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 +27 -3
- package/dist/admin/admin.controller.d.ts +21 -74
- package/dist/admin/admin.controller.js +50 -50
- package/dist/admin/admin.schemas.d.ts +57 -0
- package/dist/admin/admin.schemas.js +50 -0
- package/dist/admin/extensions.controller.d.ts +10 -0
- package/dist/admin/extensions.controller.js +18 -0
- package/dist/admin/extensions.schemas.d.ts +7 -0
- package/dist/admin/extensions.schemas.js +10 -0
- package/dist/admin/limit-defaults.d.ts +20 -0
- package/dist/admin/limit-defaults.js +10 -0
- package/dist/agents/agent-profile.service.d.ts +7 -5
- package/dist/agents/agent-profile.service.js +14 -9
- package/dist/agents/agents.controller.d.ts +7 -287
- package/dist/agents/agents.controller.js +7 -67
- package/dist/agents/agents.schemas.d.ts +389 -0
- package/dist/agents/agents.schemas.js +126 -0
- package/dist/agents/agents.service.d.ts +16 -6
- package/dist/agents/agents.service.js +75 -19
- package/dist/agents/definition.d.ts +47 -19
- package/dist/agents/definition.js +119 -38
- package/dist/agents/from-template.d.ts +2 -2
- package/dist/agents/from-template.js +76 -45
- package/dist/agents/from-template.service.d.ts +12 -0
- package/dist/agents/from-template.service.js +23 -6
- package/dist/agents/models.controller.d.ts +33 -5
- package/dist/agents/models.controller.js +50 -6
- package/dist/agents/org-templates.d.ts +13 -3
- package/dist/agents/org-templates.js +69 -28
- package/dist/agents/pending-connector-requests.d.ts +2 -0
- package/dist/agents/pending-connector-requests.js +1 -1
- package/dist/agents/pending-connectors.controller.d.ts +1 -1
- package/dist/agents/pending-connectors.controller.js +2 -2
- package/dist/agents/pending-connectors.service.d.ts +2 -2
- package/dist/agents/pending-connectors.service.js +19 -19
- package/dist/agents/profile.d.ts +18 -0
- package/dist/agents/profile.js +5 -1
- package/dist/agents/readiness.controller.d.ts +5 -5
- package/dist/agents/readiness.controller.js +6 -6
- package/dist/agents/templates.controller.d.ts +8 -17
- package/dist/agents/templates.controller.js +13 -31
- package/dist/agents/templates.schemas.d.ts +20 -0
- package/dist/agents/templates.schemas.js +45 -0
- package/dist/background/background.controller.js +3 -2
- package/dist/background/background.schemas.d.ts +10 -0
- package/dist/background/background.schemas.js +16 -0
- package/dist/background/tasks.service.d.ts +1 -1
- package/dist/background/tasks.service.js +7 -2
- package/dist/catalog/admin-catalog.controller.d.ts +4 -57
- package/dist/catalog/admin-catalog.controller.js +8 -45
- package/dist/catalog/admin-catalog.schemas.d.ts +72 -0
- package/dist/catalog/admin-catalog.schemas.js +92 -0
- package/dist/catalog/catalog-content.d.ts +12 -2
- package/dist/catalog/catalog-scope.service.js +8 -2
- package/dist/catalog/catalog.service.d.ts +2 -0
- package/dist/catalog/catalog.service.js +3 -0
- package/dist/catalog/component-scope.controller.d.ts +3 -65
- package/dist/catalog/component-scope.controller.js +3 -56
- package/dist/catalog/component-scope.schemas.d.ts +114 -0
- package/dist/catalog/component-scope.schemas.js +97 -0
- package/dist/catalog/component-scope.service.d.ts +28 -4
- package/dist/catalog/component-scope.service.js +55 -3
- package/dist/catalog/component-state.d.ts +9 -2
- package/dist/catalog/component-state.js +22 -13
- package/dist/catalog/marketplaces.controller.d.ts +5 -35
- package/dist/catalog/marketplaces.controller.js +6 -34
- package/dist/catalog/marketplaces.schemas.d.ts +48 -0
- package/dist/catalog/marketplaces.schemas.js +53 -0
- package/dist/catalog/marketplaces.service.d.ts +15 -1
- package/dist/catalog/marketplaces.service.js +22 -1
- package/dist/catalog/org-catalog.controller.d.ts +6 -62
- package/dist/catalog/org-catalog.controller.js +12 -66
- package/dist/catalog/org-catalog.schemas.d.ts +79 -0
- package/dist/catalog/org-catalog.schemas.js +82 -0
- package/dist/catalog/org-catalog.service.d.ts +9 -2
- package/dist/catalog/org-catalog.service.js +38 -5
- package/dist/catalog/org-extension.controller.d.ts +1 -12
- package/dist/catalog/org-extension.controller.js +1 -10
- package/dist/catalog/org-extension.schemas.d.ts +15 -0
- package/dist/catalog/org-extension.schemas.js +22 -0
- package/dist/catalog/org-plugin-uploads.controller.d.ts +2 -19
- package/dist/catalog/org-plugin-uploads.controller.js +15 -28
- package/dist/catalog/org-plugin-uploads.schemas.d.ts +20 -0
- package/dist/catalog/org-plugin-uploads.schemas.js +32 -0
- package/dist/catalog/owned-items.d.ts +6 -2
- package/dist/catalog/owned-items.js +16 -4
- package/dist/catalog/platform-components.d.ts +2 -0
- package/dist/catalog/platform-components.js +2 -0
- package/dist/catalog/plugin-import.js +1 -0
- package/dist/catalog/plugin-install.js +1 -1
- package/dist/catalog/requests.service.d.ts +2 -1
- package/dist/catalog/requests.service.js +6 -2
- package/dist/channels/channels.schemas.d.ts +33 -0
- package/dist/channels/channels.schemas.js +34 -0
- package/dist/channels/connections.controller.d.ts +2 -29
- package/dist/channels/connections.controller.js +1 -23
- package/dist/channels/connections.service.d.ts +8 -2
- package/dist/channels/connections.service.js +23 -5
- package/dist/channels/inbound.js +4 -0
- package/dist/config/schema.d.ts +4 -0
- package/dist/config/schema.js +24 -0
- package/dist/conversations/conversations.controller.d.ts +16 -37
- package/dist/conversations/conversations.controller.js +16 -56
- package/dist/conversations/conversations.schemas.d.ts +52 -0
- package/dist/conversations/conversations.schemas.js +79 -0
- package/dist/conversations/conversations.service.d.ts +13 -4
- package/dist/conversations/conversations.service.js +32 -26
- package/dist/conversations/events.d.ts +80 -6
- package/dist/conversations/events.js +60 -5
- package/dist/conversations/message-context.d.ts +28 -0
- package/dist/conversations/message-context.js +56 -0
- package/dist/conversations/queue.d.ts +2 -1
- package/dist/conversations/queue.js +11 -2
- package/dist/ctx/create-ctx.d.ts +15 -1
- package/dist/ctx/create-ctx.js +23 -2
- package/dist/db/kernel-schema.d.ts +44 -0
- package/dist/environments/environments.schemas.d.ts +3 -0
- package/dist/environments/environments.schemas.js +14 -0
- package/dist/environments/environments.service.d.ts +16 -4
- package/dist/environments/environments.service.js +58 -13
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/evals/evals.schemas.d.ts +110 -0
- package/dist/evals/evals.schemas.js +107 -0
- package/dist/evals/reconstruct.js +18 -11
- package/dist/evals/recorded-tools.d.ts +2 -1
- package/dist/evals/recorded-tools.js +11 -3
- package/dist/evals/run-replay.d.ts +8 -1
- package/dist/evals/run-replay.js +17 -2
- package/dist/evals/runs.controller.d.ts +2 -57
- package/dist/evals/runs.controller.js +1 -42
- package/dist/evals/runs.service.d.ts +8 -7
- package/dist/evals/runs.service.js +45 -30
- package/dist/evals/sets.controller.d.ts +2 -28
- package/dist/evals/sets.controller.js +1 -31
- package/dist/evals/sets.service.d.ts +7 -7
- package/dist/evals/sets.service.js +23 -17
- package/dist/evals/snapshot.d.ts +3 -2
- package/dist/evals/snapshot.js +17 -4
- package/dist/evals/step-replay.d.ts +2 -1
- package/dist/evals/step-replay.js +3 -2
- package/dist/extensions/admin-ops.d.ts +5 -3
- package/dist/extensions/admin-ops.js +17 -12
- package/dist/extensions/config-hash.d.ts +10 -0
- package/dist/extensions/config-hash.js +38 -0
- package/dist/extensions/deployment-config.d.ts +16 -1
- package/dist/extensions/deployment-config.js +83 -0
- package/dist/extensions/extensions.module.js +9 -12
- package/dist/extensions/host.d.ts +39 -12
- package/dist/extensions/host.js +129 -51
- package/dist/extensions/installs.d.ts +5 -0
- package/dist/extensions/installs.js +12 -0
- package/dist/extensions/org-config.d.ts +17 -2
- package/dist/extensions/org-config.js +23 -4
- package/dist/extensions/point-defaults.controller.d.ts +2 -8
- package/dist/extensions/point-defaults.controller.js +1 -3
- package/dist/extensions/point-defaults.d.ts +3 -1
- package/dist/extensions/point-defaults.js +4 -2
- package/dist/extensions/point-defaults.schemas.d.ts +9 -0
- package/dist/extensions/point-defaults.schemas.js +14 -0
- package/dist/extensions/state.module.d.ts +9 -0
- package/dist/extensions/state.module.js +38 -0
- package/dist/extensions/unavailable.d.ts +49 -0
- package/dist/extensions/unavailable.js +113 -0
- package/dist/files/previewers.controller.js +2 -3
- package/dist/files/previewers.d.ts +1 -1
- package/dist/files/previewers.js +4 -4
- package/dist/files/previewers.schemas.d.ts +10 -0
- package/dist/files/previewers.schemas.js +9 -0
- package/dist/http/api.module.js +4 -0
- package/dist/http/plugin-dispatch.d.ts +4 -1
- package/dist/http/plugin-dispatch.js +14 -2
- package/dist/identity/accounts.d.ts +43 -4
- package/dist/identity/accounts.js +74 -6
- package/dist/identity/auth.guard.js +10 -1
- package/dist/identity/cookies.d.ts +6 -0
- package/dist/identity/cookies.js +14 -0
- package/dist/identity/identity.module.js +3 -0
- package/dist/identity/initial-passwords.controller.d.ts +22 -0
- package/dist/identity/initial-passwords.controller.js +49 -0
- package/dist/identity/initial-passwords.d.ts +61 -0
- package/dist/identity/initial-passwords.job.d.ts +16 -0
- package/dist/identity/initial-passwords.job.js +46 -0
- package/dist/identity/initial-passwords.js +159 -0
- package/dist/identity/me.controller.d.ts +14 -0
- package/dist/identity/me.controller.js +39 -1
- package/dist/identity/principal.d.ts +8 -0
- package/dist/identity/principal.js +8 -0
- package/dist/identity/settings.d.ts +3 -1
- package/dist/identity/settings.js +6 -4
- package/dist/inbox/inbox.schemas.d.ts +8 -0
- package/dist/inbox/inbox.schemas.js +11 -0
- package/dist/inbox/platform-inbox.controller.d.ts +1 -1
- package/dist/inbox/platform-inbox.controller.js +2 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -0
- package/dist/infra/config/kernel-config.service.js +3 -0
- package/dist/infra/events/kernel-events.d.ts +8 -0
- package/dist/lifecycle/kernel-lifecycle.js +4 -0
- package/dist/models/embeddings.d.ts +82 -0
- package/dist/models/embeddings.js +326 -0
- package/dist/models/enablement.controller.d.ts +40 -0
- package/dist/models/enablement.controller.js +74 -0
- package/dist/models/enablement.d.ts +101 -0
- package/dist/models/enablement.js +264 -0
- package/dist/models/models.module.d.ts +5 -1
- package/dist/models/models.module.js +16 -4
- package/dist/models/org-models.schemas.d.ts +8 -0
- package/dist/models/org-models.schemas.js +22 -0
- package/dist/models/prices.d.ts +3 -1
- package/dist/models/prices.js +7 -5
- package/dist/models/purposes.d.ts +30 -6
- package/dist/models/purposes.js +68 -17
- package/dist/orgs/orgs.controller.d.ts +2 -5
- package/dist/orgs/orgs.controller.js +3 -6
- package/dist/orgs/orgs.schemas.d.ts +8 -0
- package/dist/orgs/orgs.schemas.js +16 -0
- package/dist/orgs/orgs.service.d.ts +3 -1
- package/dist/orgs/orgs.service.js +6 -4
- package/dist/orgs/settings.service.d.ts +9 -1
- package/dist/orgs/settings.service.js +20 -5
- package/dist/overrides.d.ts +4 -0
- package/dist/overrides.js +2 -0
- package/dist/platform/errors.d.ts +21 -4
- package/dist/platform/errors.js +45 -6
- package/dist/platform/exclusions.d.ts +2 -3
- package/dist/platform/exclusions.js +68 -831
- package/dist/platform/method.js +1 -1
- package/dist/platform/operation.d.ts +82 -5
- package/dist/platform/operation.js +62 -7
- package/dist/platform/ops/accounts.ops.d.ts +32 -0
- package/dist/platform/ops/accounts.ops.js +291 -0
- package/dist/platform/ops/admin.ops.d.ts +36 -0
- package/dist/platform/ops/admin.ops.js +389 -0
- package/dist/platform/ops/agent-skills.ops.d.ts +24 -0
- package/dist/platform/ops/agent-skills.ops.js +226 -0
- package/dist/platform/ops/agent-templates.ops.d.ts +4 -1
- package/dist/platform/ops/agent-templates.ops.js +194 -14
- package/dist/platform/ops/agents.ops.d.ts +19 -1
- package/dist/platform/ops/agents.ops.js +481 -58
- package/dist/platform/ops/approvals.ops.d.ts +30 -0
- package/dist/platform/ops/approvals.ops.js +116 -0
- package/dist/platform/ops/background.ops.d.ts +14 -0
- package/dist/platform/ops/background.ops.js +134 -0
- package/dist/platform/ops/catalog-admin.ops.d.ts +74 -0
- package/dist/platform/ops/catalog-admin.ops.js +587 -0
- package/dist/platform/ops/channels.ops.d.ts +16 -0
- package/dist/platform/ops/channels.ops.js +195 -0
- package/dist/platform/ops/components.ops.d.ts +46 -0
- package/dist/platform/ops/components.ops.js +853 -0
- package/dist/platform/ops/connectors.ops.d.ts +4 -2
- package/dist/platform/ops/connectors.ops.js +68 -6
- package/dist/platform/ops/conversations.ops.d.ts +30 -0
- package/dist/platform/ops/conversations.ops.js +470 -0
- package/dist/platform/ops/environments.ops.d.ts +26 -0
- package/dist/platform/ops/environments.ops.js +289 -0
- package/dist/platform/ops/errors.d.ts +10 -5
- package/dist/platform/ops/errors.js +19 -11
- package/dist/platform/ops/evals.ops.d.ts +28 -0
- package/dist/platform/ops/evals.ops.js +783 -0
- package/dist/platform/ops/extensions-admin.ops.d.ts +25 -0
- package/dist/platform/ops/extensions-admin.ops.js +344 -0
- package/dist/platform/ops/extensions.ops.d.ts +7 -1
- package/dist/platform/ops/extensions.ops.js +248 -17
- package/dist/platform/ops/inbox.ops.d.ts +25 -0
- package/dist/platform/ops/inbox.ops.js +378 -0
- package/dist/platform/ops/marketplaces.ops.d.ts +7 -1
- package/dist/platform/ops/marketplaces.ops.js +326 -17
- package/dist/platform/ops/models.ops.d.ts +25 -0
- package/dist/platform/ops/models.ops.js +232 -0
- package/dist/platform/ops/org-plugins.ops.d.ts +29 -0
- package/dist/platform/ops/org-plugins.ops.js +329 -0
- package/dist/platform/ops/org-settings.ops.d.ts +16 -0
- package/dist/platform/ops/org-settings.ops.js +102 -0
- package/dist/platform/ops/orgs.ops.d.ts +28 -0
- package/dist/platform/ops/orgs.ops.js +295 -0
- package/dist/platform/ops/other-orgs.d.ts +20 -0
- package/dist/platform/ops/other-orgs.js +72 -0
- package/dist/platform/ops/platform.ops.d.ts +4 -4
- package/dist/platform/ops/platform.ops.js +23 -24
- package/dist/platform/ops/plugins.ops.d.ts +10 -8
- package/dist/platform/ops/plugins.ops.js +176 -77
- package/dist/platform/ops/previewers.ops.d.ts +14 -0
- package/dist/platform/ops/previewers.ops.js +109 -0
- package/dist/platform/ops/requests.ops.js +57 -19
- package/dist/platform/ops/skills.ops.d.ts +5 -1
- package/dist/platform/ops/skills.ops.js +129 -11
- package/dist/platform/ops/unavailable.d.ts +23 -0
- package/dist/platform/ops/unavailable.js +111 -0
- package/dist/platform/parity.d.ts +33 -0
- package/dist/platform/parity.js +272 -0
- package/dist/platform/platform-ops.module.d.ts +32 -0
- package/dist/platform/platform-ops.module.js +78 -11
- package/dist/platform/route-schemas.d.ts +18 -0
- package/dist/platform/route-schemas.js +60 -0
- package/dist/roles/worker.module.js +2 -0
- package/dist/runtime/context/build.d.ts +2 -0
- package/dist/runtime/context/build.js +28 -2
- package/dist/runtime/context/compaction.js +10 -1
- package/dist/runtime/context/run-context.d.ts +65 -0
- package/dist/runtime/context/run-context.js +215 -0
- package/dist/runtime/hook-calls.d.ts +8 -1
- package/dist/runtime/hook-calls.js +40 -9
- package/dist/runtime/model-call.d.ts +8 -3
- package/dist/runtime/model-call.js +30 -6
- package/dist/runtime/providers.d.ts +146 -32
- package/dist/runtime/providers.js +328 -67
- package/dist/runtime/run-context.service.d.ts +65 -0
- package/dist/runtime/run-context.service.js +220 -0
- package/dist/runtime/run-worker.d.ts +6 -1
- package/dist/runtime/run-worker.js +35 -10
- package/dist/runtime/runtime.module.js +2 -0
- package/dist/runtime/subagents/definition.d.ts +15 -15
- package/dist/runtime/subagents/definition.js +49 -118
- package/dist/runtime/usage-report-jobs.d.ts +88 -0
- package/dist/runtime/usage-report-jobs.js +158 -0
- package/dist/runtime/usage-report.d.ts +33 -38
- package/dist/runtime/usage-report.js +152 -84
- package/dist/skills/changes.controller.js +2 -1
- package/dist/skills/changes.service.d.ts +1 -1
- package/dist/skills/changes.service.js +4 -4
- package/dist/skills/invocable.controller.d.ts +1 -1
- package/dist/skills/invocable.controller.js +2 -2
- package/dist/skills/invoke.d.ts +2 -2
- package/dist/skills/invoke.js +8 -1
- package/dist/skills/skills.controller.d.ts +4 -13
- package/dist/skills/skills.controller.js +8 -24
- package/dist/skills/skills.schemas.d.ts +48 -0
- package/dist/skills/skills.schemas.js +61 -0
- package/dist/skills/skills.service.d.ts +11 -1
- package/dist/skills/skills.service.js +37 -14
- package/dist/time-zone.d.ts +5 -0
- package/dist/time-zone.js +19 -0
- package/dist/tools/approvals.controller.js +2 -3
- package/dist/tools/approvals.schemas.d.ts +21 -0
- package/dist/tools/approvals.schemas.js +15 -0
- package/dist/tools/builtin-names.d.ts +10 -8
- package/dist/tools/builtin-names.js +16 -11
- package/dist/tools/builtins/builtin-tools.d.ts +3 -1
- package/dist/tools/builtins/builtin-tools.js +15 -3
- package/dist/tools/builtins/current-time.d.ts +26 -0
- package/dist/tools/builtins/current-time.js +99 -0
- package/dist/tools/builtins/platform.d.ts +19 -2
- package/dist/tools/builtins/platform.js +105 -16
- package/dist/tools/connectors.controller.d.ts +1 -2
- package/dist/tools/connectors.controller.js +1 -4
- package/dist/tools/connectors.schemas.d.ts +12 -0
- package/dist/tools/connectors.schemas.js +19 -0
- package/dist/tools/connectors.service.d.ts +5 -2
- package/dist/tools/connectors.service.js +7 -5
- package/dist/tools/org-tool-switches.d.ts +16 -2
- package/dist/tools/org-tool-switches.js +26 -9
- package/dist/tools/pipeline.js +9 -1
- package/dist/tools/registry.d.ts +48 -51
- package/dist/tools/registry.js +222 -233
- package/package.json +3 -3
- package/src/migrations/0089_model_kinds_usage.sql +38 -0
- package/src/migrations/0090_initial_passwords.sql +27 -0
- package/src/migrations/0091_account_time_zone.sql +4 -0
- package/src/migrations/0092_tools_default_on.sql +27 -0
- package/dist/platform/redact-orgs.d.ts +0 -7
- package/dist/platform/redact-orgs.js +0 -52
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { RouteSchemas } from "../platform/route-schemas.js";
|
|
3
|
+
export declare const AgentMemberIds: z.ZodArray<z.ZodString>;
|
|
4
|
+
/** Pending connectors come only from a template (ruling P4-6): a create request's are dropped. */
|
|
5
|
+
export declare const AgentCreateDefinition: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
|
|
9
|
+
instructionFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
content: z.ZodString;
|
|
12
|
+
}, z.core.$strict>>>;
|
|
13
|
+
model: z.ZodObject<{
|
|
14
|
+
provider: z.ZodString;
|
|
15
|
+
model: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
fallback: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
18
|
+
provider: z.ZodString;
|
|
19
|
+
model: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
modelParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
22
|
+
fallbackParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
23
|
+
disabledTools: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"builtin">;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
kind: z.ZodLiteral<"plugin">;
|
|
28
|
+
plugin: z.ZodString;
|
|
29
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
kind: z.ZodLiteral<"connector">;
|
|
32
|
+
connectorId: z.ZodString;
|
|
33
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
34
|
+
}, z.core.$strict>], "kind">>>;
|
|
35
|
+
toolPolicies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
36
|
+
ask: "ask";
|
|
37
|
+
deny: "deny";
|
|
38
|
+
}>>>;
|
|
39
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
orgSkills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
writePolicy: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
allow: "allow";
|
|
43
|
+
ask: "ask";
|
|
44
|
+
}>>;
|
|
45
|
+
pinned: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
subagents: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
general: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
inline: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
description: z.ZodString;
|
|
53
|
+
instructions: z.ZodString;
|
|
54
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
toolPolicies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
57
|
+
ask: "ask";
|
|
58
|
+
deny: "deny";
|
|
59
|
+
}>>>;
|
|
60
|
+
model: z.ZodOptional<z.ZodEnum<{
|
|
61
|
+
capable: "capable";
|
|
62
|
+
fast: "fast";
|
|
63
|
+
inherit: "inherit";
|
|
64
|
+
standard: "standard";
|
|
65
|
+
}>>;
|
|
66
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
high: "high";
|
|
68
|
+
low: "low";
|
|
69
|
+
max: "max";
|
|
70
|
+
medium: "medium";
|
|
71
|
+
xhigh: "xhigh";
|
|
72
|
+
}>>;
|
|
73
|
+
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
}, z.core.$strict>>>;
|
|
76
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
77
|
+
agentId: z.ZodString;
|
|
78
|
+
as: z.ZodString;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
}, z.core.$strict>>>;
|
|
81
|
+
dispatchable: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
}, z.core.$strict>>;
|
|
83
|
+
tools: z.ZodOptional<z.ZodUndefined>;
|
|
84
|
+
subagentTools: z.ZodOptional<z.ZodUndefined>;
|
|
85
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare const AgentCreateBody: z.ZodObject<{
|
|
88
|
+
definition: z.ZodObject<{
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
description: z.ZodOptional<z.ZodString>;
|
|
91
|
+
avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
|
|
92
|
+
instructionFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
content: z.ZodString;
|
|
95
|
+
}, z.core.$strict>>>;
|
|
96
|
+
model: z.ZodObject<{
|
|
97
|
+
provider: z.ZodString;
|
|
98
|
+
model: z.ZodString;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
fallback: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
101
|
+
provider: z.ZodString;
|
|
102
|
+
model: z.ZodString;
|
|
103
|
+
}, z.core.$strip>>>;
|
|
104
|
+
modelParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
105
|
+
fallbackParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
106
|
+
disabledTools: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
kind: z.ZodLiteral<"builtin">;
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
kind: z.ZodLiteral<"plugin">;
|
|
111
|
+
plugin: z.ZodString;
|
|
112
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
kind: z.ZodLiteral<"connector">;
|
|
115
|
+
connectorId: z.ZodString;
|
|
116
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
117
|
+
}, z.core.$strict>], "kind">>>;
|
|
118
|
+
toolPolicies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
119
|
+
ask: "ask";
|
|
120
|
+
deny: "deny";
|
|
121
|
+
}>>>;
|
|
122
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
orgSkills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
124
|
+
writePolicy: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
allow: "allow";
|
|
126
|
+
ask: "ask";
|
|
127
|
+
}>>;
|
|
128
|
+
pinned: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
}, z.core.$strict>>;
|
|
130
|
+
subagents: z.ZodOptional<z.ZodObject<{
|
|
131
|
+
general: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
133
|
+
inline: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
description: z.ZodString;
|
|
136
|
+
instructions: z.ZodString;
|
|
137
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
139
|
+
toolPolicies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
140
|
+
ask: "ask";
|
|
141
|
+
deny: "deny";
|
|
142
|
+
}>>>;
|
|
143
|
+
model: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
capable: "capable";
|
|
145
|
+
fast: "fast";
|
|
146
|
+
inherit: "inherit";
|
|
147
|
+
standard: "standard";
|
|
148
|
+
}>>;
|
|
149
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
high: "high";
|
|
151
|
+
low: "low";
|
|
152
|
+
max: "max";
|
|
153
|
+
medium: "medium";
|
|
154
|
+
xhigh: "xhigh";
|
|
155
|
+
}>>;
|
|
156
|
+
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
158
|
+
}, z.core.$strict>>>;
|
|
159
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
160
|
+
agentId: z.ZodString;
|
|
161
|
+
as: z.ZodString;
|
|
162
|
+
description: z.ZodString;
|
|
163
|
+
}, z.core.$strict>>>;
|
|
164
|
+
dispatchable: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
tools: z.ZodOptional<z.ZodUndefined>;
|
|
167
|
+
subagentTools: z.ZodOptional<z.ZodUndefined>;
|
|
168
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
visibility: z.ZodEnum<{
|
|
171
|
+
members: "members";
|
|
172
|
+
org: "org";
|
|
173
|
+
private: "private";
|
|
174
|
+
}>;
|
|
175
|
+
memberIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
176
|
+
profile: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
kind: z.ZodLiteral<"preset">;
|
|
179
|
+
id: z.ZodEnum<{
|
|
180
|
+
"black-bear": "black-bear";
|
|
181
|
+
capybara: "capybara";
|
|
182
|
+
elephant: "elephant";
|
|
183
|
+
fox: "fox";
|
|
184
|
+
owl: "owl";
|
|
185
|
+
panda: "panda";
|
|
186
|
+
penguin: "penguin";
|
|
187
|
+
rabbit: "rabbit";
|
|
188
|
+
turtle: "turtle";
|
|
189
|
+
whale: "whale";
|
|
190
|
+
}>;
|
|
191
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
192
|
+
kind: z.ZodLiteral<"upload">;
|
|
193
|
+
uploadId: z.ZodString;
|
|
194
|
+
}, z.core.$strict>], "kind">>>;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
quickActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
title: z.ZodString;
|
|
198
|
+
body: z.ZodString;
|
|
199
|
+
}, z.core.$strict>>>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
export declare const AgentUpdateBody: z.ZodObject<{
|
|
203
|
+
definition: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
name: z.ZodString;
|
|
205
|
+
description: z.ZodOptional<z.ZodString>;
|
|
206
|
+
avatarUrl: z.ZodDefault<z.ZodNullable<z.ZodURL>>;
|
|
207
|
+
instructionFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
content: z.ZodString;
|
|
210
|
+
}, z.core.$strict>>>;
|
|
211
|
+
model: z.ZodObject<{
|
|
212
|
+
provider: z.ZodString;
|
|
213
|
+
model: z.ZodString;
|
|
214
|
+
}, z.core.$strip>;
|
|
215
|
+
fallback: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
216
|
+
provider: z.ZodString;
|
|
217
|
+
model: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>>;
|
|
219
|
+
modelParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
220
|
+
fallbackParams: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
221
|
+
disabledTools: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
222
|
+
kind: z.ZodLiteral<"builtin">;
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
225
|
+
kind: z.ZodLiteral<"plugin">;
|
|
226
|
+
plugin: z.ZodString;
|
|
227
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
228
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
229
|
+
kind: z.ZodLiteral<"connector">;
|
|
230
|
+
connectorId: z.ZodString;
|
|
231
|
+
tools: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
232
|
+
}, z.core.$strict>], "kind">>>;
|
|
233
|
+
toolPolicies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
234
|
+
ask: "ask";
|
|
235
|
+
deny: "deny";
|
|
236
|
+
}>>>;
|
|
237
|
+
skills: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
orgSkills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
239
|
+
writePolicy: z.ZodOptional<z.ZodEnum<{
|
|
240
|
+
allow: "allow";
|
|
241
|
+
ask: "ask";
|
|
242
|
+
}>>;
|
|
243
|
+
pinned: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
244
|
+
}, z.core.$strict>>;
|
|
245
|
+
subagents: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
general: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
248
|
+
inline: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
249
|
+
name: z.ZodString;
|
|
250
|
+
description: z.ZodString;
|
|
251
|
+
instructions: z.ZodString;
|
|
252
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
253
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
254
|
+
toolPolicies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
255
|
+
ask: "ask";
|
|
256
|
+
deny: "deny";
|
|
257
|
+
}>>>;
|
|
258
|
+
model: z.ZodOptional<z.ZodEnum<{
|
|
259
|
+
capable: "capable";
|
|
260
|
+
fast: "fast";
|
|
261
|
+
inherit: "inherit";
|
|
262
|
+
standard: "standard";
|
|
263
|
+
}>>;
|
|
264
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
265
|
+
high: "high";
|
|
266
|
+
low: "low";
|
|
267
|
+
max: "max";
|
|
268
|
+
medium: "medium";
|
|
269
|
+
xhigh: "xhigh";
|
|
270
|
+
}>>;
|
|
271
|
+
maxSteps: z.ZodOptional<z.ZodNumber>;
|
|
272
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
273
|
+
}, z.core.$strict>>>;
|
|
274
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
275
|
+
agentId: z.ZodString;
|
|
276
|
+
as: z.ZodString;
|
|
277
|
+
description: z.ZodString;
|
|
278
|
+
}, z.core.$strict>>>;
|
|
279
|
+
dispatchable: z.ZodOptional<z.ZodBoolean>;
|
|
280
|
+
}, z.core.$strict>>;
|
|
281
|
+
pendingConnectors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
282
|
+
key: z.ZodString;
|
|
283
|
+
label: z.ZodString;
|
|
284
|
+
source: z.ZodUnion<readonly [z.ZodObject<{
|
|
285
|
+
template: z.ZodString;
|
|
286
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
287
|
+
needs: z.ZodObject<{
|
|
288
|
+
protocol: z.ZodEnum<{
|
|
289
|
+
mcp: "mcp";
|
|
290
|
+
openapi: "openapi";
|
|
291
|
+
}>;
|
|
292
|
+
endpoint: z.ZodString;
|
|
293
|
+
tools: z.ZodArray<z.ZodString>;
|
|
294
|
+
label: z.ZodString;
|
|
295
|
+
}, z.core.$strict>;
|
|
296
|
+
}, z.core.$strict>]>;
|
|
297
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
298
|
+
policies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
299
|
+
ask: "ask";
|
|
300
|
+
deny: "deny";
|
|
301
|
+
}>>>;
|
|
302
|
+
}, z.core.$strict>>>;
|
|
303
|
+
tools: z.ZodOptional<z.ZodUndefined>;
|
|
304
|
+
subagentTools: z.ZodOptional<z.ZodUndefined>;
|
|
305
|
+
instructions: z.ZodOptional<z.ZodString>;
|
|
306
|
+
}, z.core.$strip>>;
|
|
307
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
308
|
+
members: "members";
|
|
309
|
+
org: "org";
|
|
310
|
+
private: "private";
|
|
311
|
+
}>>;
|
|
312
|
+
memberIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
313
|
+
expectedVersion: z.ZodOptional<z.ZodNumber>;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
/**
|
|
316
|
+
* `PATCH …/profile`: the display data (avatar, quick actions). The description is part of the
|
|
317
|
+
* agent's definition (run context spec §3.5), saved with `PATCH :agentId`.
|
|
318
|
+
*/
|
|
319
|
+
export declare const AgentProfileBody: z.ZodObject<{
|
|
320
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
321
|
+
kind: z.ZodLiteral<"preset">;
|
|
322
|
+
id: z.ZodEnum<{
|
|
323
|
+
"black-bear": "black-bear";
|
|
324
|
+
capybara: "capybara";
|
|
325
|
+
elephant: "elephant";
|
|
326
|
+
fox: "fox";
|
|
327
|
+
owl: "owl";
|
|
328
|
+
panda: "panda";
|
|
329
|
+
penguin: "penguin";
|
|
330
|
+
rabbit: "rabbit";
|
|
331
|
+
turtle: "turtle";
|
|
332
|
+
whale: "whale";
|
|
333
|
+
}>;
|
|
334
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
335
|
+
kind: z.ZodLiteral<"upload">;
|
|
336
|
+
uploadId: z.ZodString;
|
|
337
|
+
}, z.core.$strict>], "kind">>>;
|
|
338
|
+
quickActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
339
|
+
title: z.ZodString;
|
|
340
|
+
body: z.ZodString;
|
|
341
|
+
}, z.core.$strict>>>;
|
|
342
|
+
expectedUpdatedAt: z.ZodString;
|
|
343
|
+
}, z.core.$strict>;
|
|
344
|
+
export declare const AgentFromTemplatePreviewBody: z.ZodObject<{
|
|
345
|
+
templateId: z.ZodString;
|
|
346
|
+
}, z.core.$strict>;
|
|
347
|
+
export declare const AgentFromTemplateBody: z.ZodObject<{
|
|
348
|
+
templateId: z.ZodString;
|
|
349
|
+
name: z.ZodString;
|
|
350
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
351
|
+
members: "members";
|
|
352
|
+
org: "org";
|
|
353
|
+
private: "private";
|
|
354
|
+
}>>;
|
|
355
|
+
members: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
356
|
+
model: z.ZodOptional<z.ZodObject<{
|
|
357
|
+
provider: z.ZodString;
|
|
358
|
+
model: z.ZodString;
|
|
359
|
+
}, z.core.$strict>>;
|
|
360
|
+
avatar: z.ZodOptional<z.ZodObject<{
|
|
361
|
+
kind: z.ZodLiteral<"preset">;
|
|
362
|
+
id: z.ZodEnum<{
|
|
363
|
+
"black-bear": "black-bear";
|
|
364
|
+
capybara: "capybara";
|
|
365
|
+
elephant: "elephant";
|
|
366
|
+
fox: "fox";
|
|
367
|
+
owl: "owl";
|
|
368
|
+
panda: "panda";
|
|
369
|
+
penguin: "penguin";
|
|
370
|
+
rabbit: "rabbit";
|
|
371
|
+
turtle: "turtle";
|
|
372
|
+
whale: "whale";
|
|
373
|
+
}>;
|
|
374
|
+
}, z.core.$strict>>;
|
|
375
|
+
previewHash: z.ZodString;
|
|
376
|
+
}, z.core.$strict>;
|
|
377
|
+
/** `:agentId` as the routes take it (`@Param`). */
|
|
378
|
+
export declare const AgentPathParams: z.ZodObject<{
|
|
379
|
+
agentId: z.ZodString;
|
|
380
|
+
}, z.core.$strip>;
|
|
381
|
+
/** `:agentId` and `:key` of a pending connector's bind route. */
|
|
382
|
+
export declare const PendingConnectorParams: z.ZodObject<{
|
|
383
|
+
agentId: z.ZodString;
|
|
384
|
+
key: z.ZodString;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
export declare const PendingConnectorBindBody: z.ZodObject<{
|
|
387
|
+
connectorId: z.ZodString;
|
|
388
|
+
}, z.core.$strict>;
|
|
389
|
+
export declare const AGENT_ROUTES: readonly RouteSchemas[];
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AGENT_VISIBILITIES } from "./agents.service.js";
|
|
3
|
+
import { AgentDefinitionSchema, ModelRef } from "./definition.js";
|
|
4
|
+
import { PresetAvatarSchema, ProfileInputSchema } from "./profile.js";
|
|
5
|
+
export const AgentMemberIds = z.array(z.string().min(1).max(100)).max(1000);
|
|
6
|
+
/**
|
|
7
|
+
* `instructions` has no default in a request: with `instructionFiles` the kernel derives it, and a
|
|
8
|
+
* new agent given neither gets the `AGENTS.md` starter (`deriveInstructions`).
|
|
9
|
+
*/
|
|
10
|
+
const RequestInstructions = z.string().max(100_000).optional();
|
|
11
|
+
/**
|
|
12
|
+
* Fields a request may not carry (tools default-on spec §2): the old enabled list, and a
|
|
13
|
+
* sub-agent's key filter (written only at dispatch).
|
|
14
|
+
*/
|
|
15
|
+
const RequestOnly = {
|
|
16
|
+
tools: z
|
|
17
|
+
.undefined({
|
|
18
|
+
error: "tools was replaced by disabledTools: an agent has every tool unless it turns it off",
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
subagentTools: z
|
|
22
|
+
.undefined({ error: "subagentTools is set only on a sub-agent's definition at dispatch" })
|
|
23
|
+
.optional(),
|
|
24
|
+
};
|
|
25
|
+
/** Pending connectors come only from a template (ruling P4-6): a create request's are dropped. */
|
|
26
|
+
export const AgentCreateDefinition = AgentDefinitionSchema.omit({ pendingConnectors: true }).extend({ instructions: RequestInstructions, ...RequestOnly });
|
|
27
|
+
const UpdateDefinition = AgentDefinitionSchema.extend({
|
|
28
|
+
instructions: RequestInstructions,
|
|
29
|
+
...RequestOnly,
|
|
30
|
+
});
|
|
31
|
+
export const AgentCreateBody = z
|
|
32
|
+
.object({
|
|
33
|
+
definition: AgentCreateDefinition,
|
|
34
|
+
visibility: z.enum(AGENT_VISIBILITIES),
|
|
35
|
+
memberIds: AgentMemberIds.optional(),
|
|
36
|
+
/** Without an avatar the agent gets a random preset. */
|
|
37
|
+
profile: ProfileInputSchema.optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export const AgentUpdateBody = z
|
|
41
|
+
.object({
|
|
42
|
+
definition: UpdateDefinition.optional(),
|
|
43
|
+
visibility: z.enum(AGENT_VISIBILITIES).optional(),
|
|
44
|
+
memberIds: AgentMemberIds.optional(),
|
|
45
|
+
/**
|
|
46
|
+
* Optimistic concurrency: the `currentVersion` the editor read. Given and different from the
|
|
47
|
+
* current version (someone saved since) -> 409 `agent.version_conflict`, nothing overwritten.
|
|
48
|
+
* Absent: not checked (older clients).
|
|
49
|
+
*/
|
|
50
|
+
expectedVersion: z.number().int().positive().optional(),
|
|
51
|
+
})
|
|
52
|
+
.strict();
|
|
53
|
+
/**
|
|
54
|
+
* `PATCH …/profile`: the display data (avatar, quick actions). The description is part of the
|
|
55
|
+
* agent's definition (run context spec §3.5), saved with `PATCH :agentId`.
|
|
56
|
+
*/
|
|
57
|
+
export const AgentProfileBody = ProfileInputSchema.omit({ description: true })
|
|
58
|
+
.extend({
|
|
59
|
+
/** The `profile.updatedAt` the client read; a different one → 409 `agent.profile_conflict`. */
|
|
60
|
+
expectedUpdatedAt: z.string().min(1).max(40),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
const TemplateId = z.string().min(1).max(100);
|
|
64
|
+
export const AgentFromTemplatePreviewBody = z.object({ templateId: TemplateId }).strict();
|
|
65
|
+
export const AgentFromTemplateBody = z
|
|
66
|
+
.object({
|
|
67
|
+
templateId: TemplateId,
|
|
68
|
+
name: z.string().min(1).max(80),
|
|
69
|
+
/** Default `private`; anything else needs `agents.manage` (ruling P4-3). */
|
|
70
|
+
visibility: z.enum(AGENT_VISIBILITIES).optional(),
|
|
71
|
+
/** The accounts of a `members` agent. */
|
|
72
|
+
members: AgentMemberIds.optional(),
|
|
73
|
+
/** The person's choice; absent = the template's model resolution (P4-4). */
|
|
74
|
+
model: ModelRef.strict().optional(),
|
|
75
|
+
/** A preset avatar; absent = a random one. */
|
|
76
|
+
avatar: PresetAvatarSchema.optional(),
|
|
77
|
+
/** The preview's `previewHash`; another one → 409 `agent.template_preview_stale`. */
|
|
78
|
+
previewHash: z.string().regex(/^[0-9a-f]{64}\.[0-9a-f]{16}$/),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
/** `:agentId` as the routes take it (`@Param`). */
|
|
82
|
+
export const AgentPathParams = z.object({ agentId: z.string().min(1) });
|
|
83
|
+
/** `:agentId` and `:key` of a pending connector's bind route. */
|
|
84
|
+
export const PendingConnectorParams = z.object({
|
|
85
|
+
agentId: z.string().min(1),
|
|
86
|
+
key: z.string().min(1),
|
|
87
|
+
});
|
|
88
|
+
export const PendingConnectorBindBody = z
|
|
89
|
+
.object({ connectorId: z.string().min(1).max(100) })
|
|
90
|
+
.strict();
|
|
91
|
+
export const AGENT_ROUTES = [
|
|
92
|
+
{ route: "GET /api/v1/orgs/:orgId/agents" },
|
|
93
|
+
{ route: "GET /api/v1/orgs/:orgId/agents/:agentId", params: AgentPathParams },
|
|
94
|
+
{ route: "POST /api/v1/orgs/:orgId/agents", body: AgentCreateBody },
|
|
95
|
+
{
|
|
96
|
+
route: "PATCH /api/v1/orgs/:orgId/agents/:agentId",
|
|
97
|
+
params: AgentPathParams,
|
|
98
|
+
body: AgentUpdateBody,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
route: "PATCH /api/v1/orgs/:orgId/agents/:agentId/profile",
|
|
102
|
+
params: AgentPathParams,
|
|
103
|
+
body: AgentProfileBody,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
route: "POST /api/v1/orgs/:orgId/agents/from-template/preview",
|
|
107
|
+
body: AgentFromTemplatePreviewBody,
|
|
108
|
+
},
|
|
109
|
+
{ route: "POST /api/v1/orgs/:orgId/agents/from-template", body: AgentFromTemplateBody },
|
|
110
|
+
{ route: "DELETE /api/v1/orgs/:orgId/agents/:agentId", params: AgentPathParams },
|
|
111
|
+
{ route: "GET /api/v1/orgs/:orgId/agents/:agentId/versions", params: AgentPathParams },
|
|
112
|
+
{
|
|
113
|
+
route: "POST /api/v1/orgs/:orgId/agents/:agentId/pending-connectors/:key/bind",
|
|
114
|
+
params: PendingConnectorParams,
|
|
115
|
+
body: PendingConnectorBindBody,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
route: "POST /api/v1/orgs/:orgId/agents/:agentId/pending-connectors/request",
|
|
119
|
+
params: AgentPathParams,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
route: "GET /api/v1/orgs/:orgId/agents/:agentId/pending-connectors/request",
|
|
123
|
+
params: AgentPathParams,
|
|
124
|
+
},
|
|
125
|
+
{ route: "GET /api/v1/orgs/:orgId/readiness" },
|
|
126
|
+
];
|
|
@@ -87,7 +87,7 @@ export declare class AgentsService {
|
|
|
87
87
|
private readonly evalBudget;
|
|
88
88
|
/** Settles the agent's connector setup request when its pending connectors change (P4-7). */
|
|
89
89
|
private readonly setupRequests;
|
|
90
|
-
constructor(db: KernelDb, lookup: AgentLookup, tools: Pick<ToolRegistry, "
|
|
90
|
+
constructor(db: KernelDb, lookup: AgentLookup, tools: Pick<ToolRegistry, "checkDisabled">,
|
|
91
91
|
/** 删除 agent 时取消它待处理的技能改动(T15)。 */
|
|
92
92
|
skillChanges: Pick<SkillChangesService, "cancelPendingForAgent" | "finishCancel">,
|
|
93
93
|
/** The org row lock (orgs/org-lock.ts): joins the caller's transaction. */
|
|
@@ -99,13 +99,23 @@ export declare class AgentsService {
|
|
|
99
99
|
/** Settles the agent's connector setup request when its pending connectors change (P4-7). */
|
|
100
100
|
setupRequests: Pick<PendingConnectorRequests, "settleIn" | "retargetIn">);
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
102
|
+
* Checks the turned-off tools and the policies (tools default-on spec §2): `disabledTools` must
|
|
103
|
+
* name existing builtins, extensions and connectors (`ToolRegistry.checkDisabled`); `toolPolicies`
|
|
104
|
+
* keys must be tools the agent could have, on or off (values only tighten, by the schema); a
|
|
105
|
+
* sub-agent's key filter is never saved. Invalid → `validation_failed` at `disabledTools.<i>` /
|
|
106
|
+
* `toolPolicies.<key>` / `subagentTools`. The list is stored in canonical form.
|
|
105
107
|
*/
|
|
106
108
|
private checkTools;
|
|
107
109
|
/**
|
|
108
|
-
*
|
|
110
|
+
* The current version's `disabledTools` (empty for an agent that is not there: the update's own
|
|
111
|
+
* checks report that): entries kept from it are not re-checked, so a connector deleted or an
|
|
112
|
+
* extension uninstalled later never blocks other edits.
|
|
113
|
+
*/
|
|
114
|
+
private keptDisabled;
|
|
115
|
+
/**
|
|
116
|
+
* 校验主模型与兜底都可解析:enabled `chat` models in the org (`resolve`'s default kind; a model the
|
|
117
|
+
* platform or the org disabled, or an embedding model → 400 `agent.model_unavailable`, spec B
|
|
118
|
+
* §5.3),并用各自模型的参数声明严格校验 `modelParams` / `fallbackParams`
|
|
109
119
|
* (没有兜底时 `fallbackParams` 必须为空);不合法 → `validation_failed`,details 逐键点名。返回提示。
|
|
110
120
|
*/
|
|
111
121
|
private checkModels;
|
|
@@ -171,7 +181,7 @@ export declare class AgentsService {
|
|
|
171
181
|
}>;
|
|
172
182
|
private updateIn;
|
|
173
183
|
/** 软删除:权限同 update。待处理的技能改动与该 agent 评测集在执行的评测运行一并取消,提交后删除草稿(T15)。 */
|
|
174
|
-
softDelete(orgId: string, agentId: string, actorAccountId: string, actorTokenId?: string): Promise<void>;
|
|
184
|
+
softDelete(orgId: string, agentId: string, actorAccountId: string, actorTokenId?: string, auditDetail?: Record<string, unknown>): Promise<void>;
|
|
175
185
|
private softDeleteIn;
|
|
176
186
|
/**
|
|
177
187
|
* 重新指派负责人(`agents.manage`,admin):在组织行锁内授权;agent 不存在 / 已删除 → `agent.not_found`;
|