@dxos/cli 0.8.4-main.fd6878d → 0.8.4-staging.ac66bdf99f

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 (323) hide show
  1. package/LICENSE +3 -3
  2. package/bin/dx.js +29 -12
  3. package/package.json +14 -129
  4. package/README.md +0 -145
  5. package/bin/agent_entrypoint +0 -22
  6. package/bin/dev.cmd +0 -3
  7. package/bin/dev.js +0 -26
  8. package/bin/handle_invitation +0 -18
  9. package/bin/run.cmd +0 -3
  10. package/dist/src/base.d.ts +0 -18
  11. package/dist/src/base.d.ts.map +0 -1
  12. package/dist/src/base.js +0 -76
  13. package/dist/src/base.js.map +0 -1
  14. package/dist/src/commands/agent/agent.node.test.d.ts +0 -2
  15. package/dist/src/commands/agent/agent.node.test.d.ts.map +0 -1
  16. package/dist/src/commands/agent/agent.node.test.js +0 -178
  17. package/dist/src/commands/agent/agent.node.test.js.map +0 -1
  18. package/dist/src/commands/agent/invitations.d.ts +0 -20
  19. package/dist/src/commands/agent/invitations.d.ts.map +0 -1
  20. package/dist/src/commands/agent/invitations.js +0 -88
  21. package/dist/src/commands/agent/invitations.js.map +0 -1
  22. package/dist/src/commands/agent/list.d.ts +0 -22
  23. package/dist/src/commands/agent/list.d.ts.map +0 -1
  24. package/dist/src/commands/agent/list.js +0 -45
  25. package/dist/src/commands/agent/list.js.map +0 -1
  26. package/dist/src/commands/agent/restart.d.ts +0 -21
  27. package/dist/src/commands/agent/restart.d.ts.map +0 -1
  28. package/dist/src/commands/agent/restart.js +0 -26
  29. package/dist/src/commands/agent/restart.js.map +0 -1
  30. package/dist/src/commands/agent/start.d.ts +0 -33
  31. package/dist/src/commands/agent/start.d.ts.map +0 -1
  32. package/dist/src/commands/agent/start.js +0 -204
  33. package/dist/src/commands/agent/start.js.map +0 -1
  34. package/dist/src/commands/agent/status.d.ts +0 -19
  35. package/dist/src/commands/agent/status.d.ts.map +0 -1
  36. package/dist/src/commands/agent/status.js +0 -30
  37. package/dist/src/commands/agent/status.js.map +0 -1
  38. package/dist/src/commands/agent/stop.d.ts +0 -22
  39. package/dist/src/commands/agent/stop.d.ts.map +0 -1
  40. package/dist/src/commands/agent/stop.js +0 -49
  41. package/dist/src/commands/agent/stop.js.map +0 -1
  42. package/dist/src/commands/config/index.d.ts +0 -7
  43. package/dist/src/commands/config/index.d.ts.map +0 -1
  44. package/dist/src/commands/config/index.js +0 -16
  45. package/dist/src/commands/config/index.js.map +0 -1
  46. package/dist/src/commands/config/index.node.test.d.ts +0 -2
  47. package/dist/src/commands/config/index.node.test.d.ts.map +0 -1
  48. package/dist/src/commands/config/index.node.test.js +0 -25
  49. package/dist/src/commands/config/index.node.test.js.map +0 -1
  50. package/dist/src/commands/debug/diagnostics.d.ts +0 -25
  51. package/dist/src/commands/debug/diagnostics.d.ts.map +0 -1
  52. package/dist/src/commands/debug/diagnostics.js +0 -53
  53. package/dist/src/commands/debug/diagnostics.js.map +0 -1
  54. package/dist/src/commands/debug/error.d.ts +0 -6
  55. package/dist/src/commands/debug/error.d.ts.map +0 -1
  56. package/dist/src/commands/debug/error.js +0 -23
  57. package/dist/src/commands/debug/error.js.map +0 -1
  58. package/dist/src/commands/debug/generate.d.ts +0 -27
  59. package/dist/src/commands/debug/generate.d.ts.map +0 -1
  60. package/dist/src/commands/debug/generate.js +0 -71
  61. package/dist/src/commands/debug/generate.js.map +0 -1
  62. package/dist/src/commands/debug/metrics.d.ts +0 -10
  63. package/dist/src/commands/debug/metrics.d.ts.map +0 -1
  64. package/dist/src/commands/debug/metrics.js +0 -39
  65. package/dist/src/commands/debug/metrics.js.map +0 -1
  66. package/dist/src/commands/debug/status.d.ts +0 -20
  67. package/dist/src/commands/debug/status.d.ts.map +0 -1
  68. package/dist/src/commands/debug/status.js +0 -28
  69. package/dist/src/commands/debug/status.js.map +0 -1
  70. package/dist/src/commands/device/info.d.ts +0 -7
  71. package/dist/src/commands/device/info.d.ts.map +0 -1
  72. package/dist/src/commands/device/info.js +0 -30
  73. package/dist/src/commands/device/info.js.map +0 -1
  74. package/dist/src/commands/device/list.d.ts +0 -20
  75. package/dist/src/commands/device/list.d.ts.map +0 -1
  76. package/dist/src/commands/device/list.js +0 -23
  77. package/dist/src/commands/device/list.js.map +0 -1
  78. package/dist/src/commands/device/update.d.ts +0 -19
  79. package/dist/src/commands/device/update.d.ts.map +0 -1
  80. package/dist/src/commands/device/update.js +0 -32
  81. package/dist/src/commands/device/update.js.map +0 -1
  82. package/dist/src/commands/edge/status.d.ts +0 -19
  83. package/dist/src/commands/edge/status.d.ts.map +0 -1
  84. package/dist/src/commands/edge/status.js +0 -24
  85. package/dist/src/commands/edge/status.js.map +0 -1
  86. package/dist/src/commands/function/list.d.ts +0 -7
  87. package/dist/src/commands/function/list.d.ts.map +0 -1
  88. package/dist/src/commands/function/list.js +0 -19
  89. package/dist/src/commands/function/list.js.map +0 -1
  90. package/dist/src/commands/function/logs.d.ts +0 -14
  91. package/dist/src/commands/function/logs.d.ts.map +0 -1
  92. package/dist/src/commands/function/logs.js +0 -38
  93. package/dist/src/commands/function/logs.js.map +0 -1
  94. package/dist/src/commands/function/trigger/list.d.ts +0 -26
  95. package/dist/src/commands/function/trigger/list.d.ts.map +0 -1
  96. package/dist/src/commands/function/trigger/list.js +0 -51
  97. package/dist/src/commands/function/trigger/list.js.map +0 -1
  98. package/dist/src/commands/function/upload.d.ts +0 -34
  99. package/dist/src/commands/function/upload.d.ts.map +0 -1
  100. package/dist/src/commands/function/upload.js +0 -148
  101. package/dist/src/commands/function/upload.js.map +0 -1
  102. package/dist/src/commands/function/watch.d.ts +0 -29
  103. package/dist/src/commands/function/watch.d.ts.map +0 -1
  104. package/dist/src/commands/function/watch.js +0 -127
  105. package/dist/src/commands/function/watch.js.map +0 -1
  106. package/dist/src/commands/halo/create.d.ts +0 -24
  107. package/dist/src/commands/halo/create.d.ts.map +0 -1
  108. package/dist/src/commands/halo/create.js +0 -36
  109. package/dist/src/commands/halo/create.js.map +0 -1
  110. package/dist/src/commands/halo/credential/add.d.ts +0 -9
  111. package/dist/src/commands/halo/credential/add.d.ts.map +0 -1
  112. package/dist/src/commands/halo/credential/add.js +0 -42
  113. package/dist/src/commands/halo/credential/add.js.map +0 -1
  114. package/dist/src/commands/halo/credential/list.d.ts +0 -23
  115. package/dist/src/commands/halo/credential/list.d.ts.map +0 -1
  116. package/dist/src/commands/halo/credential/list.js +0 -62
  117. package/dist/src/commands/halo/credential/list.js.map +0 -1
  118. package/dist/src/commands/halo/identity.d.ts +0 -8
  119. package/dist/src/commands/halo/identity.d.ts.map +0 -1
  120. package/dist/src/commands/halo/identity.js +0 -31
  121. package/dist/src/commands/halo/identity.js.map +0 -1
  122. package/dist/src/commands/halo/join.d.ts +0 -23
  123. package/dist/src/commands/halo/join.d.ts.map +0 -1
  124. package/dist/src/commands/halo/join.js +0 -94
  125. package/dist/src/commands/halo/join.js.map +0 -1
  126. package/dist/src/commands/halo/keys.d.ts +0 -7
  127. package/dist/src/commands/halo/keys.d.ts.map +0 -1
  128. package/dist/src/commands/halo/keys.js +0 -14
  129. package/dist/src/commands/halo/keys.js.map +0 -1
  130. package/dist/src/commands/halo/recovery/generate.d.ts +0 -7
  131. package/dist/src/commands/halo/recovery/generate.d.ts.map +0 -1
  132. package/dist/src/commands/halo/recovery/generate.js +0 -16
  133. package/dist/src/commands/halo/recovery/generate.js.map +0 -1
  134. package/dist/src/commands/halo/recovery/use.d.ts +0 -20
  135. package/dist/src/commands/halo/recovery/use.d.ts.map +0 -1
  136. package/dist/src/commands/halo/recovery/use.js +0 -21
  137. package/dist/src/commands/halo/recovery/use.js.map +0 -1
  138. package/dist/src/commands/halo/share.d.ts +0 -24
  139. package/dist/src/commands/halo/share.d.ts.map +0 -1
  140. package/dist/src/commands/halo/share.js +0 -73
  141. package/dist/src/commands/halo/share.js.map +0 -1
  142. package/dist/src/commands/halo/update.d.ts +0 -19
  143. package/dist/src/commands/halo/update.d.ts.map +0 -1
  144. package/dist/src/commands/halo/update.js +0 -34
  145. package/dist/src/commands/halo/update.js.map +0 -1
  146. package/dist/src/commands/info.d.ts +0 -19
  147. package/dist/src/commands/info.d.ts.map +0 -1
  148. package/dist/src/commands/info.js +0 -23
  149. package/dist/src/commands/info.js.map +0 -1
  150. package/dist/src/commands/profile/import.d.ts +0 -20
  151. package/dist/src/commands/profile/import.d.ts.map +0 -1
  152. package/dist/src/commands/profile/import.js +0 -66
  153. package/dist/src/commands/profile/import.js.map +0 -1
  154. package/dist/src/commands/profile/inspect.d.ts +0 -20
  155. package/dist/src/commands/profile/inspect.d.ts.map +0 -1
  156. package/dist/src/commands/profile/inspect.js +0 -37
  157. package/dist/src/commands/profile/inspect.js.map +0 -1
  158. package/dist/src/commands/reset/index.d.ts +0 -20
  159. package/dist/src/commands/reset/index.d.ts.map +0 -1
  160. package/dist/src/commands/reset/index.js +0 -74
  161. package/dist/src/commands/reset/index.js.map +0 -1
  162. package/dist/src/commands/shell/index.d.ts +0 -6
  163. package/dist/src/commands/shell/index.d.ts.map +0 -1
  164. package/dist/src/commands/shell/index.js +0 -25
  165. package/dist/src/commands/shell/index.js.map +0 -1
  166. package/dist/src/commands/space/close.d.ts +0 -9
  167. package/dist/src/commands/space/close.d.ts.map +0 -1
  168. package/dist/src/commands/space/close.js +0 -17
  169. package/dist/src/commands/space/close.js.map +0 -1
  170. package/dist/src/commands/space/create.d.ts +0 -10
  171. package/dist/src/commands/space/create.d.ts.map +0 -1
  172. package/dist/src/commands/space/create.js +0 -25
  173. package/dist/src/commands/space/create.js.map +0 -1
  174. package/dist/src/commands/space/epoch.d.ts +0 -10
  175. package/dist/src/commands/space/epoch.d.ts.map +0 -1
  176. package/dist/src/commands/space/epoch.js +0 -18
  177. package/dist/src/commands/space/epoch.js.map +0 -1
  178. package/dist/src/commands/space/info.d.ts +0 -10
  179. package/dist/src/commands/space/info.d.ts.map +0 -1
  180. package/dist/src/commands/space/info.js +0 -26
  181. package/dist/src/commands/space/info.js.map +0 -1
  182. package/dist/src/commands/space/join.d.ts +0 -21
  183. package/dist/src/commands/space/join.d.ts.map +0 -1
  184. package/dist/src/commands/space/join.js +0 -71
  185. package/dist/src/commands/space/join.js.map +0 -1
  186. package/dist/src/commands/space/list.d.ts +0 -24
  187. package/dist/src/commands/space/list.d.ts.map +0 -1
  188. package/dist/src/commands/space/list.js +0 -90
  189. package/dist/src/commands/space/list.js.map +0 -1
  190. package/dist/src/commands/space/members.d.ts +0 -23
  191. package/dist/src/commands/space/members.d.ts.map +0 -1
  192. package/dist/src/commands/space/members.js +0 -27
  193. package/dist/src/commands/space/members.js.map +0 -1
  194. package/dist/src/commands/space/open.d.ts +0 -9
  195. package/dist/src/commands/space/open.d.ts.map +0 -1
  196. package/dist/src/commands/space/open.js +0 -17
  197. package/dist/src/commands/space/open.js.map +0 -1
  198. package/dist/src/commands/space/query.d.ts +0 -25
  199. package/dist/src/commands/space/query.d.ts.map +0 -1
  200. package/dist/src/commands/space/query.js +0 -44
  201. package/dist/src/commands/space/query.js.map +0 -1
  202. package/dist/src/commands/space/schema/list.d.ts +0 -21
  203. package/dist/src/commands/space/schema/list.d.ts.map +0 -1
  204. package/dist/src/commands/space/schema/list.js +0 -57
  205. package/dist/src/commands/space/schema/list.js.map +0 -1
  206. package/dist/src/commands/space/share.d.ts +0 -27
  207. package/dist/src/commands/space/share.d.ts.map +0 -1
  208. package/dist/src/commands/space/share.js +0 -80
  209. package/dist/src/commands/space/share.js.map +0 -1
  210. package/dist/src/commands/tunnel/index.d.ts +0 -22
  211. package/dist/src/commands/tunnel/index.d.ts.map +0 -1
  212. package/dist/src/commands/tunnel/index.js +0 -43
  213. package/dist/src/commands/tunnel/index.js.map +0 -1
  214. package/dist/src/commands/tunnel/list.d.ts +0 -21
  215. package/dist/src/commands/tunnel/list.d.ts.map +0 -1
  216. package/dist/src/commands/tunnel/list.js +0 -29
  217. package/dist/src/commands/tunnel/list.js.map +0 -1
  218. package/dist/src/components/App.d.ts +0 -10
  219. package/dist/src/components/App.d.ts.map +0 -1
  220. package/dist/src/components/App.js +0 -31
  221. package/dist/src/components/App.js.map +0 -1
  222. package/dist/src/components/SpaceTable.d.ts +0 -10
  223. package/dist/src/components/SpaceTable.d.ts.map +0 -1
  224. package/dist/src/components/SpaceTable.js +0 -33
  225. package/dist/src/components/SpaceTable.js.map +0 -1
  226. package/dist/src/components/SystemTable.d.ts +0 -8
  227. package/dist/src/components/SystemTable.d.ts.map +0 -1
  228. package/dist/src/components/SystemTable.js +0 -51
  229. package/dist/src/components/SystemTable.js.map +0 -1
  230. package/dist/src/components/index.d.ts +0 -4
  231. package/dist/src/components/index.d.ts.map +0 -1
  232. package/dist/src/components/index.js +0 -7
  233. package/dist/src/components/index.js.map +0 -1
  234. package/dist/src/help.d.ts +0 -6
  235. package/dist/src/help.d.ts.map +0 -1
  236. package/dist/src/help.js +0 -37
  237. package/dist/src/help.js.map +0 -1
  238. package/dist/src/hooks/command-not-found.d.ts +0 -4
  239. package/dist/src/hooks/command-not-found.d.ts.map +0 -1
  240. package/dist/src/hooks/command-not-found.js +0 -16
  241. package/dist/src/hooks/command-not-found.js.map +0 -1
  242. package/dist/src/index.d.ts +0 -3
  243. package/dist/src/index.d.ts.map +0 -1
  244. package/dist/src/index.js +0 -6
  245. package/dist/src/index.js.map +0 -1
  246. package/dist/src/util/function/bundle.d.ts +0 -5
  247. package/dist/src/util/function/bundle.d.ts.map +0 -1
  248. package/dist/src/util/function/bundle.js +0 -13
  249. package/dist/src/util/function/bundle.js.map +0 -1
  250. package/dist/src/util/function/index.d.ts +0 -3
  251. package/dist/src/util/function/index.d.ts.map +0 -1
  252. package/dist/src/util/function/index.js +0 -6
  253. package/dist/src/util/function/index.js.map +0 -1
  254. package/dist/src/util/function/lookup.d.ts +0 -18
  255. package/dist/src/util/function/lookup.d.ts.map +0 -1
  256. package/dist/src/util/function/lookup.js +0 -14
  257. package/dist/src/util/function/lookup.js.map +0 -1
  258. package/dist/src/util/index.d.ts +0 -6
  259. package/dist/src/util/index.d.ts.map +0 -1
  260. package/dist/src/util/index.js +0 -9
  261. package/dist/src/util/index.js.map +0 -1
  262. package/dist/src/util/provider/digital-ocean.d.ts +0 -14
  263. package/dist/src/util/provider/digital-ocean.d.ts.map +0 -1
  264. package/dist/src/util/provider/digital-ocean.js +0 -123
  265. package/dist/src/util/provider/digital-ocean.js.map +0 -1
  266. package/dist/src/util/provider/index.d.ts +0 -3
  267. package/dist/src/util/provider/index.d.ts.map +0 -1
  268. package/dist/src/util/provider/index.js +0 -6
  269. package/dist/src/util/provider/index.js.map +0 -1
  270. package/dist/src/util/provider/provider.d.ts +0 -27
  271. package/dist/src/util/provider/provider.d.ts.map +0 -1
  272. package/dist/src/util/provider/provider.js +0 -24
  273. package/dist/src/util/provider/provider.js.map +0 -1
  274. package/dist/src/util/publish/build.d.ts +0 -11
  275. package/dist/src/util/publish/build.d.ts.map +0 -1
  276. package/dist/src/util/publish/build.js +0 -24
  277. package/dist/src/util/publish/build.js.map +0 -1
  278. package/dist/src/util/publish/common.d.ts +0 -11
  279. package/dist/src/util/publish/common.d.ts.map +0 -1
  280. package/dist/src/util/publish/common.js +0 -23
  281. package/dist/src/util/publish/common.js.map +0 -1
  282. package/dist/src/util/publish/config.d.ts +0 -3
  283. package/dist/src/util/publish/config.d.ts.map +0 -1
  284. package/dist/src/util/publish/config.js +0 -27
  285. package/dist/src/util/publish/config.js.map +0 -1
  286. package/dist/src/util/publish/index.d.ts +0 -7
  287. package/dist/src/util/publish/index.d.ts.map +0 -1
  288. package/dist/src/util/publish/index.js +0 -10
  289. package/dist/src/util/publish/index.js.map +0 -1
  290. package/dist/src/util/publish/ipfs-upload.d.ts +0 -8
  291. package/dist/src/util/publish/ipfs-upload.d.ts.map +0 -1
  292. package/dist/src/util/publish/ipfs-upload.js +0 -50
  293. package/dist/src/util/publish/ipfs-upload.js.map +0 -1
  294. package/dist/src/util/publish/publish.d.ts +0 -14
  295. package/dist/src/util/publish/publish.d.ts.map +0 -1
  296. package/dist/src/util/publish/publish.js +0 -51
  297. package/dist/src/util/publish/publish.js.map +0 -1
  298. package/dist/src/util/publish/publisher-rpc-peer.d.ts +0 -15
  299. package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +0 -1
  300. package/dist/src/util/publish/publisher-rpc-peer.js +0 -82
  301. package/dist/src/util/publish/publisher-rpc-peer.js.map +0 -1
  302. package/dist/src/util/supervisor/index.d.ts +0 -2
  303. package/dist/src/util/supervisor/index.d.ts.map +0 -1
  304. package/dist/src/util/supervisor/index.js +0 -5
  305. package/dist/src/util/supervisor/index.js.map +0 -1
  306. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts +0 -15
  307. package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +0 -1
  308. package/dist/src/util/supervisor/supervisor-rpc-peer.js +0 -83
  309. package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +0 -1
  310. package/dist/src/util/tunnel/common.d.ts +0 -9
  311. package/dist/src/util/tunnel/common.d.ts.map +0 -1
  312. package/dist/src/util/tunnel/common.js +0 -26
  313. package/dist/src/util/tunnel/common.js.map +0 -1
  314. package/dist/src/util/tunnel/index.d.ts +0 -3
  315. package/dist/src/util/tunnel/index.d.ts.map +0 -1
  316. package/dist/src/util/tunnel/index.js +0 -6
  317. package/dist/src/util/tunnel/index.js.map +0 -1
  318. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts +0 -15
  319. package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +0 -1
  320. package/dist/src/util/tunnel/tunnel-rpc-peer.js +0 -83
  321. package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +0 -1
  322. package/dist/tsconfig.tsbuildinfo +0 -1
  323. package/oclif.manifest.json +0 -5824
