@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
@@ -16,7 +16,7 @@ export declare const DeviceParams: z.ZodObject<{
16
16
  id: z.ZodString;
17
17
  }, z.core.$strip>;
18
18
  /**
19
- * A cloud device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
19
+ * A device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
20
20
  * public internet), `allowlist` (its org's hosts, narrowed to `hosts` when given: a device list
21
21
  * never adds a host, and an empty one follows the org's), `none` (closed), or `null` to follow its
22
22
  * org again. `hosts` only with `allowlist`.
@@ -30,11 +30,10 @@ export declare const DeviceNetworkBody: z.ZodObject<{
30
30
  hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
31
  }, z.core.$strict>;
32
32
  /**
33
- * `PATCH /devices/:id`: a new name, and a cloud device's sandbox `network`
34
- * ({@link DeviceNetworkBody}), within its org's and the platform's ceilings (`device.network_not_allowed`
35
- * above them). A local device's network lives on its machine (`device.ceiling_on_machine`: narrow
36
- * it with `POST /devices/:id/policy`, widen it on the machine). Through an API token or the
37
- * Platform tool (`devices.set-network`) the network may only narrow.
33
+ * `PATCH /devices/:id`: a new name, and the device's sandbox `network` ({@link DeviceNetworkBody}),
34
+ * within its org's and the platform's ceilings (`device.network_not_allowed` above them), the
35
+ * same for every provider. Through an API token or the Platform tool (`devices.set-network`) the
36
+ * network may only narrow.
38
37
  */
39
38
  export declare const DevicePatchBody: z.ZodObject<{
40
39
  name: z.ZodOptional<z.ZodString>;
@@ -47,22 +46,6 @@ export declare const DevicePatchBody: z.ZodObject<{
47
46
  hosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
47
  }, z.core.$strict>>;
49
48
  }, z.core.$strict>;
50
- /**
51
- * `POST /devices/:id/policy` (approval-only profiles design, "Settings model"): the device owner
52
- * narrows the local machine's sandbox from the web: `remove` hosts from its allowlist, and narrow
53
- * its owner ceiling (`outsideSandbox: false`, `network: "allowlist"`, `restrictedProjectReach:
54
- * "workspace"`). The web never widens it: the owner adds hosts, opens the network or allows
55
- * running outside the sandbox on the machine (`capybara-device policy add allowedDomains`,
56
- * `capybara-device ceiling set`).
57
- */
58
- export declare const DevicePolicyBody: z.ZodObject<{
59
- remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
- ownerCeiling: z.ZodOptional<z.ZodObject<{
61
- outsideSandbox: z.ZodOptional<z.ZodLiteral<false>>;
62
- network: z.ZodOptional<z.ZodLiteral<"allowlist">>;
63
- restrictedProjectReach: z.ZodOptional<z.ZodLiteral<"workspace">>;
64
- }, z.core.$strict>>;
65
- }, z.core.$strict>;
66
49
  /**
67
50
  * A project's name (project root §4.1, `isDeviceProjectName`): 1-64 UTF-16 code units, not `.` or
68
51
  * `..`, no `/`, no control characters, no leading or trailing whitespace; unique on its device.
@@ -106,16 +89,6 @@ declare const DeviceParamsDto_base: import("../infra/validation/create-zod-dto.j
106
89
  }, z.core.$strip>>;
107
90
  export declare class DeviceParamsDto extends DeviceParamsDto_base {
108
91
  }
109
- declare const DevicePolicyBodyDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
110
- remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
- ownerCeiling: z.ZodOptional<z.ZodObject<{
112
- outsideSandbox: z.ZodOptional<z.ZodLiteral<false>>;
113
- network: z.ZodOptional<z.ZodLiteral<"allowlist">>;
114
- restrictedProjectReach: z.ZodOptional<z.ZodLiteral<"workspace">>;
115
- }, z.core.$strict>>;
116
- }, z.core.$strict>>;
117
- export declare class DevicePolicyBodyDto extends DevicePolicyBodyDto_base {
118
- }
119
92
  declare const DeviceProjectAddBodyDto_base: import("../infra/validation/create-zod-dto.js").ZodDtoClass<z.ZodObject<{
120
93
  path: z.ZodString;
121
94
  name: z.ZodOptional<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
@@ -27,7 +27,7 @@ const PolicyHost = z
27
27
  ctx.addIssue({ code: "custom", message });
28
28
  });
29
29
  /**
30
- * A cloud device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
30
+ * A device's sandbox network (approval-only profiles design, "Settings model"): `open` (the
31
31
  * public internet), `allowlist` (its org's hosts, narrowed to `hosts` when given: a device list
32
32
  * never adds a host, and an empty one follows the org's), `none` (closed), or `null` to follow its
33
33
  * org again. `hosts` only with `allowlist`.
@@ -42,11 +42,10 @@ export const DeviceNetworkBody = z
42
42
  message: "Give hosts only with the allowlist network",
43
43
  });
44
44
  /**
45
- * `PATCH /devices/:id`: a new name, and a cloud device's sandbox `network`
46
- * ({@link DeviceNetworkBody}), within its org's and the platform's ceilings (`device.network_not_allowed`
47
- * above them). A local device's network lives on its machine (`device.ceiling_on_machine`: narrow
48
- * it with `POST /devices/:id/policy`, widen it on the machine). Through an API token or the
49
- * Platform tool (`devices.set-network`) the network may only narrow.
45
+ * `PATCH /devices/:id`: a new name, and the device's sandbox `network` ({@link DeviceNetworkBody}),
46
+ * within its org's and the platform's ceilings (`device.network_not_allowed` above them), the
47
+ * same for every provider. Through an API token or the Platform tool (`devices.set-network`) the
48
+ * network may only narrow.
50
49
  */
