@capybara-hq/kernel 0.1.0-rc.11 → 0.1.0-rc.13

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.
Files changed (220) hide show
  1. package/dist/admin/admin.schemas.d.ts +13 -0
  2. package/dist/agents/agent-lookup.d.ts +5 -0
  3. package/dist/agents/agent-lookup.js +15 -0
  4. package/dist/agents/agents.schemas.d.ts +3 -0
  5. package/dist/agents/agents.service.js +11 -1
  6. package/dist/agents/definition.d.ts +1 -0
  7. package/dist/agents/definition.js +7 -3
  8. package/dist/agents/org-templates.js +4 -0
  9. package/dist/agents/pending-connectors.service.js +1 -1
  10. package/dist/background/background.module.js +2 -2
  11. package/dist/background/launch-lock.d.ts +1 -1
  12. package/dist/background/launch-lock.js +1 -1
  13. package/dist/background/poll.job.d.ts +2 -2
  14. package/dist/background/poll.job.js +10 -10
  15. package/dist/background/stop.d.ts +1 -1
  16. package/dist/background/stop.js +3 -3
  17. package/dist/background/store.d.ts +5 -5
  18. package/dist/background/store.js +5 -5
  19. package/dist/background/tasks.service.d.ts +6 -6
  20. package/dist/background/tasks.service.js +13 -13
  21. package/dist/catalog/component-scope.controller.d.ts +18 -6
  22. package/dist/catalog/component-scope.controller.js +36 -13
  23. package/dist/catalog/component-scope.service.d.ts +11 -0
  24. package/dist/catalog/component-scope.service.js +4 -0
  25. package/dist/catalog/component-state.d.ts +8 -0
  26. package/dist/catalog/component-state.js +19 -11
  27. package/dist/catalog/marketplaces.service.d.ts +1 -1
  28. package/dist/catalog/plugin-import.js +4 -1
  29. package/dist/channels/channels.module.js +2 -2
  30. package/dist/channels/inbound.d.ts +8 -8
  31. package/dist/channels/inbound.js +31 -31
  32. package/dist/channels/phrases.d.ts +27 -27
  33. package/dist/channels/phrases.js +27 -27
  34. package/dist/config/docs.js +1 -1
  35. package/dist/config/schema.d.ts +2 -2
  36. package/dist/config/schema.js +21 -21
  37. package/dist/conversations/conversations.controller.d.ts +11 -11
  38. package/dist/conversations/conversations.controller.js +15 -15
  39. package/dist/conversations/conversations.module.d.ts +1 -1
  40. package/dist/conversations/conversations.module.js +7 -7
  41. package/dist/conversations/conversations.schemas.js +1 -1
  42. package/dist/conversations/conversations.service.d.ts +23 -14
  43. package/dist/conversations/conversations.service.js +28 -21
  44. package/dist/conversations/{environment-status.d.ts → device-status.d.ts} +9 -9
  45. package/dist/conversations/{environment-status.js → device-status.js} +18 -18
  46. package/dist/conversations/event-log.d.ts +1 -1
  47. package/dist/conversations/event-log.js +1 -1
  48. package/dist/conversations/events.d.ts +2 -1
  49. package/dist/conversations/events.js +2 -2
  50. package/dist/ctx/create-ctx.d.ts +10 -1
  51. package/dist/ctx/create-ctx.js +86 -25
  52. package/dist/db/kernel-schema.d.ts +39 -23
  53. package/dist/{environments → devices}/access.d.ts +19 -19
  54. package/dist/{environments → devices}/access.js +28 -28
  55. package/dist/devices/conversation-devices.d.ts +75 -0
  56. package/dist/{environments/conversation-environments.js → devices/conversation-devices.js} +71 -72
  57. package/dist/devices/devices.controller.d.ts +36 -0
  58. package/dist/{environments/environments.controller.js → devices/devices.controller.js} +37 -37
  59. package/dist/devices/devices.module.d.ts +5 -13
  60. package/dist/devices/devices.module.js +16 -29
  61. package/dist/devices/devices.schemas.d.ts +3 -0
  62. package/dist/devices/devices.schemas.js +14 -0
  63. package/dist/{environments/environments.service.d.ts → devices/devices.service.d.ts} +70 -70
  64. package/dist/{environments/environments.service.js → devices/devices.service.js} +122 -122
  65. package/dist/devices/dto.d.ts +13 -54
  66. package/dist/devices/dto.js +7 -39
  67. package/dist/devices/label.d.ts +11 -0
  68. package/dist/{environments → devices}/label.js +7 -7
  69. package/dist/{environments → devices}/legacy-cleanup.job.d.ts +3 -3
  70. package/dist/{environments → devices}/legacy-cleanup.job.js +3 -3
  71. package/dist/errors.d.ts +27 -25
  72. package/dist/errors.js +27 -25
  73. package/dist/evals/recorded-tools.d.ts +2 -2
  74. package/dist/evals/recorded-tools.js +6 -6
  75. package/dist/extensions/admin-ops.js +1 -0
  76. package/dist/extensions/admin-view.js +2 -0
  77. package/dist/extensions/effective-config.d.ts +6 -0
  78. package/dist/extensions/effective-config.js +18 -7
  79. package/dist/extensions/host.d.ts +13 -2
  80. package/dist/extensions/host.js +24 -3
  81. package/dist/extensions/instance.d.ts +12 -1
  82. package/dist/extensions/instance.js +13 -0
  83. package/dist/extensions/permission-view.d.ts +10 -1
  84. package/dist/files/previewers.d.ts +1 -1
  85. package/dist/files/previewers.js +1 -1
  86. package/dist/http/api.module.js +10 -6
  87. package/dist/http/gateway-routes.d.ts +1 -1
  88. package/dist/http/gateway-routes.js +1 -1
  89. package/dist/identity/settings.d.ts +32 -0
  90. package/dist/identity/settings.js +26 -2
  91. package/dist/infra/config/kernel-config.service.js +4 -4
  92. package/dist/kernel.module.js +3 -3
  93. package/dist/{devices → local-devices}/device-auth.controller.d.ts +6 -6
  94. package/dist/{devices → local-devices}/device-auth.controller.js +5 -5
  95. package/dist/{devices → local-devices}/device-auth.d.ts +20 -20
  96. package/dist/{devices → local-devices}/device-auth.js +51 -53
  97. package/dist/local-devices/device-auth.module.d.ts +7 -0
  98. package/dist/{devices → local-devices}/device-auth.module.js +5 -5
  99. package/dist/{devices → local-devices}/device-routes.d.ts +3 -3
  100. package/dist/{devices → local-devices}/device-routes.js +2 -2
  101. package/dist/local-devices/dto.d.ts +66 -0
  102. package/dist/local-devices/dto.js +44 -0
  103. package/dist/{devices → local-devices}/keys.d.ts +11 -11
  104. package/dist/{devices → local-devices}/keys.js +11 -11
  105. package/dist/{devices/device-gateway.d.ts → local-devices/local-device-gateway.d.ts} +14 -14
  106. package/dist/{devices/device-gateway.js → local-devices/local-device-gateway.js} +44 -44
  107. package/dist/{devices/device-provider.d.ts → local-devices/local-device-provider.d.ts} +15 -15
  108. package/dist/{devices/device-provider.js → local-devices/local-device-provider.js} +23 -23
  109. package/dist/local-devices/local-devices.module.d.ts +16 -0
  110. package/dist/local-devices/local-devices.module.js +44 -0
  111. package/dist/{devices → local-devices}/machines.d.ts +26 -26
  112. package/dist/{devices → local-devices}/machines.js +71 -71
  113. package/dist/{devices → local-devices}/relay.d.ts +15 -15
  114. package/dist/{devices → local-devices}/relay.js +55 -55
  115. package/dist/{devices → local-devices}/targets.d.ts +8 -8
  116. package/dist/{devices → local-devices}/targets.js +14 -14
  117. package/dist/orgs/offboarding.d.ts +6 -6
  118. package/dist/orgs/offboarding.js +12 -12
  119. package/dist/orgs/settings.service.d.ts +28 -0
  120. package/dist/orgs/settings.service.js +20 -1
  121. package/dist/platform/exclusions.js +48 -3
  122. package/dist/platform/operation.js +6 -2
  123. package/dist/platform/ops/admin.ops.js +8 -2
  124. package/dist/platform/ops/agents.ops.js +19 -6
  125. package/dist/platform/ops/conversations.ops.d.ts +3 -3
  126. package/dist/platform/ops/conversations.ops.js +9 -9
  127. package/dist/platform/ops/devices.ops.d.ts +26 -0
  128. package/dist/platform/ops/devices.ops.js +311 -0
  129. package/dist/platform/ops/org-settings.ops.js +2 -2
  130. package/dist/platform/ops/orgs.ops.js +1 -0
  131. package/dist/platform/ops/ui.ops.d.ts +8 -0
  132. package/dist/platform/ops/ui.ops.js +41 -0
  133. package/dist/platform/platform-ops.module.d.ts +3 -2
  134. package/dist/platform/platform-ops.module.js +8 -5
  135. package/dist/platform/route-schemas.js +6 -3
  136. package/dist/roles/gateway-role.d.ts +3 -3
  137. package/dist/roles/gateway-role.js +4 -4
  138. package/dist/roles/gateway.module.d.ts +1 -1
  139. package/dist/roles/gateway.module.js +5 -5
  140. package/dist/roles/worker.module.js +1 -1
  141. package/dist/runtime/context/build.d.ts +1 -1
  142. package/dist/runtime/context/build.js +6 -6
  143. package/dist/runtime/context/compaction.js +1 -1
  144. package/dist/runtime/context/{environment-paths.d.ts → device-paths.d.ts} +11 -11
  145. package/dist/runtime/context/{environment-paths.js → device-paths.js} +13 -13
  146. package/dist/runtime/maintenance.d.ts +1 -1
  147. package/dist/runtime/subagents/definition.d.ts +3 -2
  148. package/dist/runtime/subagents/definition.js +2 -1
  149. package/dist/sandbox/jobs.d.ts +13 -13
  150. package/dist/sandbox/jobs.js +20 -20
  151. package/dist/sandbox/leases.d.ts +9 -9
  152. package/dist/sandbox/leases.js +14 -14
  153. package/dist/sandbox/providers.d.ts +8 -8
  154. package/dist/sandbox/providers.js +8 -8
  155. package/dist/sandbox/sandbox.module.d.ts +1 -1
  156. package/dist/sandbox/sandbox.module.js +1 -1
  157. package/dist/sandbox/sandbox.service.d.ts +76 -76
  158. package/dist/sandbox/sandbox.service.js +230 -230
  159. package/dist/tools/builtins/builtin-tools.d.ts +2 -2
  160. package/dist/tools/builtins/builtin-tools.js +5 -5
  161. package/dist/tools/builtins/platform.js +1 -1
  162. package/dist/tools/builtins/sandbox/bash.js +6 -6
  163. package/dist/tools/builtins/sandbox/common.d.ts +25 -25
  164. package/dist/tools/builtins/sandbox/common.js +51 -51
  165. package/dist/tools/builtins/sandbox/edit.js +2 -2
  166. package/dist/tools/builtins/sandbox/index.d.ts +1 -1
  167. package/dist/tools/builtins/sandbox/index.js +1 -1
  168. package/dist/tools/builtins/sandbox/task-output.d.ts +6 -6
  169. package/dist/tools/builtins/sandbox/task-output.js +10 -10
  170. package/dist/tools/builtins/sandbox/task-stop.js +2 -2
  171. package/dist/tools/builtins/sandbox/write.js +2 -2
  172. package/dist/tools/builtins/skill-load.d.ts +1 -1
  173. package/dist/tools/builtins/skill-load.js +2 -2
  174. package/dist/tools/connector-account-policies.d.ts +51 -0
  175. package/dist/tools/connector-account-policies.js +165 -0
  176. package/dist/tools/connectors.controller.d.ts +35 -4
  177. package/dist/tools/connectors.controller.js +66 -7
  178. package/dist/tools/connectors.schemas.d.ts +11 -0
  179. package/dist/tools/connectors.schemas.js +11 -0
  180. package/dist/tools/connectors.service.d.ts +2 -0
  181. package/dist/tools/connectors.service.js +1 -0
  182. package/dist/tools/pipeline.d.ts +1 -1
  183. package/dist/tools/pipeline.js +4 -3
  184. package/dist/tools/policy.d.ts +23 -1
  185. package/dist/tools/policy.js +99 -24
  186. package/dist/tools/registry.d.ts +2 -2
  187. package/dist/tools/tools.module.js +6 -3
  188. package/dist/ui/admin-ui.controller.d.ts +56 -0
  189. package/dist/ui/admin-ui.controller.js +192 -0
  190. package/dist/ui/arrangement.d.ts +74 -0
  191. package/dist/ui/arrangement.js +98 -0
  192. package/dist/ui/embed-token.d.ts +2 -2
  193. package/dist/ui/embed-token.js +30 -5
  194. package/dist/ui/registry.d.ts +29 -14
  195. package/dist/ui/registry.js +31 -10
  196. package/dist/ui/slots.controller.d.ts +11 -0
  197. package/dist/ui/slots.controller.js +25 -0
  198. package/dist/ui/ui-stream.d.ts +20 -3
  199. package/dist/ui/ui-stream.js +25 -7
  200. package/dist/ui/ui.schemas.d.ts +66 -0
  201. package/dist/ui/ui.schemas.js +65 -0
  202. package/dist/ui/views.controller.d.ts +35 -49
  203. package/dist/ui/views.controller.js +48 -70
  204. package/dist/ui/views.d.ts +84 -18
  205. package/dist/ui/views.js +201 -38
  206. package/package.json +3 -3
  207. package/src/migrations/0104_connector_tool_account_policies.sql +16 -0
  208. package/src/migrations/0105_devices_rename.sql +136 -0
  209. package/dist/devices/device-auth.module.d.ts +0 -7
  210. package/dist/environments/conversation-environments.d.ts +0 -75
  211. package/dist/environments/dto.d.ts +0 -25
  212. package/dist/environments/dto.js +0 -12
  213. package/dist/environments/environments.controller.d.ts +0 -36
  214. package/dist/environments/environments.module.d.ts +0 -8
  215. package/dist/environments/environments.module.js +0 -31
  216. package/dist/environments/environments.schemas.d.ts +0 -3
  217. package/dist/environments/environments.schemas.js +0 -14
  218. package/dist/environments/label.d.ts +0 -11
  219. package/dist/platform/ops/environments.ops.d.ts +0 -26
  220. package/dist/platform/ops/environments.ops.js +0 -311
