@devframes/hub 0.9.4 → 0.9.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.
@@ -1,4 +1,4 @@
1
- import { i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, t as DEFAULT_CATEGORIES_ORDER } from "../constants-C2b2cACy.mjs";
1
+ import { i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, t as DEFAULT_CATEGORIES_ORDER } from "../constants-fpJMWBtH.mjs";
2
2
  import { a as resolveClientModuleSpecifier, n as stripRemoteConnectionFromUrl, r as clientScriptFailureHint, t as buildRemoteConnectionUrl } from "../remote-url-Bgc7gtsP.mjs";
3
3
  import { REMOTE_CONNECTION_KEY } from "devframe/constants";
4
4
  import { connectDevframe, getDevframeRpcClient, resolveWsUrl } from "devframe/client";
@@ -5,7 +5,7 @@ import { t as DevframeDocksUserSettings } from "./settings-D7whfcx2.mjs";
5
5
  * key, and channel name the hub uses — the single source of truth that keeps
6
6
  * these names out of scattered string literals.
7
7
  *
8
- * **Keep this in sync with [`docs/guide/events.md`](../../../docs/guide/events.md)**
8
+ * **Keep this in sync with [`docs/content/1.guide/20.events.md`](../../../docs/content/1.guide/20.events.md)**
9
9
  * (the Hub Events Reference): every name here appears in that page's tables, and
10
10
  * every name there resolves to an entry here. Add, rename, or remove a name in
11
11
  * both places in the same change, and reference `HUB_EVENTS.*` from call sites
@@ -5,7 +5,7 @@ import { cleanDoubleSlashes, withLeadingSlash, withTrailingSlash } from "ufo";
5
5
  * key, and channel name the hub uses — the single source of truth that keeps
6
6
  * these names out of scattered string literals.
7
7
  *
8
- * **Keep this in sync with [`docs/guide/events.md`](../../../docs/guide/events.md)**
8
+ * **Keep this in sync with [`docs/content/1.guide/20.events.md`](../../../docs/content/1.guide/20.events.md)**
9
9
  * (the Hub Events Reference): every name here appears in that page's tables, and
10
10
  * every name there resolves to an entry here. Add, rename, or remove a name in
11
11
  * both places in the same change, and reference `HUB_EVENTS.*` from call sites
@@ -1,3 +1,3 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-CmESZCBq.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-BrffEYRZ.mjs";
2
2
  export * from "devframe/constants";
3
3
  export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, HUB_EVENTS, normalizeHubBase };
@@ -1,3 +1,3 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-C2b2cACy.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS, r as DEVFRAMES_HUB_BASE, t as DEFAULT_CATEGORIES_ORDER } from "./constants-fpJMWBtH.mjs";
2
2
  export * from "devframe/constants";
3
3
  export { DEFAULT_CATEGORIES_ORDER, DEFAULT_STATE_USER_SETTINGS, DEVFRAMES_HUB_BASE, DOCK_RENDERERS_STATE_KEY, HUB_EVENTS, normalizeHubBase };
@@ -1,5 +1,5 @@
1
1
  import { r as defineHubRpcFunction } from "./define-Ceekw2EO.mjs";
2
- import { n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS } from "./constants-C2b2cACy.mjs";
2
+ import { n as DEFAULT_STATE_USER_SETTINGS, o as HUB_EVENTS } from "./constants-fpJMWBtH.mjs";
3
3
  import { i as isBareModuleSpecifier, t as buildRemoteConnectionUrl } from "./remote-url-Bgc7gtsP.mjs";
4
4
  import { createEventEmitter } from "devframe/utils/events";
5
5
  import { createHostContext, createStorage } from "devframe/node";
@@ -10,6 +10,7 @@ import { defineDiagnostics } from "devframe/utils/nostics";
10
10
  import { join, resolve } from "pathe";
11
11
  import { nanoid } from "devframe/utils/nanoid";
12
12
  import process from "node:process";
