@capybara-hq/kernel 0.1.0-rc.54 → 0.1.0-rc.55

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 (154) hide show
  1. package/dist/admin/admin.schemas.d.ts +11 -1
  2. package/dist/catalog/catalog.module.js +1 -1
  3. package/dist/catalog/marketplaces.service.d.ts +1 -1
  4. package/dist/catalog/requests.service.d.ts +5 -5
  5. package/dist/catalog/requests.service.js +9 -9
  6. package/dist/channels/cards.d.ts +4 -3
  7. package/dist/channels/cards.js +25 -16
  8. package/dist/channels/phrases.d.ts +15 -4
  9. package/dist/channels/phrases.js +15 -1
  10. package/dist/config/load.d.ts +26 -7
  11. package/dist/config/load.js +60 -9
  12. package/dist/config/permission-migration.d.ts +17 -9
  13. package/dist/config/permission-migration.js +60 -9
  14. package/dist/config/schema.d.ts +11 -1
  15. package/dist/config/schema.js +37 -11
  16. package/dist/conversations/events.d.ts +247 -5
  17. package/dist/conversations/events.js +127 -16
  18. package/dist/conversations/permission-profiles.controller.d.ts +12 -2
  19. package/dist/conversations/permission-profiles.service.d.ts +12 -2
  20. package/dist/conversations/permission-profiles.service.js +11 -4
  21. package/dist/db/kernel-schema.d.ts +8 -2
  22. package/dist/devices/device-projects.service.d.ts +1 -1
  23. package/dist/devices/device-projects.service.js +6 -6
  24. package/dist/devices/devices.controller.d.ts +10 -8
  25. package/dist/devices/devices.controller.js +14 -18
  26. package/dist/devices/devices.schemas.d.ts +5 -5
  27. package/dist/devices/devices.schemas.js +5 -5
  28. package/dist/devices/devices.service.d.ts +188 -175
  29. package/dist/devices/devices.service.js +284 -292
  30. package/dist/devices/dto.d.ts +43 -23
  31. package/dist/devices/dto.js +45 -49
  32. package/dist/devices/project-rules.d.ts +0 -10
  33. package/dist/devices/project-rules.js +0 -5
  34. package/dist/errors.d.ts +24 -19
  35. package/dist/errors.js +24 -19
  36. package/dist/evals/reconstruct.d.ts +12 -3
  37. package/dist/evals/reconstruct.js +10 -6
  38. package/dist/evals/recorded-permission-context.d.ts +6 -4
  39. package/dist/evals/recorded-permission-context.js +15 -9
  40. package/dist/evals/run-replay.d.ts +6 -1
  41. package/dist/evals/run-replay.js +7 -2
  42. package/dist/evals/worker.js +3 -1
  43. package/dist/identity/settings.d.ts +45 -18
  44. package/dist/identity/settings.js +151 -51
  45. package/dist/infra/config/kernel-config.service.d.ts +1 -1
  46. package/dist/infra/config/kernel-config.service.js +17 -5
  47. package/dist/local-devices/device-auth.controller.d.ts +1 -1
  48. package/dist/local-devices/device-auth.controller.js +1 -1
  49. package/dist/local-devices/device-auth.d.ts +4 -4
  50. package/dist/local-devices/device-auth.js +1 -1
  51. package/dist/local-devices/device-policy.service.d.ts +18 -9
  52. package/dist/local-devices/device-policy.service.js +21 -61
  53. package/dist/local-devices/device-routes.d.ts +3 -1
  54. package/dist/local-devices/device-routes.js +15 -4
  55. package/dist/local-devices/instance-bindings.js +5 -2
  56. package/dist/local-devices/local-device-gateway.d.ts +2 -2
  57. package/dist/local-devices/local-device-gateway.js +3 -3
  58. package/dist/local-devices/local-device-provider.d.ts +4 -4
  59. package/dist/local-devices/local-device-provider.js +23 -9
  60. package/dist/local-devices/local-devices.module.d.ts +1 -1
  61. package/dist/local-devices/local-devices.module.js +1 -1
  62. package/dist/local-devices/machines.d.ts +40 -16
  63. package/dist/local-devices/machines.js +89 -61
  64. package/dist/local-devices/owner-report.d.ts +16 -14
  65. package/dist/local-devices/owner-report.js +24 -30
  66. package/dist/local-devices/owner-reports.js +26 -8
  67. package/dist/local-devices/policy-summary.d.ts +25 -44
  68. package/dist/local-devices/policy-summary.js +26 -71
  69. package/dist/local-devices/relay.d.ts +6 -6
  70. package/dist/local-devices/relay.js +10 -8
  71. package/dist/net/public-address.d.ts +1 -1
  72. package/dist/net/public-address.js +5 -2
  73. package/dist/orgs/device-network-setting.d.ts +82 -0
  74. package/dist/orgs/device-network-setting.js +142 -0
  75. package/dist/orgs/settings.service.d.ts +103 -66
  76. package/dist/orgs/settings.service.js +201 -137
  77. package/dist/overrides.d.ts +5 -1
  78. package/dist/overrides.js +2 -0
  79. package/dist/platform/exclusions.js +1 -1
  80. package/dist/platform/operation.js +1 -1
  81. package/dist/platform/ops/admin.ops.js +20 -11
  82. package/dist/platform/ops/devices.ops.js +70 -5
  83. package/dist/platform/ops/org-settings.ops.js +10 -6
  84. package/dist/platform/ops/orgs.ops.js +2 -1
  85. package/dist/runtime/context/permission-profile.d.ts +17 -8
  86. package/dist/runtime/context/permission-profile.js +126 -45
  87. package/dist/runtime/permission-context.service.d.ts +1 -1
  88. package/dist/runtime/permission-context.service.js +5 -3
  89. package/dist/runtime/project/knowledge.d.ts +5 -4
  90. package/dist/runtime/project/knowledge.js +2 -1
  91. package/dist/runtime/project/knowledge.service.js +16 -13
  92. package/dist/sandbox/cloud-permission-snapshot.js +22 -3
  93. package/dist/sandbox/device-sandbox-settings.d.ts +230 -0
  94. package/dist/sandbox/device-sandbox-settings.js +470 -0
  95. package/dist/sandbox/device-sandbox.d.ts +187 -0
  96. package/dist/sandbox/device-sandbox.js +236 -0
  97. package/dist/sandbox/held-operations.js +15 -7
  98. package/dist/sandbox/modes.d.ts +49 -24
  99. package/dist/sandbox/modes.js +27 -19
  100. package/dist/sandbox/operation-authority-types.d.ts +6 -5
  101. package/dist/sandbox/operation-authority-types.js +7 -8
  102. package/dist/sandbox/operation-authority.d.ts +23 -9
  103. package/dist/sandbox/operation-authority.js +179 -97
  104. package/dist/sandbox/permission-auto-grants.d.ts +42 -0
  105. package/dist/sandbox/permission-auto-grants.js +145 -0
  106. package/dist/sandbox/permission-call-grants.d.ts +12 -4
  107. package/dist/sandbox/permission-call-grants.js +84 -35
  108. package/dist/sandbox/permission-call-grants.module.js +10 -3
  109. package/dist/sandbox/permission-call-types.d.ts +39 -5
  110. package/dist/sandbox/permission-ceiling-writes.d.ts +29 -3
  111. package/dist/sandbox/permission-ceiling-writes.js +38 -4
  112. package/dist/sandbox/permission-config-publication.d.ts +44 -2
  113. package/dist/sandbox/permission-config-publication.js +230 -59
  114. package/dist/sandbox/permission-context-types.d.ts +2 -2
  115. package/dist/sandbox/permission-facts.d.ts +144 -15
  116. package/dist/sandbox/permission-facts.js +258 -70
  117. package/dist/sandbox/permission-runtime-reports.d.ts +5 -4
  118. package/dist/sandbox/permission-runtime-reports.js +19 -29
  119. package/dist/sandbox/review/classifier.d.ts +8 -0
  120. package/dist/sandbox/review/classifier.js +10 -0
  121. package/dist/sandbox/review/permission-candidate.d.ts +69 -5
  122. package/dist/sandbox/review/permission-candidate.js +153 -30
  123. package/dist/sandbox/review/review.service.d.ts +19 -3
  124. package/dist/sandbox/review/review.service.js +59 -11
  125. package/dist/sandbox/review/rules.js +23 -3
  126. package/dist/sandbox/sandbox.service.d.ts +29 -11
  127. package/dist/sandbox/sandbox.service.js +51 -26
  128. package/dist/skills/invoke.js +3 -2
  129. package/dist/tools/approvals.service.d.ts +26 -116
  130. package/dist/tools/approvals.service.js +42 -346
  131. package/dist/tools/builtins/sandbox/bash.d.ts +16 -3
  132. package/dist/tools/builtins/sandbox/bash.js +80 -28
  133. package/dist/tools/builtins/sandbox/common.d.ts +39 -14
  134. package/dist/tools/builtins/sandbox/common.js +47 -24
  135. package/dist/tools/builtins/sandbox/deliver.js +7 -4
  136. package/dist/tools/builtins/skill-load.d.ts +2 -2
  137. package/dist/tools/builtins/skill-load.js +4 -3
  138. package/dist/tools/device-op-resolver.d.ts +4 -10
  139. package/dist/tools/device-op-resolver.js +8 -19
  140. package/dist/tools/network-asks.d.ts +52 -15
  141. package/dist/tools/network-asks.js +55 -25
  142. package/dist/tools/pipeline.d.ts +26 -14
  143. package/dist/tools/pipeline.js +144 -61
  144. package/dist/tools/registry.d.ts +6 -0
  145. package/dist/tools/tools.module.js +1 -1
  146. package/package.json +4 -4
  147. package/src/migrations/0165_device_network_columns.sql +50 -0
  148. package/src/migrations/0166_permission_grant_full_access.sql +17 -0
  149. package/src/migrations/0167_device_network_backfill.sql +32 -0
  150. package/src/migrations/0168_binding_installed_connection.sql +6 -0
  151. package/dist/orgs/cloud-network-setting.d.ts +0 -33
  152. package/dist/orgs/cloud-network-setting.js +0 -47
  153. package/dist/sandbox/platform-full-access.d.ts +0 -110
  154. package/dist/sandbox/platform-full-access.js +0 -198