@@ -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), 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 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 UI slot, the extension contributions the org hides and their order; a slot not listed follows the platform), the deployment's sandbox egress default 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. 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 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 } } replaces that slot's entry, where hidden and order list contribution keys <extension>/<contribution> (hidden ones are not listed in the web UI but their pages still open by URL); 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
  }),
@@ -159,6 +159,7 @@ let OrgsOperations = class OrgsOperations {
159
159
  "customSkills",
160
160
  "orgMarketplaceBrowse",
161
161
  "uiTheme",
162
+ "uiArrangement",
162
163
  ],
163
164
  extras: ["orgId", "runConcurrency", "sandbox", "subagents"],
164
165
  confirm: "platform",
@@ -0,0 +1,8 @@
1
+ import { type OnModuleInit } from "@nestjs/common";
2
+ import { PlatformOperations } from "../registry.js";
3
+ /** UI operations of the `Platform` tool (UI slots spec §3): the slot catalog. */
4
+ export declare class UiOperations implements OnModuleInit {
5
+ private readonly registry;
6
+ constructor(registry: PlatformOperations);
7
+ onModuleInit(): void;
8
+ }
@@ -0,0 +1,41 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { UI_SLOTS } from "@capybara-hq/plugin-sdk";
11
+ import { Inject, Injectable } from "@nestjs/common";
12
+ import { z } from "zod";
13
+ import { defineOperation } from "../operation.js";
14
+ import { PlatformOperations } from "../registry.js";
15
+ /** UI operations of the `Platform` tool (UI slots spec §3): the slot catalog. */
16
+ let UiOperations = class UiOperations {
17
+ registry;
18
+ constructor(registry) {
19
+ this.registry = registry;
20
+ }
21
+ onModuleInit() {
22
+ this.registry.register([
23
+ defineOperation({
24
+ id: "ui.slots",
25
+ description: "List the UI slots an extension can contribute to (id, version, where it is, scope and args, accepted kinds view / embed, minimum role, anchors). Use a slot id as a ui contribution's `slot` in a plugin manifest.",
26
+ input: z.object({}).strict(),
27
+ example: {},
28
+ // any signed-in person may call the route; every run's actor is a member of this org
29
+ authz: { orgAction: "agents.use" },
30
+ mirrors: ["GET /api/v1/ui/slots"],
31
+ confirm: "read",
32
+ run: async () => ({ slots: UI_SLOTS }),
33
+ }),
34
+ ]);
35
+ }
36
+ };
37
+ UiOperations = __decorate([
38
+ Injectable(),
39
+ __param(0, Inject(PlatformOperations))
40
+ ], UiOperations);
41
+ export { UiOperations };
@@ -10,7 +10,7 @@ import { ChannelsOperations } from "./ops/channels.ops.js";
10
10
  import { ComponentsOperations } from "./ops/components.ops.js";
