@superdoc/sdk 2.17.0-next.7 → 2.17.0-next.9

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.
@@ -94,8 +94,27 @@ function resolveEmbeddedPlatformBinary(target, binaryName) {
94
94
  function ensureEmbeddedExecutable(binaryPath) {
95
95
  if (process.platform === 'win32')
96
96
  return;
97
+ // AIDEV-NOTE: Never chmod a binary this process can already execute. Every
98
+ // client construction lands here, and on overlayfs any metadata write to a
99
+ // file in a read-only image layer copies the whole binary (over 100 MB) into
100
+ // the container layer, synchronously. Frequent signals during that copy, as
101
+ // a sampling profiler sends, can keep the chmod from ever completing.
97
102
  try {
98
- node_fs.chmodSync(binaryPath, 0o755);
103
+ node_fs.accessSync(binaryPath, node_fs.constants.X_OK);
104
+ return;
105
+ }
106
+ catch {
107
+ // Not executable by this process: repair below.
108
+ }
109
+ let mode = 0o755;
110
+ try {
111
+ mode = (node_fs.statSync(binaryPath).mode & 0o7777) | 0o111;
112
+ }
113
+ catch {
114
+ // Unreadable mode is not a reason to skip the repair.
115
+ }
116
+ try {
117
+ node_fs.chmodSync(binaryPath, mode);
99
118
  }
100
119
  catch {
101
120
  // Non-fatal: spawn() reports the actionable execution error.
@@ -1,4 +1,4 @@
1
- import { chmodSync, existsSync } from 'node:fs';
1
+ import { accessSync, chmodSync, constants, existsSync, statSync } from 'node:fs';
2
2
  import { createRequire } from 'node:module';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
@@ -90,8 +90,27 @@ export function resolveEmbeddedPlatformBinary(target, binaryName) {
90
90
  export function ensureEmbeddedExecutable(binaryPath) {
91
91
  if (process.platform === 'win32')
92
92
  return;
93
+ // AIDEV-NOTE: Never chmod a binary this process can already execute. Every
94
+ // client construction lands here, and on overlayfs any metadata write to a
95
+ // file in a read-only image layer copies the whole binary (over 100 MB) into
96
+ // the container layer, synchronously. Frequent signals during that copy, as
97
+ // a sampling profiler sends, can keep the chmod from ever completing.
93
98
  try {
94
- chmodSync(binaryPath, 0o755);
99
+ accessSync(binaryPath, constants.X_OK);
100
+ return;
101
+ }
102
+ catch {
103
+ // Not executable by this process: repair below.
104
+ }
105
+ let mode = 0o755;
106
+ try {
107
+ mode = (statSync(binaryPath).mode & 0o7777) | 0o111;
108
+ }
109
+ catch {
110
+ // Unreadable mode is not a reason to skip the repair.
111
+ }
112
+ try {
113
+ chmodSync(binaryPath, mode);
95
114
  }
96
115
  catch {
97
116
  // Non-fatal: spawn() reports the actionable execution error.
@@ -3,6 +3,6 @@
3
3
  // AUTO-GENERATED by scripts/embed-version.mjs — DO NOT EDIT.
4
4
  // Source of truth: package.json. Regenerated on every SDK build so the
5
5
  // SDK retains its own version identity when bundled into another package.
6
- const SDK_VERSION = '2.17.0-next.7';
6
+ const SDK_VERSION = '2.17.0-next.9';
7
7
 
8
8
  exports.SDK_VERSION = SDK_VERSION;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.17.0-next.7";
1
+ export declare const SDK_VERSION = "2.17.0-next.9";
@@ -1,4 +1,4 @@
1
1
  // AUTO-GENERATED by scripts/embed-version.mjs — DO NOT EDIT.
2
2
  // Source of truth: package.json. Regenerated on every SDK build so the
3
3
  // SDK retains its own version identity when bundled into another package.
4
- export const SDK_VERSION = '2.17.0-next.7';
4
+ export const SDK_VERSION = '2.17.0-next.9';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc/sdk",
3
- "version": "2.17.0-next.7",
3
+ "version": "2.17.0-next.9",
4
4
  "description": "Node SDK for SuperDoc, wrapping the SuperDoc CLI to read and edit .docx files from JavaScript and TypeScript.",
5
5
  "private": false,
6
6
  "license": "AGPL-3.0",
@@ -38,11 +38,11 @@
38
38
  "typescript": "^5.9.2"
39
39
  },
40
40
  "optionalDependencies": {
41
- "@superdoc/sdk-darwin-arm64": "2.17.0-next.7",
42
- "@superdoc/sdk-darwin-x64": "2.17.0-next.7",
43
- "@superdoc/sdk-linux-x64": "2.17.0-next.7",
44
- "@superdoc/sdk-linux-arm64": "2.17.0-next.7",
45
- "@superdoc/sdk-windows-x64": "2.17.0-next.7"
41
+ "@superdoc/sdk-darwin-arm64": "2.17.0-next.9",
42
+ "@superdoc/sdk-darwin-x64": "2.17.0-next.9",
43
+ "@superdoc/sdk-linux-x64": "2.17.0-next.9",
44
+ "@superdoc/sdk-linux-arm64": "2.17.0-next.9",
45
+ "@superdoc/sdk-windows-x64": "2.17.0-next.9"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"