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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/admin/admin.module.js +2 -0
  2. package/dist/admin/health.service.d.ts +11 -4
  3. package/dist/admin/health.service.js +33 -17
  4. package/dist/background/poll.job.js +2 -2
  5. package/dist/background/tasks.service.d.ts +5 -5
  6. package/dist/background/tasks.service.js +9 -8
  7. package/dist/catalog/marketplaces.service.d.ts +1 -1
  8. package/dist/catalog/requests.service.js +1 -1
  9. package/dist/config/schema.d.ts +1 -1
  10. package/dist/config/schema.js +9 -9
  11. package/dist/conversations/conversations.controller.d.ts +8 -3
  12. package/dist/conversations/conversations.controller.js +8 -3
  13. package/dist/conversations/conversations.service.d.ts +33 -15
  14. package/dist/conversations/conversations.service.js +60 -10
  15. package/dist/conversations/events.d.ts +21 -41
  16. package/dist/conversations/events.js +57 -31
  17. package/dist/conversations/permission-profiles.controller.d.ts +6 -4
  18. package/dist/conversations/permission-profiles.service.d.ts +6 -4
  19. package/dist/ctx/create-ctx.d.ts +20 -1
  20. package/dist/ctx/create-ctx.js +77 -6
  21. package/dist/ctx/device-provider-check.d.ts +6 -2
  22. package/dist/ctx/device-provider-check.js +17 -2
  23. package/dist/db/kernel-schema.d.ts +10 -48
  24. package/dist/devices/access.d.ts +3 -4
  25. package/dist/devices/access.js +3 -4
  26. package/dist/devices/conversation-devices.d.ts +1 -3
  27. package/dist/devices/conversation-devices.js +2 -7
  28. package/dist/devices/device-projects.service.js +24 -29
  29. package/dist/devices/device-provider-selection.d.ts +5 -6
  30. package/dist/devices/device-provider-selection.js +8 -9
  31. package/dist/devices/devices.controller.d.ts +8 -21
  32. package/dist/devices/devices.controller.js +9 -34
  33. package/dist/devices/devices.module.js +6 -4
  34. package/dist/devices/devices.schemas.d.ts +1 -5
  35. package/dist/devices/devices.schemas.js +1 -5
  36. package/dist/devices/devices.service.d.ts +84 -147
  37. package/dist/devices/devices.service.js +134 -229
  38. package/dist/devices/dto.d.ts +5 -32
  39. package/dist/devices/dto.js +5 -37
  40. package/dist/devices/errors.d.ts +6 -5
  41. package/dist/devices/errors.js +7 -8
  42. package/dist/devices/project-rules.d.ts +9 -11
  43. package/dist/devices/project-rules.js +7 -7
  44. package/dist/devices/working-root.d.ts +3 -6
  45. package/dist/devices/working-root.js +3 -8
  46. package/dist/dial-in/access.d.ts +23 -0
  47. package/dist/dial-in/access.js +64 -0
  48. package/dist/{local-devices/device-auth.controller.d.ts → dial-in/auth.controller.d.ts} +12 -6
  49. package/dist/{local-devices/device-auth.controller.js → dial-in/auth.controller.js} +30 -15
  50. package/dist/dial-in/auth.module.d.ts +7 -0
  51. package/dist/dial-in/auth.module.js +27 -0
  52. package/dist/{local-devices/device-auth.d.ts → dial-in/auth.service.d.ts} +42 -13
  53. package/dist/{local-devices/device-auth.js → dial-in/auth.service.js} +83 -32
  54. package/dist/dial-in/dial-in.module.d.ts +9 -0
  55. package/dist/dial-in/dial-in.module.js +37 -0
  56. package/dist/{local-devices → dial-in}/dto.d.ts +17 -2
  57. package/dist/{local-devices → dial-in}/dto.js +14 -2
  58. package/dist/dial-in/envelope.d.ts +95 -0
  59. package/dist/dial-in/envelope.js +89 -0
  60. package/dist/dial-in/gateway.d.ts +214 -0
  61. package/dist/{local-devices/local-device-gateway.js → dial-in/gateway.js} +337 -181
  62. package/dist/dial-in/handlers.d.ts +47 -0
  63. package/dist/dial-in/handlers.js +84 -0
  64. package/dist/dial-in/machines.d.ts +155 -0
  65. package/dist/dial-in/machines.js +383 -0
  66. package/dist/dial-in/relay.d.ts +135 -0
  67. package/dist/dial-in/relay.js +444 -0
  68. package/dist/dial-in/relay.module.d.ts +7 -0
  69. package/dist/dial-in/relay.module.js +24 -0
  70. package/dist/{local-devices/device-routes.d.ts → dial-in/routes.d.ts} +19 -11
  71. package/dist/{local-devices/device-routes.js → dial-in/routes.js} +45 -25
  72. package/dist/{local-devices → dial-in}/targets.d.ts +3 -18
  73. package/dist/{local-devices → dial-in}/targets.js +3 -48
  74. package/dist/errors.d.ts +8 -27
  75. package/dist/errors.js +8 -27
  76. package/dist/extensions/bootstrap.d.ts +5 -0
  77. package/dist/extensions/bootstrap.js +10 -1
  78. package/dist/extensions/extensions.module.js +6 -0
  79. package/dist/extensions/host.d.ts +6 -0
  80. package/dist/extensions/host.js +12 -2
  81. package/dist/extensions/permission-set.d.ts +15 -1
  82. package/dist/extensions/permission-set.js +11 -1
  83. package/dist/extensions/permission-view.d.ts +1 -1
  84. package/dist/extensions/permission-view.js +4 -1
  85. package/dist/http/api.module.js +4 -4
  86. package/dist/http/gateway-routes.d.ts +1 -1
  87. package/dist/http/gateway-routes.js +1 -1
  88. package/dist/http/meta.controller.js +1 -1
  89. package/dist/identity/settings.d.ts +1 -1
  90. package/dist/identity/settings.js +6 -8
  91. package/dist/infra/config/kernel-config.service.js +2 -2
  92. package/dist/infra/outbox/registry.d.ts +0 -14
  93. package/dist/infra/outbox/registry.js +0 -15
  94. package/dist/infra/throttler/named-throttlers.d.ts +1 -1
  95. package/dist/infra/throttler/named-throttlers.js +1 -1
  96. package/dist/kernel.module.js +0 -3
  97. package/dist/orgs/settings.service.js +5 -10
  98. package/dist/overrides.d.ts +0 -4
  99. package/dist/overrides.js +0 -2
  100. package/dist/platform/exclusions.js +5 -5
  101. package/dist/platform/ops/admin.ops.js +1 -1
  102. package/dist/platform/ops/conversations.ops.js +5 -2
  103. package/dist/platform/ops/devices.ops.js +11 -24
  104. package/dist/platform/ops/inbox.ops.js +1 -1
  105. package/dist/roles/gateway-role.d.ts +3 -3
  106. package/dist/roles/gateway-role.js +4 -4
  107. package/dist/roles/gateway.module.d.ts +1 -1
  108. package/dist/roles/gateway.module.js +5 -5
  109. package/dist/runtime/context/device-paths.d.ts +4 -1
  110. package/dist/runtime/context/permission-profile.js +5 -5
  111. package/dist/runtime/maintenance.d.ts +2 -5
  112. package/dist/runtime/maintenance.js +9 -19
  113. package/dist/runtime/project/knowledge.js +4 -5
  114. package/dist/runtime/project/knowledge.service.js +2 -1
  115. package/dist/sandbox/cloud-permission-snapshot.d.ts +1 -1
  116. package/dist/sandbox/cloud-permission-snapshot.js +1 -3
  117. package/dist/sandbox/device-reports.d.ts +74 -14
  118. package/dist/sandbox/device-reports.js +190 -33
  119. package/dist/sandbox/device-reports.module.d.ts +7 -0
  120. package/dist/sandbox/device-reports.module.js +25 -0
  121. package/dist/sandbox/device-sandbox.d.ts +39 -41
  122. package/dist/sandbox/device-sandbox.js +44 -83
  123. package/dist/sandbox/kernel-read.d.ts +2 -2
  124. package/dist/sandbox/legacy-retirement.d.ts +11 -59
  125. package/dist/sandbox/legacy-retirement.js +34 -186
  126. package/dist/sandbox/legacy-retirement.module.d.ts +2 -2
  127. package/dist/sandbox/legacy-retirement.module.js +2 -2
  128. package/dist/sandbox/managed-device-context.d.ts +16 -4
  129. package/dist/sandbox/managed-device-context.js +25 -8
  130. package/dist/sandbox/managed-device-context.module.js +4 -0
  131. package/dist/sandbox/modes.d.ts +3 -12
  132. package/dist/sandbox/modes.js +2 -14
  133. package/dist/{local-devices → sandbox}/network-grants.d.ts +2 -21
  134. package/dist/{local-devices → sandbox}/network-grants.js +4 -49
  135. package/dist/sandbox/operation-authority-types.d.ts +2 -1
  136. package/dist/sandbox/operation-authority.d.ts +6 -20
  137. package/dist/sandbox/operation-authority.js +43 -104
  138. package/dist/sandbox/operation-authority.module.js +1 -1
  139. package/dist/sandbox/operation-intents.d.ts +4 -1
  140. package/dist/sandbox/operation-intents.js +11 -2
  141. package/dist/sandbox/operation-reconcile.job.js +2 -4
  142. package/dist/sandbox/permission-availability.d.ts +6 -7
  143. package/dist/sandbox/permission-availability.js +7 -10
  144. package/dist/sandbox/permission-call-grants.d.ts +2 -1
  145. package/dist/sandbox/permission-call-grants.js +1 -7
  146. package/dist/sandbox/permission-call-types.d.ts +4 -4
  147. package/dist/sandbox/permission-ceiling-writes.d.ts +7 -23
  148. package/dist/sandbox/permission-ceiling-writes.js +8 -35
  149. package/dist/sandbox/permission-config-publication.d.ts +9 -1
  150. package/dist/sandbox/permission-config-publication.js +29 -21
  151. package/dist/sandbox/permission-context-types.d.ts +17 -10
  152. package/dist/sandbox/permission-facts.d.ts +98 -95
  153. package/dist/sandbox/permission-facts.js +160 -314
  154. package/dist/sandbox/permission-instance-writes.d.ts +23 -37
  155. package/dist/sandbox/permission-instance-writes.js +44 -121
  156. package/dist/sandbox/permission-runtime-reports.d.ts +38 -30
  157. package/dist/sandbox/permission-runtime-reports.js +105 -122
  158. package/dist/sandbox/providers.d.ts +26 -38
  159. package/dist/sandbox/providers.js +36 -18
  160. package/dist/sandbox/request-not-sent.d.ts +2 -13
  161. package/dist/sandbox/request-not-sent.js +2 -13
  162. package/dist/sandbox/review/permission-candidate.d.ts +13 -8
  163. package/dist/sandbox/review/permission-candidate.js +38 -48
  164. package/dist/sandbox/sandbox.module.js +7 -3
  165. package/dist/sandbox/sandbox.service.d.ts +49 -59
  166. package/dist/sandbox/sandbox.service.js +139 -259
  167. package/dist/schedules/fire.d.ts +15 -6
  168. package/dist/schedules/fire.js +27 -13
  169. package/dist/schedules/grant-rules.js +1 -1
  170. package/dist/schedules/scheduled-tasks.service.d.ts +0 -7
  171. package/dist/schedules/scheduled-tasks.service.js +1 -4
  172. package/dist/schedules/schedules.module.js +5 -3
  173. package/dist/skills/invoke.d.ts +1 -1
  174. package/dist/skills/invoke.js +2 -3
  175. package/dist/tools/approvals.service.d.ts +8 -5
  176. package/dist/tools/approvals.service.js +5 -5
  177. package/dist/tools/builtins/sandbox/bash.js +1 -2
  178. package/dist/tools/builtins/sandbox/common.d.ts +15 -9
  179. package/dist/tools/builtins/sandbox/common.js +37 -38
  180. package/dist/tools/network-asks.d.ts +19 -22
  181. package/dist/tools/network-asks.js +15 -21
  182. package/dist/tools/pipeline.d.ts +6 -7
  183. package/dist/tools/pipeline.js +17 -21
  184. package/dist/tools/tools.module.js +3 -7
  185. package/package.json +3 -4
  186. package/src/migrations/0177_dial_in_contract.sql +32 -0
  187. package/dist/local-devices/device-auth.module.d.ts +0 -7
  188. package/dist/local-devices/device-auth.module.js +0 -25
  189. package/dist/local-devices/device-policy.service.d.ts +0 -213
  190. package/dist/local-devices/device-policy.service.js +0 -605
  191. package/dist/local-devices/instance-bindings.d.ts +0 -82
  192. package/dist/local-devices/instance-bindings.js +0 -307
  193. package/dist/local-devices/local-device-gateway.d.ts +0 -153
  194. package/dist/local-devices/local-device-provider.d.ts +0 -122
  195. package/dist/local-devices/local-device-provider.js +0 -326
  196. package/dist/local-devices/local-devices.module.d.ts +0 -31
  197. package/dist/local-devices/local-devices.module.js +0 -100
  198. package/dist/local-devices/machines.d.ts +0 -211
  199. package/dist/local-devices/machines.js +0 -766
  200. package/dist/local-devices/owner-report.d.ts +0 -81
  201. package/dist/local-devices/owner-report.js +0 -150
  202. package/dist/local-devices/owner-reports.d.ts +0 -48
  203. package/dist/local-devices/owner-reports.js +0 -208
  204. package/dist/local-devices/policy-op-jobs.d.ts +0 -15
  205. package/dist/local-devices/policy-op-jobs.js +0 -12
  206. package/dist/local-devices/policy-summary.d.ts +0 -102
  207. package/dist/local-devices/policy-summary.js +0 -155
  208. package/dist/local-devices/relay.d.ts +0 -166
  209. package/dist/local-devices/relay.js +0 -559
  210. package/dist/tools/device-op-resolver.d.ts +0 -34
  211. package/dist/tools/device-op-resolver.js +0 -120
  212. /package/dist/{local-devices → dial-in}/keys.d.ts +0 -0
  213. /package/dist/{local-devices → dial-in}/keys.js +0 -0
  214. /package/dist/{local-devices → sandbox}/network-grants.module.d.ts +0 -0
  215. /package/dist/{local-devices → sandbox}/network-grants.module.js +0 -0