11
11
  import { ConnectorsOperations } from "./ops/connectors.ops.js";
12
12
  import { ConversationsOperations } from "./ops/conversations.ops.js";
13
- import { EnvironmentsOperations } from "./ops/environments.ops.js";
13
+ import { DevicesOperations } from "./ops/devices.ops.js";
14
14
  import { EvalsOperations } from "./ops/evals.ops.js";
15
15
  import { ExtensionsOperations } from "./ops/extensions.ops.js";
16
16
  import { ExtensionsAdminOperations } from "./ops/extensions-admin.ops.js";
@@ -26,11 +26,12 @@ import { PreviewersOperations } from "./ops/previewers.ops.js";
26
26
  import { RequestsOperations } from "./ops/requests.ops.js";
27
27
  import { SkillsOperations } from "./ops/skills.ops.js";
28
28
  import { ThemesOperations } from "./ops/themes.ops.js";
29
+ import { UiOperations } from "./ops/ui.ops.js";
29
30
  /**
30
31
  * One provider per domain, each taking `PlatformOperations` as its first constructor argument:
31
32
  * the parity test in `tools/checks` builds the operations from it without a Nest app.
32
33
  */
33
- export declare const PLATFORM_OPERATION_PROVIDERS: readonly [typeof PlatformOperationsProvider, typeof SkillsOperations, typeof AgentsOperations, typeof AgentTemplatesOperations, typeof PluginsOperations, typeof MarketplacesOperations, typeof RequestsOperations, typeof ConnectorsOperations, typeof ExtensionsOperations, typeof ConversationsOperations, typeof ComponentsOperations, typeof AccountsOperations, typeof OrgsOperations, typeof AdminOperations, typeof CatalogAdminOperations, typeof OrgPluginsOperations, typeof ExtensionsAdminOperations, typeof ModelsOperations, typeof InboxOperations, typeof ApprovalsOperations, typeof ChannelsOperations, typeof OrgSettingsOperations, typeof EvalsOperations, typeof BackgroundOperations, typeof PreviewersOperations, typeof EnvironmentsOperations, typeof AgentSkillsOperations, typeof ThemesOperations];
34
+ export declare const PLATFORM_OPERATION_PROVIDERS: readonly [typeof PlatformOperationsProvider, typeof SkillsOperations, typeof AgentsOperations, typeof AgentTemplatesOperations, typeof PluginsOperations, typeof MarketplacesOperations, typeof RequestsOperations, typeof ConnectorsOperations, typeof ExtensionsOperations, typeof ConversationsOperations, typeof ComponentsOperations, typeof AccountsOperations, typeof OrgsOperations, typeof AdminOperations, typeof CatalogAdminOperations, typeof OrgPluginsOperations, typeof ExtensionsAdminOperations, typeof ModelsOperations, typeof InboxOperations, typeof ApprovalsOperations, typeof ChannelsOperations, typeof OrgSettingsOperations, typeof EvalsOperations, typeof BackgroundOperations, typeof PreviewersOperations, typeof DevicesOperations, typeof AgentSkillsOperations, typeof ThemesOperations, typeof UiOperations];
34
35
  /**
35
36
  * The `Platform` tool's operations (ruling P2): one provider per domain, each registering its
36
37
  * operations into `PlatformOperations` from `onModuleInit`. It imports the domain modules, which
@@ -10,7 +10,7 @@ import { BackgroundModule } from "../background/background.module.js";
10
10
  import { CatalogModule } from "../catalog/catalog.module.js";
11
11
  import { ChannelsModule } from "../channels/channels.module.js";
12
12
  import { ConversationsModule } from "../conversations/conversations.module.js";
13
- import { EnvironmentsModule } from "../environments/environments.module.js";
13
+ import { DevicesModule } from "../devices/devices.module.js";
14
14
  import { EvalsModule } from "../evals/evals.module.js";
15
15
  import { ExtensionsModule } from "../extensions/extensions.module.js";
16
16
  import { FilesModule } from "../files/files.module.js";
@@ -34,7 +34,7 @@ import { ChannelsOperations } from "./ops/channels.ops.js";
34
34
  import { ComponentsOperations } from "./ops/components.ops.js";
35
35
  import { ConnectorsOperations } from "./ops/connectors.ops.js";
36
36
  import { ConversationsOperations } from "./ops/conversations.ops.js";
37
- import { EnvironmentsOperations } from "./ops/environments.ops.js";
37
+ import { DevicesOperations } from "./ops/devices.ops.js";
38
38
  import { EvalsOperations } from "./ops/evals.ops.js";
39
39
  import { ExtensionsOperations } from "./ops/extensions.ops.js";
40
40
  import { ExtensionsAdminOperations } from "./ops/extensions-admin.ops.js";
@@ -50,6 +50,7 @@ import { PreviewersOperations } from "./ops/previewers.ops.js";
50
50
  import { RequestsOperations } from "./ops/requests.ops.js";
51
51
  import { SkillsOperations } from "./ops/skills.ops.js";
52
52
  import { ThemesOperations } from "./ops/themes.ops.js";
53
+ import { UiOperations } from "./ops/ui.ops.js";
53
54
  import { PlatformModule } from "./platform.module.js";
54
55
  /**
55
56
  * One provider per domain, each taking `PlatformOperations` as its first constructor argument:
@@ -86,11 +87,13 @@ export const PLATFORM_OPERATION_PROVIDERS = [
86
87
  EvalsOperations,
87
88
  BackgroundOperations,
88
89
  PreviewersOperations,
89
- // Task 11b: environments, agent skills
90
- EnvironmentsOperations,
90
+ // Task 11b: devices, agent skills
91
+ DevicesOperations,
91
92
  AgentSkillsOperations,
92
93
  // themes (themes spec §9)
93
94
  ThemesOperations,
95
+ // UI slot catalog (UI slots spec §3)
96
+ UiOperations,
94
97
  ];
95
98
  /**
96
99
  * The `Platform` tool's operations (ruling P2): one provider per domain, each registering its
@@ -116,7 +119,7 @@ PlatformOpsModule = __decorate([
116
119
  InboxModule,
117
120
  ChannelsModule,
118
121
  EvalsModule,
119
- EnvironmentsModule,
122
+ DevicesModule,
120
123
  BackgroundModule,
121
124
  FilesModule,
122
125
  ThemesModule,
@@ -11,7 +11,7 @@ import { ORG_EXTENSION_ROUTES } from "../catalog/org-extension.schemas.js";
11
11
  import { ORG_PLUGIN_UPLOAD_ROUTES } from "../catalog/org-plugin-uploads.schemas.js";
12
12
  import { CHANNEL_ROUTES } from "../channels/channels.schemas.js";
13
13
  import { CONVERSATION_ROUTES } from "../conversations/conversations.schemas.js";
14
- import { ENVIRONMENT_ROUTES } from "../environments/environments.schemas.js";
14
+ import { DEVICE_ROUTES } from "../devices/devices.schemas.js";
15
15
  import { EVAL_ROUTES } from "../evals/evals.schemas.js";
16
16
  import { EXTENSION_POINT_ROUTES } from "../extensions/point-defaults.schemas.js";
17
17
  import { FILE_PREVIEWER_ROUTES } from "../files/previewers.schemas.js";
@@ -23,6 +23,7 @@ import { SKILL_ROUTES } from "../skills/skills.schemas.js";
23
23
  import { THEME_ROUTES } from "../themes/themes.schemas.js";
24
24
  import { APPROVAL_ROUTES } from "../tools/approvals.schemas.js";
25
25
  import { CONNECTOR_ROUTES } from "../tools/connectors.schemas.js";
26
+ import { UI_ROUTES } from "../ui/ui.schemas.js";
26
27
  /**
27
28
  * Every route a Platform operation mirrors, from the exported `<domain>.schemas.ts` next to each
28
29
  * controller. An operation builds its input from these (`pick` / `omit` / `extend`); the parity
@@ -57,10 +58,12 @@ export const ROUTE_SCHEMAS = [
57
58
  ...EVAL_ROUTES,
58
59
  ...BACKGROUND_ROUTES,
59
60
  ...FILE_PREVIEWER_ROUTES,
60
- // Task 11b: environments
61
- ...ENVIRONMENT_ROUTES,
61
+ // Task 11b: devices
62
+ ...DEVICE_ROUTES,
62
63
  // personal preferences (run context spec §3.4)
63
64
  ...ME_ROUTES,
64
65
  // themes (themes spec §9)
65
66
  ...THEME_ROUTES,
67
+ // UI slots (UI slots spec §3)
68
+ ...UI_ROUTES,
66
69
  ];
@@ -1,15 +1,15 @@
1
1
  import type { ExtensionContext } from "@capybara-hq/plugin-sdk";
2
2
  import { ChannelSupervisor } from "../channels/supervisor.js";
3
3
  import { ChannelWebhooks } from "../channels/webhook.js";
4
- import { DeviceGateway } from "../devices/device-gateway.js";
5
4
  import { ExtensionHost } from "../extensions/host.js";
6
5
  import type { GatewayRoutes } from "../http/gateway-routes.js";
7
6
  import { KernelConfigService } from "../infra/config/kernel-config.service.js";
7
+ import { LocalDeviceGateway } from "../local-devices/local-device-gateway.js";
8
8
  /**
9
9
  * The gateway role's parts, driven by `KernelLifecycle` at fixed points of its start order and
10
10
  * stop phases: the channel long-connection supervisor (leader election and share) and the webhook
11
11
  * inbound (its raw Fastify route, {@link routes}, and its runtime cache's invalidation), and the
12
- * device connections ({@link DeviceGateway}, `GET /device/connect`). Provided
12
+ * device connections ({@link LocalDeviceGateway}, `GET /device/connect`). Provided
13
13
  * only by `GatewayModule`, so a process without the gateway role has none of them.
14
14
  */
