@capybara-hq/kernel 0.1.0-rc.85 → 0.1.0-rc.86
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/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/cards.d.ts +7 -3
- package/dist/channels/cards.js +9 -4
- package/dist/channels/phrases.d.ts +10 -0
- package/dist/channels/phrases.js +10 -0
- package/dist/config/docs.js +1 -1
- package/dist/config/schema.d.ts +3 -0
- package/dist/config/schema.js +18 -12
- package/dist/ctx/create-ctx.d.ts +10 -1
- package/dist/ctx/create-ctx.js +42 -2
- package/dist/device-access/device-access.module.d.ts +7 -0
- package/dist/device-access/device-access.module.js +41 -0
- package/dist/device-access/device-access.service.d.ts +142 -0
- package/dist/device-access/device-access.service.js +464 -0
- package/dist/device-access/token.d.ts +6 -0
- package/dist/device-access/token.js +6 -0
- package/dist/device-access/viewer-routes.d.ts +45 -0
- package/dist/device-access/viewer-routes.js +81 -0
- package/dist/device-access/viewer.d.ts +244 -0
- package/dist/device-access/viewer.js +844 -0
- package/dist/dial-in/access.d.ts +19 -0
- package/dist/dial-in/access.js +23 -0
- package/dist/dial-in/gateway.d.ts +48 -6
- package/dist/dial-in/gateway.js +145 -10
- package/dist/dial-in/keys.d.ts +7 -0
- package/dist/dial-in/keys.js +7 -0
- package/dist/dial-in/routes.d.ts +11 -3
- package/dist/dial-in/routes.js +15 -4
- package/dist/dial-in/streams.d.ts +58 -0
- package/dist/dial-in/streams.js +283 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +2 -0
- package/dist/extensions/host.d.ts +13 -1
- package/dist/extensions/host.js +20 -1
- package/dist/extensions/permission-set.d.ts +15 -1
- package/dist/extensions/permission-set.js +13 -1
- package/dist/extensions/permission-view.d.ts +6 -4
- package/dist/extensions/permission-view.js +6 -1
- package/dist/http/error.filter.js +2 -0
- package/dist/http/gateway-routes.d.ts +8 -4
- package/dist/http/gateway-routes.js +4 -3
- package/dist/infra/lock/lock.service.d.ts +5 -1
- package/dist/infra/lock/lock.service.js +10 -4
- package/dist/infra/throttler/named-throttlers.d.ts +3 -0
- package/dist/infra/throttler/named-throttlers.js +16 -0
- package/dist/kernel.module.js +3 -0
- package/dist/roles/gateway-role.d.ts +13 -6
- package/dist/roles/gateway-role.js +27 -9
- package/dist/roles/gateway.module.d.ts +2 -1
- package/dist/roles/gateway.module.js +13 -3
- package/dist/sandbox/device-services.d.ts +62 -0
- package/dist/sandbox/device-services.js +183 -0
- package/dist/sandbox/leases.d.ts +18 -1
- package/dist/sandbox/leases.js +75 -1
- package/dist/sandbox/network-grants.js +5 -2
- package/dist/sandbox/sandbox.module.d.ts +2 -1
- package/dist/sandbox/sandbox.module.js +5 -2
- package/dist/sandbox/sandbox.service.d.ts +44 -1
- package/dist/sandbox/sandbox.service.js +142 -5
- package/dist/tools/approvals.service.d.ts +45 -20
- package/dist/tools/approvals.service.js +19 -9
- package/dist/tools/call-scope.d.ts +60 -0
- package/dist/tools/call-scope.js +23 -0
- package/dist/tools/network-asks.d.ts +13 -0
- package/dist/tools/network-asks.js +26 -2
- package/dist/tools/pipeline.d.ts +30 -1
- package/dist/tools/pipeline.js +285 -54
- package/dist/tools/questions.service.d.ts +24 -3
- package/dist/tools/questions.service.js +3 -1
- package/package.json +3 -3
|
@@ -34,13 +34,16 @@ function grantedOf(detail) {
|
|
|
34
34
|
const g = detail?.grantedHosts;
|
|
35
35
|
return Array.isArray(g) ? g.filter(exactHost) : [];
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* `detail.hosts` of a network ask: what it asked about (a command's `{ host, port }` entries, a
|
|
39
|
+
* device service's host names).
|
|
40
|
+
*/
|
|
38
41
|
function askedOf(detail) {
|
|
39
42
|
const hs = detail?.hosts;
|
|
40
43
|
if (!Array.isArray(hs))
|
|
41
44
|
return [];
|
|
42
45
|
return hs.flatMap((h) => {
|
|
43
|
-
const host = h?.host;
|
|
46
|
+
const host = typeof h === "string" ? h : h?.host;
|
|
44
47
|
return typeof host === "string" ? [host] : [];
|
|
45
48
|
});
|
|
46
49
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sandboxes: the one {@link SandboxService} (a device's file system and instance over the
|
|
3
3
|
* `device-provider@1` provider, with the shared / exclusive leases of {@link SandboxLeases}), the review
|
|
4
|
-
* every command passes in auto mode ({@link CommandReviewService}),
|
|
4
|
+
* every command passes in auto mode ({@link CommandReviewService}), device services
|
|
5
|
+
* ({@link DeviceServices}), and the producer of the
|
|
5
6
|
* one-off `sandbox-destroy-for` jobs (`MaintenanceProcessor` consumes them). The sweeps
|
|
6
7
|
* (`SandboxSweepJobs`) are the worker role's (`WorkerModule`).
|
|
7
8
|
*/
|
|
@@ -16,6 +16,7 @@ import { MAINTENANCE_QUEUE_NAME } from "../runtime/maintenance-queue.js";
|
|
|
16
16
|
import { StepLogModule } from "../runtime/step-log.js";
|
|
17
17
|
import { CloudPermissionSnapshotsModule } from "./cloud-permission-snapshot.module.js";
|
|
18
18
|
import { DeviceReportsModule } from "./device-reports.module.js";
|
|
19
|
+
import { DeviceServices } from "./device-services.js";
|
|
19
20
|
import { SandboxJobs } from "./jobs.js";
|
|
20
21
|
import { LegacyRetirementModule } from "./legacy-retirement.module.js";
|
|
21
22
|
import { OperationAuthorityModule } from "./operation-authority.module.js";
|
|
@@ -28,7 +29,8 @@ import { SandboxService } from "./sandbox.service.js";
|
|
|
28
29
|
/**
|
|
29
30
|
* Sandboxes: the one {@link SandboxService} (a device's file system and instance over the
|
|
30
31
|
* `device-provider@1` provider, with the shared / exclusive leases of {@link SandboxLeases}), the review
|
|
31
|
-
* every command passes in auto mode ({@link CommandReviewService}),
|
|
32
|
+
* every command passes in auto mode ({@link CommandReviewService}), device services
|
|
33
|
+
* ({@link DeviceServices}), and the producer of the
|
|
32
34
|
* one-off `sandbox-destroy-for` jobs (`MaintenanceProcessor` consumes them). The sweeps
|
|
33
35
|
* (`SandboxSweepJobs`) are the worker role's (`WorkerModule`).
|
|
34
36
|
*/
|
|
@@ -57,12 +59,13 @@ SandboxModule = __decorate([
|
|
|
57
59
|
StepLogModule,
|
|
58
60
|
QueueModule.registerQueue(MAINTENANCE_QUEUE_NAME),
|
|
59
61
|
],
|
|
60
|
-
providers: [SandboxService, SandboxJobs, CommandReviewService],
|
|
62
|
+
providers: [SandboxService, SandboxJobs, CommandReviewService, DeviceServices],
|
|
61
63
|
exports: [
|
|
62
64
|
SandboxProviderRegistryModule,
|
|
63
65
|
LegacyRetirementModule,
|
|
64
66
|
PermissionAuthorityModule,
|
|
65
67
|
SandboxService,
|
|
68
|
+
DeviceServices,
|
|
66
69
|
OperationIntentsModule,
|
|
67
70
|
OperationAuthorityModule,
|
|
68
71
|
SandboxJobs,
|
|
@@ -78,6 +78,21 @@ interface Instance {
|
|
|
78
78
|
export type TaggedProvider = Omit<DeviceProvider, "exec"> & {
|
|
79
79
|
exec(h: SandboxHandle, args: Omit<ExecArgs, "tag">): Promise<ExecResult>;
|
|
80
80
|
};
|
|
81
|
+
/** The device service methods of a provider ({@link SandboxService.withDeviceServices}), bound. */
|
|
82
|
+
export type DeviceServiceMethods = Pick<DeviceProvider, "ensureService" | "stopService" | "serviceRequest" | "openStream">;
|
|
83
|
+
/** A device held for a stream ({@link SandboxService.holdForStream}). */
|
|
84
|
+
export interface StreamHold {
|
|
85
|
+
h: SandboxHandle;
|
|
86
|
+
/** The provider's `openStream`, bound. */
|
|
87
|
+
p: Required<Pick<DeviceProvider, "openStream">>;
|
|
88
|
+
/**
|
|
89
|
+
* Aborts when the caller's signal aborts or the hold ends (a lifecycle change of the device);
|
|
90
|
+
* the hold is then released.
|
|
91
|
+
*/
|
|
92
|
+
signal: AbortSignal;
|
|
93
|
+
/** Ends the hold (idempotent): holder record cleared, lease released, `last_used_at` moved. */
|
|
94
|
+
release(): Promise<void>;
|
|
95
|
+
}
|
|
81
96
|
/** What {@link SandboxService.ifRunning} did. */
|
|
82
97
|
export type IfRunningResult<T> = {
|
|
83
98
|
kind: "ran";
|
|
@@ -472,6 +487,31 @@ export declare class SandboxService {
|
|
|
472
487
|
* reconcile marker under the shared lease, before any provider call (B-11).
|
|
473
488
|
*/
|
|
474
489
|
private ifRunningAs;
|
|
490
|
+
/**
|
|
491
|
+
* Holds the device's running instance for a stream to one of its services (browser use spec
|
|
492
|
+
* §6.2: an open viewer counts as device use). It never creates, resumes or rebuilds an
|
|
493
|
+
* instance: a device without a running instance, whose provider is off in `orgId`, or that is
|
|
494
|
+
* in a lifecycle change (an exclusive lease or a pending intent) is refused with
|
|
495
|
+
* `DeviceAccessError("provider_unavailable")`; a provider without `openStream` with
|
|
496
|
+
* `capability_missing`.
|
|
497
|
+
*
|
|
498
|
+
* A hold is not a lease ({@link SandboxLeases.streamHold}): it takes no
|
|
499
|
+
* `sandbox.maxConcurrentCommands` slot and never blocks a lifecycle change. Idle suspension and
|
|
500
|
+
* the inactivity destruction (on any replica) skip a device with a live hold; the forced
|
|
501
|
+
* suspension after `maxRunningMinutes` does not. A hold yields to every lifecycle change:
|
|
502
|
+
* an exclusive acquisition ends the device's holds, and a pending intent makes their next
|
|
503
|
+
* renewal fail, so the returned `signal` aborts (also when the caller's `signal` aborts or a
|
|
504
|
+
* renewal deadline passes) and the hold is released. `release()` is idempotent and moves
|
|
505
|
+
* `last_used_at` forward, so the idle clock starts when the viewer goes.
|
|
506
|
+
*/
|
|
507
|
+
holdForStream(deviceId: string, orgId: string, signal: AbortSignal): Promise<StreamHold>;
|
|
508
|
+
/**
|
|
509
|
+
* Runs `fn` with the device service methods of the device's provider (browser use spec §5),
|
|
510
|
+
* as any use of the device does ({@link withSandbox}: the instance is created or resumed,
|
|
511
|
+
* `last_used_at` moves forward). `admit` sees the provider's methods first, before any lease
|
|
512
|
+
* or instance work, so a provider without services is refused without touching the device.
|
|
513
|
+
*/
|
|
514
|
+
withDeviceServices<T>(ctx: SandboxUseContext, admit: (p: DeviceServiceMethods) => void, fn: (h: SandboxHandle, p: DeviceServiceMethods, signal: AbortSignal) => Promise<T>, signal: AbortSignal): Promise<T>;
|
|
475
515
|
/**
|
|
476
516
|
* A short lease on one path of the device around the kernel's own read-modify-write of
|
|
477
517
|
* that file (spec §10.4); waits up to 30 s, then throws `SandboxPathBusyError`. Its `signal`
|
|
@@ -693,11 +733,14 @@ export declare class SandboxService {
|
|
|
693
733
|
revokeDeadHolder(deviceId: string, token: string): Promise<void>;
|
|
694
734
|
/**
|
|
695
735
|
* Suspends running instances idle longer than `suspendAfterIdleMinutes` or running continuously
|
|
696
|
-
* longer than `maxRunningMinutes`. Skips a device with any holder
|
|
736
|
+
* longer than `maxRunningMinutes`. Skips a device with any holder, and one with an open stream
|
|
737
|
+
* hold ({@link holdForStream}) unless it is past `maxRunningMinutes`; one past
|
|
697
738
|
* `maxRunningMinutes` gets the intent for one poll window (about a second) first. Returns how
|
|
698
739
|
* many it suspended. Called every minute by the `sandbox-suspend-idle` cron.
|
|
699
740
|
*/
|
|
700
741
|
suspendIdle(now: Date): Promise<number>;
|
|
742
|
+
/** Whether the device has a live stream hold; a Redis error counts as none (the sweep goes on). */
|
|
743
|
+
private streamHeld;
|
|
701
744
|
/** {@link suspendIdle} for the rows of one provider. */
|
|
702
745
|
private suspendIdleOf;
|
|
703
746
|
/**
|
|
@@ -8,7 +8,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
10
|
import { posix } from "node:path";
|
|
11
|
-
import { isDeviceOfflineError, isSandboxPermissionUnsupportedError, isSandboxScopeDeniedError, parseSandboxBrowseScope, parseSandboxExecutionRef, parseSandboxOperationScope, parseSandboxPreparationScope, SandboxOperationOutcomeUnknownError, SandboxPermissionUnsupportedError, SandboxScopeDeniedError, } from "@capybara-hq/plugin-sdk";
|
|
11
|
+
import { DeviceAccessError, isDeviceOfflineError, isSandboxPermissionUnsupportedError, isSandboxScopeDeniedError, parseSandboxBrowseScope, parseSandboxExecutionRef, parseSandboxOperationScope, parseSandboxPreparationScope, SandboxOperationOutcomeUnknownError, SandboxPermissionUnsupportedError, SandboxScopeDeniedError, } from "@capybara-hq/plugin-sdk";
|
|
12
12
|
import { asPlatform } from "../infra/database/org-scope.js";
|
|
13
13
|
import { runOutsideTransaction } from "../infra/database/transaction-host.js";
|
|
14
14
|
import { createHeldOperations, withKernelGeneration, } from "./held-operations.js";
|
|
@@ -124,6 +124,15 @@ function parseDeferred(raw) {
|
|
|
124
124
|
* holder's own last fenced write committed; null without a fence (nothing to compare).
|
|
125
125
|
*/
|
|
126
126
|
const tokenOf = (fence) => fence === null ? null : { token: fence.gen };
|
|
127
|
+
function serviceMethodsOf(impl) {
|
|
128
|
+
return {
|
|
129
|
+
...(impl.ensureService && { ensureService: impl.ensureService.bind(impl) }),
|
|
130
|
+
...(impl.stopService && { stopService: impl.stopService.bind(impl) }),
|
|
131
|
+
...(impl.serviceRequest && { serviceRequest: impl.serviceRequest.bind(impl) }),
|
|
132
|
+
...(impl.openStream && { openStream: impl.openStream.bind(impl) }),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const streamUnavailable = (message = "The device is not running; use a device tool first to start it, then open the stream again.") => new DeviceAccessError("provider_unavailable", message);
|
|
127
136
|
/** The signal of one provider call in maintenance: aborted on timeout or when the lease is lost. */
|
|
128
137
|
const opSignal = (lease) => AbortSignal.any([lease.signal, AbortSignal.timeout(SWEEP_OP_TIMEOUT_MS)]);
|
|
129
138
|
/** The provider-side name of a device's file system and instance. */
|
|
@@ -749,6 +758,110 @@ let SandboxService = class SandboxService {
|
|
|
749
758
|
await sleep(this.pollMs + Math.floor(Math.random() * this.pollMs), signal);
|
|
750
759
|
}
|
|
751
760
|
}
|
|
761
|
+
/**
|
|
762
|
+
* Holds the device's running instance for a stream to one of its services (browser use spec
|
|
763
|
+
* §6.2: an open viewer counts as device use). It never creates, resumes or rebuilds an
|
|
764
|
+
* instance: a device without a running instance, whose provider is off in `orgId`, or that is
|
|
765
|
+
* in a lifecycle change (an exclusive lease or a pending intent) is refused with
|
|
766
|
+
* `DeviceAccessError("provider_unavailable")`; a provider without `openStream` with
|
|
767
|
+
* `capability_missing`.
|
|
768
|
+
*
|
|
769
|
+
* A hold is not a lease ({@link SandboxLeases.streamHold}): it takes no
|
|
770
|
+
* `sandbox.maxConcurrentCommands` slot and never blocks a lifecycle change. Idle suspension and
|
|
771
|
+
* the inactivity destruction (on any replica) skip a device with a live hold; the forced
|
|
772
|
+
* suspension after `maxRunningMinutes` does not. A hold yields to every lifecycle change:
|
|
773
|
+
* an exclusive acquisition ends the device's holds, and a pending intent makes their next
|
|
774
|
+
* renewal fail, so the returned `signal` aborts (also when the caller's `signal` aborts or a
|
|
775
|
+
* renewal deadline passes) and the hold is released. `release()` is idempotent and moves
|
|
776
|
+
* `last_used_at` forward, so the idle clock starts when the viewer goes.
|
|
777
|
+
*/
|
|
778
|
+
async holdForStream(deviceId, orgId, signal) {
|
|
779
|
+
signal.throwIfAborted();
|
|
780
|
+
let p;
|
|
781
|
+
try {
|
|
782
|
+
p = await this.require(deviceId, orgId);
|
|
783
|
+
}
|
|
784
|
+
catch (err) {
|
|
785
|
+
if (err instanceof ApiError && err.code === "device.unavailable")
|
|
786
|
+
throw streamUnavailable(err.message);
|
|
787
|
+
if (err instanceof ApiError && err.code === "device.not_found")
|
|
788
|
+
throw new DeviceAccessError("no_device", err.message);
|
|
789
|
+
throw err;
|
|
790
|
+
}
|
|
791
|
+
const impl = p.impl;
|
|
792
|
+
if (!impl.openStream)
|
|
793
|
+
throw new DeviceAccessError("capability_missing", "This device's provider cannot open streams to device services; choose a device on a provider that supports them.");
|
|
794
|
+
const row = () => this.db
|
|
795
|
+
.selectFrom("device_instances")
|
|
796
|
+
.selectAll()
|
|
797
|
+
.where("device_id", "=", deviceId)
|
|
798
|
+
.where("org_id", "=", orgId)
|
|
799
|
+
.executeTakeFirst();
|
|
800
|
+
const before = await row();
|
|
801
|
+
if (!before || !this.usable(before, p, null))
|
|
802
|
+
throw streamUnavailable();
|
|
803
|
+
const lease = await this.leases.streamHold(deviceId);
|
|
804
|
+
if (!lease)
|
|
805
|
+
throw streamUnavailable();
|
|
806
|
+
// read again after the hold is recorded: a lifecycle change that finished before it was
|
|
807
|
+
// recorded shows in the row; one that starts later ends the hold
|
|
808
|
+
let after;
|
|
809
|
+
try {
|
|
810
|
+
after = await row();
|
|
811
|
+
}
|
|
812
|
+
catch (err) {
|
|
813
|
+
await lease.release();
|
|
814
|
+
throw err;
|
|
815
|
+
}
|
|
816
|
+
if (!after ||
|
|
817
|
+
!this.usable(after, p, null) ||
|
|
818
|
+
after.created_at.getTime() !== before.created_at.getTime()) {
|
|
819
|
+
await lease.release();
|
|
820
|
+
throw streamUnavailable();
|
|
821
|
+
}
|
|
822
|
+
// an open viewer is device use: its last use moves when the hold is taken and when it ends
|
|
823
|
+
const touch = () => this.db
|
|
824
|
+
.updateTable("device_instances")
|
|
825
|
+
.set({ last_used_at: sql `GREATEST(last_used_at, now())` })
|
|
826
|
+
.where("device_id", "=", deviceId)
|
|
827
|
+
.where("org_id", "=", orgId)
|
|
828
|
+
.where("status", "=", "running")
|
|
829
|
+
.execute()
|
|
830
|
+
.then(() => undefined, (err) => this.log.warn("cannot update sandbox last_used_at", { deviceId, err }));
|
|
831
|
+
await touch();
|
|
832
|
+
const sig = AbortSignal.any([signal, lease.lost]);
|
|
833
|
+
let released;
|
|
834
|
+
const onAbort = () => void release();
|
|
835
|
+
const release = () => {
|
|
836
|
+
released ??= (async () => {
|
|
837
|
+
sig.removeEventListener("abort", onAbort);
|
|
838
|
+
await lease.release();
|
|
839
|
+
await touch();
|
|
840
|
+
})();
|
|
841
|
+
return released;
|
|
842
|
+
};
|
|
843
|
+
sig.addEventListener("abort", onAbort, { once: true });
|
|
844
|
+
if (sig.aborted) {
|
|
845
|
+
await release();
|
|
846
|
+
throw abortReason(sig);
|
|
847
|
+
}
|
|
848
|
+
return {
|
|
849
|
+
h: after.handle,
|
|
850
|
+
p: { openStream: impl.openStream.bind(impl) },
|
|
851
|
+
signal: sig,
|
|
852
|
+
release,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Runs `fn` with the device service methods of the device's provider (browser use spec §5),
|
|
857
|
+
* as any use of the device does ({@link withSandbox}: the instance is created or resumed,
|
|
858
|
+
* `last_used_at` moves forward). `admit` sees the provider's methods first, before any lease
|
|
859
|
+
* or instance work, so a provider without services is refused without touching the device.
|
|
860
|
+
*/
|
|
861
|
+
async withDeviceServices(ctx, admit, fn, signal) {
|
|
862
|
+
admit(serviceMethodsOf((await this.require(ctx.deviceId, ctx.orgId)).impl));
|
|
863
|
+
return this.withSandboxUse(ctx, { kind: "services", fn }, signal);
|
|
864
|
+
}
|
|
752
865
|
/**
|
|
753
866
|
* A short lease on one path of the device around the kernel's own read-modify-write of
|
|
754
867
|
* that file (spec §10.4); waits up to 30 s, then throws `SandboxPathBusyError`. Its `signal`
|
|
@@ -1116,6 +1229,8 @@ let SandboxService = class SandboxService {
|
|
|
1116
1229
|
const sig = AbortSignal.any([signal, e.lease.signal]);
|
|
1117
1230
|
if (route.kind === "preparation")
|
|
1118
1231
|
return route.run(e.handle, p.impl, { ...e.info, roots: rootsOf(e.handle) }, sig);
|
|
1232
|
+
if (route.kind === "services")
|
|
1233
|
+
return route.fn(e.handle, serviceMethodsOf(p.impl), sig);
|
|
1119
1234
|
const env = ctx.deviceId;
|
|
1120
1235
|
if (route.kind === "kernelRead")
|
|
1121
1236
|
return route.fn(e.handle, this.kernelReadProvider(e, ctx, p, route.read, sig), { ...e.info, roots: rootsOf(e.handle) }, sig);
|
|
@@ -1791,7 +1906,8 @@ let SandboxService = class SandboxService {
|
|
|
1791
1906
|
}
|
|
1792
1907
|
/**
|
|
1793
1908
|
* Suspends running instances idle longer than `suspendAfterIdleMinutes` or running continuously
|
|
1794
|
-
* longer than `maxRunningMinutes`. Skips a device with any holder
|
|
1909
|
+
* longer than `maxRunningMinutes`. Skips a device with any holder, and one with an open stream
|
|
1910
|
+
* hold ({@link holdForStream}) unless it is past `maxRunningMinutes`; one past
|
|
1795
1911
|
* `maxRunningMinutes` gets the intent for one poll window (about a second) first. Returns how
|
|
1796
1912
|
* many it suspended. Called every minute by the `sandbox-suspend-idle` cron.
|
|
1797
1913
|
*/
|
|
@@ -1803,6 +1919,16 @@ let SandboxService = class SandboxService {
|
|
|
1803
1919
|
n += await this.suspendIdleOf(p, now);
|
|
1804
1920
|
return n;
|
|
1805
1921
|
}
|
|
1922
|
+
/** Whether the device has a live stream hold; a Redis error counts as none (the sweep goes on). */
|
|
1923
|
+
async streamHeld(deviceId) {
|
|
1924
|
+
try {
|
|
1925
|
+
return (await this.leases.streamHolds(deviceId)) > 0;
|
|
1926
|
+
}
|
|
1927
|
+
catch (err) {
|
|
1928
|
+
this.log.warn("cannot read the device's stream holds", { deviceId, err });
|
|
1929
|
+
return false;
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1806
1932
|
/** {@link suspendIdle} for the rows of one provider. */
|
|
1807
1933
|
async suspendIdleOf(p, now) {
|
|
1808
1934
|
const due = this.suspendDue(now, p.plugin);
|
|
@@ -1811,6 +1937,9 @@ let SandboxService = class SandboxService {
|
|
|
1811
1937
|
let n = 0;
|
|
1812
1938
|
await inPool(rows, SWEEP_CONCURRENCY, async (c) => {
|
|
1813
1939
|
const overdue = c.running_since !== null && c.running_since < runningBefore;
|
|
1940
|
+
// an open viewer exempts the device from idle suspension only, never from the forced one
|
|
1941
|
+
if (!overdue && (await this.streamHeld(c.device_id)))
|
|
1942
|
+
return;
|
|
1814
1943
|
const done = await this.tryLocked(c.device_id, async (lease) => {
|
|
1815
1944
|
return asPlatform("deployment-wide suspension sweep", async () => {
|
|
1816
1945
|
const id = c.device_id;
|
|
@@ -1837,7 +1966,10 @@ let SandboxService = class SandboxService {
|
|
|
1837
1966
|
this.log.info("sandbox suspended", { deviceId: id });
|
|
1838
1967
|
return true;
|
|
1839
1968
|
});
|
|
1840
|
-
}, overdue
|
|
1969
|
+
}, overdue,
|
|
1970
|
+
// a hold taken since the first look (a viewer that opened meanwhile) refuses the lease:
|
|
1971
|
+
// an open viewer exempts the device from idle suspension, never from the forced one
|
|
1972
|
+
!overdue);
|
|
1841
1973
|
if (done)
|
|
1842
1974
|
n++;
|
|
1843
1975
|
});
|
|
@@ -1872,6 +2004,9 @@ let SandboxService = class SandboxService {
|
|
|
1872
2004
|
const mine = (eb) => eb.and([eb("provider", "=", p.plugin), due(eb)]);
|
|
1873
2005
|
let n = 0;
|
|
1874
2006
|
await inPool(await this.candidates(mine), SWEEP_CONCURRENCY, async ({ device_id: id }) => {
|
|
2007
|
+
// an open viewer is device use: the inactivity destruction waits (a deleted device does not)
|
|
2008
|
+
if (mode === "instance" && (await this.streamHeld(id)))
|
|
2009
|
+
return;
|
|
1875
2010
|
const done = await this.tryLocked(id, async (lease) => {
|
|
1876
2011
|
return asPlatform("deployment-wide destruction sweep", async () => {
|
|
1877
2012
|
// org-filter: deployment-wide destruction sweep (worker) over every org's due instances,
|
|
@@ -2714,10 +2849,12 @@ let SandboxService = class SandboxService {
|
|
|
2714
2849
|
* wait briefly and the sweep gets in if the running ones end. Failures are warned, recorded in
|
|
2715
2850
|
* `sweep_failed_at` (sorted last next time) and return false.
|
|
2716
2851
|
*/
|
|
2717
|
-
async tryLocked(deviceId, fn, overdue = false
|
|
2852
|
+
async tryLocked(deviceId, fn, overdue = false,
|
|
2853
|
+
/** Refused (false) while the device has a live stream hold ({@link holdForStream}). */
|
|
2854
|
+
unlessStreams = false) {
|
|
2718
2855
|
let lease;
|
|
2719
2856
|
try {
|
|
2720
|
-
lease = await this.leases.tryExclusive(deviceId);
|
|
2857
|
+
lease = await this.leases.tryExclusive(deviceId, unlessStreams ? { unlessStreams } : {});
|
|
2721
2858
|
if (!lease && overdue) {
|
|
2722
2859
|
lease = await this.leases
|
|
2723
2860
|
.acquireExclusive(deviceId, AbortSignal.timeout(SWEEP_OP_TIMEOUT_MS), Math.max(this.pollMs * 2, SWEEP_INTENT_WAIT_MS), { intent: true })
|
|
@@ -61,23 +61,12 @@ export interface KeptToolResult {
|
|
|
61
61
|
* or after its files are rebuilt (a provider that fixes limits at its file system).
|
|
62
62
|
*/
|
|
63
63
|
export type NetworkAppliesAt = "next-command" | "next-use" | "files-reset";
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
* the command and its kept `tool_result` (written with a note when the ask settles; the command is
|
|
67
|
-
* never run again), when "add to this device's list" would apply, and once approved what took
|
|
68
|
-
* effect.
|
|
69
|
-
*/
|
|
70
|
-
export interface NetworkAskDetail {
|
|
64
|
+
/** What every network ask's `detail` holds ({@link NetworkAskDetail}). */
|
|
65
|
+
interface NetworkAskDetailBase {
|
|
71
66
|
deviceId: string;
|
|
72
|
-
hosts: {
|
|
73
|
-
host: string;
|
|
74
|
-
port: number;
|
|
75
|
-
}[];
|
|
76
|
-
command: string;
|
|
77
|
-
description: string | null;
|
|
78
67
|
/** When hosts added to the device's own list apply ({@link NetworkAppliesAt}). */
|
|
79
68
|
appliesAt: NetworkAppliesAt;
|
|
80
|
-
/** The formatted `tool_result` of the
|
|
69
|
+
/** The formatted `tool_result` of the call and its display-only fields. */
|
|
81
70
|
result: KeptToolResult;
|
|
82
71
|
/** The hosts the decision allowed (every approved decision writes them; none: nothing). */
|
|
83
72
|
grantedHosts?: string[];
|
|
@@ -87,8 +76,44 @@ export interface NetworkAskDetail {
|
|
|
87
76
|
*/
|
|
88
77
|
outcome?: "once" | "always";
|
|
89
78
|
}
|
|
90
|
-
/**
|
|
91
|
-
|
|
79
|
+
/**
|
|
80
|
+
* A command's network ask (network ask-to-allow spec §6.1, P-D2): the device, the refused hosts,
|
|
81
|
+
* the command and its kept `tool_result` (written with a note when the ask settles; the command is
|
|
82
|
+
* never run again), when "add to this device's list" would apply, and once approved what took
|
|
83
|
+
* effect. `kind` absent: a command too.
|
|
84
|
+
*/
|
|
85
|
+
export interface CommandNetworkAskDetail extends NetworkAskDetailBase {
|
|
86
|
+
kind?: "command";
|
|
87
|
+
hosts: {
|
|
88
|
+
host: string;
|
|
89
|
+
port: number;
|
|
90
|
+
}[];
|
|
91
|
+
command: string;
|
|
92
|
+
description: string | null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A device service's network ask (browser use spec §7.1): an extension's tool call whose service
|
|
96
|
+
* saw `hosts` refused by the device's allowlist. It offers only `always` (the device's own list:
|
|
97
|
+
* a run grant applies per exec and cannot reach a long-lived service); approved, the call runs
|
|
98
|
+
* again, otherwise its kept result is written with the outcome's note. `service` names the
|
|
99
|
+
* extension whose service asked; `url` is the page it was loading when known.
|
|
100
|
+
*/
|
|
101
|
+
export interface ServiceNetworkAskDetail extends NetworkAskDetailBase {
|
|
102
|
+
kind: "service";
|
|
103
|
+
service: string;
|
|
104
|
+
url: string | null;
|
|
105
|
+
hosts: string[];
|
|
106
|
+
/** The call's attempt (`tool_call_started`) that asked: the re-run takes the next one. */
|
|
107
|
+
attempt: number;
|
|
108
|
+
}
|
|
109
|
+
/** A network ask's `detail`: a command's or a device service's. */
|
|
110
|
+
export type NetworkAskDetail = CommandNetworkAskDetail | ServiceNetworkAskDetail;
|
|
111
|
+
/** `Omit` over each member of a union. */
|
|
112
|
+
type OmitEach<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
113
|
+
/** A network ask's detail as the API shows it: without the kept call result. */
|
|
114
|
+
export type NetworkAskView = OmitEach<NetworkAskDetail, "result">;
|
|
115
|
+
/** The hosts a network ask asked about, whichever kind it is. */
|
|
116
|
+
export declare function networkAskHosts(detail: Pick<NetworkAskDetail, "hosts" | "kind">): string[];
|
|
92
117
|
/**
|
|
93
118
|
* A git push ask's `detail` (sandbox git credentials spec §7): the host, the repository
|
|
94
119
|
* (`<owner>/<repo>`, normalized) and the refs of the push the gateway held, the command that ran
|
|
@@ -387,7 +412,9 @@ export interface NetworkAskInput {
|
|
|
387
412
|
callId: string;
|
|
388
413
|
/** The device owner: the only person who may decide. */
|
|
389
414
|
requestedFor: string;
|
|
390
|
-
|
|
415
|
+
/** The tool key the ask is recorded under: the call's (`Bash` for a command). */
|
|
416
|
+
toolKey: string;
|
|
417
|
+
detail: OmitEach<NetworkAskDetail, "grantedHosts" | "outcome">;
|
|
391
418
|
/**
|
|
392
419
|
* What the device's provider enforces (device-provider spec §6.3, `networkAskOffer`): `once` (a
|
|
393
420
|
* run grant) only with per-operation hosts, `always` (add to the device's own list) only when
|
|
@@ -395,8 +422,6 @@ export interface NetworkAskInput {
|
|
|
395
422
|
*/
|
|
396
423
|
scopes: ("once" | "always")[];
|
|
397
424
|
}
|
|
398
|
-
/** The tool key a network ask is recorded under (the command ran in `Bash`). */
|
|
399
|
-
export declare const NETWORK_ASK_TOOL_KEY = "Bash";
|
|
400
425
|
/** The tool key a git ask is recorded under (the push ran in a `Bash` command). */
|
|
401
426
|
export declare const GIT_ASK_TOOL_KEY = "Bash";
|
|
402
427
|
/**
|
|
@@ -499,7 +524,7 @@ export declare class ApprovalsService {
|
|
|
499
524
|
/**
|
|
500
525
|
* A network ask (network ask-to-allow spec §6.2): a pending approval of kind `network` for the
|
|
501
526
|
* device owner, expiring like a tool approval (`tools.approvalTimeoutHours`), and its
|
|
502
|
-
* `approval_requested` (tool key
|
|
527
|
+
* `approval_requested` (the call's tool key, the display-only `network.hosts`), in one transaction.
|
|
503
528
|
* It takes the attempt after the call's other approvals (P-D4: the command ran, so no tool
|
|
504
529
|
* approval of the call follows it). One per call: a second request returns the first.
|
|
505
530
|
*/
|
|
@@ -48,6 +48,12 @@ import { ToolRegistry } from "./registry.js";
|
|
|
48
48
|
export { APPROVAL_DENY_REASON_MAX_CHARS } from "../conversations/events.js";
|
|
49
49
|
/** `list` 一次最多返回的审批数(收件箱据此判断这个来源是否取满)。 */
|
|
50
50
|
export const APPROVALS_LIST_MAX = 100;
|
|
51
|
+
/** The hosts a network ask asked about, whichever kind it is. */
|
|
52
|
+
export function networkAskHosts(detail) {
|
|
53
|
+
return detail.kind === "service"
|
|
54
|
+
? [...detail.hosts]
|
|
55
|
+
: detail.hosts.map((h) => h.host);
|
|
56
|
+
}
|
|
51
57
|
/**
|
|
52
58
|
* The model-visible note written after a network ask's kept result when its run is stopped before
|
|
53
59
|
* the device owner answered (spec §6.7).
|
|
@@ -115,8 +121,6 @@ const NETWORK_APPLIES_AT = new Set([
|
|
|
115
121
|
"next-use",
|
|
116
122
|
"files-reset",
|
|
117
123
|
]);
|
|
118
|
-
/** The tool key a network ask is recorded under (the command ran in `Bash`). */
|
|
119
|
-
export const NETWORK_ASK_TOOL_KEY = "Bash";
|
|
120
124
|
/** The spec hash of a network ask (no tool definition is approved). */
|
|
121
125
|
const NETWORK_ASK_SPEC_HASH = "network";
|
|
122
126
|
/** The tool key a git ask is recorded under (the push ran in a `Bash` command). */
|
|
@@ -427,18 +431,24 @@ let ApprovalsService = class ApprovalsService {
|
|
|
427
431
|
/**
|
|
428
432
|
* A network ask (network ask-to-allow spec §6.2): a pending approval of kind `network` for the
|
|
429
433
|
* device owner, expiring like a tool approval (`tools.approvalTimeoutHours`), and its
|
|
430
|
-
* `approval_requested` (tool key
|
|
434
|
+
* `approval_requested` (the call's tool key, the display-only `network.hosts`), in one transaction.
|
|
431
435
|
* It takes the attempt after the call's other approvals (P-D4: the command ran, so no tool
|
|
432
436
|
* approval of the call follows it). One per call: a second request returns the first.
|
|
433
437
|
*/
|
|
434
438
|
async requestNetwork(input) {
|
|
435
|
-
const hosts = input.detail
|
|
439
|
+
const hosts = networkAskHosts(input.detail);
|
|
436
440
|
if (hosts.length === 0 || hosts.length > NETWORK_ASK_MAX_HOSTS) {
|
|
437
441
|
throw new Error(`a network ask lists 1 to ${NETWORK_ASK_MAX_HOSTS} hosts`);
|
|
438
442
|
}
|
|
439
|
-
if (hosts.some((h) => h.
|
|
443
|
+
if (hosts.some((h) => h.length === 0 || h.length > NETWORK_HOST_MAX_CHARS)) {
|
|
440
444
|
throw new Error("a network ask's host is 1 to 255 characters");
|
|
441
445
|
}
|
|
446
|
+
if (input.toolKey.length === 0)
|
|
447
|
+
throw new Error("a network ask names its call's tool key");
|
|
448
|
+
// a service's ask offers only the device's own list (a run grant cannot reach its process)
|
|
449
|
+
if (input.detail.kind === "service" && input.scopes.some((k) => k !== "always")) {
|
|
450
|
+
throw new Error('a device service\'s network ask offers only "always"');
|
|
451
|
+
}
|
|
442
452
|
const scopes = new Set(input.scopes);
|
|
443
453
|
if (scopes.size === 0 ||
|
|
444
454
|
scopes.size !== input.scopes.length ||
|
|
@@ -490,7 +500,7 @@ let ApprovalsService = class ApprovalsService {
|
|
|
490
500
|
attempt: Number(last?.attempt ?? 0) + 1,
|
|
491
501
|
kind: "network",
|
|
492
502
|
detail: JSON.stringify(input.detail),
|
|
493
|
-
tool_key:
|
|
503
|
+
tool_key: input.toolKey,
|
|
494
504
|
spec_hash: NETWORK_ASK_SPEC_HASH,
|
|
495
505
|
connector_id: null,
|
|
496
506
|
input: JSON.stringify({}),
|
|
@@ -515,7 +525,7 @@ let ApprovalsService = class ApprovalsService {
|
|
|
515
525
|
approvalId: rec.id,
|
|
516
526
|
toolKey: rec.toolKey,
|
|
517
527
|
expiresAt: rec.expiresAt,
|
|
518
|
-
network: { hosts: input.detail
|
|
528
|
+
network: { hosts: networkAskHosts(input.detail) },
|
|
519
529
|
requestedFor: rec.requestedFor,
|
|
520
530
|
approverRole: null,
|
|
521
531
|
},
|
|
@@ -923,7 +933,7 @@ let ApprovalsService = class ApprovalsService {
|
|
|
923
933
|
}
|
|
924
934
|
if (row.expired)
|
|
925
935
|
throw new ApiError("approval.already_decided", "Approval has expired");
|
|
926
|
-
const asked = [...new Set(detail
|
|
936
|
+
const asked = [...new Set(networkAskHosts(detail))];
|
|
927
937
|
let network;
|
|
928
938
|
if (body.decision === "approve") {
|
|
929
939
|
const scope = body.scope ?? "once";
|
|
@@ -1384,7 +1394,7 @@ let ApprovalsService = class ApprovalsService {
|
|
|
1384
1394
|
},
|
|
1385
1395
|
]);
|
|
1386
1396
|
if (network !== undefined && before.detail !== null) {
|
|
1387
|
-
const asked = [...new Set(before.detail
|
|
1397
|
+
const asked = [...new Set(networkAskHosts(before.detail))];
|
|
1388
1398
|
const refused = asked.filter((h) => !network.wanted.includes(h));
|
|
1389
1399
|
await audit(t, {
|
|
1390
1400
|
actorAccountId: accountId,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ToolCallContext } from "@capybara-hq/plugin-sdk";
|
|
2
|
+
import type { ReviewRecord } from "../conversations/events.js";
|
|
3
|
+
import type { ConversationKindForHooks } from "../runtime/hook-calls.js";
|
|
4
|
+
/**
|
|
5
|
+
* The call scope (browser use spec §7.1): what a tool handler's kernel services report about one
|
|
6
|
+
* call while it runs, read by the pipeline once the handler returns, and the run facts the
|
|
7
|
+
* pipeline knows about the call that the SDK context does not carry. It lives on the call's own
|
|
8
|
+
* context object under {@link CALL_SCOPE}, written and read within the same call on the same
|
|
9
|
+
* replica, never in a module-level map.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CALL_SCOPE: unique symbol;
|
|
12
|
+
/** The run facts of a call (what the command review of a device service launch needs). */
|
|
13
|
+
export interface CallFacts {
|
|
14
|
+
runId: string;
|
|
15
|
+
step: number;
|
|
16
|
+
/** The root conversation of the run's tree (a sub-agent works in its root's device). */
|
|
17
|
+
rootConversationId: string;
|
|
18
|
+
/** An unattended run (a scheduled task): nobody is there to answer an ask. */
|
|
19
|
+
unattended: boolean;
|
|
20
|
+
agentVersion: number;
|
|
21
|
+
conversationKind?: ConversationKindForHooks;
|
|
22
|
+
/** A sub-agent's call: its parent run (hooks and the review's usage). */
|
|
23
|
+
parent?: {
|
|
24
|
+
conversationId: string;
|
|
25
|
+
runId: string;
|
|
26
|
+
callId: string;
|
|
27
|
+
budgetRunId?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface CallScope {
|
|
31
|
+
/** Absent for a scope attached outside the pipeline (nothing reads it then). */
|
|
32
|
+
facts?: CallFacts;
|
|
33
|
+
/**
|
|
34
|
+
* The device a `ctx.deviceAccess` call of this call resolved (`ensureService` / `request`), or
|
|
35
|
+
* null when none did yet.
|
|
36
|
+
*/
|
|
37
|
+
device: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The command review's record of a device service launch during this call
|
|
40
|
+
* (`ctx.deviceAccess.ensureService`), written with the call's result as a reviewed `Bash`
|
|
41
|
+
* call's is; null when nothing was reviewed. The last review wins.
|
|
42
|
+
*/
|
|
43
|
+
review: ReviewRecord | null;
|
|
44
|
+
/**
|
|
45
|
+
* Hosts a device service (`ctx.deviceAccess.reportBlockedHosts`) saw refused by the device's
|
|
46
|
+
* network allowlist during this call; null when nothing was reported. `deviceId` is the device
|
|
47
|
+
* this call's own `ctx.deviceAccess` calls resolved, or null when the call made none (the
|
|
48
|
+
* pipeline then asks about the device the call's conversation works in); `url` is the page the
|
|
49
|
+
* refusals came from, when the service said.
|
|
50
|
+
*/
|
|
51
|
+
blocked: {
|
|
52
|
+
deviceId: string | null;
|
|
53
|
+
hosts: Set<string>;
|
|
54
|
+
url: string | null;
|
|
55
|
+
} | null;
|
|
56
|
+
}
|
|
57
|
+
/** Attaches a fresh scope to the call's context (the pipeline, before the handler runs). */
|
|
58
|
+
export declare function attachCallScope(ctx: ToolCallContext, facts?: CallFacts): CallScope;
|
|
59
|
+
/** The call's scope, or null for a context the pipeline did not make (no scope attached). */
|
|
60
|
+
export declare function callScopeOf(ctx: ToolCallContext): CallScope | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The call scope (browser use spec §7.1): what a tool handler's kernel services report about one
|
|
3
|
+
* call while it runs, read by the pipeline once the handler returns, and the run facts the
|
|
4
|
+
* pipeline knows about the call that the SDK context does not carry. It lives on the call's own
|
|
5
|
+
* context object under {@link CALL_SCOPE}, written and read within the same call on the same
|
|
6
|
+
* replica, never in a module-level map.
|
|
7
|
+
*/
|
|
8
|
+
export const CALL_SCOPE = Symbol("capybara.callScope");
|
|
9
|
+
/** Attaches a fresh scope to the call's context (the pipeline, before the handler runs). */
|
|
10
|
+
export function attachCallScope(ctx, facts) {
|
|
11
|
+
const scope = {
|
|
12
|
+
device: null,
|
|
13
|
+
review: null,
|
|
14
|
+
blocked: null,
|
|
15
|
+
...(facts !== undefined && { facts }),
|
|
16
|
+
};
|
|
17
|
+
ctx[CALL_SCOPE] = scope;
|
|
18
|
+
return scope;
|
|
19
|
+
}
|
|
20
|
+
/** The call's scope, or null for a context the pipeline did not make (no scope attached). */
|
|
21
|
+
export function callScopeOf(ctx) {
|
|
22
|
+
return ctx[CALL_SCOPE] ?? null;
|
|
23
|
+
}
|
|
@@ -64,6 +64,14 @@ export interface DeviceAskFacts {
|
|
|
64
64
|
* `addNetworkHostsIn` accepts), so an offered decision does not fail for that.
|
|
65
65
|
*/
|
|
66
66
|
export declare function deviceAskTerms(f: DeviceAskFacts): Required<Pick<NetworkPlanContext, "refusal" | "offer" | "onList" | "deviceBlocks">>;
|
|
67
|
+
/**
|
|
68
|
+
* The ask terms for a device service's refusals (browser use spec §7.1): a long-lived service is
|
|
69
|
+
* reached only through the device's own list, never a per-exec run grant, so a host is offered
|
|
70
|
+
* only `always` and refused when the list cannot take it (`listAddRefusal`: beyond the org's or
|
|
71
|
+
* platform's hosts, or a device with no list of its own); a host the list already holds waits for
|
|
72
|
+
* it to apply ({@link deviceAskTerms}' `onList`).
|
|
73
|
+
*/
|
|
74
|
+
export declare function serviceAskTerms(f: DeviceAskFacts): Required<Pick<NetworkPlanContext, "refusal" | "offer" | "onList" | "deviceBlocks">>;
|
|
67
75
|
/** Asked, allowed this time (a run grant: "once"). */
|
|
68
76
|
export declare const allowedOnceNote: (hosts: readonly string[]) => string;
|
|
69
77
|
/**
|
|
@@ -71,6 +79,11 @@ export declare const allowedOnceNote: (hosts: readonly string[]) => string;
|
|
|
71
79
|
* apply at `appliesAt`, never to the command that asked, which is not run again.
|
|
72
80
|
*/
|
|
73
81
|
export declare const addedToDeviceNote: (hosts: readonly string[], appliesAt: NetworkAppliesAt) => string;
|
|
82
|
+
/**
|
|
83
|
+
* Not asked: a device service's call that already asked once (it ran again after the person added
|
|
84
|
+
* hosts to the device's list, browser use spec §7.1) was refused more hosts; one ask per call.
|
|
85
|
+
*/
|
|
86
|
+
export declare const serviceAskedNote: (hosts: readonly string[]) => string;
|
|
74
87
|
/**
|
|
75
88
|
* Not asked: the device's network settings already allow the host (its own list, added by an
|
|
76
89
|
* earlier answer or on the device page, or the org's hosts it follows), but its sandbox has not
|