@capybara-hq/kernel 0.1.0-rc.20 → 0.1.0-rc.22
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 -1
- package/dist/agents/admin-agents.d.ts +16 -3
- package/dist/agents/admin-agents.js +65 -7
- package/dist/agents/agents.schemas.d.ts +24 -6
- package/dist/agents/agents.service.d.ts +4 -3
- package/dist/agents/agents.service.js +39 -26
- package/dist/agents/definition.d.ts +44 -6
- package/dist/agents/definition.js +86 -18
- package/dist/agents/from-template.d.ts +6 -3
- package/dist/agents/from-template.js +57 -44
- package/dist/agents/org-templates.js +97 -41
- package/dist/agents/templates.d.ts +6 -0
- package/dist/agents/templates.js +15 -1
- package/dist/catalog/admin-catalog.controller.d.ts +2 -4
- package/dist/catalog/admin-catalog.controller.js +2 -6
- package/dist/catalog/catalog.module.js +3 -0
- package/dist/catalog/claude/report.d.ts +9 -2
- package/dist/catalog/claude/report.js +1 -0
- package/dist/catalog/claude/translate.js +1 -1
- package/dist/catalog/component-promotion.js +1 -2
- package/dist/catalog/component-state.d.ts +13 -1
- package/dist/catalog/component-state.js +14 -5
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/marketplaces.service.js +2 -1
- package/dist/catalog/org-catalog.controller.d.ts +13 -3
- package/dist/catalog/org-catalog.controller.js +26 -4
- package/dist/catalog/org-catalog.schemas.d.ts +13 -0
- package/dist/catalog/org-catalog.schemas.js +34 -0
- package/dist/catalog/org-plugin-uploads.controller.js +0 -1
- package/dist/catalog/org-plugin-uploads.d.ts +0 -1
- package/dist/catalog/org-plugin-uploads.js +0 -3
- package/dist/catalog/org-plugin-uploads.schemas.d.ts +0 -1
- package/dist/catalog/org-plugin-uploads.schemas.js +0 -2
- package/dist/catalog/platform-components.d.ts +0 -1
- package/dist/catalog/platform-components.js +3 -8
- package/dist/catalog/plugin-import.d.ts +0 -8
- package/dist/catalog/plugin-import.js +4 -35
- package/dist/catalog/plugin-install.d.ts +2 -2
- package/dist/catalog/plugin-install.js +2 -2
- package/dist/catalog/plugin-package.d.ts +7 -0
- package/dist/catalog/plugin-package.js +27 -1
- package/dist/catalog/plugin-upgrade.d.ts +5 -6
- package/dist/catalog/plugin-upgrade.js +5 -23
- package/dist/catalog/requests.service.d.ts +66 -10
- package/dist/catalog/requests.service.js +196 -15
- package/dist/channels/actions.d.ts +2 -0
- package/dist/channels/actions.js +19 -4
- package/dist/channels/cards.d.ts +16 -2
- package/dist/channels/cards.js +40 -7
- package/dist/channels/channels.module.js +3 -0
- package/dist/channels/outbound.d.ts +22 -1
- package/dist/channels/outbound.js +116 -7
- package/dist/channels/phrases.d.ts +25 -0
- package/dist/channels/phrases.js +19 -0
- package/dist/channels/threads.d.ts +12 -0
- package/dist/channels/threads.js +34 -0
- package/dist/config/schema.d.ts +23 -1
- package/dist/config/schema.js +105 -5
- package/dist/conversations/conversations.service.d.ts +42 -9
- package/dist/conversations/conversations.service.js +57 -25
- package/dist/conversations/events.d.ts +106 -11
- package/dist/conversations/events.js +121 -18
- package/dist/conversations/message-context.d.ts +6 -3
- package/dist/conversations/message-context.js +14 -10
- package/dist/conversations/queue.d.ts +15 -2
- package/dist/conversations/queue.js +22 -3
- package/dist/conversations/queue.service.d.ts +12 -6
- package/dist/conversations/queue.service.js +36 -13
- package/dist/db/kernel-schema.d.ts +105 -3
- package/dist/devices/conversation-devices.d.ts +8 -1
- package/dist/devices/conversation-devices.js +8 -0
- package/dist/devices/devices.controller.d.ts +21 -4
- package/dist/devices/devices.controller.js +46 -8
- package/dist/devices/devices.schemas.d.ts +9 -1
- package/dist/devices/devices.schemas.js +11 -3
- package/dist/devices/devices.service.d.ts +176 -4
- package/dist/devices/devices.service.js +341 -6
- package/dist/devices/dto.d.ts +56 -3
- package/dist/devices/dto.js +51 -1
- package/dist/devices/public-suffix.d.ts +6 -0
- package/dist/devices/public-suffix.js +79 -0
- package/dist/errors.d.ts +46 -5
- package/dist/errors.js +46 -5
- package/dist/evals/reconstruct.d.ts +18 -13
- package/dist/evals/reconstruct.js +50 -36
- package/dist/evals/recorded-tools.d.ts +7 -7
- package/dist/evals/recorded-tools.js +4 -3
- package/dist/evals/trajectory.d.ts +6 -1
- package/dist/evals/trajectory.js +7 -0
- package/dist/extensions/bootstrap.d.ts +49 -10
- package/dist/extensions/bootstrap.js +104 -27
- package/dist/extensions/package.js +2 -2
- package/dist/http/api.module.js +5 -0
- package/dist/inbox/inbox.module.js +2 -1
- package/dist/inbox/inbox.service.d.ts +19 -4
- package/dist/inbox/inbox.service.js +14 -3
- package/dist/infra/config/kernel-config.service.js +11 -0
- package/dist/infra/events/kernel-events.d.ts +2 -1
- package/dist/lifecycle/kernel-lifecycle.d.ts +5 -1
- package/dist/lifecycle/kernel-lifecycle.js +16 -4
- package/dist/local-devices/device-policy.service.d.ts +65 -0
- package/dist/local-devices/device-policy.service.js +217 -0
- package/dist/local-devices/local-device-gateway.js +4 -1
- package/dist/local-devices/local-device-provider.d.ts +40 -3
- package/dist/local-devices/local-device-provider.js +109 -7
- package/dist/local-devices/local-devices.module.d.ts +2 -1
- package/dist/local-devices/local-devices.module.js +19 -3
- package/dist/local-devices/machines.d.ts +14 -3
- package/dist/local-devices/machines.js +41 -3
- package/dist/local-devices/network-grants.d.ts +104 -0
- package/dist/local-devices/network-grants.js +288 -0
- package/dist/local-devices/policy-summary.d.ts +20 -0
- package/dist/local-devices/policy-summary.js +63 -0
- package/dist/orgs/orgs.module.js +4 -10
- package/dist/orgs/roles.d.ts +1 -1
- package/dist/orgs/roles.js +4 -0
- package/dist/orgs/settings.controller.js +2 -1
- package/dist/orgs/settings.service.d.ts +164 -12
- package/dist/orgs/settings.service.js +212 -24
- package/dist/platform/exclusions.js +11 -1
- package/dist/platform/operation.js +4 -0
- package/dist/platform/ops/admin-items.ops.js +1 -1
- package/dist/platform/ops/agent-skills.ops.js +2 -2
- package/dist/platform/ops/agent-templates.ops.js +2 -2
- package/dist/platform/ops/agents.ops.js +11 -15
- package/dist/platform/ops/devices.ops.js +3 -1
- package/dist/platform/ops/inbox.ops.js +19 -0
- package/dist/platform/ops/org-settings.ops.js +14 -5
- package/dist/platform/ops/platform.ops.d.ts +9 -1
- package/dist/platform/ops/platform.ops.js +34 -12
- package/dist/platform/ops/requests.ops.js +3 -2
- package/dist/platform/ops/schedules.ops.d.ts +21 -0
- package/dist/platform/ops/schedules.ops.js +470 -0
- package/dist/platform/ops/skills.ops.js +3 -3
- package/dist/platform/platform-ops.module.d.ts +2 -1
- package/dist/platform/platform-ops.module.js +5 -0
- package/dist/platform/route-schemas.js +3 -0
- package/dist/roles/worker.module.js +3 -0
- package/dist/runtime/context/build.js +13 -4
- package/dist/runtime/context/compaction.js +6 -3
- package/dist/runtime/context/device-paths.d.ts +43 -21
- package/dist/runtime/context/device-paths.js +104 -21
- package/dist/runtime/context/run-context.d.ts +9 -0
- package/dist/runtime/context/run-context.js +8 -0
- package/dist/runtime/context/skills.d.ts +14 -1
- package/dist/runtime/context/skills.js +36 -5
- package/dist/runtime/maintenance.d.ts +4 -2
- package/dist/runtime/maintenance.js +16 -5
- package/dist/runtime/run-finish.d.ts +6 -1
- package/dist/runtime/run-finish.js +16 -2
- package/dist/runtime/run-queue.js +21 -2
- package/dist/runtime/run-worker.js +14 -33
- package/dist/runtime/runtime.module.js +3 -0
- package/dist/runtime/subagents/definition.d.ts +32 -14
- package/dist/runtime/subagents/definition.js +106 -109
- package/dist/runtime/subagents/dispatch.js +4 -3
- package/dist/runtime/subagents/preamble.d.ts +2 -1
- package/dist/runtime/subagents/preamble.js +2 -1
- package/dist/runtime/waits.js +14 -4
- package/dist/sandbox/sandbox.service.d.ts +120 -10
- package/dist/sandbox/sandbox.service.js +335 -28
- package/dist/sandbox/tiers.d.ts +86 -0
- package/dist/sandbox/tiers.js +96 -0
- package/dist/schedules/effective-settings.d.ts +16 -0
- package/dist/schedules/effective-settings.js +17 -0
- package/dist/schedules/errors.d.ts +8 -0
- package/dist/schedules/errors.js +8 -0
- package/dist/schedules/fire.d.ts +118 -0
- package/dist/schedules/fire.js +625 -0
- package/dist/schedules/grant-rules.d.ts +94 -0
- package/dist/schedules/grant-rules.js +126 -0
- package/dist/schedules/job-ids.d.ts +32 -0
- package/dist/schedules/job-ids.js +27 -0
- package/dist/schedules/pause.d.ts +9 -0
- package/dist/schedules/pause.js +33 -0
- package/dist/schedules/run-tracker.d.ts +81 -0
- package/dist/schedules/run-tracker.js +333 -0
- package/dist/schedules/scan.job.d.ts +64 -0
- package/dist/schedules/scan.job.js +303 -0
- package/dist/schedules/schedule-math.d.ts +31 -0
- package/dist/schedules/schedule-math.js +223 -0
- package/dist/schedules/scheduled-tasks.service.d.ts +351 -0
- package/dist/schedules/scheduled-tasks.service.js +1193 -0
- package/dist/schedules/schedules.controller.d.ts +68 -0
- package/dist/schedules/schedules.controller.js +242 -0
- package/dist/schedules/schedules.module.d.ts +16 -0
- package/dist/schedules/schedules.module.js +65 -0
- package/dist/schedules/schedules.schemas.d.ts +316 -0
- package/dist/schedules/schedules.schemas.js +186 -0
- package/dist/schedules/store.d.ts +81 -0
- package/dist/schedules/store.js +390 -0
- package/dist/schedules/store.module.d.ts +6 -0
- package/dist/schedules/store.module.js +21 -0
- package/dist/schedules/types.d.ts +108 -0
- package/dist/schedules/types.js +1 -0
- package/dist/schedules/unattended.d.ts +117 -0
- package/dist/schedules/unattended.js +228 -0
- package/dist/setup/oauth-token-probe.js +8 -4
- package/dist/skills/agent-skills.service.d.ts +4 -8
- package/dist/skills/agent-skills.service.js +18 -53
- package/dist/skills/catalog.d.ts +65 -62
- package/dist/skills/catalog.js +109 -206
- package/dist/skills/conversation-catalog.d.ts +3 -3
- package/dist/skills/conversation-catalog.js +5 -12
- package/dist/skills/invoke.d.ts +2 -2
- package/dist/skills/skills.controller.d.ts +3 -1
- package/dist/skills/skills.service.d.ts +38 -37
- package/dist/skills/skills.service.js +168 -107
- package/dist/skills/usable.d.ts +57 -8
- package/dist/skills/usable.js +172 -38
- package/dist/tools/approvals.controller.d.ts +4 -2
- package/dist/tools/approvals.controller.js +17 -2
- package/dist/tools/approvals.schemas.d.ts +1 -0
- package/dist/tools/approvals.schemas.js +3 -1
- package/dist/tools/approvals.service.d.ts +182 -7
- package/dist/tools/approvals.service.js +597 -13
- package/dist/tools/builtin-names.d.ts +25 -4
- package/dist/tools/builtin-names.js +45 -4
- package/dist/tools/builtins/builtin-tools.d.ts +8 -0
- package/dist/tools/builtins/builtin-tools.js +23 -2
- package/dist/tools/builtins/sandbox/bash.js +16 -7
- package/dist/tools/builtins/sandbox/common.d.ts +1 -1
- package/dist/tools/builtins/sandbox/common.js +33 -10
- package/dist/tools/builtins/sandbox/edit.js +7 -3
- package/dist/tools/builtins/sandbox/file-state.d.ts +31 -1
- package/dist/tools/builtins/sandbox/file-state.js +33 -3
- package/dist/tools/builtins/sandbox/write.js +8 -4
- package/dist/tools/builtins/schedules.d.ts +107 -0
- package/dist/tools/builtins/schedules.js +789 -0
- package/dist/tools/elicitation.d.ts +2 -0
- package/dist/tools/elicitation.js +1 -1
- package/dist/tools/fixed-ask.d.ts +7 -0
- package/dist/tools/fixed-ask.js +9 -0
- package/dist/tools/network-asks.d.ts +109 -0
- package/dist/tools/network-asks.js +221 -0
- package/dist/tools/pipeline.d.ts +53 -6
- package/dist/tools/pipeline.js +202 -13
- package/dist/tools/policy.d.ts +21 -8
- package/dist/tools/policy.js +63 -9
- package/dist/tools/registry.d.ts +10 -1
- package/dist/tools/tools.module.js +12 -0
- package/package.json +2 -2
- package/src/migrations/0113_scheduled_tasks.sql +108 -0
- package/src/migrations/0114_network_asks.sql +23 -0
- package/src/migrations/0115_network_requests.sql +28 -0
- package/src/migrations/0116_skills_default_on.sql +37 -0
- package/src/migrations/0117_sandbox_tiers.sql +11 -0
|
@@ -39,7 +39,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
39
39
|
this.registry.register([
|
|
40
40
|
defineOperation({
|
|
41
41
|
id: "org-settings.get",
|
|
42
|
-
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), sandboxEgress and wakeOnBackgroundTask (absent means it follows the deployment), theme (the org's default theme id, null or absent following the platform, and personal: allowed or locked), uiArrangement (per list slot, the extension contributions the org hides and their order; per single slot, the contribution that replaces the built-in as use, null for the built-in; a slot not listed follows the platform), the deployment's sandbox egress default and the sandbox cpu / memory limits in effect.",
|
|
42
|
+
description: "Read this org's settings: toolSearch, locale, sandboxToolPolicy, platformTool (on, read-only or off), sandboxEgress, sandboxTier ({ max, default, allowUnsandboxed }: the org's sandbox levels strict < dev < open) and wakeOnBackgroundTask (absent means it follows the deployment), theme (the org's default theme id, null or absent following the platform, and personal: allowed or locked), uiArrangement (per list slot, the extension contributions the org hides and their order; per single slot, the contribution that replaces the built-in as use, null for the built-in; a slot not listed follows the platform), the deployment's sandbox egress default and sandbox tiers, and the sandbox cpu / memory limits in effect.",
|
|
43
43
|
input: z.object({}).strict(),
|
|
44
44
|
example: {},
|
|
45
45
|
authz: { orgAction: "org.read" },
|
|
@@ -53,7 +53,7 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
53
53
|
}),
|
|
54
54
|
defineOperation({
|
|
55
55
|
id: "org-settings.update",
|
|
56
|
-
description: "Change this org's settings (org admins). Give only the settings to change; null clears sandboxEgress or wakeOnBackgroundTask so they follow the deployment again. theme: { id, personal } sets the org's default theme (a theme id from themes.list, or null to follow the platform) and whether members may pick their own (allowed) or not (locked); null clears it. uiArrangement: { <slot>: { hidden, order } } (a list slot) or { <slot>: { use } } (a single slot: shell.brand, conversation.empty, conversation.composer.frame) replaces that slot's entry, where hidden, order and use name contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL; use null is the built-in); null for a slot makes it follow the platform again; platform.page is refused. Setting platformTool to off or read-only takes effect from the next call and cuts this Platform tool off in the org, so say so before asking; an org admin switches it back on in the web settings.",
|
|
56
|
+
description: "Change this org's settings (org admins). Give only the settings to change; null clears sandboxEgress, sandboxTier or wakeOnBackgroundTask so they follow the deployment again. sandboxTier ({ max, default, allowUnsandboxed }, replaced whole) and sandboxEgress may only narrow the org's sandbox here: raising or clearing a tier cap, allowing unsandboxed devices, or adding network hosts is refused and needs a person in the organization settings on the web. theme: { id, personal } sets the org's default theme (a theme id from themes.list, or null to follow the platform) and whether members may pick their own (allowed) or not (locked); null clears it. uiArrangement: { <slot>: { hidden, order } } (a list slot) or { <slot>: { use } } (a single slot: shell.brand, conversation.empty, conversation.composer.frame) replaces that slot's entry, where hidden, order and use name contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL; use null is the built-in); null for a slot makes it follow the platform again; platform.page is refused. Setting platformTool to off or read-only takes effect from the next call and cuts this Platform tool off in the org, so say so before asking; an org admin switches it back on in the web settings.",
|
|
57
57
|
input: OrgSettingsPatchSchema.refine((i) => Object.values(i).some((v) => v !== undefined), {
|
|
58
58
|
message: "give at least one setting",
|
|
59
59
|
}),
|
|
@@ -64,7 +64,11 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
64
64
|
errors: [
|
|
65
65
|
{
|
|
66
66
|
code: "org.sandbox_egress_not_allowed",
|
|
67
|
-
next: "
|
|
67
|
+
next: "Through this tool the org's sandbox network may only be narrowed (no new hosts, not back from none); if the deployment disables sandbox network access, sandboxEgress can only be none. To widen it, ask an org admin to change it in the organization settings on the web.",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
code: "org.sandbox_tier_not_allowed",
|
|
71
|
+
next: "Through this tool the org's sandbox level may only be lowered, never above the platform's sandbox.tiers (org-settings.get shows both); to raise it, ask an org admin to change it in the organization settings on the web.",
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
74
|
code: "theme.not_available",
|
|
@@ -75,7 +79,10 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
75
79
|
next: "Fix the setting as the message says (org-settings.get shows the current values).",
|
|
76
80
|
},
|
|
77
81
|
],
|
|
78
|
-
precheck: (i) => precheckBy(async () =>
|
|
82
|
+
precheck: (i, ctx) => precheckBy(async () => {
|
|
83
|
+
this.settings.check(i);
|
|
84
|
+
this.settings.assertOnlyNarrows(await this.settings.get(ctx.orgId), i);
|
|
85
|
+
}),
|
|
79
86
|
summary: async (i, ctx) => {
|
|
80
87
|
const { theme, ...rest } = i;
|
|
81
88
|
const parts = Object.entries(rest)
|
|
@@ -108,7 +115,9 @@ let OrgSettingsOperations = class OrgSettingsOperations {
|
|
|
108
115
|
};
|
|
109
116
|
},
|
|
110
117
|
run: async (input, ctx) => {
|
|
111
|
-
const settings = await this.settings.update(ctx.orgId, input, ctx.actorAccountId, undefined, viaAgent("org-settings.update", ctx)
|
|
118
|
+
const settings = await this.settings.update(ctx.orgId, input, ctx.actorAccountId, undefined, viaAgent("org-settings.update", ctx),
|
|
119
|
+
// a person widens the sandbox, never an agent (sandbox dev tiers spec §7.2)
|
|
120
|
+
{ onlyNarrows: true });
|
|
112
121
|
const note = input.platformTool === undefined
|
|
113
122
|
? undefined
|
|
114
123
|
: PLATFORM_TOOL_NOTE[settings.platformTool];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type OnModuleInit } from "@nestjs/common";
|
|
2
2
|
import { AgentsService } from "../../agents/agents.service.js";
|
|
3
3
|
import { AccountsService } from "../../identity/accounts.js";
|
|
4
|
+
import { KernelDb } from "../../infra/database/kernel-db.js";
|
|
4
5
|
import { OrgSettingsService } from "../../orgs/settings.service.js";
|
|
5
6
|
import { ThemesService } from "../../themes/themes.service.js";
|
|
6
7
|
import { ToolRegistry } from "../../tools/registry.js";
|
|
@@ -18,7 +19,14 @@ export declare class PlatformOperationsProvider implements OnModuleInit {
|
|
|
18
19
|
private readonly tools;
|
|
19
20
|
private readonly accounts;
|
|
20
21
|
private readonly themes;
|
|
21
|
-
|
|
22
|
+
private readonly db;
|
|
23
|
+
constructor(registry: PlatformOperations, actor: PlatformActor, agents: AgentsService, settings: OrgSettingsService, tools: ToolRegistry, accounts: AccountsService, themes: ThemesService, db: KernelDb);
|
|
24
|
+
/**
|
|
25
|
+
* The skills in the agent's catalog now, by the names a run's catalog lists them, each with its
|
|
26
|
+
* plugin (skills default-on spec §11): the resolver's result for this conversation, as the next
|
|
27
|
+
* run start would snapshot it (manual-only skills are not in the catalog).
|
|
28
|
+
*/
|
|
29
|
+
private skillNames;
|
|
22
30
|
/**
|
|
23
31
|
* The agent's tools by the keys the model sees, as the registry resolves them for a run (tools
|
|
24
32
|
* default-on spec §8): every tool the org offers that the definition does not turn off, builtins
|
|
@@ -12,8 +12,10 @@ import { z } from "zod";
|
|
|
12
12
|
import { AgentsService } from "../../agents/agents.service.js";
|
|
13
13
|
import { AccountsService } from "../../identity/accounts.js";
|
|
14
14
|
import { PreferencesSchema } from "../../identity/me.schemas.js";
|
|
15
|
+
import { KernelDb } from "../../infra/database/kernel-db.js";
|
|
15
16
|
import { can } from "../../orgs/roles.js";
|
|
16
|
-
import {
|
|
17
|
+
import { OrgSettingsService } from "../../orgs/settings.service.js";
|
|
18
|
+
import { resolveEffectiveSkills } from "../../skills/catalog.js";
|
|
17
19
|
import { ThemesService } from "../../themes/themes.service.js";
|
|
18
20
|
import { SANDBOX_TOOL_NAMES } from "../../tools/builtin-names.js";
|
|
19
21
|
import { ToolRegistry } from "../../tools/registry.js";
|
|
@@ -49,7 +51,8 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
49
51
|
tools;
|
|
50
52
|
accounts;
|
|
51
53
|
themes;
|
|
52
|
-
|
|
54
|
+
db;
|
|
55
|
+
constructor(registry, actor, agents, settings, tools, accounts, themes, db) {
|
|
53
56
|
this.registry = registry;
|
|
54
57
|
this.actor = actor;
|
|
55
58
|
this.agents = agents;
|
|
@@ -57,6 +60,21 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
57
60
|
this.tools = tools;
|
|
58
61
|
this.accounts = accounts;
|
|
59
62
|
this.themes = themes;
|
|
63
|
+
this.db = db;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The skills in the agent's catalog now, by the names a run's catalog lists them, each with its
|
|
67
|
+
* plugin (skills default-on spec §11): the resolver's result for this conversation, as the next
|
|
68
|
+
* run start would snapshot it (manual-only skills are not in the catalog).
|
|
69
|
+
*/
|
|
70
|
+
async skillNames(ctx, d) {
|
|
71
|
+
const skills = await resolveEffectiveSkills(this.db.db, {
|
|
72
|
+
orgId: ctx.orgId,
|
|
73
|
+
agentId: ctx.agentId,
|
|
74
|
+
agent: { disabledSkills: d.disabledSkills ?? [] },
|
|
75
|
+
conversationId: ctx.conversationId,
|
|
76
|
+
});
|
|
77
|
+
return skills.map((s) => ({ name: s.name, plugin: s.plugin ?? null }));
|
|
60
78
|
}
|
|
61
79
|
/**
|
|
62
80
|
* The agent's tools by the keys the model sees, as the registry resolves them for a run (tools
|
|
@@ -114,7 +132,7 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
114
132
|
}),
|
|
115
133
|
defineOperation({
|
|
116
134
|
id: "platform.me",
|
|
117
|
-
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
|
|
135
|
+
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), the skills in its catalog now by name with their plugin (every skill on in the org unless the agent turns it off, its own and builtin plugins' skills always; manual-only skills are not in the catalog), the skills it turns off (disabledSkills), sub-agents, whether it runs in a sandbox, the sandbox level (tier) and network mode of a new device, and its profile (avatar, description, quick actions). Secrets are never shown.",
|
|
118
136
|
input: EMPTY,
|
|
119
137
|
example: {},
|
|
120
138
|
authz: { orgAction: "agents.use" },
|
|
@@ -123,11 +141,14 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
123
141
|
run: async (_input, ctx) => {
|
|
124
142
|
const agent = await this.agents.get(ctx.orgId, ctx.agentId, ctx.actorAccountId);
|
|
125
143
|
const d = agent.definition;
|
|
126
|
-
const { keys: toolKeys, unavailable } = await
|
|
144
|
+
const [{ keys: toolKeys, unavailable }, skills] = await Promise.all([
|
|
145
|
+
this.toolKeys(ctx.orgId, d),
|
|
146
|
+
this.skillNames(ctx, d),
|
|
147
|
+
]);
|
|
127
148
|
const sandbox = toolKeys.some((k) => SANDBOX_TOOL_NAMES.includes(k));
|
|
128
149
|
const org = await this.settings.get(ctx.orgId);
|
|
129
|
-
|
|
130
|
-
const
|
|
150
|
+
// a new device's level: the org's default tier and its network
|
|
151
|
+
const policy = this.settings.sandboxPolicy(org, null);
|
|
131
152
|
return {
|
|
132
153
|
id: agent.id,
|
|
133
154
|
name: d.name,
|
|
@@ -139,12 +160,12 @@ let PlatformOperationsProvider = class PlatformOperationsProvider {
|
|
|
139
160
|
...(unavailable.length > 0 && { unavailableTools: unavailable }),
|
|
140
161
|
disabledTools: d.disabledTools ?? [],
|
|
141
162
|
toolPolicies: d.toolPolicies,
|
|
142
|
-
skills
|
|
143
|
-
|
|
144
|
-
pinned: d.skills?.pinned ?? [],
|
|
145
|
-
},
|
|
163
|
+
skills,
|
|
164
|
+
disabledSkills: d.disabledSkills ?? [],
|
|
146
165
|
subagents: d.subagents ?? null,
|
|
147
|
-
sandbox: sandbox
|
|
166
|
+
sandbox: sandbox
|
|
167
|
+
? { enabled: true, tier: policy.tier, egress: policy.egress }
|
|
168
|
+
: { enabled: false },
|
|
148
169
|
profile: {
|
|
149
170
|
avatar: agent.profile.avatar,
|
|
150
171
|
description: agent.profile.description,
|
|
@@ -226,6 +247,7 @@ PlatformOperationsProvider = __decorate([
|
|
|
226
247
|
__param(3, Inject(OrgSettingsService)),
|
|
227
248
|
__param(4, Inject(ToolRegistry)),
|
|
228
249
|
__param(5, Inject(AccountsService)),
|
|
229
|
-
__param(6, Inject(ThemesService))
|
|
250
|
+
__param(6, Inject(ThemesService)),
|
|
251
|
+
__param(7, Inject(KernelDb))
|
|
230
252
|
], PlatformOperationsProvider);
|
|
231
253
|
export { PlatformOperationsProvider };
|
|
@@ -23,6 +23,7 @@ const view = (r) => ({
|
|
|
23
23
|
item: r.item,
|
|
24
24
|
entry: r.entry,
|
|
25
25
|
agent: r.agent,
|
|
26
|
+
network: r.network,
|
|
26
27
|
note: r.note,
|
|
27
28
|
reason: r.reason,
|
|
28
29
|
decidedAt: r.decidedAt,
|
|
@@ -40,7 +41,7 @@ const platformRow = (r) => ({
|
|
|
40
41
|
/** A member's pending request as the org admins' list shows it: a compact row (the inbox's). */
|
|
41
42
|
const pendingRow = (r) => ({
|
|
42
43
|
id: r.id,
|
|
43
|
-
name: r.item?.name ?? r.entry?.name ?? r.agent?.name ?? r.kind,
|
|
44
|
+
name: r.item?.name ?? r.entry?.name ?? r.agent?.name ?? r.network?.hosts.join(", ") ?? r.kind,
|
|
44
45
|
state: r.status,
|
|
45
46
|
kind: r.kind,
|
|
46
47
|
requestedBy: r.requestedByName,
|
|
@@ -153,7 +154,7 @@ let RequestsOperations = class RequestsOperations {
|
|
|
153
154
|
}),
|
|
154
155
|
defineOperation({
|
|
155
156
|
id: "requests.pending",
|
|
156
|
-
description: "List the requests members sent this org's admins that wait for a decision (org admins), as the inbox shows them, newest first: kind enable (switch a plugin on)
|
|
157
|
+
description: "List the requests members sent this org's admins that wait for a decision (org admins), as the inbox shows them, newest first: kind enable (switch a plugin on), connector_setup (set up an agent's connectors) or network_allowlist (allow hosts in the org's sandbox network), what it is about (the plugin, the agent or the hosts), who asked and their note. Deciding them is done on the web. Pages by 50: pass the returned next as params.cursor.",
|
|
157
158
|
input: z.object({ cursor: Cursor.optional() }).strict(),
|
|
158
159
|
example: {},
|
|
159
160
|
authz: { orgAction: "catalog.decide" },
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type OnModuleInit } from "@nestjs/common";
|
|
2
|
+
import { ScheduledTasksService } from "../../schedules/scheduled-tasks.service.js";
|
|
3
|
+
import { PlatformOperations } from "../registry.js";
|
|
4
|
+
/**
|
|
5
|
+
* Scheduled-task operations of the `Platform` tool (scheduled tasks spec §10): the same service
|
|
6
|
+
* as the HTTP routes. Writes are `personal`. Creating or changing a task and its approved tools
|
|
7
|
+
* are never remembered (`rememberable: false`): an approval, remembered or granted to a task,
|
|
8
|
+
* must never let an unattended run create or widen a task. Delete, run and resume are never
|
|
9
|
+
* remembered either. List, pause and delete are `org.read` like their routes: a creator demoted
|
|
10
|
+
* to guest can still see and stop their own tasks (the service decides by ownership).
|
|
11
|
+
*/
|
|
12
|
+
export declare class SchedulesOperations implements OnModuleInit {
|
|
13
|
+
private readonly registry;
|
|
14
|
+
private readonly tasks;
|
|
15
|
+
constructor(registry: PlatformOperations, tasks: ScheduledTasksService);
|
|
16
|
+
/** The caller as the service expects (it reads the live role itself). */
|
|
17
|
+
private actor;
|
|
18
|
+
/** The task's name for a card; its id when it cannot be read. */
|
|
19
|
+
private label;
|
|
20
|
+
onModuleInit(): void;
|
|
21
|
+
}
|