@capybara-hq/kernel 0.1.0-rc.65 → 0.1.0-rc.67
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/bootstrap.json +0 -8
- package/dist/admin/admin.schemas.d.ts +3 -0
- package/dist/agents/admin-agents.d.ts +2 -2
- package/dist/agents/admin-agents.js +2 -1
- package/dist/agents/agent-lookup.js +2 -1
- package/dist/agents/agent-profile.service.d.ts +5 -2
- package/dist/agents/agent-profile.service.js +13 -2
- package/dist/agents/agents.controller.d.ts +4 -3
- package/dist/agents/agents.controller.js +7 -3
- package/dist/agents/agents.module.js +3 -0
- package/dist/agents/agents.schemas.d.ts +6 -6
- package/dist/agents/agents.service.d.ts +23 -2
- package/dist/agents/agents.service.js +61 -6
- package/dist/agents/avatar-view.d.ts +8 -0
- package/dist/agents/avatar-view.js +12 -0
- package/dist/agents/profile.d.ts +38 -13
- package/dist/agents/profile.js +31 -20
- package/dist/attribution/platform-attribution.d.ts +15 -6
- package/dist/attribution/platform-attribution.js +31 -14
- package/dist/background/poll.job.d.ts +1 -1
- package/dist/background/poll.job.js +8 -6
- package/dist/background/tasks.service.js +1 -1
- package/dist/catalog/catalog-content.d.ts +6 -3
- package/dist/catalog/catalog-content.js +7 -8
- package/dist/catalog/claude/translate.js +1 -1
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/marketplaces.service.js +2 -1
- package/dist/catalog/plugin-package.d.ts +3 -2
- package/dist/channels/file-delivery.d.ts +2 -0
- package/dist/channels/file-delivery.js +1 -1
- package/dist/channels/inbound.d.ts +8 -4
- package/dist/channels/inbound.js +14 -7
- package/dist/channels/outbound.js +11 -5
- package/dist/channels/phrases.d.ts +21 -13
- package/dist/channels/phrases.js +21 -14
- package/dist/client/client-files.js +1 -1
- package/dist/config/product-name.d.ts +8 -0
- package/dist/config/product-name.js +9 -0
- package/dist/config/schema.d.ts +1 -0
- package/dist/config/schema.js +17 -4
- package/dist/conversations/conversations.service.d.ts +4 -3
- package/dist/conversations/conversations.service.js +15 -2
- package/dist/ctx/create-ctx.js +5 -2
- package/dist/ctx/device-provider-check.d.ts +7 -0
- package/dist/ctx/device-provider-check.js +21 -0
- package/dist/db/kernel-schema.d.ts +7 -0
- package/dist/devices/access.d.ts +16 -46
- package/dist/devices/access.js +26 -62
- package/dist/devices/access.module.js +2 -2
- package/dist/devices/conversation-devices.d.ts +38 -18
- package/dist/devices/conversation-devices.js +69 -51
- package/dist/devices/default-provider-setting.d.ts +45 -0
- package/dist/devices/default-provider-setting.js +59 -0
- package/dist/devices/device-projects.service.js +7 -2
- package/dist/devices/device-provider-selection.d.ts +37 -0
- package/dist/devices/device-provider-selection.js +86 -0
- package/dist/devices/device-provider-selection.module.d.ts +3 -0
- package/dist/devices/device-provider-selection.module.js +22 -0
- package/dist/devices/devices.controller.d.ts +8 -5
- package/dist/devices/devices.controller.js +7 -4
- package/dist/devices/devices.module.js +3 -1
- package/dist/devices/devices.schemas.js +2 -2
- package/dist/devices/devices.service.d.ts +72 -83
- package/dist/devices/devices.service.js +139 -248
- package/dist/devices/dto.d.ts +9 -0
- package/dist/devices/dto.js +15 -2
- package/dist/devices/label.d.ts +3 -5
- package/dist/devices/label.js +3 -14
- package/dist/devices/legacy-cleanup.job.d.ts +2 -2
- package/dist/devices/legacy-cleanup.job.js +6 -6
- package/dist/errors.d.ts +15 -1
- package/dist/errors.js +15 -1
- package/dist/extensions/guide-places.d.ts +2 -1
- package/dist/extensions/guide-places.js +8 -2
- package/dist/extensions/locks.d.ts +1 -1
- package/dist/extensions/locks.js +1 -1
- package/dist/extensions/org-config.d.ts +20 -4
- package/dist/extensions/org-config.js +23 -6
- package/dist/extensions/permission-view.d.ts +2 -2
- package/dist/extensions/permission-view.js +2 -2
- package/dist/extensions/plugin-guides.d.ts +1 -1
- package/dist/extensions/plugin-guides.js +11 -3
- package/dist/extensions/point-defaults.d.ts +14 -0
- package/dist/extensions/point-defaults.js +70 -47
- package/dist/extensions/resolve.js +7 -2
- package/dist/git/gateway.d.ts +9 -0
- package/dist/git/gateway.js +36 -17
- package/dist/git/gateway.route.d.ts +1 -1
- package/dist/git/gateway.route.js +1 -3
- package/dist/http/app.d.ts +1 -1
- package/dist/identity/app-auth.d.ts +4 -3
- package/dist/identity/app-auth.js +7 -8
- package/dist/identity/settings.d.ts +8 -0
- package/dist/identity/settings.js +30 -3
- package/dist/identity/sso.d.ts +13 -7
- package/dist/identity/sso.js +21 -7
- package/dist/infra/config/kernel-config.service.js +3 -1
- package/dist/lifecycle/kernel-lifecycle.js +7 -6
- package/dist/local-devices/device-routes.d.ts +1 -1
- package/dist/local-devices/device-routes.js +2 -2
- package/dist/local-devices/local-device-provider.d.ts +14 -11
- package/dist/local-devices/local-device-provider.js +14 -0
- package/dist/local-devices/local-devices.module.d.ts +4 -4
- package/dist/local-devices/local-devices.module.js +5 -3
- package/dist/local-devices/owner-report.js +2 -1
- package/dist/local-devices/targets.d.ts +2 -0
- package/dist/local-devices/targets.js +10 -0
- package/dist/orgs/offboarding.js +9 -0
- package/dist/orgs/settings.service.d.ts +26 -1
- package/dist/orgs/settings.service.js +44 -3
- package/dist/platform/ops/admin.ops.js +8 -3
- package/dist/platform/ops/agents.ops.d.ts +6 -1
- package/dist/platform/ops/agents.ops.js +38 -11
- package/dist/platform/ops/devices.ops.js +25 -20
- package/dist/platform/ops/orgs.ops.js +1 -0
- package/dist/platform/ops/platform-icons.ops.js +4 -4
- package/dist/platform/ops/platform.ops.js +2 -1
- package/dist/platform/ops/themes.ops.js +1 -1
- package/dist/runtime/plugin-context.service.js +1 -12
- package/dist/sandbox/cloud-permission-snapshot.d.ts +2 -2
- package/dist/sandbox/cloud-permission-snapshot.js +3 -3
- package/dist/sandbox/device-reports.d.ts +50 -0
- package/dist/sandbox/device-reports.js +157 -0
- package/dist/sandbox/held-operations.d.ts +8 -8
- package/dist/sandbox/leases.d.ts +1 -1
- package/dist/sandbox/leases.js +1 -1
- package/dist/sandbox/operation-authority.d.ts +5 -2
- package/dist/sandbox/operation-authority.js +12 -11
- package/dist/sandbox/operation-reconcile.job.d.ts +2 -2
- package/dist/sandbox/operation-reconcile.job.js +5 -5
- package/dist/sandbox/permission-availability.d.ts +2 -2
- package/dist/sandbox/permission-call-types.d.ts +5 -0
- package/dist/sandbox/permission-facts.d.ts +2 -2
- package/dist/sandbox/permission-facts.js +5 -5
- package/dist/sandbox/providers.d.ts +23 -24
- package/dist/sandbox/providers.js +38 -46
- package/dist/sandbox/providers.module.js +3 -3
- package/dist/sandbox/review/classifier.d.ts +6 -0
- package/dist/sandbox/review/classifier.js +12 -1
- package/dist/sandbox/review/index.d.ts +1 -1
- package/dist/sandbox/review/index.js +1 -1
- package/dist/sandbox/sandbox.module.d.ts +1 -1
- package/dist/sandbox/sandbox.module.js +7 -2
- package/dist/sandbox/sandbox.service.d.ts +95 -68
- package/dist/sandbox/sandbox.service.js +212 -208
- package/dist/setup/setup-guides.service.d.ts +4 -1
- package/dist/setup/setup-guides.service.js +6 -1
- package/dist/themes/avatar-preset-key.d.ts +6 -0
- package/dist/themes/avatar-preset-key.js +9 -0
- package/dist/themes/platform-icon.service.js +1 -1
- package/dist/themes/theme-delivery.service.d.ts +10 -2
- package/dist/themes/theme-delivery.service.js +26 -11
- package/dist/themes/theme-state.d.ts +43 -2
- package/dist/themes/theme-state.js +61 -4
- package/dist/themes/themes-public.controller.d.ts +3 -3
- package/dist/themes/themes-public.controller.js +3 -3
- package/dist/themes/themes.service.d.ts +28 -1
- package/dist/themes/themes.service.js +36 -2
- package/dist/tools/builtins/image/generate.d.ts +3 -0
- package/dist/tools/builtins/image/generate.js +21 -11
- package/dist/tools/builtins/image/index.d.ts +1 -1
- package/dist/tools/builtins/image/index.js +1 -1
- package/dist/tools/builtins/platform.js +25 -17
- package/dist/tools/builtins/sandbox/common.d.ts +37 -13
- package/dist/tools/builtins/sandbox/common.js +63 -19
- package/dist/tools/builtins/sandbox/read.d.ts +5 -2
- package/dist/tools/builtins/sandbox/read.js +9 -6
- package/dist/tools/builtins/sandbox/task-output.d.ts +2 -2
- package/dist/tools/builtins/sandbox/task-output.js +6 -5
- package/dist/tools/builtins/skill-load.js +13 -4
- package/dist/tools/connectors.service.js +2 -1
- package/dist/tools/oauth/discovery.d.ts +2 -0
- package/dist/tools/oauth/discovery.js +3 -1
- package/dist/until-aborted.d.ts +5 -0
- package/dist/until-aborted.js +16 -0
- package/package.json +4 -4
- package/src/migrations/0176_device_report.sql +6 -0
package/dist/sandbox/leases.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { KernelLogger } from "../log.js";
|
|
|
7
7
|
* protocol that lets several holders (every conversation bound to the device, and their
|
|
8
8
|
* sub-agents) use one device's running instance concurrently (shared leases: commands, file
|
|
9
9
|
* reads and writes) while lifecycle changes (create, resume, rebuild, suspend, destroy, reset) stay
|
|
10
|
-
* alone (exclusive leases). Every `
|
|
10
|
+
* alone (exclusive leases). Every `device-provider@1` provider runs commands concurrently and kills by tag,
|
|
11
11
|
* so there is no single-holder mode. Keys, env = the device id:
|
|
12
12
|
*
|
|
13
13
|
* - `capk:sandbox:<env>`: the lock key: an exclusive holder's token, or `shared` while shared
|
package/dist/sandbox/leases.js
CHANGED
|
@@ -18,7 +18,7 @@ import { KERNEL_LOGGER, REDIS } from "../infra/tokens.js";
|
|
|
18
18
|
* protocol that lets several holders (every conversation bound to the device, and their
|
|
19
19
|
* sub-agents) use one device's running instance concurrently (shared leases: commands, file
|
|
20
20
|
* reads and writes) while lifecycle changes (create, resume, rebuild, suspend, destroy, reset) stay
|
|
21
|
-
* alone (exclusive leases). Every `
|
|
21
|
+
* alone (exclusive leases). Every `device-provider@1` provider runs commands concurrently and kills by tag,
|
|
22
22
|
* so there is no single-holder mode. Keys, env = the device id:
|
|
23
23
|
*
|
|
24
24
|
* - `capk:sandbox:<env>`: the lock key: an exclusive holder's token, or `shared` while shared
|
|
@@ -27,7 +27,8 @@ export interface PermissionScopeFacts {
|
|
|
27
27
|
actor: SandboxActor;
|
|
28
28
|
tag: string;
|
|
29
29
|
workingRoot: string;
|
|
30
|
-
|
|
30
|
+
/** The bound project's path when it is the working root, else null (free mode). */
|
|
31
|
+
projectRoot: string | null;
|
|
31
32
|
writeRoots: readonly string[];
|
|
32
33
|
allowedHosts: readonly string[];
|
|
33
34
|
/** The sandbox network of the call ({@link sandboxNetworkOf}); `allowlist` uses `allowedHosts`. */
|
|
@@ -51,7 +52,9 @@ export declare function sandboxNetworkOf(box: Pick<DeviceSandbox, "networkMode">
|
|
|
51
52
|
/**
|
|
52
53
|
* Only server-resolved facts enter this constructor; callers never submit roots or profile. It
|
|
53
54
|
* never branches on the profile: every call is sandboxed (scoped filesystem, the sandbox network),
|
|
54
|
-
* and only an escalated call within the outside-sandbox ceiling gets the device pair.
|
|
55
|
+
* and only an escalated call within the outside-sandbox ceiling gets the device pair. A scoped
|
|
56
|
+
* filesystem names the project root and the write roots only: what a sandboxed operation may read
|
|
57
|
+
* is the provider's rule.
|
|
55
58
|
*/
|
|
56
59
|
export declare function intersectPermissionScope(f: PermissionScopeFacts): SandboxOperationScope;
|
|
57
60
|
/** Fresh authority shape only. Provider dispatch must add durable admission fencing before use. */
|
|
@@ -81,7 +81,9 @@ const instanceRoots = (workingRoot) => [...new Set(["/", workingRoot])].sort(per
|
|
|
81
81
|
/**
|
|
82
82
|
* Only server-resolved facts enter this constructor; callers never submit roots or profile. It
|
|
83
83
|
* never branches on the profile: every call is sandboxed (scoped filesystem, the sandbox network),
|
|
84
|
-
* and only an escalated call within the outside-sandbox ceiling gets the device pair.
|
|
84
|
+
* and only an escalated call within the outside-sandbox ceiling gets the device pair. A scoped
|
|
85
|
+
* filesystem names the project root and the write roots only: what a sandboxed operation may read
|
|
86
|
+
* is the provider's rule.
|
|
85
87
|
*/
|
|
86
88
|
export function intersectPermissionScope(f) {
|
|
87
89
|
if (f.escalated && (!f.outsideSandboxCeiling || f.boundary === "instance"))
|
|
@@ -103,12 +105,12 @@ export function intersectPermissionScope(f) {
|
|
|
103
105
|
: f.boundary === "instance"
|
|
104
106
|
? {
|
|
105
107
|
kind: "scoped",
|
|
106
|
-
|
|
108
|
+
projectRoot: f.projectRoot,
|
|
107
109
|
writeRoots: instanceRoots(f.workingRoot),
|
|
108
110
|
}
|
|
109
111
|
: {
|
|
110
112
|
kind: "scoped",
|
|
111
|
-
|
|
113
|
+
projectRoot: f.projectRoot,
|
|
112
114
|
writeRoots: [...new Set(f.writeRoots)].sort(),
|
|
113
115
|
},
|
|
114
116
|
network: escalated
|
|
@@ -308,10 +310,8 @@ let SandboxOperationAuthority = class SandboxOperationAuthority {
|
|
|
308
310
|
: [];
|
|
309
311
|
const scope = this.scopeOf(ctx, operation, {
|
|
310
312
|
...f,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
...(grant?.expansion.readDirectories ?? []),
|
|
314
|
-
],
|
|
313
|
+
// an accepted read-directory expansion stays in the review facts and the grant row but
|
|
314
|
+
// reaches no provider: a scope carries no read roots (the provider's read rule decides)
|
|
315
315
|
baseWriteDirectories: [
|
|
316
316
|
...f.baseWriteDirectories,
|
|
317
317
|
...(grant?.expansion.writeDirectories ?? []),
|
|
@@ -382,7 +382,7 @@ let SandboxOperationAuthority = class SandboxOperationAuthority {
|
|
|
382
382
|
}
|
|
383
383
|
const profile = this.scopeOf(ctx, method, f);
|
|
384
384
|
if (profile.filesystem.kind === "scoped" &&
|
|
385
|
-
!
|
|
385
|
+
!f.baseReadDirectories.some((r) => covering === r || covering.startsWith(r === "/" ? "/" : `${r}/`)))
|
|
386
386
|
throw new ApiError("forbidden", "The kernel read is outside the conversation's profile");
|
|
387
387
|
// a restricted read-only scope whenever the runtime enforces it, whatever the conversation's
|
|
388
388
|
// profile: a runtime keyed on Full access may follow a symlinked AGENTS.md or SKILL.md out of
|
|
@@ -396,10 +396,10 @@ let SandboxOperationAuthority = class SandboxOperationAuthority {
|
|
|
396
396
|
filesystem: instance
|
|
397
397
|
? {
|
|
398
398
|
kind: "scoped",
|
|
399
|
-
|
|
399
|
+
projectRoot: covering,
|
|
400
400
|
writeRoots: instanceRoots(f.workingRoot),
|
|
401
401
|
}
|
|
402
|
-
: { kind: "scoped",
|
|
402
|
+
: { kind: "scoped", projectRoot: covering, writeRoots: [] },
|
|
403
403
|
network: { kind: "none" },
|
|
404
404
|
});
|
|
405
405
|
}
|
|
@@ -442,7 +442,7 @@ let SandboxOperationAuthority = class SandboxOperationAuthority {
|
|
|
442
442
|
actor: ctx.actor,
|
|
443
443
|
tag: operationId,
|
|
444
444
|
workingRoot: f.workingRoot,
|
|
445
|
-
|
|
445
|
+
projectRoot: f.projectRoot,
|
|
446
446
|
writeRoots: f.baseWriteDirectories,
|
|
447
447
|
allowedHosts: isExecutionMethod(operation) ? f.baseHosts : [],
|
|
448
448
|
// a native method reaches no network: only executions carry the sandbox network
|
|
@@ -548,6 +548,7 @@ let SandboxOperationAuthority = class SandboxOperationAuthority {
|
|
|
548
548
|
scopeRevision: view.scopeRevision,
|
|
549
549
|
authorityRevision: permissionScopeHash({ scopeRevision: view.scopeRevision, vector }),
|
|
550
550
|
workingRoot,
|
|
551
|
+
projectRoot,
|
|
551
552
|
baseReadDirectories: restrictedReadRoots(workingRoot, applied),
|
|
552
553
|
baseWriteDirectories: [workingRoot],
|
|
553
554
|
baseHosts: allowedHosts,
|
|
@@ -4,7 +4,7 @@ import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
|
4
4
|
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
5
5
|
import type { KernelLogger } from "../log.js";
|
|
6
6
|
import { SandboxOperationIntents } from "./operation-intents.js";
|
|
7
|
-
import {
|
|
7
|
+
import { DeviceProviders } from "./providers.js";
|
|
8
8
|
import { SandboxService } from "./sandbox.service.js";
|
|
9
9
|
/** Called only by the maintenance consumer. It has no native dispatch or lease token API. */
|
|
10
10
|
export declare class SandboxOperationReconcileJob {
|
|
@@ -17,7 +17,7 @@ export declare class SandboxOperationReconcileJob {
|
|
|
17
17
|
private readonly config;
|
|
18
18
|
/** Where a recovered start's refusal keeps the provider's own message (never the task's). */
|
|
19
19
|
private readonly log?;
|
|
20
|
-
constructor(intents: SandboxOperationIntents, db: KernelDb, providers:
|
|
20
|
+
constructor(intents: SandboxOperationIntents, db: KernelDb, providers: Pick<DeviceProviders, "forDevice">, sandbox: Pick<SandboxService, "ifRunning">, tasks: Pick<BackgroundTaskStore, "byOperation" | "settleOwedCancel">, stopper: Pick<BackgroundTaskStopper, "stop">, config: Pick<KernelConfigService, "get">,
|
|
21
21
|
/** Where a recovered start's refusal keeps the provider's own message (never the task's). */
|
|
22
22
|
log?: Pick<KernelLogger, "warn"> | undefined);
|
|
23
23
|
reconcile(operationId: string): Promise<void>;
|
|
@@ -18,7 +18,7 @@ import { KERNEL_LOGGER } from "../infra/tokens.js";
|
|
|
18
18
|
import { isDeviceRequestNotSent } from "../local-devices/relay.js";
|
|
19
19
|
import { checkManagedStart } from "./held-operations.js";
|
|
20
20
|
import { SandboxOperationIntents } from "./operation-intents.js";
|
|
21
|
-
import {
|
|
21
|
+
import { DeviceProviders } from "./providers.js";
|
|
22
22
|
import { SandboxService } from "./sandbox.service.js";
|
|
23
23
|
/**
|
|
24
24
|
* What an operation's in-sandbox time limit leaves beyond `sandbox.limits.maxCommandSeconds`
|
|
@@ -111,11 +111,11 @@ let SandboxOperationReconcileJob = class SandboxOperationReconcileJob {
|
|
|
111
111
|
.select("provider")
|
|
112
112
|
.where("device_id", "=", claimed.device_id)
|
|
113
113
|
.executeTakeFirst();
|
|
114
|
-
const entry = this.providers.
|
|
114
|
+
const entry = this.providers.forDevice(claimed.provider);
|
|
115
115
|
if (!Number.isSafeInteger(generation) ||
|
|
116
116
|
instance?.provider !== claimed.provider ||
|
|
117
117
|
!entry ||
|
|
118
|
-
|
|
118
|
+
entry.version !== claimed.provider_version)
|
|
119
119
|
throw new SandboxOperationOutcomeUnknownError("The recorded provider or instance is not current; the start outcome remains unknown");
|
|
120
120
|
const r = await this.sandbox.ifRunning(claimed.device_id, { createdAt: new Date(generation) }, async (p, h, signal) => {
|
|
121
121
|
await checkManagedStart(p, h, scope, input, signal);
|
|
@@ -201,7 +201,7 @@ let SandboxOperationReconcileJob = class SandboxOperationReconcileJob {
|
|
|
201
201
|
}
|
|
202
202
|
throw new SandboxOperationOutcomeUnknownError("The revoked operation's instance must be reconciled before cleanup is acknowledged");
|
|
203
203
|
}
|
|
204
|
-
const provider = this.providers.
|
|
204
|
+
const provider = this.providers.forDevice(row.provider)?.impl;
|
|
205
205
|
if (!provider?.revokeOperation)
|
|
206
206
|
throw new SandboxOperationOutcomeUnknownError("The operation's provider is unavailable; revocation remains owed");
|
|
207
207
|
await provider.revokeOperation(instance.handle, { operationId: row.operation_id, admitBeforeMs: row.deadline.getTime() }, AbortSignal.timeout(30_000));
|
|
@@ -283,7 +283,7 @@ SandboxOperationReconcileJob = __decorate([
|
|
|
283
283
|
Injectable(),
|
|
284
284
|
__param(0, Inject(SandboxOperationIntents)),
|
|
285
285
|
__param(1, Inject(KernelDb)),
|
|
286
|
-
__param(2, Inject(
|
|
286
|
+
__param(2, Inject(DeviceProviders)),
|
|
287
287
|
__param(3, Inject(SandboxService)),
|
|
288
288
|
__param(4, Inject(BackgroundTaskStore)),
|
|
289
289
|
__param(5, Inject(BackgroundTaskStopper)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SandboxPermissionSupport, SandboxPermissionUnsupportedError
|
|
1
|
+
import { type DeviceProvider, type SandboxPermissionSupport, SandboxPermissionUnsupportedError } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
/**
|
|
3
3
|
* Why a device cannot run permission-scoped work, for people and for the kernel-rendered admission
|
|
4
4
|
* text (ruling R9): an outdated sandbox provider plugin, or a runtime that cannot enforce the
|
|
@@ -43,7 +43,7 @@ export declare const unprobedPermissionAvailability: () => PermissionAvailabilit
|
|
|
43
43
|
* (ruling R9).
|
|
44
44
|
*/
|
|
45
45
|
export declare function permissionAvailabilityFor(provider: {
|
|
46
|
-
impl:
|
|
46
|
+
impl: DeviceProvider;
|
|
47
47
|
plugin: string;
|
|
48
48
|
version?: string;
|
|
49
49
|
} | undefined): PermissionAvailability;
|
|
@@ -98,6 +98,11 @@ export type PermissionReviewSnapshot = Readonly<Omit<PermissionCallBinding, "too
|
|
|
98
98
|
baseWriteDirectories: readonly string[];
|
|
99
99
|
baseHosts: readonly string[];
|
|
100
100
|
workingRoot: string;
|
|
101
|
+
/**
|
|
102
|
+
* The bound project's path when it is the working root (`workingRootOf`), else null (free
|
|
103
|
+
* mode, or a project the review works around in the workspace). An operation scope names it.
|
|
104
|
+
*/
|
|
105
|
+
projectRoot: string | null;
|
|
101
106
|
/**
|
|
102
107
|
* The call's sandbox network (the device sandbox within the applied outer boundary): `open-public`,
|
|
103
108
|
* `allowlist` (the base hosts plus accepted host grants) or `none`. Absent reads as `none`.
|
|
@@ -9,7 +9,7 @@ import { type ConsentReach, type DeviceSandbox, type HostGrantCeiling } from "./
|
|
|
9
9
|
import { type DeviceNetwork, type EffectiveDevicePolicy } from "./modes.js";
|
|
10
10
|
import { type PermissionAvailability } from "./permission-availability.js";
|
|
11
11
|
import type { AppliedEnvironment, AppliedOuterNetwork } from "./permission-context-types.js";
|
|
12
|
-
import {
|
|
12
|
+
import { DeviceProviders } from "./providers.js";
|
|
13
13
|
type Scope = DeviceProjectScope;
|
|
14
14
|
/**
|
|
15
15
|
* What decides the working root of a call (project root spec §4.3), read the same way for a
|
|
@@ -33,7 +33,7 @@ export declare class PermissionFacts {
|
|
|
33
33
|
private readonly config;
|
|
34
34
|
private readonly providers;
|
|
35
35
|
private readonly devices;
|
|
36
|
-
constructor(db: KernelDb, config: Pick<KernelConfigService, "get" | "fieldSource">, providers: Pick<
|
|
36
|
+
constructor(db: KernelDb, config: Pick<KernelConfigService, "get" | "fieldSource">, providers: Pick<DeviceProviders, "forDevice">, devices: Pick<DeviceAccess, "usable">);
|
|
37
37
|
/**
|
|
38
38
|
* Current policy, the device sandbox and persisted owner roots; access is checked by the caller.
|
|
39
39
|
* `sandbox` is the device sandbox under the device's current runtime report (the provider layer
|
|
@@ -28,7 +28,7 @@ import { appliedOf, appliedWider, cloudChosenMode, coversHost, effectiveDevicePo
|
|
|
28
28
|
import { assertAuthorityHeld } from "./permission-authority-lock.js";
|
|
29
29
|
import { deviceWorkAvailability, permissionAvailabilityFor, } from "./permission-availability.js";
|
|
30
30
|
import { readCurrentReport, readRuntimeReport, sameRuntimeIdentity, } from "./permission-runtime-reports.js";
|
|
31
|
-
import {
|
|
31
|
+
import { DeviceProviders } from "./providers.js";
|
|
32
32
|
import { homeOf } from "./review/rules.js";
|
|
33
33
|
export const permissionScopeHash = (value) => createHash("sha256").update(canonical(value)).digest("hex");
|
|
34
34
|
function canonical(value) {
|
|
@@ -302,7 +302,7 @@ let PermissionFacts = class PermissionFacts {
|
|
|
302
302
|
.where("id", "=", deviceId)
|
|
303
303
|
.where("org_id", "=", orgId)
|
|
304
304
|
.executeTakeFirst();
|
|
305
|
-
const provider = device ?
|
|
305
|
+
const provider = device ? this.providers.forDevice(device.provider) : undefined;
|
|
306
306
|
let availability = permissionAvailabilityFor(provider);
|
|
307
307
|
if (availability.state === "unprobed" && provider) {
|
|
308
308
|
const machine = provider.plugin === "@local"
|
|
@@ -445,7 +445,7 @@ let PermissionFacts = class PermissionFacts {
|
|
|
445
445
|
supported: deviceFeaturesOf(row.features).includes("projects"),
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
|
-
const impl =
|
|
448
|
+
const impl = this.providers.forDevice(row.provider)?.impl;
|
|
449
449
|
const handle = row.handle;
|
|
450
450
|
return {
|
|
451
451
|
source: "cloud",
|
|
@@ -750,7 +750,7 @@ let PermissionFacts = class PermissionFacts {
|
|
|
750
750
|
.select("provider")
|
|
751
751
|
.where("id", "=", input.deviceId)
|
|
752
752
|
.executeTakeFirst();
|
|
753
|
-
const entry =
|
|
753
|
+
const entry = this.providers.forDevice(device?.provider ?? null);
|
|
754
754
|
if (!entry || entry.plugin !== instance.provider)
|
|
755
755
|
return null;
|
|
756
756
|
const evidence = await readCurrentReport(this.db.db, input.deviceId, entry.plugin, entry.version);
|
|
@@ -782,7 +782,7 @@ PermissionFacts = __decorate([
|
|
|
782
782
|
Injectable(),
|
|
783
783
|
__param(0, Inject(KernelDb)),
|
|
784
784
|
__param(1, Inject(KernelConfigService)),
|
|
785
|
-
__param(2, Inject(
|
|
785
|
+
__param(2, Inject(DeviceProviders)),
|
|
786
786
|
__param(3, Inject(DeviceAccess))
|
|
787
787
|
], PermissionFacts);
|
|
788
788
|
export { PermissionFacts };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DeviceProvider } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
3
3
|
/** The kernel-internal provider of connected machines (local devices). */
|
|
4
4
|
export declare const LOCAL_PROVIDER = "@local";
|
|
5
5
|
/**
|
|
6
6
|
* A kernel-internal provider name: it starts with `@`, which no extension name can
|
|
7
|
-
* (`EXTENSION_NAME_RE`), so it never collides with a loaded `
|
|
7
|
+
* (`EXTENSION_NAME_RE`), so it never collides with a loaded `device-provider@1` plugin.
|
|
8
8
|
*/
|
|
9
9
|
export declare const isInternalProvider: (name: string) => boolean;
|
|
10
10
|
/**
|
|
@@ -23,11 +23,12 @@ export interface SandboxInstanceBinder {
|
|
|
23
23
|
*/
|
|
24
24
|
bind(deviceId: string, signal: AbortSignal): Promise<unknown>;
|
|
25
25
|
}
|
|
26
|
-
/** A
|
|
27
|
-
export interface
|
|
26
|
+
/** A device provider: its name (plugin name, or an internal `@…` name) and implementation. */
|
|
27
|
+
export interface DeviceProviderEntry {
|
|
28
28
|
plugin: string;
|
|
29
|
-
version
|
|
30
|
-
|
|
29
|
+
/** The loaded extension's version; a kernel-internal provider reports the kernel version. */
|
|
30
|
+
version: string;
|
|
31
|
+
impl: DeviceProvider;
|
|
31
32
|
/**
|
|
32
33
|
* The staged path's instance binder: the exclusive lifecycle holder binds the generation before
|
|
33
34
|
* it downgrades, and shared use waits for an installed binding. Absent on protocol 2.
|
|
@@ -35,34 +36,32 @@ export interface SandboxProviderEntry {
|
|
|
35
36
|
binder?: SandboxInstanceBinder;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
|
-
* The
|
|
39
|
+
* The device providers of this process (a registry: which of them serve an org is
|
|
40
|
+
* `DeviceProviderSelection`). A cloud provider is a loaded `device-provider@1` extension,
|
|
39
41
|
* read from the {@link ExtensionRegistry} at every call (providers are ready only after the
|
|
40
|
-
* extension load, and change with installs). Kernel-internal providers (`@local`) are registered
|
|
41
|
-
*
|
|
42
|
+
* extension load, and change with installs). Kernel-internal providers (`@local`) are registered by their
|
|
43
|
+
* module on init, in every replica: they are code, not shared state.
|
|
42
44
|
*
|
|
43
|
-
* Every `
|
|
45
|
+
* Every `device-provider@1` extension is handed out guarded: a network-level failure to reach it is
|
|
44
46
|
* rethrown as `SandboxProviderUnreachableError` (`./unreachable.ts`), so the tools can tell it
|
|
45
47
|
* apart. Internal providers are not: their failures (the device relay's Redis, the machine's
|
|
46
48
|
* connection) are the kernel's own and have their own errors.
|
|
47
49
|
*/
|
|
48
|
-
export declare class
|
|
50
|
+
export declare class DeviceProviders {
|
|
49
51
|
private readonly registry;
|
|
50
52
|
private readonly internal;
|
|
51
53
|
constructor(registry: Pick<ExtensionRegistry, "list">);
|
|
52
54
|
/** Registers a kernel-internal provider (an `@…` name); a later registration replaces it. */
|
|
53
|
-
register(entry:
|
|
54
|
-
/** The cloud provider (the loaded `sandbox@2` extension); undefined without one. */
|
|
55
|
-
cloud(): SandboxProviderEntry | undefined;
|
|
55
|
+
register(entry: DeviceProviderEntry): void;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* The provider of a device, from its `devices.provider` (fixed at creation): a registered
|
|
58
|
+
* internal one (`@local`), else the loaded `device-provider@1` extension of that plugin name,
|
|
59
|
+
* on in no org in particular (whether it serves the device's org is
|
|
60
|
+
* `DeviceProviderSelection.isOnInOrg`). Undefined when neither exists, or for a device without
|
|
61
|
+
* a provider (`null`). Never another provider in its place.
|
|
59
62
|
*/
|
|
60
|
-
|
|
63
|
+
forDevice(provider: string | null): DeviceProviderEntry | undefined;
|
|
64
|
+
/** Every loaded `device-provider@1` extension (no internal ones), in registry order: the sweeps. */
|
|
65
|
+
loaded(): DeviceProviderEntry[];
|
|
66
|
+
private guarded;
|
|
61
67
|
}
|
|
62
|
-
/**
|
|
63
|
-
* The provider a device works with, from its `devices.provider`: an internal one
|
|
64
|
-
* (`@local`) by that name only, never falling back to the cloud provider; any other device
|
|
65
|
-
* is a cloud device and uses the current cloud provider (files kept by another provider are
|
|
66
|
-
* refused by the sandbox service, `device.unavailable`).
|
|
67
|
-
*/
|
|
68
|
-
export declare function providerForDevice(providers: Pick<SandboxProviders, "cloud" | "forName">, provider: string | null): SandboxProviderEntry | undefined;
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { DEVICE_PROVIDER_EXTENSION_POINT } from "@capybara-hq/plugin-sdk";
|
|
11
11
|
import { Inject, Injectable } from "@nestjs/common";
|
|
12
12
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
13
13
|
import { guardProviderConnection } from "./unreachable.js";
|
|
@@ -15,21 +15,22 @@ import { guardProviderConnection } from "./unreachable.js";
|
|
|
15
15
|
export const LOCAL_PROVIDER = "@local";
|
|
16
16
|
/**
|
|
17
17
|
* A kernel-internal provider name: it starts with `@`, which no extension name can
|
|
18
|
-
* (`EXTENSION_NAME_RE`), so it never collides with a loaded `
|
|
18
|
+
* (`EXTENSION_NAME_RE`), so it never collides with a loaded `device-provider@1` plugin.
|
|
19
19
|
*/
|
|
20
20
|
export const isInternalProvider = (name) => name.startsWith("@");
|
|
21
21
|
/**
|
|
22
|
-
* The
|
|
22
|
+
* The device providers of this process (a registry: which of them serve an org is
|
|
23
|
+
* `DeviceProviderSelection`). A cloud provider is a loaded `device-provider@1` extension,
|
|
23
24
|
* read from the {@link ExtensionRegistry} at every call (providers are ready only after the
|
|
24
|
-
* extension load, and change with installs). Kernel-internal providers (`@local`) are registered
|
|
25
|
-
*
|
|
25
|
+
* extension load, and change with installs). Kernel-internal providers (`@local`) are registered by their
|
|
26
|
+
* module on init, in every replica: they are code, not shared state.
|
|
26
27
|
*
|
|
27
|
-
* Every `
|
|
28
|
+
* Every `device-provider@1` extension is handed out guarded: a network-level failure to reach it is
|
|
28
29
|
* rethrown as `SandboxProviderUnreachableError` (`./unreachable.ts`), so the tools can tell it
|
|
29
30
|
* apart. Internal providers are not: their failures (the device relay's Redis, the machine's
|
|
30
31
|
* connection) are the kernel's own and have their own errors.
|
|
31
32
|
*/
|
|
32
|
-
let
|
|
33
|
+
let DeviceProviders = class DeviceProviders {
|
|
33
34
|
registry;
|
|
34
35
|
internal = new Map();
|
|
35
36
|
constructor(registry) {
|
|
@@ -38,54 +39,45 @@ let SandboxProviders = class SandboxProviders {
|
|
|
38
39
|
/** Registers a kernel-internal provider (an `@…` name); a later registration replaces it. */
|
|
39
40
|
register(entry) {
|
|
40
41
|
if (!isInternalProvider(entry.plugin)) {
|
|
41
|
-
throw new Error(`an internal
|
|
42
|
+
throw new Error(`an internal device provider name starts with @: ${entry.plugin}`);
|
|
42
43
|
}
|
|
43
44
|
this.internal.set(entry.plugin, entry);
|
|
44
45
|
}
|
|
45
|
-
/** The cloud provider (the loaded `sandbox@2` extension); undefined without one. */
|
|
46
|
-
cloud() {
|
|
47
|
-
const e = this.registry.list("sandbox").find((x) => x.capability === SANDBOX_EXTENSION_POINT);
|
|
48
|
-
return e
|
|
49
|
-
? {
|
|
50
|
-
plugin: e.plugin,
|
|
51
|
-
version: e.version,
|
|
52
|
-
impl: guardProviderConnection(e.impl),
|
|
53
|
-
}
|
|
54
|
-
: undefined;
|
|
55
|
-
}
|
|
56
46
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
47
|
+
* The provider of a device, from its `devices.provider` (fixed at creation): a registered
|
|
48
|
+
* internal one (`@local`), else the loaded `device-provider@1` extension of that plugin name,
|
|
49
|
+
* on in no org in particular (whether it serves the device's org is
|
|
50
|
+
* `DeviceProviderSelection.isOnInOrg`). Undefined when neither exists, or for a device without
|
|
51
|
+
* a provider (`null`). Never another provider in its place.
|
|
59
52
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
forDevice(provider) {
|
|
54
|
+
if (provider === null)
|
|
55
|
+
return undefined;
|
|
56
|
+
const own = this.internal.get(provider);
|
|
62
57
|
if (own)
|
|
63
58
|
return own;
|
|
64
59
|
const e = this.registry
|
|
65
|
-
.list("
|
|
66
|
-
.find((x) => x.capability ===
|
|
67
|
-
return e
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
.list("device-provider")
|
|
61
|
+
.find((x) => x.capability === DEVICE_PROVIDER_EXTENSION_POINT && x.plugin === provider);
|
|
62
|
+
return e ? this.guarded(e) : undefined;
|
|
63
|
+
}
|
|
64
|
+
/** Every loaded `device-provider@1` extension (no internal ones), in registry order: the sweeps. */
|
|
65
|
+
loaded() {
|
|
66
|
+
return this.registry
|
|
67
|
+
.list("device-provider")
|
|
68
|
+
.filter((x) => x.capability === DEVICE_PROVIDER_EXTENSION_POINT)
|
|
69
|
+
.map((e) => this.guarded(e));
|
|
70
|
+
}
|
|
71
|
+
guarded(e) {
|
|
72
|
+
return {
|
|
73
|
+
plugin: e.plugin,
|
|
74
|
+
version: e.version,
|
|
75
|
+
impl: guardProviderConnection(e.impl),
|
|
76
|
+
};
|
|
74
77
|
}
|
|
75
78
|
};
|
|
76
|
-
|
|
79
|
+
DeviceProviders = __decorate([
|
|
77
80
|
Injectable(),
|
|
78
81
|
__param(0, Inject(ExtensionRegistry))
|
|
79
|
-
],
|
|
80
|
-
export {
|
|
81
|
-
/**
|
|
82
|
-
* The provider a device works with, from its `devices.provider`: an internal one
|
|
83
|
-
* (`@local`) by that name only, never falling back to the cloud provider; any other device
|
|
84
|
-
* is a cloud device and uses the current cloud provider (files kept by another provider are
|
|
85
|
-
* refused by the sandbox service, `device.unavailable`).
|
|
86
|
-
*/
|
|
87
|
-
export function providerForDevice(providers, provider) {
|
|
88
|
-
if (provider !== null && isInternalProvider(provider))
|
|
89
|
-
return providers.forName(provider);
|
|
90
|
-
return providers.cloud();
|
|
91
|
-
}
|
|
82
|
+
], DeviceProviders);
|
|
83
|
+
export { DeviceProviders };
|
|
@@ -6,14 +6,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { Module } from "@nestjs/common";
|
|
8
8
|
import { ExtensionRegistryModule } from "../extensions/registry.js";
|
|
9
|
-
import {
|
|
9
|
+
import { DeviceProviders } from "./providers.js";
|
|
10
10
|
let SandboxProviderRegistryModule = class SandboxProviderRegistryModule {
|
|
11
11
|
};
|
|
12
12
|
SandboxProviderRegistryModule = __decorate([
|
|
13
13
|
Module({
|
|
14
14
|
imports: [ExtensionRegistryModule],
|
|
15
|
-
providers: [
|
|
16
|
-
exports: [
|
|
15
|
+
providers: [DeviceProviders],
|
|
16
|
+
exports: [DeviceProviders],
|
|
17
17
|
})
|
|
18
18
|
], SandboxProviderRegistryModule);
|
|
19
19
|
export { SandboxProviderRegistryModule };
|
|
@@ -130,6 +130,12 @@ export declare const PERSON_MESSAGES_READ = 20;
|
|
|
130
130
|
* tool review read the same messages.
|
|
131
131
|
*/
|
|
132
132
|
export declare function readPersonMessages(db: KernelDb["db"], rootConversationId: string, budget: number): Promise<string>;
|
|
133
|
+
/**
|
|
134
|
+
* The bounded text of person messages read newest first (as {@link readPersonMessages} queries
|
|
135
|
+
* them): put back in conversation order, oldest first, before {@link boundMessages}, which keeps
|
|
136
|
+
* the newest within the budget and which the review prompts present as "oldest first".
|
|
137
|
+
*/
|
|
138
|
+
export declare function personMessagesText(payloadsNewestFirst: readonly unknown[], budget: number): string;
|
|
133
139
|
/** The identity facts the hook payloads need (all of them: without one, no hooks fire). */
|
|
134
140
|
export interface ReviewHookFacts {
|
|
135
141
|
accountId: string;
|
|
@@ -291,7 +291,18 @@ export async function readPersonMessages(db, rootConversationId, budget) {
|
|
|
291
291
|
.orderBy("seq", "desc")
|
|
292
292
|
.limit(PERSON_MESSAGES_READ)
|
|
293
293
|
.execute();
|
|
294
|
-
|
|
294
|
+
return personMessagesText(rows.map((r) => r.payload), budget);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* The bounded text of person messages read newest first (as {@link readPersonMessages} queries
|
|
298
|
+
* them): put back in conversation order, oldest first, before {@link boundMessages}, which keeps
|
|
299
|
+
* the newest within the budget and which the review prompts present as "oldest first".
|
|
300
|
+
*/
|
|
301
|
+
export function personMessagesText(payloadsNewestFirst, budget) {
|
|
302
|
+
const texts = payloadsNewestFirst
|
|
303
|
+
.map((p) => textOfUserMessage(p))
|
|
304
|
+
.filter((t) => t !== "")
|
|
305
|
+
.reverse();
|
|
295
306
|
return boundMessages(texts, budget);
|
|
296
307
|
}
|
|
297
308
|
/* ---------------------------------------------------------------------------------------------- *
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* a model or a lock; the parser and the table are pure.
|
|
6
6
|
*/
|
|
7
7
|
export type { ClassifierAnswer, ReviewClassifierDeps, ReviewClassifierInput, ReviewHookFacts, ReviewModelCall, ReviewModelCallArgs, ReviewOutcomeTexts, RunClassifierArgs, } from "./classifier.js";
|
|
8
|
-
export { boundMessages, callReviewModel, classifierMessage, fitReviewInput, fitReviewText, newReviewTag, parseReviewAnswer, REVIEW_ASK_REASON, REVIEW_MAX_OUTPUT_TOKENS, REVIEW_PURPOSE, REVIEW_SYSTEM_PROMPT, REVIEW_TRUNCATED_ASK_REASON, REVIEW_TRUNCATED_MARKER, REVIEW_UNAVAILABLE_PREFIX, readPersonMessages, reviewModelLimits, reviewSystemPrompt, runClassifier, } from "./classifier.js";
|
|
8
|
+
export { boundMessages, callReviewModel, classifierMessage, fitReviewInput, fitReviewText, newReviewTag, parseReviewAnswer, personMessagesText, REVIEW_ASK_REASON, REVIEW_MAX_OUTPUT_TOKENS, REVIEW_PURPOSE, REVIEW_SYSTEM_PROMPT, REVIEW_TRUNCATED_ASK_REASON, REVIEW_TRUNCATED_MARKER, REVIEW_UNAVAILABLE_PREFIX, readPersonMessages, reviewModelLimits, reviewSystemPrompt, runClassifier, } from "./classifier.js";
|
|
9
9
|
export type { CommandReview, ReviewCall, ReviewInput, ReviewVerdict } from "./review.service.js";
|
|
10
10
|
export { CommandReviewService, REVIEW_REASONS, } from "./review.service.js";
|
|
11
11
|
export { parseCommand, reviewRules, reviewWrite, writtenPaths, } from "./rules.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* auto mode (and for the file writes outside the workspace). Only the service touches the database,
|
|
5
5
|
* a model or a lock; the parser and the table are pure.
|
|
6
6
|
*/
|
|
7
|
-
export { boundMessages, callReviewModel, classifierMessage, fitReviewInput, fitReviewText, newReviewTag, parseReviewAnswer, REVIEW_ASK_REASON, REVIEW_MAX_OUTPUT_TOKENS, REVIEW_PURPOSE, REVIEW_SYSTEM_PROMPT, REVIEW_TRUNCATED_ASK_REASON, REVIEW_TRUNCATED_MARKER, REVIEW_UNAVAILABLE_PREFIX, readPersonMessages, reviewModelLimits, reviewSystemPrompt, runClassifier, } from "./classifier.js";
|
|
7
|
+
export { boundMessages, callReviewModel, classifierMessage, fitReviewInput, fitReviewText, newReviewTag, parseReviewAnswer, personMessagesText, REVIEW_ASK_REASON, REVIEW_MAX_OUTPUT_TOKENS, REVIEW_PURPOSE, REVIEW_SYSTEM_PROMPT, REVIEW_TRUNCATED_ASK_REASON, REVIEW_TRUNCATED_MARKER, REVIEW_UNAVAILABLE_PREFIX, readPersonMessages, reviewModelLimits, reviewSystemPrompt, runClassifier, } from "./classifier.js";
|
|
8
8
|
export { CommandReviewService, REVIEW_REASONS, } from "./review.service.js";
|
|
9
9
|
export { parseCommand, reviewRules, reviewWrite, writtenPaths, } from "./rules.js";
|
|
10
10
|
export { applySessionGrants, isSessionGrantableRule } from "./types.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
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
4
|
* every command passes in auto mode ({@link CommandReviewService}), and the producer of the
|
|
5
5
|
* one-off `sandbox-destroy-for` jobs (`MaintenanceProcessor` consumes them). The sweeps
|
|
6
6
|
* (`SandboxSweepJobs`) are the worker role's (`WorkerModule`).
|
|
@@ -7,12 +7,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Module } from "@nestjs/common";
|
|
8
8
|
import { BackgroundStoreModule } from "../background/store.module.js";
|
|
9
9
|
import { EventLogModule } from "../conversations/event-log.js";
|
|
10
|
+
import { DeviceProviderSelectionModule } from "../devices/device-provider-selection.module.js";
|
|
10
11
|
import { ExtensionsModule } from "../extensions/extensions.module.js";
|
|
11
12
|
import { QueueModule } from "../infra/queue/queue.module.js";
|
|
12
13
|
import { ModelsModule } from "../models/models.module.js";
|
|
13
14
|
import { MAINTENANCE_QUEUE_NAME } from "../runtime/maintenance-queue.js";
|
|
14
15
|
import { StepLogModule } from "../runtime/step-log.js";
|
|
15
16
|
import { CloudPermissionSnapshotsModule } from "./cloud-permission-snapshot.module.js";
|
|
17
|
+
import { DeviceReports } from "./device-reports.js";
|
|
16
18
|
import { SandboxJobs } from "./jobs.js";
|
|
17
19
|
import { LegacyRetirementModule } from "./legacy-retirement.module.js";
|
|
18
20
|
import { OperationAuthorityModule } from "./operation-authority.module.js";
|
|
@@ -24,7 +26,7 @@ import { CommandReviewService } from "./review/review.service.js";
|
|
|
24
26
|
import { SandboxService } from "./sandbox.service.js";
|
|
25
27
|
/**
|
|
26
28
|
* Sandboxes: the one {@link SandboxService} (a device's file system and instance over the
|
|
27
|
-
* `
|
|
29
|
+
* `device-provider@1` provider, with the shared / exclusive leases of {@link SandboxLeases}), the review
|
|
28
30
|
* every command passes in auto mode ({@link CommandReviewService}), and the producer of the
|
|
29
31
|
* one-off `sandbox-destroy-for` jobs (`MaintenanceProcessor` consumes them). The sweeps
|
|
30
32
|
* (`SandboxSweepJobs`) are the worker role's (`WorkerModule`).
|
|
@@ -34,6 +36,8 @@ let SandboxModule = class SandboxModule {
|
|
|
34
36
|
SandboxModule = __decorate([
|
|
35
37
|
Module({
|
|
36
38
|
imports: [
|
|
39
|
+
// which providers serve an org: a use needs the device's provider on in its org
|
|
40
|
+
DeviceProviderSelectionModule,
|
|
37
41
|
SandboxProviderRegistryModule,
|
|
38
42
|
PermissionAuthorityModule,
|
|
39
43
|
PermissionFactsModule,
|
|
@@ -49,7 +53,7 @@ SandboxModule = __decorate([
|
|
|
49
53
|
StepLogModule,
|
|
50
54
|
QueueModule.registerQueue(MAINTENANCE_QUEUE_NAME),
|
|
51
55
|
],
|
|
52
|
-
providers: [SandboxService, SandboxJobs, CommandReviewService],
|
|
56
|
+
providers: [SandboxService, SandboxJobs, CommandReviewService, DeviceReports],
|
|
53
57
|
exports: [
|
|
54
58
|
SandboxProviderRegistryModule,
|
|
55
59
|
LegacyRetirementModule,
|
|
@@ -60,6 +64,7 @@ SandboxModule = __decorate([
|
|
|
60
64
|
SandboxJobs,
|
|
61
65
|
CommandReviewService,
|
|
62
66
|
CloudPermissionSnapshotsModule,
|
|
67
|
+
DeviceReports,
|
|
63
68
|
],
|
|
64
69
|
})
|
|
65
70
|
], SandboxModule);
|