@dxos/cli 0.4.5-main.e7f0200 → 0.4.5-main.ea4f804

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 (46) hide show
  1. package/dist/src/base-command.d.ts +1 -1
  2. package/dist/src/base-command.d.ts.map +1 -1
  3. package/dist/src/base-command.js +14 -29
  4. package/dist/src/base-command.js.map +1 -1
  5. package/dist/src/commands/agent/start.d.ts.map +1 -1
  6. package/dist/src/commands/agent/start.js +22 -2
  7. package/dist/src/commands/agent/start.js.map +1 -1
  8. package/dist/src/commands/agent/stop.js +1 -1
  9. package/dist/src/commands/app/create.js +2 -2
  10. package/dist/src/commands/debug/error.d.ts +6 -0
  11. package/dist/src/commands/debug/error.d.ts.map +1 -0
  12. package/dist/src/commands/debug/error.js +26 -0
  13. package/dist/src/commands/debug/error.js.map +1 -0
  14. package/dist/src/commands/device/update.d.ts +17 -0
  15. package/dist/src/commands/device/update.d.ts.map +1 -0
  16. package/dist/src/commands/device/update.js +52 -0
  17. package/dist/src/commands/device/update.js.map +1 -0
  18. package/dist/src/commands/halo/credential/list.js +1 -1
  19. package/dist/src/commands/halo/identity.d.ts.map +1 -1
  20. package/dist/src/commands/halo/identity.js +1 -0
  21. package/dist/src/commands/halo/identity.js.map +1 -1
  22. package/dist/src/commands/halo/join.d.ts +1 -1
  23. package/dist/src/commands/halo/join.d.ts.map +1 -1
  24. package/dist/src/commands/halo/join.js +25 -12
  25. package/dist/src/commands/halo/join.js.map +1 -1
  26. package/dist/src/commands/halo/share.d.ts +1 -0
  27. package/dist/src/commands/halo/share.d.ts.map +1 -1
  28. package/dist/src/commands/halo/share.js +9 -0
  29. package/dist/src/commands/halo/share.js.map +1 -1
  30. package/dist/src/commands/halo/update.d.ts +17 -0
  31. package/dist/src/commands/halo/update.d.ts.map +1 -0
  32. package/dist/src/commands/halo/update.js +42 -0
  33. package/dist/src/commands/halo/update.js.map +1 -0
  34. package/dist/src/commands/kube/auth.js +1 -1
  35. package/dist/src/commands/kube/deploy.js +2 -2
  36. package/dist/src/commands/space/create.js +1 -1
  37. package/dist/src/commands/space/list.d.ts +1 -1
  38. package/dist/src/commands/space/list.d.ts.map +1 -1
  39. package/dist/src/commands/space/list.js +6 -1
  40. package/dist/src/commands/space/list.js.map +1 -1
  41. package/dist/src/errors.d.ts +11 -3
  42. package/dist/src/errors.d.ts.map +1 -1
  43. package/dist/src/errors.js +22 -4
  44. package/dist/src/errors.js.map +1 -1
  45. package/oclif.manifest.json +245 -8
  46. package/package.json +25 -23
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class Update extends BaseCommand<typeof Update> {
3
+ static description: string;
4
+ static flags: {
5
+ displayName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ 'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ 'no-wait': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ };
15
+ run(): Promise<any>;
16
+ }
17
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/halo/update.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,WAAW,SAA8B;IACzD,OAAgB,KAAK;;;;;;;;;;MAGnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAsB1B"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2022 DXOS.org
4
+ //
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const core_1 = require("@oclif/core");
10
+ const chalk_1 = __importDefault(require("chalk"));
11
+ const async_1 = require("@dxos/async");
12
+ const base_command_1 = require("../../base-command");
13
+ const errors_1 = require("../../errors");
14
+ const timeouts_1 = require("../../timeouts");
15
+ class Update extends base_command_1.BaseCommand {
16
+ async run() {
17
+ return await this.execWithClient(async (client) => {
18
+ var _a;
19
+ // TODO(mykola): Hack to wait for identity with `client.halo.identity.wait()`.
20
+ await (0, async_1.asyncTimeout)(client.spaces.isReady.wait(), timeouts_1.IDENTITY_WAIT_TIMEOUT, new errors_1.IdentityWaitTimeoutError());
21
+ const identity = client.halo.identity.get();
22
+ if (!identity) {
23
+ // TODO(burdon): Error if called twice with no halo.
24
+ this.log((0, chalk_1.default) `{red Identity not initialized.}`);
25
+ return {};
26
+ }
27
+ this.log('updating:');
28
+ const newIdentity = await ((_a = client.services.services.IdentityService) === null || _a === void 0 ? void 0 : _a.updateProfile({
29
+ displayName: this.flags.displayName,
30
+ }));
31
+ this.log('Identity updated:', newIdentity);
32
+ return newIdentity;
33
+ });
34
+ }
35
+ }
36
+ Update.description = 'Update identity profile.';
37
+ Update.flags = {
38
+ ...base_command_1.BaseCommand.flags,
39
+ displayName: core_1.Flags.string({ description: 'Set display name' }),
40
+ };
41
+ exports.default = Update;
42
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/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th extends base_command_1.BaseCommand {
18
18
  const { deviceKey } = client.halo.device;
19
19
  const authDeviceCreds = await (0, util_1.queryCredentials)(client, 'dxos.halo.credentials.AuthorizedDevice', (cred) => keys_1.PublicKey.equals(cred.subject.id, deviceKey));
20
20
  if (!authDeviceCreds.length) {
21
- this.error('No authorized devices');
21
+ this.catch('No authorized devices');
22
22
  }
23
23
  // Init auth sequence.
24
24
  return this.execWithSupervisor(async (supervisor) => {
@@ -11,7 +11,7 @@ class Deploy extends base_command_1.BaseCommand {
11
11
  const { hostname, provider: providerName, dev, accessToken } = this.flags;
12
12
  return await this.execWithClient(async (client) => {
13
13
  if (!client.halo.identity) {
14
- this.error('Client identity not initialized.');
14
+ this.catch('Client identity not initialized.');
15
15
  }
16
16
  // TODO(egorgripasov): HALO <-> KUBE integration.
17
17
  let provider;
@@ -21,7 +21,7 @@ class Deploy extends base_command_1.BaseCommand {
21
21
  break;
22
22
  }
23
23
  default: {
24
- this.error(`Unknown provider: ${providerName}`);
24
+ this.catch(`Unknown provider: ${providerName}`);
25
25
  }
26
26
  }
27
27
  const kube = await provider.deploy({ hostname, dev, accessToken });
@@ -14,7 +14,7 @@ class Create extends base_command_1.BaseCommand {
14
14
  async run() {
15
15
  return await this.execWithClient(async (client) => {
16
16
  const space = await client.spaces.create();
17
- await (0, util_1.waitForSpace)(space, this.flags.timeout, (err) => this.error(err));
17
+ await (0, util_1.waitForSpace)(space, this.flags.timeout, (err) => this.catch(err));
18
18
  space.properties.name = this.args.name;
19
19
  const data = {
20
20
  key: space.key,
@@ -5,6 +5,7 @@ export default class List extends BaseCommand<typeof List> {
5
5
  static description: string;
6
6
  static flags: {
7
7
  live: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
9
  columns: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
10
  sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
11
  filter: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -19,7 +20,6 @@ export default class List extends BaseCommand<typeof List> {
19
20
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
20
21
  config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
22
  'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
22
- timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
23
23
  'no-wait': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
24
24
  };
25
25
  run(): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/list.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,KAAK;;;;;;;;;;;;;;;;;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAkBnB,gBAAgB,CAAC,MAAM,EAAE,MAAM;CAkDtC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/space/list.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,KAAK;;;;;;;;;;;;;;;;;;MAWnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAkBnB,gBAAgB,CAAC,MAAM,EAAE,MAAM;CAkDtC"}
@@ -11,7 +11,7 @@ const util_1 = require("../../util");
11
11
  class List extends base_command_1.BaseCommand {
12
12
  async run() {
13
13
  return await this.execWithClient(async (client) => {
14
- const spaces = await this.getSpaces(client, false);
14
+ const spaces = await this.getSpaces(client, true);
15
15
  if (this.flags.json) {
16
16
  return (0, util_1.mapSpaces)(spaces);
17
17
  }
@@ -78,6 +78,11 @@ List.flags = {
78
78
  live: core_1.Flags.boolean({
79
79
  description: 'Live update.',
80
80
  }),
81
+ timeout: core_1.Flags.integer({
82
+ description: 'Timeout (ms).',
83
+ default: 1000,
84
+ aliases: ['t'],
85
+ }),
81
86
  };
82
87
  exports.default = List;
83
88
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/space/list.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAwC;AAExC,uCAAoC;AAGpC,2CAAwC;AAExC,qDAAiD;AACjD,qCAAoD;AAEpD,MAAqB,IAAK,SAAQ,0BAAwB;IAWxD,KAAK,CAAC,GAAG;QACP,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACnD,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;gBACnB,OAAO,IAAA,gBAAS,EAAC,MAAM,CAAC,CAAC;aAC1B;iBAAM;gBACL,IAAA,kBAAW,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBAEhC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;oBACnB,gFAAgF;oBAChF,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CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;qBACxD,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;oBACjB,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;YACP,CAAC;SACF,CAAC,CACH,CAAC;IACJ,CAAC;;AAlFe,mBAAc,GAAG,IAAI,CAAC;AACtB,gBAAW,GAAG,cAAc,CAAC;AAC7B,UAAK,GAAG;IACtB,GAAG,0BAAW,CAAC,KAAK;IACpB,GAAG,SAAE,CAAC,KAAK,CAAC,KAAK,EAAE;IACnB,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC;QAClB,WAAW,EAAE,cAAc;KAC5B,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,IAAK;QACd,OAAO,EAAE,CAAC,GAAG,CAAC;KACf,CAAC;CACH,CAAC;kBAdiB,IAAI"}
@@ -1,10 +1,18 @@
1
- export declare class SpaceWaitTimeoutError extends Error {
1
+ export declare abstract class FriendlyError extends Error {
2
+ abstract friendlyMessage: string;
3
+ get suggestion(): string | undefined;
4
+ }
5
+ export declare class SpaceWaitTimeoutError extends FriendlyError {
2
6
  constructor(timeout: number);
7
+ get friendlyMessage(): string;
8
+ get suggestion(): string;
3
9
  }
4
- export declare class PublisherConnectionError extends Error {
10
+ export declare class PublisherConnectionError extends FriendlyError {
5
11
  constructor();
12
+ get friendlyMessage(): string;
6
13
  }
7
- export declare class IdentityWaitTimeoutError extends Error {
14
+ export declare class IdentityWaitTimeoutError extends FriendlyError {
8
15
  constructor();
16
+ get friendlyMessage(): string;
9
17
  }
10
18
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAIA,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,wBAAyB,SAAQ,KAAK;;CAIlD;AAED,qBAAa,wBAAyB,SAAQ,KAAK;;CAIlD"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAIA,8BAAsB,aAAc,SAAQ,KAAK;IAC/C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,IAAI,UAAU,IAAI,MAAM,GAAG,SAAS,CAEnC;CACF;AAED,qBAAa,qBAAsB,SAAQ,aAAa;gBAC1C,OAAO,EAAE,MAAM;IAI3B,IAAI,eAAe,WAElB;IAED,IAAa,UAAU,WAEtB;CACF;AAED,qBAAa,wBAAyB,SAAQ,aAAa;;IAKzD,IAAI,eAAe,WAElB;CACF;AAED,qBAAa,wBAAyB,SAAQ,aAAa;;IAKzD,IAAI,eAAe,WAElB;CACF"}
@@ -3,23 +3,41 @@
3
3
  // Copyright 2023 DXOS.org
4
4
  //
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.IdentityWaitTimeoutError = exports.PublisherConnectionError = exports.SpaceWaitTimeoutError = void 0;
7
- class SpaceWaitTimeoutError extends Error {
6
+ exports.IdentityWaitTimeoutError = exports.PublisherConnectionError = exports.SpaceWaitTimeoutError = exports.FriendlyError = void 0;
7
+ class FriendlyError extends Error {
8
+ get suggestion() {
9
+ return undefined;
10
+ }
11
+ }
12
+ exports.FriendlyError = FriendlyError;
13
+ class SpaceWaitTimeoutError extends FriendlyError {
8
14
  constructor(timeout) {
9
15
  super(`Timeout waiting for space to be ready: ${timeout.toLocaleString()}ms`);
10
16
  }
17
+ get friendlyMessage() {
18
+ return 'Space takes too long to load.';
19
+ }
20
+ get suggestion() {
21
+ return 'Increase timeout.';
22
+ }
11
23
  }
12
24
  exports.SpaceWaitTimeoutError = SpaceWaitTimeoutError;
13
- class PublisherConnectionError extends Error {
25
+ class PublisherConnectionError extends FriendlyError {
14
26
  constructor() {
15
27
  super('Error while connecting to kube publisher.');
16
28
  }
29
+ get friendlyMessage() {
30
+ return 'Error while connecting to kube publisher.';
31
+ }
17
32
  }
18
33
  exports.PublisherConnectionError = PublisherConnectionError;
19
- class IdentityWaitTimeoutError extends Error {
34
+ class IdentityWaitTimeoutError extends FriendlyError {
20
35
  constructor() {
21
36
  super('Timeout waiting for identity.');
22
37
  }
38
+ get friendlyMessage() {
39
+ return 'Error while connecting to kube publisher.';
40
+ }
23
41
  }
24
42
  exports.IdentityWaitTimeoutError = IdentityWaitTimeoutError;
25
43
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAe;QACzB,KAAK,CAAC,0CAA0C,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAChF,CAAC;CACF;AAJD,sDAIC;AAED,MAAa,wBAAyB,SAAQ,KAAK;IACjD;QACE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACrD,CAAC;CACF;AAJD,4DAIC;AAED,MAAa,wBAAyB,SAAQ,KAAK;IACjD;QACE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzC,CAAC;CACF;AAJD,4DAIC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,MAAsB,aAAc,SAAQ,KAAK;IAE/C,IAAI,UAAU;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AALD,sCAKC;AAED,MAAa,qBAAsB,SAAQ,aAAa;IACtD,YAAY,OAAe;QACzB,KAAK,CAAC,0CAA0C,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,+BAA+B,CAAC;IACzC,CAAC;IAED,IAAa,UAAU;QACrB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;CACF;AAZD,sDAYC;AAED,MAAa,wBAAyB,SAAQ,aAAa;IACzD;QACE,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,2CAA2C,CAAC;IACrD,CAAC;CACF;AARD,4DAQC;AAED,MAAa,wBAAyB,SAAQ,aAAa;IACzD;QACE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,2CAA2C,CAAC;IACrD,CAAC;CACF;AARD,4DAQC"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.5-main.e7f0200",
2
+ "version": "0.4.5-main.ea4f804",
3
3
  "commands": {
4
4
  "agent:list": {
5
5
  "id": "agent:list",
@@ -991,6 +991,80 @@
991
991
  },
992
992
  "args": {}
993
993
  },
994
+ "debug:error": {
995
+ "id": "debug:error",
996
+ "description": "Throw error for debugging.",
997
+ "strict": true,
998
+ "pluginName": "@dxos/cli",
999
+ "pluginAlias": "@dxos/cli",
1000
+ "pluginType": "core",
1001
+ "aliases": [],
1002
+ "flags": {
1003
+ "json": {
1004
+ "name": "json",
1005
+ "type": "boolean",
1006
+ "description": "Output as JSON.",
1007
+ "allowNo": false
1008
+ },
1009
+ "dry-run": {
1010
+ "name": "dry-run",
1011
+ "type": "boolean",
1012
+ "description": "Dry run.",
1013
+ "allowNo": false
1014
+ },
1015
+ "verbose": {
1016
+ "name": "verbose",
1017
+ "type": "boolean",
1018
+ "char": "v",
1019
+ "description": "Verbose output",
1020
+ "allowNo": false
1021
+ },
1022
+ "profile": {
1023
+ "name": "profile",
1024
+ "type": "option",
1025
+ "description": "User profile.",
1026
+ "multiple": false,
1027
+ "default": "default"
1028
+ },
1029
+ "config": {
1030
+ "name": "config",
1031
+ "type": "option",
1032
+ "description": "Config file.",
1033
+ "helpValue": "path",
1034
+ "multiple": false,
1035
+ "dependsOn": [
1036
+ "profile"
1037
+ ],
1038
+ "default": "/home/runner/.config/dx/profile/default.yml",
1039
+ "aliases": [
1040
+ "c"
1041
+ ]
1042
+ },
1043
+ "no-agent": {
1044
+ "name": "no-agent",
1045
+ "type": "boolean",
1046
+ "description": "Run command without using or starting agent.",
1047
+ "allowNo": false
1048
+ },
1049
+ "timeout": {
1050
+ "name": "timeout",
1051
+ "type": "option",
1052
+ "description": "Timeout (ms).",
1053
+ "multiple": false,
1054
+ "default": 60000,
1055
+ "aliases": [
1056
+ "t"
1057
+ ]
1058
+ },
1059
+ "no-wait": {
1060
+ "name": "no-wait",
1061
+ "type": "boolean",
1062
+ "description": "Do not wait for space to be ready.",
1063
+ "allowNo": false
1064
+ }
1065
+ },
1066
+ "args": {}
1067
+ },
994
1068
  "debug:generate": {
995
1069
  "id": "debug:generate",
996
1070
  "description": "Generate test data.",
@@ -1487,6 +1561,86 @@
1487
1561
  },
1488
1562
  "args": {}
1489
1563
  },
1564
+ "device:update": {
1565
+ "id": "device:update",
1566
+ "description": "Update device info.",
1567
+ "strict": true,
1568
+ "pluginName": "@dxos/cli",
1569
+ "pluginAlias": "@dxos/cli",
1570
+ "pluginType": "core",
1571
+ "aliases": [],
1572
+ "flags": {
1573
+ "json": {
1574
+ "name": "json",
1575
+ "type": "boolean",
1576
+ "description": "Output as JSON.",
1577
+ "allowNo": false
1578
+ },
1579
+ "dry-run": {
1580
+ "name": "dry-run",
1581
+ "type": "boolean",
1582
+ "description": "Dry run.",
1583
+ "allowNo": false
1584
+ },
1585
+ "verbose": {
1586
+ "name": "verbose",
1587
+ "type": "boolean",
1588
+ "char": "v",
1589
+ "description": "Verbose output",
1590
+ "allowNo": false
1591
+ },
1592
+ "profile": {
1593
+ "name": "profile",
1594
+ "type": "option",
1595
+ "description": "User profile.",
1596
+ "multiple": false,
1597
+ "default": "default"
1598
+ },
1599
+ "config": {
1600
+ "name": "config",
1601
+ "type": "option",
1602
+ "description": "Config file.",
1603
+ "helpValue": "path",
1604
+ "multiple": false,
1605
+ "dependsOn": [
1606
+ "profile"
1607
+ ],
1608
+ "default": "/home/runner/.config/dx/profile/default.yml",
1609
+ "aliases": [
1610
+ "c"
1611
+ ]
1612
+ },
1613
+ "no-agent": {
1614
+ "name": "no-agent",
1615
+ "type": "boolean",
1616
+ "description": "Run command without using or starting agent.",
1617
+ "allowNo": false
1618
+ },
1619
+ "timeout": {
1620
+ "name": "timeout",
1621
+ "type": "option",
1622
+ "description": "Timeout (ms).",
1623
+ "multiple": false,
1624
+ "default": 60000,
1625
+ "aliases": [
1626
+ "t"
1627
+ ]
1628
+ },
1629
+ "no-wait": {
1630
+ "name": "no-wait",
1631
+ "type": "boolean",
1632
+ "description": "Do not wait for space to be ready.",
1633
+ "allowNo": false
1634
+ },
1635
+ "label": {
1636
+ "name": "label",
1637
+ "type": "option",
1638
+ "description": "Set device label",
1639
+ "multiple": false
1640
+ }
1641
+ },
1642
+ "args": {}
1643
+ },
1490
1644
  "function:dev": {
1491
1645
  "id": "function:dev",
1492
1646
  "description": "Functions development server.",
@@ -2051,12 +2205,9 @@
2051
2205
  "timeout": {
2052
2206
  "name": "timeout",
2053
2207
  "type": "option",
2054
- "description": "Timeout (ms).",
2208
+ "description": "Timeout in seconds",
2055
2209
  "multiple": false,
2056
- "default": 60000,
2057
- "aliases": [
2058
- "t"
2059
- ]
2210
+ "default": 300
2060
2211
  },
2061
2212
  "no-wait": {
2062
2213
  "name": "no-wait",
@@ -2156,6 +2307,92 @@
2156
2307
  "type": "boolean",
2157
2308
  "description": "Flag that specifies if secret auth code is not required",
2158
2309
  "allowNo": false
2310
+ },
2311
+ "origin": {
2312
+ "name": "origin",
2313
+ "type": "option",
2314
+ "description": "Base URL of the application to join the invitation, e.g. https://composer.dxos.org",
2315
+ "multiple": false
2316
+ }
2317
+ },
2318
+ "args": {}
2319
+ },
2320
+ "halo:update": {
2321
+ "id": "halo:update",
2322
+ "description": "Update identity profile.",
2323
+ "strict": true,
2324
+ "pluginName": "@dxos/cli",
2325
+ "pluginAlias": "@dxos/cli",
2326
+ "pluginType": "core",
2327
+ "aliases": [],
2328
+ "flags": {
2329
+ "json": {
2330
+ "name": "json",
2331
+ "type": "boolean",
2332
+ "description": "Output as JSON.",
2333
+ "allowNo": false
2334
+ },
2335
+ "dry-run": {
2336
+ "name": "dry-run",
2337
+ "type": "boolean",
2338
+ "description": "Dry run.",
2339
+ "allowNo": false
2340
+ },
2341
+ "verbose": {
2342
+ "name": "verbose",
2343
+ "type": "boolean",
2344
+ "char": "v",
2345
+ "description": "Verbose output",
2346
+ "allowNo": false
2347
+ },
2348
+ "profile": {
2349
+ "name": "profile",
2350
+ "type": "option",
2351
+ "description": "User profile.",
2352
+ "multiple": false,
2353
+ "default": "default"
2354
+ },
2355
+ "config": {
2356
+ "name": "config",
2357
+ "type": "option",
2358
+ "description": "Config file.",
2359
+ "helpValue": "path",
2360
+ "multiple": false,
2361
+ "dependsOn": [
2362
+ "profile"
2363
+ ],
2364
+ "default": "/home/runner/.config/dx/profile/default.yml",
2365
+ "aliases": [
2366
+ "c"
2367
+ ]
2368
+ },
2369
+ "no-agent": {
2370
+ "name": "no-agent",
2371
+ "type": "boolean",
2372
+ "description": "Run command without using or starting agent.",
2373
+ "allowNo": false
2374
+ },
2375
+ "timeout": {
2376
+ "name": "timeout",
2377
+ "type": "option",
2378
+ "description": "Timeout (ms).",
2379
+ "multiple": false,
2380
+ "default": 60000,
2381
+ "aliases": [
2382
+ "t"
2383
+ ]
2384
+ },
2385
+ "no-wait": {
2386
+ "name": "no-wait",
2387
+ "type": "boolean",
2388
+ "description": "Do not wait for space to be ready.",
2389
+ "allowNo": false
2390
+ },
2391
+ "displayName": {
2392
+ "name": "displayName",
2393
+ "type": "option",
2394
+ "description": "Set display name",
2395
+ "multiple": false
2159
2396
  }
2160
2397
  },
2161
2398
  "args": {}
@@ -2957,7 +3194,7 @@
2957
3194
  "type": "option",
2958
3195
  "description": "Timeout (ms).",
2959
3196
  "multiple": false,
2960
- "default": 60000,
3197
+ "default": 1000,
2961
3198
  "aliases": [
2962
3199
  "t"
2963
3200
  ]
@@ -3524,7 +3761,7 @@
3524
3761
  "type": "option",
3525
3762
  "description": "Tunnel name",
3526
3763
  "multiple": false,
3527
- "default": "gee-september-xray-fruit"
3764
+ "default": "fanta-shade-aspen-black"
3528
3765
  }
3529
3766
  },
3530
3767
  "args": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/cli",
3
- "version": "0.4.5-main.e7f0200",
3
+ "version": "0.4.5-main.ea4f804",
4
4
  "description": "DXOS CLI",
5
5
  "keywords": [
6
6
  "dxos",
@@ -42,31 +42,32 @@
42
42
  "lodash.defaultsdeep": "^4.6.1",
43
43
  "node-fetch": "^2.6.0",
44
44
  "pkg-up": "^3.1.0",
45
+ "platform": "^1.3.6",
45
46
  "react": "^18.2.0",
46
47
  "uuid": "^8.3.2",
47
48
  "ws": "^8.14.2",
48
- "@dxos/agent": "0.4.5-main.e7f0200",
49
- "@dxos/bare-template": "0.4.5-main.e7f0200",
50
- "@dxos/async": "0.4.5-main.e7f0200",
51
- "@dxos/client": "0.4.5-main.e7f0200",
52
- "@dxos/client-protocol": "0.4.5-main.e7f0200",
53
- "@dxos/client-services": "0.4.5-main.e7f0200",
54
- "@dxos/config": "0.4.5-main.e7f0200",
55
- "@dxos/debug": "0.4.5-main.e7f0200",
56
- "@dxos/context": "0.4.5-main.e7f0200",
57
- "@dxos/functions": "0.4.5-main.e7f0200",
58
- "@dxos/hello-template": "0.4.5-main.e7f0200",
59
- "@dxos/invariant": "0.4.5-main.e7f0200",
60
- "@dxos/log": "0.4.5-main.e7f0200",
61
- "@dxos/network-manager": "0.4.5-main.e7f0200",
62
- "@dxos/observability": "0.4.5-main.e7f0200",
63
- "@dxos/plate": "0.4.5-main.e7f0200",
64
- "@dxos/process": "0.4.5-main.e7f0200",
65
- "@dxos/protocols": "0.4.5-main.e7f0200",
66
- "@dxos/random": "0.4.5-main.e7f0200",
67
- "@dxos/rpc": "0.4.5-main.e7f0200",
68
- "@dxos/util": "0.4.5-main.e7f0200",
69
- "@dxos/tasks-template": "0.4.5-main.e7f0200"
49
+ "@dxos/async": "0.4.5-main.ea4f804",
50
+ "@dxos/agent": "0.4.5-main.ea4f804",
51
+ "@dxos/bare-template": "0.4.5-main.ea4f804",
52
+ "@dxos/client-protocol": "0.4.5-main.ea4f804",
53
+ "@dxos/client": "0.4.5-main.ea4f804",
54
+ "@dxos/config": "0.4.5-main.ea4f804",
55
+ "@dxos/debug": "0.4.5-main.ea4f804",
56
+ "@dxos/context": "0.4.5-main.ea4f804",
57
+ "@dxos/client-services": "0.4.5-main.ea4f804",
58
+ "@dxos/functions": "0.4.5-main.ea4f804",
59
+ "@dxos/hello-template": "0.4.5-main.ea4f804",
60
+ "@dxos/invariant": "0.4.5-main.ea4f804",
61
+ "@dxos/log": "0.4.5-main.ea4f804",
62
+ "@dxos/network-manager": "0.4.5-main.ea4f804",
63
+ "@dxos/observability": "0.4.5-main.ea4f804",
64
+ "@dxos/plate": "0.4.5-main.ea4f804",
65
+ "@dxos/process": "0.4.5-main.ea4f804",
66
+ "@dxos/protocols": "0.4.5-main.ea4f804",
67
+ "@dxos/random": "0.4.5-main.ea4f804",
68
+ "@dxos/rpc": "0.4.5-main.ea4f804",
69
+ "@dxos/tasks-template": "0.4.5-main.ea4f804",
70
+ "@dxos/util": "0.4.5-main.ea4f804"
70
71
  },
71
72
  "devDependencies": {
72
73
  "@oclif/test": "^2.3.31",
@@ -77,6 +78,7 @@
77
78
  "@types/lodash.defaultsdeep": "^4.6.6",
78
79
  "@types/node": "^18.11.9",
79
80
  "@types/node-fetch": "^2.5.10",
81
+ "@types/platform": "^1.3.4",
80
82
  "@types/react-dom": "^18.0.6",
81
83
  "fast-check": "^3.15.1",
82
84
  "oclif": "^3.7.0",