15
15
  export declare class GatewayRole {
@@ -26,7 +26,7 @@ export declare class GatewayRole {
26
26
  private unsubscribeWebhooks;
27
27
  /** The supervisor was started: the runs phase stops it. */
28
28
  private supervisorStarted;
29
- constructor(config: KernelConfigService, host: ExtensionHost, bus: Pick<ExtensionContext["bus"], "subscribe">, supervisor: ChannelSupervisor, webhooks: ChannelWebhooks, devices: DeviceGateway);
29
+ constructor(config: KernelConfigService, host: ExtensionHost, bus: Pick<ExtensionContext["bus"], "subscribe">, supervisor: ChannelSupervisor, webhooks: ChannelWebhooks, devices: LocalDeviceGateway);
30
30
  /**
31
31
  * The gateway role's HTTP routes (the channel webhook, the device connection), registered when
32
32
  * the app is built.
@@ -11,15 +11,15 @@ import { Inject, Injectable } from "@nestjs/common";
11
11
  import { CHANNEL_CHANGED_TOPIC } from "../channels/connections.service.js";
12
12
  import { ChannelSupervisor } from "../channels/supervisor.js";
13
13
  import { ChannelWebhooks } from "../channels/webhook.js";
14
- import { DeviceGateway } from "../devices/device-gateway.js";
15
14
  import { ExtensionHost } from "../extensions/host.js";
16
15
  import { KernelConfigService } from "../infra/config/kernel-config.service.js";
17
16
  import { KERNEL_BUS } from "../infra/tokens.js";
17
+ import { LocalDeviceGateway } from "../local-devices/local-device-gateway.js";
18
18
  /**
19
19
  * The gateway role's parts, driven by `KernelLifecycle` at fixed points of its start order and
20
20
  * stop phases: the channel long-connection supervisor (leader election and share) and the webhook
21
21
  * inbound (its raw Fastify route, {@link routes}, and its runtime cache's invalidation), and the
22
- * device connections ({@link DeviceGateway}, `GET /device/connect`). Provided
22
+ * device connections ({@link LocalDeviceGateway}, `GET /device/connect`). Provided
23
23
  * only by `GatewayModule`, so a process without the gateway role has none of them.
24
24
  */
25
25
  let GatewayRole = class GatewayRole {
@@ -55,7 +55,7 @@ let GatewayRole = class GatewayRole {
55
55
  webhookMaxBodyBytes: config.channels.webhookMaxBodyBytes,
56
56
  devices: {
57
57
  gateway: this.devices,
58
- maxFrameBytes: config.environments.device.maxFrameBytes,
58
+ maxFrameBytes: config.devices.local.maxFrameBytes,
59
59
  },
60
60
  };
61
61
  }
@@ -113,6 +113,6 @@ GatewayRole = __decorate([
113
113
  __param(2, Inject(KERNEL_BUS)),
114
114
  __param(3, Inject(ChannelSupervisor)),
115
115
  __param(4, Inject(ChannelWebhooks)),
116
- __param(5, Inject(DeviceGateway))
116
+ __param(5, Inject(LocalDeviceGateway))
117
117
  ], GatewayRole);
118
118
  export { GatewayRole };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The gateway role (nest kernel spec §2), imported by `KernelModule` only when `roles` includes
3
3
  * `gateway`: the channel long-connection supervisor, the webhook inbound (served as a raw Fastify
4
- * route, `http/gateway-routes.ts`), the device connections ({@link DeviceGateway}, `GET
4
+ * route, `http/gateway-routes.ts`), the device connections ({@link LocalDeviceGateway}, `GET
5
5
  * /device/connect`) and {@link GatewayRole}, which `KernelLifecycle` drives. It runs
6
6
  * no cron and no queue consumer (those are the worker role's).
7
7
  */
@@ -8,14 +8,14 @@ import { Module } from "@nestjs/common";
8
8
  import { ChannelsModule } from "../channels/channels.module.js";
9
9
  import { ChannelSupervisor } from "../channels/supervisor.js";
10
10
  import { ChannelWebhooks } from "../channels/webhook.js";
11
- import { DeviceGateway } from "../devices/device-gateway.js";
12
- import { DevicesModule } from "../devices/devices.module.js";
13
11
  import { ExtensionsModule } from "../extensions/extensions.module.js";
12
+ import { LocalDeviceGateway } from "../local-devices/local-device-gateway.js";
13
+ import { LocalDevicesModule } from "../local-devices/local-devices.module.js";
14
14
  import { GatewayRole } from "./gateway-role.js";
15
15
  /**
16
16
  * The gateway role (nest kernel spec §2), imported by `KernelModule` only when `roles` includes
17
17
  * `gateway`: the channel long-connection supervisor, the webhook inbound (served as a raw Fastify
18
- * route, `http/gateway-routes.ts`), the device connections ({@link DeviceGateway}, `GET
18
+ * route, `http/gateway-routes.ts`), the device connections ({@link LocalDeviceGateway}, `GET
19
19
  * /device/connect`) and {@link GatewayRole}, which `KernelLifecycle` drives. It runs
20
20
  * no cron and no queue consumer (those are the worker role's).
21
21
  */
@@ -23,8 +23,8 @@ let GatewayModule = class GatewayModule {
23
23
  };
24
24
  GatewayModule = __decorate([
25
25
  Module({
26
- imports: [ChannelsModule, ExtensionsModule, DevicesModule],
27
- providers: [ChannelSupervisor, ChannelWebhooks, DeviceGateway, GatewayRole],
26
+ imports: [ChannelsModule, ExtensionsModule, LocalDevicesModule],
27
+ providers: [ChannelSupervisor, ChannelWebhooks, LocalDeviceGateway, GatewayRole],
28
28
  exports: [GatewayRole],
29
29
  })
30
30
  ], GatewayModule);
@@ -18,7 +18,7 @@ import { AttachmentsModule } from "../conversations/attachments.module.js";
18
18
  import { AttachmentCleanupJob } from "../conversations/attachments.service.js";
19
19
  import { EventLogModule } from "../conversations/event-log.js";
20
20
  import { TitlesModule } from "../conversations/titles.js";
21
- import { LegacySandboxCleanupJob } from "../environments/legacy-cleanup.job.js";
21
+ import { LegacySandboxCleanupJob } from "../devices/legacy-cleanup.job.js";
22
22
  import { EvalWorkersModule } from "../evals/evals.module.js";
23
23
  import { ExtensionsModule } from "../extensions/extensions.module.js";
24
24
  import { PluginsReconcileJob } from "../extensions/lifecycle.js";
@@ -233,7 +233,7 @@ export declare function summaryText(summary: string): string;
233
233
  * `user_message` / `assistant_message`(content 原样,含 opaque;aborted 的也回放;媒体引用按
234
234
  * {@link resolveMedia} 换成 base64 或文字占位)/ `reminder`
235
235
  * (`role: "system"`,放在它所在的位置)/ `tools_changed` (`role: "system"`, the text of {@link toolsChangedText}, at its position) /
236
- * `environment_paths` (`role: "system"` at its position, `environmentPathsText`; covered by the
236
+ * `device_paths` (`role: "system"` at its position, `devicePathsText`; covered by the
237
237
  * summary: the latest one follows the summary) /
238
238
  * `run_context` (`role: "system"` at its position, `runContextText`; covered by the summary: the
239
239
  * current context follows the summary whole; a user message's sender line by `senderLines`) /
@@ -4,7 +4,7 @@ import { renderBackgroundFinished } from "../../background/render.js";
4
4
  import { isAbsorbable, } from "../../conversations/events.js";
5
5
  import { catalogText, isAlwaysLoaded } from "../../tools/builtins/tool-search.js";
6
6
  import { renderSubagentDelivery } from "../subagents/render.js";
7
- import { environmentPathsAt, environmentPathsText } from "./environment-paths.js";
7
+ import { devicePathsAt, devicePathsText } from "./device-paths.js";
8
8
  import { LEGACY_CATALOG_HEADER, LEGACY_SKILL_TEXTS, usesLegacyToolNames } from "./legacy-text.js";
9
9
  import { currentRunContext, runContextEvents, runContextFullText, runContextText, senderLines, } from "./run-context.js";
10
10
  import { invokedSkillNames, invokedSkillsText, SKILL_TEXTS, skillsCatalogEvents, snapshotChangeText, snapshotCurrentText, snapshotSystemText, systemSkillsCatalog, } from "./skills.js";
@@ -337,7 +337,7 @@ export function summaryText(summary) {
337
337
  * `user_message` / `assistant_message`(content 原样,含 opaque;aborted 的也回放;媒体引用按
338
338
  * {@link resolveMedia} 换成 base64 或文字占位)/ `reminder`
339
339
  * (`role: "system"`,放在它所在的位置)/ `tools_changed` (`role: "system"`, the text of {@link toolsChangedText}, at its position) /
340
- * `environment_paths` (`role: "system"` at its position, `environmentPathsText`; covered by the
340
+ * `device_paths` (`role: "system"` at its position, `devicePathsText`; covered by the
341
341
  * summary: the latest one follows the summary) /
342
342
  * `run_context` (`role: "system"` at its position, `runContextText`; covered by the summary: the
343
343
  * current context follows the summary whole; a user message's sender line by `senderLines`) /
@@ -552,9 +552,9 @@ export function buildModelRequest(input) {
552
552
  }
553
553
  // environments spec §13.1: the instance's directories told before the boundary follow the
554
554
  // summary again (the model keeps using the real paths)
555
- const paths = environmentPathsAt(events, after);
555
+ const paths = devicePathsAt(events, after);
556
556
  if (paths) {
557
- messages.push({ role: "system", content: environmentPathsText(paths.payload.roots) });
557
+ messages.push({ role: "system", content: devicePathsText(paths.payload.roots) });
558
558
  }
559
559
  // 被摘要覆盖的变更提醒不再发送:摘要时生效的目录与 system 里的不同 → 紧随摘要补上完整的当前目录
560
560
  const covered = skillSnaps.filter((e) => e.seq <= after).at(-1);
@@ -631,8 +631,8 @@ export function buildModelRequest(input) {
631
631
  break;
632
632
  // the instance's directories (environments spec §13.1): logged during a step's tool call,
633
633
  // so rendered after that step's tool results
634
- case "environment_paths":
635
- messages.push({ role: "system", content: environmentPathsText(e.payload.roots) });
634
+ case "device_paths":
635
+ messages.push({ role: "system", content: devicePathsText(e.payload.roots) });
636
636
  break;
637
637
  // hook_denied is not model-visible: the model sees only the denied tool call's tool_result
638
638
  // (and nothing for a denied model request), so request building skips it
@@ -134,7 +134,7 @@ function transcriptLine(e) {
134
134
  // phase D: a forked skill's report is user content of the request (build.ts)
135
135
  case "skill_fork_result":
136
136
  return `User: ${e.payload.text}`;
137
- // environment_paths is left out too: the latest one follows the summary (build.ts)
137
+ // device_paths is left out too: the latest one follows the summary (build.ts)
138
138
  // run_context is left out: its current values follow the summary anyway (build.ts), and
139
139
  // stale names should not be summarised as current
140
140
  case "tool_result":
@@ -1,40 +1,40 @@
1
1
  import type { SandboxRoots } from "@capybara-hq/plugin-sdk";
2
2
  import type { ConversationEvent } from "../../conversations/events.js";
3
3
  /**
4
- * The `environment_paths` event (environments spec §13.1, ruling R22): the first sandbox tool call
4
+ * The `device_paths` event (environments spec §13.1, ruling R22): the first sandbox tool call
5
5
  * of every conversation records the instance's roots (the defaults included), and a later call
6
6
  * records them again whenever they differ from the conversation's latest recorded ones (a
7
7
  * connected machine's real paths, a mode switch back to the defaults). Model-visible: rendered at
8
8
  * its position as a system message; in the log, so it needs no `DriftReason`.
9
9
  */
10
- /** The system line of an `environment_paths` event (model-visible, English). */
11
- export declare function environmentPathsText(r: SandboxRoots): string;
10
+ /** The system line of an `device_paths` event (model-visible, English). */
11
+ export declare function devicePathsText(r: SandboxRoots): string;
12
12
  /** Whether two sets of roots are the same paths. */
13
13
  export declare const sameRoots: (a: SandboxRoots, b: SandboxRoots) => boolean;
14
14
  /**
15
- * The idempotency key of an `environment_paths` event for `r` that follows the conversation's
15
+ * The idempotency key of an `device_paths` event for `r` that follows the conversation's
16
16
  * event at `prevSeq` (0: none). Unique per change (A → B → A gets three events), while parallel
17
17
  * calls that saw the same latest event write it once.
18
18
  */
19
- export declare const environmentPathsIdemKey: (r: SandboxRoots, prevSeq: number) => string;
19
+ export declare const devicePathsIdemKey: (r: SandboxRoots, prevSeq: number) => string;
20
20
  /**
21
- * The `environment_paths` event to append when a sandbox call holds an instance with `roots` and
21
+ * The `device_paths` event to append when a sandbox call holds an instance with `roots` and
22
22
  * the conversation's latest such event is `latest`; null when nothing changed.
23
23
  */
24
- export declare function environmentPathsChange(latest: {
24
+ export declare function devicePathsChange(latest: {
25
25
  seq: number;
26
26
  payload: {
27
27
  roots: SandboxRoots;
28
28
  };
29
29
  } | undefined, roots: SandboxRoots, runId: string | undefined): {
30
- type: "environment_paths";
30
+ type: "device_paths";
31
31
  runId?: string;
32
32
  idemKey: string;
33
33
  payload: {
34
34
  roots: SandboxRoots;
35
35
  };
36
36
  } | null;
37
- /** The latest `environment_paths` event at or before `seq`; undefined without one. */
38
- export declare function environmentPathsAt(events: readonly ConversationEvent[], seq: number): Extract<ConversationEvent, {
39
- type: "environment_paths";
37
+ /** The latest `device_paths` event at or before `seq`; undefined without one. */
38
+ export declare function devicePathsAt(events: readonly ConversationEvent[], seq: number): Extract<ConversationEvent, {
39
+ type: "device_paths";
40
40
  }> | undefined;
@@ -1,47 +1,47 @@
1
1
  import { createHash } from "node:crypto";
2
2
  /**
3
- * The `environment_paths` event (environments spec §13.1, ruling R22): the first sandbox tool call
3
+ * The `device_paths` event (environments spec §13.1, ruling R22): the first sandbox tool call
4
4
  * of every conversation records the instance's roots (the defaults included), and a later call
5
5
  * records them again whenever they differ from the conversation's latest recorded ones (a
6
6
  * connected machine's real paths, a mode switch back to the defaults). Model-visible: rendered at
7
7
  * its position as a system message; in the log, so it needs no `DriftReason`.
8
8
  */
9
- /** The system line of an `environment_paths` event (model-visible, English). */
10
- export function environmentPathsText(r) {
11
- return `This environment's directories: workspace ${r.workspace}, skills ${r.skills} (read only), temporary files ${r.tmp}. Use these paths in commands and tool calls.`;
9
+ /** The system line of an `device_paths` event (model-visible, English). */
10
+ export function devicePathsText(r) {
11
+ return `This device's directories: workspace ${r.workspace}, skills ${r.skills} (read only), temporary files ${r.tmp}. Use these paths in commands and tool calls.`;
12
12
  }
13
13
  /** Whether two sets of roots are the same paths. */
14
14
  export const sameRoots = (a, b) => a.workspace === b.workspace && a.skills === b.skills && a.tmp === b.tmp;
15
15
  /**
16
- * The idempotency key of an `environment_paths` event for `r` that follows the conversation's
16
+ * The idempotency key of an `device_paths` event for `r` that follows the conversation's
17
17
  * event at `prevSeq` (0: none). Unique per change (A → B → A gets three events), while parallel
18
18
  * calls that saw the same latest event write it once.
19
19
  */
20
- export const environmentPathsIdemKey = (r, prevSeq) => `environment_paths:${createHash("sha256")
20
+ export const devicePathsIdemKey = (r, prevSeq) => `device_paths:${createHash("sha256")
21
21
  .update(JSON.stringify([r.workspace, r.skills, r.tmp]))
22
22
  .digest("hex")
23
23
  .slice(0, 16)}:${prevSeq}`;
24
24
  /**
25
- * The `environment_paths` event to append when a sandbox call holds an instance with `roots` and
25
+ * The `device_paths` event to append when a sandbox call holds an instance with `roots` and
26
26
  * the conversation's latest such event is `latest`; null when nothing changed.
27
27
  */
28
- export function environmentPathsChange(latest, roots, runId) {
28
+ export function devicePathsChange(latest, roots, runId) {
29
29
  if (latest && sameRoots(latest.payload.roots, roots))
30
30
  return null;
31
31
  return {
32
- type: "environment_paths",
32
+ type: "device_paths",
33
33
  ...(runId !== undefined && { runId }),
34
- idemKey: environmentPathsIdemKey(roots, latest?.seq ?? 0),
34
+ idemKey: devicePathsIdemKey(roots, latest?.seq ?? 0),
35
35
  payload: { roots: { workspace: roots.workspace, skills: roots.skills, tmp: roots.tmp } },
36
36
  };
37
37
  }
38
- /** The latest `environment_paths` event at or before `seq`; undefined without one. */
39
- export function environmentPathsAt(events, seq) {
38
+ /** The latest `device_paths` event at or before `seq`; undefined without one. */
39
+ export function devicePathsAt(events, seq) {
40
40
  let found;
41
41
  for (const e of events) {
42
42
  if (e.seq > seq)
43
43
  break;
44
- if (e.type === "environment_paths")
44
+ if (e.type === "device_paths")
45
45
  found = e;
46
46
  }
47
47
  return found;
@@ -32,7 +32,7 @@ export declare class MaintenanceProcessor extends WorkerHost<Worker> {
32
32
  private readonly scheduled;
33
33
  private readonly log;
34
34
  private readonly queue;
35
- constructor(waits: Pick<Waits, "processTimeout">, sandbox: Pick<SandboxService, "destroyEnvironment" | "resetFileSystem">, drift: Pick<ToolDrift, "check">, directory: Pick<DirectorySync, "runSyncJob">, runs: Pick<RunQueue, "ensureRun">, ownedCleanup: Pick<OwnedPluginCleanup, "run">, scheduled: Pick<ScheduledRuns, "runNow">, log: Pick<KernelLogger, "error" | "warn">, queue: Pick<Queue, "removeJobScheduler">);
35
+ constructor(waits: Pick<Waits, "processTimeout">, sandbox: Pick<SandboxService, "destroyDevice" | "resetFileSystem">, drift: Pick<ToolDrift, "check">, directory: Pick<DirectorySync, "runSyncJob">, runs: Pick<RunQueue, "ensureRun">, ownedCleanup: Pick<OwnedPluginCleanup, "run">, scheduled: Pick<ScheduledRuns, "runNow">, log: Pick<KernelLogger, "error" | "warn">, queue: Pick<Queue, "removeJobScheduler">);
36
36
  /**
37
37
  * Removes the retired job schedulers (`RETIRED_SCHEDULER_IDS`, runtime/retired-schedulers.ts): every fixed-period
38
38
  * maintenance job is a `@LockedCron` / `@LockedInterval` now. Idempotent; called once when a
@@ -34,9 +34,10 @@ export interface EffectiveDefinitionDeps {
34
34
  type Policy = "ask" | "deny";
35
35
  /**
36
36
  * `base` with `over` applied on top, the stricter value winning per key (`deny` > `ask`). Values
37
- * other than `ask` / `deny` (stored template data is not re-validated) are skipped on both sides.
37
+ * other than `ask` / `deny` (stored template data is not re-validated; an agent's connector-tool
38
+ * `allow`, which the policy check reads from the agent's current version) are skipped on both sides.
38
39
  */
39
- export declare function stricterPolicies(base: Record<string, Policy>, over: Record<string, Policy>): Record<string, Policy>;
40
+ export declare function stricterPolicies(base: Record<string, string>, over: Record<string, string>): Record<string, Policy>;
40
41
  /** An org agent's version and definition as checked by its gates. */
41
42
  export interface CheckedOrgAgent {
42
43
  version: number;
@@ -23,7 +23,8 @@ const RANK = { ask: 1, deny: 2 };
23
23
  const isPolicy = (p) => p === "ask" || p === "deny";
24
24
  /**
25
25
  * `base` with `over` applied on top, the stricter value winning per key (`deny` > `ask`). Values
26
- * other than `ask` / `deny` (stored template data is not re-validated) are skipped on both sides.
26
+ * other than `ask` / `deny` (stored template data is not re-validated; an agent's connector-tool
27
+ * `allow`, which the policy check reads from the agent's current version) are skipped on both sides.
27
28
  */
28
29
  export function stricterPolicies(base, over) {
29
30
  const out = {};
@@ -7,20 +7,20 @@ export declare const SANDBOX_SUSPEND_JOB = "sandbox-suspend-idle";
7
7
  /** The inactivity destruction sweep (hourly, once per tick across replicas). */
8
8
  export declare const SANDBOX_DESTROY_JOB = "sandbox-destroy-inactive";
9
9
  /**
10
- * One-off job: destroy a batch of environments now, instance and file system (environment
11
- * deletion, offboarding; data `{ environmentIds }`).
10
+ * One-off job: destroy a batch of devices now, instance and file system (device
11
+ * deletion, offboarding; data `{ deviceIds }`).
12
12
  */
13
13
  export declare const SANDBOX_DESTROY_FOR_JOB = "sandbox-destroy-for";
14
14
  /**
15
- * One-off job: start an environment over with empty files (`resetFileSystem`; data
16
- * `{ environmentId }`, job id {@link resetFilesJobId}).
15
+ * One-off job: start a device over with empty files (`resetFileSystem`; data
16
+ * `{ deviceId }`, job id {@link resetFilesJobId}).
17
17
  */
18
18
  export declare const SANDBOX_RESET_FILES_JOB = "sandbox-reset-files";
19
19
  /**
20
- * The deterministic id of an environment's reset job: a second request while one is waiting or
20
+ * The deterministic id of a device's reset job: a second request while one is waiting or
21
21
  * running joins it (that reset still empties the files); once it ended, a new request is a new job.
22
22
  */
23
- export declare const resetFilesJobId: (environmentId: string) => string;
23
+ export declare const resetFilesJobId: (deviceId: string) => string;
24
24
  /**
25
25
  * The producer of the sandbox maintenance jobs: {@link SANDBOX_DESTROY_FOR_JOB} (BullMQ's own job
26
26
  * ids, as before: every enqueue is a new job, also after a batch failed all its attempts) and
@@ -30,16 +30,16 @@ export declare class SandboxJobs {
30
30
  private readonly queue;
31
31
  constructor(queue: Pick<Queue, "add">);
32
32
  /**
33
- * Enqueues the destruction of these environments: a failed batch is retried whole (destroying
33
+ * Enqueues the destruction of these devices: a failed batch is retried whole (destroying
34
34
  * one already destroyed does nothing).
35
35
  */
36
- destroy(environmentIds: string[]): Promise<void>;
36
+ destroy(deviceIds: string[]): Promise<void>;
37
37
  /**
38
- * Enqueues the reset of an environment's files (see {@link resetFilesJobId}): retried on failure
38
+ * Enqueues the reset of a device's files (see {@link resetFilesJobId}): retried on failure
39
39
  * (the exclusive lease not obtained in time, the provider failing); a job that failed all its
40
40
  * attempts is removed, so the id never blocks a later request.
41
41
  */
42
- resetFiles(environmentId: string): Promise<void>;
42
+ resetFiles(deviceId: string): Promise<void>;
43
43
  }
44
44
  /**
45
45
  * The worker side of {@link SANDBOX_RESET_FILES_JOB}: `resetFileSystem` under the exclusive lease;
@@ -47,14 +47,14 @@ export declare class SandboxJobs {
47
47
  */
48
48
  export declare function runSandboxResetFiles(sandbox: Pick<SandboxService, "resetFileSystem">, job: Pick<Job, "data">): Promise<void>;
49
49
  /**
50
- * The worker side of {@link SANDBOX_DESTROY_FOR_JOB}: `destroyEnvironment` one by one; a failure is
50
+ * The worker side of {@link SANDBOX_DESTROY_FOR_JOB}: `destroyDevice` one by one; a failure is
51
51
  * warned and fails the job (the whole batch is retried) after the others were destroyed.
52
52
  */
53
- export declare function runSandboxDestroyFor(sandbox: Pick<SandboxService, "destroyEnvironment">, log: Pick<KernelLogger, "warn">, job: Pick<Job, "data">): Promise<void>;
53
+ export declare function runSandboxDestroyFor(sandbox: Pick<SandboxService, "destroyDevice">, log: Pick<KernelLogger, "warn">, job: Pick<Job, "data">): Promise<void>;
54
54
  /**
55
55
  * The sandbox sweeps (exactly once per tick across replicas): every minute the idle and overdue
56
56
  * running instances are suspended, every hour the inactive instances are destroyed (files kept)
57
- * and deleted environments, or those of deleted orgs, are destroyed with their files. Both do nothing without a sandbox provider. They replace the
57
+ * and deleted devices, or those of deleted orgs, are destroyed with their files. Both do nothing without a sandbox provider. They replace the
58
58
  * maintenance schedulers `sandbox-suspend-idle-every-minute` and `sandbox-destroy-inactive-hourly`
59
59
  * (retired at worker start).
60
60
  */