@volter/editor-sdk 0.5.58 → 0.5.60

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
@@ -2,7 +2,7 @@
2
2
  "name": "@volter/editor-sdk",
3
3
  "author": "Volter AI, Inc.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.5.58",
5
+ "version": "0.5.60",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -70,7 +70,7 @@
70
70
  "typescript": "^5.6.0",
71
71
  "undici": "^7.28.0",
72
72
  "zod": "^4.3.6",
73
- "@volter/editor-project": "0.5.58",
73
+ "@volter/editor-project": "0.5.60",
74
74
  "@types/node": "^22.0.0"
75
75
  },
76
76
  "peerDependencies": {
package/src/client.ts CHANGED
@@ -471,6 +471,11 @@ export class EditorClient {
471
471
  await this.command({ type: 'play' });
472
472
  }
473
473
 
474
+ /** Refuse shutdown if a document cannot be saved. Does not stop the server. */
475
+ async prepareClose(): Promise<void> {
476
+ await this.command({ type: 'session-prepare-close' });
477
+ }
478
+
474
479
  /** Stops play, and finalizes this run's recording before the surface it was
475
480
  * photographing is torn down. The capture is absent when nothing recorded. */
476
481
  async stop(): Promise<{ recording?: GameplayRecordingCapture }> {
package/src/host.ts CHANGED
@@ -563,6 +563,9 @@ export interface EditorHostSession {
563
563
  * A lane that owns a worker, a socket or a device ends it here.
564
564
  */
565
565
  onEnded(fn: () => void): () => void;
566
+ /** Save before an explicit session close, while HTTP and the relay are live.
567
+ * Rejection cancels close; onEnded remains forced resource teardown. */
568
+ onBeforeClose(fn: () => Promise<void>): () => void;
566
569
  /**
567
570
  * PUBLISH (or retract, with null) THIS LANE'S OUT-OF-PROCESS WORKER METER, so
568
571
  * the tab census carries it out on the heartbeat — the one channel that still
@@ -114,6 +114,7 @@ const alwaysRefresh = (timeoutMs = DEFAULT_RELAY_COMMAND_TIMEOUT_MS): RelayComma
114
114
  * Rows without an explicit budget take {@link DEFAULT_RELAY_COMMAND_TIMEOUT_MS}.
115
115
  */
116
116
  export const RELAY_COMMANDS = {
117
+ 'session-prepare-close': noDerivedRefresh(120_000),
117
118
  // ---- Selection and framing ---------------------------------------------
118
119
  select: noDerivedRefresh(30_000),
119
120
  'select-multiple': noDerivedRefresh(),