hyperbrane 0.1.2 → 0.2.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 (300) hide show
  1. package/README.md +105 -23
  2. package/dist/agent/agentClient.d.ts +5 -0
  3. package/dist/agent/agentClient.js +4 -0
  4. package/dist/agent/agentService.d.ts +9 -37
  5. package/dist/agent/agentService.js +64 -323
  6. package/dist/agent/agentStorage.d.ts +1 -20
  7. package/dist/agent/agentStorage.js +0 -30
  8. package/dist/agent/api.d.ts +105 -152
  9. package/dist/agent/api.js +1 -8
  10. package/dist/agent/client.d.ts +3 -1
  11. package/dist/agent/client.js +2 -3
  12. package/dist/agent/control.d.ts +23 -0
  13. package/dist/agent/control.js +479 -0
  14. package/dist/agent/dimensionAgentClient.d.ts +8 -0
  15. package/dist/agent/dimensionAgentClient.js +99 -0
  16. package/dist/agent/hostTranscript.d.ts +0 -6
  17. package/dist/agent/hostTranscript.js +3 -14
  18. package/dist/agent/session/backend.d.ts +18 -32
  19. package/dist/agent/session/claude/home.d.ts +0 -1
  20. package/dist/agent/session/claude/home.js +0 -1
  21. package/dist/agent/session/claude/provision.d.ts +10 -0
  22. package/dist/agent/session/claude/provision.js +17 -0
  23. package/dist/agent/session/claude/transcript.d.ts +3 -7
  24. package/dist/agent/session/claude/transcript.js +68 -14
  25. package/dist/agent/session/client.d.ts +1 -10
  26. package/dist/agent/session/client.js +0 -3
  27. package/dist/agent/session/codex/provision.d.ts +14 -0
  28. package/dist/agent/session/codex/provision.js +25 -0
  29. package/dist/agent/session/fileTranscript.d.ts +6 -49
  30. package/dist/agent/session/fileTranscript.js +26 -82
  31. package/dist/agent/session/install.d.ts +5 -0
  32. package/dist/agent/session/install.js +35 -0
  33. package/dist/agent/session/sessionStorage.d.ts +4 -35
  34. package/dist/agent/session/sessionStorage.js +10 -16
  35. package/dist/agent/session/sharedConnection.d.ts +0 -8
  36. package/dist/agent/session/sharedConnection.js +0 -7
  37. package/dist/agent/session/storedTranscripts.d.ts +1 -6
  38. package/dist/agent/session/storedTranscripts.js +0 -3
  39. package/dist/agent/session/worker/jsonRpc.d.ts +2 -13
  40. package/dist/agent/session/worker/jsonRpc.js +2 -11
  41. package/dist/agent/session/worker/protocol.d.ts +30 -21
  42. package/dist/agent/session/worker/protocol.js +29 -18
  43. package/dist/agent/session/worker/workerParams.d.ts +0 -5
  44. package/dist/agent/session/worker/workerParams.js +24 -17
  45. package/dist/agent/session/workerConnection.d.ts +2 -13
  46. package/dist/agent/session/workerConnection.js +7 -12
  47. package/dist/agent/session/workerGatewayConnection.d.ts +18 -0
  48. package/dist/agent/session/workerGatewayConnection.js +86 -0
  49. package/dist/agent/vendor-types/manifest.json +32 -0
  50. package/dist/agent/workerBundle.d.ts +4 -19
  51. package/dist/agent/workerBundle.generated.js +1 -1
  52. package/dist/agent/workerBundle.js +3 -30
  53. package/dist/agent/workerReplacement.d.ts +3 -0
  54. package/dist/agent/workerReplacement.js +49 -0
  55. package/dist/cli/agent.js +31 -16
  56. package/dist/cli/command.d.ts +10 -11
  57. package/dist/cli/command.js +0 -4
  58. package/dist/cli/dimension.js +6 -6
  59. package/dist/cli/gateway.js +3 -6
  60. package/dist/cli/main.js +14 -31
  61. package/dist/cli/streamPrinter.d.ts +2 -10
  62. package/dist/cli/streamPrinter.js +16 -46
  63. package/dist/cli/table.d.ts +0 -3
  64. package/dist/cli/table.js +0 -4
  65. package/dist/dimension/api.d.ts +42 -27
  66. package/dist/dimension/api.js +28 -47
  67. package/dist/dimension/client.d.ts +5 -0
  68. package/dist/dimension/client.js +4 -0
  69. package/dist/dimension/control.d.ts +22 -0
  70. package/dist/dimension/control.js +346 -0
  71. package/dist/dimension/image.d.ts +0 -5
  72. package/dist/dimension/image.js +0 -8
  73. package/dist/dimension/imageFiles.generated.js +1 -1
  74. package/dist/dimension/paths.d.ts +5 -4
  75. package/dist/dimension/paths.js +15 -6
  76. package/dist/dimension/service.d.ts +8 -24
  77. package/dist/dimension/service.js +85 -227
  78. package/dist/dimension/transport-worker.d.ts +1 -0
  79. package/dist/dimension/transport-worker.js +151 -0
  80. package/dist/dimension/transportBundle.d.ts +2 -0
  81. package/dist/dimension/transportBundle.generated.d.ts +1 -0
  82. package/dist/dimension/transportBundle.generated.js +2 -0
  83. package/dist/dimension/transportBundle.js +4 -0
  84. package/dist/dimension/transportClient.d.ts +10 -0
  85. package/dist/dimension/transportClient.js +115 -0
  86. package/dist/dimension/transportProtocol.d.ts +53 -0
  87. package/dist/dimension/transportProtocol.js +8 -0
  88. package/dist/index.d.ts +7 -9
  89. package/dist/index.js +7 -19
  90. package/dist/lib/control.d.ts +11 -0
  91. package/dist/lib/control.js +62 -0
  92. package/dist/lib/docker.d.ts +0 -22
  93. package/dist/lib/docker.js +0 -10
  94. package/dist/lib/image.d.ts +0 -3
  95. package/dist/lib/image.js +0 -2
  96. package/dist/lib/jsonDirectory.d.ts +0 -13
  97. package/dist/lib/jsonDirectory.js +34 -18
  98. package/dist/lib/scriptBundle.d.ts +6 -0
  99. package/dist/lib/scriptBundle.js +28 -0
  100. package/dist/lib/sh.d.ts +2 -0
  101. package/dist/lib/sh.js +8 -0
  102. package/dist/lib/sleep.d.ts +0 -1
  103. package/dist/lib/sleep.js +0 -1
  104. package/dist/lib/streamFetch.d.ts +15 -0
  105. package/dist/lib/streamFetch.js +150 -0
  106. package/dist/lib/tar.d.ts +0 -1
  107. package/dist/lib/tar.js +5 -11
  108. package/dist/lib/unixSocket.d.ts +2 -0
  109. package/dist/lib/unixSocket.js +28 -0
  110. package/dist/portal-gateway/api.d.ts +14 -44
  111. package/dist/portal-gateway/api.js +1 -3
  112. package/dist/portal-gateway/control.d.ts +42 -0
  113. package/dist/portal-gateway/control.js +657 -0
  114. package/dist/portal-gateway/gatewayClient.d.ts +5 -0
  115. package/dist/portal-gateway/gatewayClient.js +4 -0
  116. package/dist/portal-gateway/gatewayService.d.ts +8 -38
  117. package/dist/portal-gateway/gatewayService.js +82 -254
  118. package/dist/portal-gateway/image.d.ts +0 -1
  119. package/dist/portal-gateway/image.js +0 -2
  120. package/dist/portal-gateway/imageFiles.generated.js +2 -2
  121. package/dist/portal-gateway/portalClient.d.ts +5 -0
  122. package/dist/portal-gateway/portalClient.js +4 -0
  123. package/dist/portal-gateway/portalService.d.ts +5 -47
  124. package/dist/portal-gateway/portalService.js +19 -349
  125. package/dist/portal-gateway/transport-worker.d.ts +1 -0
  126. package/dist/portal-gateway/transport-worker.js +205 -0
  127. package/dist/portal-gateway/transportBundle.d.ts +2 -0
  128. package/dist/portal-gateway/transportBundle.generated.d.ts +1 -0
  129. package/dist/portal-gateway/transportBundle.generated.js +2 -0
  130. package/dist/portal-gateway/transportBundle.js +4 -0
  131. package/dist/portal-gateway/upstream.d.ts +0 -81
  132. package/dist/portal-gateway/upstream.js +0 -1
  133. package/dist/restore.d.ts +9 -0
  134. package/dist/restore.js +10 -0
  135. package/dist/sandbox/api.d.ts +126 -187
  136. package/dist/sandbox/api.js +5 -7
  137. package/dist/sandbox/client.d.ts +3 -0
  138. package/dist/sandbox/client.js +7 -0
  139. package/dist/sandbox/data-endpoints/dataEndpoints.d.ts +13 -0
  140. package/dist/sandbox/data-endpoints/dataEndpoints.js +100 -0
  141. package/dist/sandbox/data-endpoints/firewalledPorts.d.ts +4 -0
  142. package/dist/sandbox/data-endpoints/firewalledPorts.js +28 -0
  143. package/dist/sandbox/lib/httpOverStream.d.ts +3 -0
  144. package/dist/sandbox/lib/httpOverStream.js +21 -0
  145. package/dist/sandbox/lib/remoteFileOperations.d.ts +10 -0
  146. package/dist/sandbox/lib/remoteFileOperations.js +70 -0
  147. package/dist/sandbox/lib/shellCommand.d.ts +3 -0
  148. package/dist/sandbox/lib/shellCommand.js +7 -0
  149. package/dist/sandbox/lib/sshKey.d.ts +6 -0
  150. package/dist/sandbox/lib/sshKey.js +75 -0
  151. package/dist/sandbox/providers/boat/boatService.d.ts +3 -0
  152. package/dist/sandbox/providers/boat/boatService.js +373 -0
  153. package/dist/sandbox/providers/exedev/exeDevService.d.ts +2 -0
  154. package/dist/sandbox/providers/exedev/exeDevService.js +129 -0
  155. package/dist/sandbox/providers/exedev/exeDevToken.d.ts +1 -0
  156. package/dist/sandbox/providers/exedev/exeDevToken.js +50 -0
  157. package/dist/sandbox/providers/local/localService.d.ts +2 -0
  158. package/dist/sandbox/providers/local/localService.js +197 -0
  159. package/dist/sandbox/providers/ssh/sshService.d.ts +2 -0
  160. package/dist/sandbox/providers/ssh/sshService.js +83 -0
  161. package/dist/sandbox/providers/ssh/sshTransport.d.ts +12 -0
  162. package/dist/sandbox/providers/ssh/sshTransport.js +216 -0
  163. package/dist/sandbox/service.d.ts +3 -0
  164. package/dist/sandbox/service.js +26 -0
  165. package/dist/sandbox/storage/descriptors.d.ts +6 -0
  166. package/dist/sandbox/storage/descriptors.js +25 -0
  167. package/dist/sandbox/storage/sandboxStorage.d.ts +11 -0
  168. package/dist/sandbox/storage/sandboxStorage.js +42 -0
  169. package/dist/upstreams/anthropic.d.ts +0 -5
  170. package/dist/upstreams/anthropic.js +1 -8
  171. package/dist/upstreams/index.d.ts +2 -6
  172. package/dist/upstreams/index.js +0 -4
  173. package/dist/upstreams/openai.d.ts +0 -5
  174. package/dist/upstreams/openai.js +1 -13
  175. package/dist/vendor-types/claude/agent-sdk/bridge.d.ts +20 -4
  176. package/dist/vendor-types/claude/agent-sdk/browser-sdk.d.ts +24 -0
  177. package/dist/vendor-types/claude/agent-sdk/core.d.ts +2 -0
  178. package/dist/vendor-types/claude/agent-sdk/sdk-tools.d.ts +75 -6
  179. package/dist/vendor-types/claude/agent-sdk/sdk.d.ts +569 -100
  180. package/package.json +13 -4
  181. package/dist/agent/gatewaySignIns.d.ts +0 -5
  182. package/dist/agent/gatewaySignIns.js +0 -11
  183. package/dist/agent/session/codex/home.d.ts +0 -2
  184. package/dist/agent/session/codex/home.js +0 -4
  185. package/dist/agent/session/codex/messages.d.ts +0 -30
  186. package/dist/agent/session/codex/messages.js +0 -135
  187. package/dist/agent/session/codex/transcript.d.ts +0 -12
  188. package/dist/agent/session/codex/transcript.js +0 -22
  189. package/dist/agent/session/sdkMessages.d.ts +0 -15
  190. package/dist/agent/session/sdkMessages.js +0 -28
  191. package/dist/agent/session/workerSseConnection.d.ts +0 -31
  192. package/dist/agent/session/workerSseConnection.js +0 -76
  193. package/dist/agent/vendor-types/codex/app-server/AbsolutePathBuf.d.ts +0 -10
  194. package/dist/agent/vendor-types/codex/app-server/AbsolutePathBuf.js +0 -2
  195. package/dist/agent/vendor-types/codex/app-server/FunctionCallOutputBody.d.ts +0 -2
  196. package/dist/agent/vendor-types/codex/app-server/FunctionCallOutputBody.js +0 -2
  197. package/dist/agent/vendor-types/codex/app-server/FunctionCallOutputContentItem.d.ts +0 -22
  198. package/dist/agent/vendor-types/codex/app-server/FunctionCallOutputContentItem.js +0 -2
  199. package/dist/agent/vendor-types/codex/app-server/ImageDetail.d.ts +0 -1
  200. package/dist/agent/vendor-types/codex/app-server/ImageDetail.js +0 -2
  201. package/dist/agent/vendor-types/codex/app-server/ImageGenerationFailure.d.ts +0 -5
  202. package/dist/agent/vendor-types/codex/app-server/ImageGenerationFailure.js +0 -2
  203. package/dist/agent/vendor-types/codex/app-server/ImageGenerationItem.d.ts +0 -11
  204. package/dist/agent/vendor-types/codex/app-server/ImageGenerationItem.js +0 -2
  205. package/dist/agent/vendor-types/codex/app-server/LegacyAppPathString.d.ts +0 -23
  206. package/dist/agent/vendor-types/codex/app-server/LegacyAppPathString.js +0 -2
  207. package/dist/agent/vendor-types/codex/app-server/MessagePhase.d.ts +0 -7
  208. package/dist/agent/vendor-types/codex/app-server/MessagePhase.js +0 -2
  209. package/dist/agent/vendor-types/codex/app-server/ReasoningEffort.d.ts +0 -4
  210. package/dist/agent/vendor-types/codex/app-server/ReasoningEffort.js +0 -2
  211. package/dist/agent/vendor-types/codex/app-server/SleepItem.d.ts +0 -7
  212. package/dist/agent/vendor-types/codex/app-server/SleepItem.js +0 -2
  213. package/dist/agent/vendor-types/codex/app-server/WebSearchItem.d.ts +0 -14
  214. package/dist/agent/vendor-types/codex/app-server/WebSearchItem.js +0 -2
  215. package/dist/agent/vendor-types/codex/app-server/serde_json/JsonValue.d.ts +0 -3
  216. package/dist/agent/vendor-types/codex/app-server/serde_json/JsonValue.js +0 -2
  217. package/dist/agent/vendor-types/codex/app-server/v2/AgentMessageDelivery.d.ts +0 -1
  218. package/dist/agent/vendor-types/codex/app-server/v2/AgentMessageDelivery.js +0 -2
  219. package/dist/agent/vendor-types/codex/app-server/v2/AsyncUserInputQuestion.d.ts +0 -4
  220. package/dist/agent/vendor-types/codex/app-server/v2/AsyncUserInputQuestion.js +0 -2
  221. package/dist/agent/vendor-types/codex/app-server/v2/ByteRange.d.ts +0 -4
  222. package/dist/agent/vendor-types/codex/app-server/v2/ByteRange.js +0 -2
  223. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentState.d.ts +0 -5
  224. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentState.js +0 -2
  225. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentStatus.d.ts +0 -1
  226. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentStatus.js +0 -2
  227. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentTool.d.ts +0 -1
  228. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentTool.js +0 -2
  229. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentToolCallStatus.d.ts +0 -1
  230. package/dist/agent/vendor-types/codex/app-server/v2/CollabAgentToolCallStatus.js +0 -2
  231. package/dist/agent/vendor-types/codex/app-server/v2/CommandAction.d.ts +0 -19
  232. package/dist/agent/vendor-types/codex/app-server/v2/CommandAction.js +0 -2
  233. package/dist/agent/vendor-types/codex/app-server/v2/CommandExecutionSource.d.ts +0 -1
  234. package/dist/agent/vendor-types/codex/app-server/v2/CommandExecutionSource.js +0 -2
  235. package/dist/agent/vendor-types/codex/app-server/v2/CommandExecutionStatus.d.ts +0 -1
  236. package/dist/agent/vendor-types/codex/app-server/v2/CommandExecutionStatus.js +0 -2
  237. package/dist/agent/vendor-types/codex/app-server/v2/DynamicToolCallOutputContentItem.d.ts +0 -10
  238. package/dist/agent/vendor-types/codex/app-server/v2/DynamicToolCallOutputContentItem.js +0 -2
  239. package/dist/agent/vendor-types/codex/app-server/v2/DynamicToolCallStatus.d.ts +0 -1
  240. package/dist/agent/vendor-types/codex/app-server/v2/DynamicToolCallStatus.js +0 -2
  241. package/dist/agent/vendor-types/codex/app-server/v2/FileUpdateChange.d.ts +0 -6
  242. package/dist/agent/vendor-types/codex/app-server/v2/FileUpdateChange.js +0 -2
  243. package/dist/agent/vendor-types/codex/app-server/v2/HookPromptFragment.d.ts +0 -4
  244. package/dist/agent/vendor-types/codex/app-server/v2/HookPromptFragment.js +0 -2
  245. package/dist/agent/vendor-types/codex/app-server/v2/McpAppDisplayMode.d.ts +0 -1
  246. package/dist/agent/vendor-types/codex/app-server/v2/McpAppDisplayMode.js +0 -2
  247. package/dist/agent/vendor-types/codex/app-server/v2/McpAppUi.d.ts +0 -8
  248. package/dist/agent/vendor-types/codex/app-server/v2/McpAppUi.js +0 -2
  249. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallAppContext.d.ts +0 -7
  250. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallAppContext.js +0 -2
  251. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallError.d.ts +0 -3
  252. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallError.js +0 -2
  253. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallResult.d.ts +0 -6
  254. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallResult.js +0 -2
  255. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallStatus.d.ts +0 -1
  256. package/dist/agent/vendor-types/codex/app-server/v2/McpToolCallStatus.js +0 -2
  257. package/dist/agent/vendor-types/codex/app-server/v2/MemoryCitation.d.ts +0 -5
  258. package/dist/agent/vendor-types/codex/app-server/v2/MemoryCitation.js +0 -2
  259. package/dist/agent/vendor-types/codex/app-server/v2/MemoryCitationEntry.d.ts +0 -6
  260. package/dist/agent/vendor-types/codex/app-server/v2/MemoryCitationEntry.js +0 -2
  261. package/dist/agent/vendor-types/codex/app-server/v2/PatchApplyStatus.d.ts +0 -1
  262. package/dist/agent/vendor-types/codex/app-server/v2/PatchApplyStatus.js +0 -2
  263. package/dist/agent/vendor-types/codex/app-server/v2/PatchChangeKind.d.ts +0 -8
  264. package/dist/agent/vendor-types/codex/app-server/v2/PatchChangeKind.js +0 -2
  265. package/dist/agent/vendor-types/codex/app-server/v2/SubAgentActivityKind.d.ts +0 -1
  266. package/dist/agent/vendor-types/codex/app-server/v2/SubAgentActivityKind.js +0 -2
  267. package/dist/agent/vendor-types/codex/app-server/v2/TextElement.d.ts +0 -11
  268. package/dist/agent/vendor-types/codex/app-server/v2/TextElement.js +0 -2
  269. package/dist/agent/vendor-types/codex/app-server/v2/ThreadItem.d.ts +0 -215
  270. package/dist/agent/vendor-types/codex/app-server/v2/ThreadItem.js +0 -2
  271. package/dist/agent/vendor-types/codex/app-server/v2/UserInput.d.ts +0 -35
  272. package/dist/agent/vendor-types/codex/app-server/v2/UserInput.js +0 -2
  273. package/dist/agent/vendor-types/codex/app-server/v2/WebSearchAction.d.ts +0 -14
  274. package/dist/agent/vendor-types/codex/app-server/v2/WebSearchAction.js +0 -2
  275. package/dist/cli/services.d.ts +0 -19
  276. package/dist/cli/services.js +0 -34
  277. package/dist/dimension/http.d.ts +0 -7
  278. package/dist/dimension/http.js +0 -77
  279. package/dist/dimension/storage.d.ts +0 -39
  280. package/dist/dimension/storage.js +0 -79
  281. package/dist/portal-gateway/fakes.d.ts +0 -3
  282. package/dist/portal-gateway/fakes.js +0 -11
  283. package/dist/portal-gateway/gatewayStorage.d.ts +0 -66
  284. package/dist/portal-gateway/gatewayStorage.js +0 -125
  285. package/dist/portal-gateway/portalStorage.d.ts +0 -34
  286. package/dist/portal-gateway/portalStorage.js +0 -44
  287. package/dist/sandbox/boatService.d.ts +0 -52
  288. package/dist/sandbox/boatService.js +0 -343
  289. package/dist/sandbox/containerService.d.ts +0 -15
  290. package/dist/sandbox/containerService.js +0 -184
  291. package/dist/sandbox/endpointProxy.d.ts +0 -90
  292. package/dist/sandbox/endpointProxy.js +0 -716
  293. package/dist/sandbox/exeDevAuth.d.ts +0 -16
  294. package/dist/sandbox/exeDevAuth.js +0 -49
  295. package/dist/sandbox/localService.d.ts +0 -19
  296. package/dist/sandbox/localService.js +0 -200
  297. package/dist/sandbox/sseConnection.d.ts +0 -41
  298. package/dist/sandbox/sseConnection.js +0 -166
  299. package/dist/sandbox/sshService.d.ts +0 -30
  300. package/dist/sandbox/sshService.js +0 -680
