@deepseek-ai/libreoffice-kit 0.1.3 → 0.1.4

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 CHANGED
@@ -52,6 +52,8 @@ npm exec -- dsoffice recalculate --input budget.xlsx --output recalculated.xlsx
52
52
 
53
53
  Conversion workers run the package's shipped JavaScript with an empty `execArgv`; consumer launch flags such as `--input-type=module` are not inherited.
54
54
 
55
+ Windows native helpers use anonymous stdio pipes and inherit the caller's token and Job restrictions. Pipe polling does not occupy libuv worker threads while a helper waits for commands. Cancellation waits for process exit and pipe closure; this transport does not grant additional filesystem or network access.
56
+
55
57
  On Windows, an engine executable or program path of 260 or more characters uses a temporary helper copy and a junction to the installed resources inside the private operation directory. Resources stay in their installation, and the junction remains until the helper closes. A renderer that exits before returning a protocol response rejects with its exit status and captured diagnostics.
56
58
 
57
59
  On Linux, the native child searches the selected engine's program directory before system paths for shared libraries. Caller-provided `LD_LIBRARY_PATH` and `LD_PRELOAD` are not inherited.
package/README.zh.md CHANGED
@@ -54,6 +54,8 @@ npm exec -- dsoffice recalculate --input budget.xlsx --output recalculated.xlsx
54
54
 
55
55
  转换 worker 以空的 `execArgv` 运行包内发布的 JavaScript;`--input-type=module` 之类的调用方启动参数不会被继承。
56
56
 
57
+ Windows 原生 helper 使用匿名标准输入输出管道,继承调用方的令牌和 Job 限制。helper 等待命令时,管道轮询不会占用 libuv 工作线程。取消会等待进程退出和管道关闭;此传输方式不授予额外的文件系统或网络权限。
58
+
57
59
  在 Linux 上,原生子进程会先在所选引擎的 program 目录中查找共享库,然后才查找系统路径。调用方提供的 `LD_LIBRARY_PATH` 和 `LD_PRELOAD` 不会被继承。
58
60
 
59
61
  调用方负责授权输入访问并拥有私有输入/输出目录;路径必须是绝对路径,并在转换期间保持不变。输入文件必须是常规 Office 文件,且在配置的字节限制之内。ZIP 条目数和解压大小限制适用于 OOXML;二进制 DOC/XLS/PPT 使用 OLE 复合容器,内部结构由 LibreOffice 导入器验证。二进制格式仍遵守相同的转换超时和输入/输出限制。输出创建使用独占模式和 `0600` 权限;已存在的输出绝不会被覆盖。失败或取消的渲染会删除新建的输出。`maxOutputBytes` 限制返回的 PDF 及其读取缓冲区;原生临时磁盘文件在导出完成前可能继续增长,随后过大的 PDF 会在 Node 读取之前被拒绝并删除。成功的 PDF 归调用方所有,调用方可以将其字节发送给浏览器 PDF 阅读器。
package/lib/cli.js CHANGED
@@ -2,11 +2,14 @@
2
2
  import { createRequire } from "node:module";
3
3
  import { parseArgs } from "node:util";
4
4
  import { dirname, extname, isAbsolute, join, posix, relative, resolve, sep, win32 } from "node:path";
