@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.
- package/dist/admin/admin.module.js +2 -0
- package/dist/admin/health.service.d.ts +11 -4
- package/dist/admin/health.service.js +33 -17
- package/dist/background/poll.job.js +2 -2
- package/dist/background/tasks.service.d.ts +5 -5
- package/dist/background/tasks.service.js +9 -8
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/requests.service.js +1 -1
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/schema.js +9 -9
- package/dist/conversations/conversations.controller.d.ts +8 -3
- package/dist/conversations/conversations.controller.js +8 -3
- package/dist/conversations/conversations.service.d.ts +33 -15
- package/dist/conversations/conversations.service.js +60 -10
- package/dist/conversations/events.d.ts +21 -41
- package/dist/conversations/events.js +57 -31
- package/dist/conversations/permission-profiles.controller.d.ts +6 -4
- package/dist/conversations/permission-profiles.service.d.ts +6 -4
- package/dist/ctx/create-ctx.d.ts +20 -1
- package/dist/ctx/create-ctx.js +77 -6
- package/dist/ctx/device-provider-check.d.ts +6 -2
- package/dist/ctx/device-provider-check.js +17 -2
- package/dist/db/kernel-schema.d.ts +10 -48
- package/dist/devices/access.d.ts +3 -4
- package/dist/devices/access.js +3 -4
- package/dist/devices/conversation-devices.d.ts +1 -3
- package/dist/devices/conversation-devices.js +2 -7
- package/dist/devices/device-projects.service.js +24 -29
- package/dist/devices/device-provider-selection.d.ts +5 -6
- package/dist/devices/device-provider-selection.js +8 -9
- package/dist/devices/devices.controller.d.ts +8 -21
- package/dist/devices/devices.controller.js +9 -34
- package/dist/devices/devices.module.js +6 -4
- package/dist/devices/devices.schemas.d.ts +1 -5
- package/dist/devices/devices.schemas.js +1 -5
- package/dist/devices/devices.service.d.ts +84 -147
- package/dist/devices/devices.service.js +134 -229
- package/dist/devices/dto.d.ts +5 -32
- package/dist/devices/dto.js +5 -37
- package/dist/devices/errors.d.ts +6 -5
- package/dist/devices/errors.js +7 -8
- package/dist/devices/project-rules.d.ts +9 -11
- package/dist/devices/project-rules.js +7 -7
- package/dist/devices/working-root.d.ts +3 -6
- package/dist/devices/working-root.js +3 -8
- package/dist/dial-in/access.d.ts +23 -0
- package/dist/dial-in/access.js +64 -0
- package/dist/{local-devices/device-auth.controller.d.ts → dial-in/auth.controller.d.ts} +12 -6
- package/dist/{local-devices/device-auth.controller.js → dial-in/auth.controller.js} +30 -15
- package/dist/dial-in/auth.module.d.ts +7 -0
- package/dist/dial-in/auth.module.js +27 -0
- package/dist/{local-devices/device-auth.d.ts → dial-in/auth.service.d.ts} +42 -13
- package/dist/{local-devices/device-auth.js → dial-in/auth.service.js} +83 -32
- package/dist/dial-in/dial-in.module.d.ts +9 -0
- package/dist/dial-in/dial-in.module.js +37 -0
- package/dist/{local-devices → dial-in}/dto.d.ts +17 -2
- package/dist/{local-devices → dial-in}/dto.js +14 -2
- package/dist/dial-in/envelope.d.ts +95 -0
- package/dist/dial-in/envelope.js +89 -0
- package/dist/dial-in/gateway.d.ts +214 -0
- package/dist/{local-devices/local-device-gateway.js → dial-in/gateway.js} +337 -181
- package/dist/dial-in/handlers.d.ts +47 -0
- package/dist/dial-in/handlers.js +84 -0
- package/dist/dial-in/machines.d.ts +155 -0
- package/dist/dial-in/machines.js +383 -0
- package/dist/dial-in/relay.d.ts +135 -0
- package/dist/dial-in/relay.js +444 -0
- package/dist/dial-in/relay.module.d.ts +7 -0
- package/dist/dial-in/relay.module.js +24 -0
- package/dist/{local-devices/device-routes.d.ts → dial-in/routes.d.ts} +19 -11
- package/dist/{local-devices/device-routes.js → dial-in/routes.js} +45 -25
- package/dist/{local-devices → dial-in}/targets.d.ts +3 -18
- package/dist/{local-devices → dial-in}/targets.js +3 -48
- package/dist/errors.d.ts +8 -27
- package/dist/errors.js +8 -27
- package/dist/extensions/bootstrap.d.ts +5 -0
- package/dist/extensions/bootstrap.js +10 -1
- package/dist/extensions/extensions.module.js +6 -0
- package/dist/extensions/host.d.ts +6 -0
- package/dist/extensions/host.js +12 -2
- package/dist/extensions/permission-set.d.ts +15 -1
- package/dist/extensions/permission-set.js +11 -1
- package/dist/extensions/permission-view.d.ts +1 -1
- package/dist/extensions/permission-view.js +4 -1
- package/dist/http/api.module.js +4 -4
- package/dist/http/gateway-routes.d.ts +1 -1
- package/dist/http/gateway-routes.js +1 -1
- package/dist/http/meta.controller.js +1 -1
- package/dist/identity/settings.d.ts +1 -1
- package/dist/identity/settings.js +6 -8
- package/dist/infra/config/kernel-config.service.js +2 -2
- package/dist/infra/outbox/registry.d.ts +0 -14
- package/dist/infra/outbox/registry.js +0 -15
- package/dist/infra/throttler/named-throttlers.d.ts +1 -1
- package/dist/infra/throttler/named-throttlers.js +1 -1
- package/dist/kernel.module.js +0 -3
- package/dist/orgs/settings.service.js +5 -10
- package/dist/overrides.d.ts +0 -4
- package/dist/overrides.js +0 -2
- package/dist/platform/exclusions.js +5 -5
- package/dist/platform/ops/admin.ops.js +1 -1
- package/dist/platform/ops/conversations.ops.js +5 -2
- package/dist/platform/ops/devices.ops.js +11 -24
- package/dist/platform/ops/inbox.ops.js +1 -1
- package/dist/roles/gateway-role.d.ts +3 -3
- package/dist/roles/gateway-role.js +4 -4
- package/dist/roles/gateway.module.d.ts +1 -1
- package/dist/roles/gateway.module.js +5 -5
- package/dist/runtime/context/device-paths.d.ts +4 -1
- package/dist/runtime/context/permission-profile.js +5 -5
- package/dist/runtime/maintenance.d.ts +2 -5
- package/dist/runtime/maintenance.js +9 -19
- package/dist/runtime/project/knowledge.js +4 -5
- package/dist/runtime/project/knowledge.service.js +2 -1
- package/dist/sandbox/cloud-permission-snapshot.d.ts +1 -1
- package/dist/sandbox/cloud-permission-snapshot.js +1 -3
- package/dist/sandbox/device-reports.d.ts +74 -14
- package/dist/sandbox/device-reports.js +190 -33
- package/dist/sandbox/device-reports.module.d.ts +7 -0
- package/dist/sandbox/device-reports.module.js +25 -0
- package/dist/sandbox/device-sandbox.d.ts +39 -41
- package/dist/sandbox/device-sandbox.js +44 -83
- package/dist/sandbox/kernel-read.d.ts +2 -2
- package/dist/sandbox/legacy-retirement.d.ts +11 -59
- package/dist/sandbox/legacy-retirement.js +34 -186
- package/dist/sandbox/legacy-retirement.module.d.ts +2 -2
- package/dist/sandbox/legacy-retirement.module.js +2 -2
- package/dist/sandbox/managed-device-context.d.ts +16 -4
- package/dist/sandbox/managed-device-context.js +25 -8
- package/dist/sandbox/managed-device-context.module.js +4 -0
- package/dist/sandbox/modes.d.ts +3 -12
- package/dist/sandbox/modes.js +2 -14
- package/dist/{local-devices → sandbox}/network-grants.d.ts +2 -21
- package/dist/{local-devices → sandbox}/network-grants.js +4 -49
- package/dist/sandbox/operation-authority-types.d.ts +2 -1
- package/dist/sandbox/operation-authority.d.ts +6 -20
- package/dist/sandbox/operation-authority.js +43 -104
- package/dist/sandbox/operation-authority.module.js +1 -1
- package/dist/sandbox/operation-intents.d.ts +4 -1
- package/dist/sandbox/operation-intents.js +11 -2
- package/dist/sandbox/operation-reconcile.job.js +2 -4
- package/dist/sandbox/permission-availability.d.ts +6 -7
- package/dist/sandbox/permission-availability.js +7 -10
- package/dist/sandbox/permission-call-grants.d.ts +2 -1
- package/dist/sandbox/permission-call-grants.js +1 -7
- package/dist/sandbox/permission-call-types.d.ts +4 -4
- package/dist/sandbox/permission-ceiling-writes.d.ts +7 -23
- package/dist/sandbox/permission-ceiling-writes.js +8 -35
- package/dist/sandbox/permission-config-publication.d.ts +9 -1
- package/dist/sandbox/permission-config-publication.js +29 -21
- package/dist/sandbox/permission-context-types.d.ts +17 -10
- package/dist/sandbox/permission-facts.d.ts +98 -95
- package/dist/sandbox/permission-facts.js +160 -314
- package/dist/sandbox/permission-instance-writes.d.ts +23 -37
- package/dist/sandbox/permission-instance-writes.js +44 -121
- package/dist/sandbox/permission-runtime-reports.d.ts +38 -30
- package/dist/sandbox/permission-runtime-reports.js +105 -122
- package/dist/sandbox/providers.d.ts +26 -38
- package/dist/sandbox/providers.js +36 -18
- package/dist/sandbox/request-not-sent.d.ts +2 -13
- package/dist/sandbox/request-not-sent.js +2 -13
- package/dist/sandbox/review/permission-candidate.d.ts +13 -8
- package/dist/sandbox/review/permission-candidate.js +38 -48
- package/dist/sandbox/sandbox.module.js +7 -3
- package/dist/sandbox/sandbox.service.d.ts +49 -59
- package/dist/sandbox/sandbox.service.js +139 -259
- package/dist/schedules/fire.d.ts +15 -6
- package/dist/schedules/fire.js +27 -13
- package/dist/schedules/grant-rules.js +1 -1
- package/dist/schedules/scheduled-tasks.service.d.ts +0 -7
- package/dist/schedules/scheduled-tasks.service.js +1 -4
- package/dist/schedules/schedules.module.js +5 -3
- package/dist/skills/invoke.d.ts +1 -1
- package/dist/skills/invoke.js +2 -3
- package/dist/tools/approvals.service.d.ts +8 -5
- package/dist/tools/approvals.service.js +5 -5
- package/dist/tools/builtins/sandbox/bash.js +1 -2
- package/dist/tools/builtins/sandbox/common.d.ts +15 -9
- package/dist/tools/builtins/sandbox/common.js +37 -38
- package/dist/tools/network-asks.d.ts +19 -22
- package/dist/tools/network-asks.js +15 -21
- package/dist/tools/pipeline.d.ts +6 -7
- package/dist/tools/pipeline.js +17 -21
- package/dist/tools/tools.module.js +3 -7
- package/package.json +3 -4
- package/src/migrations/0177_dial_in_contract.sql +32 -0
- package/dist/local-devices/device-auth.module.d.ts +0 -7
- package/dist/local-devices/device-auth.module.js +0 -25
- package/dist/local-devices/device-policy.service.d.ts +0 -213
- package/dist/local-devices/device-policy.service.js +0 -605
- package/dist/local-devices/instance-bindings.d.ts +0 -82
- package/dist/local-devices/instance-bindings.js +0 -307
- package/dist/local-devices/local-device-gateway.d.ts +0 -153
- package/dist/local-devices/local-device-provider.d.ts +0 -122
- package/dist/local-devices/local-device-provider.js +0 -326
- package/dist/local-devices/local-devices.module.d.ts +0 -31
- package/dist/local-devices/local-devices.module.js +0 -100
- package/dist/local-devices/machines.d.ts +0 -211
- package/dist/local-devices/machines.js +0 -766
- package/dist/local-devices/owner-report.d.ts +0 -81
- package/dist/local-devices/owner-report.js +0 -150
- package/dist/local-devices/owner-reports.d.ts +0 -48
- package/dist/local-devices/owner-reports.js +0 -208
- package/dist/local-devices/policy-op-jobs.d.ts +0 -15
- package/dist/local-devices/policy-op-jobs.js +0 -12
- package/dist/local-devices/policy-summary.d.ts +0 -102
- package/dist/local-devices/policy-summary.js +0 -155
- package/dist/local-devices/relay.d.ts +0 -166
- package/dist/local-devices/relay.js +0 -559
- package/dist/tools/device-op-resolver.d.ts +0 -34
- package/dist/tools/device-op-resolver.js +0 -120
- /package/dist/{local-devices → dial-in}/keys.d.ts +0 -0
- /package/dist/{local-devices → dial-in}/keys.js +0 -0
- /package/dist/{local-devices → sandbox}/network-grants.module.d.ts +0 -0
- /package/dist/{local-devices → sandbox}/network-grants.module.js +0 -0
|
@@ -5,7 +5,7 @@ export type { PermissionCrossingKind };
|
|
|
5
5
|
import type { ReviewFacts } from "./types.js";
|
|
6
6
|
export declare const withinDirectory: (target: string, root: string) => boolean;
|
|
7
7
|
/** Validate the exact presentation and its union with base authority; never truncate or widen. */
|
|
8
|
-
export declare function normalizePermissionExpansion(value: PermissionExpansion, base: Pick<PermissionReviewSnapshot, "
|
|
8
|
+
export declare function normalizePermissionExpansion(value: PermissionExpansion, base: Pick<PermissionReviewSnapshot, "baseWriteDirectories" | "baseHosts">): PermissionExpansion;
|
|
9
9
|
export declare function permissionCandidateHash(candidate: Omit<PermissionCandidate, "candidateHash">): string;
|
|
10
10
|
/** The `Bash` `sandbox` value that asks to run this one call outside the OS sandbox. */
|
|
11
11
|
export declare const SANDBOX_ESCALATED = "escalated";
|
|
@@ -39,19 +39,24 @@ export declare const ESCALATION_UNATTENDED_WHY = "this is an unattended run (a s
|
|
|
39
39
|
* Why an escalation cannot be reviewed because a layer's outside-sandbox setting is off: one text
|
|
40
40
|
* per layer that blocks it (`DeviceSandbox.layer.outsideSandbox`), each naming who lifts it and how.
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Why an escalation cannot be reviewed because the device's provider does not allow running
|
|
44
|
+
* outside its sandbox now, with the provider's own description of the device (its report).
|
|
45
|
+
*/
|
|
46
|
+
export declare const escalationDeviceOffWhy: (description: string | null) => string;
|
|
43
47
|
export declare const ESCALATION_ORG_OFF_WHY = "running commands outside the sandbox is off in this organization; an organization admin can allow running outside the sandbox";
|
|
44
48
|
export declare const ESCALATION_PLATFORM_OFF_WHY = "running commands outside the sandbox is off on this platform; a super admin can allow running outside the sandbox";
|
|
45
|
-
export declare const ESCALATION_NO_OUTSIDE_WHY = "this device is
|
|
49
|
+
export declare const ESCALATION_NO_OUTSIDE_WHY = "this device is an instance that is itself the sandbox, so this device has no outside of its sandbox to run a command in";
|
|
46
50
|
/**
|
|
47
|
-
* The refusal text of an escalation that a layer's outside-sandbox setting blocks
|
|
48
|
-
*
|
|
49
|
-
*
|
|
51
|
+
* The refusal text of an escalation that a layer's outside-sandbox setting blocks, the same for
|
|
52
|
+
* every provider: an instance-boundary provider has no outside at all, whichever layer is off;
|
|
53
|
+
* otherwise the platform or the org names who lifts it, and a provider whose support does not
|
|
54
|
+
* allow it now says so with its description of the device (`description`, its report's).
|
|
50
55
|
*/
|
|
51
56
|
export declare const escalationCeilingWhy: (input: {
|
|
52
57
|
layer: DeviceSandboxLayer | null;
|
|
53
|
-
location: "local" | "cloud";
|
|
54
58
|
boundary: "operation" | "instance";
|
|
59
|
+
description?: string | null;
|
|
55
60
|
}) => string;
|
|
56
61
|
/** Why an escalation cannot be reviewed: the runtime cannot run a command outside its sandbox now. */
|
|
57
62
|
export declare const escalationRuntimeWhy: (reason: string) => string;
|
|
@@ -118,7 +123,7 @@ export declare function runtimeWriteRootRefusal(root: string, escalationRefusal?
|
|
|
118
123
|
export declare function perCallHostRefusal(facts: PermissionReviewSnapshot, host: string): string | null;
|
|
119
124
|
/**
|
|
120
125
|
* Extract proposals from the actual validated call. Parsing proposes reach; it never grants it.
|
|
121
|
-
* `homes` are the owner's home candidates (the
|
|
126
|
+
* `homes` are the owner's home candidates (the provider's reported home, the workspace's home prefix): a
|
|
122
127
|
* call reaching an owner-denied path under one is refused, never proposed.
|
|
123
128
|
*/
|
|
124
129
|
export declare function buildPermissionCandidate(call: {
|
|
@@ -22,22 +22,16 @@ function directory(value) {
|
|
|
22
22
|
/** Validate the exact presentation and its union with base authority; never truncate or widen. */
|
|
23
23
|
export function normalizePermissionExpansion(value, base) {
|
|
24
24
|
const writeDirectories = sorted(value.writeDirectories.map(directory));
|
|
25
|
-
const readDirectories = sorted([...value.readDirectories.map(directory), ...writeDirectories]);
|
|
26
25
|
const hosts = sorted(value.hosts.map((host) => {
|
|
27
26
|
const normalized = host.toLowerCase();
|
|
28
27
|
if (normalized !== host || host.includes("*") || validateAllowHost(host).length)
|
|
29
28
|
throw new ApiError("forbidden", "Permission expansion requires an exact valid host without wildcards");
|
|
30
29
|
return normalized;
|
|
31
30
|
}));
|
|
32
|
-
if (sorted([
|
|
33
|
-
...base.baseReadDirectories,
|
|
34
|
-
...base.baseWriteDirectories,
|
|
35
|
-
...readDirectories,
|
|
36
|
-
...writeDirectories,
|
|
37
|
-
]).length > 64 ||
|
|
31
|
+
if (sorted([...base.baseWriteDirectories, ...writeDirectories]).length > 64 ||
|
|
38
32
|
sorted([...base.baseHosts, ...hosts]).length > 100)
|
|
39
33
|
throw new ApiError("forbidden", "Permission expansion exceeds the combined limit of 64 directory roots or 100 hosts");
|
|
40
|
-
return {
|
|
34
|
+
return { writeDirectories, hosts };
|
|
41
35
|
}
|
|
42
36
|
export function permissionCandidateHash(candidate) {
|
|
43
37
|
return permissionScopeHash(candidate);
|
|
@@ -89,27 +83,30 @@ export const ESCALATION_UNATTENDED_WHY = "this is an unattended run (a scheduled
|
|
|
89
83
|
* Why an escalation cannot be reviewed because a layer's outside-sandbox setting is off: one text
|
|
90
84
|
* per layer that blocks it (`DeviceSandbox.layer.outsideSandbox`), each naming who lifts it and how.
|
|
91
85
|
*/
|
|
92
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Why an escalation cannot be reviewed because the device's provider does not allow running
|
|
88
|
+
* outside its sandbox now, with the provider's own description of the device (its report).
|
|
89
|
+
*/
|
|
90
|
+
export const escalationDeviceOffWhy = (description) => `this device's provider does not allow running outside the sandbox now${description ? `: ${description.replace(/\.$/, "")}` : ""}`;
|
|
93
91
|
export const ESCALATION_ORG_OFF_WHY = "running commands outside the sandbox is off in this organization; an organization admin can allow running outside the sandbox";
|
|
94
92
|
export const ESCALATION_PLATFORM_OFF_WHY = "running commands outside the sandbox is off on this platform; a super admin can allow running outside the sandbox";
|
|
95
|
-
export const ESCALATION_NO_OUTSIDE_WHY = "this device is
|
|
93
|
+
export const ESCALATION_NO_OUTSIDE_WHY = "this device is an instance that is itself the sandbox, so this device has no outside of its sandbox to run a command in";
|
|
96
94
|
/**
|
|
97
|
-
* The refusal text of an escalation that a layer's outside-sandbox setting blocks
|
|
98
|
-
*
|
|
99
|
-
*
|
|
95
|
+
* The refusal text of an escalation that a layer's outside-sandbox setting blocks, the same for
|
|
96
|
+
* every provider: an instance-boundary provider has no outside at all, whichever layer is off;
|
|
97
|
+
* otherwise the platform or the org names who lifts it, and a provider whose support does not
|
|
98
|
+
* allow it now says so with its description of the device (`description`, its report's).
|
|
100
99
|
*/
|
|
101
100
|
export const escalationCeilingWhy = (input) => {
|
|
102
|
-
if (input.
|
|
101
|
+
if (input.boundary === "instance")
|
|
103
102
|
return ESCALATION_NO_OUTSIDE_WHY;
|
|
104
103
|
switch (input.layer) {
|
|
105
104
|
case "platform":
|
|
106
105
|
return ESCALATION_PLATFORM_OFF_WHY;
|
|
107
106
|
case "org":
|
|
108
107
|
return ESCALATION_ORG_OFF_WHY;
|
|
109
|
-
case "provider":
|
|
110
|
-
return escalationRuntimeWhy("This device's runtime cannot run a command outside its sandbox");
|
|
111
108
|
default:
|
|
112
|
-
return
|
|
109
|
+
return escalationDeviceOffWhy(input.description ?? null);
|
|
113
110
|
}
|
|
114
111
|
};
|
|
115
112
|
/** Why an escalation cannot be reviewed: the runtime cannot run a command outside its sandbox now. */
|
|
@@ -162,12 +159,9 @@ export function approverForCrossing(input) {
|
|
|
162
159
|
export function crossingOfCandidate(candidate) {
|
|
163
160
|
if (candidate.scopeKind === "sandbox-escalation")
|
|
164
161
|
return "outside-sandbox";
|
|
165
|
-
return candidate.permissionScope.
|
|
166
|
-
candidate.permissionScope.writeDirectories.length > 0
|
|
167
|
-
? "directory"
|
|
168
|
-
: "host";
|
|
162
|
+
return candidate.permissionScope.writeDirectories.length > 0 ? "directory" : "host";
|
|
169
163
|
}
|
|
170
|
-
/** The paths a
|
|
164
|
+
/** The paths a device never opens to restricted work, relative to `~`. */
|
|
171
165
|
const OWNER_DENIED_PATHS = [...DEVICE_DENIED_SECRET_PATHS, DEVICE_DEFAULT_STATE_PATH];
|
|
172
166
|
/**
|
|
173
167
|
* The owner-denied path (as `~/…`) that `target` is at or under for one of `homes`, if any: the
|
|
@@ -257,7 +251,7 @@ function bindingOf(call, facts) {
|
|
|
257
251
|
}
|
|
258
252
|
/**
|
|
259
253
|
* Extract proposals from the actual validated call. Parsing proposes reach; it never grants it.
|
|
260
|
-
* `homes` are the owner's home candidates (the
|
|
254
|
+
* `homes` are the owner's home candidates (the provider's reported home, the workspace's home prefix): a
|
|
261
255
|
* call reaching an owner-denied path under one is refused, never proposed.
|
|
262
256
|
*/
|
|
263
257
|
export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
@@ -302,7 +296,7 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
302
296
|
};
|
|
303
297
|
const candidate = {
|
|
304
298
|
binding: bindingOf(call, facts),
|
|
305
|
-
permissionScope: {
|
|
299
|
+
permissionScope: { writeDirectories: [], hosts: [] },
|
|
306
300
|
scopeKind: "sandbox-escalation",
|
|
307
301
|
escalation: { justification, ...backgroundOf(input, opts.backgroundMaxSeconds) },
|
|
308
302
|
};
|
|
@@ -312,19 +306,18 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
312
306
|
};
|
|
313
307
|
}
|
|
314
308
|
let targetPath;
|
|
315
|
-
const
|
|
316
|
-
|
|
309
|
+
const writes = [], hosts = [];
|
|
310
|
+
// a write root outside the base write roots is proposed; a read is never proposed (what a
|
|
311
|
+
// sandboxed operation may read is the device provider's rule, which no approval widens)
|
|
312
|
+
const proposeWriteDirectory = (value) => {
|
|
317
313
|
const normalized = directory(path.posix.resolve(facts.workingRoot, value));
|
|
318
314
|
refuseDenied(normalized);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
throw new ProtectedPathError(runtime);
|
|
326
|
-
}
|
|
327
|
-
(write ? writes : reads).push(normalized);
|
|
315
|
+
if (!facts.baseWriteDirectories.some((root) => withinDirectory(normalized, root))) {
|
|
316
|
+
refuseWriteDenied(normalized);
|
|
317
|
+
const runtime = runtimeWriteRootRefusal(normalized, facts.escalationRefusal);
|
|
318
|
+
if (runtime)
|
|
319
|
+
throw new ProtectedPathError(runtime);
|
|
320
|
+
writes.push(normalized);
|
|
328
321
|
}
|
|
329
322
|
};
|
|
330
323
|
// the paths a file call names: `file_path`, or every path a `GenerateImage` call writes into the
|
|
@@ -336,7 +329,7 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
336
329
|
: [];
|
|
337
330
|
try {
|
|
338
331
|
if (targets.length > 0) {
|
|
339
|
-
const write = call.toolKey !== "Read"
|
|
332
|
+
const write = call.toolKey !== "Read";
|
|
340
333
|
for (const target of targets)
|
|
341
334
|
if (target.length > 4096 || /[\0*?[\]{}]/.test(target))
|
|
342
335
|
throw new Error("Invalid target path");
|
|
@@ -348,11 +341,13 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
348
341
|
// inside the base scope too: the credential consent it would get could never run there
|
|
349
342
|
for (const target of resolved)
|
|
350
343
|
refuseDenied(target);
|
|
344
|
+
// a read proposes nothing: the provider's read rule decides it
|
|
345
|
+
if (!write)
|
|
346
|
+
return { kind: "in-scope" };
|
|
351
347
|
for (const target of resolved) {
|
|
352
|
-
if (!
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
proposeDirectory(path.posix.dirname(target), write);
|
|
348
|
+
if (!facts.baseWriteDirectories.some((root) => withinDirectory(target, root))) {
|
|
349
|
+
refuseWriteDenied(target);
|
|
350
|
+
proposeWriteDirectory(path.posix.dirname(target));
|
|
356
351
|
}
|
|
357
352
|
}
|
|
358
353
|
// what the person approves: every path the call writes
|
|
@@ -367,7 +362,7 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
367
362
|
const parsed = parseCommand(input.command);
|
|
368
363
|
for (const command of parsed?.commands ?? []) {
|
|
369
364
|
if (command.argv[0] === "cd" && command.argv.length === 2 && command.argv[1])
|
|
370
|
-
|
|
365
|
+
proposeWriteDirectory(command.argv[1]);
|
|
371
366
|
for (const word of command.argv) {
|
|
372
367
|
if (!allowlist || !/^https?:\/\//i.test(word))
|
|
373
368
|
continue;
|
|
@@ -394,14 +389,9 @@ export function buildPermissionCandidate(call, facts, homes = [], opts = {}) {
|
|
|
394
389
|
// as admission and the recorded context cut it too (B-15)
|
|
395
390
|
const reachable = hostsWithinOuter(hosts, facts.outerNetwork ?? undefined);
|
|
396
391
|
hosts.splice(0, hosts.length, ...reachable);
|
|
397
|
-
if (!
|
|
392
|
+
if (!writes.length && !hosts.length)
|
|
398
393
|
return { kind: "in-scope" };
|
|
399
|
-
const permissionScope = normalizePermissionExpansion({
|
|
400
|
-
if (!facts.broadProjectReach && (reads.length || writes.length))
|
|
401
|
-
throw new Error(`This call needs access outside the working directory ${facts.workingRoot} (${[
|
|
402
|
-
...writes,
|
|
403
|
-
...reads,
|
|
404
|
-
].join(", ")}), which the device owner's limits do not allow, so it did not run. Keep the call inside ${facts.workingRoot}, or ask the user to have the device's limits widened.`);
|
|
394
|
+
const permissionScope = normalizePermissionExpansion({ writeDirectories: writes, hosts }, facts);
|
|
405
395
|
// a host beyond the per-call host ceiling is never proposed (so never auto-granted): the reply
|
|
406
396
|
// names who can add it
|
|
407
397
|
const refused = hosts.flatMap((host) => {
|
|
@@ -8,13 +8,14 @@ import { Module } from "@nestjs/common";
|
|
|
8
8
|
import { BackgroundStoreModule } from "../background/store.module.js";
|
|
9
9
|
import { EventLogModule } from "../conversations/event-log.js";
|
|
10
10
|
import { DeviceProviderSelectionModule } from "../devices/device-provider-selection.module.js";
|
|
11
|
+
import { DialInRelayModule } from "../dial-in/relay.module.js";
|
|
11
12
|
import { ExtensionsModule } from "../extensions/extensions.module.js";
|
|
12
13
|
import { QueueModule } from "../infra/queue/queue.module.js";
|
|
13
14
|
import { ModelsModule } from "../models/models.module.js";
|
|
14
15
|
import { MAINTENANCE_QUEUE_NAME } from "../runtime/maintenance-queue.js";
|
|
15
16
|
import { StepLogModule } from "../runtime/step-log.js";
|
|
16
17
|
import { CloudPermissionSnapshotsModule } from "./cloud-permission-snapshot.module.js";
|
|
17
|
-
import {
|
|
18
|
+
import { DeviceReportsModule } from "./device-reports.module.js";
|
|
18
19
|
import { SandboxJobs } from "./jobs.js";
|
|
19
20
|
import { LegacyRetirementModule } from "./legacy-retirement.module.js";
|
|
20
21
|
import { OperationAuthorityModule } from "./operation-authority.module.js";
|
|
@@ -39,6 +40,9 @@ SandboxModule = __decorate([
|
|
|
39
40
|
// which providers serve an org: a use needs the device's provider on in its org
|
|
40
41
|
DeviceProviderSelectionModule,
|
|
41
42
|
SandboxProviderRegistryModule,
|
|
43
|
+
// whether a dial-in device's machine is connected before a dispatch is recorded
|
|
44
|
+
DialInRelayModule,
|
|
45
|
+
DeviceReportsModule,
|
|
42
46
|
PermissionAuthorityModule,
|
|
43
47
|
PermissionFactsModule,
|
|
44
48
|
OperationIntentsModule,
|
|
@@ -53,7 +57,7 @@ SandboxModule = __decorate([
|
|
|
53
57
|
StepLogModule,
|
|
54
58
|
QueueModule.registerQueue(MAINTENANCE_QUEUE_NAME),
|
|
55
59
|
],
|
|
56
|
-
providers: [SandboxService, SandboxJobs, CommandReviewService
|
|
60
|
+
providers: [SandboxService, SandboxJobs, CommandReviewService],
|
|
57
61
|
exports: [
|
|
58
62
|
SandboxProviderRegistryModule,
|
|
59
63
|
LegacyRetirementModule,
|
|
@@ -64,7 +68,7 @@ SandboxModule = __decorate([
|
|
|
64
68
|
SandboxJobs,
|
|
65
69
|
CommandReviewService,
|
|
66
70
|
CloudPermissionSnapshotsModule,
|
|
67
|
-
|
|
71
|
+
DeviceReportsModule,
|
|
68
72
|
],
|
|
69
73
|
})
|
|
70
74
|
], SandboxModule);
|
|
@@ -10,6 +10,7 @@ import { type Selectable } from "kysely";
|
|
|
10
10
|
import type { KernelConfig } from "../config/schema.js";
|
|
11
11
|
import type { DeviceInstancesTable } from "../db/kernel-schema.js";
|
|
12
12
|
import { DeviceProviderSelection } from "../devices/device-provider-selection.js";
|
|
13
|
+
import { DialInRelay } from "../dial-in/relay.js";
|
|
13
14
|
import { ApiError } from "../errors.js";
|
|
14
15
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
15
16
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
@@ -109,11 +110,10 @@ export interface DeviceLimitsState {
|
|
|
109
110
|
/** The provider-side name of a device's file system and instance. */
|
|
110
111
|
export declare const deviceResourceName: (deviceId: string) => string;
|
|
111
112
|
/**
|
|
112
|
-
* The device's file system is gone at the provider (409); never replaced silently
|
|
113
|
-
*
|
|
114
|
-
* owner's: `capybara-device logout`, then `login` into the device, recreates it (ruling R24).
|
|
113
|
+
* The device's file system is gone at the provider (409); never replaced silently: the device's
|
|
114
|
+
* page resets its files where its provider offers that (its report's `reset`).
|
|
115
115
|
*/
|
|
116
|
-
export declare const deviceFilesLost: (
|
|
116
|
+
export declare const deviceFilesLost: () => ApiError;
|
|
117
117
|
/**
|
|
118
118
|
* A cloud sandbox provider refused to make (or move) an instance with the open public network
|
|
119
119
|
* (409; auto mode spec §4.2): a provider that cannot or is set not to offer it. The text is
|
|
@@ -167,23 +167,12 @@ export declare class RetirementPendingError extends ApiError {
|
|
|
167
167
|
name: string;
|
|
168
168
|
}
|
|
169
169
|
export declare const retirementPending: () => ApiError;
|
|
170
|
-
/**
|
|
171
|
-
* A local machine's old instance may still run legacy work, and a later boot of that machine is
|
|
172
|
-
* the evidence that ends it (503, 8.5): the person restarts the computer.
|
|
173
|
-
*/
|
|
174
|
-
export declare const restartRequired: () => ApiError;
|
|
175
170
|
/**
|
|
176
171
|
* A cloud device's earlier instance may still run legacy work and no evidence the kernel can get
|
|
177
172
|
* will ever cover it (an incarnation replaced without a recorded confirmed destruction, or an
|
|
178
173
|
* unknown one it cannot clear) (503, 8.5): the owner deletes the device and creates it again.
|
|
179
174
|
*/
|
|
180
175
|
export declare const recreateRequired: () => ApiError;
|
|
181
|
-
/**
|
|
182
|
-
* A local machine's old instance may still run legacy work, and the computer never reported a
|
|
183
|
-
* boot identity, so not even a restart can prove it ended (503, 8.5): the owner replaces the
|
|
184
|
-
* device. A deleted device's obligations never block a new one.
|
|
185
|
-
*/
|
|
186
|
-
export declare const replaceRequired: () => ApiError;
|
|
187
176
|
/**
|
|
188
177
|
* The kernel's sandbox service over the `device-provider@1` provider, keyed by **device** (spec
|
|
189
178
|
* 2026-11-07-environments-design §4.2, §5.1): one file system kept until the device is
|
|
@@ -234,16 +223,14 @@ export declare const replaceRequired: () => ApiError;
|
|
|
234
223
|
*
|
|
235
224
|
* - **Provider per device** (device-provider spec §6.1): a device is bound to its provider
|
|
236
225
|
* (`devices.provider`, fixed at creation) for life, resolved at every call
|
|
237
|
-
* ({@link DeviceProviders.forDevice})
|
|
238
|
-
*
|
|
226
|
+
* ({@link DeviceProviders.forDevice}), the same way for every provider (a dial-in one reaches its
|
|
227
|
+
* machine through the generic channel inside its own calls). Several
|
|
239
228
|
* providers serve one org side by side. A use needs the provider loaded **and** on in the
|
|
240
229
|
* device's org ({@link DeviceProviderSelection.isOnInOrg}); otherwise, and for an instance row
|
|
241
230
|
* naming another provider, the use fails `device.unavailable` (503) and nothing changes: the
|
|
242
231
|
* files and instance stay, nothing is demoted, recreated or moved to another provider.
|
|
243
232
|
* Lifecycle cleanup (destroy, sweeps, reset) only needs the provider loaded. The sweeps run
|
|
244
|
-
* per
|
|
245
|
-
* touched. A `@local` instance is never suspended or destroyed for inactivity; a deleted
|
|
246
|
-
* `@local` device (or one of a deleted org) is destroyed by the sweep like any other.
|
|
233
|
+
* per provider over its own rows; rows of a provider that is not loaded are never touched.
|
|
247
234
|
*
|
|
248
235
|
* No in-process state: replicas share it through PG and Redis.
|
|
249
236
|
*/
|
|
@@ -277,29 +264,39 @@ export declare class SandboxService {
|
|
|
277
264
|
private readonly snapshots;
|
|
278
265
|
/** The stored device report, refreshed after a create or a resume (never fails the use). */
|
|
279
266
|
private readonly reports;
|
|
267
|
+
/**
|
|
268
|
+
* The dial-in relay: a dial-in provider's device whose machine is not connected refuses a new
|
|
269
|
+
* operation before its dispatch is recorded (absent in hand-built services: not checked).
|
|
270
|
+
*/
|
|
271
|
+
private readonly relay?;
|
|
280
272
|
constructor(db: KernelDb,
|
|
281
273
|
/** The record of the instance each holder last used (`capk:sandbox-seen:…`). */
|
|
282
274
|
redis: Pick<Redis, "get" | "set" | "getdel">, leases: SandboxLeases,
|
|
283
275
|
/** The providers (read at every call: providers are ready after the extension load). */
|
|
284
|
-
providers: Pick<DeviceProviders, "forDevice" | "loaded">,
|
|
276
|
+
providers: Pick<DeviceProviders, "forDevice" | "loaded" | "all">,
|
|
285
277
|
/** Whether a device's provider serves its org now (read at every use, never cached). */
|
|
286
278
|
selection: Pick<DeviceProviderSelection, "isOnInOrg">, config: Pick<KernelConfigService, "get" | "fieldSource">, log: Pick<KernelLogger, "info" | "warn">, facts: Pick<PermissionFacts, "devicePolicy" | "assertCloudReconciled" | "readHeldEnvironment" | "readDevice" | "deviceSandbox" | "deviceSandboxFacts" | "orgHostGrantCeiling">, operationIntents: SandboxOperationIntents, authority: SandboxOperationAuthority, instanceWrites: PermissionInstanceWrites,
|
|
287
279
|
/** The retirement obligations every lifecycle acquisition is gated on (8.5). */
|
|
288
|
-
retirement: Pick<LegacyRetirementStore, "unresolved" | "hasUnresolved" | "
|
|
280
|
+
retirement: Pick<LegacyRetirementStore, "unresolved" | "hasUnresolved" | "scanUntilStable" | "frozen" | "frozenAt" | "quarantine" | "noteFailure" | "resolveDestroyed" | "resolveCancelled" | "membersOf" | "recordDestruction" | "destructionRecorded">,
|
|
289
281
|
/** The cloud snapshot writer's reconcile, for the lifecycle reconcile of marked devices (B-12). */
|
|
290
282
|
snapshots: Pick<CloudPermissionSnapshots, "reconcileHeld">,
|
|
291
283
|
/** The stored device report, refreshed after a create or a resume (never fails the use). */
|
|
292
|
-
reports: Pick<DeviceReports, "refresh"
|
|
284
|
+
reports: Pick<DeviceReports, "refresh">,
|
|
285
|
+
/**
|
|
286
|
+
* The dial-in relay: a dial-in provider's device whose machine is not connected refuses a new
|
|
287
|
+
* operation before its dispatch is recorded (absent in hand-built services: not checked).
|
|
288
|
+
*/
|
|
289
|
+
relay?: Pick<DialInRelay, "connection"> | undefined);
|
|
293
290
|
/** Poll interval while waiting for a lease (the leases' own). */
|
|
294
291
|
private get pollMs();
|
|
295
292
|
/**
|
|
296
293
|
* Whether the device of `orgId` can be used now: its provider is loaded and on in the org
|
|
297
|
-
* ({@link DeviceProviderSelection.isOnInOrg}
|
|
294
|
+
* ({@link DeviceProviderSelection.isOnInOrg}). A missing device, one of
|
|
298
295
|
* another org or one without a provider is not.
|
|
299
296
|
*/
|
|
300
297
|
availableFor(deviceId: string, orgId: string): Promise<boolean>;
|
|
301
298
|
/**
|
|
302
|
-
* Whether the provider the device is bound to is loaded here
|
|
299
|
+
* Whether the provider the device is bound to is loaded here, whatever
|
|
303
300
|
* its org says: for lifecycle work that goes on while the org has the provider off (owed
|
|
304
301
|
* revocations, cleanup).
|
|
305
302
|
*/
|
|
@@ -330,8 +327,8 @@ export declare class SandboxService {
|
|
|
330
327
|
private get cap();
|
|
331
328
|
/**
|
|
332
329
|
* The effective device policy of a device (auto mode spec §4.3): the platform's switch and the
|
|
333
|
-
* org's settings with the device's own mode (a
|
|
334
|
-
*
|
|
330
|
+
* org's settings with the device's own mode (a missing device has none). Without `deviceId`:
|
|
331
|
+
* an org-level policy with no choice.
|
|
335
332
|
*/
|
|
336
333
|
devicePolicy(device: {
|
|
337
334
|
orgId: string;
|
|
@@ -342,21 +339,19 @@ export declare class SandboxService {
|
|
|
342
339
|
orgId: string;
|
|
343
340
|
deviceId: string;
|
|
344
341
|
}): Promise<HostGrantCeiling>;
|
|
345
|
-
/** The device's source (`local` for a connected machine, else `cloud`); cloud when unknown. */
|
|
346
|
-
private deviceSource;
|
|
347
342
|
/**
|
|
348
|
-
* The device's effective sandbox limits (spec §8.4; auto mode spec §4.2)
|
|
349
|
-
* `sandbox.limits` resources, cpu / memory per the super admin's org
|
|
350
|
-
* M16), the effective mode and the device sandbox network
|
|
351
|
-
*
|
|
352
|
-
*
|
|
343
|
+
* The device's effective sandbox limits (spec §8.4; auto mode spec §4.2), the same for every
|
|
344
|
+
* provider: the deployment's `sandbox.limits` resources, cpu / memory per the super admin's org
|
|
345
|
+
* override (C19 / Ruling M16), the effective mode and the device's sandbox network
|
|
346
|
+
* ({@link devicePolicy}: its own `devices.network_*` within the platform's and the org's
|
|
347
|
+
* ceilings). An operation-boundary provider also gets each operation's network in its scope.
|
|
348
|
+
* `opts.policy`: what the caller already read (avoids the policy queries).
|
|
353
349
|
*/
|
|
354
350
|
deviceLimits(device: {
|
|
355
351
|
orgId: string;
|
|
356
352
|
deviceId?: string;
|
|
357
353
|
}, opts?: {
|
|
358
354
|
policy?: EffectiveDevicePolicy;
|
|
359
|
-
source?: "cloud" | "local";
|
|
360
355
|
}): Promise<DeviceLimits>;
|
|
361
356
|
/**
|
|
362
357
|
* The org's limits for a standing network grant (a scheduled task's grant, a network approval):
|
|
@@ -368,7 +363,8 @@ export declare class SandboxService {
|
|
|
368
363
|
ceilingLimits(orgId: string): Promise<SandboxLimits>;
|
|
369
364
|
/**
|
|
370
365
|
* Why a per-call host grant for each host is unavailable on the device, naming who can add it
|
|
371
|
-
* (`hostGrantRefusal`; null: grantable): a network ask is made only for a grantable host
|
|
366
|
+
* (`hostGrantRefusal`; null: grantable): a network ask is made only for a grantable host, and
|
|
367
|
+
* only on a device whose provider enforces an allowlist (`allowlist`, from its support).
|
|
372
368
|
*/
|
|
373
369
|
hostRefusal(device: {
|
|
374
370
|
orgId: string;
|
|
@@ -376,6 +372,7 @@ export declare class SandboxService {
|
|
|
376
372
|
}): Promise<{
|
|
377
373
|
refusal: (host: string) => string | null;
|
|
378
374
|
box: DeviceSandbox;
|
|
375
|
+
allowlist: boolean;
|
|
379
376
|
}>;
|
|
380
377
|
/**
|
|
381
378
|
* The limits state of a device's instance for its page (auto mode spec §4.2), read without a
|
|
@@ -384,8 +381,7 @@ export declare class SandboxService {
|
|
|
384
381
|
* `pendingNextUse`: a cloud instance exists and differs; its next use applies the new limits
|
|
385
382
|
* (files kept). `pendingFilesReset`: the provider fixes limits at its file system
|
|
386
383
|
* (`limitsApplyAt: "fileSystem"`) and cannot `update` them, so only a file reset applies them.
|
|
387
|
-
*
|
|
388
|
-
* its `applied` is null. `opts.policy`: the device's effective policy when the caller already
|
|
384
|
+
* `opts.policy`: the device's effective policy when the caller already
|
|
389
385
|
* read it ({@link devicePolicy}).
|
|
390
386
|
*/
|
|
391
387
|
limitsState(device: {
|
|
@@ -406,8 +402,7 @@ export declare class SandboxService {
|
|
|
406
402
|
* widening still reaches instances created afterwards), unless only a file reset could apply it
|
|
407
403
|
* ({@link fsBound}). A provider bound to its file system still goes through the exclusive lease
|
|
408
404
|
* once for a narrowing, so `applyLimits` records it as `unapplied` (the device is then unprobed
|
|
409
|
-
* until the reset, never silently supported).
|
|
410
|
-
* with each command).
|
|
405
|
+
* until the reset, never silently supported).
|
|
411
406
|
*/
|
|
412
407
|
private mustApply;
|
|
413
408
|
/**
|
|
@@ -492,7 +487,7 @@ export declare class SandboxService {
|
|
|
492
487
|
* owner browse ({@link withBrowse}) of a device that may be stopped: the owner, membership and
|
|
493
488
|
* browsing ceiling checks of the browse first (`resolveBrowse`), then the lifecycle `enter` a
|
|
494
489
|
* use takes (the exclusive lease creates or resumes the instance through the retirement gate,
|
|
495
|
-
* the B-11 reconcile marker,
|
|
490
|
+
* the B-11 reconcile marker, `maxRunningSandboxes` and fencing), and the lease
|
|
496
491
|
* is left at once. No conversation holds it and nothing runs in it; what the start caused is
|
|
497
492
|
* not marked seen, so each conversation's next use still learns of it.
|
|
498
493
|
*/
|
|
@@ -523,9 +518,9 @@ export declare class SandboxService {
|
|
|
523
518
|
withSandbox<T>(ctx: SandboxUseContext, fn: (h: SandboxHandle, p: HeldProvider, info: SandboxUseInfo, signal: AbortSignal) => Promise<T>, signal: AbortSignal): Promise<T>;
|
|
524
519
|
private withSandboxUse;
|
|
525
520
|
/**
|
|
526
|
-
* The limits a
|
|
527
|
-
*
|
|
528
|
-
*
|
|
521
|
+
* The limits a device's instance must run with for this use (auto mode spec §4.2), read fresh,
|
|
522
|
+
* the same for every provider. A scheduled run has no separate mode grant: the effective policy
|
|
523
|
+
* applies to it as to any use.
|
|
529
524
|
*/
|
|
530
525
|
private wantedLimits;
|
|
531
526
|
/**
|
|
@@ -582,11 +577,10 @@ export declare class SandboxService {
|
|
|
582
577
|
*/
|
|
583
578
|
private enter;
|
|
584
579
|
/**
|
|
585
|
-
* Whether this
|
|
586
|
-
*
|
|
587
|
-
* installed binding instead.
|
|
580
|
+
* Whether the lifecycle records this provider's instances' evidence (B-15): a provider (with a
|
|
581
|
+
* known version) that reads its own permission support, the same for every device.
|
|
588
582
|
*/
|
|
589
|
-
private
|
|
583
|
+
private recordsSupport;
|
|
590
584
|
/**
|
|
591
585
|
* The provider's permission support of the held instance `handle`, read under the caller's
|
|
592
586
|
* lifecycle lease within {@link PERMISSION_SUPPORT_TIMEOUT_MS}; undefined when it cannot be
|
|
@@ -605,8 +599,6 @@ export declare class SandboxService {
|
|
|
605
599
|
* evidence as it was. Never throws.
|
|
606
600
|
*/
|
|
607
601
|
private refreshCloudSupport;
|
|
608
|
-
/** No binder (protocol 2), or the current generation's binding is installed (B-8). */
|
|
609
|
-
private bound;
|
|
610
602
|
private clearIntent;
|
|
611
603
|
private readRow;
|
|
612
604
|
/** The instance row belongs to another org: reported as not found, so ids cannot be probed. */
|
|
@@ -688,9 +680,8 @@ export declare class SandboxService {
|
|
|
688
680
|
* (the instance only; the file system is kept and the next use builds a new instance on it); an
|
|
689
681
|
* device that was deleted, or whose org was deleted, loses its instance and its file system
|
|
690
682
|
* and its row is deleted (as {@link destroyDevice} does). Devices with any holder are
|
|
691
|
-
* skipped.
|
|
692
|
-
*
|
|
693
|
-
* hourly by the `sandbox-destroy-inactive` cron.
|
|
683
|
+
* skipped. Each provider sweeps its own rows the same way. Returns how many it destroyed.
|
|
684
|
+
* Called hourly by the `sandbox-destroy-inactive` cron.
|
|
694
685
|
*/
|
|
695
686
|
destroyInactive(now: Date): Promise<number>;
|
|
696
687
|
/**
|
|
@@ -756,12 +747,11 @@ export declare class SandboxService {
|
|
|
756
747
|
* before the instance is used, resumed, rebuilt, switched to another provider, bound or
|
|
757
748
|
* downgraded to shared use: every unresolved obligation of the device is settled here or the
|
|
758
749
|
* device is unavailable ({@link retirementPending}).
|
|
759
|
-
* - The obligation names the **current** incarnation (provider and exact generation):
|
|
760
|
-
*
|
|
761
|
-
* kept), the confirmed destruction is recorded and the row reads
|
|
762
|
-
* creates a fresh instance; a failed destroy keeps the obligation.
|
|
763
|
-
*
|
|
764
|
-
* - B-22: a **suspended** current cloud incarnation whose members are all revoked managed starts
|
|
750
|
+
* - The obligation names the **current** incarnation (provider and exact generation): it is
|
|
751
|
+
* destroyed whole by its provider, whatever the provider (never resumed, never `killAll`ed,
|
|
752
|
+
* the file system kept), the confirmed destruction is recorded and the row reads
|
|
753
|
+
* `destroyed`, so the use creates a fresh instance; a failed destroy keeps the obligation.
|
|
754
|
+
* - B-22: a **suspended** current incarnation whose members are all revoked managed starts
|
|
765
755
|
* is not destroyed whole (its other tasks would be lost): each revoked ref gets its exact stop
|
|
766
756
|
* (persisted while suspended), the instance is resumed, each stop is confirmed (`stopped` or
|
|
767
757
|
* `already-exited`), and the obligation resolves as `exact-cancelled`. Any failure is noted on
|