@@ -7,10 +7,11 @@ import { KernelConfigService } from "../infra/config/kernel-config.service.js";
7
7
  import { KernelDb } from "../infra/database/kernel-db.js";
8
8
  import { TransactionHost } from "../infra/database/transaction-host.js";
9
9
  import type { KernelLogger } from "../log.js";
10
+ import { type DeviceNetworkMode } from "../sandbox/device-sandbox.js";
11
+ import { type DevicesNetworkView, type DevicesOutsideSandboxView } from "../sandbox/device-sandbox-settings.js";
10
12
  import { PermissionCeilingWrites } from "../sandbox/permission-ceiling-writes.js";
11
- import { type DevicesFullAccessView } from "../sandbox/platform-full-access.js";
12
13
  import { type ExternalSharingView } from "../shares/settings.js";
13
- import { type CloudNetworkSetting } from "./cloud-network-setting.js";
14
+ import { type DeviceNetworkSetting } from "./device-network-setting.js";
14
15
  import { OrgLock } from "./org-lock.js";
15
16
  /**
16
17
  * Org settings (`capybara.orgs.settings` jsonb). Read leniently: a missing or invalid field reads
@@ -25,13 +26,16 @@ import { OrgLock } from "./org-lock.js";
25
26
  * execution). An invalid stored value reads as `ask` (narrower, never wider) and is logged.
26
27
  * - `wakeOnBackgroundTask`: the org's override of `runtime.wakeOnBackgroundTask` (absent follows
27
28
  * the deployment), see {@link effectiveWakeOnBackgroundTask}.
28
- * - `fullAccess`: whether devices of the org may run with Full permission (permission runtime
29
- * cutover B1, replacing `autoMode`); absent follows the platform's `devices.fullAccess`, and an
30
- * invalid stored value reads as `off` (narrower, never wider). Setting `allowed` while the
31
- * platform is `off` is refused.
32
- * - `cloudNetwork`: the org's sandbox-mode network as a delta over the platform's allowlist (org
33
- * egress ceiling spec §D1, {@link CloudNetworkSettingSchema}). An invalid stored value reads as
34
- * `{ mode: "allowlist", base: "none" }`, the empty allowlist (narrower, never wider).
29
+ * - `outsideSandbox`: whether devices of the org may be granted running a call outside their
30
+ * sandbox (approval-only profiles design, replacing `fullAccess`); absent follows the platform's
31
+ * `devices.outsideSandbox`, and an invalid stored value reads as `off` (narrower, never wider).
32
+ * Setting `allowed` while the platform is `off` is refused.
33
+ * - `deviceNetwork`: the org's device sandbox network, its default and ceiling and its hosts as a
34
+ * delta over the platform's allowlist ({@link DeviceNetworkSettingSchema}, replacing
35
+ * `cloudNetwork`). An invalid stored value reads as the empty allowlist (narrower, never wider);
36
+ * a default or ceiling above the platform's ceiling is refused.
37
+ * Old keys are read and kept in step until the permission configuration publication converts
38
+ * them ({@link orgDeviceSandboxOf}).
35
39
  * - `platformTool`: the `Platform` builtin for the whole org (Platform tool spec §3): `on`,
36
40
  * `read-only` (writes listed as unavailable) or `off` (default `on`).
37
41
  * - `timeZone`: the org's default time zone (IANA; absent = UTC) for senders without one of their
@@ -43,12 +47,12 @@ import { OrgLock } from "./org-lock.js";
43
47
  * - `gitGateway`: the org's git gateway switch and host sources (sandbox git credentials spec §9);
44
48
  * not in the PATCH yet; an invalid stored value reads as `{ enabled: false }` (fails closed).
45
49
  */
