@capybara-hq/kernel 0.1.0-rc.68 → 0.1.0-rc.69

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 (215) hide show
  1. package/dist/admin/admin.module.js +2 -0
  2. package/dist/admin/health.service.d.ts +11 -4
  3. package/dist/admin/health.service.js +33 -17
  4. package/dist/background/poll.job.js +2 -2
  5. package/dist/background/tasks.service.d.ts +5 -5
  6. package/dist/background/tasks.service.js +9 -8
  7. package/dist/catalog/marketplaces.service.d.ts +1 -1
  8. package/dist/catalog/requests.service.js +1 -1
  9. package/dist/config/schema.d.ts +1 -1
  10. package/dist/config/schema.js +9 -9
  11. package/dist/conversations/conversations.controller.d.ts +8 -3
  12. package/dist/conversations/conversations.controller.js +8 -3
  13. package/dist/conversations/conversations.service.d.ts +33 -15
  14. package/dist/conversations/conversations.service.js +60 -10
  15. package/dist/conversations/events.d.ts +21 -41
  16. package/dist/conversations/events.js +57 -31
  17. package/dist/conversations/permission-profiles.controller.d.ts +6 -4
  18. package/dist/conversations/permission-profiles.service.d.ts +6 -4
  19. package/dist/ctx/create-ctx.d.ts +20 -1
  20. package/dist/ctx/create-ctx.js +77 -6
  21. package/dist/ctx/device-provider-check.d.ts +6 -2
  22. package/dist/ctx/device-provider-check.js +17 -2
  23. package/dist/db/kernel-schema.d.ts +10 -48
  24. package/dist/devices/access.d.ts +3 -4
  25. package/dist/devices/access.js +3 -4
  26. package/dist/devices/conversation-devices.d.ts +1 -3
  27. package/dist/devices/conversation-devices.js +2 -7
  28. package/dist/devices/device-projects.service.js +24 -29
  29. package/dist/devices/device-provider-selection.d.ts +5 -6
  30. package/dist/devices/device-provider-selection.js +8 -9
  31. package/dist/devices/devices.controller.d.ts +8 -21
  32. package/dist/devices/devices.controller.js +9 -34
  33. package/dist/devices/devices.module.js +6 -4
  34. package/dist/devices/devices.schemas.d.ts +1 -5
  35. package/dist/devices/devices.schemas.js +1 -5
  36. package/dist/devices/devices.service.d.ts +84 -147
  37. package/dist/devices/devices.service.js +134 -229
  38. package/dist/devices/dto.d.ts +5 -32
  39. package/dist/devices/dto.js +5 -37
  40. package/dist/devices/errors.d.ts +6 -5
  41. package/dist/devices/errors.js +7 -8
  42. package/dist/devices/project-rules.d.ts +9 -11
  43. package/dist/devices/project-rules.js +7 -7
  44. package/dist/devices/working-root.d.ts +3 -6
  45. package/dist/devices/working-root.js +3 -8
  46. package/dist/dial-in/access.d.ts +23 -0
  47. package/dist/dial-in/access.js +64 -0
  48. package/dist/{local-devices/device-auth.controller.d.ts → dial-in/auth.controller.d.ts} +12 -6
  49. package/dist/{local-devices/device-auth.controller.js → dial-in/auth.controller.js} +30 -15
  50. package/dist/dial-in/auth.module.d.ts +7 -0
  51. package/dist/dial-in/auth.module.js +27 -0
  52. package/dist/{local-devices/device-auth.d.ts → dial-in/auth.service.d.ts} +42 -13
  53. package/dist/{local-devices/device-auth.js → dial-in/auth.service.js} +83 -32
  54. package/dist/dial-in/dial-in.module.d.ts +9 -0
  55. package/dist/dial-in/dial-in.module.js +37 -0
  56. package/dist/{local-devices → dial-in}/dto.d.ts +17 -2
  57. package/dist/{local-devices → dial-in}/dto.js +14 -2
  58. package/dist/dial-in/envelope.d.ts +95 -0
  59. package/dist/dial-in/envelope.js +89 -0
  60. package/dist/dial-in/gateway.d.ts +214 -0
  61. package/dist/{local-devices/local-device-gateway.js → dial-in/gateway.js} +337 -181
  62. package/dist/dial-in/handlers.d.ts +47 -0
  63. package/dist/dial-in/handlers.js +84 -0
  64. package/dist/dial-in/machines.d.ts +155 -0
  65. package/dist/dial-in/machines.js +383 -0
  66. package/dist/dial-in/relay.d.ts +135 -0
  67. package/dist/dial-in/relay.js +444 -0
  68. package/dist/dial-in/relay.module.d.ts +7 -0
  69. package/dist/dial-in/relay.module.js +24 -0
  70. package/dist/{local-devices/device-routes.d.ts → dial-in/routes.d.ts} +19 -11
  71. package/dist/{local-devices/device-routes.js → dial-in/routes.js} +45 -25
  72. package/dist/{local-devices → dial-in}/targets.d.ts +3 -18
  73. package/dist/{local-devices → dial-in}/targets.js +3 -48
  74. package/dist/errors.d.ts +8 -27
  75. package/dist/errors.js +8 -27
  76. package/dist/extensions/bootstrap.d.ts +5 -0
  77. package/dist/extensions/bootstrap.js +10 -1
  78. package/dist/extensions/extensions.module.js +6 -0
  79. package/dist/extensions/host.d.ts +6 -0
  80. package/dist/extensions/host.js +12 -2
  81. package/dist/extensions/permission-set.d.ts +15 -1
  82. package/dist/extensions/permission-set.js +11 -1
  83. package/dist/extensions/permission-view.d.ts +1 -1
  84. package/dist/extensions/permission-view.js +4 -1
  85. package/dist/http/api.module.js +4 -4
  86. package/dist/http/gateway-routes.d.ts +1 -1
  87. package/dist/http/gateway-routes.js +1 -1
  88. package/dist/http/meta.controller.js +1 -1
  89. package/dist/identity/settings.d.ts +1 -1
  90. package/dist/identity/settings.js +6 -8
  91. package/dist/infra/config/kernel-config.service.js +2 -2
  92. package/dist/infra/outbox/registry.d.ts +0 -14
  93. package/dist/infra/outbox/registry.js +0 -15
  94. package/dist/infra/throttler/named-throttlers.d.ts +1 -1
  95. package/dist/infra/throttler/named-throttlers.js +1 -1
  96. package/dist/kernel.module.js +0 -3
  97. package/dist/orgs/settings.service.js +5 -10
  98. package/dist/overrides.d.ts +0 -4
  99. package/dist/overrides.js +0 -2
  100. package/dist/platform/exclusions.js +5 -5
  101. package/dist/platform/ops/admin.ops.js +1 -1
  102. package/dist/platform/ops/conversations.ops.js +5 -2
  103. package/dist/platform/ops/devices.ops.js +11 -24
  104. package/dist/platform/ops/inbox.ops.js +1 -1
  105. package/dist/roles/gateway-role.d.ts +3 -3
  106. package/dist/roles/gateway-role.js +4 -4
  107. package/dist/roles/gateway.module.d.ts +1 -1
  108. package/dist/roles/gateway.module.js +5 -5
  109. package/dist/runtime/context/device-paths.d.ts +4 -1
  110. package/dist/runtime/context/permission-profile.js +5 -5
  111. package/dist/runtime/maintenance.d.ts +2 -5
  112. package/dist/runtime/maintenance.js +9 -19
  113. package/dist/runtime/project/knowledge.js +4 -5
  114. package/dist/runtime/project/knowledge.service.js +2 -1
  115. package/dist/sandbox/cloud-permission-snapshot.d.ts +1 -1
  116. package/dist/sandbox/cloud-permission-snapshot.js +1 -3
  117. package/dist/sandbox/device-reports.d.ts +74 -14
  118. package/dist/sandbox/device-reports.js +190 -33
  119. package/dist/sandbox/device-reports.module.d.ts +7 -0
  120. package/dist/sandbox/device-reports.module.js +25 -0
  121. package/dist/sandbox/device-sandbox.d.ts +39 -41
  122. package/dist/sandbox/device-sandbox.js +44 -83
  123. package/dist/sandbox/kernel-read.d.ts +2 -2
  124. package/dist/sandbox/legacy-retirement.d.ts +11 -59
  125. package/dist/sandbox/legacy-retirement.js +34 -186
  126. package/dist/sandbox/legacy-retirement.module.d.ts +2 -2
  127. package/dist/sandbox/legacy-retirement.module.js +2 -2
  128. package/dist/sandbox/managed-device-context.d.ts +16 -4
  129. package/dist/sandbox/managed-device-context.js +25 -8
  130. package/dist/sandbox/managed-device-context.module.js +4 -0
  131. package/dist/sandbox/modes.d.ts +3 -12
  132. package/dist/sandbox/modes.js +2 -14
  133. package/dist/{local-devices → sandbox}/network-grants.d.ts +2 -21
  134. package/dist/{local-devices → sandbox}/network-grants.js +4 -49
  135. package/dist/sandbox/operation-authority-types.d.ts +2 -1
  136. package/dist/sandbox/operation-authority.d.ts +6 -20
  137. package/dist/sandbox/operation-authority.js +43 -104
  138. package/dist/sandbox/operation-authority.module.js +1 -1
  139. package/dist/sandbox/operation-intents.d.ts +4 -1
  140. package/dist/sandbox/operation-intents.js +11 -2
  141. package/dist/sandbox/operation-reconcile.job.js +2 -4
  142. package/dist/sandbox/permission-availability.d.ts +6 -7
  143. package/dist/sandbox/permission-availability.js +7 -10
  144. package/dist/sandbox/permission-call-grants.d.ts +2 -1
  145. package/dist/sandbox/permission-call-grants.js +1 -7
  146. package/dist/sandbox/permission-call-types.d.ts +4 -4
  147. package/dist/sandbox/permission-ceiling-writes.d.ts +7 -23
  148. package/dist/sandbox/permission-ceiling-writes.js +8 -35
  149. package/dist/sandbox/permission-config-publication.d.ts +9 -1
  150. package/dist/sandbox/permission-config-publication.js +29 -21
  151. package/dist/sandbox/permission-context-types.d.ts +17 -10
  152. package/dist/sandbox/permission-facts.d.ts +98 -95
  153. package/dist/sandbox/permission-facts.js +160 -314
  154. package/dist/sandbox/permission-instance-writes.d.ts +23 -37
  155. package/dist/sandbox/permission-instance-writes.js +44 -121
  156. package/dist/sandbox/permission-runtime-reports.d.ts +38 -30
  157. package/dist/sandbox/permission-runtime-reports.js +105 -122
  158. package/dist/sandbox/providers.d.ts +26 -38
  159. package/dist/sandbox/providers.js +36 -18
  160. package/dist/sandbox/request-not-sent.d.ts +2 -13
  161. package/dist/sandbox/request-not-sent.js +2 -13
  162. package/dist/sandbox/review/permission-candidate.d.ts +13 -8
  163. package/dist/sandbox/review/permission-candidate.js +38 -48
  164. package/dist/sandbox/sandbox.module.js +7 -3
  165. package/dist/sandbox/sandbox.service.d.ts +49 -59
  166. package/dist/sandbox/sandbox.service.js +139 -259
  167. package/dist/schedules/fire.d.ts +15 -6
  168. package/dist/schedules/fire.js +27 -13
  169. package/dist/schedules/grant-rules.js +1 -1
  170. package/dist/schedules/scheduled-tasks.service.d.ts +0 -7
  171. package/dist/schedules/scheduled-tasks.service.js +1 -4
  172. package/dist/schedules/schedules.module.js +5 -3
  173. package/dist/skills/invoke.d.ts +1 -1
  174. package/dist/skills/invoke.js +2 -3
  175. package/dist/tools/approvals.service.d.ts +8 -5
  176. package/dist/tools/approvals.service.js +5 -5
  177. package/dist/tools/builtins/sandbox/bash.js +1 -2
  178. package/dist/tools/builtins/sandbox/common.d.ts +15 -9
  179. package/dist/tools/builtins/sandbox/common.js +37 -38
  180. package/dist/tools/network-asks.d.ts +19 -22
  181. package/dist/tools/network-asks.js +15 -21
  182. package/dist/tools/pipeline.d.ts +6 -7
  183. package/dist/tools/pipeline.js +17 -21
  184. package/dist/tools/tools.module.js +3 -7
  185. package/package.json +3 -4
  186. package/src/migrations/0177_dial_in_contract.sql +32 -0
  187. package/dist/local-devices/device-auth.module.d.ts +0 -7
  188. package/dist/local-devices/device-auth.module.js +0 -25
  189. package/dist/local-devices/device-policy.service.d.ts +0 -213
  190. package/dist/local-devices/device-policy.service.js +0 -605
  191. package/dist/local-devices/instance-bindings.d.ts +0 -82
  192. package/dist/local-devices/instance-bindings.js +0 -307
  193. package/dist/local-devices/local-device-gateway.d.ts +0 -153
  194. package/dist/local-devices/local-device-provider.d.ts +0 -122
  195. package/dist/local-devices/local-device-provider.js +0 -326
  196. package/dist/local-devices/local-devices.module.d.ts +0 -31
  197. package/dist/local-devices/local-devices.module.js +0 -100
  198. package/dist/local-devices/machines.d.ts +0 -211
  199. package/dist/local-devices/machines.js +0 -766
  200. package/dist/local-devices/owner-report.d.ts +0 -81
  201. package/dist/local-devices/owner-report.js +0 -150
  202. package/dist/local-devices/owner-reports.d.ts +0 -48
  203. package/dist/local-devices/owner-reports.js +0 -208
  204. package/dist/local-devices/policy-op-jobs.d.ts +0 -15
  205. package/dist/local-devices/policy-op-jobs.js +0 -12
  206. package/dist/local-devices/policy-summary.d.ts +0 -102
  207. package/dist/local-devices/policy-summary.js +0 -155
  208. package/dist/local-devices/relay.d.ts +0 -166
  209. package/dist/local-devices/relay.js +0 -559
  210. package/dist/tools/device-op-resolver.d.ts +0 -34
  211. package/dist/tools/device-op-resolver.js +0 -120
  212. /package/dist/{local-devices → dial-in}/keys.d.ts +0 -0
  213. /package/dist/{local-devices → dial-in}/keys.js +0 -0
  214. /package/dist/{local-devices → sandbox}/network-grants.module.d.ts +0 -0
  215. /package/dist/{local-devices → sandbox}/network-grants.module.js +0 -0
