@stll/folio-cli 0.4.3 → 0.4.5

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.
@@ -241,6 +241,11 @@ const acquireEditorLease = async ({ documentPath, owner, txId = `editor-${random
241
241
  now
242
242
  });
243
243
  };
244
+ const surfaceBackgroundError = (error) => {
245
+ queueMicrotask(() => {
246
+ throw error instanceof Error ? error : new Error(String(error));
247
+ });
248
+ };
244
249
  /**
245
250
  * Renew `lease` every `intervalMs` until stopped. When a renewal is refused
246
251
  * (the lease was taken over or expired), renewing stops and `onLost` runs:
@@ -256,7 +261,9 @@ const keepEditorLeaseAlive = (lease, { intervalMs = EDITOR_RENEW_MS, onLost }) =
256
261
  onLost(renewed.error);
257
262
  }
258
263
  };
259
- const timer = setInterval(() => void renew(), intervalMs);
264
+ const timer = setInterval(() => {
265
+ renew().catch(surfaceBackgroundError);
266
+ }, intervalMs);
260
267
  timer.unref();
261
268
  return { stop: () => {
262
269
  stopped = true;
@@ -287,12 +294,14 @@ const watchFlushRequests = ({ documentPath, token, onRequest, pollMs = 100 }) =>
287
294
  }
288
295
  };
289
296
  const watcher = Result.try(() => watch(path.dirname(documentPath), (_event, name) => {
290
- if (name === null || name.startsWith(prefix)) check();
297
+ if (name === null || name.startsWith(prefix)) check().catch(surfaceBackgroundError);
291
298
  }));
292
299
  if (watcher.isOk()) watcher.value.on("error", () => void 0);
293
- const timer = setInterval(() => void check(), pollMs);
300
+ const timer = setInterval(() => {
301
+ check().catch(surfaceBackgroundError);
302
+ }, pollMs);
294
303
  timer.unref();
295
- check();
304
+ check().catch(surfaceBackgroundError);
296
305
  return { close: () => {
297
306
  closed = true;
298
307
  clearInterval(timer);
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.4.3";
2
+ var version = "0.4.5";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-cli",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Command line and stdio MCP server for reading, reviewing, and redlining .docx files with folio: tracked-change edits, comments, and comparisons written atomically with version preconditions.",
5
5
  "keywords": [
6
6
  "cli",
@@ -71,8 +71,8 @@
71
71
  "@fontsource/tinos": "^5.2.7",
72
72
  "@modelcontextprotocol/server": "2.0.0",
73
73
  "@stll/agent-input": "0.1.0",
74
- "@stll/folio-agents": "^0.15.4",
75
- "@stll/folio-core": "^0.57.0",
74
+ "@stll/folio-agents": "^0.15.5",
75
+ "@stll/folio-core": "^0.58.3",
76
76
  "better-result": "3.0.1",
77
77
  "fast-xml-parser": "^5.10.1",
78
78
  "jszip": "3.10.2"