@dxos/cli 0.5.1-main.ff7d242 → 0.5.1-next.260c093

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.
@@ -4,6 +4,8 @@ export default class List extends BaseCommand<typeof List> {
4
4
  static description: string;
5
5
  static flags: {
6
6
  type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
+ delay: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
9
  columns: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
10
  sort: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
11
  filter: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -20,7 +22,6 @@ export default class List extends BaseCommand<typeof List> {
20
22
  target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
23
  'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
22
24
  'no-start-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
23
- timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
24
25
  'no-wait': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
26
  'json-log': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
26
27
  'json-logfile': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/halo/credential/list.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAA4B;IACvD,OAAgB,KAAK;;;;;;;;;;;;;;;;;;;;;;MAMnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAe1B"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/commands/halo/credential/list.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAA4B;IACvD,OAAgB,KAAK;;;;;;;;;;;;;;;;;;;;;;;MAcnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CA2B1B"}
@@ -4,6 +4,7 @@
4
4
  //
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const core_1 = require("@oclif/core");
7
+ const async_1 = require("@dxos/async");
7
8
  const base_command_1 = require("../../../base-command");
8
9
  const util_1 = require("../../../util");
9
10
  class List extends base_command_1.BaseCommand {
@@ -13,7 +14,18 @@ class List extends base_command_1.BaseCommand {
13
14
  if (!identity) {
14
15
  this.catch('Profile not initialized.');
15
16
  }
16
- const credentials = await (0, util_1.queryCredentials)(client, this.flags.type);
17
+ // Wait for at least one credential before returning a result.
18
+ const trigger = new async_1.Trigger();
19
+ client.halo.credentials.subscribe((credentials) => {
20
+ if (credentials.length > 0) {
21
+ trigger.wake();
22
+ }
23
+ });
24
+ await trigger.wait({ timeout: this.flags.timeout });
25
+ // Even if we wait for a single credential, we're still likely to miss credentials unless we wait some more.
26
+ await (0, async_1.sleep)(this.flags.delay);
27
+ const credentials = client.halo.queryCredentials({ type: this.flags.type });
28
+ console.log(credentials);
17
29
  if (this.flags.json) {
18
30
  return (0, util_1.mapCredentials)(credentials);
19
31
  }
@@ -31,6 +43,14 @@ List.flags = {
31
43
  type: core_1.Flags.string({
32
44
  description: 'Type',
33
45
  }),
46
+ timeout: core_1.Flags.integer({
47
+ description: 'Time in milliseconds to wait for at least one credential before listing.',
48
+ default: 500,
49
+ }),
50
+ delay: core_1.Flags.integer({
51
+ description: 'Delay in milliseconds before listing.',
52
+ default: 250,
53
+ }),
34
54
  };
35
55
  exports.default = List;
36
56
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/halo/credential/list.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAwC;AAIxC,wDAAoD;AACpD,wCAAmF;AAEnF,MAAqB,IAAK,SAAQ,0BAAwB;IAWxD,KAAK,CAAC,GAAG;QACP,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;YACtC,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;aACxC;YAED,MAAM,WAAW,GAAG,MAAM,IAAA,uBAAgB,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpE,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;gBACnB,OAAO,IAAA,qBAAc,EAAC,WAAW,CAAC,CAAC;aACpC;iBAAM;gBACL,IAAA,uBAAgB,EAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AAxBe,mBAAc,GAAG,IAAI,CAAC;AACtB,gBAAW,GAAG,wBAAwB,CAAC;AACvC,UAAK,GAAG;IACtB,GAAG,0BAAW,CAAC,KAAK;IACpB,GAAG,SAAE,CAAC,KAAK,CAAC,KAAK,EAAE;IACnB,IAAI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BACnB,OAAO,IAAA,qBAAc,EAAC,WAAW,CAAC,CAAC;aACpC;iBAAM;gBACL,IAAA,uBAAgB,EAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AA5Ce,mBAAc,GAAG,IAAI,CAAC;AACtB,gBAAW,GAAG,wBAAwB,CAAC;AACvC,UAAK,GAAG;IACtB,GAAG,0BAAW,CAAC,KAAK;IACpB,GAAG,SAAE,CAAC,KAAK,CAAC,KAAK,EAAE;IACnB,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM;KACpB,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,0EAA0E;QACvF,OAAO,EAAE,GAAG;KACb,CAAC;IACF,KAAK,EAAE,YAAK,CAAC,OAAO,CAAC;QACnB,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,GAAG;KACb,CAAC;CACH,CAAC;kBAjBiB,IAAI"}
@@ -10,7 +10,7 @@ class Close extends base_command_1.BaseCommand {
10
10
  const { key } = this.args;
11
11
  return await this.execWithClient(async (client) => {
12
12
  const space = await this.getSpace(client, key, false);
13
- await space.internal.close();
13
+ await space.close();
14
14
  });
15
15
  }
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"close.js","sourceRoot":"","sources":["../../../../src/commands/space/close.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAmC;AAInC,qDAAiD;AAEjD,MAAqB,KAAM,SAAQ,0BAAyB;IAI1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;;AATe,iBAAW,GAAG,cAAc,CAAC;AAC7B,UAAI,GAAG,EAAE,GAAG,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;kBAF3B,KAAK"}
1
+ {"version":3,"file":"close.js","sourceRoot":"","sources":["../../../../src/commands/space/close.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAmC;AAInC,qDAAiD;AAEjD,MAAqB,KAAM,SAAQ,0BAAyB;IAI1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;;AATe,iBAAW,GAAG,cAAc,CAAC;AAC7B,UAAI,GAAG,EAAE,GAAG,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;kBAF3B,KAAK"}
@@ -10,7 +10,7 @@ class Open extends base_command_1.BaseCommand {
10
10
  const { key } = this.args;
11
11
  return await this.execWithClient(async (client) => {
12
12
  const space = await this.getSpace(client, key, false);
13
- await space.internal.open();
13
+ await space.open();
14
14
  });
15
15
  }
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../src/commands/space/open.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAmC;AAInC,qDAAiD;AAEjD,MAAqB,IAAK,SAAQ,0BAAwB;IAIxD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;;AATe,gBAAW,GAAG,aAAa,CAAC;AAC5B,SAAI,GAAG,EAAE,GAAG,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;kBAF3B,IAAI"}
1
+ {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../src/commands/space/open.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAmC;AAInC,qDAAiD;AAEjD,MAAqB,IAAK,SAAQ,0BAAwB;IAIxD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;;AATe,gBAAW,GAAG,aAAa,CAAC;AAC5B,SAAI,GAAG,EAAE,GAAG,EAAE,WAAI,CAAC,MAAM,EAAE,EAAE,CAAC;kBAF3B,IAAI"}
@@ -1,6 +1,4 @@
1
- import { type Client } from '@dxos/client';
2
1
  import { type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
3
- export declare const queryCredentials: (client: Client, type?: string, predicate?: ((value: Credential) => boolean) | undefined) => Promise<Credential[]>;
4
2
  export declare const mapCredentials: (credentials: Credential[], truncateKeys?: boolean) => {
5
3
  id: string;
6
4
  issuer: string;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/util/credentials.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAM9E,eAAO,MAAM,gBAAgB,WACnB,MAAM,SACP,MAAM,uBACO,UAAU,KAAK,OAAO,kBACzC,QAAQ,UAAU,EAAE,CAuBtB,CAAC;AAEF,eAAO,MAAM,cAAc,gBAAiB,UAAU,EAAE;;;;;GAOvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAAiB,UAAU,EAAE,qBAqBzD,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/util/credentials.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAI9E,eAAO,MAAM,cAAc,gBAAiB,UAAU,EAAE;;;;;GAOvD,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAAiB,UAAU,EAAE,qBAqBzD,CAAC"}
@@ -3,35 +3,9 @@
3
3
  // Copyright 2023 DXOS.org
4
4
  //
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.printCredentials = exports.mapCredentials = exports.queryCredentials = void 0;
6
+ exports.printCredentials = exports.mapCredentials = void 0;
7
7
  const core_1 = require("@oclif/core");
8
- const async_1 = require("@dxos/async");
9
8
  const types_1 = require("./types");
10
- const timeout = 500;
11
- const queryCredentials = async (client, type, predicate) => {
12
- const credentialsQuery = client.halo.queryCredentials({ type });
13
- const trigger = new async_1.Trigger();
14
- let result = [];
15
- credentialsQuery.subscribe({
16
- onUpdate: (credentials) => {
17
- if (predicate) {
18
- result = credentials.filter(predicate);
19
- }
20
- else {
21
- result = credentials;
22
- }
23
- },
24
- onError: (err) => {
25
- throw err;
26
- },
27
- });
28
- setTimeout(() => {
29
- trigger.wake(result);
30
- }, timeout);
31
- await trigger.wait();
32
- return result;
33
- };
34
- exports.queryCredentials = queryCredentials;
35
9
  const mapCredentials = (credentials, truncateKeys = false) => {
36
10
  return credentials.map((credential) => ({
37
11
  id: (0, types_1.maybeTruncateKey)(credential.id, truncateKeys),
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/util/credentials.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,sCAAiC;AAEjC,uCAAsC;AAItC,mCAA2C;AAE3C,MAAM,OAAO,GAAG,GAAG,CAAC;AAEb,MAAM,gBAAgB,GAAG,KAAK,EACnC,MAAc,EACd,IAAa,EACb,SAA0C,EACnB,EAAE;IACzB,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,IAAI,eAAO,EAAgB,CAAC;IAC5C,IAAI,MAAM,GAAiB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,SAAS,CAAC;QACzB,QAAQ,EAAE,CAAC,WAAyB,EAAE,EAAE;YACtC,IAAI,SAAS,EAAE;gBACb,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;aACxC;iBAAM;gBACL,MAAM,GAAG,WAAW,CAAC;aACtB;QACH,CAAC;QACD,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACf,MAAM,GAAG,CAAC;QACZ,CAAC;KACF,CAAC,CAAC;IAEH,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,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GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACtC,EAAE,EAAE,IAAA,wBAAgB,EAAC,UAAU,CAAC,EAAG,EAAE,YAAY,CAAC;QAClD,MAAM,EAAE,IAAA,wBAAgB,EAAC,UAAU,CAAC,MAAO,EAAE,YAAY,CAAC;QAC1D,OAAO,EAAE,IAAA,wBAAgB,EAAC,UAAU,CAAC,OAAQ,CAAC,EAAG,EAAE,YAAY,CAAC;QAChE,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC;KAC5C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB;AAEK,MAAM,gBAAgB,GAAG,CAAC,WAAyB,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IACxE,SAAE,CAAC,KAAK,CACN,IAAA,sBAAc,EAAC,WAAW,EAAE,IAAI,CAAC,EACjC;QACE,EAAE,EAAE;YACF,MAAM,EAAE,IAAI;SACb;QACD,MAAM,EAAE;YACN,MAAM,EAAE,QAAQ;SACjB;QACD,OAAO,EAAE;YACP,MAAM,EAAE,SAAS;SAClB;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM;SACf;KACF,EACD;QACE,GAAG,KAAK;KACT,CACF,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,gBAAgB,oBAqB3B"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.1-main.ff7d242",
2
+ "version": "0.5.1-next.260c093",
3
3
  "commands": {
4
4
  "agent:invitations": {
5
5
  "id": "agent:invitations",
@@ -3296,231 +3296,6 @@
3296
3296
  },
3297
3297
  "args": {}
3298
3298
  },
3299
- "kube:auth": {
3300
- "id": "kube:auth",
3301
- "description": "Authenticate with KUBE.",
3302
- "strict": true,
3303
- "pluginName": "@dxos/cli",
3304
- "pluginAlias": "@dxos/cli",
3305
- "pluginType": "core",
3306
- "aliases": [],
3307
- "flags": {
3308
- "json": {
3309
- "name": "json",
3310
- "type": "boolean",
3311
- "description": "Format output as json.",
3312
- "helpGroup": "GLOBAL",
3313
- "allowNo": false
3314
- },
3315
- "dry-run": {
3316
- "name": "dry-run",
3317
- "type": "boolean",
3318
- "description": "Dry run.",
3319
- "allowNo": false
3320
- },
3321
- "verbose": {
3322
- "name": "verbose",
3323
- "type": "boolean",
3324
- "char": "v",
3325
- "description": "Verbose output",
3326
- "allowNo": false
3327
- },
3328
- "profile": {
3329
- "name": "profile",
3330
- "type": "option",
3331
- "description": "User profile.",
3332
- "multiple": false,
3333
- "default": "default"
3334
- },
3335
- "config": {
3336
- "name": "config",
3337
- "type": "option",
3338
- "description": "Config file.",
3339
- "helpValue": "path",
3340
- "multiple": false,
3341
- "dependsOn": [
3342
- "profile"
3343
- ],
3344
- "default": "/home/runner/.config/dx/profile/default.yml",
3345
- "aliases": [
3346
- "c"
3347
- ]
3348
- },
3349
- "target": {
3350
- "name": "target",
3351
- "type": "option",
3352
- "description": "Target websocket server.",
3353
- "multiple": false
3354
- },
3355
- "no-agent": {
3356
- "name": "no-agent",
3357
- "type": "boolean",
3358
- "description": "Run command without using an agent.",
3359
- "allowNo": false
3360
- },
3361
- "no-start-agent": {
3362
- "name": "no-start-agent",
3363
- "type": "boolean",
3364
- "description": "Do not automatically start an agent if one is not running.",
3365
- "allowNo": false
3366
- },
3367
- "timeout": {
3368
- "name": "timeout",
3369
- "type": "option",
3370
- "description": "Timeout (ms).",
3371
- "multiple": false,
3372
- "default": 60000,
3373
- "aliases": [
3374
- "t"
3375
- ]
3376
- },
3377
- "no-wait": {
3378
- "name": "no-wait",
3379
- "type": "boolean",
3380
- "description": "Do not wait for space to be ready.",
3381
- "allowNo": false
3382
- },
3383
- "json-log": {
3384
- "name": "json-log",
3385
- "type": "boolean",
3386
- "description": "When running in foreground, log JSON format",
3387
- "allowNo": false
3388
- },
3389
- "json-logfile": {
3390
- "name": "json-logfile",
3391
- "type": "option",
3392
- "description": "JSON log file destination, or 'stdout' or 'stderr'",
3393
- "multiple": false,
3394
- "default": "stderr"
3395
- }
3396
- },
3397
- "args": {}
3398
- },
3399
- "kube:deploy": {
3400
- "id": "kube:deploy",
3401
- "description": "Deploy KUBE.",
3402
- "strict": true,
3403
- "pluginName": "@dxos/cli",
3404
- "pluginAlias": "@dxos/cli",
3405
- "pluginType": "core",
3406
- "aliases": [],
3407
- "flags": {
3408
- "json": {
3409
- "name": "json",
3410
- "type": "boolean",
3411
- "description": "Output as JSON.",
3412
- "allowNo": false
3413
- },
3414
- "dry-run": {
3415
- "name": "dry-run",
3416
- "type": "boolean",
3417
- "description": "Dry run.",
3418
- "allowNo": false
3419
- },
3420
- "verbose": {
3421
- "name": "verbose",
3422
- "type": "boolean",
3423
- "char": "v",
3424
- "description": "Verbose output",
3425
- "allowNo": false
3426
- },
3427
- "profile": {
3428
- "name": "profile",
3429
- "type": "option",
3430
- "description": "User profile.",
3431
- "multiple": false,
3432
- "default": "default"
3433
- },
3434
- "config": {
3435
- "name": "config",
3436
- "type": "option",
3437
- "description": "Config file.",
3438
- "helpValue": "path",
3439
- "multiple": false,
3440
- "dependsOn": [
3441
- "profile"
3442
- ],
3443
- "default": "/home/runner/.config/dx/profile/default.yml",
3444
- "aliases": [
3445
- "c"
3446
- ]
3447
- },
3448
- "target": {
3449
- "name": "target",
3450
- "type": "option",
3451
- "description": "Target websocket server.",
3452
- "multiple": false
3453
- },
3454
- "no-agent": {
3455
- "name": "no-agent",
3456
- "type": "boolean",
3457
- "description": "Run command without using an agent.",
3458
- "allowNo": false
3459
- },
3460
- "no-start-agent": {
3461
- "name": "no-start-agent",
3462
- "type": "boolean",
3463
- "description": "Do not automatically start an agent if one is not running.",
3464
- "allowNo": false
3465
- },
3466
- "timeout": {
3467
- "name": "timeout",
3468
- "type": "option",
3469
- "description": "Timeout (ms).",
3470
- "multiple": false,
3471
- "default": 60000,
3472
- "aliases": [
3473
- "t"
3474
- ]
3475
- },
3476
- "no-wait": {
3477
- "name": "no-wait",
3478
- "type": "boolean",
3479
- "description": "Do not wait for space to be ready.",
3480
- "allowNo": false
3481
- },
3482
- "json-log": {
3483
- "name": "json-log",
3484
- "type": "boolean",
3485
- "description": "When running in foreground, log JSON format",
3486
- "allowNo": false
3487
- },
3488
- "json-logfile": {
3489
- "name": "json-logfile",
3490
- "type": "option",
3491
- "description": "JSON log file destination, or 'stdout' or 'stderr'",
3492
- "multiple": false,
3493
- "default": "stderr"
3494
- },
3495
- "hostname": {
3496
- "name": "hostname",
3497
- "type": "option",
3498
- "description": "Hostname",
3499
- "required": true,
3500
- "multiple": false
3501
- },
3502
- "provider": {
3503
- "name": "provider",
3504
- "type": "option",
3505
- "description": "Cloud Provider",
3506
- "multiple": false,
3507
- "default": "digitalocean"
3508
- },
3509
- "accessToken": {
3510
- "name": "accessToken",
3511
- "type": "option",
3512
- "description": "Access token for seeding admin identity",
3513
- "multiple": false
3514
- },
3515
- "dev": {
3516
- "name": "dev",
3517
- "type": "boolean",
3518
- "description": "Deploy latest version from dev channel",
3519
- "allowNo": false
3520
- }
3521
- },
3522
- "args": {}
3523
- },
3524
3299
  "reset": {
3525
3300
  "id": "reset",
3526
3301
  "description": "Reset user data.",
@@ -5060,7 +4835,7 @@
5060
4835
  "type": "option",
5061
4836
  "description": "Tunnel name",
5062
4837
  "multiple": false,
5063
- "default": "charlie-oven-fourteen-mango"
4838
+ "default": "maryland-green-november-blue"
5064
4839
  }
5065
4840
  },
5066
4841
  "args": {
@@ -5346,12 +5121,9 @@
5346
5121
  "timeout": {
5347
5122
  "name": "timeout",
5348
5123
  "type": "option",
5349
- "description": "Timeout (ms).",
5124
+ "description": "Time in milliseconds to wait for at least one credential before listing.",
5350
5125
  "multiple": false,
5351
- "default": 60000,
5352
- "aliases": [
5353
- "t"
5354
- ]
5126
+ "default": 500
5355
5127
  },
5356
5128
  "no-wait": {
5357
5129
  "name": "no-wait",
@@ -5450,6 +5222,13 @@
5450
5222
  "type": "option",
5451
5223
  "description": "Type",
5452
5224
  "multiple": false
5225
+ },
5226
+ "delay": {
5227
+ "name": "delay",
5228
+ "type": "option",
5229
+ "description": "Delay in milliseconds before listing.",
5230
+ "multiple": false,
5231
+ "default": 250
5453
5232
  }
5454
5233
  },
5455
5234
  "args": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/cli",
3
- "version": "0.5.1-main.ff7d242",
3
+ "version": "0.5.1-next.260c093",
4
4
  "description": "DXOS CLI",
5
5
  "keywords": [
6
6
  "dxos",
@@ -36,7 +36,7 @@
36
36
  "ink": "^3.2.0",
37
37
  "ink-table": "~3.0.0",
38
38
  "inquirer": "^8.2.0",
39
- "isomorphic-ws": "^4.0.1",
39
+ "isomorphic-ws": "^5.0.0",
40
40
  "js-yaml": "^4.1.0",
41
41
  "kubo-rpc-client": "^3.0.2",
42
42
  "lodash.defaultsdeep": "^4.6.1",
@@ -47,28 +47,28 @@
47
47
  "uuid": "^8.3.2",
48
48
  "ws": "^8.14.2",
49
49
  "wtfnode": "^0.9.1",
50
- "@dxos/agent": "0.5.1-main.ff7d242",
51
- "@dxos/async": "0.5.1-main.ff7d242",
52
- "@dxos/client-protocol": "0.5.1-main.ff7d242",
53
- "@dxos/client": "0.5.1-main.ff7d242",
54
- "@dxos/client-services": "0.5.1-main.ff7d242",
55
- "@dxos/context": "0.5.1-main.ff7d242",
56
- "@dxos/debug": "0.5.1-main.ff7d242",
57
- "@dxos/bare-template": "0.5.1-main.ff7d242",
58
- "@dxos/config": "0.5.1-main.ff7d242",
59
- "@dxos/functions": "0.5.1-main.ff7d242",
60
- "@dxos/hello-template": "0.5.1-main.ff7d242",
61
- "@dxos/invariant": "0.5.1-main.ff7d242",
62
- "@dxos/network-manager": "0.5.1-main.ff7d242",
63
- "@dxos/observability": "0.5.1-main.ff7d242",
64
- "@dxos/process": "0.5.1-main.ff7d242",
65
- "@dxos/plate": "0.5.1-main.ff7d242",
66
- "@dxos/log": "0.5.1-main.ff7d242",
67
- "@dxos/protocols": "0.5.1-main.ff7d242",
68
- "@dxos/random": "0.5.1-main.ff7d242",
69
- "@dxos/tasks-template": "0.5.1-main.ff7d242",
70
- "@dxos/rpc": "0.5.1-main.ff7d242",
71
- "@dxos/util": "0.5.1-main.ff7d242"
50
+ "@dxos/async": "0.5.1-next.260c093",
51
+ "@dxos/bare-template": "0.5.1-next.260c093",
52
+ "@dxos/agent": "0.5.1-next.260c093",
53
+ "@dxos/client": "0.5.1-next.260c093",
54
+ "@dxos/client-protocol": "0.5.1-next.260c093",
55
+ "@dxos/client-services": "0.5.1-next.260c093",
56
+ "@dxos/config": "0.5.1-next.260c093",
57
+ "@dxos/context": "0.5.1-next.260c093",
58
+ "@dxos/functions": "0.5.1-next.260c093",
59
+ "@dxos/debug": "0.5.1-next.260c093",
60
+ "@dxos/hello-template": "0.5.1-next.260c093",
61
+ "@dxos/invariant": "0.5.1-next.260c093",
62
+ "@dxos/log": "0.5.1-next.260c093",
63
+ "@dxos/network-manager": "0.5.1-next.260c093",
64
+ "@dxos/observability": "0.5.1-next.260c093",
65
+ "@dxos/plate": "0.5.1-next.260c093",
66
+ "@dxos/process": "0.5.1-next.260c093",
67
+ "@dxos/protocols": "0.5.1-next.260c093",
68
+ "@dxos/random": "0.5.1-next.260c093",
69
+ "@dxos/rpc": "0.5.1-next.260c093",
70
+ "@dxos/tasks-template": "0.5.1-next.260c093",
71
+ "@dxos/util": "0.5.1-next.260c093"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@oclif/test": "^2.3.31",
@@ -1,9 +0,0 @@
1
- import { type Client } from '@dxos/client';
2
- import { BaseCommand } from '../../base-command';
3
- export default class Auth extends BaseCommand<typeof Auth> {
4
- static enableJsonFlag: boolean;
5
- static description: string;
6
- presentAuthCredentials(client: Client): Promise<any>;
7
- run(): Promise<any>;
8
- }
9
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/commands/kube/auth.ts"],"names":[],"mappings":"AAMA,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,SAA6B;IAElD,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAwCpD,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CA0B1B"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 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 chalk_1 = __importDefault(require("chalk"));
10
- const invariant_1 = require("@dxos/invariant");
11
- const keys_1 = require("@dxos/keys");
12
- const base_command_1 = require("../../base-command");
13
- const util_1 = require("../../util");
14
- class Auth extends base_command_1.BaseCommand {
15
- async presentAuthCredentials(client) {
16
- this.log((0, chalk_1.default) `{gray Initiating presentation sequence..}`);
17
- // TODO(egorgripasov): Find AuthorizedDevice by KubeAccess credential.
18
- const { deviceKey } = client.halo.device;
19
- const authDeviceCreds = await (0, util_1.queryCredentials)(client, 'dxos.halo.credentials.AuthorizedDevice', (cred) => keys_1.PublicKey.equals(cred.subject.id, deviceKey));
20
- if (!authDeviceCreds.length) {
21
- this.catch('No authorized devices');
22
- }
23
- // Init auth sequence.
24
- return this.execWithSupervisor(async (supervisor) => {
25
- var _a;
26
- const { nonce, kubeKey } = await supervisor.rpc.initAuthSequence();
27
- // Find proper KubeAccess credential.
28
- const kubeAccessCreds = await (0, util_1.queryCredentials)(client, 'dxos.halo.credentials.KubeAccess', (cred) => keys_1.PublicKey.equals(cred.issuer, kubeKey));
29
- if (!kubeAccessCreds.length) {
30
- this.log((0, chalk_1.default) `{gray No KUBE access credentials - requesting..}`);
31
- }
32
- else {
33
- this.log((0, chalk_1.default) `{gray KUBE access credentials found - requesting session token..}`);
34
- }
35
- const credsToPresent = [authDeviceCreds[0].id, (_a = kubeAccessCreds[0]) === null || _a === void 0 ? void 0 : _a.id].filter(Boolean);
36
- // Create presentation.
37
- const presentation = await client.halo.presentCredentials({
38
- ids: credsToPresent,
39
- nonce,
40
- });
41
- return supervisor.rpc.authenticate({
42
- presentation,
43
- });
44
- });
45
- }
46
- async run() {
47
- return await this.execWithClient(async (client) => {
48
- const identity = client.halo.identity;
49
- if (!identity) {
50
- // TODO(burdon): Error if called twice with no halo.
51
- this.log((0, chalk_1.default) `{red Profile not initialized.}`);
52
- }
53
- else {
54
- const { credential, token } = await this.presentAuthCredentials(client);
55
- (0, invariant_1.invariant)(!!credential || !!token, 'No credentials or token received.');
56
- if (token) {
57
- this.log((0, chalk_1.default) `{green Authenticated with session token ${token}}`);
58
- }
59
- else {
60
- this.log((0, chalk_1.default) `{gray Writing KUBE access credential..}`);
61
- await client.halo.writeCredentials([credential]);
62
- const { token } = await this.presentAuthCredentials(client);
63
- if (token) {
64
- this.log((0, chalk_1.default) `{green Authenticated with session token: ${token}}`);
65
- }
66
- else {
67
- this.log((0, chalk_1.default) `{red Failed to authenticate.}`);
68
- }
69
- }
70
- }
71
- });
72
- }
73
- }
74
- Auth.enableJsonFlag = true;
75
- Auth.description = 'Authenticate with KUBE.';
76
- exports.default = Auth;
77
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/commands/kube/auth.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,kDAA0B;AAG1B,+CAA4C;AAC5C,qCAAuC;AAEvC,qDAAiD;AACjD,qCAAsE;AAEtE,MAAqB,IAAK,SAAQ,0BAAwB;IAIxD,KAAK,CAAC,sBAAsB,CAAC,MAAc;QACzC,IAAI,CAAC,G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F;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AApEe,mBAAc,GAAG,IAAI,CAAC;AACtB,gBAAW,GAAG,yBAAyB,CAAC;kBAFrC,IAAI"}
@@ -1,24 +0,0 @@
1
- import { BaseCommand } from '../../base-command';
2
- export default class Deploy extends BaseCommand<typeof Deploy> {
3
- static description: string;
4
- static flags: {
5
- hostname: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
- provider: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- accessToken: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- dev: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
- json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
- 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
- verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
- profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
- 'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
- 'no-start-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
- timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
- 'no-wait': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
- 'json-log': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
- 'json-logfile': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
- };
22
- run(): Promise<any>;
23
- }
24
- //# sourceMappingURL=deploy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../../src/commands/kube/deploy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,WAAW,SAAkB;IAC7C,OAAgB,KAAK;;;;;;;;;;;;;;;;;MAiBnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAwB1B"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2022 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const core_1 = require("@oclif/core");
7
- const base_command_1 = require("../../base-command");
8
- const provider_1 = require("../../util/provider");
9
- class Deploy extends base_command_1.BaseCommand {
10
- async run() {
11
- const { hostname, provider: providerName, dev, accessToken } = this.flags;
12
- return await this.execWithClient(async (client) => {
13
- if (!client.halo.identity) {
14
- this.catch('Client identity not initialized.');
15
- }
16
- // TODO(egorgripasov): HALO <-> KUBE integration.
17
- let provider;
18
- switch (providerName) {
19
- case provider_1.DEFAULT_PROVIDER: {
20
- provider = new provider_1.DigitalOceanProvider(this.clientConfig);
21
- break;
22
- }
23
- default: {
24
- this.catch(`Unknown provider: ${providerName}`);
25
- }
26
- }
27
- const kube = await provider.deploy({ hostname, dev, accessToken });
28
- (0, provider_1.printKubes)([kube]);
29
- });
30
- }
31
- }
32
- Deploy.description = 'Deploy KUBE.';
33
- Deploy.flags = {
34
- ...base_command_1.BaseCommand.flags,
35
- hostname: core_1.Flags.string({
36
- description: 'Hostname',
37
- required: true,
38
- }),
39
- provider: core_1.Flags.string({
40
- description: 'Cloud Provider',
41
- default: provider_1.DEFAULT_PROVIDER,
42
- }),
43
- accessToken: core_1.Flags.string({
44
- description: 'Access token for seeding admin identity',
45
- }),
46
- dev: core_1.Flags.boolean({
47
- description: 'Deploy latest version from dev channel',
48
- default: false,
49
- }),
50
- };
51
- exports.default = Deploy;
52
- //# sourceMappingURL=deploy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../src/commands/kube/deploy.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,sCAAoC;AAIpC,qDAAiD;AACjD,kDAAiH;AAEjH,MAAqB,MAAO,SAAQ,0BAA0B;IAqB5D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1E,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;YACxD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAC;aAChD;YAED,iDAAiD;YACjD,IAAI,QAA2B,CAAC;YAChC,QAAQ,YAAY,EAAE;gBACpB,KAAK,2BAAgB,CAAC,CAAC;oBACrB,QAAQ,GAAG,IAAI,+BAAoB,CAAC,IAAI,CAAC,YAAa,CAAC,CAAC;oBACxD,MAAM;iBACP;gBAED,OAAO,CAAC,CAAC;oBACP,IAAI,CAAC,KAAK,CAAC,qBAAqB,YAAY,EAAE,CAAC,CAAC;iBACjD;aACF;YAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;YACnE,IAAA,qBAAU,EAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC;;AA3Ce,kBAAW,GAAG,cAAc,CAAC;AAC7B,YAAK,GAAG;IACtB,GAAG,0BAAW,CAAC,KAAK;IACpB,QAAQ,EAA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