@superdoc/sdk 2.19.0-next.9 → 2.19.0
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 +36 -0
- package/dist/generated/client.d.ts +2 -0
- package/dist/generated/contract.cjs +1 -1
- package/dist/generated/contract.js +1 -1
- package/dist/runtime/host.cjs +61 -19
- package/dist/runtime/host.d.ts +3 -0
- package/dist/runtime/host.js +61 -19
- package/dist/runtime/sdk-version.generated.cjs +1 -1
- package/dist/runtime/sdk-version.generated.d.ts +1 -1
- package/dist/runtime/sdk-version.generated.js +1 -1
- package/dist/runtime/state-directory.cjs +132 -0
- package/dist/runtime/state-directory.d.ts +14 -0
- package/dist/runtime/state-directory.js +127 -0
- package/dist/runtime/transport-common.d.ts +2 -0
- package/package.json +7 -7
- package/tools/__pycache__/__init__.cpython-311.pyc +0 -0
- package/tools/__pycache__/intent_dispatch_generated.cpython-311.pyc +0 -0
- package/tools/tools-policy.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,42 @@ room sync on every call. To cut round trips further, batch related edits with
|
|
|
37
37
|
`document.mutations.apply()` or arbitrary operations with
|
|
38
38
|
`document.plan.execute()`.
|
|
39
39
|
|
|
40
|
+
For read-only hosts and containers, configure a writable state directory:
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
const client = new SuperDocClient({ stateDir: '/tmp/superdoc-state' });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`stateDir` takes precedence over `SUPERDOC_CLI_STATE_DIR` in the client's child
|
|
47
|
+
environment. Configured directories remain after disposal. Without either
|
|
48
|
+
setting, the SDK keeps the usual home directory state when it is usable;
|
|
49
|
+
otherwise it allocates a private directory in the child environment's temporary
|
|
50
|
+
location. `connect()` (including lazy connection on `open()`) checks that state
|
|
51
|
+
can be written and throws `SuperDocCliError` with code
|
|
52
|
+
`STATE_DIRECTORY_UNWRITABLE` and path details if it cannot. An invalid explicit
|
|
53
|
+
setting never silently falls back.
|
|
54
|
+
|
|
55
|
+
The home default is `~/.superdoc-cli/state/v1`. Each open document uses
|
|
56
|
+
`<state root>/contexts/<context ID>/`, where the root is the default,
|
|
57
|
+
configured `stateDir`, environment override, or SDK-owned temporary directory.
|
|
58
|
+
The context contains `metadata.json`, an `original.docx` input copy, a
|
|
59
|
+
`working.docx` checkpoint copy, and the host's `owner` file; operations can also
|
|
60
|
+
create a temporary `lock` file. Budget writable storage for both DOCX copies.
|
|
61
|
+
State does not need to live in the working directory, which can be read-only.
|
|
62
|
+
Temporary fallback uses the child's `TMPDIR` (or `TMP`/`TEMP`) on Unix; that
|
|
63
|
+
location must be writable. A configured state directory needs writable storage
|
|
64
|
+
even when the temporary directory is read-only. Save destinations must also be
|
|
65
|
+
writable; choose an explicit output path outside a read-only working directory.
|
|
66
|
+
|
|
67
|
+
`close()` removes that document's context. `dispose()` removes only an
|
|
68
|
+
SDK-allocated temporary root, after active operations finish and the host has
|
|
69
|
+
stopped. State remains when disposal fails. If the host exits unsuccessfully, disposal
|
|
70
|
+
throws `HOST_SHUTDOWN_FAILED` with the retained path in `details`; that client
|
|
71
|
+
remains failed, and the retained files are available for recovery. Killing
|
|
72
|
+
the SDK parent can leave temporary state behind; the operating system or host
|
|
73
|
+
operator must reclaim it. A new client gets a separate private root and does
|
|
74
|
+
not sweep another client's state.
|
|
75
|
+
|
|
40
76
|
For token-authenticated Hocuspocus or y-websocket rooms, pass the credential as
|
|
41
77
|
an option on that document's open request:
|
|
42
78
|
|
|
@@ -26693,6 +26693,7 @@ export interface DocContentControlsDeleteParams {
|
|
|
26693
26693
|
textboxId: string;
|
|
26694
26694
|
});
|
|
26695
26695
|
};
|
|
26696
|
+
overrideDeletionLock?: boolean;
|
|
26696
26697
|
}
|
|
26697
26698
|
export interface DocContentControlsCopyParams {
|
|
26698
26699
|
doc?: string;
|
|
@@ -149145,6 +149146,7 @@ export interface DocContentControlsDeleteBoundParams {
|
|
|
149145
149146
|
textboxId: string;
|
|
149146
149147
|
});
|
|
149147
149148
|
};
|
|
149149
|
+
overrideDeletionLock?: boolean;
|
|
149148
149150
|
}
|
|
149149
149151
|
export interface DocContentControlsCopyBoundParams {
|
|
149150
149152
|
out?: string;
|