@@ -1,33 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import Table from 'ink-table';
5
- import React, { useEffect, useState } from 'react';
6
- import { mapSpaces } from '@dxos/cli-base';
7
- /**
8
- * Spaces list table.
9
- */
10
- export const SpaceTable = ({ client, interval = 1000 }) => {
11
- const [data, setData] = useState([]);
12
- useEffect(() => {
13
- const timer = setInterval(() => handleRefresh(), Math.min(100, interval));
14
- return () => clearInterval(timer);
15
- }, [client, interval]);
16
- const handleRefresh = async () => {
17
- const spaces = client.spaces.get();
18
- const data = await mapSpaces(spaces, { truncateKeys: true });
19
- setData(data.map(({ key, state, name, members, objects, startup }) => ({
20
- key,
21
- state,
22
- name,
23
- members,
24
- objects,
25
- startup,
26
- })));
27
- };
28
- if (!data.length) {
29
- return null;
30
- }
31
- return React.createElement(Table, { data: data });
32
- };
33
- //# sourceMappingURL=SpaceTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpaceTable.js","sourceRoot":"","sources":["../../../src/components/SpaceTable.tsx"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,KAAK,MAAM,WAAW,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAA8C,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,EAAE,EAAE;IACnG,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAoB,EAAE,CAAC,CAAC;IACxD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC1E,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,OAAO,CACL,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7D,GAAG;YACH,KAAK;YACL,IAAI;YACJ,OAAO;YACP,OAAO;YACP,OAAO;SACR,CAAC,CAAC,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,oBAAC,KAAK,IAAC,IAAI,EAAE,IAAI,GAAI,CAAC;AAC/B,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { type FC } from 'react';
2
- /**
3
- * System info.
4
- */
5
- export declare const SystemTable: FC<{
6
- interval?: number;
7
- }>;
8
- //# sourceMappingURL=SystemTable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SystemTable.d.ts","sourceRoot":"","sources":["../../../src/components/SystemTable.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAqB5D;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAmDjD,CAAC"}
@@ -1,51 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import Table from 'ink-table';
5
- import React, { useEffect, useState } from 'react';
6
- /**
7
- * System info.
8
- */
9
- export const SystemTable = ({ interval = 1_000 }) => {
10
- const [data, setData] = useState([]);
11
- useEffect(() => {
12
- const timer = setInterval(() => handleRefresh(), Math.max(100, interval));
13
- return () => clearInterval(timer);
14
- }, [interval]);
15
- const size = (n, unit = 1_000, len = 10) => Math.round(n / unit)
16
- .toLocaleString()
17
- .padStart(len, ' ');
18
- const handleRefresh = () => {
19
- // TODO(burdon): https://www.npmjs.com/package/express-status-monitor
20
- // https://nodejs.org/api/process.html#process_process_memoryusage
21
- const { rss, heapTotal, heapUsed, external } = process.memoryUsage();
22
- // TODO(burdon): How to measure CPU usage while running status?
23
- // https://nodejs.org/api/process.html#processcpuusagepreviousvalue
24
- // last.current = process.cpuUsage(last.current);
25
- // const { user, system } = last.current;
26
- setData([
27
- {
28
- // arch: os.arch(),
29
- // version: process.version,
30
- // uptime: os.uptime().toLocaleString().padStart(10, ' '),
31
- rss: size(rss),
32
- heap_total: size(heapTotal),
33
- heap_used: size(heapUsed),
34
- external: size(external),
35
- // total: os.totalmem().toLocaleString().padStart(14, ' '),
36
- // free: os.freemem().toLocaleString().padStart(14, ' '),
37
- // loadavg: os
38
- // .loadavg()
39
- // .map((n) => n.toFixed(2))
40
- // .join('; '),
41
- // user: size(user),
42
- // system: size(system),
43
- },
44
- ]);
45
- };
46
- if (!data.length) {
47
- return null;
48
- }
49
- return React.createElement(Table, { data: data });
50
- };
51
- //# sourceMappingURL=SystemTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SystemTable.js","sourceRoot":"","sources":["../../../src/components/SystemTable.tsx"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,KAAK,MAAM,WAAW,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAW,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAqB5D;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA8B,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7E,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAU,EAAE,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAA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,0 @@
1
- export * from './App';
2
- export * from './SpaceTable';
3
- export * from './SystemTable';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- export * from './App';
5
- export * from './SpaceTable';
6
- export * from './SystemTable';
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Help } from '@oclif/core';
2
- export declare const BANNER: string;
3
- export default class CustomHelp extends Help {
4
- showHelp(args: string[]): Promise<void>;
5
- }
6
- //# sourceMappingURL=help.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,eAAO,MAAM,MAAM,QAK6D,CAAC;AAEjF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAyBvD"}
package/dist/src/help.js DELETED
@@ -1,37 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import { Help } from '@oclif/core';
5
- import chalk from 'chalk';
6
- import rev from 'git-rev-sync';
7
- // http://patorjk.com/software/taag/#p=testall&f=Patorjk-HeX&t=DXOS
8
- export const BANNER = '_/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\______/\\/\\/\\/\\/\\_\n' +
9
- '_/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__/\\/\\_________\n' +
10
- '_/\\/\\____/\\/\\______/\\/\\______/\\/\\____/\\/\\____/\\/\\/\\/\\___\n' +
11
- '_/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\____/\\/\\__________/\\/\\_\n' +
12
- '_/\\/\\/\\/\\/\\____/\\/\\____/\\/\\____/\\/\\/\\/\\____/\\/\\/\\/\\/\\___\n';
13
- export default class CustomHelp extends Help {
14
- async showHelp(args) {
15
- if (!args.length) {
16
- console.log(BANNER);
17
- }
18
- const warnings = [];
19
- if (process.env.NODE_ENV === 'development') {
20
- let branch = '';
21
- try {
22
- branch = `(${rev.branch()} #${rev.short()})`;
23
- }
24
- catch { }
25
- warnings.push(chalk `{blue NODE_ENV}: {red ${process.env.NODE_ENV}}${branch}`);
26
- }
27
- if (process.env.DX_PROFILE) {
28
- warnings.push(chalk `{blue DX_PROFILE}: {green ${process.env.DX_PROFILE}}`);
29
- }
30
- if (warnings.length) {
31
- this.log(warnings.join('\n'));
32
- this.log();
33
- }
34
- await super.showHelp(args);
35
- }
36
- }
37
- //# sourceMappingURL=help.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,cAAc,CAAC;AAE/B,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GACjB,8EAA8E;IAC9E,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAC1E,8EAA8E,CAAC;AAEjF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IACjC,KAAK,CAAC,QAAQ,CAAC,IAAc;QACpC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;QAED,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC;YAC/C,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAA,yBAAyB,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,MAAM,EAAE,CAAC,CAAC;QAChF,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAA,6BAA6B,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;QAED,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF"}
@@ -1,4 +0,0 @@
1
- import { type Hook } from '@oclif/core';
2
- declare const hook: Hook<'command_not_found'>;
3
- export default hook;
4
- //# sourceMappingURL=command-not-found.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-not-found.d.ts","sourceRoot":"","sources":["../../../src/hooks/command-not-found.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAMxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAMnC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,16 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
- import chalk from 'chalk';
5
- //
6
- // NOTE: May fail in dev mode due to build reason in packages depended upon by commands.
7
- //
8
- const hook = async (params) => {
9
- const { id } = params;
10
- console.log(chalk `{red Error}: Invalid command: ${id}`);
11
- if (process.env.NODE_ENV === 'development') {
12
- console.log(chalk `{yellow Hint}: Commands will fail silently if they fail to build (Run again with \`DEBUG=*\`).`);
13
- }
14
- };
15
- export default hook;
16
- //# sourceMappingURL=command-not-found.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-not-found.js","sourceRoot":"","sources":["../../../src/hooks/command-not-found.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAGF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,EAAE;AACF,wFAAwF;AACxF,EAAE;AACF,MAAM,IAAI,GAA8B,KAAK,EAAE,MAAM,EAAE,EAAE;IACvD,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,iCAAiC,EAAE,EAAE,CAAC,CAAC;IACxD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,gGAAgG,CAAC,CAAC;IACrH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,3 +0,0 @@
1
- export { run } from '@oclif/core';
2
- export * from './base';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,cAAc,QAAQ,CAAC"}
package/dist/src/index.js DELETED
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- export { run } from '@oclif/core';
5
- export * from './base';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,cAAc,QAAQ,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const bundleScript: (source: string) => Promise<{
2
- bundle?: string;
3
- error?: Error;
4
- }>;
5
- //# sourceMappingURL=bundle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../src/util/function/bundle.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAS7F,CAAC"}
@@ -1,13 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
- import { Bundler } from '@dxos/functions/bundler';
5
- export const bundleScript = async (source) => {
6
- const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
7
- const buildResult = await bundler.bundle({ source });
8
- if (buildResult.error || !buildResult.bundle) {
9
- return { error: buildResult.error || new Error('Bundle creation failed') };
10
- }
11
- return { bundle: buildResult.bundle };
12
- };
13
- //# sourceMappingURL=bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../../src/util/function/bundle.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AACF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAc,EAA+C,EAAE;IAChG,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3F,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAErD,IAAI,WAAW,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;AACxC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './bundle';
2
- export * from './lookup';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/function/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
- export * from './bundle';
5
- export * from './lookup';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/function/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -1,18 +0,0 @@
1
- import { type Space } from '@dxos/client/echo';
2
- export declare const findFunctionByDeploymentId: (space: Space, functionId?: string) => Promise<import("@dxos/live-object").Live<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
3
- version: string;
4
- name: string;
5
- description?: string | undefined;
6
- source?: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
7
- description?: string | undefined;
8
- source: import("@dxos/echo-schema").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
9
- content: string;
10
- }>;
11
- name?: string | undefined;
12
- changed?: boolean | undefined;
13
- }> | undefined;
14
- inputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
15
- outputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
16
- binding?: string | undefined;
17
- }> | undefined>;
18
- //# sourceMappingURL=lookup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../../../../src/util/function/lookup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,KAAK,EAAW,MAAM,mBAAmB,CAAC;AAGhE,eAAO,MAAM,0BAA0B,GAAU,OAAO,KAAK,EAAE,aAAa,MAAM;;;;;;;;;;;;;;;eAOjF,CAAC"}
@@ -1,14 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
- import { Filter, getMeta } from '@dxos/client/echo';
5
- import { FunctionType, getUserFunctionUrlInMetadata, makeFunctionUrl } from '@dxos/functions';
6
- export const findFunctionByDeploymentId = async (space, functionId) => {
7
- if (!functionId) {
8
- return undefined;
9
- }
10
- const invocationUrl = makeFunctionUrl({ functionId });
11
- const functions = await space.db.query(Filter.type(FunctionType)).run();
12
- return functions.objects.find((fn) => getUserFunctionUrlInMetadata(getMeta(fn)) === invocationUrl);
13
- };
14
- //# sourceMappingURL=lookup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lookup.js","sourceRoot":"","sources":["../../../../src/util/function/lookup.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,MAAM,EAAc,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9F,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,EAAE,KAAY,EAAE,UAAmB,EAAE,EAAE;IACpF,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,aAAa,GAAG,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACxE,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC;AACrG,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from './provider';
2
- export * from './publish';
3
- export * from './supervisor';
4
- export * from './tunnel';
5
- export * from './function';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- export * from './provider';
5
- export * from './publish';
6
- export * from './supervisor';
7
- export * from './tunnel';
8
- export * from './function';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/util/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { Config } from '@dxos/client';
2
- import { type KubeDeployOptions, type MachineryProvider } from './provider';
3
- export declare class DigitalOceanProvider implements MachineryProvider {
4
- private _session;
5
- constructor(config: Config);
6
- getDropletIdFromName(name: string): Promise<any>;
7
- getSshKeys(): Promise<any>;
8
- deploy(options: KubeDeployOptions): Promise<{
9
- hostname: any;
10
- createdAt: any;
11
- ipAddress: any;
12
- }>;
13
- }
14
- //# sourceMappingURL=digital-ocean.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"digital-ocean.d.ts","sourceRoot":"","sources":["../../../../src/util/provider/digital-ocean.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAY,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKtF,qBAAa,oBAAqB,YAAW,iBAAiB;IAC5D,OAAO,CAAC,QAAQ,CAAM;gBAEV,MAAM,EAAE,MAAM;IAOpB,oBAAoB,CAAC,IAAI,EAAE,MAAM;IAQjC,UAAU;IAKV,MAAM,CAAC,OAAO,EAAE,iBAAiB;;;;;CA0GxC"}
@@ -1,123 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import DigitalOcean from 'do-wrapper';
5
- import { waitForCondition } from '@dxos/async';
6
- import { invariant } from '@dxos/invariant';
7
- import { KUBE_TAG } from './provider';
8
- const DEFAULT_REGION = 'nyc3';
9
- const DEFAULT_MEMORY = 4;
10
- export class DigitalOceanProvider {
11
- _session;
12
- constructor(config) {
13
- const doAccessToken = config.get('runtime.services.machine.doAccessToken');
14
- invariant(doAccessToken, 'Invalid DigitalOcean Access Token.');
15
- this._session = new DigitalOcean(doAccessToken, 100);
16
- }
17
- async getDropletIdFromName(name) {
18
- invariant(name);
19
- const result = await this._session.droplets.getAll();
20
- const [targetDroplet] = result.droplets.filter((droplet) => droplet.name === name) || [];
21
- return targetDroplet ? targetDroplet.id : undefined;
22
- }
23
- async getSshKeys() {
24
- const result = await this._session.keys.getAll();
25
- return result.ssh_keys?.map((key) => key.fingerprint);
26
- }
27
- async deploy(options) {
28
- const { hostname: name, region = DEFAULT_REGION, memory = DEFAULT_MEMORY, dev, accessToken } = options;
29
- const dropletId = await this.getDropletIdFromName(name);
30
- if (dropletId) {
31
- throw new Error(`${name} already exists.`);
32
- }
33
- const channel = dev ? 'dev' : 'latest';
34
- const cloudConfigScript = `
35
- #cloud-config
36
-
37
- package_update: true
38
-
39
- package_upgrade: true
40
-
41
- packages:
42
- - python
43
- - build-essential
44
- - docker-ce
45
- - docker-ce-cli
46
-
47
- apt:
48
- sources:
49
- docker.list:
50
- source: deb [arch=amd64] https://download.docker.com/linux/ubuntu $RELEASE stable
51
- keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
52
- ` +
53
- (accessToken
54
- ? `
55
- write_files:
56
- - path: /root/.kube/acl/seed.yaml
57
- content: |
58
- - entity: "${accessToken}"
59
- capabilities:
60
- - 100
61
- subject: "*"
62
- `
63
- : '') +
64
- `
65
- runcmd:
66
- - curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
67
- - chmod +x /usr/local/bin/docker-compose
68
- - ch=${channel} bash -c "$(curl -fsSL https://dxos.nyc3.digitaloceanspaces.com/install.sh)"
69
- - kube start
70
- `;
71
- let sizeSlug = 's-2vcpu-4gb';
72
- switch (memory) {
73
- case 1:
74
- sizeSlug = 's-1vcpu-1gb';
75
- break;
76
- case 2:
77
- sizeSlug = 's-2vcpu-2gb';
78
- break;
79
- case 4:
80
- sizeSlug = 's-2vcpu-4gb';
81
- break;
82
- case 8:
83
- sizeSlug = 's-4vcpu-8gb';
84
- break;
85
- case 16:
86
- sizeSlug = 's-8vcpu-16gb';
87
- break;
88
- case 32:
89
- sizeSlug = 's-8vcpu-32gb';
90
- break;
91
- }
92
- const sshKeys = await this.getSshKeys();
93
- invariant(sshKeys.length, 'No SSH keys found.');
94
- const createParameters = {
95
- name,
96
- region,
97
- size: sizeSlug,
98
- image: 'ubuntu-22-10-x64',
99
- ssh_keys: sshKeys,
100
- user_data: cloudConfigScript,
101
- tags: [KUBE_TAG],
102
- };
103
- const result = await this._session.droplets.create(createParameters);
104
- const droplet = await waitForCondition({
105
- condition: async () => {
106
- const { droplet } = await this._session.droplets.getById(result.droplet.id);
107
- if (droplet?.networks.v4.find((net) => net.type === 'public').ip_address) {
108
- return droplet;
109
- }
110
- return undefined;
111
- },
112
- timeout: 0,
113
- interval: 1000,
114
- });
115
- const ipAddress = droplet.networks.v4.find((net) => net.type === 'public').ip_address;
116
- return {
117
- hostname: droplet.name,
118
- createdAt: droplet.created_at,
119
- ipAddress,
120
- };
121
- }
122
- }
123
- //# sourceMappingURL=digital-ocean.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"digital-ocean.js","sourceRoot":"","sources":["../../../../src/util/provider/digital-ocean.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,YAAY,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAkD,MAAM,YAAY,CAAC;AAEtF,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAM,OAAO,oBAAoB;IACvB,QAAQ,CAAM;IAEtB,YAAY,MAAc;QACxB,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;QAC3E,SAAS,CAAC,aAAa,EAAE,oCAAoC,CAAC,CAAC;QAE/D,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC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AC,CAAC,UAAU,EAAE,CAAC;oBAC9E,OAAO,OAAO,CAAC;gBACjB,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,UAAU,CAAC;QAE3F,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,SAAS,EAAE,OAAO,CAAC,UAAU;YAC7B,SAAS;SACV,CAAC;IACJ,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- export * from './digital-ocean';
2
- export * from './provider';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/provider/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- export * from './digital-ocean';
5
- export * from './provider';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/provider/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -1,27 +0,0 @@
1
- import { type TableFlags } from '@dxos/cli-base';
2
- export declare const KUBE_TAG = "kube";
3
- export declare const DEFAULT_PROVIDER = "digitalocean";
4
- export interface KubeDeployOptions {
5
- hostname: string;
6
- region?: string;
7
- memory?: number;
8
- dev: boolean;
9
- accessToken?: string;
10
- }
11
- export type KUBE = {
12
- hostname: string;
13
- createdAt: string;
14
- ipAddress: string;
15
- };
16
- export interface MachineryProvider {
17
- /**
18
- * Deploy KUBE to a Provider.
19
- */
20
- deploy(options: KubeDeployOptions): Promise<KUBE>;
21
- }
22
- export declare const mapKubes: (kubes: KUBE[]) => {
23
- key: string;
24
- ipAddress: string;
25
- }[];
26
- export declare const printKubes: (kubes: KUBE[], flags?: TableFlags) => void;
27
- //# sourceMappingURL=provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../src/util/provider/provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAS,MAAM,gBAAgB,CAAC;AAExD,eAAO,MAAM,QAAQ,SAAS,CAAC;AAE/B,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,IAAI,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,IAAI,EAAE;;;GAKrC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,IAAI,EAAE,EAAE,QAAO,UAAe,SAe/D,CAAC"}
@@ -1,24 +0,0 @@
1
- //
2
- // Copyright 2022 DXOS.org
3
- //
4
- import { ux } from '@oclif/core';
5
- import { table } from '@dxos/cli-base';
6
- export const KUBE_TAG = 'kube';
7
- export const DEFAULT_PROVIDER = 'digitalocean';
8
- export const mapKubes = (kubes) => {
9
- return kubes.map((kube) => ({
10
- key: kube.hostname,
11
- ipAddress: kube.ipAddress,
12
- }));
13
- };
14
- export const printKubes = (kubes, flags = {}) => {
15
- ux.stdout(table(mapKubes(kubes), {
16
- key: {
17
- header: 'hostname',
18
- },
19
- ipAddress: {
20
- header: 'ip address',
21
- },
22
- }, flags));
23
- };
24
- //# sourceMappingURL=provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../../../../src/util/provider/provider.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAmB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAuB/C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;IACxC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1B,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,QAAoB,EAAE,EAAE,EAAE;IAClE,EAAE,CAAC,MAAM,CACP,KAAK,CACH,QAAQ,CAAC,KAAK,CAAC,EACf;QACE,GAAG,EAAE;YACH,MAAM,EAAE,UAAU;SACnB;QACD,SAAS,EAAE;YACT,MAAM,EAAE,YAAY;SACrB;KACF,EACD,KAAK,CACN,CACF,CAAC;AACJ,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Logger, PackageModule } from './common';
2
- export interface BuildParams {
3
- log: Logger;
4
- module: PackageModule;
5
- }
6
- interface BuildArgs {
7
- verbose?: boolean;
8
- }
9
- export declare const build: ({ verbose }: BuildArgs, { log, module }: BuildParams) => void;
10
- export {};
11
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/build.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,SAAS;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,KAAK,GAAI,aAAa,SAAS,EAAE,iBAAiB,WAAW,SAyBzE,CAAC"}