diggylab 0.1.30 → 0.1.32
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 +15 -2
- package/cli.js +22 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,8 +37,21 @@ npm publish apps/desktop-agent/dist-npm --access public
|
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
`cli:pack` bundles the workspace code into a single `cli.js`, so the published package only depends
|
|
40
|
-
on `playwright`, `qrcode-terminal`, and `ws`.
|
|
41
|
-
|
|
40
|
+
on `playwright`, `qrcode-terminal`, and `ws`. The packed manifest copies the version from
|
|
41
|
+
`apps/desktop-agent/package.json`; use the override below when the app release has not caught up yet.
|
|
42
|
+
|
|
43
|
+
### Publishing ahead of an app release
|
|
44
|
+
|
|
45
|
+
To ship a CLI fix before the next app release — without running the Version Release workflow — pack a
|
|
46
|
+
specific version. The repo version stays where the release workflow expects it, and that workflow
|
|
47
|
+
later lands on the same number:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pnpm --filter jobfinding-desktop-agent cli:pack -- --version 0.1.31
|
|
51
|
+
npm publish apps/desktop-agent/dist-npm --access public
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`CLI_PACKAGE_VERSION=0.1.31` works as well.
|
|
42
55
|
|
|
43
56
|
## Commands
|
|
44
57
|
|
package/cli.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
// src/cli/cli.ts
|
|
4
4
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
5
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
5
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, realpathSync } from "node:fs";
|
|
6
6
|
import { hostname, homedir } from "node:os";
|
|
7
7
|
import { dirname as dirname3, join as join4 } from "node:path";
|
|
8
|
-
import { fileURLToPath
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
9
|
|
|
10
10
|
// ../../packages/facebook-scanner/dist/parser.js
|
|
11
11
|
var paths = {
|
|
@@ -534,7 +534,7 @@ var ActivityLog = class {
|
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
536
|
append(input) {
|
|
537
|
-
const
|
|
537
|
+
const entry = {
|
|
538
538
|
...input,
|
|
539
539
|
id: this.options.randomUuid(),
|
|
540
540
|
timestamp: new Date(this.options.now()).toISOString(),
|
|
@@ -542,8 +542,8 @@ var ActivityLog = class {
|
|
|
542
542
|
message: sanitize(input.message).slice(0, 500)
|
|
543
543
|
};
|
|
544
544
|
this.pending = this.pending.catch(() => void 0).then(async () => {
|
|
545
|
-
await this.persist(
|
|
546
|
-
for (const listener of this.listeners) listener(
|
|
545
|
+
await this.persist(entry);
|
|
546
|
+
for (const listener of this.listeners) listener(entry);
|
|
547
547
|
});
|
|
548
548
|
return this.pending;
|
|
549
549
|
}
|
|
@@ -556,8 +556,8 @@ var ActivityLog = class {
|
|
|
556
556
|
for (const line of lines.split("\n")) {
|
|
557
557
|
if (!line) continue;
|
|
558
558
|
try {
|
|
559
|
-
const
|
|
560
|
-
if (isEntry(
|
|
559
|
+
const entry = JSON.parse(line);
|
|
560
|
+
if (isEntry(entry)) entries.push(entry);
|
|
561
561
|
} catch {
|
|
562
562
|
}
|
|
563
563
|
}
|
|
@@ -582,12 +582,12 @@ var ActivityLog = class {
|
|
|
582
582
|
const source = await readFile(join(this.options.directory, `${day}.jsonl`));
|
|
583
583
|
await writeFile(destination, await gzipAsync(source), { mode: 384 });
|
|
584
584
|
}
|
|
585
|
-
async persist(
|
|
585
|
+
async persist(entry) {
|
|
586
586
|
await mkdir(this.options.directory, { recursive: true });
|
|
587
|
-
const day =
|
|
587
|
+
const day = entry.timestamp.slice(0, 10);
|
|
588
588
|
const path = join(this.options.directory, `${day}.jsonl`);
|
|
589
589
|
const existing = await readFile(path, "utf8").catch(() => "");
|
|
590
|
-
const line = `${JSON.stringify(
|
|
590
|
+
const line = `${JSON.stringify(entry)}
|
|
591
591
|
`;
|
|
592
592
|
let value = `${existing}${line}`;
|
|
593
593
|
while (Buffer.byteLength(value) > this.options.maxFileBytes && value.includes("\n")) {
|
|
@@ -2612,8 +2612,9 @@ async function commandLogin(runtime, options, io) {
|
|
|
2612
2612
|
}
|
|
2613
2613
|
let display = null;
|
|
2614
2614
|
try {
|
|
2615
|
-
|
|
2616
|
-
|
|
2615
|
+
const needsVirtualDisplay = process.platform === "linux" && !process.env.DISPLAY;
|
|
2616
|
+
if (!needsVirtualDisplay) {
|
|
2617
|
+
io.log(process.env.DISPLAY ? `Opening the Facebook login page on display ${process.env.DISPLAY}.` : "Opening the Facebook login page in a browser window.");
|
|
2617
2618
|
} else {
|
|
2618
2619
|
display = await startVirtualDisplay({
|
|
2619
2620
|
bind: options.bind,
|
|
@@ -2767,8 +2768,15 @@ async function main(argv, io = console) {
|
|
|
2767
2768
|
return commandUnpair(runtime, io);
|
|
2768
2769
|
}
|
|
2769
2770
|
}
|
|
2770
|
-
|
|
2771
|
-
if (
|
|
2771
|
+
function isEntryPoint() {
|
|
2772
|
+
if (!process.argv[1]) return false;
|
|
2773
|
+
try {
|
|
2774
|
+
return realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
2775
|
+
} catch {
|
|
2776
|
+
return false;
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
if (isEntryPoint()) {
|
|
2772
2780
|
void main(process.argv.slice(2)).then((code) => {
|
|
2773
2781
|
process.exitCode = code;
|
|
2774
2782
|
}).catch((error) => {
|