@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.
- package/LICENSE +3 -3
- package/bin/dx.js +29 -12
- package/package.json +14 -129
- package/README.md +0 -145
- package/bin/agent_entrypoint +0 -22
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -26
- package/bin/handle_invitation +0 -18
- package/bin/run.cmd +0 -3
- package/dist/src/base.d.ts +0 -18
- package/dist/src/base.d.ts.map +0 -1
- package/dist/src/base.js +0 -76
- package/dist/src/base.js.map +0 -1
- package/dist/src/commands/agent/agent.node.test.d.ts +0 -2
- package/dist/src/commands/agent/agent.node.test.d.ts.map +0 -1
- package/dist/src/commands/agent/agent.node.test.js +0 -178
- package/dist/src/commands/agent/agent.node.test.js.map +0 -1
- package/dist/src/commands/agent/invitations.d.ts +0 -20
- package/dist/src/commands/agent/invitations.d.ts.map +0 -1
- package/dist/src/commands/agent/invitations.js +0 -88
- package/dist/src/commands/agent/invitations.js.map +0 -1
- package/dist/src/commands/agent/list.d.ts +0 -22
- package/dist/src/commands/agent/list.d.ts.map +0 -1
- package/dist/src/commands/agent/list.js +0 -45
- package/dist/src/commands/agent/list.js.map +0 -1
- package/dist/src/commands/agent/restart.d.ts +0 -21
- package/dist/src/commands/agent/restart.d.ts.map +0 -1
- package/dist/src/commands/agent/restart.js +0 -26
- package/dist/src/commands/agent/restart.js.map +0 -1
- package/dist/src/commands/agent/start.d.ts +0 -33
- package/dist/src/commands/agent/start.d.ts.map +0 -1
- package/dist/src/commands/agent/start.js +0 -204
- package/dist/src/commands/agent/start.js.map +0 -1
- package/dist/src/commands/agent/status.d.ts +0 -19
- package/dist/src/commands/agent/status.d.ts.map +0 -1
- package/dist/src/commands/agent/status.js +0 -30
- package/dist/src/commands/agent/status.js.map +0 -1
- package/dist/src/commands/agent/stop.d.ts +0 -22
- package/dist/src/commands/agent/stop.d.ts.map +0 -1
- package/dist/src/commands/agent/stop.js +0 -49
- package/dist/src/commands/agent/stop.js.map +0 -1
- package/dist/src/commands/config/index.d.ts +0 -7
- package/dist/src/commands/config/index.d.ts.map +0 -1
- package/dist/src/commands/config/index.js +0 -16
- package/dist/src/commands/config/index.js.map +0 -1
- package/dist/src/commands/config/index.node.test.d.ts +0 -2
- package/dist/src/commands/config/index.node.test.d.ts.map +0 -1
- package/dist/src/commands/config/index.node.test.js +0 -25
- package/dist/src/commands/config/index.node.test.js.map +0 -1
- package/dist/src/commands/debug/diagnostics.d.ts +0 -25
- package/dist/src/commands/debug/diagnostics.d.ts.map +0 -1
- package/dist/src/commands/debug/diagnostics.js +0 -53
- package/dist/src/commands/debug/diagnostics.js.map +0 -1
- package/dist/src/commands/debug/error.d.ts +0 -6
- package/dist/src/commands/debug/error.d.ts.map +0 -1
- package/dist/src/commands/debug/error.js +0 -23
- package/dist/src/commands/debug/error.js.map +0 -1
- package/dist/src/commands/debug/generate.d.ts +0 -27
- package/dist/src/commands/debug/generate.d.ts.map +0 -1
- package/dist/src/commands/debug/generate.js +0 -71
- package/dist/src/commands/debug/generate.js.map +0 -1
- package/dist/src/commands/debug/metrics.d.ts +0 -10
- package/dist/src/commands/debug/metrics.d.ts.map +0 -1
- package/dist/src/commands/debug/metrics.js +0 -39
- package/dist/src/commands/debug/metrics.js.map +0 -1
- package/dist/src/commands/debug/status.d.ts +0 -20
- package/dist/src/commands/debug/status.d.ts.map +0 -1
- package/dist/src/commands/debug/status.js +0 -28
- package/dist/src/commands/debug/status.js.map +0 -1
- package/dist/src/commands/device/info.d.ts +0 -7
- package/dist/src/commands/device/info.d.ts.map +0 -1
- package/dist/src/commands/device/info.js +0 -30
- package/dist/src/commands/device/info.js.map +0 -1
- package/dist/src/commands/device/list.d.ts +0 -20
- package/dist/src/commands/device/list.d.ts.map +0 -1
- package/dist/src/commands/device/list.js +0 -23
- package/dist/src/commands/device/list.js.map +0 -1
- package/dist/src/commands/device/update.d.ts +0 -19
- package/dist/src/commands/device/update.d.ts.map +0 -1
- package/dist/src/commands/device/update.js +0 -32
- package/dist/src/commands/device/update.js.map +0 -1
- package/dist/src/commands/edge/status.d.ts +0 -19
- package/dist/src/commands/edge/status.d.ts.map +0 -1
- package/dist/src/commands/edge/status.js +0 -24
- package/dist/src/commands/edge/status.js.map +0 -1
- package/dist/src/commands/function/list.d.ts +0 -7
- package/dist/src/commands/function/list.d.ts.map +0 -1
- package/dist/src/commands/function/list.js +0 -19
- package/dist/src/commands/function/list.js.map +0 -1
- package/dist/src/commands/function/logs.d.ts +0 -14
- package/dist/src/commands/function/logs.d.ts.map +0 -1
- package/dist/src/commands/function/logs.js +0 -38
- package/dist/src/commands/function/logs.js.map +0 -1
- package/dist/src/commands/function/trigger/list.d.ts +0 -26
- package/dist/src/commands/function/trigger/list.d.ts.map +0 -1
- package/dist/src/commands/function/trigger/list.js +0 -51
- package/dist/src/commands/function/trigger/list.js.map +0 -1
- package/dist/src/commands/function/upload.d.ts +0 -34
- package/dist/src/commands/function/upload.d.ts.map +0 -1
- package/dist/src/commands/function/upload.js +0 -148
- package/dist/src/commands/function/upload.js.map +0 -1
- package/dist/src/commands/function/watch.d.ts +0 -29
- package/dist/src/commands/function/watch.d.ts.map +0 -1
- package/dist/src/commands/function/watch.js +0 -127
- package/dist/src/commands/function/watch.js.map +0 -1
- package/dist/src/commands/halo/create.d.ts +0 -24
- package/dist/src/commands/halo/create.d.ts.map +0 -1
- package/dist/src/commands/halo/create.js +0 -36
- package/dist/src/commands/halo/create.js.map +0 -1
- package/dist/src/commands/halo/credential/add.d.ts +0 -9
- package/dist/src/commands/halo/credential/add.d.ts.map +0 -1
- package/dist/src/commands/halo/credential/add.js +0 -42
- package/dist/src/commands/halo/credential/add.js.map +0 -1
- package/dist/src/commands/halo/credential/list.d.ts +0 -23
- package/dist/src/commands/halo/credential/list.d.ts.map +0 -1
- package/dist/src/commands/halo/credential/list.js +0 -62
- package/dist/src/commands/halo/credential/list.js.map +0 -1
- package/dist/src/commands/halo/identity.d.ts +0 -8
- package/dist/src/commands/halo/identity.d.ts.map +0 -1
- package/dist/src/commands/halo/identity.js +0 -31
- package/dist/src/commands/halo/identity.js.map +0 -1
- package/dist/src/commands/halo/join.d.ts +0 -23
- package/dist/src/commands/halo/join.d.ts.map +0 -1
- package/dist/src/commands/halo/join.js +0 -94
- package/dist/src/commands/halo/join.js.map +0 -1
- package/dist/src/commands/halo/keys.d.ts +0 -7
- package/dist/src/commands/halo/keys.d.ts.map +0 -1
- package/dist/src/commands/halo/keys.js +0 -14
- package/dist/src/commands/halo/keys.js.map +0 -1
- package/dist/src/commands/halo/recovery/generate.d.ts +0 -7
- package/dist/src/commands/halo/recovery/generate.d.ts.map +0 -1
- package/dist/src/commands/halo/recovery/generate.js +0 -16
- package/dist/src/commands/halo/recovery/generate.js.map +0 -1
- package/dist/src/commands/halo/recovery/use.d.ts +0 -20
- package/dist/src/commands/halo/recovery/use.d.ts.map +0 -1
- package/dist/src/commands/halo/recovery/use.js +0 -21
- package/dist/src/commands/halo/recovery/use.js.map +0 -1
- package/dist/src/commands/halo/share.d.ts +0 -24
- package/dist/src/commands/halo/share.d.ts.map +0 -1
- package/dist/src/commands/halo/share.js +0 -73
- package/dist/src/commands/halo/share.js.map +0 -1
- package/dist/src/commands/halo/update.d.ts +0 -19
- package/dist/src/commands/halo/update.d.ts.map +0 -1
- package/dist/src/commands/halo/update.js +0 -34
- package/dist/src/commands/halo/update.js.map +0 -1
- package/dist/src/commands/info.d.ts +0 -19
- package/dist/src/commands/info.d.ts.map +0 -1
- package/dist/src/commands/info.js +0 -23
- package/dist/src/commands/info.js.map +0 -1
- package/dist/src/commands/profile/import.d.ts +0 -20
- package/dist/src/commands/profile/import.d.ts.map +0 -1
- package/dist/src/commands/profile/import.js +0 -66
- package/dist/src/commands/profile/import.js.map +0 -1
- package/dist/src/commands/profile/inspect.d.ts +0 -20
- package/dist/src/commands/profile/inspect.d.ts.map +0 -1
- package/dist/src/commands/profile/inspect.js +0 -37
- package/dist/src/commands/profile/inspect.js.map +0 -1
- package/dist/src/commands/reset/index.d.ts +0 -20
- package/dist/src/commands/reset/index.d.ts.map +0 -1
- package/dist/src/commands/reset/index.js +0 -74
- package/dist/src/commands/reset/index.js.map +0 -1
- package/dist/src/commands/shell/index.d.ts +0 -6
- package/dist/src/commands/shell/index.d.ts.map +0 -1
- package/dist/src/commands/shell/index.js +0 -25
- package/dist/src/commands/shell/index.js.map +0 -1
- package/dist/src/commands/space/close.d.ts +0 -9
- package/dist/src/commands/space/close.d.ts.map +0 -1
- package/dist/src/commands/space/close.js +0 -17
- package/dist/src/commands/space/close.js.map +0 -1
- package/dist/src/commands/space/create.d.ts +0 -10
- package/dist/src/commands/space/create.d.ts.map +0 -1
- package/dist/src/commands/space/create.js +0 -25
- package/dist/src/commands/space/create.js.map +0 -1
- package/dist/src/commands/space/epoch.d.ts +0 -10
- package/dist/src/commands/space/epoch.d.ts.map +0 -1
- package/dist/src/commands/space/epoch.js +0 -18
- package/dist/src/commands/space/epoch.js.map +0 -1
- package/dist/src/commands/space/info.d.ts +0 -10
- package/dist/src/commands/space/info.d.ts.map +0 -1
- package/dist/src/commands/space/info.js +0 -26
- package/dist/src/commands/space/info.js.map +0 -1
- package/dist/src/commands/space/join.d.ts +0 -21
- package/dist/src/commands/space/join.d.ts.map +0 -1
- package/dist/src/commands/space/join.js +0 -71
- package/dist/src/commands/space/join.js.map +0 -1
- package/dist/src/commands/space/list.d.ts +0 -24
- package/dist/src/commands/space/list.d.ts.map +0 -1
- package/dist/src/commands/space/list.js +0 -90
- package/dist/src/commands/space/list.js.map +0 -1
- package/dist/src/commands/space/members.d.ts +0 -23
- package/dist/src/commands/space/members.d.ts.map +0 -1
- package/dist/src/commands/space/members.js +0 -27
- package/dist/src/commands/space/members.js.map +0 -1
- package/dist/src/commands/space/open.d.ts +0 -9
- package/dist/src/commands/space/open.d.ts.map +0 -1
- package/dist/src/commands/space/open.js +0 -17
- package/dist/src/commands/space/open.js.map +0 -1
- package/dist/src/commands/space/query.d.ts +0 -25
- package/dist/src/commands/space/query.d.ts.map +0 -1
- package/dist/src/commands/space/query.js +0 -44
- package/dist/src/commands/space/query.js.map +0 -1
- package/dist/src/commands/space/schema/list.d.ts +0 -21
- package/dist/src/commands/space/schema/list.d.ts.map +0 -1
- package/dist/src/commands/space/schema/list.js +0 -57
- package/dist/src/commands/space/schema/list.js.map +0 -1
- package/dist/src/commands/space/share.d.ts +0 -27
- package/dist/src/commands/space/share.d.ts.map +0 -1
- package/dist/src/commands/space/share.js +0 -80
- package/dist/src/commands/space/share.js.map +0 -1
- package/dist/src/commands/tunnel/index.d.ts +0 -22
- package/dist/src/commands/tunnel/index.d.ts.map +0 -1
- package/dist/src/commands/tunnel/index.js +0 -43
- package/dist/src/commands/tunnel/index.js.map +0 -1
- package/dist/src/commands/tunnel/list.d.ts +0 -21
- package/dist/src/commands/tunnel/list.d.ts.map +0 -1
- package/dist/src/commands/tunnel/list.js +0 -29
- package/dist/src/commands/tunnel/list.js.map +0 -1
- package/dist/src/components/App.d.ts +0 -10
- package/dist/src/components/App.d.ts.map +0 -1
- package/dist/src/components/App.js +0 -31
- package/dist/src/components/App.js.map +0 -1
- package/dist/src/components/SpaceTable.d.ts +0 -10
- package/dist/src/components/SpaceTable.d.ts.map +0 -1
- package/dist/src/components/SpaceTable.js +0 -33
- package/dist/src/components/SpaceTable.js.map +0 -1
- package/dist/src/components/SystemTable.d.ts +0 -8
- package/dist/src/components/SystemTable.d.ts.map +0 -1
- package/dist/src/components/SystemTable.js +0 -51
- package/dist/src/components/SystemTable.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -4
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -7
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/help.d.ts +0 -6
- package/dist/src/help.d.ts.map +0 -1
- package/dist/src/help.js +0 -37
- package/dist/src/help.js.map +0 -1
- package/dist/src/hooks/command-not-found.d.ts +0 -4
- package/dist/src/hooks/command-not-found.d.ts.map +0 -1
- package/dist/src/hooks/command-not-found.js +0 -16
- package/dist/src/hooks/command-not-found.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -6
- package/dist/src/index.js.map +0 -1
- package/dist/src/util/function/bundle.d.ts +0 -5
- package/dist/src/util/function/bundle.d.ts.map +0 -1
- package/dist/src/util/function/bundle.js +0 -13
- package/dist/src/util/function/bundle.js.map +0 -1
- package/dist/src/util/function/index.d.ts +0 -3
- package/dist/src/util/function/index.d.ts.map +0 -1
- package/dist/src/util/function/index.js +0 -6
- package/dist/src/util/function/index.js.map +0 -1
- package/dist/src/util/function/lookup.d.ts +0 -18
- package/dist/src/util/function/lookup.d.ts.map +0 -1
- package/dist/src/util/function/lookup.js +0 -14
- package/dist/src/util/function/lookup.js.map +0 -1
- package/dist/src/util/index.d.ts +0 -6
- package/dist/src/util/index.d.ts.map +0 -1
- package/dist/src/util/index.js +0 -9
- package/dist/src/util/index.js.map +0 -1
- package/dist/src/util/provider/digital-ocean.d.ts +0 -14
- package/dist/src/util/provider/digital-ocean.d.ts.map +0 -1
- package/dist/src/util/provider/digital-ocean.js +0 -123
- package/dist/src/util/provider/digital-ocean.js.map +0 -1
- package/dist/src/util/provider/index.d.ts +0 -3
- package/dist/src/util/provider/index.d.ts.map +0 -1
- package/dist/src/util/provider/index.js +0 -6
- package/dist/src/util/provider/index.js.map +0 -1
- package/dist/src/util/provider/provider.d.ts +0 -27
- package/dist/src/util/provider/provider.d.ts.map +0 -1
- package/dist/src/util/provider/provider.js +0 -24
- package/dist/src/util/provider/provider.js.map +0 -1
- package/dist/src/util/publish/build.d.ts +0 -11
- package/dist/src/util/publish/build.d.ts.map +0 -1
- package/dist/src/util/publish/build.js +0 -24
- package/dist/src/util/publish/build.js.map +0 -1
- package/dist/src/util/publish/common.d.ts +0 -11
- package/dist/src/util/publish/common.d.ts.map +0 -1
- package/dist/src/util/publish/common.js +0 -23
- package/dist/src/util/publish/common.js.map +0 -1
- package/dist/src/util/publish/config.d.ts +0 -3
- package/dist/src/util/publish/config.d.ts.map +0 -1
- package/dist/src/util/publish/config.js +0 -27
- package/dist/src/util/publish/config.js.map +0 -1
- package/dist/src/util/publish/index.d.ts +0 -7
- package/dist/src/util/publish/index.d.ts.map +0 -1
- package/dist/src/util/publish/index.js +0 -10
- package/dist/src/util/publish/index.js.map +0 -1
- package/dist/src/util/publish/ipfs-upload.d.ts +0 -8
- package/dist/src/util/publish/ipfs-upload.d.ts.map +0 -1
- package/dist/src/util/publish/ipfs-upload.js +0 -50
- package/dist/src/util/publish/ipfs-upload.js.map +0 -1
- package/dist/src/util/publish/publish.d.ts +0 -14
- package/dist/src/util/publish/publish.d.ts.map +0 -1
- package/dist/src/util/publish/publish.js +0 -51
- package/dist/src/util/publish/publish.js.map +0 -1
- package/dist/src/util/publish/publisher-rpc-peer.d.ts +0 -15
- package/dist/src/util/publish/publisher-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/publish/publisher-rpc-peer.js +0 -82
- package/dist/src/util/publish/publisher-rpc-peer.js.map +0 -1
- package/dist/src/util/supervisor/index.d.ts +0 -2
- package/dist/src/util/supervisor/index.d.ts.map +0 -1
- package/dist/src/util/supervisor/index.js +0 -5
- package/dist/src/util/supervisor/index.js.map +0 -1
- package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts +0 -15
- package/dist/src/util/supervisor/supervisor-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/supervisor/supervisor-rpc-peer.js +0 -83
- package/dist/src/util/supervisor/supervisor-rpc-peer.js.map +0 -1
- package/dist/src/util/tunnel/common.d.ts +0 -9
- package/dist/src/util/tunnel/common.d.ts.map +0 -1
- package/dist/src/util/tunnel/common.js +0 -26
- package/dist/src/util/tunnel/common.js.map +0 -1
- package/dist/src/util/tunnel/index.d.ts +0 -3
- package/dist/src/util/tunnel/index.d.ts.map +0 -1
- package/dist/src/util/tunnel/index.js +0 -6
- package/dist/src/util/tunnel/index.js.map +0 -1
- package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts +0 -15
- package/dist/src/util/tunnel/tunnel-rpc-peer.d.ts.map +0 -1
- package/dist/src/util/tunnel/tunnel-rpc-peer.js +0 -83
- package/dist/src/util/tunnel/tunnel-rpc-peer.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/oclif.manifest.json +0 -5824
package/LICENSE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
Copyright (c)
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2025 DXOS
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
5
|
|
|
6
6
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
7
|
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/bin/dx.js
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Copyright 2024 DXOS.org
|
|
6
|
-
//
|
|
3
|
+
const { execFileSync } = require('child_process');
|
|
4
|
+
const { join } = require('path');
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const PLATFORMS = {
|
|
7
|
+
'darwin-arm64': '@dxos/cli-darwin-arm64',
|
|
8
|
+
'darwin-x64': '@dxos/cli-darwin-x64',
|
|
9
|
+
'linux-arm64': '@dxos/cli-linux-arm64',
|
|
10
|
+
'linux-x64': '@dxos/cli-linux-x64',
|
|
11
|
+
'win32-x64': '@dxos/cli-win32-x64',
|
|
12
|
+
};
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
const key = `${process.platform}-${process.arch}`;
|
|
15
|
+
const pkg = PLATFORMS[key];
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
if (!pkg) {
|
|
18
|
+
console.error(`Unsupported platform: ${key}`);
|
|
19
|
+
console.error('Supported platforms:', Object.keys(PLATFORMS).join(', '));
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
try {
|
|
24
|
+
const binary = process.platform === 'win32' ? 'dx.exe' : 'dx';
|
|
25
|
+
const binPath = join(require.resolve(pkg), '..', binary);
|
|
26
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
27
|
+
} catch (error) {
|
|
28
|
+
if (error.code === 'MODULE_NOT_FOUND') {
|
|
29
|
+
console.error(`Platform-specific package not found: ${pkg}`);
|
|
30
|
+
console.error('Please reinstall @dxos/cli to get the correct platform binary.');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
package/package.json
CHANGED
|
@@ -1,146 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/cli",
|
|
3
|
-
"version": "0.8.4-
|
|
3
|
+
"version": "0.8.4-staging.ac66bdf99f",
|
|
4
4
|
"description": "DXOS CLI",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"dxos",
|
|
7
|
-
"cli",
|
|
8
|
-
"oclif"
|
|
9
|
-
],
|
|
10
5
|
"homepage": "https://dxos.org",
|
|
11
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
12
11
|
"license": "MIT",
|
|
13
12
|
"author": "info@dxos.org",
|
|
14
|
-
"
|
|
15
|
-
"type": "module",
|
|
16
|
-
"main": "dist/src/index.js",
|
|
17
|
-
"types": "dist/src/index.d.ts",
|
|
13
|
+
"type": "commonjs",
|
|
18
14
|
"bin": {
|
|
19
15
|
"dx": "./bin/dx.js"
|
|
20
16
|
},
|
|
21
17
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"/dist",
|
|
25
|
-
"/oclif.manifest.json"
|
|
18
|
+
"bin",
|
|
19
|
+
"LICENSE"
|
|
26
20
|
],
|
|
27
|
-
"
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@octokit/core": "^4.0.4",
|
|
34
|
-
"chalk": "^4.1.0",
|
|
35
|
-
"cli-progress": "^3.11.2",
|
|
36
|
-
"date-fns": "^3.3.1",
|
|
37
|
-
"do-wrapper": "^4.5.1",
|
|
38
|
-
"extensionless": "^1.9.9",
|
|
39
|
-
"fs-extra": "^8.1.0",
|
|
40
|
-
"get-folder-size": "^2.0.1",
|
|
41
|
-
"git-rev-sync": "^3.0.2",
|
|
42
|
-
"ink": "^3.2.0",
|
|
43
|
-
"ink-table": "~3.0.0",
|
|
44
|
-
"inquirer": "^12.0.0",
|
|
45
|
-
"isomorphic-ws": "^5.0.0",
|
|
46
|
-
"js-yaml": "^4.1.0",
|
|
47
|
-
"kubo-rpc-client": "^4.1.1",
|
|
48
|
-
"lodash.defaultsdeep": "^4.6.1",
|
|
49
|
-
"node-clipboardy": "^1.0.3",
|
|
50
|
-
"node-fetch": "^2.6.0",
|
|
51
|
-
"pkg-up": "^3.1.0",
|
|
52
|
-
"platform": "^1.3.6",
|
|
53
|
-
"react": "~18.2.0",
|
|
54
|
-
"ws": "^8.14.2",
|
|
55
|
-
"wtfnode": "^0.9.1",
|
|
56
|
-
"@dxos/agent": "0.8.4-main.fd6878d",
|
|
57
|
-
"@dxos/async": "0.8.4-main.fd6878d",
|
|
58
|
-
"@dxos/cli-base": "0.8.4-main.fd6878d",
|
|
59
|
-
"@dxos/cli-composer": "0.8.4-main.fd6878d",
|
|
60
|
-
"@dxos/client": "0.8.4-main.fd6878d",
|
|
61
|
-
"@dxos/client-protocol": "0.8.4-main.fd6878d",
|
|
62
|
-
"@dxos/compute": "0.8.4-main.fd6878d",
|
|
63
|
-
"@dxos/config": "0.8.4-main.fd6878d",
|
|
64
|
-
"@dxos/client-services": "0.8.4-main.fd6878d",
|
|
65
|
-
"@dxos/context": "0.8.4-main.fd6878d",
|
|
66
|
-
"@dxos/debug": "0.8.4-main.fd6878d",
|
|
67
|
-
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
68
|
-
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
69
|
-
"@dxos/functions": "0.8.4-main.fd6878d",
|
|
70
|
-
"@dxos/network-manager": "0.8.4-main.fd6878d",
|
|
71
|
-
"@dxos/node-std": "0.8.4-main.fd6878d",
|
|
72
|
-
"@dxos/process": "0.8.4-main.fd6878d",
|
|
73
|
-
"@dxos/observability": "0.8.4-main.fd6878d",
|
|
74
|
-
"@dxos/log": "0.8.4-main.fd6878d",
|
|
75
|
-
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
76
|
-
"@dxos/protocols": "0.8.4-main.fd6878d",
|
|
77
|
-
"@dxos/rpc": "0.8.4-main.fd6878d",
|
|
78
|
-
"@dxos/schema": "0.8.4-main.fd6878d",
|
|
79
|
-
"@dxos/random": "0.8.4-main.fd6878d",
|
|
80
|
-
"@dxos/util": "0.8.4-main.fd6878d"
|
|
81
|
-
},
|
|
82
|
-
"devDependencies": {
|
|
83
|
-
"@oclif/test": "^4.1.0",
|
|
84
|
-
"@types/cli-progress": "^3.11.0",
|
|
85
|
-
"@types/fs-extra": "^9.0.4",
|
|
86
|
-
"@types/js-yaml": "^4.0.5",
|
|
87
|
-
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
88
|
-
"@types/node-fetch": "^2.5.10",
|
|
89
|
-
"@types/platform": "^1.3.4",
|
|
90
|
-
"@types/react-dom": "~18.2.0",
|
|
91
|
-
"oclif": "^4.15.12",
|
|
92
|
-
"shx": "^0.3.3",
|
|
93
|
-
"undici": "*"
|
|
94
|
-
},
|
|
95
|
-
"peerDependencies": {
|
|
96
|
-
"undici": "*"
|
|
97
|
-
},
|
|
98
|
-
"engines": {
|
|
99
|
-
"node": ">=18.0.0"
|
|
21
|
+
"optionalDependencies": {
|
|
22
|
+
"@dxos/cli-darwin-arm64": "0.8.4-staging.ac66bdf99f",
|
|
23
|
+
"@dxos/cli-darwin-x64": "0.8.4-staging.ac66bdf99f",
|
|
24
|
+
"@dxos/cli-linux-arm64": "0.8.4-staging.ac66bdf99f",
|
|
25
|
+
"@dxos/cli-linux-x64": "0.8.4-staging.ac66bdf99f",
|
|
26
|
+
"@dxos/cli-win32-x64": "0.8.4-staging.ac66bdf99f"
|
|
100
27
|
},
|
|
101
28
|
"publishConfig": {
|
|
102
29
|
"access": "public"
|
|
103
|
-
},
|
|
104
|
-
"oclif": {
|
|
105
|
-
"bin": "dx",
|
|
106
|
-
"dirname": "dx",
|
|
107
|
-
"commands": "./dist/src/commands",
|
|
108
|
-
"hooks": {
|
|
109
|
-
"command_not_found": "./dist/src/hooks/command-not-found"
|
|
110
|
-
},
|
|
111
|
-
"plugins": [
|
|
112
|
-
"@dxos/cli-composer",
|
|
113
|
-
"@oclif/plugin-autocomplete",
|
|
114
|
-
"@oclif/plugin-help",
|
|
115
|
-
"@oclif/plugin-plugins",
|
|
116
|
-
"@oclif/plugin-update"
|
|
117
|
-
],
|
|
118
|
-
"helpClass": "./dist/src/help",
|
|
119
|
-
"topicSeparator": " ",
|
|
120
|
-
"topics": {
|
|
121
|
-
"agent": {
|
|
122
|
-
"description": "Manage agents."
|
|
123
|
-
},
|
|
124
|
-
"debug": {
|
|
125
|
-
"description": "Debugging tools and diagnostics."
|
|
126
|
-
},
|
|
127
|
-
"device": {
|
|
128
|
-
"description": "Manage HALO devices."
|
|
129
|
-
},
|
|
130
|
-
"function": {
|
|
131
|
-
"description": "Manage distributed functions and triggers."
|
|
132
|
-
},
|
|
133
|
-
"halo": {
|
|
134
|
-
"description": "Manage HALO identity and devices."
|
|
135
|
-
},
|
|
136
|
-
"space": {
|
|
137
|
-
"description": "Manage ECHO Spaces."
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
"scripts": {
|
|
142
|
-
"bin": "./bin/dx.js",
|
|
143
|
-
"manifest": "NODE_OPTIONS='--import=extensionless/register' oclif manifest",
|
|
144
|
-
"readme": "oclif readme --multi"
|
|
145
30
|
}
|
|
146
31
|
}
|
package/README.md
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# DX CLI
|
|
2
|
-
|
|
3
|
-
DXOS command line interface.
|
|
4
|
-
|
|
5
|
-
<!-- toc -->
|
|
6
|
-
* [DX CLI](#dx-cli)
|
|
7
|
-
* [Installation](#installation)
|
|
8
|
-
* [Agent](#agent)
|
|
9
|
-
* [Development](#development)
|
|
10
|
-
<!-- tocstop -->
|
|
11
|
-
|
|
12
|
-
# Installation
|
|
13
|
-
```terminal
|
|
14
|
-
npm install -g @dxos/cli@main
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
# Agent
|
|
18
|
-
See main docs at [Agents](https://docs.dxos.org/guide/cli/agent.html)
|
|
19
|
-
|
|
20
|
-
## Running an agent as a system service
|
|
21
|
-
### Start an agent as a system daemon via CLI command
|
|
22
|
-
|
|
23
|
-
Agent could be started as a system daemon via cli command:
|
|
24
|
-
|
|
25
|
-
```terminal
|
|
26
|
-
dx agent start --system
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This command will run an agent as `launchd` service (macOS users) or as a `systemd` service (Linux users).
|
|
30
|
-
|
|
31
|
-
Other useful commands:
|
|
32
|
-
|
|
33
|
-
```terminal
|
|
34
|
-
dx agent list --system
|
|
35
|
-
dx agent restart --system
|
|
36
|
-
dx agent stop --system
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Alternatively, manual setup could be used (see below).
|
|
40
|
-
|
|
41
|
-
### Install agent as a `launchd` service (macOS users) - manual setup
|
|
42
|
-
1. Install DXOS CLI with steps in [Installation](#Installation) section.
|
|
43
|
-
2. Replace `??NODE_PATH??` in "./init-templates/org.dxos.agent.plist" with output of command `dirname $(which node)`
|
|
44
|
-
3. Replace `??DX_PATH??` in "./init-templates/org.dxos.agent.plist" with output of command `which dx`
|
|
45
|
-
4. Copy `./init-templates/org.dxos.agent.plist` -> `~/Library/LaunchAgents/org.dxos.agent.plist`
|
|
46
|
-
5. Run `launchctl load -w ~/Library/LaunchAgents/org.dxos.agent.plist`
|
|
47
|
-
|
|
48
|
-
### Stop agent started by `launchd`
|
|
49
|
-
1. Run `launchctl unload -w ~/Library/LaunchAgents/org.dxos.agent.plist`
|
|
50
|
-
2. Remove `~/Library/LaunchAgents/org.dxos.agent.plist`
|
|
51
|
-
|
|
52
|
-
## Install agent as a `systemd` service (Linux users) - manual setup
|
|
53
|
-
1. Install DXOS CLI with steps in [Installation](#Installation) section.
|
|
54
|
-
1. Copy `./init-templates/dxos-agent.service` and `./init-templates/pre-dxos-agent.service` -> `~/.config/systemd/user/`
|
|
55
|
-
1. Run `systemctl --user daemon-reload` to make the systemd daemon aware of the service
|
|
56
|
-
1. Run `systemctl --user enable dxos-agent` to enable the service to start automatically
|
|
57
|
-
1. Optionally, run `sudo loginctl enable-linger {USERNAME}` to enable the service to start without user login (replace `{USERNAME}` with the name of the user that will run the service)
|
|
58
|
-
1. Run `systemctl --user start dxos-agent` to start the service
|
|
59
|
-
|
|
60
|
-
## Start agent with CLI
|
|
61
|
-
Agent is automatically started by each command that requires Client (to avoid this behavior use `--no-agent` flag). You can use `--profile` flag (default value is `default`) to run agent in an isolated profile, and `--foreground` to run agent in attached process.
|
|
62
|
-
```terminal
|
|
63
|
-
dx agent start
|
|
64
|
-
```
|
|
65
|
-
see: [dx agent start](#dx-agent-start)
|
|
66
|
-
|
|
67
|
-
## Adding Agent to your Composer Identity
|
|
68
|
-
1. Go to [Composer](https://composer.dev.dxos.org). And create a device invitation.
|
|
69
|
-

|
|
70
|
-

|
|
71
|
-
|
|
72
|
-
2. Run halo join command in your terminal.
|
|
73
|
-

|
|
74
|
-
|
|
75
|
-
3. Proceed with invitation
|
|
76
|
-
|
|
77
|
-
## Troubleshooting
|
|
78
|
-
1. Make sure you are running the latest version of the shared worker in the browser. Go to the shared workers tab chrome://inspect/#workers, kill `dxos-vault` worker, then reload the Composer tab.
|
|
79
|
-
2. Restart your agent with [```dx agent restart```](#dx-agent-restart). Also useful command[ ```dx agent stop --all```](#dx-agent-stop)
|
|
80
|
-
#### Danger Zone
|
|
81
|
-
3. Reset Storage. Warning: Agent will lose its storage, and config file will be deleted [```dx reset --force```](#dx-reset)
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
# Development
|
|
86
|
-
|
|
87
|
-
### Multiple Profile configuration
|
|
88
|
-
Both the CLI and agents can be configured to use a given profile using either the `--profile` flag or `DX_PROFILE` environment variable.
|
|
89
|
-
The CLI will automatically connect to the agent using the given profile.
|
|
90
|
-
|
|
91
|
-
### Local development
|
|
92
|
-
The CLI can be invoked out of the Git monorepo using the `bin/dev` command.
|
|
93
|
-
|
|
94
|
-
Source the following script to set an alias for `dx` that can be called from any directory:
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
cd packages/devtools/cli
|
|
98
|
-
. ../../devtools/cli/scripts/dev.sh
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Example:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
DX_PROFILE=test dx agent start --ws=4567
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
NOTE: The `agent` will need to be recompiled after any changes.
|
|
108
|
-
|
|
109
|
-
### Building
|
|
110
|
-
To build the CLI:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
moon run cli:build
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Devtools
|
|
117
|
-
The agent can be configured to expose a Websocket port using the `--ws` flag that can be connected to using DXOS Devtools:
|
|
118
|
-
|
|
119
|
-
To connect devtools, set the `target` query parameter to the agent's websocket URL, e.g.,
|
|
120
|
-
|
|
121
|
-
`https://devtools.dxos.org?target=ws://localhost:4567`
|
|
122
|
-
|
|
123
|
-
### Debugging
|
|
124
|
-
|
|
125
|
-
To enable logging, set `LOG_FILTER`:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
LOG_FILTER=info,agent:debug dx agent start -f
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
If the agent is run in background mode, log files will be created in `/tmp/dx/run/profile/<profile name>/logs`
|
|
132
|
-
|
|
133
|
-
To enable the node debugger, set `NODE_OPTIONS` then open in VSCode (CMD-SHIFT-P "Attach to Node process").
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
NODE_OPTIONS="--inspect-brk"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Reporting errors
|
|
140
|
-
|
|
141
|
-
Run the following command to create a gist of the debug stats.
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
dx debug stats --json --no-agent | gh gist create
|
|
145
|
-
```
|
package/bin/agent_entrypoint
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# TODO(nf): container currently built with Debian due to musl incompatibilities, but still avoiding bash-isms
|
|
4
|
-
set -eu
|
|
5
|
-
|
|
6
|
-
if [ "$1" = "dx" ]; then
|
|
7
|
-
if [ "${DX_PROFILE_MODE-}" = "volume" ] && [ -n "${DX_PROFILE_ROOT-}" ]; then
|
|
8
|
-
export HOME=$DX_PROFILE_ROOT
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
export LOG_FILTER=${LOG_FILTER:-info}
|
|
12
|
-
# TODO(nf): handle global arguments and other invocations?
|
|
13
|
-
if [ "$2" = "agent" ]; then
|
|
14
|
-
if [ -n "${DXOS_AGENT_IDENTITY_KEY-}" ]; then
|
|
15
|
-
echo "Starting DXOS agent for $DXOS_AGENT_IDENTITY_KEY"
|
|
16
|
-
else
|
|
17
|
-
echo "Starting DXOS agent"
|
|
18
|
-
fi
|
|
19
|
-
fi
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
exec "$@"
|
package/bin/dev.cmd
DELETED
package/bin/dev.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --import=extensionless/register --loader ts-node/esm --no-warnings=ExperimentalWarning
|
|
2
|
-
|
|
3
|
-
// NOTE: Specify --no-warnings in production script.
|
|
4
|
-
|
|
5
|
-
// process.env.NODE_ENV = 'development';
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
// Copyright 2024 DXOS.org
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
import { execute, settings } from '@oclif/core';
|
|
12
|
-
|
|
13
|
-
if (process.env.DX_TRACK_LEAKS) {
|
|
14
|
-
globalThis.wtf = require('wtfnode');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
process.env.DX_ENVIRONMENT ??= 'development';
|
|
18
|
-
|
|
19
|
-
settings.debug = true;
|
|
20
|
-
|
|
21
|
-
await execute({ development: true, dir: import.meta.url });
|
|
22
|
-
|
|
23
|
-
// // In dev mode, always show stack traces.
|
|
24
|
-
|
|
25
|
-
// // Start the CLI.
|
|
26
|
-
// oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/handle_invitation
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
set -eu
|
|
3
|
-
if [ "${DX_PROFILE_MODE-}" = "volume" ] && [ -n "${DX_PROFILE_ROOT-}" ]; then
|
|
4
|
-
export HOME=$DX_PROFILE_ROOT
|
|
5
|
-
fi
|
|
6
|
-
|
|
7
|
-
[ -f $HOME/.agent-invitation-complete ] && exit 0
|
|
8
|
-
|
|
9
|
-
export LOG_FILTER=debug
|
|
10
|
-
while true; do
|
|
11
|
-
if [ -f /tmp/dx/run/profile/default/lockfile ] && dx agent status; then
|
|
12
|
-
break
|
|
13
|
-
fi
|
|
14
|
-
sleep 1
|
|
15
|
-
done
|
|
16
|
-
|
|
17
|
-
dx halo join --verbose --invitation=$DXOS_AGENT_INVITATION --managed-agent --device-label "agent running in ${DX_AGENT_ENVIRONMENT-}"
|
|
18
|
-
touch $HOME/.agent-invitation-complete
|
package/bin/run.cmd
DELETED
package/dist/src/base.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Command } from '@oclif/core';
|
|
2
|
-
import { AbstractBaseCommand, FriendlyError } from '@dxos/cli-base';
|
|
3
|
-
import { PublisherRpcPeer, SupervisorRpcPeer, TunnelRpcPeer } from './util';
|
|
4
|
-
export declare class PublisherConnectionError extends FriendlyError {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
7
|
-
export declare abstract class BaseCommand<T extends typeof Command = any> extends AbstractBaseCommand<T> {
|
|
8
|
-
/**
|
|
9
|
-
* Convenience function to wrap command passing in KUBE publisher.
|
|
10
|
-
*/
|
|
11
|
-
execWithPublisher<T>(callback: (rpc: PublisherRpcPeer) => Promise<T | undefined>): Promise<T | undefined>;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated
|
|
14
|
-
*/
|
|
15
|
-
execWithTunneling<T>(callback: (rpc: TunnelRpcPeer) => Promise<T | undefined>): Promise<T | undefined>;
|
|
16
|
-
execWithSupervisor<T>(callback: (rpc: SupervisorRpcPeer) => Promise<T | undefined>): Promise<T | undefined>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=base.d.ts.map
|
package/dist/src/base.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5E,qBAAa,wBAAyB,SAAQ,aAAa;;CAI1D;AAGD,8BAAsB,WAAW,CAAC,CAAC,SAAS,OAAO,OAAO,GAAG,GAAG,CAAE,SAAQ,mBAAmB,CAAC,CAAC,CAAC;IAC9F;;OAEG;IACG,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAkB/G;;OAEG;IACG,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAiBtG,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;CAgBlH"}
|
package/dist/src/base.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
import { AbstractBaseCommand, FriendlyError } from '@dxos/cli-base';
|
|
5
|
-
import { invariant } from '@dxos/invariant';
|
|
6
|
-
import { PublisherRpcPeer, SupervisorRpcPeer, TunnelRpcPeer } from './util';
|
|
7
|
-
export class PublisherConnectionError extends FriendlyError {
|
|
8
|
-
constructor() {
|
|
9
|
-
super('Error while connecting to kube publisher.');
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
// TODO(burdon): Remove deprecated methods.
|
|
13
|
-
export class BaseCommand extends AbstractBaseCommand {
|
|
14
|
-
/**
|
|
15
|
-
* Convenience function to wrap command passing in KUBE publisher.
|
|
16
|
-
*/
|
|
17
|
-
async execWithPublisher(callback) {
|
|
18
|
-
let rpc;
|
|
19
|
-
try {
|
|
20
|
-
const wsEndpoint = this.clientConfig.get('runtime.services.publisher.server');
|
|
21
|
-
invariant(wsEndpoint);
|
|
22
|
-
rpc = new PublisherRpcPeer(wsEndpoint);
|
|
23
|
-
await Promise.race([rpc.connected.waitForCount(1), rpc.error.waitForCount(1).then((err) => Promise.reject(err))]);
|
|
24
|
-
return await callback(rpc);
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
this.log('Publisher failed: ', err);
|
|
28
|
-
this.catch(new PublisherConnectionError());
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
if (rpc) {
|
|
32
|
-
await rpc.close();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
|
-
async execWithTunneling(callback) {
|
|
40
|
-
let rpc;
|
|
41
|
-
try {
|
|
42
|
-
const wsEndpoint = this.clientConfig.get('runtime.services.tunneling.server');
|
|
43
|
-
invariant(wsEndpoint);
|
|
44
|
-
rpc = new TunnelRpcPeer(wsEndpoint);
|
|
45
|
-
await Promise.race([rpc.connected.waitForCount(1), rpc.error.waitForCount(1).then((err) => Promise.reject(err))]);
|
|
46
|
-
return await callback(rpc);
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
this.catch(err);
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
if (rpc) {
|
|
53
|
-
await rpc.close();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async execWithSupervisor(callback) {
|
|
58
|
-
let rpc;
|
|
59
|
-
try {
|
|
60
|
-
const wsEndpoint = this.clientConfig.get('runtime.services.supervisor.server');
|
|
61
|
-
invariant(wsEndpoint);
|
|
62
|
-
rpc = new SupervisorRpcPeer(wsEndpoint);
|
|
63
|
-
await Promise.race([rpc.connected.waitForCount(1), rpc.error.waitForCount(1).then((err) => Promise.reject(err))]);
|
|
64
|
-
return await callback(rpc);
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
this.catch(err);
|
|
68
|
-
}
|
|
69
|
-
finally {
|
|
70
|
-
if (rpc) {
|
|
71
|
-
await rpc.close();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=base.js.map
|
package/dist/src/base.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.node.test.d.ts","sourceRoot":"","sources":["../../../../src/commands/agent/agent.node.test.ts"],"names":[],"mappings":""}
|