@flowriki/agent 0.1.0-beta.1 → 0.1.0-beta.10
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 +30 -7
- package/dist/accname.global.js +1 -0
- package/dist/bin.js +9 -0
- package/dist/{chunk-ATOHKUGQ.js → chunk-O5HHREII.js} +3278 -1826
- package/dist/cli.js +18 -9
- package/dist/engine.js +5 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -4,17 +4,14 @@ import {
|
|
|
4
4
|
connect,
|
|
5
5
|
disconnect,
|
|
6
6
|
doctor,
|
|
7
|
+
prepareBrowsers,
|
|
7
8
|
resolveCheckouts,
|
|
8
9
|
start,
|
|
9
10
|
status
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-O5HHREII.js";
|
|
11
12
|
|
|
12
13
|
// src/cli.ts
|
|
13
14
|
import { parseArgs } from "util";
|
|
14
|
-
process.on("warning", (warning) => {
|
|
15
|
-
if (warning.name === "ExperimentalWarning" && /SQLite/i.test(warning.message)) return;
|
|
16
|
-
console.warn(`${warning.name}: ${warning.message}`);
|
|
17
|
-
});
|
|
18
15
|
var paint = (code) => (s) => `\x1B[${code}m${s}\x1B[0m`;
|
|
19
16
|
var bold = paint("1");
|
|
20
17
|
var dim = paint("2");
|
|
@@ -31,6 +28,7 @@ ${bold("USAGE")}
|
|
|
31
28
|
flowriki-agent start run the agent (stays in the foreground)
|
|
32
29
|
flowriki-agent status is it connected, and what is prepared
|
|
33
30
|
flowriki-agent doctor diagnose setup problems
|
|
31
|
+
flowriki-agent prepare download the browser recording needs
|
|
34
32
|
flowriki-agent disconnect forget this computer's credential
|
|
35
33
|
|
|
36
34
|
${bold("OPTIONS")}
|
|
@@ -39,6 +37,7 @@ ${bold("OPTIONS")}
|
|
|
39
37
|
--name <label> how this computer appears in your dashboard
|
|
40
38
|
--service <url> advanced: a self-hosted Flowriki. Defaults to the
|
|
41
39
|
hosted service, which is what you want.
|
|
40
|
+
--no-open print the approval link without opening a browser
|
|
42
41
|
--json machine-readable output for status and doctor
|
|
43
42
|
-h, --help this
|
|
44
43
|
-v, --version version
|
|
@@ -58,6 +57,7 @@ async function main(argv) {
|
|
|
58
57
|
name: { type: "string" },
|
|
59
58
|
service: { type: "string" },
|
|
60
59
|
json: { type: "boolean" },
|
|
60
|
+
"no-open": { type: "boolean" },
|
|
61
61
|
help: { type: "boolean", short: "h" },
|
|
62
62
|
version: { type: "boolean", short: "v" }
|
|
63
63
|
}
|
|
@@ -83,6 +83,7 @@ Run \`flowriki-agent --help\`.`);
|
|
|
83
83
|
switch (command) {
|
|
84
84
|
case "connect": {
|
|
85
85
|
const result = await connect({
|
|
86
|
+
open: !values["no-open"],
|
|
86
87
|
...service ? { service } : {},
|
|
87
88
|
...values.name ? { machineName: String(values.name) } : {},
|
|
88
89
|
onProgress: (note) => {
|
|
@@ -93,7 +94,7 @@ Run \`flowriki-agent --help\`.`);
|
|
|
93
94
|
console.log(` ${url}
|
|
94
95
|
`);
|
|
95
96
|
if (note.detail?.["canOpen"] === false) {
|
|
96
|
-
console.log(dim("
|
|
97
|
+
console.log(dim(" Open the approval link in your browser.\n"));
|
|
97
98
|
} else {
|
|
98
99
|
console.log(dim(" Opening it for you. If nothing happens, use the link above.\n"));
|
|
99
100
|
}
|
|
@@ -133,8 +134,7 @@ Run \`flowriki-agent --help\`.`);
|
|
|
133
134
|
console.log(`${bold("Flowriki agent")} ${dim(AGENT_VERSION)}`);
|
|
134
135
|
console.log(dim(` connected as ${started.connection.machineName}`));
|
|
135
136
|
if (started.projects.length === 0) {
|
|
136
|
-
console.log(
|
|
137
|
-
console.log(dim(" Add one: flowriki-agent start --project /path/to/a/checkout"));
|
|
137
|
+
console.log(dim(" ready \u2014 this machine records and runs whatever the dashboard asks for"));
|
|
138
138
|
}
|
|
139
139
|
for (const project of started.projects) {
|
|
140
140
|
console.log(dim(` project ${project.name} (${project.root})`));
|
|
@@ -154,6 +154,11 @@ Run \`flowriki-agent --help\`.`);
|
|
|
154
154
|
return await new Promise(() => {
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
+
case "prepare": {
|
|
158
|
+
const result = await prepareBrowsers();
|
|
159
|
+
console.log(result.ok ? green(result.message) : red(result.message));
|
|
160
|
+
return result.ok ? 0 : 1;
|
|
161
|
+
}
|
|
157
162
|
case "status": {
|
|
158
163
|
const state = status(service);
|
|
159
164
|
if (values.json) {
|
|
@@ -186,7 +191,11 @@ Run \`flowriki-agent --help\`.`);
|
|
|
186
191
|
console.log(` node ${found.node} ${dim(`${found.platform}/${found.arch}`)}`);
|
|
187
192
|
console.log(` protocol ${found.protocolVersion}`);
|
|
188
193
|
console.log(` data ${found.dataDir}`);
|
|
189
|
-
console.log(
|
|
194
|
+
console.log(
|
|
195
|
+
` service ${found.service} ${found.reachable ? green("reachable") : red("unreachable")}` + // WHICH FLOWRIKI, from the service's own mouth. Not the site being
|
|
196
|
+
// tested — that is a project setting and changes nothing here.
|
|
197
|
+
(found.environment ? dim(` [${found.environment}]`) : "")
|
|
198
|
+
);
|
|
190
199
|
console.log(` credential ${found.credentialFingerprint ?? dim("none stored")}`);
|
|
191
200
|
console.log(
|
|
192
201
|
` browsers ${found.playwright.chromiumInstalled ? green("chromium ready") : yellow("chromium not installed")} ${dim(found.playwright.browsersPath ?? "")}`
|
package/dist/engine.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
AGENT_VERSION,
|
|
4
|
+
browsersReady,
|
|
4
5
|
connect,
|
|
5
6
|
disconnect,
|
|
6
7
|
doctor,
|
|
8
|
+
prepareBrowsers,
|
|
7
9
|
resolveCheckouts,
|
|
8
10
|
start,
|
|
9
11
|
status
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-O5HHREII.js";
|
|
11
13
|
export {
|
|
12
14
|
AGENT_VERSION,
|
|
15
|
+
browsersReady,
|
|
13
16
|
connect,
|
|
14
17
|
disconnect,
|
|
15
18
|
doctor,
|
|
19
|
+
prepareBrowsers,
|
|
16
20
|
resolveCheckouts,
|
|
17
21
|
start,
|
|
18
22
|
status
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowriki/agent",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.10",
|
|
4
4
|
"description": "Run Flowriki UI tests on your own computer. Connects this machine to your Flowriki account.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"flowriki-agent": "dist/
|
|
8
|
+
"flowriki-agent": "dist/bin.js"
|
|
9
9
|
},
|
|
10
10
|
"main": "./dist/engine.js",
|
|
11
11
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "git+https://github.com/Muhammad-Safiullah/flowriki.git",
|
|
40
|
-
"directory": "packages/agent-
|
|
40
|
+
"directory": "packages/agent-cli"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"flowriki",
|