diggylab 0.1.30 → 0.1.31

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 (3) hide show
  1. package/README.md +15 -2
  2. package/cli.js +19 -12
  3. 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`. Bump the version in `apps/desktop-agent/package.json`
41
- first — the packed manifest copies it.
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, pathToFileURL } from "node:url";
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 entry2 = {
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(entry2);
546
- for (const listener of this.listeners) listener(entry2);
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 entry2 = JSON.parse(line);
560
- if (isEntry(entry2)) entries.push(entry2);
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(entry2) {
585
+ async persist(entry) {
586
586
  await mkdir(this.options.directory, { recursive: true });
587
- const day = entry2.timestamp.slice(0, 10);
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(entry2)}
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")) {
@@ -2767,8 +2767,15 @@ async function main(argv, io = console) {
2767
2767
  return commandUnpair(runtime, io);
2768
2768
  }
2769
2769
  }
2770
- var entry = process.argv[1] ? pathToFileURL(process.argv[1]).href : "";
2771
- if (import.meta.url === entry) {
2770
+ function isEntryPoint() {
2771
+ if (!process.argv[1]) return false;
2772
+ try {
2773
+ return realpathSync(process.argv[1]) === fileURLToPath(import.meta.url);
2774
+ } catch {
2775
+ return false;
2776
+ }
2777
+ }
2778
+ if (isEntryPoint()) {
2772
2779
  void main(process.argv.slice(2)).then((code) => {
2773
2780
  process.exitCode = code;
2774
2781
  }).catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diggylab",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "description": "DiggyLab Desktop Agent collects posts and information from Facebook Groups on a paired computer. (headless CLI)",
5
5
  "type": "module",
6
6
  "bin": {