46
- export { type CloudNetworkSetting, CloudNetworkSettingSchema, invalidCloudNetwork, ORG_SANDBOX_ALLOW_HOSTS_MAX, } from "./cloud-network-setting.js";
50
+ export { type DeviceNetworkSetting, DeviceNetworkSettingSchema, invalidDeviceNetwork, ORG_SANDBOX_ALLOW_HOSTS_MAX, } from "./device-network-setting.js";
47
51
  /**
48
- * The org's Full permission switch (B1): `allowed` or `off`; absent follows the platform's
49
- * `devices.fullAccess`. An invalid stored value reads as `off` (narrower, never wider).
52
+ * The org's outside-sandbox ceiling: `allowed` or `off`; absent follows the platform's
53
+ * `devices.outsideSandbox`. An invalid stored value reads as `off` (narrower, never wider).
50
54
  */
51
- export declare const FullAccessSetting: z.ZodEnum<{
55
+ export declare const OutsideSandboxSetting: z.ZodEnum<{
52
56
  allowed: "allowed";
53
57
  off: "off";
54
58
  }>;
@@ -143,12 +147,16 @@ export declare const OrgSettingsSchema: z.ZodObject<{
143
147
  on: "on";
144
148
  "read-only": "read-only";
145
149
  }>>>;
146
- fullAccess: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
150
+ outsideSandbox: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
147
151
  allowed: "allowed";
148
152
  off: "off";
149
153
  }>>>;