13
+ import { resolveClientAssets } from "devframe";
13
14
  //#region src/node/diagnostics.ts
14
15
  const diagnostics = defineDiagnostics({
15
16
  docsBase: "https://devfra.me/errors",
@@ -935,14 +936,15 @@ async function prepareDevframe(ctx, d, options = {}) {
935
936
  id,
936
937
  basePath: void 0
937
938
  }, "hosted"));
938
- if (d.cli?.distDir) {
939
+ const clientAssets = resolveClientAssets(d);
940
+ if (clientAssets) {
939
941
  if (ctx.host.mountConnectionMeta) await ctx.host.mountConnectionMeta(base);
940
942
  else diagnostics.DF8106({
941
943
  id,
942
944
  name: d.name,
943
945
  base
944
946
  });
945
- const distSource = d.cli.distDir;
947
+ const distSource = clientAssets;
946
948
  ctx.views.hostStatic(base, typeof distSource === "string" ? resolve(distSource) : distSource, d.importMetaUrl);
947
949
  }
948
950
  ctx.docks.register({
@@ -1,4 +1,4 @@
1
- import { _ as DevframeDocksHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeMessagesHost, h as DevframeTerminalsHost, i as hubDocksActivate, l as hubTerminalsRemove, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize, v as DevframeCommandsHost } from "../context-TgU_TKiY.mjs";
1
+ import { _ as DevframeDocksHost, a as hubMessagesAdd, c as hubMessagesUpdate, d as hubTerminalsRestart, f as hubTerminalsTerminate, g as DevframeMessagesHost, h as DevframeTerminalsHost, i as hubDocksActivate, l as hubTerminalsRemove, n as builtinHubRpcDeclarations, o as hubMessagesClear, p as hubTerminalsWrite, r as hubCommandsExecute, s as hubMessagesRemove, t as createHubContext, u as hubTerminalsResize, v as DevframeCommandsHost } from "../context-CqHxHlNV.mjs";
2
2
  import "ufo";
3
3
  import "pathe";
4
4
  import "node:process";
@@ -9,7 +9,7 @@ import assert from "node:assert";
9
9
  import "node:path";
10
10
  import v8 from "node:v8";
11
11
  import { format, inspect } from "node:util";
12
- //#region ../../node_modules/.pnpm/acorn@8.16.0/node_modules/acorn/dist/acorn.mjs
12
+ //#region ../../node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
13
13
  var astralIdentifierCodes = [
14
14
  509,
15
15
  0,
@@ -1228,6 +1228,7 @@ function getLineInfo(input, offset) {
1228
1228
  var defaultOptions = {
1229
1229
  ecmaVersion: null,
1230
1230
  sourceType: "script",
1231
+ strict: false,
1231
1232
  onInsertedSemicolon: null,
1232
1233
  onTrailingComma: null,
1233
1234
  allowReserved: null,
@@ -1238,6 +1239,7 @@ var defaultOptions = {
1238
1239
  allowHashBang: false,
1239
1240
  checkPrivateFields: true,
1240
1241
  locations: false,
1242
+ startLocation: null,
1241
1243
  onToken: null,
1242
1244
  onComment: null,
1243
1245
  ranges: false,
@@ -1319,14 +1321,15 @@ var Parser = function Parser(options, input, startPos) {
1319
1321
  this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
1320
1322
  this.input = String(input);
1321
1323
  this.containsEsc = false;
1322
- if (startPos) {
1323
- this.pos = startPos;
1324
+ this.pos = startPos || 0;
1325
+ this.curLine = 1;
1326
+ if (options.startLocation) {
1327
+ this.lineStart = this.pos - options.startLocation.column;
1328
+ this.curLine = options.startLocation.line;
1329
+ } else if (startPos) {
1324
1330
  this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
1325
- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
1326
- } else {
1327
- this.pos = this.lineStart = 0;
1328
- this.curLine = 1;
1329
- }
1331
+ if (this.options.locations) this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
1332
+ } else this.lineStart = 0;
1330
1333
  this.type = types$1.eof;
1331
1334
  this.value = null;
1332
1335
  this.start = this.end = this.pos;
@@ -1336,7 +1339,7 @@ var Parser = function Parser(options, input, startPos) {
1336
1339
  this.context = this.initialContext();
1337
1340
  this.exprAllowed = true;
1338
1341
  this.inModule = options.sourceType === "module";
1339
- this.strict = this.inModule || this.strictDirective(this.pos);
1342
+ this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
1340
1343
  this.potentialArrowAt = -1;
1341
1344
  this.potentialArrowInForAwait = false;
1342
1345
  this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
@@ -1362,9 +1365,12 @@ var prototypeAccessors = {
1362
1365
  inClassStaticBlock: { configurable: true }
1363
1366
  };
1364
1367
  Parser.prototype.parse = function parse() {
1368
+ var this$1$1 = this;
1365
1369
  var node = this.options.program || this.startNode();
1366
1370
  this.nextToken();
1367
- return this.parseTopLevel(node);
1371
+ return this.catchStackOverflow(function() {
1372
+ return this$1$1.parseTopLevel(node);
1373
+ });
1368
1374
  };
1369
1375
  prototypeAccessors.inFunction.get = function() {
1370
1376
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
@@ -1467,6 +1473,14 @@ pp$9.eatContextual = function(name) {
1467
1473
  this.next();
1468
1474
  return true;
1469
1475
  };
1476
+ pp$9.catchStackOverflow = function(f) {
1477
+ try {
1478
+ return f();
1479
+ } catch (e) {
1480
+ if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
1481
+ else throw e;
1482
+ }
1483
+ };
1470
1484
  pp$9.expectContextual = function(name) {
1471
1485
  if (!this.eatContextual(name)) this.unexpected();
1472
1486
  };
@@ -1522,10 +1536,10 @@ pp$9.isSimpleAssignTarget = function(expr) {
1522
1536
  };
1523
1537
  var pp$8 = Parser.prototype;
1524
1538
  pp$8.parseTopLevel = function(node) {
1525
- var exports = Object.create(null);
1539
+ var exports$1 = Object.create(null);
1526
1540
  if (!node.body) node.body = [];
1527
1541
  while (this.type !== types$1.eof) {
1528
- var stmt = this.parseStatement(null, true, exports);
1542
+ var stmt = this.parseStatement(null, true, exports$1);
1529
1543
  node.body.push(stmt);
1530
1544
  }
1531
1545
  if (this.inModule) for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) {
@@ -1587,7 +1601,13 @@ pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
1587
1601
  while (isIdentifierChar(ch = this.fullCharCodeAt(next)));
1588
1602
  if (ch === 92) return true;
1589
1603
  var id = this.input.slice(idStart, next);
1590
- if (keywordRelationalOperator.test(id) || isFor && id === "of") return false;
1604
+ if (keywordRelationalOperator.test(id)) return false;
1605
+ if (isFor && !isAwaitUsing && id === "of") {
1606
+ skipWhiteSpace.lastIndex = next;
1607
+ var skipAfterOf = skipWhiteSpace.exec(this.input);
1608
+ next = next + skipAfterOf[0].length;
1609
+ if (this.input.charCodeAt(next) !== 61 || (ch = this.input.charCodeAt(next + 1)) === 61 || ch === 62) return false;
1610
+ }
1591
1611
  return true;
1592
1612
  };
1593
1613
  pp$8.isAwaitUsing = function(isFor) {
@@ -1596,7 +1616,7 @@ pp$8.isAwaitUsing = function(isFor) {
1596
1616
  pp$8.isUsing = function(isFor) {
1597
1617
  return this.isUsingKeyword(false, isFor);
1598
1618
  };
1599
- pp$8.parseStatement = function(context, topLevel, exports) {
1619
+ pp$8.parseStatement = function(context, topLevel, exports$1) {
1600
1620
  var starttype = this.type, node = this.startNode(), kind;
1601
1621
  if (this.isLet(context)) {
1602
1622
  starttype = types$1._var;
@@ -1640,7 +1660,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1640
1660
  if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level");
1641
1661
  if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'");
1642
1662
  }
1643
- return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports);
1663
+ return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1);
1644
1664
  default:
1645
1665
  if (this.isAsyncFunction()) {
1646
1666
  if (context) this.unexpected();
@@ -1650,6 +1670,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
1650
1670
  var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
1651
1671
  if (usingKind) {
1652
1672
  if (!this.allowUsing) this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
1673
+ if (context) this.raise(this.start, "Using declaration is not allowed in single-statement positions");
1653
1674
  if (usingKind === "await using") {
1654
1675
  if (!this.canAwait) this.raise(this.start, "Await using cannot appear outside of async function");
1655
1676
  this.next();
@@ -1753,11 +1774,10 @@ pp$8.parseForStatement = function(node) {
1753
1774
  };
1754
1775
  pp$8.parseForAfterInit = function(node, init, awaitAt) {
1755
1776
  if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
1756
- if (this.options.ecmaVersion >= 9) {
1757
- if (this.type === types$1._in) {
1758
- if (awaitAt > -1) this.unexpected(awaitAt);
1759
- } else node.await = awaitAt > -1;
1760
- }
1777
+ if (this.type === types$1._in) {
1778
+ if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) this.raise(this.start, "Using declaration is not allowed in for-in loops");
1779
+ if (this.options.ecmaVersion >= 9 && awaitAt > -1) this.unexpected(awaitAt);
1780
+ } else if (this.options.ecmaVersion >= 9) node.await = awaitAt > -1;
1761
1781
  return this.parseForIn(node, init);
1762
1782
  }
1763
1783
  if (awaitAt > -1) this.unexpected(awaitAt);
@@ -2165,11 +2185,11 @@ function checkKeyName(node, name) {
2165
2185
  var key = node.key;
2166
2186
  return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name);
2167
2187
  }
2168
- pp$8.parseExportAllDeclaration = function(node, exports) {
2188
+ pp$8.parseExportAllDeclaration = function(node, exports$1) {
2169
2189
  if (this.options.ecmaVersion >= 11) {
2170
2190
  if (this.eatContextual("as")) {
2171
2191
  node.exported = this.parseModuleExportName();
2172
- this.checkExport(exports, node.exported, this.lastTokStart);
2192
+ this.checkExport(exports$1, node.exported, this.lastTokStart);
2173
2193
  } else node.exported = null;
2174
2194
  }
2175
2195
  this.expectContextual("from");
@@ -2179,24 +2199,24 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
2179
2199
  this.semicolon();
2180
2200
  return this.finishNode(node, "ExportAllDeclaration");
2181
2201
  };
2182
- pp$8.parseExport = function(node, exports) {
2202
+ pp$8.parseExport = function(node, exports$1) {
2183
2203
  this.next();
2184
- if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports);
2204
+ if (this.eat(types$1.star)) return this.parseExportAllDeclaration(node, exports$1);
2185
2205
  if (this.eat(types$1._default)) {
2186
- this.checkExport(exports, "default", this.lastTokStart);
2206
+ this.checkExport(exports$1, "default", this.lastTokStart);
2187
2207
  node.declaration = this.parseExportDefaultDeclaration();
2188
2208
  return this.finishNode(node, "ExportDefaultDeclaration");
2189
2209
  }
2190
2210
  if (this.shouldParseExportStatement()) {
2191
2211
  node.declaration = this.parseExportDeclaration(node);
2192
- if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports, node.declaration.declarations);
2193
- else this.checkExport(exports, node.declaration.id, node.declaration.id.start);
2212
+ if (node.declaration.type === "VariableDeclaration") this.checkVariableExport(exports$1, node.declaration.declarations);
2213
+ else this.checkExport(exports$1, node.declaration.id, node.declaration.id.start);
2194
2214
  node.specifiers = [];
2195
2215
  node.source = null;
2196
2216
  if (this.options.ecmaVersion >= 16) node.attributes = [];
2197
2217
  } else {
2198
2218
  node.declaration = null;
2199
- node.specifiers = this.parseExportSpecifiers(exports);
2219
+ node.specifiers = this.parseExportSpecifiers(exports$1);
2200
2220
  if (this.eatContextual("from")) {
2201
2221
  if (this.type !== types$1.string) this.unexpected();
2202
2222
  node.source = this.parseExprAtom();
@@ -2234,45 +2254,45 @@ pp$8.parseExportDefaultDeclaration = function() {
2234
2254
  return declaration;
2235
2255
  }
2236
2256
  };
2237
- pp$8.checkExport = function(exports, name, pos) {
2238
- if (!exports) return;
2257
+ pp$8.checkExport = function(exports$1, name, pos) {
2258
+ if (!exports$1) return;
2239
2259
  if (typeof name !== "string") name = name.type === "Identifier" ? name.name : name.value;
2240
- if (hasOwn(exports, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
2241
- exports[name] = true;
2260
+ if (hasOwn(exports$1, name)) this.raiseRecoverable(pos, "Duplicate export '" + name + "'");
2261
+ exports$1[name] = true;
2242
2262
  };
2243
- pp$8.checkPatternExport = function(exports, pat) {
2263
+ pp$8.checkPatternExport = function(exports$1, pat) {
2244
2264
  var type = pat.type;
2245
- if (type === "Identifier") this.checkExport(exports, pat, pat.start);
2265
+ if (type === "Identifier") this.checkExport(exports$1, pat, pat.start);
2246
2266
  else if (type === "ObjectPattern") for (var i = 0, list = pat.properties; i < list.length; i += 1) {
2247
2267
  var prop = list[i];
2248
- this.checkPatternExport(exports, prop);
2268
+ this.checkPatternExport(exports$1, prop);
2249
2269
  }
2250
2270
  else if (type === "ArrayPattern") for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
2251
2271
  var elt = list$1[i$1];
2252
- if (elt) this.checkPatternExport(exports, elt);
2272
+ if (elt) this.checkPatternExport(exports$1, elt);
2253
2273
  }
2254
- else if (type === "Property") this.checkPatternExport(exports, pat.value);
2255
- else if (type === "AssignmentPattern") this.checkPatternExport(exports, pat.left);
2256
- else if (type === "RestElement") this.checkPatternExport(exports, pat.argument);
2274
+ else if (type === "Property") this.checkPatternExport(exports$1, pat.value);
2275
+ else if (type === "AssignmentPattern") this.checkPatternExport(exports$1, pat.left);
2276
+ else if (type === "RestElement") this.checkPatternExport(exports$1, pat.argument);
2257
2277
  };
2258
- pp$8.checkVariableExport = function(exports, decls) {
2259
- if (!exports) return;
2278
+ pp$8.checkVariableExport = function(exports$1, decls) {
2279
+ if (!exports$1) return;
2260
2280
  for (var i = 0, list = decls; i < list.length; i += 1) {
2261
2281
  var decl = list[i];
2262
- this.checkPatternExport(exports, decl.id);
2282
+ this.checkPatternExport(exports$1, decl.id);
2263
2283
  }
2264
2284
  };
2265
2285
  pp$8.shouldParseExportStatement = function() {
2266
2286
  return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
2267
2287
  };
2268
- pp$8.parseExportSpecifier = function(exports) {
2288
+ pp$8.parseExportSpecifier = function(exports$1) {
2269
2289
  var node = this.startNode();
2270
2290
  node.local = this.parseModuleExportName();
2271
2291
  node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
2272
- this.checkExport(exports, node.exported, node.exported.start);
2292
+ this.checkExport(exports$1, node.exported, node.exported.start);
2273
2293
  return this.finishNode(node, "ExportSpecifier");
2274
2294
  };
2275
- pp$8.parseExportSpecifiers = function(exports) {
2295
+ pp$8.parseExportSpecifiers = function(exports$1) {
2276
2296
  var nodes = [], first = true;
2277
2297
  this.expect(types$1.braceL);
2278
2298
  while (!this.eat(types$1.braceR)) {
@@ -2280,7 +2300,7 @@ pp$8.parseExportSpecifiers = function(exports) {
2280
2300
  this.expect(types$1.comma);
2281
2301
  if (this.afterTrailingComma(types$1.braceR)) break;
2282
2302
  } else first = false;
2283
- nodes.push(this.parseExportSpecifier(exports));
2303
+ nodes.push(this.parseExportSpecifier(exports$1));
2284
2304
  }
2285
2305
  return nodes;
2286
2306
  };
@@ -2713,15 +2733,18 @@ pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
2713
2733
  other[kind] = true;
2714
2734
  };
2715
2735
  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
2716
- var startPos = this.start, startLoc = this.startLoc;
2717
- var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
2718
- if (this.type === types$1.comma) {
2719
- var node = this.startNodeAt(startPos, startLoc);
2720
- node.expressions = [expr];
2721
- while (this.eat(types$1.comma)) node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors));
2722
- return this.finishNode(node, "SequenceExpression");
2723
- }
2724
- return expr;
2736
+ var this$1$1 = this;
2737
+ return this.catchStackOverflow(function() {
2738
+ var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
2739
+ var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
2740
+ if (this$1$1.type === types$1.comma) {
2741
+ var node = this$1$1.startNodeAt(startPos, startLoc);
2742
+ node.expressions = [expr];
2743
+ while (this$1$1.eat(types$1.comma)) node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors));
2744
+ return this$1$1.finishNode(node, "SequenceExpression");
2745
+ }
2746
+ return expr;
2747
+ });
2725
2748
  };
2726
2749
  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
2727
2750
  if (this.isContextual("yield")) {
@@ -2767,7 +2790,7 @@ pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
2767
2790
  var startPos = this.start, startLoc = this.startLoc;
2768
2791
  var expr = this.parseExprOps(forInit, refDestructuringErrors);
2769
2792
  if (this.checkExpressionErrors(refDestructuringErrors)) return expr;
2770
- if (this.eat(types$1.question)) {
2793
+ if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
2771
2794
  var node = this.startNodeAt(startPos, startLoc);
2772
2795
  node.test = expr;
2773
2796
  node.consequent = this.parseMaybeAssign();
@@ -2843,7 +2866,7 @@ pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forIni
2843
2866
  expr = this.finishNode(node$1, "UpdateExpression");
2844
2867
  }
2845
2868
  }
2846
- if (!incDec && this.eat(types$1.starstar)) {
2869
+ if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
2847
2870
  if (sawUnary) this.unexpected(this.lastTokStart);
2848
2871
  else return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false);
2849
2872
  } else return expr;
@@ -3148,6 +3171,7 @@ pp$5.parseNew = function() {
3148
3171
  }
3149
3172
  var startPos = this.start, startLoc = this.startLoc;
3150
3173
  node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
3174
+ if (node.callee.type === "Super") this.raiseRecoverable(startPos, "Invalid use of 'super'");
3151
3175
  if (this.eat(types$1.parenL)) node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false);
3152
3176
  else node.arguments = empty;
3153
3177
  return this.finishNode(node, "NewExpression");
@@ -5109,7 +5133,7 @@ pp.readWord = function() {
5109
5133
  };
5110
5134
  Parser.acorn = {
5111
5135
  Parser,
5112
- version: "8.16.0",
5136
+ version: "8.18.0",
5113
5137
  defaultOptions,
5114
5138
  Position,
5115
5139
  SourceLocation,
@@ -1,5 +1,5 @@
1
1
  import { i as InstallDevframeOptions, n as DevframeHubContext, t as CreateHubContextOptions } from "../context-BVkxwz5k.mjs";
2
- import { r as DEVFRAMES_HUB_BASE } from "../constants-CmESZCBq.mjs";
2
+ import { r as DEVFRAMES_HUB_BASE } from "../constants-BrffEYRZ.mjs";
3
3
  import { DevframeInstanceRecord } from "devframe/internal";
4
4
  import { ConnectionMeta, DevframeDefinition, DevframeServiceInput, DevframeSseOptions, DevframeStorageScope, DevframeWsOptions, McpRouteOptions } from "devframe/types";
5
5
  import { DevframeAuthHandler } from "devframe/node/auth";
@@ -1,6 +1,6 @@
1
- import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, r as DEVFRAMES_HUB_BASE } from "../constants-C2b2cACy.mjs";
1
+ import { a as normalizeHubBase, i as DOCK_RENDERERS_STATE_KEY, r as DEVFRAMES_HUB_BASE } from "../constants-fpJMWBtH.mjs";
2
2
  import { a as resolveClientModuleSpecifier } from "../remote-url-Bgc7gtsP.mjs";
3
- import { m as prepareDevframe, t as createHubContext, y as diagnostics } from "../context-TgU_TKiY.mjs";
3
+ import { m as prepareDevframe, t as createHubContext, y as diagnostics } from "../context-CqHxHlNV.mjs";
4
4
  import { joinURL, withTrailingSlash, withoutLeadingSlash } from "ufo";
5
5
  import { DEVFRAME_CONNECTION_META_FILENAME, DEVFRAME_DOCK_IMPORTS_FILENAME, DEVFRAME_MCP_ROUTE, DEVFRAME_WS_ROUTE } from "devframe/constants";
6
6
  import { createH3DevframeHost, createInstanceShell, resolveInstanceRegister } from "devframe/internal";
@@ -192,14 +192,12 @@ function initHub(options) {
192
192
  for (const run of setups) await run();
193
193
  await options.configure?.(ctx);
194
194
  await options.ui?.setup?.(ctx);
195
- if (rendererRegistrations.length > 0) {
196
- const manifest = {};
197
- for (const registration of rendererRegistrations) manifest[registration.type] = {
198
- importFrom: joinURL(base, "__renderers", `${registration.type}.mjs`),
199
- ...registration.importName ? { importName: registration.importName } : {}
200
- };
201
- (await ctx.rpc.sharedState.get(DOCK_RENDERERS_STATE_KEY, { initialValue: {} })).mutate(() => manifest);
202
- }
195
+ const manifest = {};
196
+ for (const registration of rendererRegistrations) manifest[registration.type] = {
197
+ importFrom: joinURL(base, "__renderers", `${registration.type}.mjs`),
198
+ ...registration.importName ? { importName: registration.importName } : {}
199
+ };
200
+ (await ctx.rpc.sharedState.get(DOCK_RENDERERS_STATE_KEY, { initialValue: {} })).mutate(() => manifest);
203
201
  const mcpConfig = options.mcp === true ? {} : options.mcp;
204
202
  if (!mcpConfig) return { context: ctx };
205
203
  const mcpRoute = withoutLeadingSlash(mcpConfig.path ?? DEVFRAME_MCP_ROUTE);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/hub",
3
3
  "type": "module",
4
- "version": "0.9.4",
4
+ "version": "0.9.5",
5
5
  "description": "Hub layer that orchestrates devframe docks, terminals, messages, and commands on any host.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "dist"
35
35
  ],
36
36
  "peerDependencies": {
37
- "devframe": "0.9.4"
37
+ "devframe": "0.9.5"
38
38
  },
39
39
  "dependencies": {
40
40
  "@standard-schema/spec": "^1.1.0",
@@ -52,7 +52,7 @@
52
52
  "mlly": "^1.8.2",
53
53
  "tsdown": "^0.22.14",
54
54
  "valibot": "^1.4.2",
55
- "devframe": "0.9.4"
55
+ "devframe": "0.9.5"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "tsdown",