@@ -1,77 +0,0 @@
1
- import { DimensionConflictError, DimensionInvalidError, DimensionNotFoundError, } from "./api.js";
2
- import { createDockerClient } from "../lib/docker.js";
3
- import { createLocalSandbox } from "../sandbox/localService.js";
4
- import { createDimensionImage } from "./image.js";
5
- import { createDimensionService } from "./service.js";
6
- import { createFileStorage } from "./storage.js";
7
- export function createDimensionHttpServer(service, port) {
8
- let server;
9
- async function handleListDimensions() {
10
- return Response.json(await service.getDimensions());
11
- }
12
- async function handleCreateDimension(req) {
13
- // TODO: add validation with proper JSON reply
14
- const dimension = (await req.json());
15
- await service.createDimension(dimension);
16
- return Response.json(dimension, { status: 201 });
17
- }
18
- async function handleDestroyDimension(req) {
19
- await service.destroyDimension(req.params.dimensionName);
20
- return new Response(null, { status: 204 });
21
- }
22
- async function handleUpdateDimension(req) {
23
- const limits = (await req.json());
24
- return Response.json(await service.updateDimension(req.params.dimensionName, limits));
25
- }
26
- async function handleRestartDimension(req) {
27
- await service.restartDimension(req.params.dimensionName);
28
- return new Response(null, { status: 204 });
29
- }
30
- function handleNotFound() {
31
- return new Response("Not Found", { status: 404 });
32
- }
33
- function handleError(error) {
34
- if (error instanceof DimensionInvalidError)
35
- return Response.json({ error: error.message }, { status: 400 });
36
- if (error instanceof DimensionConflictError)
37
- return Response.json({ error: error.message }, { status: 409 });
38
- if (error instanceof DimensionNotFoundError)
39
- return Response.json({ error: error.message }, { status: 404 });
40
- console.error(error);
41
- return Response.json({ error: error.message }, { status: 500 });
42
- }
43
- async function start() {
44
- server = Bun.serve({
45
- port,
46
- routes: {
47
- "/v1/dimensions": {
48
- GET: handleListDimensions,
49
- POST: handleCreateDimension,
50
- },
51
- "/v1/dimensions/:dimensionName": {
52
- DELETE: handleDestroyDimension,
53
- PATCH: handleUpdateDimension,
54
- },
55
- "/v1/dimensions/:dimensionName/restart": {
56
- POST: handleRestartDimension,
57
- },
58
- },
59
- fetch: handleNotFound,
60
- error: handleError,
61
- });
62
- console.log(`dimension service listening on ${server.url}`);
63
- return server.url;
64
- }
65
- async function stop() {
66
- await server?.stop();
67
- server = undefined;
68
- }
69
- return { start, stop };
70
- }
71
- if (import.meta.main) {
72
- const port = Number(process.env.PORT ?? 3000);
73
- const host = createLocalSandbox("/");
74
- const docker = createDockerClient(host);
75
- const service = createDimensionService(createFileStorage(host), docker, createDimensionImage(docker), host);
76
- await createDimensionHttpServer(service, port).start();
77
- }
@@ -1,39 +0,0 @@
1
- import { type Sandbox } from "../sandbox/api.ts";
2
- import type { Dimension } from "./api.ts";
3
- /** "creating" until provisioning has finished once; a create that crashed stays "creating" until retried. */
4
- export type DimensionRecord = Dimension & {
5
- state: "creating" | "ready";
6
- };
7
- /**
8
- * One JSON file per dimension, so no operation rewrites a shared file and every write is a single
9
- * atomic sandbox operation. Safe to use from several processes at once.
10
- */
11
- export interface Storage {
12
- getDimensions(): Promise<DimensionRecord[]>;
13
- /** Stores the record unless one with that name exists; returns whichever record is stored afterwards. */
14
- insertDimension(record: DimensionRecord): Promise<DimensionRecord>;
15
- /** Replaces the record. */
16
- saveDimension(record: DimensionRecord): Promise<void>;
17
- /** No-op if the record doesn't exist. */
18
- removeDimension(dimensionName: string): Promise<void>;
19
- /**
20
- * Sandbox path of the dimension's run directory, mounted into it at RUN_PATH so processes on both
21
- * sides can meet at unix sockets in it (the agent session worker). Creates it.
22
- */
23
- ensureRunDirectory(dimensionName: string): Promise<string>;
24
- /** Removes the run directory and everything in it. No-op if missing. */
25
- removeRunDirectory(dimensionName: string): Promise<void>;
26
- /**
27
- * Sandbox path of the dimension's state directory, mounted into it at STATE_PATH: what hyperbrane
28
- * keeps for what runs in the dimension (the agent session worker's records), on the host with the
29
- * rest of its storage. Creates it.
30
- */
31
- ensureStateDirectory(dimensionName: string): Promise<string>;
32
- /** Removes the state directory and everything in it. No-op if missing. */
33
- removeStateDirectory(dimensionName: string): Promise<void>;
34
- }
35
- /**
36
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane/dimensions of the sandbox's user.
37
- * Run and state directories go next to it, in dimension-run/<dimension> and dimension-state/<dimension>.
38
- */
39
- export declare function createFileStorage(sandbox: Sandbox, dir?: string): Storage;
@@ -1,79 +0,0 @@
1
- import { dirname } from "node:path";
2
- import { createJsonDirectory } from "../lib/jsonDirectory.js";
3
- import { SandboxNotFoundError } from "../sandbox/api.js";
4
- import { dimensionRunDirectory, dimensionStateDirectory } from "./paths.js";
5
- const EXTENSION = ".json";
6
- /**
7
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane/dimensions of the sandbox's user.
8
- * Run and state directories go next to it, in dimension-run/<dimension> and dimension-state/<dimension>.
9
- */
10
- export function createFileStorage(sandbox, dir) {
11
- async function storageDir() {
12
- return dir ?? `${await sandbox.homeDirectory()}/.local/share/hyperbrane/dimensions`;
13
- }
14
- async function pathFor(dimensionName) {
15
- return `${await storageDir()}/${dimensionName}${EXTENSION}`;
16
- }
17
- function serialize(record) {
18
- return JSON.stringify(record, null, 2) + "\n";
19
- }
20
- async function readRecord(path) {
21
- try {
22
- return JSON.parse(new TextDecoder().decode(await sandbox.readFile(path)));
23
- }
24
- catch (error) {
25
- if (error instanceof SandboxNotFoundError)
26
- return null;
27
- throw error;
28
- }
29
- }
30
- // All at once (lib/jsonDirectory.ts): a call per record adds up on a remote machine.
31
- async function getDimensions() {
32
- return createJsonDirectory(sandbox, storageDir).list();
33
- }
34
- async function insertDimension(record) {
35
- const path = await pathFor(record.name);
36
- if (await sandbox.writeFileExclusive(path, serialize(record)))
37
- return record;
38
- // Lost to an existing record; if that one was removed in the meantime, try again.
39
- return (await readRecord(path)) ?? insertDimension(record);
40
- }
41
- async function saveDimension(record) {
42
- await sandbox.writeFile(await pathFor(record.name), serialize(record));
43
- }
44
- async function removeDimension(dimensionName) {
45
- await sandbox.removeFile(await pathFor(dimensionName));
46
- }
47
- async function runDirectory(dimensionName) {
48
- return dimensionRunDirectory(dirname(await storageDir()), dimensionName);
49
- }
50
- async function ensureRunDirectory(dimensionName) {
51
- const path = await runDirectory(dimensionName);
52
- await sandbox.createDirectory(path);
53
- return path;
54
- }
55
- async function removeRunDirectory(dimensionName) {
56
- await sandbox.removeDirectory(await runDirectory(dimensionName));
57
- }
58
- async function stateDirectory(dimensionName) {
59
- return dimensionStateDirectory(dirname(await storageDir()), dimensionName);
60
- }
61
- async function ensureStateDirectory(dimensionName) {
62
- const path = await stateDirectory(dimensionName);
63
- await sandbox.createDirectory(path);
64
- return path;
65
- }
66
- async function removeStateDirectory(dimensionName) {
67
- await sandbox.removeDirectory(await stateDirectory(dimensionName));
68
- }
69
- return {
70
- getDimensions,
71
- insertDimension,
72
- saveDimension,
73
- removeDimension,
74
- ensureRunDirectory,
75
- removeRunDirectory,
76
- ensureStateDirectory,
77
- removeStateDirectory,
78
- };
79
- }
@@ -1,3 +0,0 @@
1
- import type { FakeShape } from "./upstream.ts";
2
- /** A fake for an API key: the shape's prefix, then random characters as long as the real key. */
3
- export declare function issueKeyFake(shape: FakeShape, key: string): string;
@@ -1,11 +0,0 @@
1
- // Like the gateway addon (image/upstreams.py), which issues the fakes for captured tokens.
2
- const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
3
- function random(length) {
4
- const bytes = crypto.getRandomValues(new Uint8Array(length));
5
- return Array.from(bytes, (byte) => ALPHABET[byte % ALPHABET.length]).join("");
6
- }
7
- /** A fake for an API key: the shape's prefix, then random characters as long as the real key. */
8
- export function issueKeyFake(shape, key) {
9
- const prefix = "prefix" in shape ? shape.prefix : "";
10
- return prefix + random(Math.max(key.length - prefix.length, 16));
11
- }
@@ -1,66 +0,0 @@
1
- import type { Sandbox } from "../sandbox/api.ts";
2
- import type { Gateway, TrafficRule } from "./api.ts";
3
- import type { ApiKeyCredential, OAuthCredential, UpstreamDefinition } from "./upstream.ts";
4
- /** "creating" until the container has come up once; a create that crashed stays "creating" until retried. */
5
- export type GatewayRecord = Gateway & {
6
- state: "creating" | "ready";
7
- };
8
- export type TrafficRuleResponse = {
9
- name: string;
10
- action: "ALLOW" | "DENY";
11
- at: number;
12
- };
13
- /** Every name must pass checkName; operations throw InvalidNameError otherwise. */
14
- export interface GatewayStorage {
15
- /** Stores the record unless one with that name exists; returns whichever record is stored afterwards. */
16
- insertGateway(gateway: GatewayRecord): Promise<GatewayRecord>;
17
- /** Replaces the record. */
18
- saveGateway(gateway: GatewayRecord): Promise<void>;
19
- /** Null if missing. */
20
- readGateway(gatewayName: string): Promise<GatewayRecord | null>;
21
- /** Removes the gateway's state (credentials, rules, CA), then its record. No-op if missing. */
22
- removeGateway(gatewayName: string): Promise<void>;
23
- listGateways(): Promise<GatewayRecord[]>;
24
- /**
25
- * Sandbox path of the directory mounted into the gateway container as /state. Creates it with
26
- * its upstreams/, credentials/, traffic-rules/, traffic-responses/ and mitmproxy/ subdirectories.
27
- */
28
- ensureStateDirectory(gatewayName: string): Promise<string>;
29
- /** Replaces the definition. */
30
- saveUpstream(gatewayName: string, upstream: UpstreamDefinition): Promise<void>;
31
- /** Null if missing. */
32
- readUpstream(gatewayName: string, upstreamName: string): Promise<UpstreamDefinition | null>;
33
- /** Removes the definition and its credentials. No-op if missing. */
34
- removeUpstream(gatewayName: string, upstreamName: string): Promise<void>;
35
- listUpstreams(gatewayName: string): Promise<UpstreamDefinition[]>;
36
- /** Written by the gateway as it captures tokens; null until a client signs in. */
37
- readOAuthCredential(gatewayName: string, upstreamName: string): Promise<OAuthCredential | null>;
38
- /** No-op if missing. */
39
- removeOAuthCredential(gatewayName: string, upstreamName: string): Promise<void>;
40
- /** Null if none were ever set. */
41
- readApiKeys(gatewayName: string, upstreamName: string): Promise<ApiKeyCredential | null>;
42
- /** Every credential the gateway holds, by name ("<upstream>.oauth", "<upstream>.api-keys"), at once. */
43
- listCredentials(gatewayName: string): Promise<Map<string, unknown>>;
44
- /** Replaces the upstream's keys. */
45
- saveApiKeys(gatewayName: string, upstreamName: string, keys: ApiKeyCredential): Promise<void>;
46
- /** No-op if missing. */
47
- removeApiKeys(gatewayName: string, upstreamName: string): Promise<void>;
48
- /** Stores the record unless one with that name exists; returns whichever record is stored afterwards. */
49
- insertTrafficRule(gatewayName: string, rule: TrafficRule): Promise<TrafficRule>;
50
- /** Replaces the record. */
51
- saveTrafficRule(gatewayName: string, rule: TrafficRule): Promise<void>;
52
- /** Null if missing. */
53
- readTrafficRule(gatewayName: string, ruleName: string): Promise<TrafficRule | null>;
54
- /** Removes the rule and its last response. No-op if missing. */
55
- removeTrafficRule(gatewayName: string, ruleName: string): Promise<void>;
56
- listTrafficRules(gatewayName: string): Promise<TrafficRule[]>;
57
- /** Replaces the rule's last response. */
58
- saveTrafficRuleResponse(gatewayName: string, response: TrafficRuleResponse): Promise<void>;
59
- }
60
- /**
61
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane of the sandbox's user. Layout:
62
- * gateways/<gateway>.json, and gateway-state/<gateway>/ holding everything the container sees:
63
- * upstreams/<upstream>.json, credentials/<upstream>.oauth.json and <upstream>.api-keys.json,
64
- * traffic-rules/<rule>.json, traffic-responses/<rule>.json, mitmproxy/.
65
- */
66
- export declare function createGatewayStorage(sandbox: Sandbox, dir?: string): GatewayStorage;
@@ -1,125 +0,0 @@
1
- import { checkName, createJsonDirectory, defaultDataDir } from "../lib/jsonDirectory.js";
2
- /**
3
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane of the sandbox's user. Layout:
4
- * gateways/<gateway>.json, and gateway-state/<gateway>/ holding everything the container sees:
5
- * upstreams/<upstream>.json, credentials/<upstream>.oauth.json and <upstream>.api-keys.json,
6
- * traffic-rules/<rule>.json, traffic-responses/<rule>.json, mitmproxy/.
7
- */
8
- export function createGatewayStorage(sandbox, dir) {
9
- async function dataDir() {
10
- return dir ?? defaultDataDir(sandbox);
11
- }
12
- async function stateDir(gatewayName) {
13
- return `${await dataDir()}/gateway-state/${checkName(gatewayName)}`;
14
- }
15
- const gateways = createJsonDirectory(sandbox, async () => `${await dataDir()}/gateways`);
16
- function stateSubdirectory(gatewayName, subdirectory) {
17
- checkName(gatewayName);
18
- return createJsonDirectory(sandbox, async () => `${await stateDir(gatewayName)}/${subdirectory}`);
19
- }
20
- const upstreams = (gatewayName) => stateSubdirectory(gatewayName, "upstreams");
21
- const credentials = (gatewayName) => stateSubdirectory(gatewayName, "credentials");
22
- const trafficRules = (gatewayName) => stateSubdirectory(gatewayName, "traffic-rules");
23
- const trafficResponses = (gatewayName) => stateSubdirectory(gatewayName, "traffic-responses");
24
- async function insertGateway(gateway) {
25
- return gateways.insert(gateway.name, gateway);
26
- }
27
- async function saveGateway(gateway) {
28
- await gateways.save(gateway.name, gateway);
29
- }
30
- async function readGateway(gatewayName) {
31
- return gateways.read(gatewayName);
32
- }
33
- async function removeGateway(gatewayName) {
34
- await sandbox.removeDirectory(await stateDir(gatewayName));
35
- await gateways.remove(gatewayName);
36
- }
37
- async function listGateways() {
38
- return gateways.list();
39
- }
40
- async function ensureStateDirectory(gatewayName) {
41
- const path = await stateDir(gatewayName);
42
- for (const subdirectory of ["upstreams", "credentials", "traffic-rules", "traffic-responses", "mitmproxy"]) {
43
- await sandbox.createDirectory(`${path}/${subdirectory}`);
44
- }
45
- return path;
46
- }
47
- async function saveUpstream(gatewayName, upstream) {
48
- await upstreams(gatewayName).save(upstream.name, upstream);
49
- }
50
- async function readUpstream(gatewayName, upstreamName) {
51
- return upstreams(gatewayName).read(upstreamName);
52
- }
53
- // Definition last: while any credential is left, the upstream is still there to retry the removal.
54
- async function removeUpstream(gatewayName, upstreamName) {
55
- await removeOAuthCredential(gatewayName, upstreamName);
56
- await removeApiKeys(gatewayName, upstreamName);
57
- await upstreams(gatewayName).remove(upstreamName);
58
- }
59
- async function listUpstreams(gatewayName) {
60
- return upstreams(gatewayName).list();
61
- }
62
- // Credential names are "<upstream>.oauth" and "<upstream>.api-keys", checked as names like any other.
63
- async function readOAuthCredential(gatewayName, upstreamName) {
64
- return (await credentials(gatewayName).read(`${checkName(upstreamName)}.oauth`));
65
- }
66
- async function removeOAuthCredential(gatewayName, upstreamName) {
67
- await credentials(gatewayName).remove(`${checkName(upstreamName)}.oauth`);
68
- }
69
- /** Every credential the gateway holds, by name ("<upstream>.oauth", "<upstream>.api-keys"), at once. */
70
- async function listCredentials(gatewayName) {
71
- return new Map(await credentials(gatewayName).entries());
72
- }
73
- async function readApiKeys(gatewayName, upstreamName) {
74
- return (await credentials(gatewayName).read(`${checkName(upstreamName)}.api-keys`));
75
- }
76
- async function saveApiKeys(gatewayName, upstreamName, keys) {
77
- await credentials(gatewayName).save(`${checkName(upstreamName)}.api-keys`, keys);
78
- }
79
- async function removeApiKeys(gatewayName, upstreamName) {
80
- await credentials(gatewayName).remove(`${checkName(upstreamName)}.api-keys`);
81
- }
82
- async function insertTrafficRule(gatewayName, rule) {
83
- return trafficRules(gatewayName).insert(rule.name, rule);
84
- }
85
- async function saveTrafficRule(gatewayName, rule) {
86
- await trafficRules(gatewayName).save(rule.name, rule);
87
- }
88
- async function readTrafficRule(gatewayName, ruleName) {
89
- return trafficRules(gatewayName).read(ruleName);
90
- }
91
- async function removeTrafficRule(gatewayName, ruleName) {
92
- await trafficRules(gatewayName).remove(ruleName);
93
- await trafficResponses(gatewayName).remove(ruleName);
94
- }
95
- async function listTrafficRules(gatewayName) {
96
- return trafficRules(gatewayName).list();
97
- }
98
- async function saveTrafficRuleResponse(gatewayName, response) {
99
- await trafficResponses(gatewayName).save(response.name, response);
100
- }
101
- return {
102
- insertGateway,
103
- saveGateway,
104
- readGateway,
105
- removeGateway,
106
- listGateways,
107
- ensureStateDirectory,
108
- saveUpstream,
109
- readUpstream,
110
- removeUpstream,
111
- listUpstreams,
112
- readOAuthCredential,
113
- removeOAuthCredential,
114
- readApiKeys,
115
- listCredentials,
116
- saveApiKeys,
117
- removeApiKeys,
118
- insertTrafficRule,
119
- saveTrafficRule,
120
- readTrafficRule,
121
- removeTrafficRule,
122
- listTrafficRules,
123
- saveTrafficRuleResponse,
124
- };
125
- }
@@ -1,34 +0,0 @@
1
- import type { Sandbox } from "../sandbox/api.ts";
2
- import type { Portal } from "./api.ts";
3
- /**
4
- * "creating" until wired once; "destroying" from the moment its removal starts, so nothing wires it
5
- * again. `subnet` indexes the portal's /30, set once claimed.
6
- */
7
- export type PortalRecord = Portal & {
8
- state: "creating" | "ready" | "destroying";
9
- subnet?: number;
10
- };
11
- /** Every name must pass checkName; operations throw InvalidNameError otherwise. */
12
- export interface PortalStorage {
13
- /** Stores the record unless one with that name exists; returns whichever record is stored afterwards. */
14
- insertPortal(portal: PortalRecord): Promise<PortalRecord>;
15
- /** Replaces the record. */
16
- savePortal(portal: PortalRecord): Promise<void>;
17
- /** Null if missing. */
18
- readPortal(portalName: string): Promise<PortalRecord | null>;
19
- /** No-op if missing. */
20
- removePortal(portalName: string): Promise<void>;
21
- listPortals(): Promise<PortalRecord[]>;
22
- /**
23
- * Claims a free subnet index for the portal, atomically across processes; returns the portal's
24
- * existing claim if it already has one (e.g. from a create that crashed before saving it).
25
- */
26
- claimSubnet(portalName: string): Promise<number>;
27
- /** No-op if unclaimed. */
28
- releaseSubnet(subnet: number): Promise<void>;
29
- }
30
- /**
31
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane of the sandbox's user.
32
- * Layout: portals/<portal>.json, portal-subnets/<index>.json.
33
- */
34
- export declare function createPortalStorage(sandbox: Sandbox, dir?: string): PortalStorage;
@@ -1,44 +0,0 @@
1
- import { createJsonDirectory, defaultDataDir } from "../lib/jsonDirectory.js";
2
- /**
3
- * `dir` is a sandbox path; defaults to ~/.local/share/hyperbrane of the sandbox's user.
4
- * Layout: portals/<portal>.json, portal-subnets/<index>.json.
5
- */
6
- export function createPortalStorage(sandbox, dir) {
7
- async function dataDir() {
8
- return dir ?? defaultDataDir(sandbox);
9
- }
10
- const portals = createJsonDirectory(sandbox, async () => `${await dataDir()}/portals`);
11
- const subnets = createJsonDirectory(sandbox, async () => `${await dataDir()}/portal-subnets`);
12
- async function insertPortal(portal) {
13
- return portals.insert(portal.name, portal);
14
- }
15
- async function savePortal(portal) {
16
- await portals.save(portal.name, portal);
17
- }
18
- async function readPortal(portalName) {
19
- return portals.read(portalName);
20
- }
21
- async function removePortal(portalName) {
22
- await portals.remove(portalName);
23
- }
24
- async function listPortals() {
25
- return portals.list();
26
- }
27
- async function claimSubnet(portalName) {
28
- const claims = await subnets.list();
29
- const own = claims.find((claim) => claim.portalName === portalName);
30
- if (own)
31
- return own.subnet;
32
- const taken = new Set(claims.map((claim) => claim.subnet));
33
- let subnet = 0;
34
- while (taken.has(subnet))
35
- subnet++;
36
- const winner = await subnets.insert(String(subnet), { subnet, portalName });
37
- // Lost the index to a concurrent claim: look again.
38
- return winner.portalName === portalName ? subnet : claimSubnet(portalName);
39
- }
40
- async function releaseSubnet(subnet) {
41
- await subnets.remove(String(subnet));
42
- }
43
- return { insertPortal, savePortal, readPortal, removePortal, listPortals, claimSubnet, releaseSubnet };
44
- }
@@ -1,52 +0,0 @@
1
- import { BoatApi, type Sandbox as BoatMachine } from "@boatdev/sdk";
2
- import { type Sandbox, type SandboxAccessibleEndpoint, type SandboxExpiration } from "./api.ts";
3
- import { type SandboxEndpointAuth } from "./endpointProxy.ts";
4
- export declare const BOAT_API_URL = "https://boat.dev/api/v1";
5
- export declare function createBoatApi(apiKey: string, basePath?: string): BoatApi;
6
- /** A call to Boat that failed: its HTTP status and Boat's error code. */
7
- export declare class BoatError extends Error {
8
- readonly status: number;
9
- readonly code: string;
10
- name: string;
11
- constructor(status: number, code: string, message: string);
12
- }
13
- export type BoatSandboxOptions = {
14
- /** Where the sandbox's endpoint proxy listens; Boat publishes it. Defaults to 8900. */
15
- proxyPort?: number;
16
- /** Sandbox path the endpoint proxy keeps its records in; defaults to ~/.local/state/hyperbrane/endpoints. */
17
- stateDirectory?: string;
18
- };
19
- /**
20
- * A Boat sandbox (https://boat.dev), driven through Boat's API alone (its SDK): files through its
21
- * file calls, commands through its command call (one shell line, up to 600s), and what needs a
22
- * stream into the sandbox through the sandbox's own endpoints: `connect` is an "sse" endpoint to
23
- * the socket, `fetch` an "http" one (so docker's responses stream). Those endpoints, like any the
24
- * sandbox exposes, sit behind one proxy that Boat publishes on a URL of its own (boatHostPortAuth).
25
- * Sandbox paths are paths in the sandbox; the sandbox must be running (ensureBoatRunning).
26
- */
27
- export declare function createBoatSandbox(api: BoatApi, sandboxId: string, { proxyPort, stateDirectory }?: BoatSandboxOptions): Sandbox & SandboxAccessibleEndpoint & SandboxExpiration;
28
- /**
29
- * Endpoints published by Boat: the proxy listens on the accessible host's port inside the sandbox
30
- * and checks the bearer or basic credentials it mints per endpoint (proxyCredentialsAuth), and
31
- * Boat's hostPort makes that port public, with Boat's TLS, on a URL of its own:
32
- * https://<sandbox>-<port>.on.boat.dev. Boat's own guard for a port (a token it trades for a
33
- * cookie) isn't used: a client can't carry it through a POST, nor a browser keep it across sites.
34
- */
35
- export declare function boatHostPortAuth(api: BoatApi, sandboxId: string): SandboxEndpointAuth;
36
- /** Creates a sandbox, names it, and waits until it runs commands. */
37
- export declare function createBoatMachine(api: BoatApi, { name }: {
38
- name: string;
39
- }): Promise<BoatMachine>;
40
- /** The sandbox, running: one that was stopped (archived) is resumed, its disk as it was, first. */
41
- export declare function ensureBoatRunning(api: BoatApi, sandboxId: string): Promise<BoatMachine>;
42
- /** Stops the sandbox, saving its disk first (Boat archives it), for a later ensureBoatRunning. */
43
- export declare function archiveBoatMachine(api: BoatApi, sandboxId: string): Promise<void>;
44
- /**
45
- * Lets `publicKey` (OpenSSH) log in to the running sandbox, and says where: Boat's SSH endpoint for
46
- * it and its user. The endpoint may change when the sandbox is resumed on another machine.
47
- */
48
- export declare function authorizeBoatSshKey(api: BoatApi, sandboxId: string, publicKey: string): Promise<{
49
- host: string;
50
- port: number;
51
- user: string;
52
- }>;