@capybara-hq/kernel 0.1.0-rc.6 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bootstrap.json +27 -3
- package/dist/admin/admin.controller.d.ts +8 -72
- package/dist/admin/admin.controller.js +21 -46
- 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 +13 -5
- package/dist/agents/agents.service.js +67 -13
- 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 +20 -3
- package/dist/agents/models.controller.d.ts +1 -2
- package/dist/agents/models.controller.js +1 -1
- 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/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/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 +9 -1
- package/dist/conversations/conversations.service.js +23 -18
- 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/db/kernel-schema.d.ts +20 -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 +3 -0
- package/dist/errors.js +3 -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 +13 -0
- package/dist/evals/runs.controller.d.ts +2 -57
- package/dist/evals/runs.controller.js +1 -42
- package/dist/evals/runs.service.d.ts +6 -6
- package/dist/evals/runs.service.js +32 -18
- 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/extensions/admin-ops.d.ts +5 -3
- package/dist/extensions/admin-ops.js +17 -12
- package/dist/extensions/deployment-config.d.ts +16 -1
- package/dist/extensions/deployment-config.js +83 -0
- package/dist/extensions/extensions.module.js +3 -0
- package/dist/extensions/host.d.ts +33 -2
- package/dist/extensions/host.js +107 -1
- 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/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 +2 -0
- 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 +12 -0
- package/dist/identity/me.controller.js +31 -1
- package/dist/identity/me.schemas.d.ts +14 -0
- package/dist/identity/me.schemas.js +17 -0
- 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/lifecycle/kernel-lifecycle.js +4 -0
- package/dist/models/enablement.d.ts +2 -0
- package/dist/models/enablement.js +1 -0
- 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 +12 -2
- package/dist/models/purposes.js +22 -8
- 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 +58 -849
- package/dist/platform/method.js +1 -1
- package/dist/platform/operation.d.ts +82 -5
- package/dist/platform/operation.js +63 -8
- 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 +11 -6
- package/dist/platform/ops/platform.ops.js +73 -27
- 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 +63 -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/model-call.js +2 -1
- package/dist/runtime/providers.js +8 -1
- 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 +5 -0
- package/dist/runtime/run-worker.js +31 -6
- package/dist/runtime/runtime.module.js +2 -0
- package/dist/runtime/subagents/definition.d.ts +15 -15
- package/dist/runtime/subagents/definition.js +46 -115
- 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 +3 -1
- package/dist/tools/registry.d.ts +48 -51
- package/dist/tools/registry.js +222 -233
- package/package.json +3 -3
- 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
|
@@ -7,10 +7,11 @@ 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 { extensionToolKey } from "@capybara-hq/plugin-sdk";
|
|
11
10
|
import { Inject, Injectable } from "@nestjs/common";
|
|
12
11
|
import { z } from "zod";
|
|
13
12
|
import { AgentsService } from "../../agents/agents.service.js";
|
|
13
|
+
import { AccountsService } from "../../identity/accounts.js";
|
|
14
|
+
import { PreferencesSchema } from "../../identity/me.schemas.js";
|
|
14
15
|
import { can } from "../../orgs/roles.js";
|
|
15
16
|
import { effectiveSandboxEgress, OrgSettingsService } from "../../orgs/settings.service.js";
|
|
16
17
|
import { SANDBOX_TOOL_NAMES } from "../../tools/builtin-names.js";
|
|
@@ -18,7 +19,6 @@ import { ToolRegistry } from "../../tools/registry.js";
|
|
|
18
19
|
import { PlatformActor } from "../actor.js";
|
|
19
20
|
import { defineOperation } from "../operation.js";
|
|
20
21
|
import { PlatformOperations } from "../registry.js";
|
|
21
|
-
import { asToolError } from "./errors.js";
|
|
22
22
|
/** What a role may build, as the model says it to the person: the action and its plain words. */
|
|
23
23
|
const BUILDS = [
|
|
24
24
|
{ action: "agents.create", what: "create private agents and edit the agents you own" },
|
|
@@ -36,43 +36,43 @@ const FAMILIES = [
|
|
|
36
36
|
"Plugin and connector tools, named plugin__<plugin>__<tool> and mcp__<connector>__<tool>.",
|
|
37
37
|
];
|
|
38
38
|
const EMPTY = z.object({}).strict();
|
|
39
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The `platform` domain: orientation and what this agent is (spec §7, synthetic), and the
|
|
41
|
+
* person's own preferences (`/me/preferences`).
|
|
42
|
+
*/
|
|
40
43
|
let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
41
44
|
registry;
|
|
42
45
|
actor;
|
|
43
46
|
agents;
|
|
44
47
|
settings;
|
|
45
48
|
tools;
|
|
46
|
-
|
|
49
|
+
accounts;
|
|
50
|
+
constructor(registry, actor, agents, settings, tools, accounts) {
|
|
47
51
|
this.registry = registry;
|
|
48
52
|
this.actor = actor;
|
|
49
53
|
this.agents = agents;
|
|
50
54
|
this.settings = settings;
|
|
51
55
|
this.tools = tools;
|
|
56
|
+
this.accounts = accounts;
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
|
-
* The agent's tools by the keys the model sees
|
|
55
|
-
*
|
|
56
|
-
* `
|
|
57
|
-
* cannot load now are listed with the registry's reason.
|
|
59
|
+
* The agent's tools by the keys the model sees, as the registry resolves them for a run (tools
|
|
60
|
+
* default-on spec §8): every tool the org offers that the definition does not turn off, builtins
|
|
61
|
+
* by name, extension tools as `plugin__<plugin>__<tool>`, connector tools as
|
|
62
|
+
* `mcp__<slug>__<tool>`; the ones that cannot load now are listed with the registry's reason.
|
|
58
63
|
*/
|
|
59
64
|
async toolKeys(orgId, d) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
:
|
|
64
|
-
|
|
65
|
-
for (const t of resolved.tools) {
|
|
66
|
-
if (t.source.kind !== "connector")
|
|
67
|
-
continue;
|
|
68
|
-
live.set(t.source.connectorId, [...(live.get(t.source.connectorId) ?? []), t.key]);
|
|
69
|
-
}
|
|
70
|
-
const keys = d.tools.flatMap((r) => r.kind === "connector"
|
|
71
|
-
? (live.get(r.connectorId) ?? [])
|
|
72
|
-
: [r.kind === "builtin" ? r.name : extensionToolKey(r.plugin, r.name)]);
|
|
65
|
+
const resolved = await this.tools.forAgent(orgId, {
|
|
66
|
+
disabledTools: d.disabledTools ?? [],
|
|
67
|
+
subagentTools: d.subagentTools,
|
|
68
|
+
subagents: d.subagents,
|
|
69
|
+
});
|
|
73
70
|
return {
|
|
74
|
-
keys: [...new Set(
|
|
75
|
-
unavailable: resolved.unavailable.map((u) => ({
|
|
71
|
+
keys: [...new Set(resolved.tools.map((t) => t.key))],
|
|
72
|
+
unavailable: [...resolved.unavailable, ...(resolved.hidden ?? [])].map((u) => ({
|
|
73
|
+
tool: u.ref,
|
|
74
|
+
reason: u.reason,
|
|
75
|
+
})),
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
onModuleInit() {
|
|
@@ -111,13 +111,13 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
111
111
|
}),
|
|
112
112
|
defineOperation({
|
|
113
113
|
id: "platform.me",
|
|
114
|
-
description: "Show this agent as configured: its model, tools by the keys you call them by (connector tools as mcp__<connector>__<tool>, with those that cannot load now and why), skills (org and pinned), sub-agents, whether it runs in a sandbox,
|
|
114
|
+
description: "Show this agent as configured: its model, the tools it has now by the keys you call them by (every tool the org offers unless the agent turns it off; connector tools as mcp__<connector>__<tool>, with those that cannot load now and why), the tools it turns off (disabledTools), skills (org and pinned), sub-agents, whether it runs in a sandbox, the sandbox network mode, and its profile (avatar, description, quick actions). Secrets are never shown.",
|
|
115
115
|
input: EMPTY,
|
|
116
116
|
example: {},
|
|
117
117
|
authz: { orgAction: "agents.use" },
|
|
118
118
|
mirrors: [],
|
|
119
119
|
confirm: "read",
|
|
120
|
-
run: async (_input, ctx) =>
|
|
120
|
+
run: async (_input, ctx) => {
|
|
121
121
|
const agent = await this.agents.get(ctx.orgId, ctx.agentId, ctx.actorAccountId);
|
|
122
122
|
const d = agent.definition;
|
|
123
123
|
const { keys: toolKeys, unavailable } = await this.toolKeys(ctx.orgId, d);
|
|
@@ -134,6 +134,7 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
134
134
|
fallback: d.fallback,
|
|
135
135
|
tools: toolKeys,
|
|
136
136
|
...(unavailable.length > 0 && { unavailableTools: unavailable }),
|
|
137
|
+
disabledTools: d.disabledTools ?? [],
|
|
137
138
|
toolPolicies: d.toolPolicies,
|
|
138
139
|
skills: {
|
|
139
140
|
orgSkills: d.skills?.orgSkills ?? [],
|
|
@@ -141,8 +142,52 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
141
142
|
},
|
|
142
143
|
subagents: d.subagents ?? null,
|
|
143
144
|
sandbox: sandbox ? { enabled: true, egress: egress.egress } : { enabled: false },
|
|
145
|
+
profile: {
|
|
146
|
+
avatar: agent.profile.avatar,
|
|
147
|
+
description: agent.profile.description,
|
|
148
|
+
quickActions: agent.profile.quickActions,
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
defineOperation({
|
|
154
|
+
id: "platform.preferences",
|
|
155
|
+
description: "Read your own preferences: your time zone (an IANA name such as Asia/Shanghai), or null when it follows the time zone of the browser you send messages from. The run context already tells you the zone in effect for this message.",
|
|
156
|
+
input: EMPTY,
|
|
157
|
+
example: {},
|
|
158
|
+
// any signed-in person may call the route; every run's actor is a member of this org
|
|
159
|
+
authz: { orgAction: "agents.use" },
|
|
160
|
+
mirrors: ["GET /api/v1/me/preferences"],
|
|
161
|
+
confirm: "read",
|
|
162
|
+
run: async (_input, ctx) => this.accounts.preferences(ctx.actorAccountId),
|
|
163
|
+
}),
|
|
164
|
+
defineOperation({
|
|
165
|
+
id: "platform.set-preferences",
|
|
166
|
+
description: "Set your own time zone (an IANA name such as Europe/Berlin), or null to follow the time zone of the browser you send messages from. It applies to the messages you send afterwards, on the web and in IM; the current run keeps its zone.",
|
|
167
|
+
input: PreferencesSchema,
|
|
168
|
+
example: { timeZone: "Asia/Shanghai" },
|
|
169
|
+
authz: { orgAction: "agents.use" },
|
|
170
|
+
mirrors: ["PUT /api/v1/me/preferences"],
|
|
171
|
+
confirm: "personal",
|
|
172
|
+
errors: [
|
|
173
|
+
{
|
|
174
|
+
code: "validation_failed",
|
|
175
|
+
next: "Use an IANA time zone name such as Asia/Shanghai or America/New_York, or null.",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
summary: async (input, ctx) => {
|
|
179
|
+
const now = (await this.accounts.preferences(ctx.actorAccountId)).timeZone;
|
|
180
|
+
const from = { zh: now ?? "跟随浏览器", en: now ?? "follow the browser" };
|
|
181
|
+
const to = {
|
|
182
|
+
zh: input.timeZone ?? "跟随浏览器",
|
|
183
|
+
en: input.timeZone ?? "follow the browser",
|
|
184
|
+
};
|
|
185
|
+
return {
|
|
186
|
+
zh: `把你的时区从「${from.zh}」改为「${to.zh}」`,
|
|
187
|
+
en: `Change your time zone from "${from.en}" to "${to.en}"`,
|
|
144
188
|
};
|
|
145
|
-
}
|
|
189
|
+
},
|
|
190
|
+
run: async (input, ctx) => this.accounts.setPreferences(ctx.actorAccountId, { timeZone: input.timeZone }),
|
|
146
191
|
}),
|
|
147
192
|
]);
|
|
148
193
|
}
|
|
@@ -153,6 +198,7 @@ PlatformOperationsProvider = __decorate([
|
|
|
153
198
|
__param(1, Inject(PlatformActor)),
|
|
154
199
|
__param(2, Inject(AgentsService)),
|
|
155
200
|
__param(3, Inject(OrgSettingsService)),
|
|
156
|
-
__param(4, Inject(ToolRegistry))
|
|
201
|
+
__param(4, Inject(ToolRegistry)),
|
|
202
|
+
__param(5, Inject(AccountsService))
|
|
157
203
|
], PlatformOperationsProvider);
|
|
158
204
|
export { PlatformOperationsProvider };
|
|
@@ -4,14 +4,16 @@ import { OrgCatalogService } from "../../catalog/org-catalog.service.js";
|
|
|
4
4
|
import { PluginInstaller } from "../../catalog/plugin-install.js";
|
|
5
5
|
import { PlatformPluginUpdater } from "../../catalog/plugin-upgrade.js";
|
|
6
6
|
import { OrgExtensionConfigs } from "../../extensions/org-config.js";
|
|
7
|
+
import { ExtensionAvailability } from "../../extensions/unavailable.js";
|
|
7
8
|
import { KernelDb } from "../../infra/database/kernel-db.js";
|
|
8
9
|
import { PlatformOperations } from "../registry.js";
|
|
9
|
-
export
|
|
10
|
+
export { OTHER_ORG } from "./other-orgs.js";
|
|
10
11
|
export declare const NEEDS_INPUT = "This plugin needs configuration a person must enter; ask them to enable it on the \u63D2\u4EF6 page.";
|
|
11
12
|
/**
|
|
12
13
|
* Plugin operations of the `Platform` tool (spec §7): the org's view (list, get, switch on or off)
|
|
13
14
|
* and the super admin's platform view (list, get, update with its preview). Every platform result
|
|
14
|
-
*
|
|
15
|
+
* shows the admin console's data in full for platform items and the org's own (spec §14.5 item 1);
|
|
16
|
+
* plugins other orgs own are only counted, and reading or updating one is refused.
|
|
15
17
|
*/
|
|
16
18
|
export declare class PluginsOperations implements OnModuleInit {
|
|
17
19
|
private readonly registry;
|
|
@@ -21,13 +23,13 @@ export declare class PluginsOperations implements OnModuleInit {
|
|
|
21
23
|
private readonly installer;
|
|
22
24
|
private readonly extensions;
|
|
23
25
|
private readonly kdb;
|
|
24
|
-
|
|
26
|
+
private readonly availability;
|
|
27
|
+
constructor(registry: PlatformOperations, orgCatalog: OrgCatalogService, catalog: CatalogService, updater: PlatformPluginUpdater, installer: PluginInstaller, extensions: OrgExtensionConfigs, kdb: KernelDb, availability: ExtensionAvailability);
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
29
|
+
* Installed (or builtin) plugins whose extension stopped loading: the reason, keyed by plugin
|
|
30
|
+
* name. Their state stays (`on` / `needs_config`) so an org admin can still switch them off;
|
|
31
|
+
* the reason and next step tell why the plugin does nothing now.
|
|
28
32
|
*/
|
|
29
|
-
private
|
|
30
|
-
/** How many live catalog items other orgs own (left out of the platform list). */
|
|
31
|
-
private otherOrgItems;
|
|
33
|
+
private stopped;
|
|
32
34
|
onModuleInit(): void;
|
|
33
35
|
}
|