@intentic/sandbox-contract 1.245.0 → 1.246.1

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 (205) hide show
  1. package/README.md +17 -1
  2. package/dist/command-classes.d.ts +6 -3
  3. package/dist/command-classes.d.ts.map +1 -1
  4. package/dist/command-classes.js +43 -18
  5. package/dist/command-classes.js.map +1 -1
  6. package/dist/contracts/{cursor.contract.d.ts → accounts.contract.d.ts} +102 -3
  7. package/dist/contracts/accounts.contract.d.ts.map +1 -0
  8. package/dist/contracts/accounts.contract.js +61 -0
  9. package/dist/contracts/accounts.contract.js.map +1 -0
  10. package/dist/contracts/agents.contract.d.ts +121 -0
  11. package/dist/contracts/agents.contract.d.ts.map +1 -1
  12. package/dist/contracts/agents.contract.js +4 -4
  13. package/dist/contracts/agents.contract.js.map +1 -1
  14. package/dist/contracts/ci.contract.d.ts +2 -0
  15. package/dist/contracts/ci.contract.d.ts.map +1 -1
  16. package/dist/contracts/host.contract.d.ts +35 -0
  17. package/dist/contracts/host.contract.d.ts.map +1 -1
  18. package/dist/contracts/host.contract.js +3 -2
  19. package/dist/contracts/host.contract.js.map +1 -1
  20. package/dist/contracts/personas.contract.d.ts +4 -2
  21. package/dist/contracts/personas.contract.d.ts.map +1 -1
  22. package/dist/contracts/runner.contract.d.ts +2 -2
  23. package/dist/contracts/settings.contract.d.ts +2 -51
  24. package/dist/contracts/settings.contract.d.ts.map +1 -1
  25. package/dist/contracts/system.contract.d.ts +80 -30
  26. package/dist/contracts/system.contract.d.ts.map +1 -1
  27. package/dist/contracts/system.contract.js +26 -17
  28. package/dist/contracts/system.contract.js.map +1 -1
  29. package/dist/definition.d.ts +4 -8
  30. package/dist/definition.d.ts.map +1 -1
  31. package/dist/documents.d.ts +0 -1
  32. package/dist/documents.d.ts.map +1 -1
  33. package/dist/documents.js +1 -2
  34. package/dist/documents.js.map +1 -1
  35. package/dist/embed.d.ts +23 -0
  36. package/dist/embed.d.ts.map +1 -0
  37. package/dist/embed.js +84 -0
  38. package/dist/embed.js.map +1 -0
  39. package/dist/events.d.ts +21 -0
  40. package/dist/events.d.ts.map +1 -1
  41. package/dist/events.js +5 -2
  42. package/dist/events.js.map +1 -1
  43. package/dist/history-state.d.ts.map +1 -1
  44. package/dist/history-state.js +2 -0
  45. package/dist/history-state.js.map +1 -1
  46. package/dist/index.d.ts +354 -335
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +5 -13
  49. package/dist/index.js.map +1 -1
  50. package/dist/peer-dial.d.ts +33 -0
  51. package/dist/peer-dial.d.ts.map +1 -0
  52. package/dist/peer-dial.js +79 -0
  53. package/dist/peer-dial.js.map +1 -0
  54. package/dist/peer-mcp-server.d.ts +36 -0
  55. package/dist/peer-mcp-server.d.ts.map +1 -0
  56. package/dist/peer-mcp-server.js +71 -0
  57. package/dist/peer-mcp-server.js.map +1 -0
  58. package/dist/provider-specs.d.ts +38 -20
  59. package/dist/provider-specs.d.ts.map +1 -1
  60. package/dist/provider-specs.js +39 -13
  61. package/dist/provider-specs.js.map +1 -1
  62. package/dist/quick-model.d.ts.map +1 -1
  63. package/dist/quick-model.js +2 -1
  64. package/dist/quick-model.js.map +1 -1
  65. package/dist/runtime-state.d.ts +1 -1
  66. package/dist/runtime-state.js +1 -1
  67. package/dist/runtime-state.js.map +1 -1
  68. package/dist/safety-policy.d.ts +12 -3
  69. package/dist/safety-policy.d.ts.map +1 -1
  70. package/dist/safety-policy.js +30 -5
  71. package/dist/safety-policy.js.map +1 -1
  72. package/dist/schemas/agent.d.ts +6 -6
  73. package/dist/schemas/agent.d.ts.map +1 -1
  74. package/dist/schemas/agent.js +6 -2
  75. package/dist/schemas/agent.js.map +1 -1
  76. package/dist/schemas/agents.d.ts +42 -0
  77. package/dist/schemas/agents.d.ts.map +1 -1
  78. package/dist/schemas/agents.js +25 -4
  79. package/dist/schemas/agents.js.map +1 -1
  80. package/dist/schemas/automations.d.ts +11 -2
  81. package/dist/schemas/automations.d.ts.map +1 -1
  82. package/dist/schemas/automations.js +1 -1
  83. package/dist/schemas/automations.js.map +1 -1
  84. package/dist/schemas/ci.d.ts +6 -0
  85. package/dist/schemas/ci.d.ts.map +1 -1
  86. package/dist/schemas/ci.js +3 -2
  87. package/dist/schemas/ci.js.map +1 -1
  88. package/dist/schemas/context.d.ts +30 -0
  89. package/dist/schemas/context.d.ts.map +1 -0
  90. package/dist/schemas/context.js +34 -0
  91. package/dist/schemas/context.js.map +1 -0
  92. package/dist/schemas/{computers.d.ts → devices.d.ts} +154 -60
  93. package/dist/schemas/devices.d.ts.map +1 -0
  94. package/dist/schemas/devices.js +157 -0
  95. package/dist/schemas/devices.js.map +1 -0
  96. package/dist/schemas/hosts.d.ts +12 -0
  97. package/dist/schemas/hosts.d.ts.map +1 -1
  98. package/dist/schemas/hosts.js +1 -0
  99. package/dist/schemas/hosts.js.map +1 -1
  100. package/dist/schemas/issues.d.ts +0 -5
  101. package/dist/schemas/issues.d.ts.map +1 -1
  102. package/dist/schemas/issues.js +0 -1
  103. package/dist/schemas/issues.js.map +1 -1
  104. package/dist/schemas/personas.d.ts +5 -3
  105. package/dist/schemas/personas.d.ts.map +1 -1
  106. package/dist/schemas/personas.js +3 -2
  107. package/dist/schemas/personas.js.map +1 -1
  108. package/dist/schemas/provider-oauth.d.ts +48 -16
  109. package/dist/schemas/provider-oauth.d.ts.map +1 -1
  110. package/dist/schemas/provider-oauth.js +22 -20
  111. package/dist/schemas/provider-oauth.js.map +1 -1
  112. package/dist/schemas/settings.d.ts +1 -52
  113. package/dist/schemas/settings.d.ts.map +1 -1
  114. package/dist/schemas/settings.js +8 -11
  115. package/dist/schemas/settings.js.map +1 -1
  116. package/dist/schemas/terminal.js +9 -9
  117. package/dist/schemas/terminal.js.map +1 -1
  118. package/dist/schemas/usage.d.ts +0 -2
  119. package/dist/schemas/usage.d.ts.map +1 -1
  120. package/dist/schemas/usage.js +0 -2
  121. package/dist/schemas/usage.js.map +1 -1
  122. package/dist/shell-regions.d.ts +4 -0
  123. package/dist/shell-regions.d.ts.map +1 -0
  124. package/dist/shell-regions.js +156 -0
  125. package/dist/shell-regions.js.map +1 -0
  126. package/dist/workspace-state.d.ts +8 -0
  127. package/dist/workspace-state.d.ts.map +1 -1
  128. package/dist/workspace-state.js +13 -5
  129. package/dist/workspace-state.js.map +1 -1
  130. package/package.json +37 -4
  131. package/src/agent-catalog.ts +1 -1
  132. package/src/arrival.ts +3 -3
  133. package/src/command-classes.test.ts +195 -71
  134. package/src/command-classes.ts +148 -46
  135. package/src/contracts/accounts.contract.ts +94 -0
  136. package/src/contracts/agents.contract.ts +4 -3
  137. package/src/contracts/exit.contract.ts +2 -2
  138. package/src/contracts/host.contract.ts +17 -5
  139. package/src/contracts/settings.contract.ts +1 -1
  140. package/src/contracts/system.contract.ts +43 -24
  141. package/src/contracts/vpn.contract.ts +2 -2
  142. package/src/documents.test.ts +2 -1
  143. package/src/documents.ts +7 -11
  144. package/src/embed.test.ts +68 -0
  145. package/src/embed.ts +164 -0
  146. package/src/events.ts +30 -3
  147. package/src/history-state.ts +12 -3
  148. package/src/host-protocol.ts +2 -2
  149. package/src/index.ts +6 -14
  150. package/src/model-order.ts +1 -1
  151. package/src/peer-dial.test.ts +203 -0
  152. package/src/peer-dial.ts +163 -0
  153. package/src/peer-mcp-server.test.ts +104 -0
  154. package/src/peer-mcp-server.ts +144 -0
  155. package/src/provider-specs.test.ts +44 -17
  156. package/src/provider-specs.ts +147 -67
  157. package/src/quick-model.ts +10 -3
  158. package/src/routes.test.ts +6 -3
  159. package/src/runner-protocol.ts +1 -1
  160. package/src/runtime-state.ts +2 -2
  161. package/src/safety-policy.test.ts +88 -0
  162. package/src/safety-policy.ts +84 -14
  163. package/src/schemas/agent.ts +41 -13
  164. package/src/schemas/agents.ts +65 -4
  165. package/src/schemas/automations.ts +6 -4
  166. package/src/schemas/capabilities.ts +4 -4
  167. package/src/schemas/ci.ts +23 -6
  168. package/src/schemas/context.ts +87 -0
  169. package/src/schemas/{computers.ts → devices.ts} +190 -107
  170. package/src/schemas/hosts.ts +5 -1
  171. package/src/schemas/issues.ts +0 -4
  172. package/src/schemas/personas.ts +8 -3
  173. package/src/schemas/provider-oauth.ts +49 -52
  174. package/src/schemas/settings.ts +30 -54
  175. package/src/schemas/terminal.ts +12 -12
  176. package/src/schemas/usage.ts +3 -27
  177. package/src/schemas/version-seam.test.ts +0 -1
  178. package/src/shell-regions.ts +289 -0
  179. package/src/versions.ts +2 -2
  180. package/src/webext-links.ts +2 -2
  181. package/src/webext-protocol.ts +2 -2
  182. package/src/workspace-state.test.ts +48 -1
  183. package/src/workspace-state.ts +48 -11
  184. package/dist/contracts/claude.contract.d.ts +0 -91
  185. package/dist/contracts/claude.contract.d.ts.map +0 -1
  186. package/dist/contracts/claude.contract.js +0 -50
  187. package/dist/contracts/claude.contract.js.map +0 -1
  188. package/dist/contracts/cursor.contract.d.ts.map +0 -1
  189. package/dist/contracts/cursor.contract.js +0 -50
  190. package/dist/contracts/cursor.contract.js.map +0 -1
  191. package/dist/contracts/grok.contract.d.ts +0 -36
  192. package/dist/contracts/grok.contract.d.ts.map +0 -1
  193. package/dist/contracts/grok.contract.js +0 -31
  194. package/dist/contracts/grok.contract.js.map +0 -1
  195. package/dist/contracts/keys.contract.d.ts +0 -81
  196. package/dist/contracts/keys.contract.d.ts.map +0 -1
  197. package/dist/contracts/keys.contract.js +0 -51
  198. package/dist/contracts/keys.contract.js.map +0 -1
  199. package/dist/schemas/computers.d.ts.map +0 -1
  200. package/dist/schemas/computers.js +0 -135
  201. package/dist/schemas/computers.js.map +0 -1
  202. package/src/contracts/claude.contract.ts +0 -71
  203. package/src/contracts/cursor.contract.ts +0 -74
  204. package/src/contracts/grok.contract.ts +0 -41
  205. package/src/contracts/keys.contract.ts +0 -79