@@ -17,11 +17,11 @@ type Scope = DeviceProjectScope;
17
17
  */
18
18
  export interface WorkingFacts {
19
19
  /**
20
- * The device's workspace: the latest `device_paths` roots recorded in the calling conversation,
21
- * else the root's, else the machine's reported roots, else the default.
20
+ * The device's workspace: the held instance's committed roots, else the latest `device_paths`
21
+ * roots recorded in the calling conversation, else the root's, else the default.
22
22
  */
23
23
  workspace: string;
24
- /** The owner's home: the machine's reported home, else the workspace's home prefix; null: unknown. */
24
+ /** The owner's home: the provider's reported home, else the workspace's home prefix; null: unknown. */
25
25
  home: string | null;
26
26
  /** The root conversation's latest project snapshot; null: free, or none recorded yet. */
27
27
  project: WorkingProject | null;
@@ -35,37 +35,25 @@ export declare class PermissionFacts {
35
35
  private readonly devices;
36
36
  constructor(db: KernelDb, config: Pick<KernelConfigService, "get" | "fieldSource">, providers: Pick<DeviceProviders, "forDevice">, devices: Pick<DeviceAccess, "usable">);
37
37
  /**
38
- * Current policy, the device sandbox and persisted owner roots; access is checked by the caller.
39
- * `sandbox` is the device sandbox under the device's current runtime report (the provider layer
40
- * assumed before one is recorded), the same under every permission profile.
38
+ * Current policy and the device sandbox; access is checked by the caller. `sandbox` is the device
39
+ * sandbox under the device's current runtime report (else the support stored with its report,
40
+ * else the provider layer assumed before one is recorded), the same under every permission
41
+ * profile.
41
42
  */
42
43
  readDevice(orgId: string, deviceId: string): Promise<{
43
44
  policy: EffectiveDevicePolicy;
44
- owner: {
45
- state: "blocked" | "report";
46
- outsideSandbox: boolean;
47
- restrictedProjectReach: import("../local-devices/owner-report.js").RestrictedProjectReach;
48
- network: "allowlist" | "open";
49
- allowedDomains: string[];
50
- } | null;
51
45
  sandbox: DeviceSandbox;
52
46
  hostCeiling: HostGrantCeiling;
53
47
  hostRefusal: (host: string) => string | null;
54
- reach: {
55
- outsideSandbox: boolean;
56
- networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
57
- networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
58
- restrictedProjectReach: "os-user" | "workspace";
59
- hostCeiling: HostGrantCeiling;
60
- };
61
- roots: {} | null;
62
- home: string | null;
48
+ /** The provider's description of the device (its stored report, English), or null. */
49
+ description: string | null;
63
50
  }>;
64
51
  /**
65
52
  * The effective device sandbox (approval-only profiles design, "Settings model"): the platform,
66
- * org, device and provider layers read live and combined by {@link effectiveDeviceSandbox}. A
67
- * local device's layer is its owner's authenticated report (missing or blocked: fail closed,
68
- * nothing outside and the allowlist); a cloud device's is its stored network choice.
53
+ * org, device and provider layers read live and combined by {@link effectiveDeviceSandbox}, one
54
+ * path for every provider. The device layer is its stored network choice; the provider layer
55
+ * its current runtime report, else the support stored with its device report (device-provider
56
+ * spec §6.7), else the layer assumed before any ({@link providerLayerOf}).
69
57
  */
70
58
  deviceSandbox(orgId: string, deviceId: string, availability?: PermissionAvailability): Promise<DeviceSandbox>;
71
59
  /**
@@ -74,21 +62,31 @@ export declare class PermissionFacts {
74
62
  * crossing ceilings a Full access consent covers ({@link ConsentReach}).
75
63
  */
76
64
  deviceSandboxFacts(orgId: string, deviceId: string, availability?: PermissionAvailability,
77
- /** A cloud device's network as it would be stored (a change checked before it is written). */
78
- pendingCloud?: {
65
+ /** The device's network as it would be stored (a change checked before it is written). */
66
+ pending?: {
79
67
  networkMode: "open" | "allowlist" | "none" | null;
80
68
  networkHosts: string[];
81
- }): Promise<{
69
+ },
70
+ /**
71
+ * Which provider layer: `ceilings` (the support chain, {@link providerLayerOf}; the consent
72
+ * reach reads it too) or `lifecycle` (no support: the network an instance is created with is
73
+ * the device's own choice within the ceilings, never a support read after an earlier
74
+ * instance, so a support arriving never makes the next use recreate the instance; the
75
+ * provider enforces what it can).
76
+ */
77
+ layer?: "ceilings" | "lifecycle"): Promise<{
82
78
  box: DeviceSandbox;
83
79
  hostCeiling: HostGrantCeiling;
84
80
  /** The org's effective hosts: what a device's own host list may narrow, never add to. */
85
81
  orgHosts: string[];
86
82
  refusal: (host: string) => string | null;
83
+ description: string | null;
84
+ /** Its provider enforces a sandbox allowlist (its support): a blocked host may be asked about. */
85
+ allowlist: boolean;
87
86
  reach: {
88
87
  outsideSandbox: boolean;
89
88
  networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
90
89
  networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
91
- restrictedProjectReach: "os-user" | "workspace";
92
90
  hostCeiling: HostGrantCeiling;
93
91
  };
94
92
  }>;
@@ -106,11 +104,10 @@ export declare class PermissionFacts {
106
104
  } | null>;
107
105
  /**
108
106
  * The device's lifecycle policy: the kernel-internal mode tier (`auto` / `sandbox`, recorded with
109
- * a cloud instance's applied limits and deciding the working root's reach) and the network a
110
- * cloud instance is created with. A cloud device's network is its device sandbox network
111
- * ({@link deviceSandbox}); the B1 snapshot's `outer_network` is no longer read: migrations 0165
112
- * and 0167 and the snapshot writer copy an allowlist snapshot into the device's own network
113
- * choice (`network_mode`, `network_hosts`).
107
+ * an instance's applied limits) and the network an instance is created with: its device sandbox
108
+ * network ({@link deviceSandbox}), the same for every provider. The B1 snapshot's
109
+ * `outer_network` is no longer read: migrations 0165 and 0167 and the snapshot writer copy an
110
+ * allowlist snapshot into the device's own network choice (`network_mode`, `network_hosts`).
114
111
  */
115
112
  devicePolicy(device: {
116
113
  orgId: string;
@@ -124,22 +121,16 @@ export declare class PermissionFacts {
124
121
  */
125
122
  assertCloudReconciled(orgId: string, deviceId: string): Promise<void>;
126
123
  /**
127
- * Refuses new authority on a local device whose machine regressed its owner report sequence on
128
- * a new connection or sent conflicting reports (B2): only a valid current report or a new
129
- * login clears it. Late deliveries of older reports are ignored, never blocking.
124
+ * The mode tier a device chose: the narrower of its old switch and its B1 owner snapshot
125
+ * (`cloudChosenMode`), or null for a device that follows the platform and the org; `found`:
126
+ * a live device of the org. The tier is kernel-internal (instance limits); whether a call may
127
+ * run outside the sandbox is the device sandbox's.
130
128
  */
131
- assertOwnerReportUsable(orgId: string, deviceId: string): Promise<void>;
132
- /**
133
- * The mode tier a device chose: a local device's derived one (`ownerModeOf`: `auto` only when
134
- * its owner allows running outside the sandbox); a cloud device's narrower of its old switch and
135
- * its B1 owner snapshot (`cloudChosenMode`), or null for a cloud device that follows the
136
- * platform and the org. The tier is kernel-internal (instance limits, reach): a cloud device
137
- * never runs outside its sandbox.
138
- */
139
- private deviceChosenMode;
129
+ private chosenMode;
140
130
  /**
141
131
  * The device's current permission availability: the provider's capability shape, then the
142
- * runtime report recorded for its current identity. No probe or provider call.
132
+ * runtime report recorded for its current identity under the provider's version, the same for
133
+ * every provider. No probe or provider call.
143
134
  */
144
135
  private availability;
145
136
  readWorkingFacts({ orgId, rootConversationId, holderConversationId: conversationId, deviceId, }: {
@@ -161,11 +152,15 @@ export declare class PermissionFacts {
161
152
  workingProject(orgId: string, rootConversationId: string): Promise<WorkingProject | null>;
162
153
  /** The workspace root of a conversation's latest `device_paths` event, or null. */
163
154
  private recordedWorkspace;
155
+ /** The owner's home the device's provider last reported (`devices.report`), or null. */
156
+ private reportedHome;
164
157
  /**
165
- * The workspace root and the owner's home the device's active machine last reported, or null
166
- * (cloud: no machine).
158
+ * The owner's live device's project scope: whether its provider offers projects (it has
159
+ * `list`), the home its provider last reported (the base the picker starts from; null: none,
160
+ * the workspace) and the workspace as last known (the instance's handle). What a project path
161
+ * may be is the provider's rule (device-provider spec §6.1): it refuses one it will not serve,
162
+ * so the kernel narrows no path below a reported home.
167
163
  */
168
- private machineRoots;
169
164
  projectScope(orgId: string, accountId: string, deviceId: string): Promise<Scope>;
170
165
  resolveProjectForBinding(orgId: string, deviceId: string, accountId: string, name: string): Promise<{
171
166
  name: string;
@@ -181,18 +176,18 @@ export declare class PermissionFacts {
181
176
  outsideSandbox: boolean;
182
177
  networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
183
178
  networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
184
- restrictedProjectReach: "os-user" | "workspace";
185
179
  hostCeiling: HostGrantCeiling;
186
180
  };
187
181
  availability: PermissionAvailability;
188
- location: "cloud" | "local";
189
182
  sandbox: DeviceSandbox;
190
183
  outsideSandboxCeiling: boolean;
191
- broadProjectReach: boolean;
192
184
  }>;
193
185
  /**
194
186
  * The preview people see before choosing a profile: availability is the device-work verdict
195
- * ({@link deviceWorkAvailability}). Kernel callers only use it as a check.
187
+ * ({@link deviceWorkAvailability}). Kernel callers only use it as a check. `consentReach` is the
188
+ * reach an Auto consent confirmed against this `scopeRevision` records (the same layer as the
189
+ * crossing ceilings, whatever the runtime's state): the confirmation names exactly what it
190
+ * covers, never a guess from the runtime availability.
196
191
  */
197
192
  preview(orgId: string, accountId: string, deviceId: string, project?: string): Promise<{
198
193
  deviceId: string;
@@ -203,13 +198,10 @@ export declare class PermissionFacts {
203
198
  outsideSandbox: boolean;
204
199
  networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
205
200
  networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
206
- restrictedProjectReach: "os-user" | "workspace";
207
201
  hostCeiling: HostGrantCeiling;
208
202
  };
209
- location: "cloud" | "local";
210
203
  sandbox: DeviceSandbox;
211
204
  outsideSandboxCeiling: boolean;
212
- broadProjectReach: boolean;
213
205
  availability: PermissionAvailability;
214
206
  }>;
215
207
  view(orgId: string, accountId: string, row: PermissionRoot): Promise<{
@@ -224,7 +216,13 @@ export declare class PermissionFacts {
224
216
  scopeRevision: string | null;
225
217
  availability: PermissionAvailability;
226
218
  outsideSandboxCeiling: boolean;
227
- broadProjectReach: boolean;
219
+ /** What an Auto consent confirmed now records (the confirmation names exactly this). */
220
+ consentReach: {
221
+ outsideSandbox: boolean;
222
+ networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
223
+ networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
224
+ hostCeiling: HostGrantCeiling;
225
+ } | null;
228
226
  sandbox: DeviceSandbox | null;
229
227
  startingWorkNotice: string;
230
228
  }>;
@@ -245,7 +243,13 @@ export declare class PermissionFacts {
245
243
  } | null;
246
244
  scopeRevision: string | null;
247
245
  outsideSandboxCeiling: boolean;
248
- broadProjectReach: boolean;
246
+ /** What an Auto consent confirmed now records (the confirmation names exactly this). */
247
+ consentReach: {
248
+ outsideSandbox: boolean;
249
+ networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
250
+ networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
251
+ hostCeiling: HostGrantCeiling;
252
+ } | null;
249
253
  sandbox: DeviceSandbox | null;
250
254
  startingWorkNotice: string;
251
255
  }>;
@@ -256,7 +260,8 @@ export declare class PermissionFacts {
256
260
  */
257
261
  viewWithAccess(orgId: string, accountId: string, row: PermissionRoot): Promise<{
258
262
  access: "actor-device-access" | "device" | "no-device" | "provider-unavailable";
259
- location: "cloud" | "local" | null;
263
+ /** Whether the device's scope was read (a usable device): its availability is a verdict. */
264
+ previewed: boolean;
260
265
  view: {
261
266
  profile: PermissionProfile;
262
267
  revision: number;
@@ -269,20 +274,31 @@ export declare class PermissionFacts {
269
274
  scopeRevision: string | null;
270
275
  availability: PermissionAvailability;
271
276
  outsideSandboxCeiling: boolean;
272
- broadProjectReach: boolean;
277
+ /** What an Auto consent confirmed now records (the confirmation names exactly this). */
278
+ consentReach: {
279
+ outsideSandbox: boolean;
280
+ networkCeiling: "none" | import("./device-sandbox.js").DeviceNetworkMode;
281
+ networkMode: "none" | import("./device-sandbox.js").DeviceNetworkMode;
282
+ hostCeiling: HostGrantCeiling;
283
+ } | null;
273
284
  sandbox: DeviceSandbox | null;
274
285
  startingWorkNotice: string;
275
286
  };
276
287
  }>;
277
288
  /**
278
- * The installed environment of the device's current instance (B1 adapter over the Task 8 B4
279
- * installed binding and its current runtime attestation), read under the caller's device
280
- * authority lock. Null whenever it cannot be proved: no live instance (none, creating,
281
- * destroyed), no installed binding of exactly this generation, a binding of another provider or
282
- * machine, a runtime identity differing from the bound one, roots differing from the committed
283
- * ones. A cloud device proves it by its kernel-recorded cloud evidence instead (B-15,
284
- * {@link cloudAppliedLocked}). Never desired policy, never a provider call, probe, resume or
285
- * provisioning; a suspended instance is read as recorded.
289
+ * The installed environment of the device's current instance (B1 adapter), read under the
290
+ * caller's device authority lock: its provider's current runtime report recorded with the
291
+ * kernel-built identity ({@link readCurrentReport}, which binds the device's report revision),
292
+ * the same for every provider. Null whenever it cannot be proved: no live instance (none,
293
+ * creating, destroyed), an instance of another provider than the device's, roots differing from
294
+ * the committed ones, missing or stale evidence, desired limits waiting for a file reset
295
+ * (`unapplied`) and applied limits more permissive than the effective desired ones in any
296
+ * dimension (network kind, a host the desired allowlist does not cover; spec §124): a pending
297
+ * desired change is never projected as installed. Applied limits narrower than desired stand;
298
+ * the next use's lifecycle lease applies any change before admitting an operation, and its new
299
+ * limits change the identity, so that use records the evidence again. Never desired policy,
300
+ * never a provider call, probe, resume or provisioning; a suspended instance is read as
301
+ * recorded.
286
302
  */
287
303
  readAppliedEnvironmentLocked(input: {
288
304
  orgId: string;
@@ -298,43 +314,30 @@ export declare class PermissionFacts {
298
314
  deviceId: string;
299
315
  }): Promise<AppliedEnvironment | null>;
300
316
  private readAppliedEnvironment;
301
- /**
302
- * A cloud instance's installed environment (B-15, Q1 option A): its current runtime report
303
- * recorded with the kernel-built cloud identity (provider plugin and version, handle,
304
- * generation, applied limits; `readCurrentReport`), named by that report's identity hash in
305
- * place of a binding id. Null while the evidence is missing or stale, while desired limits wait
306
- * for a file reset (`unapplied`) and while the applied limits are more permissive than the
307
- * effective desired ones in any dimension (mode, network kind, a host the desired allowlist
308
- * does not cover; spec §124): a pending desired change is never projected as installed. Applied
309
- * limits narrower than desired stand (the outer boundary is the applied network, and restricted
310
- * hosts are cut to it); the next use's lifecycle lease applies any change before admitting an
311
- * operation, and its new limits change the identity, so that use records the evidence again.
312
- */
313
- private cloudAppliedLocked;
314
317
  }
315
318
  /**
316
- * The outer boundary a cloud instance's applied network proves: public addresses, or its exact
317
- * allowlist (empty: network disabled). Null when the allowlist cannot be stated as recorded
318
- * context hosts (a host that is not a normalized authority host, or more than the cap).
319
+ * The outer boundary an instance-boundary instance's applied network proves: public addresses, or
320
+ * its exact allowlist (empty: network disabled). Null when the allowlist cannot be stated as
321
+ * recorded context hosts (a host that is not a normalized authority host, or more than the cap).
319
322
  */
320
- export declare function cloudOuterNetwork(network: DeviceNetwork): AppliedOuterNetwork | null;
323
+ export declare function instanceOuterNetwork(network: DeviceNetwork): AppliedOuterNetwork | null;
321
324
  /**
322
- * Restricted hosts within a cloud instance's applied outer boundary (narrowing only): a host the
323
- * outer allowlist does not cover cannot be reached, so neither admission nor the recorded context
324
- * names it. A local device's host environment keeps every host.
325
+ * Restricted hosts within an instance's applied outer boundary (narrowing only): a host the outer
326
+ * allowlist does not cover cannot be reached, so neither admission nor the recorded context names
327
+ * it. An operation-boundary runtime's host environment keeps every host.
325
328
  */
326
329
  export declare function hostsWithinOuter(hosts: readonly string[], outer: AppliedOuterNetwork | undefined): string[];
327
330
  /**
328
- * The network a device sandbox gives a cloud instance's outer boundary: the open public internet,
329
- * or its allowlist (empty under the kill switch, which closes it).
331
+ * The network a device sandbox gives an instance's outer boundary: the open public internet, or
332
+ * its allowlist (empty under the kill switch, which closes it).
330
333
  */
331
334
  export declare function networkOfSandbox(box: DeviceSandbox): DeviceNetwork;
332
335
  /**
333
- * A cloud device's own sandbox network: its stored choice (`network_mode`, `network_hosts`; null
334
- * follows the org). A B1 snapshot is copied into it by migrations 0165 and 0167, the snapshot
335
- * writer and every publication (`copyCloudSnapshotNetworks`), never read here.
336
+ * A device's own sandbox network, whatever its provider: its stored choice (`network_mode`,
337
+ * `network_hosts`; null follows the org). A B1 snapshot is copied into it by migrations 0165 and
338
+ * 0167, the snapshot writer and every publication (`copyCloudSnapshotNetworks`), never read here.
336
339
  */
337
- export declare function cloudOwnNetwork(row: {
340
+ export declare function ownNetwork(row: {
338
341
  network_mode?: unknown;
339
342
  network_hosts?: unknown;
340
343
  } | undefined): {