@capybara-hq/kernel 0.1.0-rc.41 → 0.1.0-rc.43
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 +3 -3
- package/dist/admin/admin.schemas.d.ts +6 -0
- package/dist/admin/org-network.service.d.ts +3 -1
- package/dist/admin/org-network.service.js +10 -2
- package/dist/app.d.ts +4 -0
- package/dist/app.js +2 -0
- package/dist/background/finish.d.ts +9 -1
- package/dist/background/finish.js +57 -4
- package/dist/background/launch.d.ts +23 -0
- package/dist/background/launch.js +55 -1
- package/dist/background/managed-output.d.ts +110 -0
- package/dist/background/managed-output.js +219 -0
- package/dist/background/managed.d.ts +52 -0
- package/dist/background/managed.js +128 -0
- package/dist/background/poll.job.d.ts +35 -1
- package/dist/background/poll.job.js +174 -9
- package/dist/background/render.js +1 -0
- package/dist/background/retire-legacy-tasks.job.d.ts +57 -0
- package/dist/background/retire-legacy-tasks.job.js +149 -0
- package/dist/background/session.d.ts +15 -5
- package/dist/background/session.js +22 -6
- package/dist/background/stop.d.ts +35 -5
- package/dist/background/stop.js +94 -8
- package/dist/background/store.d.ts +110 -3
- package/dist/background/store.js +205 -3
- package/dist/background/tasks.service.d.ts +18 -1
- package/dist/background/tasks.service.js +99 -9
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/channels/cards.js +1 -1
- package/dist/channels/inbound.js +2 -0
- package/dist/channels/phrases.d.ts +4 -0
- package/dist/channels/phrases.js +4 -0
- package/dist/config/load.d.ts +18 -0
- package/dist/config/load.js +39 -1
- package/dist/config/permission-migration.d.ts +26 -0
- package/dist/config/permission-migration.js +64 -0
- package/dist/config/schema.d.ts +4 -1
- package/dist/config/schema.js +41 -10
- package/dist/conversations/conversations.controller.d.ts +1 -1
- package/dist/conversations/conversations.controller.js +1 -1
- package/dist/conversations/conversations.module.js +12 -0
- package/dist/conversations/conversations.service.d.ts +11 -2
- package/dist/conversations/conversations.service.js +97 -27
- package/dist/conversations/event-log.d.ts +1 -1
- package/dist/conversations/event-log.js +10 -2
- package/dist/conversations/events.d.ts +307 -4
- package/dist/conversations/events.js +286 -32
- package/dist/conversations/permission-profile-store.d.ts +50 -0
- package/dist/conversations/permission-profile-store.js +67 -0
- package/dist/conversations/permission-profile-store.module.d.ts +2 -0
- package/dist/conversations/permission-profile-store.module.js +19 -0
- package/dist/conversations/permission-profiles.controller.d.ts +84 -0
- package/dist/conversations/permission-profiles.controller.js +105 -0
- package/dist/conversations/permission-profiles.schemas.d.ts +31 -0
- package/dist/conversations/permission-profiles.schemas.js +23 -0
- package/dist/conversations/permission-profiles.service.d.ts +56 -0
- package/dist/conversations/permission-profiles.service.js +179 -0
- package/dist/ctx/create-ctx.d.ts +12 -5
- package/dist/ctx/create-ctx.js +21 -5
- package/dist/db/kernel-schema.d.ts +248 -3
- package/dist/devices/access.js +1 -1
- package/dist/devices/access.module.d.ts +2 -0
- package/dist/devices/access.module.js +19 -0
- package/dist/devices/conversation-devices.d.ts +8 -29
- package/dist/devices/conversation-devices.js +37 -73
- package/dist/devices/device-projects.service.d.ts +26 -28
- package/dist/devices/device-projects.service.js +123 -127
- package/dist/devices/devices.controller.js +3 -1
- package/dist/devices/devices.module.js +11 -9
- package/dist/devices/devices.service.d.ts +116 -8
- package/dist/devices/devices.service.js +252 -20
- package/dist/devices/dto.d.ts +16 -0
- package/dist/devices/dto.js +34 -6
- package/dist/devices/errors.d.ts +8 -0
- package/dist/devices/errors.js +10 -0
- package/dist/devices/project-rules.d.ts +44 -0
- package/dist/devices/project-rules.js +27 -0
- package/dist/devices/working-root.d.ts +6 -0
- package/dist/devices/working-root.js +12 -1
- package/dist/errors.d.ts +31 -0
- package/dist/errors.js +31 -0
- package/dist/evals/reconstruct.d.ts +19 -2
- package/dist/evals/reconstruct.js +40 -2
- package/dist/evals/recorded-permission-context.d.ts +77 -0
- package/dist/evals/recorded-permission-context.js +151 -0
- package/dist/evals/recorded-tools.d.ts +10 -1
- package/dist/evals/recorded-tools.js +27 -3
- package/dist/evals/run-replay.d.ts +8 -2
- package/dist/evals/run-replay.js +18 -2
- package/dist/evals/trajectory.d.ts +1 -1
- package/dist/evals/worker.d.ts +10 -1
- package/dist/evals/worker.js +23 -14
- package/dist/extensions/host.d.ts +4 -1
- package/dist/extensions/host.js +10 -6
- package/dist/http/api.module.js +2 -0
- package/dist/identity/accounts.d.ts +14 -1
- package/dist/identity/accounts.js +61 -5
- package/dist/identity/identity.module.js +2 -0
- package/dist/identity/settings.d.ts +28 -12
- package/dist/identity/settings.js +89 -33
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/infra/cli/kernel-cli.module.d.ts +2 -2
- package/dist/infra/cli/kernel-cli.module.js +5 -2
- package/dist/infra/cli/permission-cutover.d.ts +59 -0
- package/dist/infra/cli/permission-cutover.js +107 -0
- package/dist/infra/config/kernel-config.service.d.ts +2 -2
- package/dist/infra/config/kernel-config.service.js +35 -11
- package/dist/infra/database/startup-activation-transaction.d.ts +36 -0
- package/dist/infra/database/startup-activation-transaction.js +242 -0
- package/dist/infra/database/transaction-host.d.ts +47 -0
- package/dist/infra/database/transaction-host.js +119 -0
- package/dist/infra/database/xact-lock.d.ts +1 -0
- package/dist/infra/database/xact-lock.js +6 -0
- package/dist/infra/outbox/registry.d.ts +39 -0
- package/dist/infra/outbox/registry.js +18 -0
- package/dist/kernel.module.js +2 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +3 -1
- package/dist/lifecycle/kernel-lifecycle.js +55 -28
- package/dist/local-devices/device-auth.js +1 -1
- package/dist/local-devices/device-policy.service.d.ts +35 -5
- package/dist/local-devices/device-policy.service.js +188 -13
- package/dist/local-devices/instance-bindings.d.ts +82 -0
- package/dist/local-devices/instance-bindings.js +304 -0
- package/dist/local-devices/keys.d.ts +5 -0
- package/dist/local-devices/keys.js +5 -0
- package/dist/local-devices/local-device-gateway.d.ts +19 -4
- package/dist/local-devices/local-device-gateway.js +185 -17
- package/dist/local-devices/local-device-provider.d.ts +42 -7
- package/dist/local-devices/local-device-provider.js +185 -10
- package/dist/local-devices/local-devices.module.d.ts +17 -2
- package/dist/local-devices/local-devices.module.js +49 -8
- package/dist/local-devices/machines.d.ts +35 -12
- package/dist/local-devices/machines.js +203 -8
- package/dist/local-devices/network-grants.js +3 -3
- package/dist/local-devices/network-grants.module.d.ts +2 -0
- package/dist/local-devices/network-grants.module.js +14 -0
- package/dist/local-devices/owner-report.d.ts +79 -0
- package/dist/local-devices/owner-report.js +155 -0
- package/dist/local-devices/owner-reports.d.ts +48 -0
- package/dist/local-devices/owner-reports.js +190 -0
- package/dist/local-devices/policy-summary.d.ts +24 -1
- package/dist/local-devices/policy-summary.js +48 -0
- package/dist/local-devices/relay.d.ts +82 -6
- package/dist/local-devices/relay.js +187 -16
- package/dist/local-devices/targets.d.ts +16 -1
- package/dist/local-devices/targets.js +35 -2
- package/dist/models/image-usable.d.ts +22 -0
- package/dist/models/image-usable.js +29 -0
- package/dist/models/images.d.ts +125 -0
- package/dist/models/images.js +440 -0
- package/dist/models/models.module.d.ts +3 -2
- package/dist/models/models.module.js +16 -5
- package/dist/models/org-models.schemas.js +1 -0
- package/dist/models/purposes.controller.d.ts +7 -0
- package/dist/models/purposes.controller.js +9 -0
- package/dist/models/purposes.d.ts +28 -3
- package/dist/models/purposes.js +40 -13
- package/dist/orgs/cloud-network-setting.d.ts +33 -0
- package/dist/orgs/cloud-network-setting.js +47 -0
- package/dist/orgs/offboarding.d.ts +3 -1
- package/dist/orgs/offboarding.js +8 -2
- package/dist/orgs/org-lock.d.ts +10 -4
- package/dist/orgs/org-lock.js +10 -4
- package/dist/orgs/orgs.service.d.ts +3 -1
- package/dist/orgs/orgs.service.js +8 -2
- package/dist/orgs/settings.controller.d.ts +4 -1
- package/dist/orgs/settings.controller.js +3 -3
- package/dist/orgs/settings.service.d.ts +48 -56
- package/dist/orgs/settings.service.js +144 -101
- package/dist/overrides.d.ts +6 -1
- package/dist/overrides.js +2 -0
- package/dist/platform/exclusions.js +20 -0
- package/dist/platform/ops/admin.ops.js +14 -11
- package/dist/platform/ops/agent-skills.ops.js +2 -0
- package/dist/platform/ops/devices.ops.js +10 -2
- package/dist/platform/ops/models.ops.js +10 -0
- package/dist/platform/ops/org-settings.ops.js +6 -6
- package/dist/platform/ops/orgs.ops.js +1 -0
- package/dist/roles/worker.module.js +4 -0
- package/dist/runtime/context/build.d.ts +3 -1
- package/dist/runtime/context/build.js +19 -3
- package/dist/runtime/context/compaction.js +5 -0
- package/dist/runtime/context/device-paths.d.ts +9 -2
- package/dist/runtime/context/device-paths.js +20 -0
- package/dist/runtime/context/permission-profile.d.ts +46 -0
- package/dist/runtime/context/permission-profile.js +194 -0
- package/dist/runtime/hook-calls.d.ts +11 -1
- package/dist/runtime/hook-calls.js +24 -1
- package/dist/runtime/maintenance.d.ts +7 -1
- package/dist/runtime/maintenance.js +43 -15
- package/dist/runtime/model-call.d.ts +32 -0
- package/dist/runtime/model-call.js +67 -0
- package/dist/runtime/permission-context-errors.d.ts +39 -0
- package/dist/runtime/permission-context-errors.js +67 -0
- package/dist/runtime/permission-context.service.d.ts +60 -0
- package/dist/runtime/permission-context.service.js +286 -0
- package/dist/runtime/project/knowledge.d.ts +7 -2
- package/dist/runtime/project/knowledge.js +5 -2
- package/dist/runtime/project/knowledge.service.d.ts +17 -2
- package/dist/runtime/project/knowledge.service.js +76 -12
- package/dist/runtime/providers.d.ts +9 -5
- package/dist/runtime/providers.js +22 -3
- package/dist/runtime/run-execution.d.ts +4 -1
- package/dist/runtime/run-execution.js +14 -5
- package/dist/runtime/run-steps.d.ts +11 -3
- package/dist/runtime/run-steps.js +27 -4
- package/dist/runtime/runtime.module.js +11 -0
- package/dist/runtime/usage-report.d.ts +10 -6
- package/dist/runtime/usage-report.js +31 -11
- package/dist/sandbox/attachments-path.d.ts +15 -0
- package/dist/sandbox/attachments-path.js +15 -0
- package/dist/sandbox/cloud-permission-snapshot.d.ts +159 -0
- package/dist/sandbox/cloud-permission-snapshot.js +407 -0
- package/dist/sandbox/cloud-permission-snapshot.module.d.ts +8 -0
- package/dist/sandbox/cloud-permission-snapshot.module.js +34 -0
- package/dist/sandbox/held-operations.d.ts +39 -0
- package/dist/sandbox/held-operations.js +119 -0
- package/dist/sandbox/jobs.d.ts +14 -3
- package/dist/sandbox/jobs.js +20 -2
- package/dist/sandbox/kernel-read.d.ts +55 -0
- package/dist/sandbox/kernel-read.js +57 -0
- package/dist/sandbox/legacy-retirement.d.ts +336 -0
- package/dist/sandbox/legacy-retirement.js +1063 -0
- package/dist/sandbox/legacy-retirement.module.d.ts +8 -0
- package/dist/sandbox/legacy-retirement.module.js +25 -0
- package/dist/sandbox/managed-device-context.d.ts +94 -0
- package/dist/sandbox/managed-device-context.js +308 -0
- package/dist/sandbox/managed-device-context.module.d.ts +6 -0
- package/dist/sandbox/managed-device-context.module.js +33 -0
- package/dist/sandbox/modes.d.ts +56 -8
- package/dist/sandbox/modes.js +92 -8
- package/dist/sandbox/operation-authority-types.d.ts +8 -0
- package/dist/sandbox/operation-authority-types.js +32 -0
- package/dist/sandbox/operation-authority.d.ts +145 -0
- package/dist/sandbox/operation-authority.js +783 -0
- package/dist/sandbox/operation-authority.module.d.ts +2 -0
- package/dist/sandbox/operation-authority.module.js +29 -0
- package/dist/sandbox/operation-intents.d.ts +206 -0
- package/dist/sandbox/operation-intents.js +1252 -0
- package/dist/sandbox/operation-intents.module.d.ts +2 -0
- package/dist/sandbox/operation-intents.module.js +21 -0
- package/dist/sandbox/operation-payloads.d.ts +33 -0
- package/dist/sandbox/operation-payloads.js +332 -0
- package/dist/sandbox/operation-reconcile.job.d.ts +49 -0
- package/dist/sandbox/operation-reconcile.job.js +247 -0
- package/dist/sandbox/permission-authority-epochs.d.ts +18 -0
- package/dist/sandbox/permission-authority-epochs.js +83 -0
- package/dist/sandbox/permission-authority-lock.d.ts +38 -0
- package/dist/sandbox/permission-authority-lock.js +147 -0
- package/dist/sandbox/permission-authority.module.d.ts +9 -0
- package/dist/sandbox/permission-authority.module.js +55 -0
- package/dist/sandbox/permission-availability.d.ts +18 -0
- package/dist/sandbox/permission-availability.js +19 -0
- package/dist/sandbox/permission-call-grants.d.ts +34 -0
- package/dist/sandbox/permission-call-grants.js +349 -0
- package/dist/sandbox/permission-call-grants.module.d.ts +2 -0
- package/dist/sandbox/permission-call-grants.module.js +21 -0
- package/dist/sandbox/permission-call-types.d.ts +82 -0
- package/dist/sandbox/permission-call-types.js +1 -0
- package/dist/sandbox/permission-ceiling-writes.d.ts +47 -0
- package/dist/sandbox/permission-ceiling-writes.js +223 -0
- package/dist/sandbox/permission-config-publication.d.ts +76 -0
- package/dist/sandbox/permission-config-publication.js +339 -0
- package/dist/sandbox/permission-context-types.d.ts +64 -0
- package/dist/sandbox/permission-context-types.js +24 -0
- package/dist/sandbox/permission-facts.d.ts +206 -0
- package/dist/sandbox/permission-facts.js +627 -0
- package/dist/sandbox/permission-facts.module.d.ts +2 -0
- package/dist/sandbox/permission-facts.module.js +20 -0
- package/dist/sandbox/permission-instance-writes.d.ts +90 -0
- package/dist/sandbox/permission-instance-writes.js +305 -0
- package/dist/sandbox/permission-runtime-reports.d.ts +83 -0
- package/dist/sandbox/permission-runtime-reports.js +354 -0
- package/dist/sandbox/permission-transitions.d.ts +31 -0
- package/dist/sandbox/permission-transitions.js +155 -0
- package/dist/sandbox/platform-full-access.d.ts +128 -0
- package/dist/sandbox/platform-full-access.js +210 -0
- package/dist/sandbox/providers.d.ts +22 -0
- package/dist/sandbox/providers.js +10 -2
- package/dist/sandbox/providers.module.d.ts +2 -0
- package/dist/sandbox/providers.module.js +19 -0
- package/dist/sandbox/request-not-sent.d.ts +13 -0
- package/dist/sandbox/request-not-sent.js +13 -0
- package/dist/sandbox/review/classifier.d.ts +2 -0
- package/dist/sandbox/review/classifier.js +8 -0
- package/dist/sandbox/review/permission-candidate.d.ts +12 -0
- package/dist/sandbox/review/permission-candidate.js +145 -0
- package/dist/sandbox/review/review.service.d.ts +5 -2
- package/dist/sandbox/review/review.service.js +60 -15
- package/dist/sandbox/sandbox-file-reader.d.ts +18 -1
- package/dist/sandbox/sandbox-file-reader.js +51 -7
- package/dist/sandbox/sandbox.module.js +26 -6
- package/dist/sandbox/sandbox.service.d.ts +230 -34
- package/dist/sandbox/sandbox.service.js +1368 -199
- package/dist/sandbox/unreachable.js +17 -3
- package/dist/sandbox/use-context.d.ts +17 -0
- package/dist/sandbox/use-context.js +1 -0
- package/dist/skills/invoke.d.ts +27 -4
- package/dist/skills/invoke.js +72 -7
- package/dist/tools/approvals.controller.d.ts +1 -0
- package/dist/tools/approvals.schemas.d.ts +1 -0
- package/dist/tools/approvals.schemas.js +3 -1
- package/dist/tools/approvals.service.d.ts +23 -10
- package/dist/tools/approvals.service.js +104 -26
- package/dist/tools/builtin-names.d.ts +3 -1
- package/dist/tools/builtin-names.js +5 -1
- package/dist/tools/builtins/artifacts.d.ts +43 -0
- package/dist/tools/builtins/artifacts.js +67 -0
- package/dist/tools/builtins/builtin-tools.d.ts +20 -2
- package/dist/tools/builtins/builtin-tools.js +61 -10
- package/dist/tools/builtins/image/generate.d.ts +59 -0
- package/dist/tools/builtins/image/generate.js +535 -0
- package/dist/tools/builtins/image/index.d.ts +2 -0
- package/dist/tools/builtins/image/index.js +2 -0
- package/dist/tools/builtins/image/paths.d.ts +12 -0
- package/dist/tools/builtins/image/paths.js +26 -0
- package/dist/tools/builtins/sandbox/bash.d.ts +25 -1
- package/dist/tools/builtins/sandbox/bash.js +201 -5
- package/dist/tools/builtins/sandbox/common.d.ts +92 -20
- package/dist/tools/builtins/sandbox/common.js +201 -17
- package/dist/tools/builtins/sandbox/deliver.js +9 -51
- package/dist/tools/builtins/sandbox/edit.js +2 -2
- package/dist/tools/builtins/sandbox/fetch-attachment.js +11 -4
- package/dist/tools/builtins/sandbox/glob.js +2 -2
- package/dist/tools/builtins/sandbox/grep.js +2 -2
- package/dist/tools/builtins/sandbox/read.js +2 -2
- package/dist/tools/builtins/sandbox/task-list.js +7 -1
- package/dist/tools/builtins/sandbox/task-output.d.ts +1 -1
- package/dist/tools/builtins/sandbox/task-output.js +172 -0
- package/dist/tools/builtins/sandbox/task-stop.js +25 -3
- package/dist/tools/builtins/sandbox/write.js +2 -2
- package/dist/tools/builtins/skill-load.js +9 -6
- package/dist/tools/device-op-resolver.d.ts +1 -1
- package/dist/tools/device-op-resolver.js +13 -3
- package/dist/tools/permission-approval-jobs.d.ts +18 -0
- package/dist/tools/permission-approval-jobs.js +92 -0
- package/dist/tools/pipeline.d.ts +17 -2
- package/dist/tools/pipeline.js +315 -26
- package/dist/tools/registry.d.ts +9 -0
- package/dist/tools/tools.module.js +15 -0
- package/package.json +4 -3
- package/src/migrations/0146_permission_authority_epochs.sql +6 -0
- package/src/migrations/0147_conversation_permission_profiles.sql +4 -0
- package/src/migrations/0148_first_message_request_hash.sql +2 -0
- package/src/migrations/0149_sandbox_operation_intents.sql +66 -0
- package/src/migrations/0150_permission_call_grants_and_approvals.sql +36 -0
- package/src/migrations/0151_starting_execution_grants.sql +8 -0
- package/src/migrations/0152_background_launch_identity.sql +66 -0
- package/src/migrations/0153_background_cancel_requester.sql +13 -0
- package/src/migrations/0154_cloud_owner_ceiling.sql +14 -0
- package/src/migrations/0155_device_instance_generations.sql +30 -0
- package/src/migrations/0156_device_owner_report.sql +7 -0
- package/src/migrations/0157_legacy_retirement.sql +116 -0
- package/src/migrations/0158_legacy_freeze_enumerated.sql +5 -0
- package/src/migrations/0159_retirement_exact_cancel.sql +9 -0
- package/src/migrations/0160_model_usage_image_kind.sql +10 -0
- package/dist/sandbox/platform-auto-mode.d.ts +0 -63
- package/dist/sandbox/platform-auto-mode.js +0 -63
|
@@ -10,6 +10,7 @@ import { MachinesService } from "../local-devices/machines.js";
|
|
|
10
10
|
import type { DeviceModeLevel } from "../runtime/context/device-paths.js";
|
|
11
11
|
import { SandboxJobs } from "../sandbox/jobs.js";
|
|
12
12
|
import { type DeviceNetwork, type EffectiveDevicePolicy, type NetworkKind, type OrgDeviceSettings, type SandboxMode } from "../sandbox/modes.js";
|
|
13
|
+
import { PermissionCeilingWrites } from "../sandbox/permission-ceiling-writes.js";
|
|
13
14
|
import { SandboxProviders } from "../sandbox/providers.js";
|
|
14
15
|
import { SandboxService } from "../sandbox/sandbox.service.js";
|
|
15
16
|
import { DeviceAccess } from "./access.js";
|
|
@@ -56,6 +57,20 @@ export interface DeviceView {
|
|
|
56
57
|
} | null;
|
|
57
58
|
/** Its mode and network (auto mode spec §4.3). */
|
|
58
59
|
mode: DeviceModeView;
|
|
60
|
+
/**
|
|
61
|
+
* The device owner's ceiling as last reported (B2, read only): a local device's authenticated
|
|
62
|
+
* owner report (`state: "report"`), a stale or conflicting report (`blocked`), only a protocol
|
|
63
|
+
* 2 summary (`legacy`, translated exactly) or nothing (`missing`); a cloud device's explicit
|
|
64
|
+
* Full ceiling once snapshotted. `stale` is true while the machine is offline or the report is
|
|
65
|
+
* not current: last-known facts, never authority. null for a cloud device not snapshotted yet.
|
|
66
|
+
*/
|
|
67
|
+
ownerCeiling: DeviceOwnerCeilingView | null;
|
|
68
|
+
/**
|
|
69
|
+
* A cloud device whose B1 snapshot found applied limits it could not establish exactly: nothing
|
|
70
|
+
* runs on it until a file reset establishes them (`device.permission_reconcile_required` at
|
|
71
|
+
* admission). Always false for a local device.
|
|
72
|
+
*/
|
|
73
|
+
reconcileRequired: boolean;
|
|
59
74
|
sessionIsolation: boolean;
|
|
60
75
|
/** Its file system is gone at the provider; reset the files to use it again. */
|
|
61
76
|
filesLost: boolean;
|
|
@@ -70,6 +85,26 @@ export interface DeviceView {
|
|
|
70
85
|
limits: SandboxLimits;
|
|
71
86
|
createdAt: string;
|
|
72
87
|
}
|
|
88
|
+
/** {@link DeviceView.ownerCeiling}. */
|
|
89
|
+
export interface DeviceOwnerCeilingView {
|
|
90
|
+
state: "report" | "blocked" | "legacy" | "missing" | "cloud";
|
|
91
|
+
revision: string | null;
|
|
92
|
+
sequence: number | null;
|
|
93
|
+
/** The owner's ceiling as stored or reported (a cloud device: the raw B1 ceiling). */
|
|
94
|
+
fullAccess: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the owner's side allows Full access as the kernel applies it: a cloud device's ceiling
|
|
97
|
+
* narrowed by its old sandbox switch (`cloudChosenMode`); a local machine's derived mode
|
|
98
|
+
* (`ownerModeOf`: its report, else an older program's mode or isolation), as admission reads it.
|
|
99
|
+
* The platform and the org may still cut it ({@link DeviceModeView.allowedMode}).
|
|
100
|
+
*/
|
|
101
|
+
effectiveFullAccess: boolean;
|
|
102
|
+
/** Restricted project reach; a cloud device stays within its provisioned files (`workspace`). */
|
|
103
|
+
restrictedProjectReach: "workspace" | "os-user";
|
|
104
|
+
restrictedAllowedDomains: string[];
|
|
105
|
+
observedAt: string | null;
|
|
106
|
+
stale: boolean;
|
|
107
|
+
}
|
|
73
108
|
/**
|
|
74
109
|
* A device's mode and network as its owner sees it (auto mode spec §4.1–§4.3).
|
|
75
110
|
*/
|
|
@@ -79,7 +114,7 @@ export interface DeviceModeView {
|
|
|
79
114
|
* device has no choice, so it follows {@link allowedMode}.
|
|
80
115
|
*/
|
|
81
116
|
mode: SandboxMode;
|
|
82
|
-
/** `auto` only when the platform's and the org's `
|
|
117
|
+
/** `auto` only when the platform's and the org's `fullAccess` leave it allowed. */
|
|
83
118
|
allowedMode: SandboxMode;
|
|
84
119
|
/** Which layer allows auto mode (`org`: the org set it; `platform`: the org follows the platform); null when only sandbox mode is allowed. */
|
|
85
120
|
allowedBy: "org" | "platform" | null;
|
|
@@ -96,13 +131,30 @@ export interface DeviceModeView {
|
|
|
96
131
|
} | null;
|
|
97
132
|
/**
|
|
98
133
|
* A cloud device: the network sandbox mode gives it, whatever mode it runs at now (the org's
|
|
99
|
-
* `cloudNetwork`, open by default; the kill switch empties it)
|
|
100
|
-
*
|
|
134
|
+
* `cloudNetwork`, open by default; the kill switch empties it) within its {@link outerNetwork},
|
|
135
|
+
* so the page names exactly what turning Full access off reaches before it is done (hardening
|
|
136
|
+
* spec D3). Null for a local device.
|
|
101
137
|
*/
|
|
102
138
|
sandboxNetwork: {
|
|
103
139
|
kind: NetworkKind;
|
|
104
140
|
hosts: string[];
|
|
105
141
|
} | null;
|
|
142
|
+
/**
|
|
143
|
+
* A cloud device: the network Full access gives it (the open public network, or the kill
|
|
144
|
+
* switch's empty allowlist) within its {@link outerNetwork}. Null for a local device.
|
|
145
|
+
*/
|
|
146
|
+
fullNetwork: {
|
|
147
|
+
kind: NetworkKind;
|
|
148
|
+
hosts: string[];
|
|
149
|
+
} | null;
|
|
150
|
+
/**
|
|
151
|
+
* A cloud device's B1 outer network: the boundary no mode or ceiling change widens. Null for a
|
|
152
|
+
* local device and for a cloud device not snapshotted yet.
|
|
153
|
+
*/
|
|
154
|
+
outerNetwork: {
|
|
155
|
+
kind: NetworkKind;
|
|
156
|
+
hosts: string[];
|
|
157
|
+
} | null;
|
|
106
158
|
/**
|
|
107
159
|
* A cloud device's instance runs another mode or network kind: its next use updates or recreates
|
|
108
160
|
* it, files kept (「下次使用时生效,文件保留」).
|
|
@@ -124,11 +176,13 @@ export declare const RECENT_POLICY_CHANGES = 10;
|
|
|
124
176
|
* made on the machine by its owner (`device`, `capybara-device policy ...`); one sent whose
|
|
125
177
|
* answer never came (`device.policy_unknown`) or that failed (`device.policy_failed`) too;
|
|
126
178
|
* - `mode` (`device.mode_changed`): the device switched between auto and sandbox mode, on the
|
|
127
|
-
* machine (`device`) or by a policy op (`web`, `im`)
|
|
179
|
+
* machine (`device`) or by a policy op (`web`, `im`);
|
|
180
|
+
* - `ceiling` (`device.owner_ceiling_changed`): the owner ceiling changed, a cloud device's Full
|
|
181
|
+
* ceiling on the device page (`web`) or a machine's authenticated report (`device`).
|
|
128
182
|
*/
|
|
129
183
|
export interface DeviceModeChangeView {
|
|
130
184
|
at: string;
|
|
131
|
-
kind: "policy" | "mode";
|
|
185
|
+
kind: "policy" | "mode" | "ceiling";
|
|
132
186
|
/** Hosts added to / removed from the local allowlist (`policy` only; else empty). */
|
|
133
187
|
add: string[];
|
|
134
188
|
remove: string[];
|
|
@@ -137,6 +191,14 @@ export interface DeviceModeChangeView {
|
|
|
137
191
|
from?: SandboxMode | null;
|
|
138
192
|
to: SandboxMode;
|
|
139
193
|
} | null;
|
|
194
|
+
/**
|
|
195
|
+
* The ceiling change (`ceiling` only; else null): Full access, and a machine's restricted project
|
|
196
|
+
* reach (a cloud device has none). `from` is null when the row does not say.
|
|
197
|
+
*/
|
|
198
|
+
ceiling: {
|
|
199
|
+
from: DeviceCeilingFacts | null;
|
|
200
|
+
to: DeviceCeilingFacts;
|
|
201
|
+
} | null;
|
|
140
202
|
/** The deciding account's display name (null when the account is gone). */
|
|
141
203
|
by: string | null;
|
|
142
204
|
/** `device`: made or reported on the machine itself. */
|
|
@@ -148,12 +210,22 @@ export interface DeviceModeChangeView {
|
|
|
148
210
|
*/
|
|
149
211
|
outcome: "applied" | "unknown" | "failed";
|
|
150
212
|
}
|
|
213
|
+
/** One side of a {@link DeviceModeChangeView.ceiling} change. */
|
|
214
|
+
export interface DeviceCeilingFacts {
|
|
215
|
+
fullAccess: boolean;
|
|
216
|
+
restrictedProjectReach?: "workspace" | "os-user";
|
|
217
|
+
}
|
|
151
218
|
/** A change of a local device's policy by its owner (`POST /devices/:id/policy`). */
|
|
152
219
|
export interface DevicePolicyChange {
|
|
153
220
|
add?: string[] | undefined;
|
|
154
221
|
remove?: string[] | undefined;
|
|
155
222
|
/** Switch the sandbox back on; auto mode is turned on only on the machine. */
|
|
156
223
|
mode?: "sandbox" | undefined;
|
|
224
|
+
/** B2: narrow the owner ceiling (never widen; the schema refuses true and os-user). */
|
|
225
|
+
ownerCeiling?: {
|
|
226
|
+
fullAccess?: false | undefined;
|
|
227
|
+
restrictedProjectReach?: "workspace" | undefined;
|
|
228
|
+
} | undefined;
|
|
157
229
|
}
|
|
158
230
|
/** What `PATCH /devices/:id` changes. */
|
|
159
231
|
export interface DevicePatch {
|
|
@@ -165,6 +237,14 @@ export interface DevicePatch {
|
|
|
165
237
|
* A local device refuses it here (`device.mode_on_device`, its mode is its machine's).
|
|
166
238
|
*/
|
|
167
239
|
mode?: "sandbox" | null;
|
|
240
|
+
/**
|
|
241
|
+
* B2: a cloud device's explicit Full ceiling. Narrowing applies; widening needs
|
|
242
|
+
* `confirmWidening` and stays bounded by the platform, the org and the outer network.
|
|
243
|
+
*/
|
|
244
|
+
ownerCeiling?: {
|
|
245
|
+
fullAccess: boolean;
|
|
246
|
+
};
|
|
247
|
+
confirmWidening?: true;
|
|
168
248
|
}
|
|
169
249
|
/** The machine connected to a local device, as its owner sees it. */
|
|
170
250
|
export interface DeviceMachineView {
|
|
@@ -207,11 +287,12 @@ export declare class DevicesService {
|
|
|
207
287
|
private readonly locks;
|
|
208
288
|
private readonly machines;
|
|
209
289
|
private readonly policies;
|
|
290
|
+
private readonly ceilings;
|
|
210
291
|
constructor(db: KernelDb, txHost: TransactionHost, config: Pick<KernelConfigService, "get" | "fieldSource">, providers: Pick<SandboxProviders, "cloud" | "forName">, sandbox: Pick<SandboxService, "devicePolicy" | "deviceLimits" | "limitsState">, sandboxJobs: Pick<SandboxJobs, "resetFiles">,
|
|
211
292
|
/** Owes a deleted device's destruction in the delete's transaction. */
|
|
212
293
|
outbox: Pick<OutboxService, "add">, access: Pick<DeviceAccess, "usable">, displayNames: Pick<ExtensionDisplayNames, "many">,
|
|
213
294
|
/** Reads the device relay's lease (`online`). */
|
|
214
|
-
locks: Pick<LockService, "holderOf">, machines: Pick<MachinesService, "revoke" | "revokeActive">, policies: Pick<DevicePolicyService, "apply" | "summary"
|
|
295
|
+
locks: Pick<LockService, "holderOf">, machines: Pick<MachinesService, "revoke" | "revokeActive">, policies: Pick<DevicePolicyService, "apply" | "summary">, ceilings: PermissionCeilingWrites);
|
|
215
296
|
/**
|
|
216
297
|
* The person's live devices in the org, the default first, then by creation. With a
|
|
217
298
|
* current sandbox provider the default device is created first if missing (its first need,
|
|
@@ -275,6 +356,21 @@ export declare class DevicesService {
|
|
|
275
356
|
*/
|
|
276
357
|
update(orgId: string, accountId: string, id: string, patch: DevicePatch, actorTokenId?: string): Promise<DeviceView>;
|
|
277
358
|
private updateIn;
|
|
359
|
+
/**
|
|
360
|
+
* B2 cloud owner ceiling (`PATCH ownerCeiling: {fullAccess}`), under the device authority
|
|
361
|
+
* writer: a cloud device's explicit Full ceiling. Narrowing applies at once and revokes only Full
|
|
362
|
+
* work; widening needs the person's explicit confirmation in a web session, is refused while
|
|
363
|
+
* the platform or the org does not allow Full access, never touches the outer network, and
|
|
364
|
+
* resets Full consent (conversations need fresh consent). A local device's ceiling is its
|
|
365
|
+
* machine's (`device.mode_on_device`).
|
|
366
|
+
*/
|
|
367
|
+
private cloudOwnerCeilingLocked;
|
|
368
|
+
/**
|
|
369
|
+
* How far restricted work may root outside the device's workspace now (B2): a local machine's
|
|
370
|
+
* owner reach within a platform and org that allow the wider device ceiling; a cloud device
|
|
371
|
+
* keeps its previous rule (its effective mode). Never the owner's Full permission alone.
|
|
372
|
+
*/
|
|
373
|
+
projectReach(orgId: string, deviceId: string): Promise<"workspace" | "os-user">;
|
|
278
374
|
/**
|
|
279
375
|
* The mode a sandbox call in the device runs at now, for the model (`device_paths`, auto mode
|
|
280
376
|
* spec §4.2): the effective policy for the mode it runs at (a local machine's derived mode,
|
|
@@ -292,8 +388,15 @@ export declare class DevicesService {
|
|
|
292
388
|
* sandbox tools then fail with `device.not_found`. A local device's machine is
|
|
293
389
|
* revoked in the same transaction; after the commit it is told `stop { reason: "deleted" }`
|
|
294
390
|
* (while connected) and its connection is closed.
|
|
391
|
+
*
|
|
392
|
+
* The membership, the device row and the device's permission authority lock are the
|
|
393
|
+
* transaction's ordered prelude (`withOrderedLocks`): inside a run's fence (the Platform tool's
|
|
394
|
+
* `devices.delete`) they follow the org row and precede the conversation rows.
|
|
295
395
|
*/
|
|
296
396
|
remove(orgId: string, accountId: string, id: string, actorTokenId?: string, auditDetail?: Record<string, unknown>): Promise<void>;
|
|
397
|
+
/** The prelude of {@link remove}: the membership, the device row, the device's write lock. */
|
|
398
|
+
private lockRemovalSubject;
|
|
399
|
+
private removeIn;
|
|
297
400
|
/**
|
|
298
401
|
* Disconnects the machine of one of the person's own local devices (it must sign in
|
|
299
402
|
* again); see {@link MachinesService.revoke}.
|
|
@@ -391,7 +494,8 @@ export declare class DevicesService {
|
|
|
391
494
|
/**
|
|
392
495
|
* The last {@link RECENT_POLICY_CHANGES} mode and policy changes of each device in the org
|
|
393
496
|
* (audit rows `device.policy_changed`, `device.policy_unknown`, `device.policy_failed`,
|
|
394
|
-
* `device.mode_changed`), newest first, with the deciding
|
|
497
|
+
* `device.mode_changed`, `device.owner_ceiling_changed`), newest first, with the deciding
|
|
498
|
+
* account's display name.
|
|
395
499
|
*/
|
|
396
500
|
private recentModeChanges;
|
|
397
501
|
/**
|
|
@@ -414,8 +518,12 @@ export declare function deviceModeViewOf(policy: EffectiveDevicePolicy, settings
|
|
|
414
518
|
pendingNextUse: boolean;
|
|
415
519
|
pendingFilesReset: boolean;
|
|
416
520
|
recent: DeviceModeChangeView[];
|
|
417
|
-
/** The network sandbox mode gives a cloud device
|
|
521
|
+
/** The network sandbox mode gives a cloud device, within its outer network. */
|
|
418
522
|
sandboxNetwork: DeviceNetwork;
|
|
523
|
+
/** The network Full access gives a cloud device, within its outer network. */
|
|
524
|
+
fullNetwork: DeviceNetwork;
|
|
525
|
+
/** A cloud device's B1 outer network; null when not snapshotted. */
|
|
526
|
+
outerNetwork: DeviceNetwork | null;
|
|
419
527
|
},
|
|
420
528
|
/** The platform kill switch (`sandbox.limits.egress: none`): the network is the platform's. */
|
|
421
529
|
killSwitch?: boolean): DeviceModeView;
|