51
50
  export const DevicePatchBody = z
52
51
  .object({
@@ -57,35 +56,6 @@ export const DevicePatchBody = z
57
56
  .refine((b) => b.name !== undefined || b.network !== undefined, {
58
57
  message: "Give at least one of name or network",
59
58
  });
60
- /**
61
- * `POST /devices/:id/policy` (approval-only profiles design, "Settings model"): the device owner
62
- * narrows the local machine's sandbox from the web: `remove` hosts from its allowlist, and narrow
63
- * its owner ceiling (`outsideSandbox: false`, `network: "allowlist"`, `restrictedProjectReach:
64
- * "workspace"`). The web never widens it: the owner adds hosts, opens the network or allows
65
- * running outside the sandbox on the machine (`capybara-device policy add allowedDomains`,
66
- * `capybara-device ceiling set`).
67
- */
68
- export const DevicePolicyBody = z
69
- .object({
70
- remove: z.array(PolicyHost).min(1).max(100).optional(),
71
- ownerCeiling: z
72
- .object({
73
- outsideSandbox: z.literal(false).optional(),
74
- network: z.literal("allowlist").optional(),
75
- restrictedProjectReach: z.literal("workspace").optional(),
76
- })
77
- .strict()
78
- .refine((c) => c.outsideSandbox !== undefined ||
79
- c.network !== undefined ||
80
- c.restrictedProjectReach !== undefined, {
81
- message: "Give outsideSandbox: false, network: allowlist or restrictedProjectReach: workspace",
82
- })
83
- .optional(),
84
- })
85
- .strict()
86
- .refine((b) => b.remove !== undefined || b.ownerCeiling !== undefined, {
87
- message: "Give at least one of remove or ownerCeiling",
88
- });
89
59
  /**
90
60
  * A project's name (project root §4.1, `isDeviceProjectName`): 1-64 UTF-16 code units, not `.` or
91
61
  * `..`, no `/`, no control characters, no leading or trailing whitespace; unique on its device.
@@ -125,8 +95,6 @@ export class DevicePatchBodyDto extends createZodDto(DevicePatchBody, "DevicePat
125
95
  }
126
96
  export class DeviceParamsDto extends createZodDto(DeviceParams, "DeviceParams") {
127
97
  }
128
- export class DevicePolicyBodyDto extends createZodDto(DevicePolicyBody, "DevicePolicyBody") {
129
- }
130
98
  export class DeviceProjectAddBodyDto extends createZodDto(DeviceProjectAddBody, "DeviceProjectAddBody") {
131
99
  }
132
100
  export class DeviceProjectParamsDto extends createZodDto(DeviceProjectParams, "DeviceProjectParams") {
@@ -2,12 +2,13 @@ import { ApiError } from "../errors.js";
2
2
  /** The device is missing, deleted, or not in the caller's org (404; ids cannot be probed). */
3
3
  export declare const deviceNotFound: () => ApiError;
4
4
  /**
5
- * The device's machine was disconnected (revoked, signed out): 403 `device.forbidden`
6
- * with `details: [{ reason: "machine_revoked" }]`, so the tools tell the model what to ask for.
5
+ * The machine serving a dial-in device was disconnected (revoked, signed out): 403
6
+ * `device.forbidden` with `details: [{ reason: "machine_revoked" }]`, so the tools tell the model
7
+ * what to ask for.
7
8
  */
8
9
  export declare const machineRevoked: () => ApiError;
9
10
  /**
10
- * The device offers no projects (project root §4.1): a local machine whose `capybara-device`
11
- * does not announce `projects`, or a cloud provider without `list` / `scan`.
11
+ * The device offers no projects (project root §4.1): its provider does not implement `list`
12
+ * (or `scan`).
12
13
  */
13
- export declare const projectsUnsupported: (local: boolean) => ApiError;
14
+ export declare const projectsUnsupported: () => ApiError;
@@ -2,14 +2,13 @@ import { ApiError } from "../errors.js";
2
2
  /** The device is missing, deleted, or not in the caller's org (404; ids cannot be probed). */
3
3
  export const deviceNotFound = () => new ApiError("device.not_found", "This device does not exist or was deleted.");
4
4
  /**
5
- * The device's machine was disconnected (revoked, signed out): 403 `device.forbidden`
6
- * with `details: [{ reason: "machine_revoked" }]`, so the tools tell the model what to ask for.
5
+ * The machine serving a dial-in device was disconnected (revoked, signed out): 403
6
+ * `device.forbidden` with `details: [{ reason: "machine_revoked" }]`, so the tools tell the model
7
+ * what to ask for.
7
8
  */
8
- export const machineRevoked = () => new ApiError("device.forbidden", "The machine of this local device was disconnected. Run capybara-device logout, then capybara-device login on it, or pick another device.", [{ reason: "machine_revoked" }]);
9
+ export const machineRevoked = () => new ApiError("device.forbidden", "The machine serving this device was disconnected. Sign that machine in to this device again, or pick another device.", [{ reason: "machine_revoked" }]);
9
10
  /**
10
- * The device offers no projects (project root §4.1): a local machine whose `capybara-device`
11
- * does not announce `projects`, or a cloud provider without `list` / `scan`.
11
+ * The device offers no projects (project root §4.1): its provider does not implement `list`
12
+ * (or `scan`).
12
13
  */
13
- export const projectsUnsupported = (local) => new ApiError("device.projects_unsupported", local
14
- ? "This device's capybara-device does not support projects; update capybara-device on that machine and reconnect it."
15
- : "This device's sandbox provider does not support projects; its conversations work without one.");
14
+ export const projectsUnsupported = () => new ApiError("device.projects_unsupported", "This device's provider does not support projects; its conversations work without one.");
@@ -2,24 +2,23 @@ import { ApiError } from "../errors.js";
2
2
  import type { SandboxMode } from "../sandbox/modes.js";
3
3
  /** What a project's scope is read from: the device's mode now and the bases it gives. */
4
4
  export interface DeviceProjectScope {
5
- source: "cloud" | "local";
6
5
  mode: SandboxMode;
6
+ /** The workspace root as last known (the held instance's handle). */
7
+ workspace: string;
7
8
  /**
8
- * How far restricted reads reach (B2): `os-user` only on a local machine whose owner chose it,
9
- * within a platform and org that allow the wider device ceiling; else the workspace.
9
+ * The home its provider last reported (`devices.report.home`): projects are relative to it and
10
+ * the kernel narrows no path below it (where a project may lie is the provider's rule); null
11
+ * when the provider reports none, and projects stay in the workspace.
10
12
  */
11
- reach: "workspace" | "os-user";
12
- /** The workspace root as last known (a machine's hello, a cloud instance's handle). */
13
- workspace: string;
14
- /** The owner's home a local machine reported; null when unknown (and for a cloud device). */
15
13
  home: string | null;
16
14
  supported: boolean;
17
15
  }
18
16
  type Scope = DeviceProjectScope;
19
- /** The base a relative path is resolved against in the scope's mode (project root §4.2). */
20
- export declare const baseOf: (s: Scope, workspace?: string) => string | null;
17
+ /** The base a relative path resolves against (project root §4.2): the home, else the workspace. */
18
+ export declare const baseOf: (s: Scope, workspace?: string) => string;
21
19
  /**
22
- * `path` lies inside what the scope's mode may read (sandbox mode and cloud: the workspace, as the
20
+ * `path` lies inside what the kernel lets the scope's projects reach: anywhere when the provider
21
+ * reports a home (the provider refuses what it will not serve), else inside the workspace (as the
23
22
  * held instance reports it when given).
24
23
  */
25
24
  export declare const withinMode: (s: Scope, path: string, workspace?: string) => boolean;
@@ -28,7 +27,6 @@ export declare const nameTaken: (name: string) => ApiError;
28
27
  export declare const projectNotFound: (name: string) => ApiError;
29
28
  export declare const outsideMode: (path: string, mode: SandboxMode) => ApiError;
30
29
  export declare const tooBroad: (path: string) => ApiError;
31
- export declare const homeUnknown: () => ApiError;
32
30
  /** A device-supplied or person-supplied string inside a message, bounded. */
33
31
  export declare function clipped(s: string, max?: number): string;
34
32
  export {};
@@ -1,13 +1,14 @@
1
1
  import { ApiError } from "../errors.js";
2
- /** Only the owner's home bounds nothing: OS-user reach on a machine reads what its owner can. */
3
- const homeBased = (s) => s.source === "local" && s.reach === "os-user";
4
- /** The base a relative path is resolved against in the scope's mode (project root §4.2). */
5
- export const baseOf = (s, workspace = s.workspace) => homeBased(s) ? s.home : workspace;
2
+ /** The base a relative path resolves against (project root §4.2): the home, else the workspace. */
3
+ export const baseOf = (s, workspace = s.workspace) => s.home ?? workspace;
6
4
  /**
7
- * `path` lies inside what the scope's mode may read (sandbox mode and cloud: the workspace, as the
5
+ * `path` lies inside what the kernel lets the scope's projects reach: anywhere when the provider
6
+ * reports a home (the provider refuses what it will not serve), else inside the workspace (as the
8
7
  * held instance reports it when given).
9
8
  */
10
- export const withinMode = (s, path, workspace = s.workspace) => homeBased(s) || path === workspace || path.startsWith(workspace === "/" ? "/" : `${workspace}/`);
9
+ export const withinMode = (s, path, workspace = s.workspace) => s.home !== null ||
10
+ path === workspace ||
11
+ path.startsWith(workspace === "/" ? "/" : `${workspace}/`);
11
12
  export const nameInvalid = (name) => new ApiError("device.project_name_invalid", `"${clipped(name)}" is not a valid project name: use 1-64 characters, not . or .., without / or control characters, and without leading or trailing spaces`);
12
13
  export const nameTaken = (name) => new ApiError("device.project_name_taken", `This device already has a project named "${clipped(name)}"; pick another name`);
13
14
  export const projectNotFound = (name) => new ApiError("device.project_not_found", `This device has no project named "${clipped(name)}"`);
@@ -15,7 +16,6 @@ export const outsideMode = (path, mode) => new ApiError("device.project_outside_
15
16
  ? `${clipped(path)} is outside the device's workspace, the only directory it can read in sandbox mode`
16
17
  : `${clipped(path)} is outside the device's workspace, the only directory a cloud device can read`);
17
18
  export const tooBroad = (path) => new ApiError("device.project_path_too_broad", `${clipped(path)} holds the owner's home directory (or other people's): pick the project's own directory, the home or below it`);
18
- export const homeUnknown = () => new ApiError("device.project_home_unknown", "In auto mode a project's path is relative to the owner's home directory, which this device has not reported; update capybara-device on that machine and reconnect it");
19
19
  /** A device-supplied or person-supplied string inside a message, bounded. */
20
20
  export function clipped(s, max = 200) {
21
21
  return s.length <= max ? s : `${s.slice(0, max)}…`;
@@ -1,4 +1,3 @@
1
- import type { SandboxMode } from "../sandbox/modes.js";
2
1
  /**
3
2
  * What decides a conversation's working root (project root spec §4.3): the latest `project_root`
4
3
  * event of its root conversation (sub-agents inherit their root's binding), or the bound root
@@ -24,15 +23,13 @@ export declare function aboveHome(root: string, home: string | null | undefined)
24
23
  * `Glob` and `Grep` search by default, what a relative file-tool path resolves against, and the
25
24
  * command review's `workspace` fact. It is the project's root when the latest snapshot is usable,
26
25
  * else the device's `workspace` (free mode). It never widens anything: a root that is not a clean
27
- * absolute path, one the run cannot use, one outside the workspace in sandbox mode (where the
28
- * device reads nothing else), and one above the owner's home ({@link aboveHome}) all fall back
29
- * to the device's workspace.
26
+ * absolute path, one the run cannot use and one above the owner's home ({@link aboveHome}) all
27
+ * fall back to the device's workspace. Where a project may lie is its device provider's rule
28
+ * (device-provider spec §6.1), checked when the project was added.
30
29
  */
31
30
  export declare function workingRootOf(project: WorkingProject | null | undefined, device: {
32
- mode: SandboxMode;
33
31
  workspace: string;
34
32
  home?: string | null;
35
- reach?: "workspace" | "os-user" | undefined;
36
33
  }): string;
37
34
  /**
38
35
  * A root in the one form two roots are compared in (B-18): POSIX-normalized (`.` and doubled `/`
@@ -21,9 +21,9 @@ const isInside = (path, dir) => path === dir || path.startsWith(dir === "/" ? "/
21
21
  * `Glob` and `Grep` search by default, what a relative file-tool path resolves against, and the
22
22
  * command review's `workspace` fact. It is the project's root when the latest snapshot is usable,
23
23
  * else the device's `workspace` (free mode). It never widens anything: a root that is not a clean
24
- * absolute path, one the run cannot use, one outside the workspace in sandbox mode (where the
25
- * device reads nothing else), and one above the owner's home ({@link aboveHome}) all fall back
26
- * to the device's workspace.
24
+ * absolute path, one the run cannot use and one above the owner's home ({@link aboveHome}) all
25
+ * fall back to the device's workspace. Where a project may lie is its device provider's rule
26
+ * (device-provider spec §6.1), checked when the project was added.
27
27
  */
28
28
  export function workingRootOf(project, device) {
29
29
  if (project == null || project.unavailable)
@@ -33,11 +33,6 @@ export function workingRootOf(project, device) {
33
33
  : project.root;
34
34
  if (validateSandboxPathShape(root).length > 0)
35
35
  return device.workspace;
36
- // B2: a root outside the workspace needs the wider restricted reach (`reach`, given apart from
37
- // the Full mode); without it, the protocol 2 encoding (`mode: auto` was that reach)
38
- const wide = device.reach !== undefined ? device.reach === "os-user" : device.mode === "auto";
39
- if (!wide && !isInside(root, device.workspace))
40
- return device.workspace;
41
36
  if (aboveHome(root, device.home))
42
37
  return device.workspace;
43
38
  return root;
@@ -0,0 +1,23 @@
1
+ import { KernelDb } from "../infra/database/kernel-db.js";
2
+ import { DialInRelay, type DialInRequestOptions } from "./relay.js";
3
+ /**
4
+ * What `ctx.dialIn` is built from (`ctx/create-ctx.ts`): the relay, and the check that a device is
5
+ * served by the calling extension. Kept below the extension host (its module imports nothing but
6
+ * the global infrastructure), so the host can build every extension's `ctx` from it.
7
+ */
8
+ export declare class DialInAccess {
9
+ private readonly kdb;
10
+ private readonly relay;
11
+ constructor(kdb: KernelDb, relay: Pick<DialInRelay, "request" | "online" | "stop">);
12
+ /**
13
+ * Whether `deviceId` is a live device (in a live org) whose `devices.provider` is `plugin`, and
14
+ * `plugin` is enabled in the device's org. Read from PG at every call. The full availability
15
+ * check (valid org and effective config, `DeviceProviderSelection.isOnInOrg`) runs at the
16
+ * machine's hello; this one stays below the extension host's module.
17
+ */
18
+ serves(plugin: string, deviceId: string): Promise<boolean>;
19
+ /** {@link DialInRelay.request} with only the options an extension may pass. */
20
+ request(deviceId: string, body: unknown, opts: Pick<DialInRequestOptions, "timeoutMs" | "signal">): Promise<unknown>;
21
+ online(deviceId: string): Promise<boolean>;
22
+ stop(deviceId: string, reason: "drain" | "stop"): Promise<void>;
23
+ }
@@ -0,0 +1,64 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { Inject, Injectable } from "@nestjs/common";
11
+ import { isExtensionEnabled } from "../extensions/enabled.js";
12
+ import { KernelDb } from "../infra/database/kernel-db.js";
13
+ import { DialInRelay } from "./relay.js";
14
+ /**
15
+ * What `ctx.dialIn` is built from (`ctx/create-ctx.ts`): the relay, and the check that a device is
16
+ * served by the calling extension. Kept below the extension host (its module imports nothing but
17
+ * the global infrastructure), so the host can build every extension's `ctx` from it.
18
+ */
19
+ let DialInAccess = class DialInAccess {
20
+ kdb;
21
+ relay;
22
+ constructor(kdb, relay) {
23
+ this.kdb = kdb;
24
+ this.relay = relay;
25
+ }
26
+ /**
27
+ * Whether `deviceId` is a live device (in a live org) whose `devices.provider` is `plugin`, and
28
+ * `plugin` is enabled in the device's org. Read from PG at every call. The full availability
29
+ * check (valid org and effective config, `DeviceProviderSelection.isOnInOrg`) runs at the
30
+ * machine's hello; this one stays below the extension host's module.
31
+ */
32
+ async serves(plugin, deviceId) {
33
+ const row = await this.kdb.db
34
+ .selectFrom("devices as d")
35
+ .innerJoin("orgs as o", "o.id", "d.org_id")
36
+ .select(["d.org_id", "d.provider"])
37
+ .where("d.id", "=", deviceId)
38
+ .where("d.deleted_at", "is", null)
39
+ .where("o.deleted_at", "is", null)
40
+ .executeTakeFirst();
41
+ if (!row || row.provider !== plugin)
42
+ return false;
43
+ return isExtensionEnabled(this.kdb.db, row.org_id, plugin);
44
+ }
45
+ /** {@link DialInRelay.request} with only the options an extension may pass. */
46
+ request(deviceId, body, opts) {
47
+ return this.relay.request(deviceId, body, {
48
+ timeoutMs: opts.timeoutMs,
49
+ ...(opts.signal !== undefined && { signal: opts.signal }),
50
+ });
51
+ }
52
+ online(deviceId) {
53
+ return this.relay.online(deviceId);
54
+ }
55
+ stop(deviceId, reason) {
56
+ return this.relay.stop(deviceId, reason);
57
+ }
58
+ };
59
+ DialInAccess = __decorate([
60
+ Injectable(),
61
+ __param(0, Inject(KernelDb)),
62
+ __param(1, Inject(DialInRelay))
63
+ ], DialInAccess);
64
+ export { DialInAccess };
@@ -2,14 +2,14 @@ import type { FastifyReply, FastifyRequest } from "fastify";
2
2
  import type { z } from "zod";
3
3
  import { type Principal } from "../identity/principal.js";
4
4
  import { CredentialThrottler } from "../infra/throttler/credential-throttler.js";
5
- import { type DeviceAuthorization, DeviceAuthService, type DeviceGrant, type DeviceMachineInfo } from "./device-auth.js";
6
- import { type DeviceAuthorizeBody, type DeviceConfirmBody, type DeviceTokenBody, type DeviceUserCodeBody, type DeviceUserCodeParams } from "./dto.js";
5
+ import { type DeviceAuthorization, type DeviceGrant, type DeviceMachineInfo, DialInAuthService, type DialInProviderChoice } from "./auth.service.js";
6
+ import { type DeviceAuthorizeBody, type DeviceConfirmBody, type DeviceProvidersQuery, type DeviceTokenBody, type DeviceUserCodeBody, type DeviceUserCodeParams } from "./dto.js";
7
7
  /**
8
8
  * Device sign-in (`/api/v1/device`, environments spec §13.3; the shape of RFC 8628).
9
9
  *
10
10
  * The program's routes are public (it has no credential yet); like every public unsafe route
11
11
  * they need `X-Capybara-Csrf: 1`, which `capybara-device` sends:
12
- * - `POST /authorize { name, os, arch, programVersion }` → `{ deviceCode, userCode,
12
+ * - `POST /authorize { name, os, arch, programVersion, protocol }` → `{ deviceCode, userCode,
13
13
  * verificationUri, verificationUriComplete, interval, expiresIn }` (`device-authorize-ip`);
14
14
  * - `POST /token { deviceCode }` → `{ credential, orgId, deviceId, connectUrl,
15
15
  * reconnectGraceSeconds, maxFrameBytes, outsideSandbox }` once, else `device_sign_in.authorization_pending` / `device_sign_in.slow_down` /
@@ -18,21 +18,27 @@ import { type DeviceAuthorizeBody, type DeviceConfirmBody, type DeviceTokenBody,
18
18
  * The person's routes need a web session (the confirmation page `/device`); each try of a user
19
19
  * code counts on `device-code-account` (refunded on success):
20
20
  * - `GET /pending/:userCode` → `{ machine, expiresAt }`;
21
- * - `POST /confirm { userCode, orgId, deviceId | name }` → `{ deviceId }`
21
+ * - `GET /providers?orgId&userCode` → `{ providers: [{ plugin, displayName, devices }] }`: the
22
+ * dial-in providers on in the org that speak the program's protocol, each with the person's
23
+ * devices of it (`agents.use` in the org);
24
+ * - `POST /confirm { userCode, orgId, provider, deviceId | name }` → `{ deviceId }`
22
25
  * (`device_sign_in.expired` / `device_sign_in.unavailable` when the credential could not be handed over: the
23
26
  * machine is revoked again and the person runs login again);
24
27
  * - `POST /deny { userCode }` → 204.
25
28
  */
26
- export declare class DeviceAuthController {
29
+ export declare class DialInAuthController {
27
30
  private readonly auth;
28
31
  private readonly throttler;
29
- constructor(auth: DeviceAuthService, throttler: CredentialThrottler);
32
+ constructor(auth: DialInAuthService, throttler: CredentialThrottler);
30
33
  authorize(body: z.infer<typeof DeviceAuthorizeBody>): Promise<DeviceAuthorization>;
31
34
  token(body: z.infer<typeof DeviceTokenBody>): Promise<DeviceGrant>;
32
35
  pending(principal: Principal, params: z.infer<typeof DeviceUserCodeParams>, req: FastifyRequest, reply: FastifyReply): Promise<{
33
36
  machine: DeviceMachineInfo;
34
37
  expiresAt: string;
35
38
  }>;
39
+ providers(principal: Principal, query: z.infer<typeof DeviceProvidersQuery>, req: FastifyRequest, reply: FastifyReply): Promise<{
40
+ providers: DialInProviderChoice[];
41
+ }>;
36
42
  confirm(principal: Principal, body: z.infer<typeof DeviceConfirmBody>, req: FastifyRequest, reply: FastifyReply): Promise<{
37
43
  deviceId: string;
38
44
  }>;
@@ -11,9 +11,9 @@ import { Controller, Get, HttpCode, Inject, Post, Req, Res } from "@nestjs/commo
11
11
  import { CurrentPrincipal, Public, requireUser, SessionOnly, } from "../identity/principal.js";
12
12
  import { CredentialThrottler } from "../infra/throttler/credential-throttler.js";
13
13
  import { Throttled } from "../infra/throttler/throttler.guard.js";
14
- import { ZBody, ZParam } from "../infra/validation/zod-params.js";
15
- import { DeviceAuthService, } from "./device-auth.js";
16
- import { DeviceAuthorizeBodyDto, DeviceConfirmBodyDto, DeviceTokenBodyDto, DeviceUserCodeBodyDto, DeviceUserCodeParamsDto, } from "./dto.js";
14
+ import { ZBody, ZParam, ZQuery } from "../infra/validation/zod-params.js";
15
+ import { DialInAuthService, } from "./auth.service.js";
16
+ import { DeviceAuthorizeBodyDto, DeviceConfirmBodyDto, DeviceProvidersQueryDto, DeviceTokenBodyDto, DeviceUserCodeBodyDto, DeviceUserCodeParamsDto, } from "./dto.js";
17
17
  /** The throttler of every route that takes a user code (guessing another machine's code). */
18
18
  const CODE_THROTTLER = ["device-code-account"];
19
19
  /**
@@ -21,7 +21,7 @@ const CODE_THROTTLER = ["device-code-account"];
21
21
  *
22
22
  * The program's routes are public (it has no credential yet); like every public unsafe route
23
23
  * they need `X-Capybara-Csrf: 1`, which `capybara-device` sends:
24
- * - `POST /authorize { name, os, arch, programVersion }` → `{ deviceCode, userCode,
24
+ * - `POST /authorize { name, os, arch, programVersion, protocol }` → `{ deviceCode, userCode,
25
25
  * verificationUri, verificationUriComplete, interval, expiresIn }` (`device-authorize-ip`);
26
26
  * - `POST /token { deviceCode }` → `{ credential, orgId, deviceId, connectUrl,
27
27
  * reconnectGraceSeconds, maxFrameBytes, outsideSandbox }` once, else `device_sign_in.authorization_pending` / `device_sign_in.slow_down` /
@@ -30,12 +30,15 @@ const CODE_THROTTLER = ["device-code-account"];
30
30
  * The person's routes need a web session (the confirmation page `/device`); each try of a user
31
31
  * code counts on `device-code-account` (refunded on success):
32
32
  * - `GET /pending/:userCode` → `{ machine, expiresAt }`;
33
- * - `POST /confirm { userCode, orgId, deviceId | name }` → `{ deviceId }`
33
+ * - `GET /providers?orgId&userCode` → `{ providers: [{ plugin, displayName, devices }] }`: the
34
+ * dial-in providers on in the org that speak the program's protocol, each with the person's
35
+ * devices of it (`agents.use` in the org);
36
+ * - `POST /confirm { userCode, orgId, provider, deviceId | name }` → `{ deviceId }`
34
37
  * (`device_sign_in.expired` / `device_sign_in.unavailable` when the credential could not be handed over: the
35
38
  * machine is revoked again and the person runs login again);
36
39
  * - `POST /deny { userCode }` → 204.
37
40
  */
38
- let DeviceAuthController = class DeviceAuthController {
41
+ let DialInAuthController = class DialInAuthController {
39
42
  auth;
40
43
  throttler;
41
44
  constructor(auth, throttler) {
@@ -52,6 +55,10 @@ let DeviceAuthController = class DeviceAuthController {
52
55
  requireUser(principal);
53
56
  return this.counted(req, reply, () => this.auth.pending(params.userCode));
54
57
  }
58
+ async providers(principal, query, req, reply) {
59
+ const p = requireUser(principal);
60
+ return this.counted(req, reply, () => this.auth.providers(p, query));
61
+ }
55
62
  async confirm(principal, body, req, reply) {
56
63
  const p = requireUser(principal);
57
64
  return this.counted(req, reply, () => this.auth.confirm(p, body));
@@ -74,14 +81,14 @@ __decorate([
74
81
  HttpCode(200),
75
82
  Throttled("device-authorize-ip"),
76
83
  __param(0, ZBody(DeviceAuthorizeBodyDto))
77
- ], DeviceAuthController.prototype, "authorize", null);
84
+ ], DialInAuthController.prototype, "authorize", null);
78
85
  __decorate([
79
86
  Post("token"),
80
87
  Public(),
81
88
  HttpCode(200),
82
89
  Throttled("device-token-ip"),
83
90
  __param(0, ZBody(DeviceTokenBodyDto))
84
- ], DeviceAuthController.prototype, "token", null);
91
+ ], DialInAuthController.prototype, "token", null);
85
92
  __decorate([
86
93
  Get("pending/:userCode"),
87
94
  SessionOnly(),
@@ -89,7 +96,15 @@ __decorate([
89
96
  __param(1, ZParam(DeviceUserCodeParamsDto)),
90
97
  __param(2, Req()),
91
98
  __param(3, Res({ passthrough: true }))
92
- ], DeviceAuthController.prototype, "pending", null);
99
+ ], DialInAuthController.prototype, "pending", null);
100
+ __decorate([
101
+ Get("providers"),
102
+ SessionOnly(),
103
+ __param(0, CurrentPrincipal()),
104
+ __param(1, ZQuery(DeviceProvidersQueryDto)),
105
+ __param(2, Req()),
106
+ __param(3, Res({ passthrough: true }))
107
+ ], DialInAuthController.prototype, "providers", null);
93
108
  __decorate([
94
109
  Post("confirm"),
95
110
  SessionOnly(),
@@ -98,7 +113,7 @@ __decorate([
98
113
  __param(1, ZBody(DeviceConfirmBodyDto)),
99
114
  __param(2, Req()),
100
115
  __param(3, Res({ passthrough: true }))
101
- ], DeviceAuthController.prototype, "confirm", null);
116
+ ], DialInAuthController.prototype, "confirm", null);
102
117
  __decorate([
103
118
  Post("deny"),
104
119
  SessionOnly(),
@@ -107,10 +122,10 @@ __decorate([
107
122
  __param(1, ZBody(DeviceUserCodeBodyDto)),
108
123
  __param(2, Req()),
109
124
  __param(3, Res({ passthrough: true }))
110
- ], DeviceAuthController.prototype, "deny", null);
111
- DeviceAuthController = __decorate([
125
+ ], DialInAuthController.prototype, "deny", null);
126
+ DialInAuthController = __decorate([
112
127
  Controller("api/v1/device"),
113
- __param(0, Inject(DeviceAuthService)),
128
+ __param(0, Inject(DialInAuthService)),
114
129
  __param(1, Inject(CredentialThrottler))
115
- ], DeviceAuthController);
116
- export { DeviceAuthController };
130
+ ], DialInAuthController);
131
+ export { DialInAuthController };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Device sign-in (environments spec §13.3): {@link DialInAuthService} behind
3
+ * `DialInAuthController`. Kept apart from {@link DialInModule}, which `DevicesModule` imports
4
+ * (through the local devices: deleting a device revokes its machine), while sign-in needs both.
5
+ */
6
+ export declare class DialInAuthModule {
7
+ }
@@ -0,0 +1,27 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Module } from "@nestjs/common";
8
+ import { DevicesModule } from "../devices/devices.module.js";
9
+ import { ExtensionsModule } from "../extensions/extensions.module.js";
10
+ import { DialInAuthService } from "./auth.service.js";
11
+ import { DialInModule } from "./dial-in.module.js";
12
+ /**
13
+ * Device sign-in (environments spec §13.3): {@link DialInAuthService} behind
14
+ * `DialInAuthController`. Kept apart from {@link DialInModule}, which `DevicesModule` imports
15
+ * (through the local devices: deleting a device revokes its machine), while sign-in needs both.
16
+ */
17
+ let DialInAuthModule = class DialInAuthModule {
18
+ };
19
+ DialInAuthModule = __decorate([
20
+ Module({
21
+ // ExtensionsModule: the providers' display names on the sign-in page
22
+ imports: [DialInModule, DevicesModule, ExtensionsModule],
23
+ providers: [DialInAuthService],
24
+ exports: [DialInAuthService],
25
+ })
26
+ ], DialInAuthModule);
27
+ export { DialInAuthModule };