@deepseek-ai/libreoffice-kit 0.2.2 → 0.2.3-rc.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 +12 -0
- package/README.zh.md +12 -0
- package/frame-forwarding/README.md +6 -2
- package/frame-forwarding/README.zh.md +6 -2
- package/frame-forwarding/include/dsh_frame_forwarding.h +10 -1
- package/frame-forwarding/index.d.ts +1 -1
- package/frame-forwarding/prebuilds/darwin-arm64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/darwin-arm64/libdsh_frame_forwarding_sdk.a +0 -0
- package/frame-forwarding/prebuilds/darwin-arm64/manifest.json +13 -12
- package/frame-forwarding/prebuilds/darwin-x64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/darwin-x64/libdsh_frame_forwarding_sdk.a +0 -0
- package/frame-forwarding/prebuilds/darwin-x64/manifest.json +13 -12
- package/frame-forwarding/prebuilds/win32-arm64/dsh_frame_forwarding_sdk.lib +0 -0
- package/frame-forwarding/prebuilds/win32-arm64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/win32-arm64/manifest.json +13 -12
- package/frame-forwarding/prebuilds/win32-x64/dsh_frame_forwarding_sdk.lib +0 -0
- package/frame-forwarding/prebuilds/win32-x64/frame-forwarding.node +0 -0
- package/frame-forwarding/prebuilds/win32-x64/manifest.json +13 -12
- package/frame-forwarding/receipt.json +9 -8
- package/frame-forwarding/scripts/metadata.mjs +4 -3
- package/frame-forwarding/sdk.json +3 -2
- package/frame-forwarding/src/producer.cc +30 -7
- package/frame-forwarding/src/receiver.cc +7 -1
- package/frame-forwarding/src/transport.cc +28 -21
- package/frame-forwarding/src/transport.h +13 -0
- package/lib/cli.js +69 -20
- package/lib/editor.js +52 -15
- package/lib/index.js +69 -20
- package/lib/types/engine.d.ts +15 -4
- package/lib/types/errors.d.ts +6 -0
- package/lib/types/index.d.ts +7 -0
- package/lib/types/options.d.ts +9 -1
- package/lib/types/runtime.d.ts +5 -1
- package/package.json +6 -6
package/lib/types/engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Node API release version returned by runtime discovery. */
|
|
2
|
-
export declare const ENGINE_VERSION = "0.2.
|
|
2
|
+
export declare const ENGINE_VERSION = "0.2.3-rc.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. */
|
|
@@ -56,13 +56,24 @@ export declare function installedPackageExists(name: string): boolean;
|
|
|
56
56
|
* @returns the declared platform target, or undefined for an unsupported host.
|
|
57
57
|
*/
|
|
58
58
|
export declare function platformTarget(platform?: string, arch?: string, report?: () => EngineHostReport): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Map an engine package name to the absolute path of that package's installed `package.json`.
|
|
61
|
+
* The resolver receives the platform package name (`@deepseek-ai/libreoffice-kit-<target>`) when the host has a
|
|
62
|
+
* native target, and `@deepseek-ai/libreoffice-kit-wasm` when WASM is selected. To report an absent native package,
|
|
63
|
+
* throw an error whose `code` is `MODULE_NOT_FOUND` (as `require.resolve` does); that selects WASM. Any other
|
|
64
|
+
* failure, or a result that is not an absolute path to an existing file, rejects. The resolver must be synchronous. The adapter does not probe its own
|
|
65
|
+
* installation for packages a caller resolver reports missing.
|
|
66
|
+
*/
|
|
67
|
+
export type EnginePackageResolver = (name: string) => string;
|
|
59
68
|
/**
|
|
60
69
|
* Prefer the installed compatible native engine; hosts without one use the shared WASM package.
|
|
61
|
-
* @param resolvePackage -
|
|
62
|
-
* @param packageExists -
|
|
70
|
+
* @param resolvePackage - Engine package manifest resolver; defaults to Node resolution from this module.
|
|
71
|
+
* @param packageExists - Whether a native package that resolved as `MODULE_NOT_FOUND` is nevertheless installed (and
|
|
72
|
+
* therefore incomplete). Only the default resolver probes this module's installation; a caller resolver is the sole
|
|
73
|
+
* authority on whether its packages exist.
|
|
63
74
|
* @param host - Process identification and diagnostic report.
|
|
64
75
|
* @returns the installed native engine, or the installed WASM engine.
|
|
65
76
|
*/
|
|
66
|
-
export declare function resolveEngine(resolvePackage?:
|
|
77
|
+
export declare function resolveEngine(resolvePackage?: EnginePackageResolver, packageExists?: (name: string) => boolean, { platform, arch, report }?: EngineResolutionHost): Promise<Engine>;
|
|
67
78
|
export {};
|
|
68
79
|
//# sourceMappingURL=engine.d.ts.map
|
package/lib/types/errors.d.ts
CHANGED
|
@@ -18,4 +18,10 @@ export declare class ConversionError extends Error {
|
|
|
18
18
|
* @returns The published category, or `failed` when no published category is present.
|
|
19
19
|
*/
|
|
20
20
|
export declare function failureCode(error: unknown): ConversionErrorCode;
|
|
21
|
+
/**
|
|
22
|
+
* Describe any thrown value, including caller callbacks that throw non-Error values.
|
|
23
|
+
* @param error - The thrown value.
|
|
24
|
+
* @returns The Error message, or the value's string form.
|
|
25
|
+
*/
|
|
26
|
+
export declare function failureMessage(error: unknown): string;
|
|
21
27
|
//# sourceMappingURL=errors.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { RenderImagesRequest, RenderImagesResult } from './image-operations.ts';
|
|
2
2
|
export { IMAGE_FORMATS } from './image-operations.ts';
|
|
3
3
|
export type { RenderImagesRequest, RenderImagesResult, RenderedImage } from './image-operations.ts';
|
|
4
|
+
import type { EnginePackageResolver } from './engine.ts';
|
|
4
5
|
import type { ConversionRequest } from './operations.ts';
|
|
5
6
|
export { CONVERSION_FORMATS } from './operations.ts';
|
|
6
7
|
export type { ConversionRequest } from './operations.ts';
|
|
7
8
|
export { discoverRuntime } from './runtime.ts';
|
|
8
9
|
export type { RuntimeInfo } from './runtime.ts';
|
|
10
|
+
export type { EnginePackageResolver } from './engine.ts';
|
|
9
11
|
export { ConversionError } from './errors.ts';
|
|
10
12
|
export type { ConversionErrorCode } from './errors.ts';
|
|
11
13
|
export { ENGINE_VERSION, ENGINE_VERSIONS } from './engine.ts';
|
|
12
14
|
/** Host limits used by both native and Node WASM conversions. All byte limits are positive safe integers. */
|
|
13
15
|
export interface ConverterOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Engine package manifest resolver. Defaults to Node resolution from this package. Its result decides whether the
|
|
18
|
+
* native engine is installed and which installation is read; it also locates the WASM fallback package.
|
|
19
|
+
*/
|
|
20
|
+
resolveEnginePackage?: EnginePackageResolver;
|
|
14
21
|
/** User-local font metadata cache directory. Defaults to the platform cache directory; false disables disk reuse. */
|
|
15
22
|
fontMetadataCacheDirectory?: string | false;
|
|
16
23
|
/** Maximum persisted and reusable per-file metadata bytes. Default: 32 MiB. */
|
package/lib/types/options.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Validated deployment limits shared by native and Node WASM conversions. */
|
|
2
2
|
import type { ConverterOptions } from './index.ts';
|
|
3
|
+
import type { EnginePackageResolver } from './engine.ts';
|
|
3
4
|
/** Ordered family groups used when the caller supplies none. */
|
|
4
5
|
export declare const FONT_FALLBACKS: readonly (readonly string[])[];
|
|
5
6
|
/** Resolved limits and font settings used by every conversion of one converter. */
|
|
@@ -21,11 +22,18 @@ export interface ResolvedOptions {
|
|
|
21
22
|
readonly fontFallbacks: string[][];
|
|
22
23
|
readonly initialFontFamilies: string[];
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Validate an optional caller-supplied engine package resolver.
|
|
27
|
+
* @param value - The `resolveEnginePackage` option value.
|
|
28
|
+
* @returns the resolver, or undefined when absent.
|
|
29
|
+
* @throws TypeError when the value is defined and not a function.
|
|
30
|
+
*/
|
|
31
|
+
export declare function enginePackageResolver(value: unknown): EnginePackageResolver | undefined;
|
|
24
32
|
/**
|
|
25
33
|
* Resolve defaults once; reject misspelled options and malformed font settings.
|
|
26
34
|
* @param input - Caller options; absent fields keep their documented default.
|
|
27
35
|
* @returns The validated limits and font settings, with caller arrays copied.
|
|
28
|
-
* @throws TypeError for a non-object argument
|
|
36
|
+
* @throws TypeError for a non-object argument, an unknown option name, or a non-function `resolveEnginePackage`.
|
|
29
37
|
* @throws RangeError for a limit outside the positive safe-integer timer range.
|
|
30
38
|
*/
|
|
31
39
|
export declare function resolveOptions(input?: ConverterOptions): ResolvedOptions;
|
package/lib/types/runtime.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConverterOptions } from './index.ts';
|
|
1
2
|
/** Paths use the same installed Node API and precompiled engine as createConverter. */
|
|
2
3
|
export interface RuntimeInfo {
|
|
3
4
|
readonly version: string;
|
|
@@ -9,8 +10,11 @@ export interface RuntimeInfo {
|
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Inspect installed engine metadata without starting, downloading, or building an engine.
|
|
13
|
+
* @param options - The options of a later createConverter call, validated the same way; only `resolveEnginePackage`
|
|
14
|
+
* affects discovery, so both select the same engine.
|
|
12
15
|
* @returns Public entry paths, Node API version, and selected backend.
|
|
16
|
+
* @throws TypeError or RangeError for options createConverter would reject.
|
|
13
17
|
* @throws ConversionError when the installed engine is unavailable or invalid.
|
|
14
18
|
*/
|
|
15
|
-
export declare function discoverRuntime(): Promise<RuntimeInfo>;
|
|
19
|
+
export declare function discoverRuntime(options?: ConverterOptions): Promise<RuntimeInfo>;
|
|
16
20
|
//# sourceMappingURL=runtime.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.2.
|
|
4
|
+
"version": "0.2.3-rc.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -124,11 +124,11 @@
|
|
|
124
124
|
},
|
|
125
125
|
"optionalDependencies": {
|
|
126
126
|
"koffi": "3.1.1",
|
|
127
|
-
"@deepseek-ai/libreoffice-kit-darwin-arm64": "0.2.
|
|
128
|
-
"@deepseek-ai/libreoffice-kit-darwin-x64": "0.2.
|
|
129
|
-
"@deepseek-ai/libreoffice-kit-win32-arm64": "0.2.
|
|
130
|
-
"@deepseek-ai/libreoffice-kit-
|
|
131
|
-
"@deepseek-ai/libreoffice-kit-
|
|
127
|
+
"@deepseek-ai/libreoffice-kit-darwin-arm64": "0.2.3-rc.4",
|
|
128
|
+
"@deepseek-ai/libreoffice-kit-darwin-x64": "0.2.3-rc.4",
|
|
129
|
+
"@deepseek-ai/libreoffice-kit-win32-arm64": "0.2.3-rc.4",
|
|
130
|
+
"@deepseek-ai/libreoffice-kit-win32-x64": "0.2.3-rc.4",
|
|
131
|
+
"@deepseek-ai/libreoffice-kit-wasm": "0.2.3-rc.4"
|
|
132
132
|
},
|
|
133
133
|
"bin": {
|
|
134
134
|
"dsoffice": "./lib/cli.js"
|