@openduo/duoduo 0.2.12 → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openduo/duoduo",
3
- "version": "0.2.12",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -10,6 +10,7 @@
10
10
  "bin/duoduo",
11
11
  "bootstrap/",
12
12
  "dist/release/",
13
+ "scripts/postinstall.mjs",
13
14
  "README.md"
14
15
  ],
15
16
  "bin": {
@@ -72,6 +73,7 @@
72
73
  "format": "prettier --write .",
73
74
  "format:check": "prettier --check .",
74
75
  "lint-staged": "lint-staged",
76
+ "postinstall": "node scripts/postinstall.mjs",
75
77
  "dev": "bash scripts/dev.sh",
76
78
  "dev:host": "tsx watch src/daemon/daemon.ts",
77
79
  "dev:build": "bash scripts/dev.sh --build",
@@ -88,6 +90,7 @@
88
90
  "start:daemon": "tsx src/daemon/daemon.ts",
89
91
  "start:cli": "bash scripts/container-cli.sh",
90
92
  "mailbox:prompt": "tsx scripts/mailbox-prompt.ts",
93
+ "telemetry:report": "tsx scripts/telemetry-report.ts",
91
94
  "runtime:migrate": "tsx scripts/migrate-runtime-state.ts",
92
95
  "start:feishu": "bash scripts/feishu-gw.sh",
93
96
  "start:feishu:bg": "bash scripts/feishu-gw.sh --bg",
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ // Restore execute permission on vendored ripgrep binaries.
3
+ // npm pack strips all files to 0644, so after `npm install` the rg
4
+ // binaries are not executable. This script runs as a postinstall hook
5
+ // to fix that.
6
+ import { chmod, readdir } from "node:fs/promises";
7
+ import path from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
11
+ const rgDir = path.join(rootDir, "dist", "release", "vendor", "ripgrep");
12
+
13
+ try {
14
+ const entries = await readdir(rgDir, { withFileTypes: true });
15
+ for (const entry of entries) {
16
+ if (!entry.isDirectory()) continue;
17
+ for (const bin of ["rg", "rg.exe"]) {
18
+ const p = path.join(rgDir, entry.name, bin);
19
+ try { await chmod(p, 0o755); } catch { /* skip missing */ }
20
+ }
21
+ }
22
+ } catch {
23
+ // dist/release may not exist in dev-only installs — silently skip.
24
+ }