150
- cloudNetwork: z.ZodCatch<z.ZodOptional<z.ZodObject<{
151
- mode: z.ZodOptional<z.ZodEnum<{
154
+ deviceNetwork: z.ZodCatch<z.ZodOptional<z.ZodObject<{
155
+ default: z.ZodOptional<z.ZodEnum<{
156
+ allowlist: "allowlist";
157
+ open: "open";
158
+ }>>;
159
+ ceiling: z.ZodOptional<z.ZodEnum<{
152
160
  allowlist: "allowlist";
153
161
  open: "open";
154
162
  }>>;
@@ -236,12 +244,16 @@ export declare const OrgSettingsPatchSchema: z.ZodObject<{
236
244
  "read-only": "read-only";
237
245
  }>>;
238
246
  wakeOnBackgroundTask: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
239
- fullAccess: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
247
+ outsideSandbox: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
240
248
  allowed: "allowed";
241
249
  off: "off";
242
250
  }>>>;
243
- cloudNetwork: z.ZodOptional<z.ZodNullable<z.ZodObject<{
244
- mode: z.ZodOptional<z.ZodEnum<{
251
+ deviceNetwork: z.ZodOptional<z.ZodNullable<z.ZodObject<{
252
+ default: z.ZodOptional<z.ZodEnum<{
253
+ allowlist: "allowlist";
254
+ open: "open";
255
+ }>>;
256
+ ceiling: z.ZodOptional<z.ZodEnum<{
245
257
  allowlist: "allowlist";
246
258
  open: "open";
247
259
  }>>;
@@ -300,10 +312,10 @@ export declare function effectiveWakeOnBackgroundTask(deployment: boolean, org:
300
312
  * setting `sandboxLimitOverrides[orgId]`) replaces the deployment's cpu / memoryMb; fields it does
301
313
  * not give, disk and the network, stay as in `deployment`. Read only when an instance is created.
302
314
  */
303
- export declare function effectiveSandboxLimits(deployment: SandboxLimits, override: {
315
+ export declare function effectiveSandboxLimits<L extends SandboxLimits>(deployment: L, override: {
304
316
  cpu?: number | undefined;
305
317
  memoryMb?: number | undefined;
306
- } | undefined): SandboxLimits;
318
+ } | undefined): L;
307
319
  /** 组织设置 GET 带回的只读沙箱限额:实际生效值与来源(有超级管理员的覆盖为 `override`)。 */
308
320
  export interface OrgSandboxLimits {
309
321
  cpu: number;
@@ -317,14 +329,14 @@ export interface OrgEffectiveNetwork {
317
329
  }
318
330
  /** The deployment defaults the settings page shows for "follow the platform" (`GET` returns them). */
319
331
  export interface OrgSettingsDeployment {
320
- /** The platform's Full permission switch and where it comes from. */
321
- fullAccess: DevicesFullAccessView;
332
+ /** The platform's outside-sandbox ceiling and where it comes from. */
333
+ outsideSandbox: DevicesOutsideSandboxView;
322
334
  /**
323
- * The platform's network: its allowlist (what an org's delta applies to), whether orgs may go
324
- * beyond it (`sandbox.limits.orgHosts`) and the kill switch (`off`: `sandbox.limits.egress` is
325
- * `none`).
335
+ * The platform's device network: its default and ceiling with their sources, its allowlist
336
+ * (what an org's delta applies to), whether orgs may go beyond it (`sandbox.limits.orgHosts`)
337
+ * and the kill switch (`off`: `sandbox.limits.egress` is `none`).
326
338
  */
327
- cloudNetwork: {
339
+ deviceNetwork: DevicesNetworkView & {
328
340
  allowHosts: string[];
329
341
  orgHosts: "extend" | "within";
330
342
  off: boolean;
@@ -346,9 +358,9 @@ export interface OrgSettingsDeployment {
346
358
  promptSuggestions: "on" | "off";
347
359
  }
348
360
  /**
349
- * Parses the stored jsonb into settings (leniently, see {@link OrgSettingsSchema}). `fullAccess` is
350
- * read over both keys, the narrower of it and an old `autoMode` the permission configuration
351
- * publication has not converted yet ({@link narrowedOrgFullAccess}; fail closed).
361
+ * Parses the stored jsonb into settings (leniently, see {@link OrgSettingsSchema}).
362
+ * `outsideSandbox` and `deviceNetwork` are read over the new and the old keys the permission
363
+ * configuration publication has not converted yet ({@link orgDeviceSandboxOf}; fail closed).
352
364
  */
353
365
  export declare function parseOrgSettings(raw: unknown): OrgSettings;
354
366
  /** The org's stored settings jsonb, read live; undefined when the org is missing or deleted. */
@@ -383,70 +395,92 @@ export declare function logUnreadableSecuritySettings(log: (msg: string, fields:
383
395
  export declare function invalidStoredExternalSharing(raw: unknown): boolean;
384
396
  /** Whether a stored settings object holds a `promptSuggestions` this version reads as `off`. */
385
397
  export declare function invalidStoredPromptSuggestions(raw: unknown): boolean;
386
- /** Whether a stored settings object holds a `fullAccess` this version reads as `off`. */
387
- export declare function invalidStoredFullAccess(raw: unknown): boolean;
388
- /** Whether a stored settings object holds a `cloudNetwork` this version reads as an empty allowlist. */
389
- export declare function invalidStoredCloudNetwork(raw: unknown): boolean;
398
+ /** Whether a stored settings object holds an `outsideSandbox` this version reads as `off`. */
399
+ export declare function invalidStoredOutsideSandbox(raw: unknown): boolean;
400
+ /** Whether a stored settings object holds a `deviceNetwork` this version reads as an empty allowlist. */
401
+ export declare function invalidStoredDeviceNetwork(raw: unknown): boolean;
402
+ /**
403
+ * Whether `next`'s default or ceiling (absent: follow the platform, read as open, the widest the
404
+ * platform may relax to) opens where `prev`'s is the allowlist.
405
+ */
406
+ export declare function deviceNetworkModeWidens(prev: DeviceNetworkSetting | undefined, next: DeviceNetworkSetting | undefined): "default" | "ceiling" | null;
407
+ /** The org's effective network default and ceiling: its own, within the platform's. */
408
+ export declare function effectiveOrgNetwork(platform: {
409
+ default: DeviceNetworkMode;
410
+ ceiling: DeviceNetworkMode;
411
+ }, org: DeviceNetworkSetting | undefined): {
412
+ default: DeviceNetworkMode;
413
+ ceiling: DeviceNetworkMode;
414
+ };
415
+ /** Which effective field opens from `a` to `b`, if any. */
416
+ export declare function effectiveNetworkWidens(a: {
417
+ default: DeviceNetworkMode;
418
+ ceiling: DeviceNetworkMode;
419
+ }, b: {
420
+ default: DeviceNetworkMode;
421
+ ceiling: DeviceNetworkMode;
422
+ }): "default" | "ceiling" | null;
390
423
  /**
391
- * Whether `next` (absent: follow the platform) widens `prev` (spec §D3), both normalized (mode
392
- * open, base platform, empty lists): the open mode where it was the allowlist; base none to
393
- * platform; with base platform, dropping one of the stored exclusions; an extra host no stored
394
- * extra covers. Over-strict on purpose: moving to base none with a platform entry as an extra is a
395
- * narrowing these rules refuse (a token cannot pin a platform host the platform may drop later).
424
+ * Whether `next`'s hosts (absent: follow the platform) widen `prev`'s (org egress ceiling spec
425
+ * §D3), both normalized (base platform, empty lists): base none to platform; with base platform,
426
+ * dropping one of the stored exclusions; an extra host no stored extra covers. Over-strict on
427
+ * purpose: moving to base none with a platform entry as an extra is a narrowing these rules refuse
428
+ * (a token cannot pin a platform host the platform may drop later).
396
429
  */
397
- export declare function cloudNetworkWidens(prev: CloudNetworkSetting | undefined, next: CloudNetworkSetting | undefined): boolean;
398
- /** 组织设置服务:读取与修改(修改需 `org.update`,锁内实时复核角色,写审计)。 */
430
+ export declare function deviceNetworkHostsWiden(prev: DeviceNetworkSetting | undefined, next: DeviceNetworkSetting | undefined): boolean;
431
+ /** Org settings: read and update (an update needs `org.update`, re-checks the role under the lock and is audited). */
399
432
  export declare class OrgSettingsService {
400
433
  private readonly db;
401
434
  readonly txHost: TransactionHost;
402
435
  private readonly orgLock;
403
436
  /**
404
- * The deployment config: `sandbox.limits` and the platform's Full switch
405
- * (`devices.fullAccess`; the org may follow it, never exceed it).
437
+ * The deployment config: `sandbox.limits` and the platform's device sandbox settings
438
+ * (`devices.outsideSandbox`, `devices.network`; the org may follow them, never exceed them).
406
439
  */
407
440
  private readonly config;
408
441
  private readonly ceilings;
409
442
  private readonly log?;
410
443
  constructor(db: KernelDb, txHost: TransactionHost, orgLock: OrgLock,
411
444
  /**
412
- * The deployment config: `sandbox.limits` and the platform's Full switch
413
- * (`devices.fullAccess`; the org may follow it, never exceed it).
445
+ * The deployment config: `sandbox.limits` and the platform's device sandbox settings
446
+ * (`devices.outsideSandbox`, `devices.network`; the org may follow them, never exceed them).
414
447
  */
415
448
  config: Pick<KernelConfigService, "get" | "fieldSource">, ceilings: PermissionCeilingWrites, log?: KernelLogger | undefined);
416
- /** Parses stored settings, warning when an invalid `fullAccess` narrows to `off`, an invalid
417
- * `cloudNetwork` to an empty allowlist, or a security setting reads narrower
449
+ /** Parses stored settings, warning when an invalid `outsideSandbox` narrows to `off`, an
450
+ * invalid `deviceNetwork` to an empty allowlist, or a security setting reads narrower
418
451
  * ({@link logUnreadableSecuritySettings}, warn). */
419
452
  private parseStored;
420
- /** 部署默认值(设置页展示「跟随部署」时的实际取值)。 */
453
+ /** The deployment defaults (what "follow the platform" means on the settings page). */
421
454
  deployment(): Promise<OrgSettingsDeployment>;
422
455
  /** Whether prompt suggestions run for the org now: one read of the platform and of the org. */
423
456
  promptSuggestionsEnabled(orgId: string): Promise<boolean>;
424
457
  /**
425
- * The org's effective sandbox-mode network (spec §D3): the cloud network's mode and the hosts,
426
- * from the platform's `sandbox.limits` and the org's stored delta.
458
+ * The org's effective sandbox network (spec §D3): its mode and the hosts, from the platform's
459
+ * `sandbox.limits` and the org's stored delta.
427
460
  */
428
- effectiveNetwork(settings: Pick<OrgSettings, "cloudNetwork">): OrgEffectiveNetwork;
461
+ effectiveNetwork(settings: Pick<OrgSettings, "deviceNetwork">): OrgEffectiveNetwork;
429
462
  /** 组织实际生效的沙箱 cpu / 内存(只读;由超级管理员在部署设置里覆盖)。 */
430
463
  sandboxLimits(orgId: string): Promise<OrgSandboxLimits>;
431
464
  get(orgId: string): Promise<OrgSettingsView>;
432
465
  /**
433
466
  * The refusals of {@link update} that need no read of the org (the Platform tool's precheck):
434
- * auto mode where the platform turned it off, external sharing where the platform denies it.
467
+ * running outside the sandbox where the platform turned it off, a network default or ceiling
468
+ * above the platform's ceiling, external sharing where the platform denies it.
435
469
  */
436
470
  check(patch: OrgSettingsPatch): Promise<void>;
437
471
  /**
438
- * Under `sandbox.limits.orgHosts: within` (spec §D2), refuses what would widen past the platform
439
- * ceiling compared with the stored value `before`: the open cloud network where the org did not
440
- * store it, or an extra host outside the platform's allowlist that the org did not store. Stored
441
- * values are sent back as they are (the PATCH replaces `cloudNetwork` whole) and have no effect
442
- * under the ceiling (they are filtered on read), so they never block a write.
472
+ * Under `sandbox.limits.orgHosts: within` (spec §D2), refuses an extra host outside the
473
+ * platform's allowlist that the org did not store. Stored values are sent back as they are (the
474
+ * PATCH replaces `deviceNetwork` whole) and have no effect under the ceiling (they are filtered on
475
+ * read), so they never block a write. Whether the network may be open is the network ceiling's
476
+ * (`devices.network.ceiling`, {@link check}), not `orgHosts`'.
443
477
  */
444
478
  assertWithinCeiling(before: OrgSettings, patch: OrgSettingsPatch): void;
445
479
  update(orgId: string, patch: OrgSettingsPatch, actorAccountId: string, actorTokenId?: string,
446
480
  /** Merged into the audit detail (the Platform tool's `via: "agent"`). */
447
481
  auditDetail?: Record<string, unknown>,
448
482
  /**
449
- * `onlyNarrows` (the Platform tool, API tokens): refuse a `fullAccess`, `cloudNetwork` or
483
+ * `onlyNarrows` (the Platform tool, API tokens): refuse an `outsideSandbox`, `deviceNetwork` or
450
484
  * `externalSharing` change that widens (see {@link assertOnlyNarrows}); only a person in a
451
485
  * session widens.
452
486
  */
@@ -455,13 +489,16 @@ export declare class OrgSettingsService {
455
489
  }): Promise<OrgSettingsView>;
456
490
  private lockFor;
457
491
  /**
458
- * Refuses a patch that widens the org's sandbox (auto mode spec §4.3: only a person widens it,
459
- * never the Platform tool or an API token):
460
- * - `fullAccess`: `allowed` where the organization runs `off` (an absent value follows the
461
- * platform); clearing it follows the platform too, never wider than the platform allows;
462
- * - `cloudNetwork`: compared as stored deltas ({@link cloudNetworkWidens}), never as effective
463
- * values: under the kill switch or the platform ceiling the effective values hide a widening
464
- * that takes effect when the platform relaxes (org egress ceiling spec §D3);
492
+ * Refuses a patch that widens the org's sandbox (only a person widens it, never the Platform tool
493
+ * or an API token):
494
+ * - `outsideSandbox`: `allowed` where the organization runs `off` (an absent value follows the
495
+ * platform); clearing it follows the platform too, never wider than the platform allows
496
+ * (`org.outside_sandbox_not_allowed`);
497
+ * - `deviceNetwork`: compared as stored deltas, never as effective values (under the kill switch
498
+ * or a platform ceiling the effective values hide a widening that takes effect when the
499
+ * platform relaxes, org egress ceiling spec §D3): a default or ceiling opened
500
+ * ({@link deviceNetworkModeWidens}, `org.network_not_allowed`) or wider hosts
501
+ * ({@link deviceNetworkHostsWiden}, `org.sandbox_egress_not_allowed`);
465
502
  * - `externalSharing`: `on` where the org is off (absent = off).
466
503
  */
467
504
  assertOnlyNarrows(before: OrgSettings, patch: OrgSettingsPatch): Promise<void>;
@@ -469,7 +506,7 @@ export declare class OrgSettingsService {
469
506
  }
470
507
  /**
471
508
  * The one {@link OrgSettingsService}: the orgs module re-exports it, and the catalog imports it
472
- * directly (approving a network request writes the org's cloud network) without a cycle through
509
+ * directly (approving a network request writes the org's device network) without a cycle through
473
510
  * OrgsModule.
474
511
  */
475
512
  export declare class OrgSettingsModule {