5
- import { constants, lstatSync, readdirSync } from "node:fs";
5
+ import { closeSync, constants, createWriteStream, lstatSync, readSync, readdirSync } from "node:fs";
6
6
  import { copyFile, lstat, mkdir, mkdtemp, open, readFile, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
7
7
  import { homedir, tmpdir } from "node:os";
8
8
  import { Worker } from "node:worker_threads";
9
9
  import { spawn } from "node:child_process";
10
+ import { EventEmitter } from "node:events";
11
+ import { Readable } from "node:stream";
12
+ import { finished } from "node:stream/promises";
10
13
  import { createHash, randomUUID } from "node:crypto";
11
14
  import { createInterface } from "node:readline";
12
15
  import { zlibSync } from "fflate";
@@ -317,6 +320,164 @@ function selectedPages(pages, count, limit) {
317
320
  return result;
318
321
  }
319
322
  //#endregion
323
+ //#region lib/types/native-process.js
324
+ /** Native helper stdio; Windows anonymous pipes retain the caller's restricted-token permissions. */
325
+ function windowsPipes() {
326
+ const koffi = createRequire(import.meta.url)("koffi");
327
+ const kernel = koffi.load("kernel32.dll"), node = koffi.load(null);
328
+ const createPipe = kernel.func("int __stdcall CreatePipe(_Out_ void **read, _Out_ void **write, void *attributes, uint32 size)");
329
+ const closeHandle = kernel.func("int __stdcall CloseHandle(void *handle)");
330
+ const peek = kernel.func("int __stdcall PeekNamedPipe(void *pipe, void *buffer, uint32 size, void *read, _Out_ uint32 *available, void *remaining)");
331
+ const lastError = kernel.func("uint32 __stdcall GetLastError()");
332
+ const openFd = node.func("int uv_open_osfhandle(void *handle)");
333
+ function pipe() {
334
+ const reads = [null], writes = [null];
335
+ if (!createPipe(reads, writes, null, 0)) throw new Error(`CreatePipe failed: ${lastError()}`);
336
+ const read = openFd(reads[0]);
337
+ if (read < 0) {
338
+ closeHandle(reads[0]);
339
+ closeHandle(writes[0]);
340
+ throw new Error("Cannot open anonymous input descriptor");
341
+ }
342
+ const write = openFd(writes[0]);
343
+ if (write < 0) {
344
+ closeSync(read);
345
+ closeHandle(writes[0]);
346
+ throw new Error("Cannot open anonymous output descriptor");
347
+ }
348
+ let timer;
349
+ let ended = false;
350
+ const readable = new Readable({
351
+ read() {
352
+ if (timer === void 0 && !ended) poll();
353
+ },
354
+ destroy(error, callback) {
355
+ ended = true;
356
+ clearTimeout(timer);
357
+ try {
358
+ closeSync(read);
359
+ callback(error);
360
+ } catch (cause) {
361
+ callback(error ?? cause);
362
+ }
363
+ }
364
+ });
365
+ function poll() {
366
+ timer = void 0;
367
+ try {
368
+ const available = [0];
369
+ if (!peek(reads[0], null, 0, null, available, null)) {
370
+ const code = lastError();
371
+ if (code !== 109) throw new Error(`PeekNamedPipe failed: ${code}`);
372
+ ended = true;
373
+ readable.push(null);
374
+ return;
375
+ }
376
+ if (available[0] > 0) {
377
+ const buffer = Buffer.allocUnsafe(Math.min(available[0], 65536));
378
+ const count = readSync(read, buffer, 0, buffer.length, null);
379
+ if (!readable.push(buffer.subarray(0, count))) return;
380
+ }
381
+ timer = setTimeout(poll, 5);
382
+ } catch (error) {
383
+ readable.destroy(error);
384
+ }
385
+ }
386
+ return {
387
+ read,
388
+ write,
389
+ readable
390
+ };
391
+ }
392
+ return { pipe };
393
+ }
394
+ /**
395
+ * Spawn with inherited token and Job restrictions; pipe creation never requests a new sandbox policy.
396
+ * @param executable - Verified native helper executable.
397
+ * @param args - Helper protocol arguments.
398
+ * @param env - Filtered operation environment.
399
+ * @returns Helper streams and process lifetime, with output drained before close.
400
+ */
401
+ function spawnNative(executable, args, env) {
402
+ if (process.platform !== "win32") return spawn(executable, args, {
403
+ stdio: "pipe",
404
+ windowsHide: true,
405
+ env
406
+ });
407
+ const { pipe } = windowsPipes();
408
+ const owned = [];
409
+ let child;
410
+ try {
411
+ const input = pipe();
412
+ owned.push(input);
413
+ const output = pipe();
414
+ owned.push(output);
415
+ const error = pipe();
416
+ owned.push(error);
417
+ child = spawn(executable, args, {
418
+ stdio: [
419
+ input.read,
420
+ output.write,
421
+ error.write
422
+ ],
423
+ windowsHide: true,
424
+ env
425
+ });
426
+ } catch (error) {
427
+ for (const entry of owned) {
428
+ entry.readable.destroy();
429
+ closeSync(entry.write);
430
+ }
431
+ throw error;
432
+ }
433
+ const [input, output, error] = owned;
434
+ input.readable.destroy();
435
+ closeSync(output.write);
436
+ closeSync(error.write);
437
+ const stdin = createWriteStream("", {
438
+ fd: input.write,
439
+ autoClose: true
440
+ });
441
+ const helper = new class extends EventEmitter {
442
+ stdin = stdin;
443
+ stdout = output.readable;
444
+ stderr = error.readable;
445
+ get exitCode() {
446
+ return child.exitCode;
447
+ }
448
+ get signalCode() {
449
+ return child.signalCode;
450
+ }
451
+ kill(signal) {
452
+ return child.kill(signal);
453
+ }
454
+ }();
455
+ let failure;
456
+ const fail = (cause) => {
457
+ failure ??= cause;
458
+ child.kill("SIGKILL");
459
+ };
460
+ stdin.on("error", fail);
461
+ output.readable.on("error", fail);
462
+ error.readable.on("error", fail);
463
+ const drained = Promise.allSettled([
464
+ finished(stdin),
465
+ finished(output.readable),
466
+ finished(error.readable)
467
+ ]);
468
+ child.once("error", (cause) => {
469
+ failure ??= cause;
470
+ });
471
+ child.once("close", (code, signal) => {
472
+ stdin.destroy();
473
+ drained.then(() => {
474
+ if (failure !== void 0) helper.emit("error", failure);
475
+ helper.emit("close", code, signal);
476
+ });
477
+ });
478
+ return helper;
479
+ }
480
+ //#endregion
320
481
  //#region lib/types/profile.js
321
482
  /** Private headless profile used by both native and WASM conversions. */
322
483
  /**
@@ -607,7 +768,7 @@ async function runNative(engine, options, input, output, profile, fonts, substit
607
768
  return withNativeEngine(engine, profile, async (engine) => {
608
769
  signal.throwIfAborted();
609
770
  const env = nativeEnvironment(profile, engine.programDirectory);
610
- const child = spawn(engine.executable, [
771
+ const child = spawnNative(engine.executable, [
611
772
  "--program-directory",
612
773
  engine.programDirectory,
613
774
  "--input-path",
@@ -626,15 +787,8 @@ async function runNative(engine, options, input, output, profile, fonts, substit
626
787
  String(operation.recalculate),
627
788
  ...operation.sheet === void 0 ? [] : ["--sheet", operation.sheet],
628
789
  ...fonts.flatMap((path) => ["--font-file", path])
629
- ], {
630
- stdio: [
631
- "ignore",
632
- "pipe",
633
- "pipe"
634
- ],
635
- windowsHide: true,
636
- env
637
- });
790
+ ], env);
791
+ child.stdin.end();
638
792
  let stdout = "";
639
793
  let stderr = "";
640
794
  let failure;
@@ -816,7 +970,7 @@ async function renderImagesWithNative(request) {
816
970
  await prepareNativeFontProfile(profile, substitutions);
817
971
  return withNativeEngine(engine, profile, async (engine) => {
818
972
  signal.throwIfAborted();
819
- const child = spawn(engine.executable, [
973
+ const child = spawnNative(engine.executable, [
820
974
  "--operation",
821
975
  "render-images",
822
976
  "--program-directory",
@@ -832,15 +986,7 @@ async function renderImagesWithNative(request) {
832
986
  "--max-image-resolution",
833
987
  String(options.maxImageResolution),
834
988
  ...fonts.flatMap((path) => ["--font-file", path])
835
- ], {
836
- stdio: [
837
- "pipe",
838
- "pipe",
839
- "pipe"
840
- ],
841
- windowsHide: true,
842
- env: nativeEnvironment(profile, engine.programDirectory)
843
- });
989
+ ], nativeEnvironment(profile, engine.programDirectory));
844
990
  const lines = [];
845
991
  const waiters = [];
846
992
  const output = createInterface({ input: child.stdout });
@@ -1278,16 +1424,16 @@ function resolveOptions(input = {}) {
1278
1424
  /** Resolve installed, version-matched engine packages without downloads or compilation. */
1279
1425
  const require = createRequire(import.meta.url);
1280
1426
  /** Node API release version returned by runtime discovery. */
1281
- const ENGINE_VERSION = "0.1.3";
1427
+ const ENGINE_VERSION = "0.1.4";
1282
1428
  /** Exact compatible engine versions; unchanged platforms retain their published packages. */
1283
1429
  const ENGINE_VERSIONS = Object.freeze({
1284
- "darwin-arm64": "0.1.3",
1285
- "darwin-x64": "0.1.3",
1430
+ "darwin-arm64": "0.1.4",
1431
+ "darwin-x64": "0.1.4",
1286
1432
  "linux-arm64-glibc": "0.1.1",
1287
1433
  "linux-x64-glibc": "0.1.1",
1288
- "win32-arm64": "0.1.3",
1289
- "win32-x64": "0.1.3",
1290
- wasm: "0.1.3"
1434
+ "win32-arm64": "0.1.4",
1435
+ "win32-x64": "0.1.4",
1436
+ wasm: "0.1.4"
1291
1437
  });
1292
1438
  /** npm scope and name prefix shared by the engine packages this adapter installs. */
1293
1439
  const ENGINE_PREFIX = "@deepseek-ai/libreoffice-kit";
package/lib/index.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import { createRequire } from "node:module";
2
- import { constants, lstatSync, readdirSync } from "node:fs";
2
+ import { closeSync, constants, createWriteStream, lstatSync, readSync, readdirSync } from "node:fs";
3
3
  import { copyFile, lstat, mkdir, mkdtemp, open, readFile, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
4
4
  import { homedir, tmpdir } from "node:os";
5
5
  import { dirname, extname, isAbsolute, join, posix, relative, resolve, sep, win32 } from "node:path";
6
6
  import { Worker } from "node:worker_threads";
7
7
  import { spawn } from "node:child_process";
8
+ import { EventEmitter } from "node:events";
9
+ import { Readable } from "node:stream";
10
+ import { finished } from "node:stream/promises";
8
11
  import { createHash, randomUUID } from "node:crypto";
9
12
  import { createInterface } from "node:readline";
10
13
  import { zlibSync } from "fflate";
@@ -315,6 +318,164 @@ function selectedPages(pages, count, limit) {
315
318
  return result;
316
319
  }
317
320
  //#endregion
321
+ //#region lib/types/native-process.js
322
+ /** Native helper stdio; Windows anonymous pipes retain the caller's restricted-token permissions. */
323
+ function windowsPipes() {
324
+ const koffi = createRequire(import.meta.url)("koffi");
325
+ const kernel = koffi.load("kernel32.dll"), node = koffi.load(null);
326
+ const createPipe = kernel.func("int __stdcall CreatePipe(_Out_ void **read, _Out_ void **write, void *attributes, uint32 size)");
327
+ const closeHandle = kernel.func("int __stdcall CloseHandle(void *handle)");
328
+ const peek = kernel.func("int __stdcall PeekNamedPipe(void *pipe, void *buffer, uint32 size, void *read, _Out_ uint32 *available, void *remaining)");
329
+ const lastError = kernel.func("uint32 __stdcall GetLastError()");
330
+ const openFd = node.func("int uv_open_osfhandle(void *handle)");
331
+ function pipe() {
332
+ const reads = [null], writes = [null];
333
+ if (!createPipe(reads, writes, null, 0)) throw new Error(`CreatePipe failed: ${lastError()}`);
334
+ const read = openFd(reads[0]);
335
+ if (read < 0) {
336
+ closeHandle(reads[0]);
337
+ closeHandle(writes[0]);
338
+ throw new Error("Cannot open anonymous input descriptor");
339
+ }
340
+ const write = openFd(writes[0]);
341
+ if (write < 0) {
342
+ closeSync(read);
343
+ closeHandle(writes[0]);
344
+ throw new Error("Cannot open anonymous output descriptor");
345
+ }
346
+ let timer;
347
+ let ended = false;
348
+ const readable = new Readable({
349
+ read() {
350
+ if (timer === void 0 && !ended) poll();
351
+ },
352
+ destroy(error, callback) {
353
+ ended = true;
354
+ clearTimeout(timer);
355
+ try {
356
+ closeSync(read);
357
+ callback(error);
358
+ } catch (cause) {
359
+ callback(error ?? cause);
360
+ }
361
+ }
362
+ });
363
+ function poll() {
364
+ timer = void 0;
365
+ try {
366
+ const available = [0];
367
+ if (!peek(reads[0], null, 0, null, available, null)) {
368
+ const code = lastError();
369
+ if (code !== 109) throw new Error(`PeekNamedPipe failed: ${code}`);
370
+ ended = true;
371
+ readable.push(null);
372
+ return;
373
+ }
374
+ if (available[0] > 0) {
375
+ const buffer = Buffer.allocUnsafe(Math.min(available[0], 65536));
376
+ const count = readSync(read, buffer, 0, buffer.length, null);
377
+ if (!readable.push(buffer.subarray(0, count))) return;
378
+ }
379
+ timer = setTimeout(poll, 5);
380
+ } catch (error) {
381
+ readable.destroy(error);
382
+ }
383
+ }
384
+ return {
385
+ read,
386
+ write,
387
+ readable
388
+ };
389
+ }
390
+ return { pipe };
391
+ }
392
+ /**
393
+ * Spawn with inherited token and Job restrictions; pipe creation never requests a new sandbox policy.
394
+ * @param executable - Verified native helper executable.
395
+ * @param args - Helper protocol arguments.
396
+ * @param env - Filtered operation environment.
397
+ * @returns Helper streams and process lifetime, with output drained before close.
398
+ */
399
+ function spawnNative(executable, args, env) {
400
+ if (process.platform !== "win32") return spawn(executable, args, {
401
+ stdio: "pipe",
402
+ windowsHide: true,
403
+ env
404
+ });
405
+ const { pipe } = windowsPipes();
406
+ const owned = [];
407
+ let child;
408
+ try {
409
+ const input = pipe();
410
+ owned.push(input);
411
+ const output = pipe();
412
+ owned.push(output);
413
+ const error = pipe();
414
+ owned.push(error);
415
+ child = spawn(executable, args, {
416
+ stdio: [
417
+ input.read,
418
+ output.write,
419
+ error.write
420
+ ],
421
+ windowsHide: true,
422
+ env
423
+ });
424
+ } catch (error) {
425
+ for (const entry of owned) {
426
+ entry.readable.destroy();
427
+ closeSync(entry.write);
428
+ }
429
+ throw error;
430
+ }
431
+ const [input, output, error] = owned;
432
+ input.readable.destroy();
433
+ closeSync(output.write);
434
+ closeSync(error.write);
435
+ const stdin = createWriteStream("", {
436
+ fd: input.write,
437
+ autoClose: true
438
+ });
439
+ const helper = new class extends EventEmitter {
440
+ stdin = stdin;
441
+ stdout = output.readable;
442
+ stderr = error.readable;
443
+ get exitCode() {
444
+ return child.exitCode;
445
+ }
446
+ get signalCode() {
447
+ return child.signalCode;
448
+ }
449
+ kill(signal) {
450
+ return child.kill(signal);
451
+ }
452
+ }();
453
+ let failure;
454
+ const fail = (cause) => {
455
+ failure ??= cause;
456
+ child.kill("SIGKILL");
457
+ };
458
+ stdin.on("error", fail);
459
+ output.readable.on("error", fail);
460
+ error.readable.on("error", fail);
461
+ const drained = Promise.allSettled([
462
+ finished(stdin),
463
+ finished(output.readable),
464
+ finished(error.readable)
465
+ ]);
466
+ child.once("error", (cause) => {
467
+ failure ??= cause;
468
+ });
469
+ child.once("close", (code, signal) => {
470
+ stdin.destroy();
471
+ drained.then(() => {
472
+ if (failure !== void 0) helper.emit("error", failure);
473
+ helper.emit("close", code, signal);
474
+ });
475
+ });
476
+ return helper;
477
+ }
478
+ //#endregion
318
479
  //#region lib/types/profile.js
319
480
  /** Private headless profile used by both native and WASM conversions. */
320
481
  /**
@@ -605,7 +766,7 @@ async function runNative(engine, options, input, output, profile, fonts, substit
605
766
  return withNativeEngine(engine, profile, async (engine) => {
606
767
  signal.throwIfAborted();
607
768
  const env = nativeEnvironment(profile, engine.programDirectory);
608
- const child = spawn(engine.executable, [
769
+ const child = spawnNative(engine.executable, [
609
770
  "--program-directory",
610
771
  engine.programDirectory,
611
772
  "--input-path",
@@ -624,15 +785,8 @@ async function runNative(engine, options, input, output, profile, fonts, substit
624
785
  String(operation.recalculate),
625
786
  ...operation.sheet === void 0 ? [] : ["--sheet", operation.sheet],
626
787
  ...fonts.flatMap((path) => ["--font-file", path])
627
- ], {
628
- stdio: [
629
- "ignore",
630
- "pipe",
631
- "pipe"
632
- ],
633
- windowsHide: true,
634
- env
635
- });
788
+ ], env);
789
+ child.stdin.end();
636
790
  let stdout = "";
637
791
  let stderr = "";
638
792
  let failure;
@@ -814,7 +968,7 @@ async function renderImagesWithNative(request) {
814
968
  await prepareNativeFontProfile(profile, substitutions);
815
969
  return withNativeEngine(engine, profile, async (engine) => {
816
970
  signal.throwIfAborted();
817
- const child = spawn(engine.executable, [
971
+ const child = spawnNative(engine.executable, [
818
972
  "--operation",
819
973
  "render-images",
820
974
  "--program-directory",
@@ -830,15 +984,7 @@ async function renderImagesWithNative(request) {
830
984
  "--max-image-resolution",
831
985
  String(options.maxImageResolution),
832
986
  ...fonts.flatMap((path) => ["--font-file", path])
833
- ], {
834
- stdio: [
835
- "pipe",
836
- "pipe",
837
- "pipe"
838
- ],
839
- windowsHide: true,
840
- env: nativeEnvironment(profile, engine.programDirectory)
841
- });
987
+ ], nativeEnvironment(profile, engine.programDirectory));
842
988
  const lines = [];
843
989
  const waiters = [];
844
990
  const output = createInterface({ input: child.stdout });
@@ -1276,16 +1422,16 @@ function resolveOptions(input = {}) {
1276
1422
  /** Resolve installed, version-matched engine packages without downloads or compilation. */
1277
1423
  const require = createRequire(import.meta.url);
1278
1424
  /** Node API release version returned by runtime discovery. */
1279
- const ENGINE_VERSION = "0.1.3";
1425
+ const ENGINE_VERSION = "0.1.4";
1280
1426
  /** Exact compatible engine versions; unchanged platforms retain their published packages. */
1281
1427
  const ENGINE_VERSIONS = Object.freeze({
1282
- "darwin-arm64": "0.1.3",
1283
- "darwin-x64": "0.1.3",
1428
+ "darwin-arm64": "0.1.4",
1429
+ "darwin-x64": "0.1.4",
1284
1430
  "linux-arm64-glibc": "0.1.1",
1285
1431
  "linux-x64-glibc": "0.1.1",
1286
- "win32-arm64": "0.1.3",
1287
- "win32-x64": "0.1.3",
1288
- wasm: "0.1.3"
1432
+ "win32-arm64": "0.1.4",
1433
+ "win32-x64": "0.1.4",
1434
+ wasm: "0.1.4"
1289
1435
  });
1290
1436
  /** npm scope and name prefix shared by the engine packages this adapter installs. */
1291
1437
  const ENGINE_PREFIX = "@deepseek-ai/libreoffice-kit";
@@ -1,5 +1,5 @@
1
1
  /** Node API release version returned by runtime discovery. */
2
- export declare const ENGINE_VERSION = "0.1.3";
2
+ export declare const ENGINE_VERSION = "0.1.4";
3
3
  /** Exact compatible engine versions; unchanged platforms retain their published packages. */
4
4
  export declare const ENGINE_VERSIONS: Readonly<Record<string, string>>;
5
5
  /** Host diagnostic fields used to identify the runtime glibc version. */
@@ -0,0 +1,20 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import { Readable, Writable } from 'node:stream';
3
+ /** The helper owner observes closure only after both output pipes finish. */
4
+ export interface NativeChild extends EventEmitter {
5
+ stdin: Writable;
6
+ stdout: Readable;
7
+ stderr: Readable;
8
+ readonly exitCode: number | null;
9
+ readonly signalCode: NodeJS.Signals | null;
10
+ kill(signal: NodeJS.Signals): boolean;
11
+ }
12
+ /**
13
+ * Spawn with inherited token and Job restrictions; pipe creation never requests a new sandbox policy.
14
+ * @param executable - Verified native helper executable.
15
+ * @param args - Helper protocol arguments.
16
+ * @param env - Filtered operation environment.
17
+ * @returns Helper streams and process lifetime, with output drained before close.
18
+ */
19
+ export declare function spawnNative(executable: string, args: string[], env: NodeJS.ProcessEnv): NativeChild;
20
+ //# sourceMappingURL=native-process.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/libreoffice-kit",
3
3
  "description": "Convert, recalculate, and render Office documents with prebuilt LibreOffice",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,14 +37,15 @@
37
37
  "dependencies": {
38
38
  "fflate": "0.8.2",
39
39
  "fontkit": "2.0.4",
40
+ "koffi": "3.1.1",
40
41
  "saxes": "6.0.0"
41
42
  },
42
43
  "optionalDependencies": {
43
- "@deepseek-ai/libreoffice-kit-darwin-arm64": "0.1.3",
44
- "@deepseek-ai/libreoffice-kit-win32-x64": "0.1.3",
45
- "@deepseek-ai/libreoffice-kit-wasm": "0.1.3",
46
- "@deepseek-ai/libreoffice-kit-darwin-x64": "0.1.3",
47
- "@deepseek-ai/libreoffice-kit-win32-arm64": "0.1.3"
44
+ "@deepseek-ai/libreoffice-kit-darwin-arm64": "0.1.4",
45
+ "@deepseek-ai/libreoffice-kit-wasm": "0.1.4",
46
+ "@deepseek-ai/libreoffice-kit-win32-x64": "0.1.4",
47
+ "@deepseek-ai/libreoffice-kit-darwin-x64": "0.1.4",
48
+ "@deepseek-ai/libreoffice-kit-win32-arm64": "0.1.4"
48
49
  },
49
50
  "bin": {
50
51
  "dsoffice": "./lib/cli.js"