@@ -1,211 +0,0 @@
1
- import type { DeviceFeature, DeviceLocalPolicySummary, DeviceStopArgs, ExtensionContext, LegacyDeviceHello } from "@capybara-hq/plugin-sdk";
2
- import { type DeviceHello, type DeviceOwnerCeiling } from "@capybara-hq/plugin-sdk";
3
- import { KernelDb } from "../infra/database/kernel-db.js";
4
- import { TransactionHost } from "../infra/database/transaction-host.js";
5
- import { OutboxService } from "../infra/outbox/outbox.service.js";
6
- import type { KernelLogger } from "../log.js";
7
- import { LegacyRetirementStore } from "../sandbox/legacy-retirement.js";
8
- import { PermissionCeilingWrites } from "../sandbox/permission-ceiling-writes.js";
9
- import { PermissionRuntimeReports } from "../sandbox/permission-runtime-reports.js";
10
- import { OwnerReports } from "./owner-reports.js";
11
- import { LocalDeviceRelay } from "./relay.js";
12
- /** The machine credential's prefix (`cap_dev_` plus 32 random bytes, base64url). */
13
- export declare const MACHINE_CREDENTIAL_PREFIX = "cap_dev_";
14
- /** What a machine credential stands for. */
15
- export interface MachineIdentity {
16
- machineId: string;
17
- orgId: string;
18
- deviceId: string;
19
- accountId: string;
20
- }
21
- /** The machine connected to a device (its unrevoked row). */
22
- export interface ActiveMachine {
23
- id: string;
24
- orgId: string;
25
- accountId: string;
26
- name: string;
27
- os: string;
28
- arch: string;
29
- programVersion: string | null;
30
- lastSeenAt: Date | null;
31
- createdAt: Date;
32
- /** The features its program reported in its last hello (known ones only). */
33
- features: DeviceFeature[];
34
- /** Its local network policy as last reported (hello or `policy` op); null when unknown. */
35
- localPolicy: DeviceLocalPolicySummary | null;
36
- }
37
- export declare class MachinesService {
38
- private readonly db;
39
- readonly txHost: TransactionHost;
40
- private readonly relay;
41
- private readonly bus;
42
- private readonly outbox;
43
- private readonly log;
44
- private readonly ceilings;
45
- private readonly reports;
46
- private readonly owners;
47
- /** The host's boot identity: restart evidence for local legacy obligations (8.5). */
48
- private readonly retirement;
49
- constructor(db: KernelDb, txHost: TransactionHost, relay: Pick<LocalDeviceRelay, "holderLive" | "send">, bus: ExtensionContext["bus"], outbox: Pick<OutboxService, "add">, log: Pick<KernelLogger, "warn">, ceilings: PermissionCeilingWrites, reports: PermissionRuntimeReports, owners: OwnerReports,
50
- /** The host's boot identity: restart evidence for local legacy obligations (8.5). */
51
- retirement: Pick<LegacyRetirementStore, "recordBoot" | "clearBoot">);
52
- /**
53
- * A new machine for the device and its credential (returned once). Revokes the
54
- * device's active machine first. Joins the caller's transaction (the device confirmation),
55
- * which has already checked the device is the person's own live local device.
56
- */
57
- issue(input: {
58
- orgId: string;
59
- deviceId: string;
60
- accountId: string;
61
- name: string;
62
- os: string;
63
- arch: string;
64
- programVersion: string;
65
- }): Promise<{
66
- machineId: string;
67
- credential: string;
68
- }>;
69
- /**
70
- * Ruling R23: the new machine may serve the device from another directory or mode (other
71
- * roots), and a login recreates a directory that was lost (ruling R24). So the instance row
72
- * forgets its instance (status `none`, no handle) and its files count as there again; the next
73
- * use creates a fresh instance on the machine (with its roots: a new `device_paths` event
74
- * follows). The fence moves on, so a lifecycle holder of the old instance fails its next write.
75
- * The reset count (`fs_resets`) moves on when the files the next instance sees are not the old
76
- * ones, so conversations that used the old files are told their files were reset, not that they
77
- * were kept: lost files come back as an empty directory, and another machine (`moved`: name, OS
78
- * or arch differ from the device's previous machine) has other files. Another directory on
79
- * the same machine is known only from the new machine's first hello ({@link recordHello}).
80
- */
81
- private resetInstance;
82
- /**
83
- * Who a machine credential stands for, or null: the machine is not revoked, its device is
84
- * live, the org is not deleted (ruling R12), and the person is an active account still a member
85
- * of the org. Read live on every call (a connection re-checks it as it sees fit).
86
- */
87
- authenticate(credential: string): Promise<MachineIdentity | null>;
88
- /**
89
- * Stores what the program reported in its hello frame and marks the machine seen. On the
90
- * machine's first hello, when it is the same machine as the device's previous one (else
91
- * {@link issue} already counted the reset) but serves another directory or mode (other roots,
92
- * ruling R23), the device's files are other files: `fs_resets` moves on (maintainer
93
- * decision 2026-11-08), so conversations get the files-reset notice. A previous machine that
94
- * never said hello has no known roots: nothing to compare. The reported features (known ones
95
- * only) and local policy summary (null when absent or malformed) replace the stored ones, so a
96
- * program downgraded to one without them is no longer sent what it cannot do. The summary is the
97
- * device's sandbox allowlist; a change of what the owner sets, made on the machine while it was
98
- * away, is audited `device.policy_changed` (the owner ceiling's, `device.owner_ceiling_changed`)
99
- * ({@link reportedPolicy}). The outcomes of its recent policy ops (`recentOps`) backfill the
100
- * platform's ops still pending on the row ({@link backfillOps}). The owner's home directory
101
- * (`home`) replaces the stored one too (null when the hello has none).
102
- */
103
- recordHello(machineId: string, hello: LegacyDeviceHello,
104
- /** A protocol 4 hello's authenticated owner report (B2): it, not the summary, decides publication. */
105
- owner?: {
106
- report: DeviceOwnerCeiling;
107
- connectionId: string | null;
108
- }): Promise<void>;
109
- /**
110
- * Hello backfill (transactional outbox spec §7): a pending op of the platform's whose outcome
111
- * the hello reports (`applied`, `refused`), or that it does not list although the op can no
112
- * longer reach the machine (`absent`: past its `resolveAt`), is marked `reported` and owes a
113
- * `device-op-resolve` job (`device-op-reported-<opId>`) that records the outcome. An op the
114
- * machine logged only as `started` (it stopped between the log and the answer) is judged once
115
- * past its `resolveAt` by the policy the hello reports: its change there → `applied`, else
116
- * `interrupted` (within the window, or with no readable policy, it is left). An expired entry
117
- * (past `until`) is skipped: the machine's reports are no longer the op's. Runs in the caller's
118
- * transaction, with the machine's row locked; an op already reported is not owed again.
119
- */
120
- private backfillOps;
121
- /**
122
- * A protocol 4 hello on an authenticated connection: validated as a frame, then recorded like
123
- * {@link recordHello} with its owner report and the connection it arrived on.
124
- */
125
- recordHelloV3(machineId: string, hello: DeviceHello, connectionId?: string | null): Promise<void>;
126
- /**
127
- * The runtime identity a v3 hello may attest (B4): only a bound hello re-reporting exactly the
128
- * identity of the current instance generation's installed binding. An unbound hello, another
129
- * generation or a binding still awaiting the device attests nothing (unprobed; it never finishes
130
- * an installation, which only the bindInstance answer does).
131
- *
132
- * The machine the current generation was installed for no longer attesting it means its program
133
- * can never serve that generation again: a restarted program whose verified runtime differs from
134
- * the one its stored binding attested (every capybara-device upgrade changes the runtime bytes)
135
- * starts unbound, and the device refuses to rebind a generation under a changed runtime. The
136
- * instance is then replaced ({@link replaceUnattestedLocked}), so the next use creates and binds
137
- * a new generation under the new evidence instead of staying unprobed until a new login.
138
- *
139
- * A connection answers bindInstance before its own hello is recorded (the hello is recorded
140
- * after `ready`), so a binding installed on the hello's own connection is newer than the hello:
141
- * it is left as it is (`installed-here`), never replaced by the evidence the hello predates.
142
- */
143
- private boundIdentityLocked;
144
- /**
145
- * Replaces a local instance whose installed binding its machine no longer attests (under the
146
- * device authority writer): the row forgets its instance (status `none`, no handle) and its
147
- * fence moves on, so a lifecycle holder of the old instance fails its next write; the device's
148
- * admission epoch advances, revoking every admitted or started operation of the old generation.
149
- * The files stay (the same machine and directory): the next use creates a new instance on them,
150
- * which the kernel binds under the program's new runtime evidence. Full consent is left to that
151
- * install, which resets it when the proven environment fingerprint changed: a fingerprint a
152
- * hello merely names proves nothing, and nothing is admitted before the install records a
153
- * report, so resetting here too would reset twice.
154
- */
155
- private replaceUnattestedLocked;
156
- /**
157
- * Stores the local policy summary a connected program pushed after its hello (a `policy` frame:
158
- * its policy file changed on the machine: its sandbox allowlist), read and audited as the hello's
159
- * ({@link recordHello}). A change the owner made on the machine is audited
160
- * `device.policy_changed`. The next sandbox call then records a
161
- * new `device_paths` event when the facts the model is told changed. A revoked machine is left
162
- * alone.
163
- */
164
- recordPolicy(machineId: string, summary: DeviceLocalPolicySummary | undefined): Promise<void>;
165
- /**
166
- * A staged (v3) `policy` frame (B2): the summary is kept for the device page like protocol 2's,
167
- * while the authenticated owner report alone decides what changed ({@link OwnerReports}).
168
- */
169
- recordPolicyV3(machineId: string, frame: unknown, connectionId?: string | null): Promise<void>;
170
- /**
171
- * The summary to store for one a program reported (hello or `policy` frame): the parsed one, else
172
- * null. When both the stored and the reported summary are readable and what the owner sets
173
- * changed ({@link localPolicyDiff}) by no `policy` op the platform sent ({@link opExplains}: its
174
- * answer may come after the machine's own report), the owner changed it on the machine
175
- * (`capybara-device policy add|remove allowedDomains ...`): the host changes are audited
176
- * `device.policy_changed`, `via: "device"`, so the device page lists them beside the platform's
177
- * changes (an owner ceiling change is the owner report writer's, `device.owner_ceiling_changed`);
178
- * one an op explains is not audited here (the op's answer is). A summary reported again is no change. Runs in the caller's transaction,
179
- * with the machine's row locked.
180
- */
181
- private reportedPolicy;
182
- /** Marks the machine seen (a ping); writes at most once every 60 seconds. */
183
- touch(machineId: string): Promise<void>;
184
- /**
185
- * Disconnects the machine of one of the person's own live local devices (`DELETE
186
- * /orgs/:orgId/devices/:id/machine`): revokes it and audits
187
- * `device.machine_revoked`. Anyone else's device, a cloud one or a missing one →
188
- * `device.not_found`; no machine connected is a no-op.
189
- */
190
- revoke(orgId: string, accountId: string, deviceId: string, actorTokenId?: string): Promise<void>;
191
- /**
192
- * Revokes the device's active machine, if any, in the caller's transaction, and after the
193
- * commit tells it to stop for `reason` (none: only its connection is closed) and closes its
194
- * connection. Returns the revoked machine's id. Used by {@link issue} (replaced: no stop),
195
- * {@link revoke} and the device's deletion (`deleted`).
196
- */
197
- revokeActive(deviceId: string, reason: DeviceStopArgs["reason"] | null): Promise<string | null>;
198
- /**
199
- * Revokes one machine by id (a sign-in whose credential never reached the program), with the
200
- * same post-commit disconnect as a replacement (no stop frame). True when it was active.
201
- */
202
- revokeMachine(machineId: string): Promise<boolean>;
203
- /** The device's active machine, or null. */
204
- activeFor(deviceId: string): Promise<ActiveMachine | null>;
205
- /**
206
- * After a revocation commits: `stop` is queued only while a replica holds the connection (an
207
- * offline machine must not find it on the list later), then the revocation is published.
208
- * Failures are logged; the revocation itself stands.
209
- */
210
- private disconnect;
211
- }