@dxos/cli 0.1.51 → 0.1.52-main.18d393e
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/README.md +6 -29
- package/dist/src/commands/agent/start.d.ts +13 -0
- package/dist/src/commands/agent/start.d.ts.map +1 -1
- package/dist/src/commands/agent/start.js +68 -7
- package/dist/src/commands/agent/start.js.map +1 -1
- package/dist/src/util/telemetryrc.json +2 -2
- package/oclif.manifest.json +11 -72
- package/package.json +23 -23
- package/dist/src/commands/agent/run.d.ts +0 -19
- package/dist/src/commands/agent/run.d.ts.map +0 -1
- package/dist/src/commands/agent/run.js +0 -66
- package/dist/src/commands/agent/run.js.map +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ $ npm install -g @dxos/cli
|
|
|
27
27
|
$ dx COMMAND
|
|
28
28
|
running command...
|
|
29
29
|
$ dx (--version)
|
|
30
|
-
@dxos/cli/0.1.
|
|
30
|
+
@dxos/cli/0.1.52-main.18d393e linux-x64 node-v18.16.1
|
|
31
31
|
$ dx --help [COMMAND]
|
|
32
32
|
USAGE
|
|
33
33
|
$ dx COMMAND
|
|
@@ -40,7 +40,6 @@ USAGE
|
|
|
40
40
|
<!-- commands -->
|
|
41
41
|
* [`dx agent list`](#dx-agent-list)
|
|
42
42
|
* [`dx agent restart`](#dx-agent-restart)
|
|
43
|
-
* [`dx agent run`](#dx-agent-run)
|
|
44
43
|
* [`dx agent start`](#dx-agent-start)
|
|
45
44
|
* [`dx agent stop`](#dx-agent-stop)
|
|
46
45
|
* [`dx app create NAME`](#dx-app-create-name)
|
|
@@ -130,16 +129,17 @@ DESCRIPTION
|
|
|
130
129
|
Restart agent daemon.
|
|
131
130
|
```
|
|
132
131
|
|
|
133
|
-
## `dx agent
|
|
132
|
+
## `dx agent start`
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
Start agent daemon.
|
|
136
135
|
|
|
137
136
|
```
|
|
138
137
|
USAGE
|
|
139
|
-
$ dx agent
|
|
140
|
-
<value>] [--socket] [--web-socket <value>] [--http <value>] [--epoch <value>]
|
|
138
|
+
$ dx agent start [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout
|
|
139
|
+
<value>] [-f] [--socket] [--web-socket <value>] [--http <value>] [--epoch <value>]
|
|
141
140
|
|
|
142
141
|
FLAGS
|
|
142
|
+
-f, --foreground Run in foreground
|
|
143
143
|
-v, --verbose Verbose output
|
|
144
144
|
--config=<value> [default: /home/runner/.config/dx/profile/default.yml] Config file.
|
|
145
145
|
--dry-run Dry run.
|
|
@@ -154,29 +154,6 @@ FLAGS
|
|
|
154
154
|
GLOBAL FLAGS
|
|
155
155
|
--json Format output as json.
|
|
156
156
|
|
|
157
|
-
DESCRIPTION
|
|
158
|
-
Run agent as foreground process.
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## `dx agent start`
|
|
162
|
-
|
|
163
|
-
Start agent daemon.
|
|
164
|
-
|
|
165
|
-
```
|
|
166
|
-
USAGE
|
|
167
|
-
$ dx agent start [--json] [--dry-run] [-v] [--config <value> --profile <value>] [--no-agent] [--timeout <value>]
|
|
168
|
-
|
|
169
|
-
FLAGS
|
|
170
|
-
-v, --verbose Verbose output
|
|
171
|
-
--config=<value> [default: /home/runner/.config/dx/profile/default.yml] Config file.
|
|
172
|
-
--dry-run Dry run.
|
|
173
|
-
--no-agent Auto-start agent.
|
|
174
|
-
--profile=<value> [default: default] User profile.
|
|
175
|
-
--timeout=<value> [default: 30] Timeout in seconds.
|
|
176
|
-
|
|
177
|
-
GLOBAL FLAGS
|
|
178
|
-
--json Format output as json.
|
|
179
|
-
|
|
180
157
|
DESCRIPTION
|
|
181
158
|
Start agent daemon.
|
|
182
159
|
```
|
|
@@ -2,6 +2,19 @@ import { BaseCommand } from '../../base-command';
|
|
|
2
2
|
export default class Start extends BaseCommand<typeof Start> {
|
|
3
3
|
static enableJsonFlag: boolean;
|
|
4
4
|
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
foreground: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
socket: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
'web-socket': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
http: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
epoch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
+
};
|
|
5
18
|
run(): Promise<any>;
|
|
6
19
|
}
|
|
7
20
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../../src/commands/agent/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../../src/commands/agent/start.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAyB;IAEpD,OAAgB,KAAK;;;;;;;;;;;;MAqBnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAkD1B"}
|
|
@@ -6,21 +6,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const core_1 = require("@oclif/core");
|
|
9
10
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const agent_1 = require("@dxos/agent");
|
|
12
|
+
const client_protocol_1 = require("@dxos/client-protocol");
|
|
10
13
|
const base_command_1 = require("../../base-command");
|
|
14
|
+
const util_1 = require("../../util");
|
|
11
15
|
class Start extends base_command_1.BaseCommand {
|
|
12
16
|
async run() {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const { flags } = await this.parse(Start);
|
|
18
|
+
if (flags.foreground) {
|
|
19
|
+
const listen = [];
|
|
20
|
+
if (this.flags.socket) {
|
|
21
|
+
listen.push(`unix://${client_protocol_1.DX_RUNTIME}/profile/${this.flags.profile}/agent.sock`);
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
if (this.flags['web-socket']) {
|
|
24
|
+
listen.push(`ws://localhost:${this.flags['web-socket']}`);
|
|
25
|
+
}
|
|
26
|
+
if (this.flags.http) {
|
|
27
|
+
listen.push(`http://localhost:${this.flags.http}`);
|
|
28
|
+
}
|
|
29
|
+
const options = {
|
|
30
|
+
profile: this.flags.profile,
|
|
31
|
+
listen,
|
|
32
|
+
};
|
|
33
|
+
// TODO(burdon): Build monitoring into agent start (not just epoch).
|
|
34
|
+
if (this.flags.epoch && this.flags.epoch !== '0') {
|
|
35
|
+
options.monitor = {
|
|
36
|
+
limit: (0, util_1.safeParseInt)(this.flags.epoch, undefined),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const agent = new agent_1.Agent(this.clientConfig, options);
|
|
40
|
+
await agent.start();
|
|
41
|
+
// NOTE: This is currently called by the agent's forever daemon.
|
|
42
|
+
this.log('Agent started... (ctrl-c to exit)');
|
|
43
|
+
process.on('SIGINT', async () => {
|
|
44
|
+
await agent.stop();
|
|
45
|
+
process.exit(0);
|
|
46
|
+
});
|
|
47
|
+
if (this.flags['web-socket']) {
|
|
48
|
+
this.log(`Open devtools: https://devtools.dxos.org?target=ws://localhost:${this.flags['web-socket']}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return await this.execWithDaemon(async (daemon) => {
|
|
53
|
+
if (await daemon.isRunning(flags.profile)) {
|
|
54
|
+
this.log((0, chalk_1.default) `{red Warning}: ${flags.profile} is already running (Maybe run 'dx reset')`);
|
|
55
|
+
}
|
|
56
|
+
await daemon.start(this.flags.profile);
|
|
57
|
+
this.log('Agent started');
|
|
58
|
+
});
|
|
59
|
+
}
|
|
21
60
|
}
|
|
22
61
|
}
|
|
23
62
|
Start.enableJsonFlag = true;
|
|
24
63
|
Start.description = 'Start agent daemon.';
|
|
64
|
+
Start.flags = {
|
|
65
|
+
...base_command_1.BaseCommand.flags,
|
|
66
|
+
foreground: core_1.Flags.boolean({
|
|
67
|
+
char: 'f',
|
|
68
|
+
description: 'Run in foreground',
|
|
69
|
+
default: false,
|
|
70
|
+
}),
|
|
71
|
+
socket: core_1.Flags.boolean({
|
|
72
|
+
description: 'Expose socket.',
|
|
73
|
+
default: true,
|
|
74
|
+
}),
|
|
75
|
+
'web-socket': core_1.Flags.integer({
|
|
76
|
+
description: 'Expose web socket port.',
|
|
77
|
+
aliases: ['ws'],
|
|
78
|
+
}),
|
|
79
|
+
http: core_1.Flags.integer({
|
|
80
|
+
description: 'Expose HTTP proxy.',
|
|
81
|
+
}),
|
|
82
|
+
epoch: core_1.Flags.string({
|
|
83
|
+
description: 'Manage epochs (set to "auto" or message count).',
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
25
86
|
exports.default = Start;
|
|
26
87
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../src/commands/agent/start.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,kDAA0B;AAE1B,qDAAiD;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../src/commands/agent/start.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,sCAAoC;AACpC,kDAA0B;AAE1B,uCAAkD;AAClD,2DAAmD;AAEnD,qDAAiD;AACjD,qCAA0C;AAE1C,MAAqB,KAAM,SAAQ,0BAAyB;IA2B1D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,KAAK,CAAC,UAAU,EAAE;YACpB,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,UAAU,4BAAU,YAAY,IAAI,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;aAC9E;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;gBAC5B,MAAM,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;aAC3D;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;aACpD;YAED,MAAM,OAAO,GAAiB;gBAC5B,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO;gBAC3B,MAAM;aACP,CAAC;YAEF,oE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tB,iBAAW,GAAG,qBAAqB,CAAC;AAEpC,WAAK,GAAG;IACtB,GAAG,0BAAW,CAAC,KAAK;IACpB,UAAU,EAAE,YAAK,CAAC,OAAO,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,KAAK;KACf,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC;QACpB,WAAW,EAAE,gBAAgB;QAC7B,OAAO,EAAE,IAAI;KACd,CAAC;IACF,YAAY,EAAE,YAAK,CAAC,OAAO,CAAC;QAC1B,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,CAAC,IAAI,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC;QAClB,WAAW,EAAE,oBAAoB;KAClC,CAAC;IACF,KAAK,EAAE,YAAK,CAAC,MAAM,CAAC;QAClB,WAAW,EAAE,iDAAiD;KAC/D,CAAC;CACH,CAAC;kBAzBiB,KAAK"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"DX_ENVIRONMENT": "
|
|
3
|
-
"DX_RELEASE": "@dxos/cli@0.1.
|
|
2
|
+
"DX_ENVIRONMENT": "staging",
|
|
3
|
+
"DX_RELEASE": "@dxos/cli@0.1.52-main.18d393e",
|
|
4
4
|
"SENTRY_DESTINATION": "https://2647916221e643869965e78469479aa4@o4504012000067584.ingest.sentry.io/4504012027265029",
|
|
5
5
|
"TELEMETRY_API_KEY": "B00QG6PtJJrJ0VVFe0H5a6bcUUShKyZM",
|
|
6
6
|
"IPDATA_API_KEY": "ccc5f0cd66dd34a7c31c2ddc61c2bbca2db73892a993982bb3a5f0e2"
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1.
|
|
2
|
+
"version": "0.1.52-main.18d393e",
|
|
3
3
|
"commands": {
|
|
4
4
|
"agent:list": {
|
|
5
5
|
"id": "agent:list",
|
|
@@ -137,9 +137,9 @@
|
|
|
137
137
|
},
|
|
138
138
|
"args": {}
|
|
139
139
|
},
|
|
140
|
-
"agent:
|
|
141
|
-
"id": "agent:
|
|
142
|
-
"description": "
|
|
140
|
+
"agent:start": {
|
|
141
|
+
"id": "agent:start",
|
|
142
|
+
"description": "Start agent daemon.",
|
|
143
143
|
"strict": true,
|
|
144
144
|
"pluginName": "@dxos/cli",
|
|
145
145
|
"pluginAlias": "@dxos/cli",
|
|
@@ -202,6 +202,13 @@
|
|
|
202
202
|
"t"
|
|
203
203
|
]
|
|
204
204
|
},
|
|
205
|
+
"foreground": {
|
|
206
|
+
"name": "foreground",
|
|
207
|
+
"type": "boolean",
|
|
208
|
+
"char": "f",
|
|
209
|
+
"description": "Run in foreground",
|
|
210
|
+
"allowNo": false
|
|
211
|
+
},
|
|
205
212
|
"socket": {
|
|
206
213
|
"name": "socket",
|
|
207
214
|
"type": "boolean",
|
|
@@ -232,74 +239,6 @@
|
|
|
232
239
|
},
|
|
233
240
|
"args": {}
|
|
234
241
|
},
|
|
235
|
-
"agent:start": {
|
|
236
|
-
"id": "agent:start",
|
|
237
|
-
"description": "Start agent daemon.",
|
|
238
|
-
"strict": true,
|
|
239
|
-
"pluginName": "@dxos/cli",
|
|
240
|
-
"pluginAlias": "@dxos/cli",
|
|
241
|
-
"pluginType": "core",
|
|
242
|
-
"aliases": [],
|
|
243
|
-
"flags": {
|
|
244
|
-
"json": {
|
|
245
|
-
"name": "json",
|
|
246
|
-
"type": "boolean",
|
|
247
|
-
"description": "Format output as json.",
|
|
248
|
-
"helpGroup": "GLOBAL",
|
|
249
|
-
"allowNo": false
|
|
250
|
-
},
|
|
251
|
-
"dry-run": {
|
|
252
|
-
"name": "dry-run",
|
|
253
|
-
"type": "boolean",
|
|
254
|
-
"description": "Dry run.",
|
|
255
|
-
"allowNo": false
|
|
256
|
-
},
|
|
257
|
-
"verbose": {
|
|
258
|
-
"name": "verbose",
|
|
259
|
-
"type": "boolean",
|
|
260
|
-
"char": "v",
|
|
261
|
-
"description": "Verbose output",
|
|
262
|
-
"allowNo": false
|
|
263
|
-
},
|
|
264
|
-
"profile": {
|
|
265
|
-
"name": "profile",
|
|
266
|
-
"type": "option",
|
|
267
|
-
"description": "User profile.",
|
|
268
|
-
"multiple": false,
|
|
269
|
-
"default": "default"
|
|
270
|
-
},
|
|
271
|
-
"config": {
|
|
272
|
-
"name": "config",
|
|
273
|
-
"type": "option",
|
|
274
|
-
"description": "Config file.",
|
|
275
|
-
"multiple": false,
|
|
276
|
-
"dependsOn": [
|
|
277
|
-
"profile"
|
|
278
|
-
],
|
|
279
|
-
"default": "/home/runner/.config/dx/profile/default.yml",
|
|
280
|
-
"aliases": [
|
|
281
|
-
"c"
|
|
282
|
-
]
|
|
283
|
-
},
|
|
284
|
-
"no-agent": {
|
|
285
|
-
"name": "no-agent",
|
|
286
|
-
"type": "boolean",
|
|
287
|
-
"description": "Auto-start agent.",
|
|
288
|
-
"allowNo": false
|
|
289
|
-
},
|
|
290
|
-
"timeout": {
|
|
291
|
-
"name": "timeout",
|
|
292
|
-
"type": "option",
|
|
293
|
-
"description": "Timeout in seconds.",
|
|
294
|
-
"multiple": false,
|
|
295
|
-
"default": 30,
|
|
296
|
-
"aliases": [
|
|
297
|
-
"t"
|
|
298
|
-
]
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
"args": {}
|
|
302
|
-
},
|
|
303
242
|
"agent:stop": {
|
|
304
243
|
"id": "agent:stop",
|
|
305
244
|
"description": "Stop agent daemon.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52-main.18d393e",
|
|
4
4
|
"description": "DXOS CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dxos",
|
|
@@ -47,28 +47,28 @@
|
|
|
47
47
|
"tempy": "^1.0.1",
|
|
48
48
|
"uuid": "^8.3.2",
|
|
49
49
|
"ws": "^7.4.4",
|
|
50
|
-
"@dxos/agent": "0.1.
|
|
51
|
-
"@dxos/async": "0.1.
|
|
52
|
-
"@dxos/bare-template": "0.1.
|
|
53
|
-
"@dxos/client": "0.1.
|
|
54
|
-
"@dxos/client-protocol": "0.1.
|
|
55
|
-
"@dxos/client-services": "0.1.
|
|
56
|
-
"@dxos/codec-protobuf": "0.1.
|
|
57
|
-
"@dxos/config": "0.1.
|
|
58
|
-
"@dxos/context": "0.1.
|
|
59
|
-
"@dxos/debug": "0.1.
|
|
60
|
-
"@dxos/hello-template": "0.1.
|
|
61
|
-
"@dxos/keys": "0.1.
|
|
62
|
-
"@dxos/log": "0.1.
|
|
63
|
-
"@dxos/observable-object": "0.1.
|
|
64
|
-
"@dxos/plate": "0.1.
|
|
65
|
-
"@dxos/protocols": "0.1.
|
|
66
|
-
"@dxos/rpc": "0.1.
|
|
67
|
-
"@dxos/sentry": "0.1.
|
|
68
|
-
"@dxos/tasks-template": "0.1.
|
|
69
|
-
"@dxos/telemetry": "0.1.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
50
|
+
"@dxos/agent": "0.1.52-main.18d393e",
|
|
51
|
+
"@dxos/async": "0.1.52-main.18d393e",
|
|
52
|
+
"@dxos/bare-template": "0.1.52-main.18d393e",
|
|
53
|
+
"@dxos/client": "0.1.52-main.18d393e",
|
|
54
|
+
"@dxos/client-protocol": "0.1.52-main.18d393e",
|
|
55
|
+
"@dxos/client-services": "0.1.52-main.18d393e",
|
|
56
|
+
"@dxos/codec-protobuf": "0.1.52-main.18d393e",
|
|
57
|
+
"@dxos/config": "0.1.52-main.18d393e",
|
|
58
|
+
"@dxos/context": "0.1.52-main.18d393e",
|
|
59
|
+
"@dxos/debug": "0.1.52-main.18d393e",
|
|
60
|
+
"@dxos/hello-template": "0.1.52-main.18d393e",
|
|
61
|
+
"@dxos/keys": "0.1.52-main.18d393e",
|
|
62
|
+
"@dxos/log": "0.1.52-main.18d393e",
|
|
63
|
+
"@dxos/observable-object": "0.1.52-main.18d393e",
|
|
64
|
+
"@dxos/plate": "0.1.52-main.18d393e",
|
|
65
|
+
"@dxos/protocols": "0.1.52-main.18d393e",
|
|
66
|
+
"@dxos/rpc": "0.1.52-main.18d393e",
|
|
67
|
+
"@dxos/sentry": "0.1.52-main.18d393e",
|
|
68
|
+
"@dxos/tasks-template": "0.1.52-main.18d393e",
|
|
69
|
+
"@dxos/telemetry": "0.1.52-main.18d393e",
|
|
70
|
+
"@dxos/util": "0.1.52-main.18d393e",
|
|
71
|
+
"@dxos/websocket-rpc": "0.1.52-main.18d393e"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@oclif/test": "^2.3.11",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base-command';
|
|
2
|
-
export default class Run extends BaseCommand<typeof Run> {
|
|
3
|
-
static enableJsonFlag: boolean;
|
|
4
|
-
static description: string;
|
|
5
|
-
static flags: {
|
|
6
|
-
socket: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
'web-socket': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
-
http: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
epoch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
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
|
-
'no-agent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
-
};
|
|
17
|
-
run(): Promise<any>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../src/commands/agent/run.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW,CAAC,OAAO,GAAG,CAAC;IACtD,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAAsC;IAEjE,OAAgB,KAAK;;;;;;;;;;;MAgBnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAsC1B"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2023 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const core_1 = require("@oclif/core");
|
|
7
|
-
const agent_1 = require("@dxos/agent");
|
|
8
|
-
const client_protocol_1 = require("@dxos/client-protocol");
|
|
9
|
-
const base_command_1 = require("../../base-command");
|
|
10
|
-
const util_1 = require("../../util");
|
|
11
|
-
class Run extends base_command_1.BaseCommand {
|
|
12
|
-
async run() {
|
|
13
|
-
const listen = [];
|
|
14
|
-
if (this.flags.socket) {
|
|
15
|
-
listen.push(`unix://${client_protocol_1.DX_RUNTIME}/profile/${this.flags.profile}/agent.sock`);
|
|
16
|
-
}
|
|
17
|
-
if (this.flags['web-socket']) {
|
|
18
|
-
listen.push(`ws://localhost:${this.flags['web-socket']}`);
|
|
19
|
-
}
|
|
20
|
-
if (this.flags.http) {
|
|
21
|
-
listen.push(`http://localhost:${this.flags.http}`);
|
|
22
|
-
}
|
|
23
|
-
const options = {
|
|
24
|
-
profile: this.flags.profile,
|
|
25
|
-
listen,
|
|
26
|
-
};
|
|
27
|
-
// TODO(burdon): Build monitoring into agent start (not just epoch).
|
|
28
|
-
if (this.flags.epoch && this.flags.epoch !== '0') {
|
|
29
|
-
options.monitor = {
|
|
30
|
-
limit: (0, util_1.safeParseInt)(this.flags.epoch, undefined),
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const agent = new agent_1.Agent(this.clientConfig, options);
|
|
34
|
-
await agent.start();
|
|
35
|
-
// NOTE: This is currently called by the agent's forever daemon.
|
|
36
|
-
this.log('Agent started... (ctrl-c to exit)');
|
|
37
|
-
process.on('SIGINT', async () => {
|
|
38
|
-
await agent.stop();
|
|
39
|
-
process.exit(0);
|
|
40
|
-
});
|
|
41
|
-
if (this.flags['web-socket']) {
|
|
42
|
-
this.log(`Open devtools: https://devtools.dxos.org?target=ws://localhost:${this.flags['web-socket']}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
Run.enableJsonFlag = true;
|
|
47
|
-
Run.description = 'Run agent as foreground process.';
|
|
48
|
-
Run.flags = {
|
|
49
|
-
...base_command_1.BaseCommand.flags,
|
|
50
|
-
socket: core_1.Flags.boolean({
|
|
51
|
-
description: 'Expose socket.',
|
|
52
|
-
default: true,
|
|
53
|
-
}),
|
|
54
|
-
'web-socket': core_1.Flags.integer({
|
|
55
|
-
description: 'Expose web socket port.',
|
|
56
|
-
aliases: ['ws'],
|
|
57
|
-
}),
|
|
58
|
-
http: core_1.Flags.integer({
|
|
59
|
-
description: 'Expose HTTP proxy.',
|
|
60
|
-
}),
|
|
61
|
-
epoch: core_1.Flags.string({
|
|
62
|
-
description: 'Manage epochs (set to "auto" or message count).',
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
exports.default = Run;
|
|
66
|
-
//# sourceMappingURL=run.js.map
|
|
@@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