@@ -1,18 +1,49 @@
1
1
  import { z } from "zod";
2
- export declare const MachineSandboxSchema: z.ZodObject<{
2
+ export declare const SandboxResourcesSchema: z.ZodObject<{
3
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
4
+ cpus: z.ZodOptional<z.ZodNumber>;
5
+ privileged: z.ZodBoolean;
6
+ gpu: z.ZodBoolean;
7
+ hostRuntime: z.ZodArray<z.ZodString>;
8
+ overlayRuntime: z.ZodArray<z.ZodString>;
9
+ }, z.core.$strip>;
10
+ export type SandboxResources = z.infer<typeof SandboxResourcesSchema>;
11
+ export declare const SandboxResourcesAskFieldsSchema: z.ZodObject<{
12
+ memoryGib: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
13
+ cpus: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
14
+ privileged: z.ZodOptional<z.ZodBoolean>;
15
+ gpu: z.ZodOptional<z.ZodBoolean>;
16
+ }, z.core.$strip>;
17
+ export declare const SandboxResourcesAskSchema: z.ZodObject<{
18
+ memoryGib: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
19
+ cpus: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
20
+ privileged: z.ZodOptional<z.ZodBoolean>;
21
+ gpu: z.ZodOptional<z.ZodBoolean>;
22
+ }, z.core.$strip>;
23
+ export type SandboxResourcesAsk = z.infer<typeof SandboxResourcesAskSchema>;
24
+ export declare const DeviceSandboxSchema: z.ZodObject<{
3
25
  slug: z.ZodString;
4
26
  container: z.ZodString;
5
27
  name: z.ZodOptional<z.ZodString>;
6
28
  running: z.ZodBoolean;
7
29
  image: z.ZodString;
8
30
  tunnelRunning: z.ZodOptional<z.ZodBoolean>;
31
+ resources: z.ZodOptional<z.ZodObject<{
32
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
33
+ cpus: z.ZodOptional<z.ZodNumber>;
34
+ privileged: z.ZodBoolean;
35
+ gpu: z.ZodBoolean;
36
+ hostRuntime: z.ZodArray<z.ZodString>;
37
+ overlayRuntime: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>>;
9
39
  }, z.core.$strip>;
10
- export type MachineSandbox = z.infer<typeof MachineSandboxSchema>;
11
- export declare const MachineSandboxOpSchema: z.ZodEnum<{
40
+ export type DeviceSandbox = z.infer<typeof DeviceSandboxSchema>;
41
+ export declare const DeviceSandboxOpSchema: z.ZodEnum<{
12
42
  logs: "logs";
13
43
  prepare: "prepare";
14
44
  rebuild: "rebuild";
15
45
  remove: "remove";
46
+ reshape: "reshape";
16
47
  restart: "restart";
17
48
  rollback: "rollback";
18
49
  "runner-remove": "runner-remove";
@@ -21,13 +52,14 @@ export declare const MachineSandboxOpSchema: z.ZodEnum<{
21
52
  stop: "stop";
22
53
  update: "update";
23
54
  }>;
24
- export type MachineSandboxOp = z.infer<typeof MachineSandboxOpSchema>;
25
- export declare const MachineSandboxFlowSchema: z.ZodObject<{
55
+ export type DeviceSandboxOp = z.infer<typeof DeviceSandboxOpSchema>;
56
+ export declare const DeviceSandboxFlowSchema: z.ZodObject<{
26
57
  op: z.ZodEnum<{
27
58
  logs: "logs";
28
59
  prepare: "prepare";
29
60
  rebuild: "rebuild";
30
61
  remove: "remove";
62
+ reshape: "reshape";
31
63
  restart: "restart";
32
64
  rollback: "rollback";
33
65
  "runner-remove": "runner-remove";
@@ -38,19 +70,26 @@ export declare const MachineSandboxFlowSchema: z.ZodObject<{
38
70
  }>;
39
71
  slug: z.ZodString;
40
72
  hash: z.ZodOptional<z.ZodString>;
73
+ resources: z.ZodOptional<z.ZodObject<{
74
+ memoryGib: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
75
+ cpus: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
76
+ privileged: z.ZodOptional<z.ZodBoolean>;
77
+ gpu: z.ZodOptional<z.ZodBoolean>;
78
+ }, z.core.$strip>>;
41
79
  parentUrl: z.ZodOptional<z.ZodString>;
42
80
  pair: z.ZodOptional<z.ZodString>;
43
81
  definition: z.ZodOptional<z.ZodString>;
44
82
  overlay: z.ZodOptional<z.ZodString>;
45
83
  overlayHash: z.ZodOptional<z.ZodString>;
46
84
  }, z.core.$strip>;
47
- export type MachineSandboxFlow = z.infer<typeof MachineSandboxFlowSchema>;
48
- export declare const MachineSandboxFlowInputSchema: z.ZodObject<{
85
+ export type DeviceSandboxFlow = z.infer<typeof DeviceSandboxFlowSchema>;
86
+ export declare const DeviceSandboxFlowInputSchema: z.ZodObject<{
49
87
  op: z.ZodEnum<{
50
88
  logs: "logs";
51
89
  prepare: "prepare";
52
90
  rebuild: "rebuild";
53
91
  remove: "remove";
92
+ reshape: "reshape";
54
93
  restart: "restart";
55
94
  rollback: "rollback";
56
95
  "runner-remove": "runner-remove";
@@ -61,6 +100,12 @@ export declare const MachineSandboxFlowInputSchema: z.ZodObject<{
61
100
  }>;
62
101
  slug: z.ZodString;
63
102
  hash: z.ZodOptional<z.ZodString>;
103
+ resources: z.ZodOptional<z.ZodObject<{
104
+ memoryGib: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
105
+ cpus: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
106
+ privileged: z.ZodOptional<z.ZodBoolean>;
107
+ gpu: z.ZodOptional<z.ZodBoolean>;
108
+ }, z.core.$strip>>;
64
109
  parentUrl: z.ZodOptional<z.ZodString>;
65
110
  pair: z.ZodOptional<z.ZodString>;
66
111
  definition: z.ZodOptional<z.ZodString>;
@@ -68,8 +113,8 @@ export declare const MachineSandboxFlowInputSchema: z.ZodObject<{
68
113
  overlayHash: z.ZodOptional<z.ZodString>;
69
114
  id: z.ZodString;
70
115
  }, z.core.$strip>;
71
- export type MachineSandboxFlowInput = z.infer<typeof MachineSandboxFlowInputSchema>;
72
- export declare const MachineFlowLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
+ export type DeviceSandboxFlowInput = z.infer<typeof DeviceSandboxFlowInputSchema>;
117
+ export declare const DeviceFlowLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
73
118
  kind: z.ZodLiteral<"line">;
74
119
  text: z.ZodString;
75
120
  }, z.core.$strip>, z.ZodObject<{
@@ -79,17 +124,37 @@ export declare const MachineFlowLineSchema: z.ZodDiscriminatedUnion<[z.ZodObject
79
124
  kind: z.ZodLiteral<"error">;
80
125
  message: z.ZodString;
81
126
  }, z.core.$strip>], "kind">;
82
- export type MachineFlowLine = z.infer<typeof MachineFlowLineSchema>;
83
- export declare const MachineCommandSchema: z.ZodEnum<{
127
+ export type DeviceFlowLine = z.infer<typeof DeviceFlowLineSchema>;
128
+ export declare const DeviceAgentOpSchema: z.ZodEnum<{
129
+ restart: "restart";
130
+ upgrade: "upgrade";
131
+ }>;
132
+ export type DeviceAgentOp = z.infer<typeof DeviceAgentOpSchema>;
133
+ export declare const DeviceAgentFlowSchema: z.ZodObject<{
134
+ op: z.ZodEnum<{
135
+ restart: "restart";
136
+ upgrade: "upgrade";
137
+ }>;
138
+ }, z.core.$strip>;
139
+ export type DeviceAgentFlow = z.infer<typeof DeviceAgentFlowSchema>;
140
+ export declare const DeviceAgentFlowInputSchema: z.ZodObject<{
141
+ op: z.ZodEnum<{
142
+ restart: "restart";
143
+ upgrade: "upgrade";
144
+ }>;
145
+ id: z.ZodString;
146
+ }, z.core.$strip>;
147
+ export type DeviceAgentFlowInput = z.infer<typeof DeviceAgentFlowInputSchema>;
148
+ export declare const DeviceCommandSchema: z.ZodEnum<{
84
149
  "mirror-off": "mirror-off";
85
150
  "mirror-on": "mirror-on";
86
151
  "sync-pause": "sync-pause";
87
152
  "sync-resume": "sync-resume";
88
153
  "sync-unpair": "sync-unpair";
89
154
  }>;
90
- export type MachineCommand = z.infer<typeof MachineCommandSchema>;
91
- export declare const MachineSandboxIdSchema: z.ZodString;
92
- export declare const MachineCommandInputSchema: z.ZodObject<{
155
+ export type DeviceCommand = z.infer<typeof DeviceCommandSchema>;
156
+ export declare const DeviceSandboxIdSchema: z.ZodString;
157
+ export declare const DeviceCommandInputSchema: z.ZodObject<{
93
158
  id: z.ZodString;
94
159
  command: z.ZodEnum<{
95
160
  "mirror-off": "mirror-off";
@@ -100,14 +165,14 @@ export declare const MachineCommandInputSchema: z.ZodObject<{
100
165
  }>;
101
166
  sandboxId: z.ZodOptional<z.ZodString>;
102
167
  }, z.core.$strip>;
103
- export type MachineCommandInput = z.infer<typeof MachineCommandInputSchema>;
104
- export declare const MachineCommandResultSchema: z.ZodObject<{
168
+ export type DeviceCommandInput = z.infer<typeof DeviceCommandInputSchema>;
169
+ export declare const DeviceCommandResultSchema: z.ZodObject<{
105
170
  ok: z.ZodBoolean;
106
171
  message: z.ZodString;
107
172
  output: z.ZodOptional<z.ZodString>;
108
173
  }, z.core.$strip>;
109
- export type MachineCommandResult = z.infer<typeof MachineCommandResultSchema>;
110
- export declare const MachinePairingSchema: z.ZodObject<{
174
+ export type DeviceCommandResult = z.infer<typeof DeviceCommandResultSchema>;
175
+ export declare const DevicePairingSchema: z.ZodObject<{
111
176
  sandboxId: z.ZodString;
112
177
  mode: z.ZodEnum<{
113
178
  mirror: "mirror";
@@ -123,13 +188,13 @@ export declare const MachinePairingSchema: z.ZodObject<{
123
188
  paused: z.ZodOptional<z.ZodBoolean>;
124
189
  backupStatus: z.ZodOptional<z.ZodString>;
125
190
  }, z.core.$strip>;
126
- export type MachinePairing = z.infer<typeof MachinePairingSchema>;
127
- export declare const MachinePortStateSchema: z.ZodEnum<{
191
+ export type DevicePairing = z.infer<typeof DevicePairingSchema>;
192
+ export declare const DevicePortStateSchema: z.ZodEnum<{
128
193
  busy: "busy";
129
194
  "held-by-sandbox": "held-by-sandbox";
130
195
  mirrored: "mirrored";
131
196
  }>;
132
- export declare const MachinePortSchema: z.ZodObject<{
197
+ export declare const DevicePortSchema: z.ZodObject<{
133
198
  port: z.ZodNumber;
134
199
  host: z.ZodEnum<{
135
200
  "127.0.0.1": "127.0.0.1";
@@ -144,23 +209,20 @@ export declare const MachinePortSchema: z.ZodObject<{
144
209
  heldBy: z.ZodOptional<z.ZodString>;
145
210
  command: z.ZodOptional<z.ZodString>;
146
211
  }, z.core.$strip>;
147
- export type MachinePort = z.infer<typeof MachinePortSchema>;
148
- export declare const MachineWatcherSchema: z.ZodObject<{
212
+ export type DevicePort = z.infer<typeof DevicePortSchema>;
213
+ export declare const DeviceAgentSchema: z.ZodObject<{
149
214
  running: z.ZodBoolean;
150
215
  pid: z.ZodOptional<z.ZodNumber>;
216
+ installed: z.ZodOptional<z.ZodString>;
151
217
  build: z.ZodOptional<z.ZodString>;
152
218
  lastTickAt: z.ZodOptional<z.ZodNumber>;
153
219
  }, z.core.$strip>;
154
- export type MachineWatcher = z.infer<typeof MachineWatcherSchema>;
155
- export declare const WATCHER_STALL_AFTER_MS = 60000;
156
- export declare const watcherStalled: (watcher: MachineWatcher, now: number) => boolean;
157
- export declare const MachineReportSchema: z.ZodObject<{
220
+ export type DeviceAgent = z.infer<typeof DeviceAgentSchema>;
221
+ export declare const AGENT_STALL_AFTER_MS = 60000;
222
+ export declare const agentStalled: (agent: DeviceAgent, now: number) => boolean;
223
+ export declare const DeviceReportSchema: z.ZodObject<{
158
224
  hostname: z.ZodString;
159
225
  os: z.ZodString;
160
- agents: z.ZodObject<{
161
- sync: z.ZodOptional<z.ZodString>;
162
- host: z.ZodOptional<z.ZodString>;
163
- }, z.core.$strip>;
164
226
  sandboxes: z.ZodArray<z.ZodObject<{
165
227
  slug: z.ZodString;
166
228
  container: z.ZodString;
@@ -168,6 +230,14 @@ export declare const MachineReportSchema: z.ZodObject<{
168
230
  running: z.ZodBoolean;
169
231
  image: z.ZodString;
170
232
  tunnelRunning: z.ZodOptional<z.ZodBoolean>;
233
+ resources: z.ZodOptional<z.ZodObject<{
234
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
235
+ cpus: z.ZodOptional<z.ZodNumber>;
236
+ privileged: z.ZodBoolean;
237
+ gpu: z.ZodBoolean;
238
+ hostRuntime: z.ZodArray<z.ZodString>;
239
+ overlayRuntime: z.ZodArray<z.ZodString>;
240
+ }, z.core.$strip>>;
171
241
  }, z.core.$strip>>;
172
242
  pairings: z.ZodArray<z.ZodObject<{
173
243
  sandboxId: z.ZodString;
@@ -200,27 +270,28 @@ export declare const MachineReportSchema: z.ZodObject<{
200
270
  heldBy: z.ZodOptional<z.ZodString>;
201
271
  command: z.ZodOptional<z.ZodString>;
202
272
  }, z.core.$strip>>;
203
- watcher: z.ZodObject<{
273
+ agent: z.ZodObject<{
204
274
  running: z.ZodBoolean;
205
275
  pid: z.ZodOptional<z.ZodNumber>;
276
+ installed: z.ZodOptional<z.ZodString>;
206
277
  build: z.ZodOptional<z.ZodString>;
207
278
  lastTickAt: z.ZodOptional<z.ZodNumber>;
208
279
  }, z.core.$strip>;
209
280
  capturedAt: z.ZodNumber;
210
281
  }, z.core.$strip>;
211
- export type MachineReport = z.infer<typeof MachineReportSchema>;
212
- export declare const watcherBuildSkew: (report: MachineReport) => {
282
+ export type DeviceReport = z.infer<typeof DeviceReportSchema>;
283
+ export declare const agentBuildSkew: (agent: DeviceAgent) => {
213
284
  readonly running: string | undefined;
214
285
  readonly installed: string;
215
286
  } | undefined;
216
- export declare const ComputerGapSchema: z.ZodEnum<{
287
+ export declare const DeviceGapSchema: z.ZodEnum<{
217
288
  "no-agent": "no-agent";
218
289
  offline: "offline";
219
290
  "scope-off": "scope-off";
220
291
  unreported: "unreported";
221
292
  }>;
222
- export type ComputerGap = z.infer<typeof ComputerGapSchema>;
223
- export declare const ComputerSyncSchema: z.ZodObject<{
293
+ export type DeviceGap = z.infer<typeof DeviceGapSchema>;
294
+ export declare const DeviceSyncSchema: z.ZodObject<{
224
295
  machine: z.ZodString;
225
296
  mode: z.ZodEnum<{
226
297
  mirror: "mirror";
@@ -228,8 +299,8 @@ export declare const ComputerSyncSchema: z.ZodObject<{
228
299
  }>;
229
300
  seenAt: z.ZodOptional<z.ZodNumber>;
230
301
  }, z.core.$strip>;
231
- export type ComputerSync = z.infer<typeof ComputerSyncSchema>;
232
- export declare const ComputerSchema: z.ZodObject<{
302
+ export type DeviceSync = z.infer<typeof DeviceSyncSchema>;
303
+ export declare const DeviceSchema: z.ZodObject<{
233
304
  key: z.ZodString;
234
305
  label: z.ZodString;
235
306
  sync: z.ZodOptional<z.ZodObject<{
@@ -249,16 +320,16 @@ export declare const ComputerSchema: z.ZodObject<{
249
320
  shell: z.ZodString;
250
321
  home: z.ZodString;
251
322
  roots: z.ZodArray<z.ZodString>;
323
+ engine: z.ZodOptional<z.ZodObject<{
324
+ memoryBytes: z.ZodNumber;
325
+ cpus: z.ZodNumber;
326
+ }, z.core.$strip>>;
252
327
  }, z.core.$strip>>;
253
- hostAgent: z.ZodOptional<z.ZodString>;
328
+ agentVersion: z.ZodOptional<z.ZodString>;
254
329
  lastSeen: z.ZodOptional<z.ZodNumber>;
255
330
  report: z.ZodOptional<z.ZodObject<{
256
331
  hostname: z.ZodString;
257
332
  os: z.ZodString;
258
- agents: z.ZodObject<{
259
- sync: z.ZodOptional<z.ZodString>;
260
- host: z.ZodOptional<z.ZodString>;
261
- }, z.core.$strip>;
262
333
  sandboxes: z.ZodArray<z.ZodObject<{
263
334
  slug: z.ZodString;
264
335
  container: z.ZodString;
@@ -266,6 +337,14 @@ export declare const ComputerSchema: z.ZodObject<{
266
337
  running: z.ZodBoolean;
267
338
  image: z.ZodString;
268
339
  tunnelRunning: z.ZodOptional<z.ZodBoolean>;
340
+ resources: z.ZodOptional<z.ZodObject<{
341
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
342
+ cpus: z.ZodOptional<z.ZodNumber>;
343
+ privileged: z.ZodBoolean;
344
+ gpu: z.ZodBoolean;
345
+ hostRuntime: z.ZodArray<z.ZodString>;
346
+ overlayRuntime: z.ZodArray<z.ZodString>;
347
+ }, z.core.$strip>>;
269
348
  }, z.core.$strip>>;
270
349
  pairings: z.ZodArray<z.ZodObject<{
271
350
  sandboxId: z.ZodString;
@@ -298,9 +377,10 @@ export declare const ComputerSchema: z.ZodObject<{
298
377
  heldBy: z.ZodOptional<z.ZodString>;
299
378
  command: z.ZodOptional<z.ZodString>;
300
379
  }, z.core.$strip>>;
301
- watcher: z.ZodObject<{
380
+ agent: z.ZodObject<{
302
381
  running: z.ZodBoolean;
303
382
  pid: z.ZodOptional<z.ZodNumber>;
383
+ installed: z.ZodOptional<z.ZodString>;
304
384
  build: z.ZodOptional<z.ZodString>;
305
385
  lastTickAt: z.ZodOptional<z.ZodNumber>;
306
386
  }, z.core.$strip>;
@@ -313,9 +393,9 @@ export declare const ComputerSchema: z.ZodObject<{
313
393
  unreported: "unreported";
314
394
  }>>;
315
395
  }, z.core.$strip>;
316
- export type Computer = z.infer<typeof ComputerSchema>;
317
- export declare const ComputersListSchema: z.ZodObject<{
318
- computers: z.ZodArray<z.ZodObject<{
396
+ export type Device = z.infer<typeof DeviceSchema>;
397
+ export declare const DevicesListSchema: z.ZodObject<{
398
+ devices: z.ZodArray<z.ZodObject<{
319
399
  key: z.ZodString;
320
400
  label: z.ZodString;
321
401
  sync: z.ZodOptional<z.ZodObject<{
@@ -335,16 +415,16 @@ export declare const ComputersListSchema: z.ZodObject<{
335
415
  shell: z.ZodString;
336
416
  home: z.ZodString;
337
417
  roots: z.ZodArray<z.ZodString>;
418
+ engine: z.ZodOptional<z.ZodObject<{
419
+ memoryBytes: z.ZodNumber;
420
+ cpus: z.ZodNumber;
421
+ }, z.core.$strip>>;
338
422
  }, z.core.$strip>>;
339
- hostAgent: z.ZodOptional<z.ZodString>;
423
+ agentVersion: z.ZodOptional<z.ZodString>;
340
424
  lastSeen: z.ZodOptional<z.ZodNumber>;
341
425
  report: z.ZodOptional<z.ZodObject<{
342
426
  hostname: z.ZodString;
343
427
  os: z.ZodString;
344
- agents: z.ZodObject<{
345
- sync: z.ZodOptional<z.ZodString>;
346
- host: z.ZodOptional<z.ZodString>;
347
- }, z.core.$strip>;
348
428
  sandboxes: z.ZodArray<z.ZodObject<{
349
429
  slug: z.ZodString;
350
430
  container: z.ZodString;
@@ -352,6 +432,14 @@ export declare const ComputersListSchema: z.ZodObject<{
352
432
  running: z.ZodBoolean;
353
433
  image: z.ZodString;
354
434
  tunnelRunning: z.ZodOptional<z.ZodBoolean>;
435
+ resources: z.ZodOptional<z.ZodObject<{
436
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
437
+ cpus: z.ZodOptional<z.ZodNumber>;
438
+ privileged: z.ZodBoolean;
439
+ gpu: z.ZodBoolean;
440
+ hostRuntime: z.ZodArray<z.ZodString>;
441
+ overlayRuntime: z.ZodArray<z.ZodString>;
442
+ }, z.core.$strip>>;
355
443
  }, z.core.$strip>>;
356
444
  pairings: z.ZodArray<z.ZodObject<{
357
445
  sandboxId: z.ZodString;
@@ -384,9 +472,10 @@ export declare const ComputersListSchema: z.ZodObject<{
384
472
  heldBy: z.ZodOptional<z.ZodString>;
385
473
  command: z.ZodOptional<z.ZodString>;
386
474
  }, z.core.$strip>>;
387
- watcher: z.ZodObject<{
475
+ agent: z.ZodObject<{
388
476
  running: z.ZodBoolean;
389
477
  pid: z.ZodOptional<z.ZodNumber>;
478
+ installed: z.ZodOptional<z.ZodString>;
390
479
  build: z.ZodOptional<z.ZodString>;
391
480
  lastTickAt: z.ZodOptional<z.ZodNumber>;
392
481
  }, z.core.$strip>;
@@ -406,10 +495,6 @@ export declare const SyncStatusSchema: z.ZodObject<{
406
495
  machines: z.ZodOptional<z.ZodArray<z.ZodObject<{
407
496
  hostname: z.ZodString;
408
497
  os: z.ZodString;
409
- agents: z.ZodObject<{
410
- sync: z.ZodOptional<z.ZodString>;
411
- host: z.ZodOptional<z.ZodString>;
412
- }, z.core.$strip>;
413
498
  sandboxes: z.ZodArray<z.ZodObject<{
414
499
  slug: z.ZodString;
415
500
  container: z.ZodString;
@@ -417,6 +502,14 @@ export declare const SyncStatusSchema: z.ZodObject<{
417
502
  running: z.ZodBoolean;
418
503
  image: z.ZodString;
419
504
  tunnelRunning: z.ZodOptional<z.ZodBoolean>;
505
+ resources: z.ZodOptional<z.ZodObject<{
506
+ memoryBytes: z.ZodOptional<z.ZodNumber>;
507
+ cpus: z.ZodOptional<z.ZodNumber>;
508
+ privileged: z.ZodBoolean;
509
+ gpu: z.ZodBoolean;
510
+ hostRuntime: z.ZodArray<z.ZodString>;
511
+ overlayRuntime: z.ZodArray<z.ZodString>;
512
+ }, z.core.$strip>>;
420
513
  }, z.core.$strip>>;
421
514
  pairings: z.ZodArray<z.ZodObject<{
422
515
  sandboxId: z.ZodString;
@@ -449,9 +542,10 @@ export declare const SyncStatusSchema: z.ZodObject<{
449
542
  heldBy: z.ZodOptional<z.ZodString>;
450
543
  command: z.ZodOptional<z.ZodString>;
451
544
  }, z.core.$strip>>;
452
- watcher: z.ZodObject<{
545
+ agent: z.ZodObject<{
453
546
  running: z.ZodBoolean;
454
547
  pid: z.ZodOptional<z.ZodNumber>;
548
+ installed: z.ZodOptional<z.ZodString>;
455
549
  build: z.ZodOptional<z.ZodString>;
456
550
  lastTickAt: z.ZodOptional<z.ZodNumber>;
457
551
  }, z.core.$strip>;
@@ -459,4 +553,4 @@ export declare const SyncStatusSchema: z.ZodObject<{
459
553
  }, z.core.$strip>>>;
460
554
  }, z.core.$strip>;
461
555
  export type SyncStatus = z.infer<typeof SyncStatusSchema>;
462
- //# sourceMappingURL=computers.d.ts.map
556
+ //# sourceMappingURL=devices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/schemas/devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,eAAO,MAAM,sBAAsB;;;;;;;iBASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAOtE,eAAO,MAAM,+BAA+B;;;;;iBAK1C,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;iBAEpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG5E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAa9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AA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S3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCvB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA+C,CAAC;AAW9E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,157 @@
1
+ import { z } from "zod";
2
+ import { HostFactsSchema } from "./hosts.js";
3
+ import { DEV_VERSION } from "../versions.js";
4
+ export const SandboxResourcesSchema = z.object({
5
+ memoryBytes: z.number().optional(),
6
+ cpus: z.number().optional(),
7
+ privileged: z.boolean(),
8
+ gpu: z.boolean(),
9
+ hostRuntime: z.array(z.string()),
10
+ overlayRuntime: z.array(z.string()),
11
+ });
12
+ export const SandboxResourcesAskFieldsSchema = z.object({
13
+ memoryGib: z.int().positive().nullable().optional(),
14
+ cpus: z.int().positive().nullable().optional(),
15
+ privileged: z.boolean().optional(),
16
+ gpu: z.boolean().optional(),
17
+ });
18
+ export const SandboxResourcesAskSchema = SandboxResourcesAskFieldsSchema.refine((ask) => Object.values(ask).some((value) => value !== undefined), {
19
+ message: "a reshape must change at least one thing",
20
+ });
21
+ export const DeviceSandboxSchema = z.object({
22
+ slug: z.string(),
23
+ container: z.string(),
24
+ name: z.string().optional(),
25
+ running: z.boolean(),
26
+ image: z.string(),
27
+ tunnelRunning: z.boolean().optional(),
28
+ resources: SandboxResourcesSchema.optional(),
29
+ });
30
+ export const DeviceSandboxOpSchema = z.enum([
31
+ "start",
32
+ "stop",
33
+ "restart",
34
+ "prepare",
35
+ "update",
36
+ "rebuild",
37
+ "rollback",
38
+ "reshape",
39
+ "remove",
40
+ "logs",
41
+ "runner-up",
42
+ "runner-remove",
43
+ ]);
44
+ export const DeviceSandboxFlowSchema = z.object({
45
+ op: DeviceSandboxOpSchema,
46
+ slug: z.string().min(1),
47
+ hash: z.string().optional(),
48
+ resources: SandboxResourcesAskSchema.optional(),
49
+ parentUrl: z.string().optional(),
50
+ pair: z.string().optional().meta({ secret: true }),
51
+ definition: z.string().optional(),
52
+ overlay: z.string().optional(),
53
+ overlayHash: z.string().optional(),
54
+ });
55
+ export const DeviceSandboxFlowInputSchema = DeviceSandboxFlowSchema.extend({ id: z.string().min(1) });
56
+ export const DeviceFlowLineSchema = z.discriminatedUnion("kind", [
57
+ z.object({ kind: z.literal("line"), text: z.string() }),
58
+ z.object({ kind: z.literal("result"), message: z.string() }),
59
+ z.object({ kind: z.literal("error"), message: z.string() }),
60
+ ]);
61
+ export const DeviceAgentOpSchema = z.enum(["upgrade", "restart"]);
62
+ export const DeviceAgentFlowSchema = z.object({ op: DeviceAgentOpSchema });
63
+ export const DeviceAgentFlowInputSchema = DeviceAgentFlowSchema.extend({ id: z.string().min(1) });
64
+ export const DeviceCommandSchema = z.enum(["mirror-off", "mirror-on", "sync-pause", "sync-resume", "sync-unpair"]);
65
+ export const DeviceSandboxIdSchema = z
66
+ .string()
67
+ .max(200)
68
+ .regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/);
69
+ export const DeviceCommandInputSchema = z.object({
70
+ id: z.string().min(1),
71
+ command: DeviceCommandSchema,
72
+ sandboxId: DeviceSandboxIdSchema.optional(),
73
+ });
74
+ export const DeviceCommandResultSchema = z.object({
75
+ ok: z.boolean(),
76
+ message: z.string(),
77
+ output: z.string().optional(),
78
+ });
79
+ export const DevicePairingSchema = z.object({
80
+ sandboxId: z.string(),
81
+ mode: z.enum(["sync", "mirror"]),
82
+ localDir: z.string().optional(),
83
+ mirroring: z.enum(["on", "off"]).optional(),
84
+ mutagenStatus: z.string().optional(),
85
+ conflicts: z.number().int().nonnegative().optional(),
86
+ paused: z.boolean().optional(),
87
+ backupStatus: z.string().optional(),
88
+ });
89
+ export const DevicePortStateSchema = z.enum([
90
+ "mirrored",
91
+ "held-by-sandbox",
92
+ "busy",
93
+ ]);
94
+ export const DevicePortSchema = z.object({
95
+ port: z.number().int().min(1).max(65535),
96
+ host: z.enum(["127.0.0.1", "::1"]),
97
+ sandboxId: z.string(),
98
+ state: DevicePortStateSchema,
99
+ heldBy: z.string().optional(),
100
+ command: z.string().optional(),
101
+ });
102
+ export const DeviceAgentSchema = z.object({
103
+ running: z.boolean(),
104
+ pid: z.number().int().optional(),
105
+ installed: z.string().optional(),
106
+ build: z.string().optional(),
107
+ lastTickAt: z.number().optional(),
108
+ });
109
+ export const AGENT_STALL_AFTER_MS = 60_000;
110
+ export const agentStalled = (agent, now) => agent.running && agent.lastTickAt !== undefined && now - agent.lastTickAt > AGENT_STALL_AFTER_MS;
111
+ export const DeviceReportSchema = z.object({
112
+ hostname: z.string(),
113
+ os: z.string(),
114
+ sandboxes: z.array(DeviceSandboxSchema),
115
+ pairings: z.array(DevicePairingSchema),
116
+ ports: z.array(DevicePortSchema),
117
+ agent: DeviceAgentSchema,
118
+ capturedAt: z.number(),
119
+ });
120
+ export const agentBuildSkew = (agent) => {
121
+ const { build: running, installed } = agent;
122
+ if (!agent.running || installed === undefined || installed === DEV_VERSION || running === installed) {
123
+ return undefined;
124
+ }
125
+ return { running, installed };
126
+ };
127
+ export const DeviceGapSchema = z.enum([
128
+ "offline",
129
+ "scope-off",
130
+ "no-agent",
131
+ "unreported",
132
+ ]);
133
+ export const DeviceSyncSchema = z.object({
134
+ machine: z.string(),
135
+ mode: z.enum(["sync", "mirror"]),
136
+ seenAt: z.number().optional(),
137
+ });
138
+ export const DeviceSchema = z.object({
139
+ key: z.string(),
140
+ label: z.string(),
141
+ sync: DeviceSyncSchema.optional(),
142
+ hostId: z.string().optional(),
143
+ online: z.boolean().optional(),
144
+ platform: z.string().optional(),
145
+ facts: HostFactsSchema.optional(),
146
+ agentVersion: z.string().optional(),
147
+ lastSeen: z.number().optional(),
148
+ report: DeviceReportSchema.optional(),
149
+ gap: DeviceGapSchema.optional(),
150
+ });
151
+ export const DevicesListSchema = z.object({ devices: z.array(DeviceSchema) });
152
+ export const SyncStatusSchema = z.object({
153
+ enrolled: z.boolean(),
154
+ available: z.boolean().optional(),
155
+ machines: z.array(DeviceReportSchema).optional(),
156
+ });
157
+ //# sourceMappingURL=devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/schemas/devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiC7C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAE3C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAElC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACtC,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,+BAA+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AM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAW9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IAMrB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC"}
@@ -5,6 +5,10 @@ export declare const HostFactsSchema: z.ZodObject<{
5
5
  shell: z.ZodString;
6
6
  home: z.ZodString;
7
7
  roots: z.ZodArray<z.ZodString>;
8
+ engine: z.ZodOptional<z.ZodObject<{
9
+ memoryBytes: z.ZodNumber;
10
+ cpus: z.ZodNumber;
11
+ }, z.core.$strip>>;
8
12
  }, z.core.$strip>;
9
13
  export type HostFacts = z.infer<typeof HostFactsSchema>;
10
14
  export declare const HostSummarySchema: z.ZodObject<{
@@ -19,6 +23,10 @@ export declare const HostSummarySchema: z.ZodObject<{
19
23
  shell: z.ZodString;
20
24
  home: z.ZodString;
21
25
  roots: z.ZodArray<z.ZodString>;
26
+ engine: z.ZodOptional<z.ZodObject<{
27
+ memoryBytes: z.ZodNumber;
28
+ cpus: z.ZodNumber;
29
+ }, z.core.$strip>>;
22
30
  }, z.core.$strip>>;
23
31
  }, z.core.$strip>;
24
32
  export type HostSummary = z.infer<typeof HostSummarySchema>;
@@ -35,6 +43,10 @@ export declare const HostsListSchema: z.ZodObject<{
35
43
  shell: z.ZodString;
36
44
  home: z.ZodString;
37
45
  roots: z.ZodArray<z.ZodString>;
46
+ engine: z.ZodOptional<z.ZodObject<{
47
+ memoryBytes: z.ZodNumber;
48
+ cpus: z.ZodNumber;
49
+ }, z.core.$strip>>;
38
50
  }, z.core.$strip>>;
39
51
  }, z.core.$strip>>;
40
52
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/schemas/hosts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,eAAe;;;;;;iBAU1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAY5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;iBAAkD,CAAC"}
1
+ {"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/schemas/hosts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,eAAe;;;;;;;;;;iBAc1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;iBAY5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;iBAAkD,CAAC"}
@@ -5,6 +5,7 @@ export const HostFactsSchema = z.object({
5
5
  shell: z.string(),
6
6
  home: z.string(),
7
7
  roots: z.array(z.string()),
8
+ engine: z.object({ memoryBytes: z.number(), cpus: z.number() }).optional(),
8
9
  });
9
10
  export const HostSummarySchema = z.object({
10
11
  id: z.string(),