@superdoc-dev/cli 0.11.0-next.19 → 0.11.0-next.20

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -5
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -404909,13 +404909,16 @@ var init_invoke2 = __esm(async () => {
404909
404909
  var exports_server = {};
404910
404910
  __export(exports_server, {
404911
404911
  runHostStdio: () => runHostStdio,
404912
+ parseHostCommandTokens: () => parseHostCommandTokens,
404912
404913
  HostServer: () => HostServer
404913
404914
  });
404914
404915
  import { createInterface } from "node:readline";
404915
404916
  function parseHostCommandTokens(tokens) {
404916
404917
  let stdio = false;
404917
404918
  let help = false;
404918
- for (const token2 of tokens) {
404919
+ let requestTimeoutMs;
404920
+ for (let i4 = 0;i4 < tokens.length; i4++) {
404921
+ const token2 = tokens[i4];
404919
404922
  if (token2 === "--stdio") {
404920
404923
  stdio = true;
404921
404924
  continue;
@@ -404924,9 +404927,21 @@ function parseHostCommandTokens(tokens) {
404924
404927
  help = true;
404925
404928
  continue;
404926
404929
  }
404930
+ if (token2 === REQUEST_TIMEOUT_FLAG || token2.startsWith(`${REQUEST_TIMEOUT_FLAG}=`)) {
404931
+ const value2 = token2 === REQUEST_TIMEOUT_FLAG ? tokens[++i4] : token2.slice(REQUEST_TIMEOUT_FLAG.length + 1);
404932
+ if (value2 == null || value2 === "") {
404933
+ throw new CliError("INVALID_ARGUMENT", `host: ${REQUEST_TIMEOUT_FLAG} requires a positive finite number of milliseconds.`);
404934
+ }
404935
+ const parsed = Number(value2);
404936
+ if (!Number.isFinite(parsed) || parsed <= 0) {
404937
+ throw new CliError("INVALID_ARGUMENT", `host: ${REQUEST_TIMEOUT_FLAG} requires a positive finite number of milliseconds (got ${JSON.stringify(value2)}).`);
404938
+ }
404939
+ requestTimeoutMs = parsed;
404940
+ continue;
404941
+ }
404927
404942
  throw new CliError("INVALID_ARGUMENT", `host: unknown option ${token2}`);
404928
404943
  }
404929
- return { stdio, help };
404944
+ return { stdio, help, requestTimeoutMs };
404930
404945
  }
404931
404946
  async function settleWithTimeout(promise, timeoutMs) {
404932
404947
  const settled = promise.then((value2) => ({ kind: "success", value: value2 }), (error4) => ({ kind: "error", error: error4 }));
@@ -405112,7 +405127,7 @@ async function runHostStdio(tokens, io) {
405112
405127
  if (!parsed.stdio) {
405113
405128
  throw new CliError("INVALID_ARGUMENT", "host: only --stdio is supported in v1.");
405114
405129
  }
405115
- const server = new HostServer({ io });
405130
+ const server = new HostServer({ io, requestTimeoutMs: parsed.requestTimeoutMs });
405116
405131
  const rl = createInterface({
405117
405132
  input: process.stdin,
405118
405133
  crlfDelay: Number.POSITIVE_INFINITY
@@ -405131,8 +405146,8 @@ async function runHostStdio(tokens, io) {
405131
405146
  return 0;
405132
405147
  }
405133
405148
  var HOST_HELP = `Usage:
405134
- superdoc host --stdio
405135
- `, DEFAULT_REQUEST_TIMEOUT_MS = 30000;
405149
+ superdoc host --stdio [--request-timeout-ms <ms>]
405150
+ `, DEFAULT_REQUEST_TIMEOUT_MS = 30000, REQUEST_TIMEOUT_FLAG = "--request-timeout-ms";
405136
405151
  var init_server = __esm(async () => {
405137
405152
  init_errors();
405138
405153
  init_guards();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.11.0-next.19",
3
+ "version": "0.11.0-next.20",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -25,8 +25,8 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
- "@superdoc/super-editor": "0.0.1",
29
28
  "@superdoc/pm-adapter": "0.0.0",
29
+ "@superdoc/super-editor": "0.0.1",
30
30
  "superdoc": "1.33.1"
31
31
  },
32
32
  "module": "src/index.ts",
@@ -34,11 +34,11 @@
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.11.0-next.19",
38
- "@superdoc-dev/cli-linux-x64": "0.11.0-next.19",
39
- "@superdoc-dev/cli-windows-x64": "0.11.0-next.19",
40
- "@superdoc-dev/cli-darwin-x64": "0.11.0-next.19",
41
- "@superdoc-dev/cli-linux-arm64": "0.11.0-next.19"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.11.0-next.20",
38
+ "@superdoc-dev/cli-darwin-x64": "0.11.0-next.20",
39
+ "@superdoc-dev/cli-linux-x64": "0.11.0-next.20",
40
+ "@superdoc-dev/cli-linux-arm64": "0.11.0-next.20",
41
+ "@superdoc-dev/cli-windows-x64": "0.11.0-next.20"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",