@taptap/maker 0.0.34-beta.7 → 0.0.34

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/dist/maker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // TapTap Maker MCP - Standalone Bundle
3
- // TapTap Maker MCP version: 0.0.34-beta.7
3
+ // TapTap Maker MCP version: 0.0.34
4
4
  import { createRequire } from 'node:module';
5
5
  const require = createRequire(import.meta.url);
6
6
  const __MAKER_BUNDLE_URL__ = import.meta.url;
@@ -449,8 +449,8 @@ var init_parseUtil = __esm({
449
449
  init_errors();
450
450
  init_en();
451
451
  makeIssue = (params) => {
452
- const { data, path: path56, errorMaps, issueData } = params;
453
- const fullPath = [...path56, ...issueData.path || []];
452
+ const { data, path: path57, errorMaps, issueData } = params;
453
+ const fullPath = [...path57, ...issueData.path || []];
454
454
  const fullIssue = {
455
455
  ...issueData,
456
456
  path: fullPath
@@ -730,11 +730,11 @@ var init_types = __esm({
730
730
  init_parseUtil();
731
731
  init_util();
732
732
  ParseInputLazyPath = class {
733
- constructor(parent, value, path56, key) {
733
+ constructor(parent, value, path57, key) {
734
734
  this._cachedPath = [];
735
735
  this.parent = parent;
736
736
  this.data = value;
737
- this._path = path56;
737
+ this._path = path57;
738
738
  this._key = key;
739
739
  }
740
740
  get path() {
@@ -4243,10 +4243,10 @@ function mergeDefs(...defs) {
4243
4243
  function cloneDef(schema) {
4244
4244
  return mergeDefs(schema._zod.def);
4245
4245
  }
4246
- function getElementAtPath(obj, path56) {
4247
- if (!path56)
4246
+ function getElementAtPath(obj, path57) {
4247
+ if (!path57)
4248
4248
  return obj;
4249
- return path56.reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
4249
+ return path57.reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
4250
4250
  }
4251
4251
  function promiseAllObject(promisesObj) {
4252
4252
  const keys = Object.keys(promisesObj);
@@ -4559,11 +4559,11 @@ function aborted(x, startIndex = 0) {
4559
4559
  }
4560
4560
  return false;
4561
4561
  }
4562
- function prefixIssues(path56, issues) {
4562
+ function prefixIssues(path57, issues) {
4563
4563
  return issues.map((iss) => {
4564
4564
  var _a3;
4565
4565
  (_a3 = iss).path ?? (_a3.path = []);
4566
- iss.path.unshift(path56);
4566
+ iss.path.unshift(path57);
4567
4567
  return iss;
4568
4568
  });
4569
4569
  }
@@ -17726,8 +17726,8 @@ var require_utils = __commonJS({
17726
17726
  }
17727
17727
  return ind;
17728
17728
  }
17729
- function removeDotSegments(path56) {
17730
- let input2 = path56;
17729
+ function removeDotSegments(path57) {
17730
+ let input2 = path57;
17731
17731
  const output2 = [];
17732
17732
  let nextSlash = -1;
17733
17733
  let len = 0;
@@ -17926,8 +17926,8 @@ var require_schemes = __commonJS({
17926
17926
  wsComponent.secure = void 0;
17927
17927
  }
17928
17928
  if (wsComponent.resourceName) {
17929
- const [path56, query] = wsComponent.resourceName.split("?");
17930
- wsComponent.path = path56 && path56 !== "/" ? path56 : void 0;
17929
+ const [path57, query] = wsComponent.resourceName.split("?");
17930
+ wsComponent.path = path57 && path57 !== "/" ? path57 : void 0;
17931
17931
  wsComponent.query = query;
17932
17932
  wsComponent.resourceName = void 0;
17933
17933
  }
@@ -26984,12 +26984,12 @@ var require_dist = __commonJS({
26984
26984
  throw new Error(`Unknown format "${name}"`);
26985
26985
  return f;
26986
26986
  };
26987
- function addFormats(ajv, list, fs53, exportName) {
26987
+ function addFormats(ajv, list, fs54, exportName) {
26988
26988
  var _a3;
26989
26989
  var _b;
26990
26990
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
26991
26991
  for (const f of list)
26992
- ajv.addFormat(f, fs53[f]);
26992
+ ajv.addFormat(f, fs54[f]);
26993
26993
  }
26994
26994
  module.exports = exports = formatsPlugin;
26995
26995
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -28546,8 +28546,8 @@ var require_windows = __commonJS({
28546
28546
  "node_modules/isexe/windows.js"(exports, module) {
28547
28547
  module.exports = isexe;
28548
28548
  isexe.sync = sync;
28549
- var fs53 = __require("fs");
28550
- function checkPathExt(path56, options3) {
28549
+ var fs54 = __require("fs");
28550
+ function checkPathExt(path57, options3) {
28551
28551
  var pathext = options3.pathExt !== void 0 ? options3.pathExt : process.env.PATHEXT;
28552
28552
  if (!pathext) {
28553
28553
  return true;
@@ -28558,25 +28558,25 @@ var require_windows = __commonJS({
28558
28558
  }
28559
28559
  for (var i = 0; i < pathext.length; i++) {
28560
28560
  var p = pathext[i].toLowerCase();
28561
- if (p && path56.substr(-p.length).toLowerCase() === p) {
28561
+ if (p && path57.substr(-p.length).toLowerCase() === p) {
28562
28562
  return true;
28563
28563
  }
28564
28564
  }
28565
28565
  return false;
28566
28566
  }
28567
- function checkStat(stat, path56, options3) {
28567
+ function checkStat(stat, path57, options3) {
28568
28568
  if (!stat.isSymbolicLink() && !stat.isFile()) {
28569
28569
  return false;
28570
28570
  }
28571
- return checkPathExt(path56, options3);
28571
+ return checkPathExt(path57, options3);
28572
28572
  }
28573
- function isexe(path56, options3, cb) {
28574
- fs53.stat(path56, function(er, stat) {
28575
- cb(er, er ? false : checkStat(stat, path56, options3));
28573
+ function isexe(path57, options3, cb) {
28574
+ fs54.stat(path57, function(er, stat) {
28575
+ cb(er, er ? false : checkStat(stat, path57, options3));
28576
28576
  });
28577
28577
  }
28578
- function sync(path56, options3) {
28579
- return checkStat(fs53.statSync(path56), path56, options3);
28578
+ function sync(path57, options3) {
28579
+ return checkStat(fs54.statSync(path57), path57, options3);
28580
28580
  }
28581
28581
  }
28582
28582
  });
@@ -28586,14 +28586,14 @@ var require_mode = __commonJS({
28586
28586
  "node_modules/isexe/mode.js"(exports, module) {
28587
28587
  module.exports = isexe;
28588
28588
  isexe.sync = sync;
28589
- var fs53 = __require("fs");
28590
- function isexe(path56, options3, cb) {
28591
- fs53.stat(path56, function(er, stat) {
28589
+ var fs54 = __require("fs");
28590
+ function isexe(path57, options3, cb) {
28591
+ fs54.stat(path57, function(er, stat) {
28592
28592
  cb(er, er ? false : checkStat(stat, options3));
28593
28593
  });
28594
28594
  }
28595
- function sync(path56, options3) {
28596
- return checkStat(fs53.statSync(path56), options3);
28595
+ function sync(path57, options3) {
28596
+ return checkStat(fs54.statSync(path57), options3);
28597
28597
  }
28598
28598
  function checkStat(stat, options3) {
28599
28599
  return stat.isFile() && checkMode(stat, options3);
@@ -28617,7 +28617,7 @@ var require_mode = __commonJS({
28617
28617
  // node_modules/isexe/index.js
28618
28618
  var require_isexe = __commonJS({
28619
28619
  "node_modules/isexe/index.js"(exports, module) {
28620
- var fs53 = __require("fs");
28620
+ var fs54 = __require("fs");
28621
28621
  var core;
28622
28622
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
28623
28623
  core = require_windows();
@@ -28626,7 +28626,7 @@ var require_isexe = __commonJS({
28626
28626
  }
28627
28627
  module.exports = isexe;
28628
28628
  isexe.sync = sync;
28629
- function isexe(path56, options3, cb) {
28629
+ function isexe(path57, options3, cb) {
28630
28630
  if (typeof options3 === "function") {
28631
28631
  cb = options3;
28632
28632
  options3 = {};
@@ -28636,7 +28636,7 @@ var require_isexe = __commonJS({
28636
28636
  throw new TypeError("callback not provided");
28637
28637
  }
28638
28638
  return new Promise(function(resolve, reject) {
28639
- isexe(path56, options3 || {}, function(er, is) {
28639
+ isexe(path57, options3 || {}, function(er, is) {
28640
28640
  if (er) {
28641
28641
  reject(er);
28642
28642
  } else {
@@ -28645,7 +28645,7 @@ var require_isexe = __commonJS({
28645
28645
  });
28646
28646
  });
28647
28647
  }
28648
- core(path56, options3 || {}, function(er, is) {
28648
+ core(path57, options3 || {}, function(er, is) {
28649
28649
  if (er) {
28650
28650
  if (er.code === "EACCES" || options3 && options3.ignoreErrors) {
28651
28651
  er = null;
@@ -28655,9 +28655,9 @@ var require_isexe = __commonJS({
28655
28655
  cb(er, is);
28656
28656
  });
28657
28657
  }
28658
- function sync(path56, options3) {
28658
+ function sync(path57, options3) {
28659
28659
  try {
28660
- return core.sync(path56, options3 || {});
28660
+ return core.sync(path57, options3 || {});
28661
28661
  } catch (er) {
28662
28662
  if (options3 && options3.ignoreErrors || er.code === "EACCES") {
28663
28663
  return false;
@@ -28673,7 +28673,7 @@ var require_isexe = __commonJS({
28673
28673
  var require_which = __commonJS({
28674
28674
  "node_modules/which/which.js"(exports, module) {
28675
28675
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
28676
- var path56 = __require("path");
28676
+ var path57 = __require("path");
28677
28677
  var COLON = isWindows ? ";" : ":";
28678
28678
  var isexe = require_isexe();
28679
28679
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -28711,7 +28711,7 @@ var require_which = __commonJS({
28711
28711
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
28712
28712
  const ppRaw = pathEnv[i];
28713
28713
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
28714
- const pCmd = path56.join(pathPart, cmd);
28714
+ const pCmd = path57.join(pathPart, cmd);
28715
28715
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
28716
28716
  resolve(subStep(p, i, 0));
28717
28717
  });
@@ -28738,7 +28738,7 @@ var require_which = __commonJS({
28738
28738
  for (let i = 0; i < pathEnv.length; i++) {
28739
28739
  const ppRaw = pathEnv[i];
28740
28740
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
28741
- const pCmd = path56.join(pathPart, cmd);
28741
+ const pCmd = path57.join(pathPart, cmd);
28742
28742
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
28743
28743
  for (let j = 0; j < pathExt.length; j++) {
28744
28744
  const cur = p + pathExt[j];
@@ -28786,7 +28786,7 @@ var require_path_key = __commonJS({
28786
28786
  var require_resolveCommand = __commonJS({
28787
28787
  "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
28788
28788
  "use strict";
28789
- var path56 = __require("path");
28789
+ var path57 = __require("path");
28790
28790
  var which = require_which();
28791
28791
  var getPathKey = require_path_key();
28792
28792
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -28804,7 +28804,7 @@ var require_resolveCommand = __commonJS({
28804
28804
  try {
28805
28805
  resolved = which.sync(parsed.command, {
28806
28806
  path: env[getPathKey({ env })],
28807
- pathExt: withoutPathExt ? path56.delimiter : void 0
28807
+ pathExt: withoutPathExt ? path57.delimiter : void 0
28808
28808
  });
28809
28809
  } catch (e) {
28810
28810
  } finally {
@@ -28813,7 +28813,7 @@ var require_resolveCommand = __commonJS({
28813
28813
  }
28814
28814
  }
28815
28815
  if (resolved) {
28816
- resolved = path56.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
28816
+ resolved = path57.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
28817
28817
  }
28818
28818
  return resolved;
28819
28819
  }
@@ -28867,8 +28867,8 @@ var require_shebang_command = __commonJS({
28867
28867
  if (!match) {
28868
28868
  return null;
28869
28869
  }
28870
- const [path56, argument] = match[0].replace(/#! ?/, "").split(" ");
28871
- const binary = path56.split("/").pop();
28870
+ const [path57, argument] = match[0].replace(/#! ?/, "").split(" ");
28871
+ const binary = path57.split("/").pop();
28872
28872
  if (binary === "env") {
28873
28873
  return argument;
28874
28874
  }
@@ -28881,16 +28881,16 @@ var require_shebang_command = __commonJS({
28881
28881
  var require_readShebang = __commonJS({
28882
28882
  "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
28883
28883
  "use strict";
28884
- var fs53 = __require("fs");
28884
+ var fs54 = __require("fs");
28885
28885
  var shebangCommand = require_shebang_command();
28886
28886
  function readShebang(command) {
28887
28887
  const size = 150;
28888
28888
  const buffer = Buffer.alloc(size);
28889
28889
  let fd;
28890
28890
  try {
28891
- fd = fs53.openSync(command, "r");
28892
- fs53.readSync(fd, buffer, 0, size, 0);
28893
- fs53.closeSync(fd);
28891
+ fd = fs54.openSync(command, "r");
28892
+ fs54.readSync(fd, buffer, 0, size, 0);
28893
+ fs54.closeSync(fd);
28894
28894
  } catch (e) {
28895
28895
  }
28896
28896
  return shebangCommand(buffer.toString());
@@ -28903,7 +28903,7 @@ var require_readShebang = __commonJS({
28903
28903
  var require_parse = __commonJS({
28904
28904
  "node_modules/cross-spawn/lib/parse.js"(exports, module) {
28905
28905
  "use strict";
28906
- var path56 = __require("path");
28906
+ var path57 = __require("path");
28907
28907
  var resolveCommand = require_resolveCommand();
28908
28908
  var escape3 = require_escape();
28909
28909
  var readShebang = require_readShebang();
@@ -28928,7 +28928,7 @@ var require_parse = __commonJS({
28928
28928
  const needsShell = !isExecutableRegExp.test(commandFile);
28929
28929
  if (parsed.options.forceShell || needsShell) {
28930
28930
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
28931
- parsed.command = path56.normalize(parsed.command);
28931
+ parsed.command = path57.normalize(parsed.command);
28932
28932
  parsed.command = escape3.command(parsed.command);
28933
28933
  parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
28934
28934
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -30627,7 +30627,7 @@ function createMakerAgentsPolicyBody() {
30627
30627
  " `mcp report --ide <client> --target-dir <project> --context-stdin --consent --json`.",
30628
30628
  "- This preserves the configured package version and the absolute Windows node.exe/npm-cli.js.",
30629
30629
  "- Only with a known exact installed version, fallback to",
30630
- " `npx -y --package @taptap/maker@0.0.34-beta.7 taptap-maker mcp report ...`.",
30630
+ " `npx -y --package @taptap/maker@0.0.34 taptap-maker mcp report ...`.",
30631
30631
  "- Never use an unversioned npm package, or assume `taptap-maker`/`npx` is globally available.",
30632
30632
  "- Never include the complete conversation, project source, other MCP server entries, PAT/token",
30633
30633
  " values, or full environment variables. Normalize the user home path to `~`.",
@@ -39403,7 +39403,7 @@ var init_tracking = __esm({
39403
39403
  MAKER_MCP_TRACKING_ACTION = "tapmaker_mcp_call";
39404
39404
  MAKER_MCP_TRACKING_SOURCE = "local_mcp";
39405
39405
  MAKER_MCP_TRACKING_TIMEOUT_MS = 1500;
39406
- MAKER_MCP_VERSION = "0.0.34-beta.7".trim() ? "0.0.34-beta.7".trim() : "dev";
39406
+ MAKER_MCP_VERSION = "0.0.34".trim() ? "0.0.34".trim() : "dev";
39407
39407
  TRACKING_ERROR_MAX_LENGTH = 500;
39408
39408
  }
39409
39409
  });
@@ -42715,7 +42715,7 @@ var init_mcp = __esm({
42715
42715
  init_remoteProxyManager();
42716
42716
  init_proxyAssets();
42717
42717
  init_diagnosticRedaction();
42718
- VERSION = true ? "0.0.34-beta.7" : "dev";
42718
+ VERSION = true ? "0.0.34" : "dev";
42719
42719
  DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
42720
42720
  DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
42721
42721
  DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
@@ -49873,17 +49873,17 @@ var require_codegen3 = __commonJS({
49873
49873
  var require_fs = __commonJS({
49874
49874
  "node_modules/protobufjs/src/util/fs.js"(exports, module) {
49875
49875
  "use strict";
49876
- var fs53 = null;
49876
+ var fs54 = null;
49877
49877
  try {
49878
- fs53 = __require(
49878
+ fs54 = __require(
49879
49879
  /* webpackIgnore: true */
49880
49880
  "fs"
49881
49881
  );
49882
- if (!fs53 || !fs53.readFile || !fs53.readFileSync)
49883
- fs53 = null;
49882
+ if (!fs54 || !fs54.readFile || !fs54.readFileSync)
49883
+ fs54 = null;
49884
49884
  } catch (e) {
49885
49885
  }
49886
- module.exports = fs53;
49886
+ module.exports = fs54;
49887
49887
  }
49888
49888
  });
49889
49889
 
@@ -49893,7 +49893,7 @@ var require_fetch = __commonJS({
49893
49893
  "use strict";
49894
49894
  module.exports = fetch2;
49895
49895
  var asPromise = require_aspromise();
49896
- var fs53 = require_fs();
49896
+ var fs54 = require_fs();
49897
49897
  function fetch2(filename2, options3, callback) {
49898
49898
  if (typeof options3 === "function") {
49899
49899
  callback = options3;
@@ -49902,8 +49902,8 @@ var require_fetch = __commonJS({
49902
49902
  options3 = {};
49903
49903
  if (!callback)
49904
49904
  return asPromise(fetch2, this, filename2, options3);
49905
- if (!options3.xhr && fs53 && fs53.readFile)
49906
- return fs53.readFile(filename2, function fetchReadFileCallback(err, contents) {
49905
+ if (!options3.xhr && fs54 && fs54.readFile)
49906
+ return fs54.readFile(filename2, function fetchReadFileCallback(err, contents) {
49907
49907
  return err && typeof XMLHttpRequest !== "undefined" ? fetch2.xhr(filename2, options3, callback) : err ? callback(err) : callback(null, options3.binary ? contents : contents.toString("utf8"));
49908
49908
  });
49909
49909
  return fetch2.xhr(filename2, options3, callback);
@@ -49941,13 +49941,13 @@ var require_fetch = __commonJS({
49941
49941
  var require_path = __commonJS({
49942
49942
  "node_modules/protobufjs/src/util/path.js"(exports) {
49943
49943
  "use strict";
49944
- var path56 = exports;
49944
+ var path57 = exports;
49945
49945
  var urlRe = /^[a-zA-Z][a-zA-Z0-9+.-]+:\/\//;
49946
- function normalizeUrl(path57) {
49947
- if (typeof URL === "undefined" || !urlRe.test(path57))
49946
+ function normalizeUrl(path58) {
49947
+ if (typeof URL === "undefined" || !urlRe.test(path58))
49948
49948
  return null;
49949
49949
  try {
49950
- return new URL(path57).href;
49950
+ return new URL(path58).href;
49951
49951
  } catch (e) {
49952
49952
  return null;
49953
49953
  }
@@ -49967,8 +49967,8 @@ var require_path = __commonJS({
49967
49967
  * @param {string} path Path to test
49968
49968
  * @returns {boolean} `true` if path is absolute
49969
49969
  */
49970
- path56.isAbsolute = function isAbsolute2(path57) {
49971
- return /^(?:\/|\w+:|\\\\\w+)/.test(path57);
49970
+ path57.isAbsolute = function isAbsolute2(path58) {
49971
+ return /^(?:\/|\w+:|\\\\\w+)/.test(path58);
49972
49972
  }
49973
49973
  );
49974
49974
  var normalize = (
@@ -49977,18 +49977,18 @@ var require_path = __commonJS({
49977
49977
  * @param {string} path Path to normalize
49978
49978
  * @returns {string} Normalized path
49979
49979
  */
49980
- path56.normalize = function normalize2(path57) {
49981
- var normalizedUrl = normalizeUrl(path57);
49980
+ path57.normalize = function normalize2(path58) {
49981
+ var normalizedUrl = normalizeUrl(path58);
49982
49982
  if (normalizedUrl)
49983
49983
  return normalizedUrl;
49984
- var firstTwoCharacters = path57.substring(0, 2);
49984
+ var firstTwoCharacters = path58.substring(0, 2);
49985
49985
  var uncPrefix = "";
49986
49986
  if (firstTwoCharacters === "\\\\") {
49987
49987
  uncPrefix = firstTwoCharacters;
49988
- path57 = path57.substring(2);
49988
+ path58 = path58.substring(2);
49989
49989
  }
49990
- path57 = path57.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
49991
- var parts = path57.split("/"), absolute = isAbsolute(path57), prefix = "";
49990
+ path58 = path58.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
49991
+ var parts = path58.split("/"), absolute = isAbsolute(path58), prefix = "";
49992
49992
  if (absolute)
49993
49993
  prefix = parts.shift() + "/";
49994
49994
  for (var i = 0; i < parts.length; ) {
@@ -50007,7 +50007,7 @@ var require_path = __commonJS({
50007
50007
  return uncPrefix + prefix + parts.join("/");
50008
50008
  }
50009
50009
  );
50010
- path56.resolve = function resolve(originPath, includePath, alreadyNormalized) {
50010
+ path57.resolve = function resolve(originPath, includePath, alreadyNormalized) {
50011
50011
  var resolvedUrl = resolveUrl(originPath, includePath);
50012
50012
  if (resolvedUrl)
50013
50013
  return resolvedUrl;
@@ -50180,18 +50180,18 @@ var require_namespace = __commonJS({
50180
50180
  object3.onRemove(this);
50181
50181
  return clearCache(this);
50182
50182
  };
50183
- Namespace.prototype.define = function define2(path56, json2) {
50184
- if (util2.isString(path56))
50185
- path56 = path56.split(".");
50186
- else if (!Array.isArray(path56))
50183
+ Namespace.prototype.define = function define2(path57, json2) {
50184
+ if (util2.isString(path57))
50185
+ path57 = path57.split(".");
50186
+ else if (!Array.isArray(path57))
50187
50187
  throw TypeError("illegal path");
50188
- if (path56 && path56.length && path56[0] === "")
50188
+ if (path57 && path57.length && path57[0] === "")
50189
50189
  throw Error("path must be relative");
50190
- if (path56.length > util2.recursionLimit)
50190
+ if (path57.length > util2.recursionLimit)
50191
50191
  throw Error("max depth exceeded");
50192
50192
  var ptr = this;
50193
- while (path56.length > 0) {
50194
- var part = path56.shift();
50193
+ while (path57.length > 0) {
50194
+ var part = path57.shift();
50195
50195
  if (ptr.nested && ptr.nested[part]) {
50196
50196
  ptr = ptr.nested[part];
50197
50197
  if (!(ptr instanceof Namespace))
@@ -50227,22 +50227,22 @@ var require_namespace = __commonJS({
50227
50227
  });
50228
50228
  return this;
50229
50229
  };
50230
- Namespace.prototype.lookup = function lookup(path56, filterTypes, parentAlreadyChecked) {
50230
+ Namespace.prototype.lookup = function lookup(path57, filterTypes, parentAlreadyChecked) {
50231
50231
  if (typeof filterTypes === "boolean") {
50232
50232
  parentAlreadyChecked = filterTypes;
50233
50233
  filterTypes = void 0;
50234
50234
  } else if (filterTypes && !Array.isArray(filterTypes))
50235
50235
  filterTypes = [filterTypes];
50236
- if (util2.isString(path56) && path56.length) {
50237
- if (path56 === ".")
50236
+ if (util2.isString(path57) && path57.length) {
50237
+ if (path57 === ".")
50238
50238
  return this.root;
50239
- path56 = path56.split(".");
50240
- } else if (!path56.length)
50239
+ path57 = path57.split(".");
50240
+ } else if (!path57.length)
50241
50241
  return this;
50242
- var flatPath = path56.join(".");
50243
- if (path56[0] === "")
50244
- return this.root.lookup(path56.slice(1), filterTypes);
50245
- var found = this._lookupImpl(path56, flatPath);
50242
+ var flatPath = path57.join(".");
50243
+ if (path57[0] === "")
50244
+ return this.root.lookup(path57.slice(1), filterTypes);
50245
+ var found = this._lookupImpl(path57, flatPath);
50246
50246
  if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
50247
50247
  return found;
50248
50248
  }
@@ -50254,7 +50254,7 @@ var require_namespace = __commonJS({
50254
50254
  return null;
50255
50255
  var current = this;
50256
50256
  while (current.parent) {
50257
- found = current.parent._lookupImpl(path56, flatPath);
50257
+ found = current.parent._lookupImpl(path57, flatPath);
50258
50258
  if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
50259
50259
  return found;
50260
50260
  }
@@ -50262,22 +50262,22 @@ var require_namespace = __commonJS({
50262
50262
  }
50263
50263
  return null;
50264
50264
  };
50265
- Namespace.prototype._lookupImpl = function lookup(path56, flatPath) {
50265
+ Namespace.prototype._lookupImpl = function lookup(path57, flatPath) {
50266
50266
  if (Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
50267
50267
  return this._lookupCache[flatPath];
50268
50268
  }
50269
- var found = this.get(path56[0]);
50269
+ var found = this.get(path57[0]);
50270
50270
  var exact = null;
50271
50271
  if (found) {
50272
- if (path56.length === 1) {
50272
+ if (path57.length === 1) {
50273
50273
  exact = found;
50274
50274
  } else if (found instanceof Namespace) {
50275
- path56 = path56.slice(1);
50276
- exact = found._lookupImpl(path56, path56.join("."));
50275
+ path57 = path57.slice(1);
50276
+ exact = found._lookupImpl(path57, path57.join("."));
50277
50277
  }
50278
50278
  } else {
50279
50279
  for (var i = 0; i < this.nestedArray.length; ++i)
50280
- if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path56, flatPath))) {
50280
+ if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path57, flatPath))) {
50281
50281
  exact = found;
50282
50282
  break;
50283
50283
  }
@@ -50285,28 +50285,28 @@ var require_namespace = __commonJS({
50285
50285
  this._lookupCache[flatPath] = exact;
50286
50286
  return exact;
50287
50287
  };
50288
- Namespace.prototype.lookupType = function lookupType(path56) {
50289
- var found = this.lookup(path56, [Type]);
50288
+ Namespace.prototype.lookupType = function lookupType(path57) {
50289
+ var found = this.lookup(path57, [Type]);
50290
50290
  if (!found)
50291
- throw Error("no such type: " + path56);
50291
+ throw Error("no such type: " + path57);
50292
50292
  return found;
50293
50293
  };
50294
- Namespace.prototype.lookupEnum = function lookupEnum(path56) {
50295
- var found = this.lookup(path56, [Enum]);
50294
+ Namespace.prototype.lookupEnum = function lookupEnum(path57) {
50295
+ var found = this.lookup(path57, [Enum]);
50296
50296
  if (!found)
50297
- throw Error("no such Enum '" + path56 + "' in " + this);
50297
+ throw Error("no such Enum '" + path57 + "' in " + this);
50298
50298
  return found;
50299
50299
  };
50300
- Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path56) {
50301
- var found = this.lookup(path56, [Type, Enum]);
50300
+ Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path57) {
50301
+ var found = this.lookup(path57, [Type, Enum]);
50302
50302
  if (!found)
50303
- throw Error("no such Type or Enum '" + path56 + "' in " + this);
50303
+ throw Error("no such Type or Enum '" + path57 + "' in " + this);
50304
50304
  return found;
50305
50305
  };
50306
- Namespace.prototype.lookupService = function lookupService(path56) {
50307
- var found = this.lookup(path56, [Service]);
50306
+ Namespace.prototype.lookupService = function lookupService(path57) {
50307
+ var found = this.lookup(path57, [Service]);
50308
50308
  if (!found)
50309
- throw Error("no such Service '" + path56 + "' in " + this);
50309
+ throw Error("no such Service '" + path57 + "' in " + this);
50310
50310
  return found;
50311
50311
  };
50312
50312
  Namespace._configure = function(Type_, Service_, Enum_) {
@@ -51923,13 +51923,13 @@ var require_util3 = __commonJS({
51923
51923
  Object.defineProperty(object3, "$type", { value: enm, enumerable: false });
51924
51924
  return enm;
51925
51925
  };
51926
- util2.setProperty = function setProperty(dst, path56, value, ifNotSet) {
51927
- function setProp(dst2, path57, value2) {
51928
- var part = path57.shift();
51926
+ util2.setProperty = function setProperty(dst, path57, value, ifNotSet) {
51927
+ function setProp(dst2, path58, value2) {
51928
+ var part = path58.shift();
51929
51929
  if (util2.isUnsafeProperty(part))
51930
51930
  return dst2;
51931
- if (path57.length > 0) {
51932
- dst2[part] = setProp(dst2[part] || {}, path57, value2);
51931
+ if (path58.length > 0) {
51932
+ dst2[part] = setProp(dst2[part] || {}, path58, value2);
51933
51933
  } else {
51934
51934
  var prevValue = dst2[part];
51935
51935
  if (prevValue && ifNotSet)
@@ -51942,12 +51942,12 @@ var require_util3 = __commonJS({
51942
51942
  }
51943
51943
  if (typeof dst !== "object")
51944
51944
  throw TypeError("dst must be an object");
51945
- if (!path56)
51945
+ if (!path57)
51946
51946
  throw TypeError("path must be specified");
51947
- path56 = path56.split(".");
51948
- if (path56.length > util2.recursionLimit)
51947
+ path57 = path57.split(".");
51948
+ if (path57.length > util2.recursionLimit)
51949
51949
  throw Error("max depth exceeded");
51950
- return setProp(dst, path56, value);
51950
+ return setProp(dst, path57, value);
51951
51951
  };
51952
51952
  Object.defineProperty(util2, "decorateRoot", {
51953
51953
  get: function() {
@@ -52527,12 +52527,12 @@ var require_object = __commonJS({
52527
52527
  */
52528
52528
  fullName: {
52529
52529
  get: function() {
52530
- var path56 = [this.name], ptr = this.parent;
52530
+ var path57 = [this.name], ptr = this.parent;
52531
52531
  while (ptr) {
52532
- path56.unshift(ptr.name);
52532
+ path57.unshift(ptr.name);
52533
52533
  ptr = ptr.parent;
52534
52534
  }
52535
- return path56.join(".");
52535
+ return path57.join(".");
52536
52536
  }
52537
52537
  }
52538
52538
  });
@@ -57099,17 +57099,17 @@ var require_visit = __commonJS({
57099
57099
  visit.BREAK = BREAK;
57100
57100
  visit.SKIP = SKIP;
57101
57101
  visit.REMOVE = REMOVE;
57102
- function visit_(key, node, visitor, path56) {
57103
- const ctrl = callVisitor(key, node, visitor, path56);
57102
+ function visit_(key, node, visitor, path57) {
57103
+ const ctrl = callVisitor(key, node, visitor, path57);
57104
57104
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
57105
- replaceNode(key, path56, ctrl);
57106
- return visit_(key, ctrl, visitor, path56);
57105
+ replaceNode(key, path57, ctrl);
57106
+ return visit_(key, ctrl, visitor, path57);
57107
57107
  }
57108
57108
  if (typeof ctrl !== "symbol") {
57109
57109
  if (identity.isCollection(node)) {
57110
- path56 = Object.freeze(path56.concat(node));
57110
+ path57 = Object.freeze(path57.concat(node));
57111
57111
  for (let i = 0; i < node.items.length; ++i) {
57112
- const ci = visit_(i, node.items[i], visitor, path56);
57112
+ const ci = visit_(i, node.items[i], visitor, path57);
57113
57113
  if (typeof ci === "number")
57114
57114
  i = ci - 1;
57115
57115
  else if (ci === BREAK)
@@ -57120,13 +57120,13 @@ var require_visit = __commonJS({
57120
57120
  }
57121
57121
  }
57122
57122
  } else if (identity.isPair(node)) {
57123
- path56 = Object.freeze(path56.concat(node));
57124
- const ck = visit_("key", node.key, visitor, path56);
57123
+ path57 = Object.freeze(path57.concat(node));
57124
+ const ck = visit_("key", node.key, visitor, path57);
57125
57125
  if (ck === BREAK)
57126
57126
  return BREAK;
57127
57127
  else if (ck === REMOVE)
57128
57128
  node.key = null;
57129
- const cv = visit_("value", node.value, visitor, path56);
57129
+ const cv = visit_("value", node.value, visitor, path57);
57130
57130
  if (cv === BREAK)
57131
57131
  return BREAK;
57132
57132
  else if (cv === REMOVE)
@@ -57147,17 +57147,17 @@ var require_visit = __commonJS({
57147
57147
  visitAsync.BREAK = BREAK;
57148
57148
  visitAsync.SKIP = SKIP;
57149
57149
  visitAsync.REMOVE = REMOVE;
57150
- async function visitAsync_(key, node, visitor, path56) {
57151
- const ctrl = await callVisitor(key, node, visitor, path56);
57150
+ async function visitAsync_(key, node, visitor, path57) {
57151
+ const ctrl = await callVisitor(key, node, visitor, path57);
57152
57152
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
57153
- replaceNode(key, path56, ctrl);
57154
- return visitAsync_(key, ctrl, visitor, path56);
57153
+ replaceNode(key, path57, ctrl);
57154
+ return visitAsync_(key, ctrl, visitor, path57);
57155
57155
  }
57156
57156
  if (typeof ctrl !== "symbol") {
57157
57157
  if (identity.isCollection(node)) {
57158
- path56 = Object.freeze(path56.concat(node));
57158
+ path57 = Object.freeze(path57.concat(node));
57159
57159
  for (let i = 0; i < node.items.length; ++i) {
57160
- const ci = await visitAsync_(i, node.items[i], visitor, path56);
57160
+ const ci = await visitAsync_(i, node.items[i], visitor, path57);
57161
57161
  if (typeof ci === "number")
57162
57162
  i = ci - 1;
57163
57163
  else if (ci === BREAK)
@@ -57168,13 +57168,13 @@ var require_visit = __commonJS({
57168
57168
  }
57169
57169
  }
57170
57170
  } else if (identity.isPair(node)) {
57171
- path56 = Object.freeze(path56.concat(node));
57172
- const ck = await visitAsync_("key", node.key, visitor, path56);
57171
+ path57 = Object.freeze(path57.concat(node));
57172
+ const ck = await visitAsync_("key", node.key, visitor, path57);
57173
57173
  if (ck === BREAK)
57174
57174
  return BREAK;
57175
57175
  else if (ck === REMOVE)
57176
57176
  node.key = null;
57177
- const cv = await visitAsync_("value", node.value, visitor, path56);
57177
+ const cv = await visitAsync_("value", node.value, visitor, path57);
57178
57178
  if (cv === BREAK)
57179
57179
  return BREAK;
57180
57180
  else if (cv === REMOVE)
@@ -57201,24 +57201,24 @@ var require_visit = __commonJS({
57201
57201
  }
57202
57202
  return visitor;
57203
57203
  }
57204
- function callVisitor(key, node, visitor, path56) {
57204
+ function callVisitor(key, node, visitor, path57) {
57205
57205
  var _a3, _b, _c, _d, _e;
57206
57206
  if (typeof visitor === "function")
57207
- return visitor(key, node, path56);
57207
+ return visitor(key, node, path57);
57208
57208
  if (identity.isMap(node))
57209
- return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path56);
57209
+ return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path57);
57210
57210
  if (identity.isSeq(node))
57211
- return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path56);
57211
+ return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path57);
57212
57212
  if (identity.isPair(node))
57213
- return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path56);
57213
+ return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path57);
57214
57214
  if (identity.isScalar(node))
57215
- return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path56);
57215
+ return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path57);
57216
57216
  if (identity.isAlias(node))
57217
- return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path56);
57217
+ return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path57);
57218
57218
  return void 0;
57219
57219
  }
57220
- function replaceNode(key, path56, node) {
57221
- const parent = path56[path56.length - 1];
57220
+ function replaceNode(key, path57, node) {
57221
+ const parent = path57[path57.length - 1];
57222
57222
  if (identity.isCollection(parent)) {
57223
57223
  parent.items[key] = node;
57224
57224
  } else if (identity.isPair(parent)) {
@@ -57830,10 +57830,10 @@ var require_Collection = __commonJS({
57830
57830
  var createNode = require_createNode();
57831
57831
  var identity = require_identity();
57832
57832
  var Node = require_Node();
57833
- function collectionFromPath(schema, path56, value) {
57833
+ function collectionFromPath(schema, path57, value) {
57834
57834
  let v = value;
57835
- for (let i = path56.length - 1; i >= 0; --i) {
57836
- const k = path56[i];
57835
+ for (let i = path57.length - 1; i >= 0; --i) {
57836
+ const k = path57[i];
57837
57837
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
57838
57838
  const a = [];
57839
57839
  a[k] = v;
@@ -57852,7 +57852,7 @@ var require_Collection = __commonJS({
57852
57852
  sourceObjects: /* @__PURE__ */ new Map()
57853
57853
  });
57854
57854
  }
57855
- var isEmptyPath = (path56) => path56 == null || typeof path56 === "object" && !!path56[Symbol.iterator]().next().done;
57855
+ var isEmptyPath = (path57) => path57 == null || typeof path57 === "object" && !!path57[Symbol.iterator]().next().done;
57856
57856
  var Collection = class extends Node.NodeBase {
57857
57857
  constructor(type, schema) {
57858
57858
  super(type);
@@ -57882,11 +57882,11 @@ var require_Collection = __commonJS({
57882
57882
  * be a Pair instance or a `{ key, value }` object, which may not have a key
57883
57883
  * that already exists in the map.
57884
57884
  */
57885
- addIn(path56, value) {
57886
- if (isEmptyPath(path56))
57885
+ addIn(path57, value) {
57886
+ if (isEmptyPath(path57))
57887
57887
  this.add(value);
57888
57888
  else {
57889
- const [key, ...rest] = path56;
57889
+ const [key, ...rest] = path57;
57890
57890
  const node = this.get(key, true);
57891
57891
  if (identity.isCollection(node))
57892
57892
  node.addIn(rest, value);
@@ -57900,8 +57900,8 @@ var require_Collection = __commonJS({
57900
57900
  * Removes a value from the collection.
57901
57901
  * @returns `true` if the item was found and removed.
57902
57902
  */
57903
- deleteIn(path56) {
57904
- const [key, ...rest] = path56;
57903
+ deleteIn(path57) {
57904
+ const [key, ...rest] = path57;
57905
57905
  if (rest.length === 0)
57906
57906
  return this.delete(key);
57907
57907
  const node = this.get(key, true);
@@ -57915,8 +57915,8 @@ var require_Collection = __commonJS({
57915
57915
  * scalar values from their surrounding node; to disable set `keepScalar` to
57916
57916
  * `true` (collections are always returned intact).
57917
57917
  */
57918
- getIn(path56, keepScalar) {
57919
- const [key, ...rest] = path56;
57918
+ getIn(path57, keepScalar) {
57919
+ const [key, ...rest] = path57;
57920
57920
  const node = this.get(key, true);
57921
57921
  if (rest.length === 0)
57922
57922
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -57934,8 +57934,8 @@ var require_Collection = __commonJS({
57934
57934
  /**
57935
57935
  * Checks if the collection includes a value with the key `key`.
57936
57936
  */
57937
- hasIn(path56) {
57938
- const [key, ...rest] = path56;
57937
+ hasIn(path57) {
57938
+ const [key, ...rest] = path57;
57939
57939
  if (rest.length === 0)
57940
57940
  return this.has(key);
57941
57941
  const node = this.get(key, true);
@@ -57945,8 +57945,8 @@ var require_Collection = __commonJS({
57945
57945
  * Sets a value in this collection. For `!!set`, `value` needs to be a
57946
57946
  * boolean to add/remove the item from the set.
57947
57947
  */
57948
- setIn(path56, value) {
57949
- const [key, ...rest] = path56;
57948
+ setIn(path57, value) {
57949
+ const [key, ...rest] = path57;
57950
57950
  if (rest.length === 0) {
57951
57951
  this.set(key, value);
57952
57952
  } else {
@@ -60460,9 +60460,9 @@ var require_Document = __commonJS({
60460
60460
  this.contents.add(value);
60461
60461
  }
60462
60462
  /** Adds a value to the document. */
60463
- addIn(path56, value) {
60463
+ addIn(path57, value) {
60464
60464
  if (assertCollection(this.contents))
60465
- this.contents.addIn(path56, value);
60465
+ this.contents.addIn(path57, value);
60466
60466
  }
60467
60467
  /**
60468
60468
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -60537,14 +60537,14 @@ var require_Document = __commonJS({
60537
60537
  * Removes a value from the document.
60538
60538
  * @returns `true` if the item was found and removed.
60539
60539
  */
60540
- deleteIn(path56) {
60541
- if (Collection.isEmptyPath(path56)) {
60540
+ deleteIn(path57) {
60541
+ if (Collection.isEmptyPath(path57)) {
60542
60542
  if (this.contents == null)
60543
60543
  return false;
60544
60544
  this.contents = null;
60545
60545
  return true;
60546
60546
  }
60547
- return assertCollection(this.contents) ? this.contents.deleteIn(path56) : false;
60547
+ return assertCollection(this.contents) ? this.contents.deleteIn(path57) : false;
60548
60548
  }
60549
60549
  /**
60550
60550
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -60559,10 +60559,10 @@ var require_Document = __commonJS({
60559
60559
  * scalar values from their surrounding node; to disable set `keepScalar` to
60560
60560
  * `true` (collections are always returned intact).
60561
60561
  */
60562
- getIn(path56, keepScalar) {
60563
- if (Collection.isEmptyPath(path56))
60562
+ getIn(path57, keepScalar) {
60563
+ if (Collection.isEmptyPath(path57))
60564
60564
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
60565
- return identity.isCollection(this.contents) ? this.contents.getIn(path56, keepScalar) : void 0;
60565
+ return identity.isCollection(this.contents) ? this.contents.getIn(path57, keepScalar) : void 0;
60566
60566
  }
60567
60567
  /**
60568
60568
  * Checks if the document includes a value with the key `key`.
@@ -60573,10 +60573,10 @@ var require_Document = __commonJS({
60573
60573
  /**
60574
60574
  * Checks if the document includes a value at `path`.
60575
60575
  */
60576
- hasIn(path56) {
60577
- if (Collection.isEmptyPath(path56))
60576
+ hasIn(path57) {
60577
+ if (Collection.isEmptyPath(path57))
60578
60578
  return this.contents !== void 0;
60579
- return identity.isCollection(this.contents) ? this.contents.hasIn(path56) : false;
60579
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path57) : false;
60580
60580
  }
60581
60581
  /**
60582
60582
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -60593,13 +60593,13 @@ var require_Document = __commonJS({
60593
60593
  * Sets a value in this document. For `!!set`, `value` needs to be a
60594
60594
  * boolean to add/remove the item from the set.
60595
60595
  */
60596
- setIn(path56, value) {
60597
- if (Collection.isEmptyPath(path56)) {
60596
+ setIn(path57, value) {
60597
+ if (Collection.isEmptyPath(path57)) {
60598
60598
  this.contents = value;
60599
60599
  } else if (this.contents == null) {
60600
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path56), value);
60600
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path57), value);
60601
60601
  } else if (assertCollection(this.contents)) {
60602
- this.contents.setIn(path56, value);
60602
+ this.contents.setIn(path57, value);
60603
60603
  }
60604
60604
  }
60605
60605
  /**
@@ -62562,9 +62562,9 @@ var require_cst_visit = __commonJS({
62562
62562
  visit.BREAK = BREAK;
62563
62563
  visit.SKIP = SKIP;
62564
62564
  visit.REMOVE = REMOVE;
62565
- visit.itemAtPath = (cst, path56) => {
62565
+ visit.itemAtPath = (cst, path57) => {
62566
62566
  let item = cst;
62567
- for (const [field, index] of path56) {
62567
+ for (const [field, index] of path57) {
62568
62568
  const tok = item == null ? void 0 : item[field];
62569
62569
  if (tok && "items" in tok) {
62570
62570
  item = tok.items[index];
@@ -62573,23 +62573,23 @@ var require_cst_visit = __commonJS({
62573
62573
  }
62574
62574
  return item;
62575
62575
  };
62576
- visit.parentCollection = (cst, path56) => {
62577
- const parent = visit.itemAtPath(cst, path56.slice(0, -1));
62578
- const field = path56[path56.length - 1][0];
62576
+ visit.parentCollection = (cst, path57) => {
62577
+ const parent = visit.itemAtPath(cst, path57.slice(0, -1));
62578
+ const field = path57[path57.length - 1][0];
62579
62579
  const coll = parent == null ? void 0 : parent[field];
62580
62580
  if (coll && "items" in coll)
62581
62581
  return coll;
62582
62582
  throw new Error("Parent collection not found");
62583
62583
  };
62584
- function _visit(path56, item, visitor) {
62585
- let ctrl = visitor(item, path56);
62584
+ function _visit(path57, item, visitor) {
62585
+ let ctrl = visitor(item, path57);
62586
62586
  if (typeof ctrl === "symbol")
62587
62587
  return ctrl;
62588
62588
  for (const field of ["key", "value"]) {
62589
62589
  const token = item[field];
62590
62590
  if (token && "items" in token) {
62591
62591
  for (let i = 0; i < token.items.length; ++i) {
62592
- const ci = _visit(Object.freeze(path56.concat([[field, i]])), token.items[i], visitor);
62592
+ const ci = _visit(Object.freeze(path57.concat([[field, i]])), token.items[i], visitor);
62593
62593
  if (typeof ci === "number")
62594
62594
  i = ci - 1;
62595
62595
  else if (ci === BREAK)
@@ -62600,10 +62600,10 @@ var require_cst_visit = __commonJS({
62600
62600
  }
62601
62601
  }
62602
62602
  if (typeof ctrl === "function" && field === "key")
62603
- ctrl = ctrl(item, path56);
62603
+ ctrl = ctrl(item, path57);
62604
62604
  }
62605
62605
  }
62606
- return typeof ctrl === "function" ? ctrl(item, path56) : ctrl;
62606
+ return typeof ctrl === "function" ? ctrl(item, path57) : ctrl;
62607
62607
  }
62608
62608
  exports.visit = visit;
62609
62609
  }
@@ -63890,14 +63890,14 @@ var require_parser = __commonJS({
63890
63890
  case "scalar":
63891
63891
  case "single-quoted-scalar":
63892
63892
  case "double-quoted-scalar": {
63893
- const fs53 = this.flowScalar(this.type);
63893
+ const fs54 = this.flowScalar(this.type);
63894
63894
  if (atNextItem || it.value) {
63895
- map2.items.push({ start, key: fs53, sep: [] });
63895
+ map2.items.push({ start, key: fs54, sep: [] });
63896
63896
  this.onKeyLine = true;
63897
63897
  } else if (it.sep) {
63898
- this.stack.push(fs53);
63898
+ this.stack.push(fs54);
63899
63899
  } else {
63900
- Object.assign(it, { key: fs53, sep: [] });
63900
+ Object.assign(it, { key: fs54, sep: [] });
63901
63901
  this.onKeyLine = true;
63902
63902
  }
63903
63903
  return;
@@ -64026,13 +64026,13 @@ var require_parser = __commonJS({
64026
64026
  case "scalar":
64027
64027
  case "single-quoted-scalar":
64028
64028
  case "double-quoted-scalar": {
64029
- const fs53 = this.flowScalar(this.type);
64029
+ const fs54 = this.flowScalar(this.type);
64030
64030
  if (!it || it.value)
64031
- fc.items.push({ start: [], key: fs53, sep: [] });
64031
+ fc.items.push({ start: [], key: fs54, sep: [] });
64032
64032
  else if (it.sep)
64033
- this.stack.push(fs53);
64033
+ this.stack.push(fs54);
64034
64034
  else
64035
- Object.assign(it, { key: fs53, sep: [] });
64035
+ Object.assign(it, { key: fs54, sep: [] });
64036
64036
  return;
64037
64037
  }
64038
64038
  case "flow-map-end":
@@ -64398,7 +64398,7 @@ var require_pend = __commonJS({
64398
64398
  // node_modules/yauzl/fd-slicer.js
64399
64399
  var require_fd_slicer = __commonJS({
64400
64400
  "node_modules/yauzl/fd-slicer.js"(exports) {
64401
- var fs53 = __require("fs");
64401
+ var fs54 = __require("fs");
64402
64402
  var util2 = __require("util");
64403
64403
  var stream = __require("stream");
64404
64404
  var Readable2 = stream.Readable;
@@ -64418,7 +64418,7 @@ var require_fd_slicer = __commonJS({
64418
64418
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
64419
64419
  var self2 = this;
64420
64420
  self2.pend.go(function(cb) {
64421
- fs53.read(self2.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
64421
+ fs54.read(self2.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
64422
64422
  cb();
64423
64423
  callback(err, bytesRead, buffer2);
64424
64424
  });
@@ -64435,7 +64435,7 @@ var require_fd_slicer = __commonJS({
64435
64435
  self2.refCount -= 1;
64436
64436
  if (self2.refCount < 0) throw new Error("invalid unref");
64437
64437
  if (self2.refCount > 0) return;
64438
- fs53.close(self2.fd, onCloseDone);
64438
+ fs54.close(self2.fd, onCloseDone);
64439
64439
  function onCloseDone(err) {
64440
64440
  if (err) {
64441
64441
  self2.emit("error", err);
@@ -64467,7 +64467,7 @@ var require_fd_slicer = __commonJS({
64467
64467
  }
64468
64468
  self2.context.pend.go(function(cb) {
64469
64469
  var buffer = Buffer.allocUnsafe(toRead);
64470
- fs53.read(self2.context.fd, buffer, 0, toRead, self2.pos, function(err, bytesRead) {
64470
+ fs54.read(self2.context.fd, buffer, 0, toRead, self2.pos, function(err, bytesRead) {
64471
64471
  if (err) {
64472
64472
  self2.destroy(err);
64473
64473
  } else if (bytesRead === 0) {
@@ -64827,7 +64827,7 @@ var require_crc32 = __commonJS({
64827
64827
  // node_modules/yauzl/index.js
64828
64828
  var require_yauzl = __commonJS({
64829
64829
  "node_modules/yauzl/index.js"(exports) {
64830
- var fs53 = __require("fs");
64830
+ var fs54 = __require("fs");
64831
64831
  var zlib = __require("zlib");
64832
64832
  var fd_slicer = require_fd_slicer();
64833
64833
  var util2 = __require("util");
@@ -64852,9 +64852,9 @@ var require_yauzl = __commonJS({
64852
64852
  exports.Entry = Entry;
64853
64853
  exports.LocalFileHeader = LocalFileHeader;
64854
64854
  exports.RandomAccessReader = RandomAccessReader;
64855
- function openPromise(path56, options3) {
64855
+ function openPromise(path57, options3) {
64856
64856
  return new Promise((resolve, reject) => {
64857
- open(path56, { ...options3, lazyEntries: true }, function(err, zipfile) {
64857
+ open(path57, { ...options3, lazyEntries: true }, function(err, zipfile) {
64858
64858
  if (err) return reject(err);
64859
64859
  resolve(zipfile);
64860
64860
  });
@@ -64884,7 +64884,7 @@ var require_yauzl = __commonJS({
64884
64884
  });
64885
64885
  });
64886
64886
  }
64887
- function open(path56, options3, callback) {
64887
+ function open(path57, options3, callback) {
64888
64888
  if (typeof options3 === "function") {
64889
64889
  callback = options3;
64890
64890
  options3 = null;
@@ -64896,10 +64896,10 @@ var require_yauzl = __commonJS({
64896
64896
  if (options3.validateEntrySizes == null) options3.validateEntrySizes = true;
64897
64897
  if (options3.strictFileNames == null) options3.strictFileNames = false;
64898
64898
  if (callback == null) callback = defaultCallback;
64899
- fs53.open(path56, "r", function(err, fd) {
64899
+ fs54.open(path57, "r", function(err, fd) {
64900
64900
  if (err) return callback(err);
64901
64901
  fromFd(fd, options3, function(err2, zipfile) {
64902
- if (err2) fs53.close(fd, defaultCallback);
64902
+ if (err2) fs54.close(fd, defaultCallback);
64903
64903
  callback(err2, zipfile);
64904
64904
  });
64905
64905
  });
@@ -64916,7 +64916,7 @@ var require_yauzl = __commonJS({
64916
64916
  if (options3.validateEntrySizes == null) options3.validateEntrySizes = true;
64917
64917
  if (options3.strictFileNames == null) options3.strictFileNames = false;
64918
64918
  if (callback == null) callback = defaultCallback;
64919
- fs53.fstat(fd, function(err, stats) {
64919
+ fs54.fstat(fd, function(err, stats) {
64920
64920
  if (err) return callback(err);
64921
64921
  var reader = new fd_slicer.FdSlicer(fd);
64922
64922
  fromRandomAccessReader(reader, stats.size, options3, callback);
@@ -65690,9 +65690,9 @@ init_mcp();
65690
65690
  init_config();
65691
65691
  import { spawnSync as spawnSync8 } from "node:child_process";
65692
65692
  import crypto5 from "node:crypto";
65693
- import fs51 from "node:fs";
65693
+ import fs52 from "node:fs";
65694
65694
  import os13 from "node:os";
65695
- import path53 from "node:path";
65695
+ import path54 from "node:path";
65696
65696
  import readline from "node:readline/promises";
65697
65697
  import { stdin as input, stdout as output } from "node:process";
65698
65698
  import { pathToFileURL as pathToFileURL2 } from "node:url";
@@ -65852,21 +65852,21 @@ init_runtimeLogs();
65852
65852
 
65853
65853
  // src/maker/cli/preview.ts
65854
65854
  init_protocol2();
65855
- import fs35 from "node:fs";
65856
- import path36 from "node:path";
65855
+ import fs36 from "node:fs";
65856
+ import path37 from "node:path";
65857
65857
  import { randomBytes as randomBytes3, randomUUID as randomUUID6 } from "node:crypto";
65858
65858
 
65859
65859
  // src/maker/preview/installation.ts
65860
65860
  init_python();
65861
65861
  init_protocol2();
65862
- import fs32 from "node:fs";
65863
- import path33 from "node:path";
65862
+ import fs33 from "node:fs";
65863
+ import path34 from "node:path";
65864
65864
  import { createHash as createHash5, randomUUID as randomUUID5 } from "node:crypto";
65865
65865
 
65866
65866
  // src/maker/preview/runtime.ts
65867
65867
  init_protocol2();
65868
- import fs30 from "node:fs";
65869
- import path31 from "node:path";
65868
+ import fs31 from "node:fs";
65869
+ import path32 from "node:path";
65870
65870
  import os5 from "node:os";
65871
65871
  import { spawn as spawn6 } from "node:child_process";
65872
65872
  import { StringDecoder } from "node:string_decoder";
@@ -65992,8 +65992,8 @@ init_storage();
65992
65992
  init_configuration();
65993
65993
  init_python();
65994
65994
  init_protocol2();
65995
- import fs26 from "node:fs";
65996
- import path27 from "node:path";
65995
+ import fs27 from "node:fs";
65996
+ import path28 from "node:path";
65997
65997
  import { randomUUID as randomUUID4 } from "node:crypto";
65998
65998
  import { gunzipSync } from "node:zlib";
65999
65999
  import { execFile } from "node:child_process";
@@ -66036,6 +66036,94 @@ function trimPreviewCache(directory, prefix, limit, protectedDirectories) {
66036
66036
  }
66037
66037
  }
66038
66038
 
66039
+ // src/maker/preview/builderDiagnostics.ts
66040
+ import fs26 from "node:fs";
66041
+ import path27 from "node:path";
66042
+ function previewBuilderWarnings(source, stdout, stderr = "") {
66043
+ const errors = (stdout + "\n" + stderr).split(/\r?\n/).filter((line) => line.includes("[ERROR]"));
66044
+ if (!errors.length) return [];
66045
+ const failure = () => {
66046
+ throw new Error("ProjectBuilder reported an error.");
66047
+ };
66048
+ const summary = /^\[ERROR\]\s+增强引用错误: (\d+) 个远端路径匹配多个 source,已选择第一个$/.exec(
66049
+ errors[0]
66050
+ );
66051
+ if (!summary || Number(summary[1]) < 1 || Number(summary[1]) >= 50 || errors.length !== Number(summary[1]) + 1)
66052
+ return failure();
66053
+ const imports = /* @__PURE__ */ new Map();
66054
+ for (const line of stdout.split(/\r?\n/)) {
66055
+ const imported = /^\[INFO\]\s+导入 \d+ 个远端资源: ([\w-]+) \(client=([a-f0-9]+), server=([a-f0-9]+)\)$/.exec(
66056
+ line
66057
+ );
66058
+ if (!imported) continue;
66059
+ if (imports.has(imported[1])) return failure();
66060
+ imports.set(imported[1], [...new Set(imported.slice(2))]);
66061
+ }
66062
+ const manifests = /* @__PURE__ */ new Map();
66063
+ const resources2 = (name) => {
66064
+ if (manifests.has(name)) return manifests.get(name);
66065
+ const hashes = imports.get(name);
66066
+ if (!hashes) return failure();
66067
+ const files = [];
66068
+ for (const hash2 of hashes) {
66069
+ const filename2 = path27.join(source, ".build", "manifest_cache", name + "-" + hash2 + ".json");
66070
+ const manifest = JSON.parse(fs26.readFileSync(filename2, "utf8"));
66071
+ if (!Array.isArray(manifest.files)) return failure();
66072
+ files.push(...manifest.files);
66073
+ }
66074
+ manifests.set(name, files);
66075
+ return files;
66076
+ };
66077
+ try {
66078
+ return errors.slice(1).map((line) => {
66079
+ const detail = /^\[ERROR\]\s+(.+): multiple sources matched; selected ([\w-]+)=([\w-]+); candidates=(.+)$/.exec(
66080
+ line
66081
+ );
66082
+ if (!detail) return failure();
66083
+ const candidates = detail[4].split(", ").map((candidate) => {
66084
+ const match = /^([\w-]+)=([\w-]+)$/.exec(candidate);
66085
+ if (!match || match[2] !== detail[3]) return failure();
66086
+ const files = resources2(match[1]).filter(
66087
+ (file3) => file3.fs_path === detail[1] || file3.uuid === detail[3]
66088
+ );
66089
+ if (!files.length || files.some((file3) => file3.uuid !== detail[3] || file3.fs_path !== detail[1]))
66090
+ return failure();
66091
+ return { name: match[1], files };
66092
+ });
66093
+ if (candidates.length < 2 || candidates[0].name !== detail[2] || new Set(candidates.map((candidate) => candidate.name)).size !== candidates.length)
66094
+ return failure();
66095
+ const owners = candidates.filter(
66096
+ (candidate) => candidate.files.every((file3) => file3.source === void 0)
66097
+ );
66098
+ if (owners.length !== 1) return failure();
66099
+ const owner = owners[0];
66100
+ const canonical = owner.files[0];
66101
+ if (typeof canonical.hash !== "string" || !canonical.hash || typeof canonical.ext !== "string" || !canonical.ext || !Number.isSafeInteger(canonical.size) || Number(canonical.size) < 0)
66102
+ return failure();
66103
+ const identityFields = /* @__PURE__ */ new Set(["hash", "size", "ext"]);
66104
+ for (const candidate of candidates) {
66105
+ for (const file3 of candidate.files) {
66106
+ for (const field of Object.keys(file3)) {
66107
+ if (field.startsWith("hash@") || field.startsWith("size@")) identityFields.add(field);
66108
+ }
66109
+ }
66110
+ }
66111
+ for (const candidate of candidates) {
66112
+ for (const file3 of candidate.files) {
66113
+ if (candidate !== owner && file3.source !== owner.name) return failure();
66114
+ for (const field of identityFields) {
66115
+ if ((candidate === owner || file3[field] !== void 0) && file3[field] !== canonical[field])
66116
+ return failure();
66117
+ }
66118
+ }
66119
+ }
66120
+ return "[WARN] Verified duplicate public resource reference: " + detail[1] + " -> " + owner.name + "=" + detail[3];
66121
+ });
66122
+ } catch {
66123
+ return failure();
66124
+ }
66125
+ }
66126
+
66039
66127
  // src/maker/preview/prepare.ts
66040
66128
  function requireManifestPreviewPlatform(platform = process.platform) {
66041
66129
  if (platform !== "win32" && platform !== "darwin")
@@ -66044,47 +66132,47 @@ function requireManifestPreviewPlatform(platform = process.platform) {
66044
66132
  );
66045
66133
  }
66046
66134
  function materializePreviewBuilder() {
66047
- const directory = path27.join(getMakerHome(), "preview-tools", PREVIEW_BUILDER_DIGEST);
66135
+ const directory = path28.join(getMakerHome(), "preview-tools", PREVIEW_BUILDER_DIGEST);
66048
66136
  const files = JSON.parse(
66049
66137
  gunzipSync(Buffer.from(PREVIEW_BUILDER_SOURCE, "base64")).toString("utf8")
66050
66138
  );
66051
66139
  for (const [name, content] of Object.entries(files)) {
66052
- const filename2 = path27.join(directory, name);
66053
- fs26.mkdirSync(path27.dirname(filename2), { recursive: true, mode: 448 });
66054
- if (!fs26.existsSync(filename2) || fs26.readFileSync(filename2, "utf8") !== content)
66055
- fs26.writeFileSync(filename2, content, { mode: 384 });
66140
+ const filename2 = path28.join(directory, name);
66141
+ fs27.mkdirSync(path28.dirname(filename2), { recursive: true, mode: 448 });
66142
+ if (!fs27.existsSync(filename2) || fs27.readFileSync(filename2, "utf8") !== content)
66143
+ fs27.writeFileSync(filename2, content, { mode: 384 });
66056
66144
  }
66057
- return path27.join(directory, "project_builder.py");
66145
+ return path28.join(directory, "project_builder.py");
66058
66146
  }
66059
66147
  function inside(root2, relative) {
66060
- const filename2 = path27.resolve(root2, relative);
66061
- if (path27.relative(root2, filename2).startsWith("..") || path27.isAbsolute(relative))
66148
+ const filename2 = path28.resolve(root2, relative);
66149
+ if (path28.relative(root2, filename2).startsWith("..") || path28.isAbsolute(relative))
66062
66150
  throw new Error("Prepared manifest path escapes its output directory.");
66063
66151
  return filename2;
66064
66152
  }
66065
66153
  function copyTree(source, target, signal) {
66066
66154
  if (signal == null ? void 0 : signal.aborted) throw new Error("CANCELLED");
66067
- const stat = fs26.lstatSync(source);
66155
+ const stat = fs27.lstatSync(source);
66068
66156
  if (stat.isSymbolicLink())
66069
66157
  throw new Error(`Local prepare does not support symbolic links: ${source}`);
66070
66158
  if (stat.isDirectory()) {
66071
- fs26.mkdirSync(target, { recursive: true, mode: 448 });
66072
- for (const name of fs26.readdirSync(source)) {
66073
- copyTree(path27.join(source, name), path27.join(target, name), signal);
66159
+ fs27.mkdirSync(target, { recursive: true, mode: 448 });
66160
+ for (const name of fs27.readdirSync(source)) {
66161
+ copyTree(path28.join(source, name), path28.join(target, name), signal);
66074
66162
  }
66075
66163
  return;
66076
66164
  }
66077
66165
  if (!stat.isFile()) throw new Error(`Local prepare does not support special files: ${source}`);
66078
- fs26.mkdirSync(path27.dirname(target), { recursive: true, mode: 448 });
66079
- fs26.copyFileSync(source, target);
66166
+ fs27.mkdirSync(path28.dirname(target), { recursive: true, mode: 448 });
66167
+ fs27.copyFileSync(source, target);
66080
66168
  }
66081
66169
  function validateProjectVersion(source) {
66082
- const filename2 = path27.join(source, ".project", "project.json");
66083
- if (!fs26.existsSync(filename2))
66170
+ const filename2 = path28.join(source, ".project", "project.json");
66171
+ if (!fs27.existsSync(filename2))
66084
66172
  throw new Error(
66085
66173
  "Local prepare requires .project/project.json; JSONC-only and legacy root layouts are not supported."
66086
66174
  );
66087
- const config2 = JSON.parse(fs26.readFileSync(filename2, "utf8"));
66175
+ const config2 = JSON.parse(fs27.readFileSync(filename2, "utf8"));
66088
66176
  const version2 = Object.prototype.hasOwnProperty.call(config2, "version") ? config2.version : "1.0.0";
66089
66177
  const component = typeof version2 === "string" ? version2.replace(/\{x\}/g, "0") : "";
66090
66178
  if (!/^[a-z0-9][a-z0-9._+-]{0,127}$/i.test(component) || component.endsWith(".") || /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(?:\.|$)/i.test(component)) {
@@ -66092,15 +66180,15 @@ function validateProjectVersion(source) {
66092
66180
  "Unsafe project version: expected one portable directory component, optionally containing {x}."
66093
66181
  );
66094
66182
  }
66095
- inside(path27.join(source, "dist"), component);
66183
+ inside(path28.join(source, "dist"), component);
66096
66184
  }
66097
66185
  function validatePreparedPreview(source) {
66098
- const directory = path27.join(source, "dist");
66099
- const latest = JSON.parse(fs26.readFileSync(path27.join(directory, "latest.json"), "utf8"));
66186
+ const directory = path28.join(source, "dist");
66187
+ const latest = JSON.parse(fs27.readFileSync(path28.join(directory, "latest.json"), "utf8"));
66100
66188
  if (typeof latest.version !== "string" || !latest.version || typeof latest.client !== "string" || !/^[a-f0-9]+$/i.test(latest.client))
66101
66189
  throw new Error("Prepared latest.json is invalid.");
66102
66190
  const manifestPath = inside(directory, latest.version + "/manifest-" + latest.client + ".json");
66103
- const manifest = JSON.parse(fs26.readFileSync(manifestPath, "utf8"));
66191
+ const manifest = JSON.parse(fs27.readFileSync(manifestPath, "utf8"));
66104
66192
  if (manifest.target !== "client" || !Array.isArray(manifest.files) || typeof manifest.entry !== "string" || !manifest.entry)
66105
66193
  throw new Error("Prepared client manifest is invalid.");
66106
66194
  const sources = manifest.sources || {};
@@ -66110,8 +66198,8 @@ function validatePreparedPreview(source) {
66110
66198
  const urls = Array.isArray(config2.base_url) ? config2.base_url : [config2.base_url];
66111
66199
  if (!urls.length || urls.some((url2) => typeof url2 !== "string" || !url2.startsWith("https://")))
66112
66200
  throw new Error("Public source has no HTTPS CDN address: " + name);
66113
- const cache = path27.join(source, ".build", "manifest_cache");
66114
- if (!fs26.existsSync(cache) || !fs26.readdirSync(cache).some((file3) => file3.startsWith(name + "-") && file3.endsWith(".json")))
66201
+ const cache = path28.join(source, ".build", "manifest_cache");
66202
+ if (!fs27.existsSync(cache) || !fs27.readdirSync(cache).some((file3) => file3.startsWith(name + "-") && file3.endsWith(".json")))
66115
66203
  throw new Error("Public source index was not downloaded: " + name);
66116
66204
  }
66117
66205
  let projectFiles = 0;
@@ -66119,10 +66207,10 @@ function validatePreparedPreview(source) {
66119
66207
  if (file3.source && file3.source !== "project") continue;
66120
66208
  if (typeof file3.uuid !== "string" || typeof file3.hash !== "string" || typeof file3.ext !== "string")
66121
66209
  throw new Error("Prepared project asset metadata is invalid.");
66122
- const asset = inside(path27.join(directory, "assets"), file3.uuid + "-" + file3.hash + file3.ext);
66123
- if (!fs26.statSync(asset).isFile())
66210
+ const asset = inside(path28.join(directory, "assets"), file3.uuid + "-" + file3.hash + file3.ext);
66211
+ if (!fs27.statSync(asset).isFile())
66124
66212
  throw new Error("Prepared project asset is missing: " + asset);
66125
- if (typeof file3.size === "number" && fs26.statSync(asset).size !== file3.size)
66213
+ if (typeof file3.size === "number" && fs27.statSync(asset).size !== file3.size)
66126
66214
  throw new Error("Prepared project asset size mismatch: " + asset);
66127
66215
  projectFiles++;
66128
66216
  }
@@ -66140,8 +66228,8 @@ async function preparePreviewProject(project, directory, signal) {
66140
66228
  result = await prepareProjectCopy(project, directory, signal);
66141
66229
  return result;
66142
66230
  } finally {
66143
- const preparations = path27.join(previewDirectory(project), "preparations");
66144
- if (path27.dirname(directory) === preparations) {
66231
+ const preparations = path28.join(previewDirectory(project), "preparations");
66232
+ if (path28.dirname(directory) === preparations) {
66145
66233
  const warnings = trimPreviewCache(preparations, "", 3, [directory]);
66146
66234
  if (result)
66147
66235
  result.warnings = [...Array.isArray(result.warnings) ? result.warnings : [], ...warnings];
@@ -66155,15 +66243,15 @@ async function prepareProjectCopy(project, directory, signal) {
66155
66243
  const projectConfig = readPreviewConfiguration(project, "project");
66156
66244
  const resourcesConfig = readPreviewConfiguration(project, "resources");
66157
66245
  const settingsConfig = readPreviewConfiguration(project, "settings");
66158
- const source = path27.join(directory, "source");
66159
- if (fs26.existsSync(source)) throw new Error("Refusing to reuse an old prepared source directory.");
66160
- fs26.mkdirSync(source, { recursive: true, mode: 448 });
66246
+ const source = path28.join(directory, "source");
66247
+ if (fs27.existsSync(source)) throw new Error("Refusing to reuse an old prepared source directory.");
66248
+ fs27.mkdirSync(source, { recursive: true, mode: 448 });
66161
66249
  for (const name of ["scripts", "assets", ".project"]) {
66162
- const original = path27.join(project, name);
66163
- if (fs26.existsSync(original)) copyTree(original, path27.join(source, name), signal);
66250
+ const original = path28.join(project, name);
66251
+ if (fs27.existsSync(original)) copyTree(original, path28.join(source, name), signal);
66164
66252
  }
66165
- const configDirectory = path27.join(source, ".project");
66166
- fs26.mkdirSync(configDirectory, { recursive: true });
66253
+ const configDirectory = path28.join(source, ".project");
66254
+ fs27.mkdirSync(configDirectory, { recursive: true });
66167
66255
  const projectDefaults = projectConfig || {
66168
66256
  project_id: ((_a3 = loadProjectConfig(project)) == null ? void 0 : _a3.project_id) || "local-preview",
66169
66257
  author: { id: "local-preview" },
@@ -66171,10 +66259,10 @@ async function prepareProjectCopy(project, directory, signal) {
66171
66259
  };
66172
66260
  if (projectDefaults["entry@client"] === void 0 && projectDefaults.entry === void 0)
66173
66261
  projectDefaults.entry = previewEntryName(projectConfig, resourcesConfig);
66174
- fs26.writeFileSync(path27.join(configDirectory, "project.json"), JSON.stringify(projectDefaults));
66262
+ fs27.writeFileSync(path28.join(configDirectory, "project.json"), JSON.stringify(projectDefaults));
66175
66263
  if (!resourcesConfig)
66176
- fs26.writeFileSync(
66177
- path27.join(configDirectory, "resources.json"),
66264
+ fs27.writeFileSync(
66265
+ path28.join(configDirectory, "resources.json"),
66178
66266
  JSON.stringify({ groups: { default: ["**"] }, preload_groups: [] })
66179
66267
  );
66180
66268
  validateProjectVersion(source);
@@ -66194,45 +66282,48 @@ async function prepareProjectCopy(project, directory, signal) {
66194
66282
  "Local prepare currently supports project-local scripts/assets only; custom asset_dirs need explicit support."
66195
66283
  );
66196
66284
  configuration.build = { ...configuration.build, output_dir: "../dist" };
66197
- fs26.writeFileSync(path27.join(source, ".project", "settings.json"), JSON.stringify(configuration));
66285
+ fs27.writeFileSync(path28.join(source, ".project", "settings.json"), JSON.stringify(configuration));
66198
66286
  let python = checkMakerPythonEnvironment();
66199
66287
  if (!python.ready) python = setupMakerPythonEnvironment().environment;
66200
66288
  if (!python.ready || !python.python)
66201
66289
  throw new Error("Could not prepare the managed Python environment.");
66202
66290
  const builder = materializePreviewBuilder();
66203
66291
  const args = [builder, "--project", source, "--force-enhanced-refs", "--no-7z", "--no-compress"];
66204
- const cache = path27.join(previewDirectory(project), "public-index-cache");
66205
- const roundCache = path27.join(source, ".build", "manifest_cache");
66206
- if (fs26.existsSync(cache)) copyTree(cache, roundCache, signal);
66207
- const log = path27.join(directory, "prepare.log");
66292
+ const cache = path28.join(previewDirectory(project), "public-index-cache");
66293
+ const roundCache = path28.join(source, ".build", "manifest_cache");
66294
+ if (fs27.existsSync(cache)) copyTree(cache, roundCache, signal);
66295
+ const log = path28.join(directory, "prepare.log");
66208
66296
  try {
66209
66297
  const output2 = await promisify(execFile)(python.python, args, {
66210
- cwd: path27.dirname(builder),
66298
+ cwd: path28.dirname(builder),
66211
66299
  windowsHide: true,
66212
66300
  signal,
66213
66301
  timeout: 3e5,
66214
66302
  maxBuffer: 4 * 1024 * 1024,
66215
66303
  env: { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONNOUSERSITE: "1" }
66216
66304
  });
66217
- fs26.writeFileSync(log, String(sanitizeDiagnosticValue(output2.stdout + output2.stderr)), {
66305
+ fs27.writeFileSync(log, String(sanitizeDiagnosticValue(output2.stdout + output2.stderr)), {
66218
66306
  mode: 384
66219
66307
  });
66220
66308
  if (/加载远端来源.*失败|无法获取 version.json|无法下载 manifest/.test(output2.stdout))
66221
66309
  throw new Error("Public source index download failed.");
66222
- if (output2.stdout.includes("[ERROR]")) throw new Error("ProjectBuilder reported an error.");
66310
+ const diagnosticWarnings = previewBuilderWarnings(source, output2.stdout, output2.stderr);
66223
66311
  const result = validatePreparedPreview(source);
66224
- if (fs26.existsSync(roundCache)) copyTree(roundCache, cache, signal);
66312
+ if (fs27.existsSync(roundCache)) copyTree(roundCache, cache, signal);
66225
66313
  return {
66226
66314
  ok: true,
66227
66315
  source_directory: source,
66228
66316
  log_path: log,
66229
- warnings: output2.stdout.split(String.fromCharCode(10)).filter((line) => line.includes("[WARN]")).slice(0, 30),
66317
+ warnings: [
66318
+ ...diagnosticWarnings,
66319
+ ...output2.stdout.split(String.fromCharCode(10)).filter((line) => line.includes("[WARN]")).slice(0, 30)
66320
+ ],
66230
66321
  ...result
66231
66322
  };
66232
66323
  } catch (error2) {
66233
66324
  const failure = error2;
66234
- if (failure.stdout || failure.stderr || !fs26.existsSync(log))
66235
- fs26.writeFileSync(
66325
+ if (failure.stdout || failure.stderr || !fs27.existsSync(log))
66326
+ fs27.writeFileSync(
66236
66327
  log,
66237
66328
  String(
66238
66329
  sanitizeDiagnosticValue((failure.stdout || "") + (failure.stderr || "") || String(error2))
@@ -66245,35 +66336,35 @@ async function prepareProjectCopy(project, directory, signal) {
66245
66336
  }
66246
66337
  }
66247
66338
  function previewPreparationDirectory(project) {
66248
- return path27.join(previewDirectory(project), "preparations", randomUUID4());
66339
+ return path28.join(previewDirectory(project), "preparations", randomUUID4());
66249
66340
  }
66250
66341
 
66251
66342
  // src/maker/preview/runtime.ts
66252
66343
  init_configuration();
66253
66344
 
66254
66345
  // src/maker/preview/assets.ts
66255
- import fs27 from "node:fs";
66256
- import path28 from "node:path";
66346
+ import fs28 from "node:fs";
66347
+ import path29 from "node:path";
66257
66348
  import http from "node:http";
66258
66349
  import { randomBytes } from "node:crypto";
66259
66350
  import { pipeline } from "node:stream";
66260
66351
  async function startPreviewAssetServer(source, signal) {
66261
66352
  if (signal == null ? void 0 : signal.aborted) throw new Error("CANCELLED");
66262
- const root2 = fs27.realpathSync(path28.join(source, "dist"));
66353
+ const root2 = fs28.realpathSync(path29.join(source, "dist"));
66263
66354
  const files = /* @__PURE__ */ new Map();
66264
66355
  const allow = (relative) => {
66265
- const filename2 = path28.resolve(root2, relative);
66266
- if (!filename2.startsWith(root2 + path28.sep) || fs27.realpathSync(filename2) !== filename2 || !fs27.statSync(filename2).isFile())
66356
+ const filename2 = path29.resolve(root2, relative);
66357
+ if (!filename2.startsWith(root2 + path29.sep) || fs28.realpathSync(filename2) !== filename2 || !fs28.statSync(filename2).isFile())
66267
66358
  throw new Error("Invalid local preview asset.");
66268
- files.set(relative.split(path28.sep).join("/"), filename2);
66359
+ files.set(relative.split(path29.sep).join("/"), filename2);
66269
66360
  };
66270
66361
  allow("latest.json");
66271
- const latest = JSON.parse(fs27.readFileSync(files.get("latest.json"), "utf8"));
66362
+ const latest = JSON.parse(fs28.readFileSync(files.get("latest.json"), "utf8"));
66272
66363
  if (typeof latest.version !== "string" || !/^[^/\\]+$/.test(latest.version) || typeof latest.client !== "string" || !/^[a-f0-9]+$/i.test(latest.client))
66273
66364
  throw new Error("Invalid preview version.");
66274
66365
  const manifestName = latest.version + "/manifest-" + latest.client + ".json";
66275
66366
  allow(manifestName);
66276
- const manifest = JSON.parse(fs27.readFileSync(files.get(manifestName), "utf8"));
66367
+ const manifest = JSON.parse(fs28.readFileSync(files.get(manifestName), "utf8"));
66277
66368
  if (manifest.target !== "client" || !Array.isArray(manifest.files) || manifest.files.length > 1e5)
66278
66369
  throw new Error("Invalid preview client manifest.");
66279
66370
  for (const file3 of manifest.files) {
@@ -66283,7 +66374,7 @@ async function startPreviewAssetServer(source, signal) {
66283
66374
  throw new Error("Invalid preview asset name.");
66284
66375
  allow("assets/" + name);
66285
66376
  }
66286
- if (fs27.existsSync(path28.join(root2, "project.json"))) allow("project.json");
66377
+ if (fs28.existsSync(path29.join(root2, "project.json"))) allow("project.json");
66287
66378
  const prefix = "/" + randomBytes(32).toString("hex") + "/";
66288
66379
  let host = "";
66289
66380
  let closing;
@@ -66306,9 +66397,9 @@ async function startPreviewAssetServer(source, signal) {
66306
66397
  }
66307
66398
  let descriptor;
66308
66399
  try {
66309
- if (fs27.realpathSync(filename2) !== filename2) throw new Error("Asset changed.");
66310
- descriptor = fs27.openSync(filename2, fs27.constants.O_RDONLY | (fs27.constants.O_NOFOLLOW || 0));
66311
- const stat = fs27.fstatSync(descriptor);
66400
+ if (fs28.realpathSync(filename2) !== filename2) throw new Error("Asset changed.");
66401
+ descriptor = fs28.openSync(filename2, fs28.constants.O_RDONLY | (fs28.constants.O_NOFOLLOW || 0));
66402
+ const stat = fs28.fstatSync(descriptor);
66312
66403
  if (!stat.isFile()) throw new Error("Asset is not a file.");
66313
66404
  let start = 0;
66314
66405
  let end = stat.size - 1;
@@ -66317,7 +66408,7 @@ async function startPreviewAssetServer(source, signal) {
66317
66408
  start = match ? Number(match[1]) : NaN;
66318
66409
  end = (match == null ? void 0 : match[2]) ? Math.min(Number(match[2]), end) : end;
66319
66410
  if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end || start < 0) {
66320
- fs27.closeSync(descriptor);
66411
+ fs28.closeSync(descriptor);
66321
66412
  descriptor = void 0;
66322
66413
  response.writeHead(416, { "Content-Range": "bytes */" + stat.size }).end();
66323
66414
  return;
@@ -66332,11 +66423,11 @@ async function startPreviewAssetServer(source, signal) {
66332
66423
  filename2.endsWith(".json") ? "application/json" : "application/octet-stream"
66333
66424
  );
66334
66425
  if (request2.method === "HEAD" || stat.size === 0) {
66335
- fs27.closeSync(descriptor);
66426
+ fs28.closeSync(descriptor);
66336
66427
  descriptor = void 0;
66337
66428
  response.end();
66338
66429
  } else {
66339
- const stream = fs27.createReadStream(filename2, {
66430
+ const stream = fs28.createReadStream(filename2, {
66340
66431
  fd: descriptor,
66341
66432
  autoClose: true,
66342
66433
  start,
@@ -66347,7 +66438,7 @@ async function startPreviewAssetServer(source, signal) {
66347
66438
  });
66348
66439
  }
66349
66440
  } catch {
66350
- if (descriptor !== void 0) fs27.closeSync(descriptor);
66441
+ if (descriptor !== void 0) fs28.closeSync(descriptor);
66351
66442
  if (!response.headersSent) response.writeHead(404).end();
66352
66443
  else response.destroy();
66353
66444
  }
@@ -66390,8 +66481,8 @@ async function startPreviewAssetServer(source, signal) {
66390
66481
 
66391
66482
  // src/maker/preview/windowSettings.ts
66392
66483
  init_protocol2();
66393
- import fs28 from "node:fs";
66394
- import path29 from "node:path";
66484
+ import fs29 from "node:fs";
66485
+ import path30 from "node:path";
66395
66486
  var PREVIEW_WINDOW_PRESETS = {
66396
66487
  "16:9": { longEdge: 960, shortEdge: 540 },
66397
66488
  "21:9": { longEdge: 1260, shortEdge: 540 },
@@ -66415,20 +66506,20 @@ function validate(value) {
66415
66506
  };
66416
66507
  }
66417
66508
  function filename(project) {
66418
- return path29.join(previewDirectory(project), "window.json");
66509
+ return path30.join(previewDirectory(project), "window.json");
66419
66510
  }
66420
66511
  function readPreviewWindowSettings(project) {
66421
66512
  var _a3;
66422
66513
  let settings = defaults();
66423
66514
  try {
66424
66515
  const file3 = filename(project);
66425
- if (fs28.statSync(file3).size <= 4096)
66426
- settings = validate(JSON.parse(fs28.readFileSync(file3, "utf8")));
66516
+ if (fs29.statSync(file3).size <= 4096)
66517
+ settings = validate(JSON.parse(fs29.readFileSync(file3, "utf8")));
66427
66518
  } catch {
66428
66519
  }
66429
66520
  let projectOrientation = null;
66430
66521
  try {
66431
- const config2 = JSON.parse(fs28.readFileSync(path29.join(project, ".project/project.json"), "utf8"));
66522
+ const config2 = JSON.parse(fs29.readFileSync(path30.join(project, ".project/project.json"), "utf8"));
66432
66523
  const value = (_a3 = config2.taptap_publish) == null ? void 0 : _a3.screen_orientation;
66433
66524
  if (value === "portrait" || value === "landscape") projectOrientation = value;
66434
66525
  } catch {
@@ -66452,8 +66543,8 @@ function previewWindow(project) {
66452
66543
  }
66453
66544
 
66454
66545
  // src/maker/preview/network.ts
66455
- import fs29 from "node:fs";
66456
- import path30 from "node:path";
66546
+ import fs30 from "node:fs";
66547
+ import path31 from "node:path";
66457
66548
 
66458
66549
  // node_modules/ws/wrapper.mjs
66459
66550
  var import_stream = __toESM(require_stream(), 1);
@@ -66535,8 +66626,8 @@ function previewNetworkProject(source) {
66535
66626
  var _a3;
66536
66627
  if (!previewNetworkConfigured(source)) return void 0;
66537
66628
  const project = readPreviewConfiguration(source, "project");
66538
- const latestPath = path30.join(source, "dist", "latest.json");
66539
- const latest = fs29.existsSync(latestPath) ? JSON.parse(fs29.readFileSync(latestPath, "utf8")) : void 0;
66629
+ const latestPath = path31.join(source, "dist", "latest.json");
66630
+ const latest = fs30.existsSync(latestPath) ? JSON.parse(fs30.readFileSync(latestPath, "utf8")) : void 0;
66540
66631
  if (typeof (project == null ? void 0 : project.project_id) !== "string" || !project.project_id.trim() || ((_a3 = project.author) == null ? void 0 : _a3.id) === "local-preview")
66541
66632
  throw new Error("联网预览缺少游戏配置,请先提交构建并生成一次测试二维码,再启动本地预览。");
66542
66633
  if (!latest) {
@@ -66686,9 +66777,9 @@ var PREVIEW_TIMEOUT_MS = 3e4;
66686
66777
  var RUNTIME_STARTUP_SETTLE_MS = 3e3;
66687
66778
  async function probeRuntime(executable, signal) {
66688
66779
  if (signal == null ? void 0 : signal.aborted) throw new Error("CANCELLED");
66689
- if (!path31.isAbsolute(executable) || !fs30.statSync(executable).isFile())
66780
+ if (!path32.isAbsolute(executable) || !fs31.statSync(executable).isFile())
66690
66781
  throw new Error("Runtime must be an absolute executable file.");
66691
- fs30.accessSync(executable, process.platform === "win32" ? fs30.constants.R_OK : fs30.constants.X_OK);
66782
+ fs31.accessSync(executable, process.platform === "win32" ? fs31.constants.R_OK : fs31.constants.X_OK);
66692
66783
  return {
66693
66784
  protocol_version: 0,
66694
66785
  runtime_version: "unknown",
@@ -66767,12 +66858,12 @@ var PreviewRuntime = class {
66767
66858
  this.assets = await startPreviewAssetServer(source, this.abort.signal);
66768
66859
  this.mode = "loopback_manifest";
66769
66860
  try {
66770
- cacheRoot = process.platform === "win32" ? this.temporaryCache = fs30.realpathSync(
66771
- fs30.mkdtempSync(path31.join(os5.tmpdir(), "maker-cache-"))
66772
- ) : path31.join(_storage, "runtime-cache");
66773
- fs30.mkdirSync(cacheRoot, { recursive: true, mode: 448 });
66774
- this.assetCache = path31.join(
66775
- fs30.realpathSync(cacheRoot),
66861
+ cacheRoot = process.platform === "win32" ? this.temporaryCache = fs31.realpathSync(
66862
+ fs31.mkdtempSync(path32.join(os5.tmpdir(), "maker-cache-"))
66863
+ ) : path32.join(_storage, "runtime-cache");
66864
+ fs31.mkdirSync(cacheRoot, { recursive: true, mode: 448 });
66865
+ this.assetCache = path32.join(
66866
+ fs31.realpathSync(cacheRoot),
66776
66867
  this.assets.url.slice("http://".length).replace(":", "_")
66777
66868
  );
66778
66869
  } catch (error2) {
@@ -66893,10 +66984,10 @@ var PreviewRuntime = class {
66893
66984
  clearAssetCache() {
66894
66985
  if (this.temporaryCache) {
66895
66986
  try {
66896
- if (fs30.existsSync(this.temporaryCache)) {
66897
- if (fs30.lstatSync(this.temporaryCache).isSymbolicLink() || fs30.realpathSync(this.temporaryCache) !== this.temporaryCache)
66987
+ if (fs31.existsSync(this.temporaryCache)) {
66988
+ if (fs31.lstatSync(this.temporaryCache).isSymbolicLink() || fs31.realpathSync(this.temporaryCache) !== this.temporaryCache)
66898
66989
  throw new Error("Preview cache ownership changed.");
66899
- fs30.rmSync(this.temporaryCache, { recursive: true, force: true });
66990
+ fs31.rmSync(this.temporaryCache, { recursive: true, force: true });
66900
66991
  }
66901
66992
  this.temporaryCache = void 0;
66902
66993
  this.assetCache = void 0;
@@ -66907,10 +66998,10 @@ var PreviewRuntime = class {
66907
66998
  }
66908
66999
  if (!this.assetCache) return;
66909
67000
  try {
66910
- const parent = path31.dirname(this.assetCache);
66911
- if (fs30.existsSync(parent) && fs30.realpathSync(parent) === parent) {
66912
- fs30.rmSync(this.assetCache, { recursive: true, force: true });
66913
- if (!fs30.readdirSync(parent).length) fs30.rmdirSync(parent);
67001
+ const parent = path32.dirname(this.assetCache);
67002
+ if (fs31.existsSync(parent) && fs31.realpathSync(parent) === parent) {
67003
+ fs31.rmSync(this.assetCache, { recursive: true, force: true });
67004
+ if (!fs31.readdirSync(parent).length) fs31.rmdirSync(parent);
66914
67005
  }
66915
67006
  } catch {
66916
67007
  this.recordError("Could not remove this round of local preview download cache.");
@@ -66982,8 +67073,8 @@ var PreviewRuntime = class {
66982
67073
  };
66983
67074
 
66984
67075
  // src/maker/preview/runtimeResources.ts
66985
- import fs31 from "node:fs";
66986
- import path32 from "node:path";
67076
+ import fs32 from "node:fs";
67077
+ import path33 from "node:path";
66987
67078
  var FALLBACK_FONT = "MiSans-Regular.ttf";
66988
67079
  function defaultFontCandidates(platform) {
66989
67080
  if (platform === "darwin") {
@@ -66995,44 +67086,44 @@ function defaultFontCandidates(platform) {
66995
67086
  if (platform === "win32") {
66996
67087
  const windows = process.env.WINDIR || process.env.SystemRoot || "C:\\Windows";
66997
67088
  return [
66998
- path32.join(windows, "Fonts", "Deng.ttf"),
66999
- path32.join(windows, "Fonts", "Dengb.ttf"),
67000
- path32.join(windows, "Fonts", "msyh.ttc")
67089
+ path33.join(windows, "Fonts", "Deng.ttf"),
67090
+ path33.join(windows, "Fonts", "Dengb.ttf"),
67091
+ path33.join(windows, "Fonts", "msyh.ttc")
67001
67092
  ];
67002
67093
  }
67003
67094
  return [];
67004
67095
  }
67005
67096
  function existingFile(filename2) {
67006
67097
  try {
67007
- return fs31.statSync(filename2).isFile();
67098
+ return fs32.statSync(filename2).isFile();
67008
67099
  } catch {
67009
67100
  return false;
67010
67101
  }
67011
67102
  }
67012
67103
  function ensurePreviewRuntimeResources(executable, options3 = {}) {
67013
- const runtimeRoot = path32.dirname(fs31.realpathSync(executable));
67014
- const fonts = path32.join(runtimeRoot, "Res", "Fonts");
67015
- const legacyFonts = path32.join(runtimeRoot, "Data", "Fonts");
67104
+ const runtimeRoot = path33.dirname(fs32.realpathSync(executable));
67105
+ const fonts = path33.join(runtimeRoot, "Res", "Fonts");
67106
+ const legacyFonts = path33.join(runtimeRoot, "Data", "Fonts");
67016
67107
  for (const directory of [
67017
- path32.join(runtimeRoot, "Data", "LuaScripts"),
67108
+ path33.join(runtimeRoot, "Data", "LuaScripts"),
67018
67109
  legacyFonts,
67019
67110
  fonts,
67020
- path32.join(runtimeRoot, "CoreData")
67111
+ path33.join(runtimeRoot, "CoreData")
67021
67112
  ]) {
67022
- fs31.mkdirSync(directory, { recursive: true });
67113
+ fs32.mkdirSync(directory, { recursive: true });
67023
67114
  }
67024
- const target = path32.join(fonts, FALLBACK_FONT);
67025
- if (fs31.existsSync(target)) return { fallbackFont: "existing", warnings: [] };
67115
+ const target = path33.join(fonts, FALLBACK_FONT);
67116
+ if (fs32.existsSync(target)) return { fallbackFont: "existing", warnings: [] };
67026
67117
  const platform = options3.platform || process.platform;
67027
67118
  const candidates = [
67028
- path32.join(legacyFonts, FALLBACK_FONT),
67119
+ path33.join(legacyFonts, FALLBACK_FONT),
67029
67120
  ...options3.fontCandidates || defaultFontCandidates(platform)
67030
67121
  ];
67031
67122
  const copyErrors = [];
67032
67123
  for (const candidate of candidates) {
67033
67124
  if (!existingFile(candidate)) continue;
67034
67125
  try {
67035
- fs31.copyFileSync(candidate, target, fs31.constants.COPYFILE_EXCL);
67126
+ fs32.copyFileSync(candidate, target, fs32.constants.COPYFILE_EXCL);
67036
67127
  return { fallbackFont: "copied", fallbackFontSource: candidate, warnings: [] };
67037
67128
  } catch (error2) {
67038
67129
  if (error2.code === "EEXIST") {
@@ -67266,10 +67357,10 @@ function processPresence(pid) {
67266
67357
 
67267
67358
  // src/maker/preview/installation.ts
67268
67359
  function readInstallation(filename2) {
67269
- if (!fs32.existsSync(filename2)) return void 0;
67360
+ if (!fs33.existsSync(filename2)) return void 0;
67270
67361
  try {
67271
- const value = JSON.parse(fs32.readFileSync(filename2, "utf8"));
67272
- if (value.install_state !== "ready" || !value.executable || !path33.isAbsolute(value.executable) || !fs32.statSync(value.executable).isFile()) {
67362
+ const value = JSON.parse(fs33.readFileSync(filename2, "utf8"));
67363
+ if (value.install_state !== "ready" || !value.executable || !path34.isAbsolute(value.executable) || !fs33.statSync(value.executable).isFile()) {
67273
67364
  return void 0;
67274
67365
  }
67275
67366
  return value;
@@ -67278,27 +67369,27 @@ function readInstallation(filename2) {
67278
67369
  }
67279
67370
  }
67280
67371
  function isInside(directory, filename2) {
67281
- const relative = path33.relative(directory, filename2);
67282
- return relative !== "" && !relative.startsWith(".." + path33.sep) && !path33.isAbsolute(relative);
67372
+ const relative = path34.relative(directory, filename2);
67373
+ return relative !== "" && !relative.startsWith(".." + path34.sep) && !path34.isAbsolute(relative);
67283
67374
  }
67284
67375
  function legacyPreviewInstallation(project) {
67285
67376
  var _a3;
67286
- const root2 = path33.dirname(previewDirectory(project));
67287
- if (!fs32.existsSync(root2)) return void 0;
67288
- const entries = fs32.readdirSync(root2, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^[a-f0-9]{64}$/.test(entry.name));
67377
+ const root2 = path34.dirname(previewDirectory(project));
67378
+ if (!fs33.existsSync(root2)) return void 0;
67379
+ const entries = fs33.readdirSync(root2, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^[a-f0-9]{64}$/.test(entry.name));
67289
67380
  const candidates = [];
67290
67381
  for (const entry of entries) {
67291
- const directory = path33.join(root2, entry.name);
67292
- const filename2 = path33.join(directory, "installation.json");
67382
+ const directory = path34.join(root2, entry.name);
67383
+ const filename2 = path34.join(directory, "installation.json");
67293
67384
  const installation = readInstallation(filename2);
67294
67385
  if (!(installation == null ? void 0 : installation.executable)) continue;
67295
67386
  try {
67296
- const executable = fs32.realpathSync(installation.executable);
67297
- const managedDirectory = fs32.realpathSync(directory);
67387
+ const executable = fs33.realpathSync(installation.executable);
67388
+ const managedDirectory = fs33.realpathSync(directory);
67298
67389
  if (!isInside(managedDirectory, executable)) continue;
67299
67390
  candidates.push({
67300
67391
  installation: { ...installation, executable },
67301
- modified: Date.parse(installation.installed_at || "") || fs32.statSync(filename2).mtimeMs
67392
+ modified: Date.parse(installation.installed_at || "") || fs33.statSync(filename2).mtimeMs
67302
67393
  });
67303
67394
  } catch {
67304
67395
  }
@@ -67307,7 +67398,7 @@ function legacyPreviewInstallation(project) {
67307
67398
  return (_a3 = candidates[0]) == null ? void 0 : _a3.installation;
67308
67399
  }
67309
67400
  function previewInstallation(project) {
67310
- const filename2 = path33.join(runtimeDirectory(), "installation.json");
67401
+ const filename2 = path34.join(runtimeDirectory(), "installation.json");
67311
67402
  const current = readInstallation(filename2);
67312
67403
  if (current) return current;
67313
67404
  const legacy = legacyPreviewInstallation(project);
@@ -67326,31 +67417,31 @@ function previewInstallation(project) {
67326
67417
  }
67327
67418
  }
67328
67419
  async function withFileLock(directory, name, busyMessage, action) {
67329
- fs32.mkdirSync(directory, { recursive: true, mode: 448 });
67330
- const filename2 = path33.join(directory, name);
67420
+ fs33.mkdirSync(directory, { recursive: true, mode: 448 });
67421
+ const filename2 = path34.join(directory, name);
67331
67422
  let descriptor;
67332
67423
  try {
67333
- descriptor = fs32.openSync(filename2, "wx", 384);
67424
+ descriptor = fs33.openSync(filename2, "wx", 384);
67334
67425
  } catch {
67335
67426
  throw new Error(
67336
67427
  busyMessage + " If an interrupted command left a lock, verify it exited before removing " + filename2
67337
67428
  );
67338
67429
  }
67339
67430
  try {
67340
- fs32.writeFileSync(
67431
+ fs33.writeFileSync(
67341
67432
  descriptor,
67342
67433
  JSON.stringify({ pid: process.pid, created_at: (/* @__PURE__ */ new Date()).toISOString() })
67343
67434
  );
67344
67435
  return await action();
67345
67436
  } finally {
67346
- fs32.closeSync(descriptor);
67347
- fs32.unlinkSync(filename2);
67437
+ fs33.closeSync(descriptor);
67438
+ fs33.unlinkSync(filename2);
67348
67439
  }
67349
67440
  }
67350
67441
  async function withPreviewLock(project, action) {
67351
67442
  const directory = previewDirectory(project);
67352
- fs32.mkdirSync(directory, { recursive: true, mode: 448 });
67353
- const filename2 = path33.join(fs32.realpathSync(directory), "operation.lock");
67443
+ fs33.mkdirSync(directory, { recursive: true, mode: 448 });
67444
+ const filename2 = path34.join(fs33.realpathSync(directory), "operation.lock");
67354
67445
  const busy = () => new Error("Another preview operation is in progress. Please retry after it finishes.");
67355
67446
  const release = await claimRecoveryMutex(filename2, busy);
67356
67447
  const identity = JSON.stringify({
@@ -67360,8 +67451,8 @@ async function withPreviewLock(project, action) {
67360
67451
  });
67361
67452
  let owned = false;
67362
67453
  try {
67363
- if (fs32.existsSync(filename2)) {
67364
- const previous = fs32.readFileSync(filename2, "utf8");
67454
+ if (fs33.existsSync(filename2)) {
67455
+ const previous = fs33.readFileSync(filename2, "utf8");
67365
67456
  let pid;
67366
67457
  try {
67367
67458
  pid = JSON.parse(previous).pid;
@@ -67371,9 +67462,9 @@ async function withPreviewLock(project, action) {
67371
67462
  throw new Error(
67372
67463
  "Preview operation ownership is still active or unverified. Confirm the previous command has exited before removing only: " + filename2
67373
67464
  );
67374
- fs32.unlinkSync(filename2);
67465
+ fs33.unlinkSync(filename2);
67375
67466
  }
67376
- fs32.writeFileSync(filename2, identity, { flag: "wx", mode: 384 });
67467
+ fs33.writeFileSync(filename2, identity, { flag: "wx", mode: 384 });
67377
67468
  owned = true;
67378
67469
  return await action();
67379
67470
  } finally {
@@ -67386,7 +67477,7 @@ async function withPreviewLock(project, action) {
67386
67477
  }
67387
67478
  function removeOwnedPreviewLock(filename2, identity) {
67388
67479
  try {
67389
- if (fs32.readFileSync(filename2, "utf8") === identity) fs32.unlinkSync(filename2);
67480
+ if (fs33.readFileSync(filename2, "utf8") === identity) fs33.unlinkSync(filename2);
67390
67481
  } catch (error2) {
67391
67482
  if (error2.code !== "ENOENT") throw error2;
67392
67483
  }
@@ -67400,17 +67491,17 @@ async function withRuntimeInstallLock(action) {
67400
67491
  );
67401
67492
  }
67402
67493
  function activePreviewRuntimeDirectories(project) {
67403
- const root2 = path33.dirname(previewDirectory(project));
67404
- if (!fs32.existsSync(root2)) return [];
67494
+ const root2 = path34.dirname(previewDirectory(project));
67495
+ if (!fs33.existsSync(root2)) return [];
67405
67496
  const protectedDirectories = [];
67406
- for (const entry of fs32.readdirSync(root2, { withFileTypes: true })) {
67497
+ for (const entry of fs33.readdirSync(root2, { withFileTypes: true })) {
67407
67498
  if (!entry.isDirectory() || !/^[a-f0-9]{64}$/.test(entry.name)) continue;
67408
- const filename2 = path33.join(root2, entry.name, "session.json");
67409
- if (!fs32.existsSync(filename2)) continue;
67499
+ const filename2 = path34.join(root2, entry.name, "session.json");
67500
+ if (!fs33.existsSync(filename2)) continue;
67410
67501
  try {
67411
- const record2 = JSON.parse(fs32.readFileSync(filename2, "utf8"));
67412
- if (record2.state !== "stopped" && record2.executable && path33.isAbsolute(record2.executable)) {
67413
- protectedDirectories.push(path33.dirname(record2.executable));
67502
+ const record2 = JSON.parse(fs33.readFileSync(filename2, "utf8"));
67503
+ if (record2.state !== "stopped" && record2.executable && path34.isAbsolute(record2.executable)) {
67504
+ protectedDirectories.push(path34.dirname(record2.executable));
67414
67505
  }
67415
67506
  } catch {
67416
67507
  }
@@ -67436,12 +67527,12 @@ async function installPreviewRuntime(project, signal, update = false) {
67436
67527
  }
67437
67528
  }
67438
67529
  const directory = runtimeDirectory();
67439
- const unresolved = fs32.existsSync(directory) && fs32.readdirSync(directory, { withFileTypes: true }).find(
67440
- (entry) => entry.isDirectory() && entry.name.startsWith("runtime-") && fs32.existsSync(path33.join(directory, entry.name, UNVERIFIED_CLEANUP_MARKER))
67530
+ const unresolved = fs33.existsSync(directory) && fs33.readdirSync(directory, { withFileTypes: true }).find(
67531
+ (entry) => entry.isDirectory() && entry.name.startsWith("runtime-") && fs33.existsSync(path34.join(directory, entry.name, UNVERIFIED_CLEANUP_MARKER))
67441
67532
  );
67442
67533
  if (unresolved) {
67443
67534
  throw new Error(
67444
- "The previous installer cleanup is unverified. Confirm its processes have exited before removing only the marked directory: " + path33.join(directory, unresolved.name)
67535
+ "The previous installer cleanup is unverified. Confirm its processes have exited before removing only the marked directory: " + path34.join(directory, unresolved.name)
67445
67536
  );
67446
67537
  }
67447
67538
  const python = checkMakerPythonEnvironment();
@@ -67450,10 +67541,10 @@ async function installPreviewRuntime(project, signal, update = false) {
67450
67541
  "Runtime installation needs Python and curl. Run taptap-maker python setup with host approval, then retry."
67451
67542
  );
67452
67543
  }
67453
- const staging = path33.join(directory, "runtime-" + randomUUID5());
67454
- fs32.mkdirSync(staging, { recursive: true, mode: 448 });
67455
- const installer = path33.join(staging, "install-urhox-runtime.py");
67456
- fs32.writeFileSync(installer, PREVIEW_INSTALLER_SOURCE, { mode: 384 });
67544
+ const staging = path34.join(directory, "runtime-" + randomUUID5());
67545
+ fs33.mkdirSync(staging, { recursive: true, mode: 448 });
67546
+ const installer = path34.join(staging, "install-urhox-runtime.py");
67547
+ fs33.writeFileSync(installer, PREVIEW_INSTALLER_SOURCE, { mode: 384 });
67457
67548
  const platform = process.platform === "win32" ? "win32" : "darwin";
67458
67549
  try {
67459
67550
  await runPreviewInstaller(
@@ -67466,14 +67557,14 @@ async function installPreviewRuntime(project, signal, update = false) {
67466
67557
  signal
67467
67558
  }
67468
67559
  );
67469
- const executable = fs32.realpathSync(
67470
- path33.join(staging, platform === "win32" ? "UrhoXRuntime.exe" : "UrhoXRuntime")
67560
+ const executable = fs33.realpathSync(
67561
+ path34.join(staging, platform === "win32" ? "UrhoXRuntime.exe" : "UrhoXRuntime")
67471
67562
  );
67472
67563
  const resources2 = ensurePreviewRuntimeResources(executable);
67473
67564
  const runtime = await probeRuntime(executable, signal);
67474
- const archive = path33.join(staging, "UrhoXRuntime.zip");
67565
+ const archive = path34.join(staging, "UrhoXRuntime.zip");
67475
67566
  const hash2 = createHash5("sha256");
67476
- for await (const chunk of fs32.createReadStream(archive)) hash2.update(chunk);
67567
+ for await (const chunk of fs33.createReadStream(archive)) hash2.update(chunk);
67477
67568
  const installation = {
67478
67569
  install_state: "ready",
67479
67570
  executable,
@@ -67483,19 +67574,19 @@ async function installPreviewRuntime(project, signal, update = false) {
67483
67574
  warnings: resources2.warnings
67484
67575
  };
67485
67576
  const protectedDirectories = [staging, ...activePreviewRuntimeDirectories(project)];
67486
- if (previous.executable) protectedDirectories.push(path33.dirname(previous.executable));
67577
+ if (previous.executable) protectedDirectories.push(path34.dirname(previous.executable));
67487
67578
  installation.warnings = [
67488
67579
  ...installation.warnings || [],
67489
67580
  ...trimPreviewCache(directory, "runtime-", 2, protectedDirectories)
67490
67581
  ];
67491
- writePrivateJson(path33.join(directory, "installation.json"), installation);
67582
+ writePrivateJson(path34.join(directory, "installation.json"), installation);
67492
67583
  return installation;
67493
67584
  } catch (error2) {
67494
67585
  const cleanupUnverified = error2.cleanupVerified === false;
67495
- if (!cleanupUnverified) fs32.rmSync(staging, { recursive: true, force: true });
67586
+ if (!cleanupUnverified) fs33.rmSync(staging, { recursive: true, force: true });
67496
67587
  else
67497
- fs32.writeFileSync(
67498
- path33.join(staging, UNVERIFIED_CLEANUP_MARKER),
67588
+ fs33.writeFileSync(
67589
+ path34.join(staging, UNVERIFIED_CLEANUP_MARKER),
67499
67590
  "Installer process ownership must be verified before cleanup.\n",
67500
67591
  { mode: 384 }
67501
67592
  );
@@ -67507,8 +67598,8 @@ async function installPreviewRuntime(project, signal, update = false) {
67507
67598
 
67508
67599
  // src/maker/preview/session.ts
67509
67600
  init_protocol2();
67510
- import fs33 from "node:fs";
67511
- import path34 from "node:path";
67601
+ import fs34 from "node:fs";
67602
+ import path35 from "node:path";
67512
67603
  import http2 from "node:http";
67513
67604
  import os6 from "node:os";
67514
67605
  import { timingSafeEqual } from "node:crypto";
@@ -67539,10 +67630,10 @@ var PreviewSession = class {
67539
67630
  if ((current == null ? void 0 : current.session_id) !== this.record.session_id || current.supervisor_id !== this.record.supervisor_id)
67540
67631
  return;
67541
67632
  writePrivateJson(
67542
- path34.join(previewDirectory(this.record.project_realpath), "session.json"),
67633
+ path35.join(previewDirectory(this.record.project_realpath), "session.json"),
67543
67634
  this.record
67544
67635
  );
67545
- writePrivateJson(path34.join(previewRoundDirectory(this.record), "result.json"), this.status());
67636
+ writePrivateJson(path35.join(previewRoundDirectory(this.record), "result.json"), this.status());
67546
67637
  }
67547
67638
  }
67548
67639
  setTerminalState(state) {
@@ -67670,7 +67761,7 @@ var PreviewSession = class {
67670
67761
  this.runtime = runtime;
67671
67762
  await runtime.start(
67672
67763
  String(this.preflight.entry),
67673
- path34.join(previewDirectory(this.record.project_realpath), "storage"),
67764
+ path35.join(previewDirectory(this.record.project_realpath), "storage"),
67674
67765
  this.preflight.window
67675
67766
  );
67676
67767
  if (this.stopping) throw new Error("CANCELLED");
@@ -67689,7 +67780,7 @@ var PreviewSession = class {
67689
67780
  } finally {
67690
67781
  try {
67691
67782
  trimPreviewEvidence(
67692
- path34.join(previewDirectory(this.record.project_realpath), "sessions"),
67783
+ path35.join(previewDirectory(this.record.project_realpath), "sessions"),
67693
67784
  this.record.session_id,
67694
67785
  this.record.reload_id
67695
67786
  );
@@ -67855,7 +67946,7 @@ async function runPreviewSupervisor(project, sessionId) {
67855
67946
  try {
67856
67947
  const current = readPreviewRecord(project);
67857
67948
  if ((current == null ? void 0 : current.session_id) === record2.session_id && current.supervisor_id === record2.supervisor_id && current.reload_id === record2.reload_id) {
67858
- writePrivateJson(path34.join(previewRoundDirectory(record2), "result.json"), {
67949
+ writePrivateJson(path35.join(previewRoundDirectory(record2), "result.json"), {
67859
67950
  ...session.status(),
67860
67951
  supervisor_retired: true
67861
67952
  });
@@ -67935,7 +68026,7 @@ async function runPreviewSupervisor(project, sessionId) {
67935
68026
  record2.supervisor_pid = process.pid;
67936
68027
  record2.runtime_pid = 0;
67937
68028
  record2.runtime_launch_pending = false;
67938
- writePrivateJson(path34.join(previewDirectory(project), "session.json"), record2);
68029
+ writePrivateJson(path35.join(previewDirectory(project), "session.json"), record2);
67939
68030
  const idleTimer = setInterval(() => {
67940
68031
  if (record2.state === "stopped") void shutdown();
67941
68032
  else if (session.canRetireFailure) void shutdown(true);
@@ -67969,10 +68060,10 @@ async function previewStatus(project) {
67969
68060
  };
67970
68061
  } catch {
67971
68062
  const stopped = record2.state === "stopped";
67972
- const filename2 = path34.join(previewRoundDirectory(record2), "result.json");
68063
+ const filename2 = path35.join(previewRoundDirectory(record2), "result.json");
67973
68064
  let evidence = {};
67974
- if (fs33.existsSync(filename2)) {
67975
- const saved = JSON.parse(fs33.readFileSync(filename2, "utf8"));
68065
+ if (fs34.existsSync(filename2)) {
68066
+ const saved = JSON.parse(fs34.readFileSync(filename2, "utf8"));
67976
68067
  if (samePreviewIdentity(saved, record2)) {
67977
68068
  evidence = { ...saved };
67978
68069
  delete evidence.token;
@@ -68027,8 +68118,8 @@ init_diagnosticRedaction();
68027
68118
 
68028
68119
  // src/maker/system/backgroundProcess.ts
68029
68120
  import { spawn as spawn8 } from "node:child_process";
68030
- import fs34 from "node:fs";
68031
- import path35 from "node:path";
68121
+ import fs35 from "node:fs";
68122
+ import path36 from "node:path";
68032
68123
  var WINDOWS_ENV_KEYS = /* @__PURE__ */ new Set([
68033
68124
  "APPDATA",
68034
68125
  "COMSPEC",
@@ -68063,9 +68154,9 @@ var WINDOWS_ENV_KEYS = /* @__PURE__ */ new Set([
68063
68154
  "WINDIR"
68064
68155
  ]);
68065
68156
  function openBackgroundProcessLog(filename2) {
68066
- fs34.mkdirSync(path35.dirname(filename2), { recursive: true, mode: 448 });
68067
- const oversized = fs34.existsSync(filename2) && fs34.statSync(filename2).size > 1024 * 1024;
68068
- return fs34.openSync(filename2, oversized ? "w" : "a", 384);
68157
+ fs35.mkdirSync(path36.dirname(filename2), { recursive: true, mode: 448 });
68158
+ const oversized = fs35.existsSync(filename2) && fs35.statSync(filename2).size > 1024 * 1024;
68159
+ return fs35.openSync(filename2, oversized ? "w" : "a", 384);
68069
68160
  }
68070
68161
  function selectWindowsBackgroundEnvironment(env) {
68071
68162
  return Object.fromEntries(
@@ -68107,7 +68198,7 @@ async function launchBackgroundProcess(options3) {
68107
68198
  var _a3, _b, _c;
68108
68199
  if ((_a3 = options3.signal) == null ? void 0 : _a3.aborted) throw new Error("CANCELLED: background launch.");
68109
68200
  if ((options3.platform ?? process.platform) !== "win32") return directLaunch(options3);
68110
- fs34.closeSync(openBackgroundProcessLog(options3.logFile));
68201
+ fs35.closeSync(openBackgroundProcessLog(options3.logFile));
68111
68202
  const scripts = buildWindowsBackgroundLaunchScripts(options3);
68112
68203
  const broker = spawn8(
68113
68204
  "powershell.exe",
@@ -68180,7 +68271,7 @@ function directLaunch(options3) {
68180
68271
  env: options3.env
68181
68272
  });
68182
68273
  } finally {
68183
- fs34.closeSync(stderr);
68274
+ fs35.closeSync(stderr);
68184
68275
  }
68185
68276
  let launchFailure;
68186
68277
  child.once("error", (error2) => {
@@ -68284,7 +68375,7 @@ async function runPreviewCli(action, options3) {
68284
68375
  );
68285
68376
  } else {
68286
68377
  if (action === "stop") {
68287
- writePrivateJson(path36.join(previewDirectory(project), "stop.json"), {
68378
+ writePrivateJson(path37.join(previewDirectory(project), "stop.json"), {
68288
68379
  request_id: randomUUID6()
68289
68380
  });
68290
68381
  }
@@ -68363,8 +68454,8 @@ async function runPreviewCli(action, options3) {
68363
68454
  process.exitCode = 1;
68364
68455
  }
68365
68456
  async function startPreview(project, options3, signal) {
68366
- const stopFile = path36.join(previewDirectory(project), "stop.json");
68367
- const readStop = () => fs35.existsSync(stopFile) ? fs35.readFileSync(stopFile, "utf8") : "";
68457
+ const stopFile = path37.join(previewDirectory(project), "stop.json");
68458
+ const readStop = () => fs36.existsSync(stopFile) ? fs36.readFileSync(stopFile, "utf8") : "";
68368
68459
  const stopGeneration = readStop();
68369
68460
  const checkCancelled = () => {
68370
68461
  if (signal.aborted || readStop() !== stopGeneration)
@@ -68398,9 +68489,9 @@ async function startPreview(project, options3, signal) {
68398
68489
  install_state: "missing",
68399
68490
  error: "Runtime is missing. With host approval, run taptap-maker preview install --target-dir <PROJECT_ABSOLUTE_PATH>, then retry start."
68400
68491
  };
68401
- if (!path36.isAbsolute(configured))
68492
+ if (!path37.isAbsolute(configured))
68402
68493
  throw new Error("--runtime must be an absolute executable path.");
68403
- const executable = fs35.realpathSync(configured);
68494
+ const executable = fs36.realpathSync(configured);
68404
68495
  const resourceWarnings = externalRuntime ? [] : ensurePreviewRuntimeResources(executable).warnings;
68405
68496
  const runtime = await probeRuntime(executable, signal);
68406
68497
  checkCancelled();
@@ -68420,14 +68511,14 @@ async function startPreview(project, options3, signal) {
68420
68511
  state: "starting",
68421
68512
  runtime
68422
68513
  };
68423
- writePrivateJson(path36.join(previewDirectory(project), "session.json"), record2);
68514
+ writePrivateJson(path37.join(previewDirectory(project), "session.json"), record2);
68424
68515
  const launch = await launchPreviewSupervisorProcess({
68425
68516
  execPath: process.execPath,
68426
68517
  execArgv: process.execArgv,
68427
68518
  entry: process.argv[1],
68428
68519
  project,
68429
68520
  sessionId: record2.session_id,
68430
- cwd: path36.dirname(executable),
68521
+ cwd: path37.dirname(executable),
68431
68522
  logFile: previewSupervisorLogPath(project),
68432
68523
  env: process.env,
68433
68524
  signal
@@ -68472,7 +68563,7 @@ async function startPreview(project, options3, signal) {
68472
68563
  } else {
68473
68564
  if (launch.stopUnpublished()) {
68474
68565
  record2.state = "stopped";
68475
- writePrivateJson(path36.join(previewDirectory(project), "session.json"), record2);
68566
+ writePrivateJson(path37.join(previewDirectory(project), "session.json"), record2);
68476
68567
  } else {
68477
68568
  throw new Error(
68478
68569
  String(error2) + "; supervisor exit is unverified. Inspect " + previewSupervisorLogPath(project)
@@ -68484,8 +68575,8 @@ async function startPreview(project, options3, signal) {
68484
68575
  }
68485
68576
 
68486
68577
  // src/maker/console/cli.ts
68487
- import fs44 from "node:fs";
68488
- import path46 from "node:path";
68578
+ import fs45 from "node:fs";
68579
+ import path47 from "node:path";
68489
68580
  import { spawn as spawn11 } from "node:child_process";
68490
68581
  import { createHash as createHash9, randomUUID as randomUUID8 } from "node:crypto";
68491
68582
  init_storage();
@@ -68498,8 +68589,8 @@ init_projectSettings();
68498
68589
  init_qrcodePreflight();
68499
68590
  init_qrcodeInteraction();
68500
68591
  init_git();
68501
- import fs36 from "node:fs";
68502
- import path37 from "node:path";
68592
+ import fs37 from "node:fs";
68593
+ import path38 from "node:path";
68503
68594
  import { execFile as execFile2 } from "node:child_process";
68504
68595
  import { promisify as promisify2 } from "node:util";
68505
68596
 
@@ -68523,17 +68614,17 @@ var ConsoleError = class extends Error {
68523
68614
  // src/maker/console/projects.ts
68524
68615
  var exec = promisify2(execFile2);
68525
68616
  function objectFile2(filename2) {
68526
- const stat = fs36.statSync(filename2);
68617
+ const stat = fs37.statSync(filename2);
68527
68618
  if (!stat.isFile() || stat.size > 2 * 1024 * 1024)
68528
68619
  throw new ConsoleError("Project configuration exceeds the supported size.");
68529
- const data = JSON.parse(fs36.readFileSync(filename2, "utf8"));
68620
+ const data = JSON.parse(fs37.readFileSync(filename2, "utf8"));
68530
68621
  if (!data || typeof data !== "object" || Array.isArray(data))
68531
68622
  throw new ConsoleError("Invalid project configuration.");
68532
68623
  return data;
68533
68624
  }
68534
68625
  function optionalConfig(root2, file3) {
68535
68626
  try {
68536
- return objectFile2(path37.join(root2, ".project", file3));
68627
+ return objectFile2(path38.join(root2, ".project", file3));
68537
68628
  } catch {
68538
68629
  return {};
68539
68630
  }
@@ -68576,7 +68667,7 @@ var ConsoleProjects = class {
68576
68667
  const error2 = entry.error;
68577
68668
  const config2 = error2 ? {} : optionalConfig(entry.path, "project.json");
68578
68669
  const title = (_b = text((_a3 = config2.taptap_publish) == null ? void 0 : _a3.title)) == null ? void 0 : _b.trim();
68579
- const name = title && title !== "<game title, required>" ? title : path37.basename(entry.path) + (error2 ? "" : "(未发布)");
68670
+ const name = title && title !== "<game title, required>" ? title : path38.basename(entry.path) + (error2 ? "" : "(未发布)");
68580
68671
  return {
68581
68672
  key: entry.key,
68582
68673
  projectid: entry.binding,
@@ -68612,7 +68703,7 @@ var ConsoleProjects = class {
68612
68703
  const entry = config2["entry@server"] || resources2["entry@server"];
68613
68704
  const normalized = typeof entry === "string" ? entry.replace(/\\/g, "/").replace(/^\.\//, "") : "";
68614
68705
  const entries = normalized ? [normalized, "scripts/" + normalized, "assets/" + normalized] : [];
68615
- const directories = entries.map((file3) => path37.posix.dirname(file3)).filter((dir) => ![".", "scripts", "assets"].includes(dir));
68706
+ const directories = entries.map((file3) => path38.posix.dirname(file3)).filter((dir) => ![".", "scripts", "assets"].includes(dir));
68616
68707
  const raw = (await inspectGit(["status", "--porcelain=v1", "-z", "--untracked-files=all"])).split("\0");
68617
68708
  const files = /* @__PURE__ */ new Set();
68618
68709
  for (let i = 0; i < raw.length && raw[i]; i++) {
@@ -68629,7 +68720,7 @@ var ConsoleProjects = class {
68629
68720
  const meta3 = source + ".meta";
68630
68721
  const current = (() => {
68631
68722
  try {
68632
- return objectFile2(path37.join(project.path, meta3));
68723
+ return objectFile2(path38.join(project.path, meta3));
68633
68724
  } catch {
68634
68725
  return {};
68635
68726
  }
@@ -69034,16 +69125,16 @@ init_privateJson();
69034
69125
  init_diagnosticRedaction();
69035
69126
  init_qrcodePreflight();
69036
69127
  init_qrcodeInteraction();
69037
- import fs38 from "node:fs";
69038
- import path39 from "node:path";
69128
+ import fs39 from "node:fs";
69129
+ import path40 from "node:path";
69039
69130
  import { randomUUID as randomUUID7 } from "node:crypto";
69040
69131
 
69041
69132
  // src/maker/console/issueReport.ts
69042
69133
  init_protocol2();
69043
69134
  init_diagnosticRedaction();
69044
- import fs37 from "node:fs";
69135
+ import fs38 from "node:fs";
69045
69136
  import os7 from "node:os";
69046
- import path38 from "node:path";
69137
+ import path39 from "node:path";
69047
69138
  import { createHash as createHash6 } from "node:crypto";
69048
69139
  function consoleReportOffer(task) {
69049
69140
  if (!["failed", "unknown"].includes(task.status)) return;
@@ -69068,22 +69159,22 @@ function consoleReportOffer(task) {
69068
69159
  function logTail(root2, relative) {
69069
69160
  let fd;
69070
69161
  try {
69071
- if (fs37.lstatSync(root2).isSymbolicLink()) return "[日志不可用]";
69072
- const file3 = path38.join(fs37.realpathSync(root2), relative);
69073
- if (fs37.realpathSync(file3) !== file3 || !fs37.lstatSync(file3).isFile()) return "[日志不可用]";
69074
- fd = fs37.openSync(file3, fs37.constants.O_RDONLY | (fs37.constants.O_NOFOLLOW || 0));
69075
- const stat = fs37.fstatSync(fd);
69162
+ if (fs38.lstatSync(root2).isSymbolicLink()) return "[日志不可用]";
69163
+ const file3 = path39.join(fs38.realpathSync(root2), relative);
69164
+ if (fs38.realpathSync(file3) !== file3 || !fs38.lstatSync(file3).isFile()) return "[日志不可用]";
69165
+ fd = fs38.openSync(file3, fs38.constants.O_RDONLY | (fs38.constants.O_NOFOLLOW || 0));
69166
+ const stat = fs38.fstatSync(fd);
69076
69167
  if (!stat.isFile()) return "[日志不可用]";
69077
69168
  const offset = Math.max(0, stat.size - 6e3);
69078
69169
  const buffer = Buffer.alloc(Math.min(stat.size, 6e3));
69079
- fs37.readSync(fd, buffer, 0, buffer.length, offset);
69170
+ fs38.readSync(fd, buffer, 0, buffer.length, offset);
69080
69171
  let text2 = buffer.toString("utf8");
69081
69172
  if (offset) text2 = text2.includes("\n") ? text2.slice(text2.indexOf("\n") + 1) : "";
69082
69173
  return (offset ? "[日志仅含尾部]\n" : "") + String(sanitizeDiagnosticValue(text2));
69083
69174
  } catch {
69084
69175
  return "[日志不存在或无法读取]";
69085
69176
  } finally {
69086
- if (fd !== void 0) fs37.closeSync(fd);
69177
+ if (fd !== void 0) fs38.closeSync(fd);
69087
69178
  }
69088
69179
  }
69089
69180
  function consoleReportContext(task, project) {
@@ -69109,9 +69200,9 @@ function consoleReportContext(task, project) {
69109
69200
  runtime: record2.runtime,
69110
69201
  executable: record2.executable
69111
69202
  };
69112
- const round = path38.join("sessions", record2.session_id, String(record2.reload_id));
69113
- logs.prepare = logTail(directory, path38.join(round, "prepare.log"));
69114
- logs.runtime = logTail(directory, path38.join(round, "runtime.log"));
69203
+ const round = path39.join("sessions", record2.session_id, String(record2.reload_id));
69204
+ logs.prepare = logTail(directory, path39.join(round, "prepare.log"));
69205
+ logs.runtime = logTail(directory, path39.join(round, "runtime.log"));
69115
69206
  }
69116
69207
  if (!record2) logs.supervisor = logTail(directory, "supervisor.log");
69117
69208
  } catch {
@@ -69148,10 +69239,10 @@ var ConsoleTasks = class {
69148
69239
  this.tasks = /* @__PURE__ */ new Map();
69149
69240
  this.running = /* @__PURE__ */ new Set();
69150
69241
  var _a3;
69151
- if (historyFile && fs38.existsSync(historyFile)) {
69152
- if (fs38.statSync(historyFile).size > 40 * 1024 * 1024)
69242
+ if (historyFile && fs39.existsSync(historyFile)) {
69243
+ if (fs39.statSync(historyFile).size > 40 * 1024 * 1024)
69153
69244
  throw new ConsoleError("Console task history exceeds the supported size.");
69154
- const data = JSON.parse(fs38.readFileSync(historyFile, "utf8"));
69245
+ const data = JSON.parse(fs39.readFileSync(historyFile, "utf8"));
69155
69246
  if (!Array.isArray(data) || data.length > 100)
69156
69247
  throw new ConsoleError("Invalid console task history.");
69157
69248
  for (const task of data) {
@@ -69403,7 +69494,7 @@ var ConsoleTasks = class {
69403
69494
  persist() {
69404
69495
  this.pruneHistory();
69405
69496
  if (this.historyFile) {
69406
- fs38.mkdirSync(path39.dirname(this.historyFile), { recursive: true, mode: 448 });
69497
+ fs39.mkdirSync(path40.dirname(this.historyFile), { recursive: true, mode: 448 });
69407
69498
  while (Buffer.byteLength(JSON.stringify(Array.from(this.tasks.values()))) > 40 * 1024 * 1024) {
69408
69499
  const oldest = this.list().reverse().find((task) => {
69409
69500
  var _a3;
@@ -69422,8 +69513,8 @@ init_diagnosticRedaction();
69422
69513
  init_luaLsp();
69423
69514
 
69424
69515
  // src/maker/console/integrations/framecrate.ts
69425
- import fs39 from "node:fs";
69426
- import path40 from "node:path";
69516
+ import fs40 from "node:fs";
69517
+ import path41 from "node:path";
69427
69518
  import { pathToFileURL } from "node:url";
69428
69519
  import { spawn as spawn10 } from "node:child_process";
69429
69520
  var FramecrateLauncher = class {
@@ -69461,7 +69552,7 @@ var FramecrateLauncher = class {
69461
69552
  throw new ConsoleError("FrameCrate requires the exact console host origin.");
69462
69553
  }
69463
69554
  }
69464
- if (!path40.isAbsolute(projectPath) || fs39.realpathSync(projectPath) !== projectPath)
69555
+ if (!path41.isAbsolute(projectPath) || fs40.realpathSync(projectPath) !== projectPath)
69465
69556
  throw new ConsoleError("FrameCrate requires a validated project realpath.");
69466
69557
  const existing = this.sessions.get(projectPath);
69467
69558
  if (existing) {
@@ -69479,7 +69570,7 @@ var FramecrateLauncher = class {
69479
69570
  );
69480
69571
  const env = this.options.env ?? process.env;
69481
69572
  const configured = (_a3 = env.FRAMECRATE_STUDIO_DIR) == null ? void 0 : _a3.trim();
69482
- if (!configured || !path40.isAbsolute(configured))
69573
+ if (!configured || !path41.isAbsolute(configured))
69483
69574
  throw new ConsoleError(
69484
69575
  "FrameCrate unavailable: set FRAMECRATE_STUDIO_DIR to the absolute path of an installed studio, then reopen the console.",
69485
69576
  409
@@ -69488,10 +69579,10 @@ var FramecrateLauncher = class {
69488
69579
  let entry;
69489
69580
  let loader;
69490
69581
  try {
69491
- root2 = fs39.realpathSync(configured);
69492
- entry = path40.join(root2, "server/main.ts");
69493
- loader = path40.join(root2, "node_modules/tsx/dist/loader.mjs");
69494
- if (!fs39.statSync(entry).isFile() || !fs39.statSync(loader).isFile()) throw new Error();
69582
+ root2 = fs40.realpathSync(configured);
69583
+ entry = path41.join(root2, "server/main.ts");
69584
+ loader = path41.join(root2, "node_modules/tsx/dist/loader.mjs");
69585
+ if (!fs40.statSync(entry).isFile() || !fs40.statSync(loader).isFile()) throw new Error();
69495
69586
  } catch {
69496
69587
  throw new ConsoleError(
69497
69588
  "FrameCrate unavailable: FRAMECRATE_STUDIO_DIR must contain server/main.ts and node_modules/tsx/dist/loader.mjs. No installer is provided.",
@@ -69688,14 +69779,14 @@ var ConsolePlugins = class {
69688
69779
 
69689
69780
  // src/maker/console/updates.ts
69690
69781
  import { execFile as execFile3 } from "node:child_process";
69691
- import fs41 from "node:fs";
69692
- import path42 from "node:path";
69782
+ import fs42 from "node:fs";
69783
+ import path43 from "node:path";
69693
69784
 
69694
69785
  // src/maker/cli/mcpLauncher.ts
69695
69786
  init_client2();
69696
69787
  init_stdio3();
69697
- import fs40 from "node:fs";
69698
- import path41 from "node:path";
69788
+ import fs41 from "node:fs";
69789
+ import path42 from "node:path";
69699
69790
  import { fileURLToPath as fileURLToPath3 } from "node:url";
69700
69791
  var DEFAULT_VERIFY_TIMEOUT_MS = 9e4;
69701
69792
  var VERIFY_CLIENT_VERSION = "1.0.0";
@@ -69722,33 +69813,33 @@ function materializeMakerSelfLauncher(options3) {
69722
69813
  throw new Error(`Invalid Maker runtime version: ${options3.version}`);
69723
69814
  }
69724
69815
  const execPath = options3.execPath ?? process.execPath;
69725
- if (!path41.isAbsolute(execPath) || !fs40.existsSync(execPath)) {
69816
+ if (!path42.isAbsolute(execPath) || !fs41.existsSync(execPath)) {
69726
69817
  throw new Error("Maker self launcher requires an existing absolute Node executable.");
69727
69818
  }
69728
69819
  const sourceBundle = fileURLToPath3(options3.bundleUrl);
69729
- const sourceRoot = path41.dirname(path41.dirname(sourceBundle));
69730
- const runtimeRoot = path41.join(path41.resolve(options3.makerHome), "mcp-runtime", options3.version);
69820
+ const sourceRoot = path42.dirname(path42.dirname(sourceBundle));
69821
+ const runtimeRoot = path42.join(path42.resolve(options3.makerHome), "mcp-runtime", options3.version);
69731
69822
  for (const relativePath of [...SELF_RUNTIME_FILES, ...SELF_RUNTIME_DIRECTORIES]) {
69732
- const sourcePath = path41.join(sourceRoot, relativePath);
69733
- if (!fs40.existsSync(sourcePath)) {
69823
+ const sourcePath = path42.join(sourceRoot, relativePath);
69824
+ if (!fs41.existsSync(sourcePath)) {
69734
69825
  throw new Error(`Maker self runtime source is incomplete: ${sourcePath}`);
69735
69826
  }
69736
69827
  }
69737
- if (path41.resolve(sourceRoot) !== path41.resolve(runtimeRoot)) {
69828
+ if (path42.resolve(sourceRoot) !== path42.resolve(runtimeRoot)) {
69738
69829
  for (const relativePath of SELF_RUNTIME_FILES) {
69739
- const sourcePath = path41.join(sourceRoot, relativePath);
69740
- const targetPath = path41.join(runtimeRoot, relativePath);
69741
- fs40.mkdirSync(path41.dirname(targetPath), { recursive: true });
69742
- fs40.copyFileSync(sourcePath, targetPath);
69830
+ const sourcePath = path42.join(sourceRoot, relativePath);
69831
+ const targetPath = path42.join(runtimeRoot, relativePath);
69832
+ fs41.mkdirSync(path42.dirname(targetPath), { recursive: true });
69833
+ fs41.copyFileSync(sourcePath, targetPath);
69743
69834
  }
69744
69835
  for (const relativePath of SELF_RUNTIME_DIRECTORIES) {
69745
69836
  copySelfRuntimeDirectory(
69746
- path41.join(sourceRoot, relativePath),
69747
- path41.join(runtimeRoot, relativePath)
69837
+ path42.join(sourceRoot, relativePath),
69838
+ path42.join(runtimeRoot, relativePath)
69748
69839
  );
69749
69840
  }
69750
69841
  }
69751
- const stableBundle = path41.join(runtimeRoot, "dist", "maker.js");
69842
+ const stableBundle = path42.join(runtimeRoot, "dist", "maker.js");
69752
69843
  return {
69753
69844
  kind: "self_runtime",
69754
69845
  command: execPath,
@@ -69758,7 +69849,7 @@ function materializeMakerSelfLauncher(options3) {
69758
69849
  }
69759
69850
  function copySelfRuntimeDirectory(sourcePath, targetPath) {
69760
69851
  try {
69761
- fs40.cpSync(sourcePath, targetPath, { recursive: true });
69852
+ fs41.cpSync(sourcePath, targetPath, { recursive: true });
69762
69853
  } catch (error2) {
69763
69854
  const code = typeof error2 === "object" && error2 !== null && "code" in error2 ? String(error2.code) : void 0;
69764
69855
  if (!code || !SELF_RUNTIME_COPY_FALLBACK_CODES.has(code)) {
@@ -69768,14 +69859,14 @@ function copySelfRuntimeDirectory(sourcePath, targetPath) {
69768
69859
  }
69769
69860
  }
69770
69861
  function copyDirectoryEntries(sourcePath, targetPath) {
69771
- fs40.mkdirSync(targetPath, { recursive: true });
69772
- for (const entry of fs40.readdirSync(sourcePath, { withFileTypes: true })) {
69773
- const sourceEntry = path41.join(sourcePath, entry.name);
69774
- const targetEntry = path41.join(targetPath, entry.name);
69862
+ fs41.mkdirSync(targetPath, { recursive: true });
69863
+ for (const entry of fs41.readdirSync(sourcePath, { withFileTypes: true })) {
69864
+ const sourceEntry = path42.join(sourcePath, entry.name);
69865
+ const targetEntry = path42.join(targetPath, entry.name);
69775
69866
  if (entry.isDirectory()) {
69776
69867
  copyDirectoryEntries(sourceEntry, targetEntry);
69777
69868
  } else {
69778
- fs40.copyFileSync(sourceEntry, targetEntry);
69869
+ fs41.copyFileSync(sourceEntry, targetEntry);
69779
69870
  }
69780
69871
  }
69781
69872
  }
@@ -69790,10 +69881,10 @@ function resolveMakerMcpLauncher(options3) {
69790
69881
  commandAndArgs: ["npx", ...args]
69791
69882
  };
69792
69883
  }
69793
- const existsSync2 = options3.existsSync ?? fs40.existsSync;
69884
+ const existsSync2 = options3.existsSync ?? fs41.existsSync;
69794
69885
  const execPath = options3.execPath ?? process.execPath;
69795
69886
  const npmExecPath = options3.npmExecPath ?? process.env.npm_execpath;
69796
- const windowsPath = path41.win32;
69887
+ const windowsPath = path42.win32;
69797
69888
  const npmCliCandidates = uniqueStrings([
69798
69889
  npmExecPath,
69799
69890
  windowsPath.join(windowsPath.dirname(execPath), "node_modules", "npm", "bin", "npm-cli.js")
@@ -69961,8 +70052,8 @@ function runConsoleUpgrade(version2) {
69961
70052
  if (!VERSION2.test(version2)) throw new Error("无效版本号");
69962
70053
  const launcher = resolveMakerMcpLauncher({ packageName: `@taptap/maker@${version2}` });
69963
70054
  const home2 = getMakerHome();
69964
- const cache = path42.join(home2, "cache", "npm");
69965
- fs41.mkdirSync(cache, { recursive: true });
70055
+ const cache = path43.join(home2, "cache", "npm");
70056
+ fs42.mkdirSync(cache, { recursive: true });
69966
70057
  return new Promise((resolve, reject) => {
69967
70058
  execFile3(
69968
70059
  launcher.command,
@@ -70048,8 +70139,8 @@ var ConsoleUpdates = class {
70048
70139
  };
70049
70140
 
70050
70141
  // src/maker/console/documents.ts
70051
- import fs42 from "node:fs";
70052
- import path43 from "node:path";
70142
+ import fs43 from "node:fs";
70143
+ import path44 from "node:path";
70053
70144
  import { createHash as createHash7 } from "node:crypto";
70054
70145
 
70055
70146
  // node_modules/marked/lib/marked.esm.js
@@ -72155,8 +72246,8 @@ var GROUPS = [
72155
72246
  ["templates", "示例与模板"]
72156
72247
  ];
72157
72248
  function inside2(root2, file3) {
72158
- const relative = path43.relative(root2, file3);
72159
- return relative !== ".." && !relative.startsWith(`..${path43.sep}`) && !path43.isAbsolute(relative);
72249
+ const relative = path44.relative(root2, file3);
72250
+ return relative !== ".." && !relative.startsWith(`..${path44.sep}`) && !path44.isAbsolute(relative);
72160
72251
  }
72161
72252
  var ConsoleDocuments = class {
72162
72253
  constructor(packageRoot) {
@@ -72167,34 +72258,34 @@ var ConsoleDocuments = class {
72167
72258
  const seen = /* @__PURE__ */ new Set();
72168
72259
  let visited = 0;
72169
72260
  const collect = (base, source, relative, kind, category) => {
72170
- if (!fs42.existsSync(base)) return;
72171
- const root2 = fs42.realpathSync(base);
72261
+ if (!fs43.existsSync(base)) return;
72262
+ const root2 = fs43.realpathSync(base);
72172
72263
  const walk = (filename2, depth) => {
72173
72264
  var _a3, _b;
72174
72265
  if (depth > 7 || visited++ > 6e3 || entries.length >= MAX_ENTRIES) return;
72175
72266
  try {
72176
- const real = fs42.realpathSync(filename2);
72267
+ const real = fs43.realpathSync(filename2);
72177
72268
  if (!inside2(root2, real)) return;
72178
- const stat = fs42.statSync(real);
72269
+ const stat = fs43.statSync(real);
72179
72270
  if (stat.isDirectory()) {
72180
- if (fs42.lstatSync(filename2).isSymbolicLink()) return;
72181
- for (const name of fs42.readdirSync(filename2).sort()) {
72271
+ if (fs43.lstatSync(filename2).isSymbolicLink()) return;
72272
+ for (const name of fs43.readdirSync(filename2).sort()) {
72182
72273
  if (name === "node_modules" || name === ".git") continue;
72183
- walk(path43.join(filename2, name), depth + 1);
72274
+ walk(path44.join(filename2, name), depth + 1);
72184
72275
  }
72185
72276
  } else if (stat.isFile() && /\.md$/i.test(filename2) && stat.size <= MAX_FILE && !seen.has(real)) {
72186
72277
  seen.add(real);
72187
- const relativePath = path43.relative(root2, filename2).split(path43.sep).join("/");
72188
- const descriptor = fs42.openSync(real, "r");
72278
+ const relativePath = path44.relative(root2, filename2).split(path44.sep).join("/");
72279
+ const descriptor = fs43.openSync(real, "r");
72189
72280
  const buffer = Buffer.alloc(Math.min(8192, stat.size));
72190
72281
  let content;
72191
72282
  try {
72192
- content = buffer.subarray(0, fs42.readSync(descriptor, buffer, 0, buffer.length, 0)).toString("utf8");
72283
+ content = buffer.subarray(0, fs43.readSync(descriptor, buffer, 0, buffer.length, 0)).toString("utf8");
72193
72284
  } finally {
72194
- fs42.closeSync(descriptor);
72285
+ fs43.closeSync(descriptor);
72195
72286
  }
72196
72287
  const heading = (_b = (_a3 = content.match(/^#\s+(.+)$/m)) == null ? void 0 : _a3[1]) == null ? void 0 : _b.trim();
72197
- const fallback = path43.basename(filename2).toLowerCase() === "skill.md" ? path43.basename(path43.dirname(filename2)) : path43.basename(filename2, path43.extname(filename2));
72288
+ const fallback = path44.basename(filename2).toLowerCase() === "skill.md" ? path44.basename(path44.dirname(filename2)) : path44.basename(filename2, path44.extname(filename2));
72198
72289
  entries.push({
72199
72290
  id: createHash7("sha256").update(source + ":" + relativePath).digest("hex"),
72200
72291
  title: (heading || fallback).slice(0, 160),
@@ -72209,7 +72300,7 @@ var ConsoleDocuments = class {
72209
72300
  } catch {
72210
72301
  }
72211
72302
  };
72212
- walk(path43.join(root2, relative), 0);
72303
+ walk(path44.join(root2, relative), 0);
72213
72304
  };
72214
72305
  for (const filename2 of [
72215
72306
  "MAKER_CONSOLE.md",
@@ -72261,10 +72352,10 @@ var ConsoleDocuments = class {
72261
72352
  if (!entry) throw new ConsoleError("文档不存在或已移除,请刷新目录。", 404);
72262
72353
  let content = entry.content;
72263
72354
  if (content === void 0) {
72264
- const real = fs42.realpathSync(entry.filename);
72265
- if (!inside2(entry.root, real) || fs42.statSync(real).size > MAX_FILE)
72355
+ const real = fs43.realpathSync(entry.filename);
72356
+ if (!inside2(entry.root, real) || fs43.statSync(real).size > MAX_FILE)
72266
72357
  throw new ConsoleError("文档无法安全读取。", 403);
72267
- content = fs42.readFileSync(real, "utf8");
72358
+ content = fs43.readFileSync(real, "utf8");
72268
72359
  }
72269
72360
  return {
72270
72361
  id,
@@ -72277,7 +72368,7 @@ var ConsoleDocuments = class {
72277
72368
 
72278
72369
  // src/maker/console/folderPicker.ts
72279
72370
  import { execFile as execFile4 } from "node:child_process";
72280
- import path44 from "node:path";
72371
+ import path45 from "node:path";
72281
72372
  async function chooseProjectDirectory(platform = process.platform, signal) {
72282
72373
  let command;
72283
72374
  let args;
@@ -72295,7 +72386,7 @@ async function chooseProjectDirectory(platform = process.platform, signal) {
72295
72386
  ].join("\n")
72296
72387
  ];
72297
72388
  } else if (platform === "win32") {
72298
- command = path44.win32.join(
72389
+ command = path45.win32.join(
72299
72390
  process.env.SystemRoot || "C:\\Windows",
72300
72391
  "System32",
72301
72392
  "WindowsPowerShell",
@@ -72360,8 +72451,8 @@ async function chooseProjectDirectory(platform = process.platform, signal) {
72360
72451
  }
72361
72452
 
72362
72453
  // src/maker/console/projectDiscovery.ts
72363
- import fs43 from "node:fs";
72364
- import path45 from "node:path";
72454
+ import fs44 from "node:fs";
72455
+ import path46 from "node:path";
72365
72456
  var EXCLUDED = /* @__PURE__ */ new Set([
72366
72457
  ".git",
72367
72458
  "node_modules",
@@ -72376,7 +72467,7 @@ var EXCLUDED = /* @__PURE__ */ new Set([
72376
72467
  "System Volume Information"
72377
72468
  ]);
72378
72469
  async function discoverConsoleProjects(directory, registry2) {
72379
- const root2 = await fs43.promises.realpath(directory);
72470
+ const root2 = await fs44.promises.realpath(directory);
72380
72471
  const known = new Set(registry2.list().map((project) => project.path));
72381
72472
  const result = { added: 0, existing: 0, skipped: 0, limited: false };
72382
72473
  const deadline = Date.now() + 1e4;
@@ -72389,8 +72480,8 @@ async function discoverConsoleProjects(directory, registry2) {
72389
72480
  }
72390
72481
  const current = queue.shift();
72391
72482
  visited++;
72392
- const marker = path45.join(current.directory, ".maker-mcp/config.json");
72393
- if (fs43.existsSync(marker) || fs43.existsSync(path45.join(current.directory, ".project/project.json"))) {
72483
+ const marker = path46.join(current.directory, ".maker-mcp/config.json");
72484
+ if (fs44.existsSync(marker) || fs44.existsSync(path46.join(current.directory, ".project/project.json"))) {
72394
72485
  try {
72395
72486
  const project = registry2.add(current.directory);
72396
72487
  if (known.has(project.path)) result.existing++;
@@ -72404,7 +72495,7 @@ async function discoverConsoleProjects(directory, registry2) {
72404
72495
  }
72405
72496
  }
72406
72497
  try {
72407
- const entries = await fs43.promises.opendir(current.directory);
72498
+ const entries = await fs44.promises.opendir(current.directory);
72408
72499
  for await (const entry of entries) {
72409
72500
  if (++visited >= 5e3 || Date.now() >= deadline) {
72410
72501
  result.limited = true;
@@ -72416,7 +72507,7 @@ async function discoverConsoleProjects(directory, registry2) {
72416
72507
  continue;
72417
72508
  }
72418
72509
  queue.push({
72419
- directory: path45.join(current.directory, entry.name),
72510
+ directory: path46.join(current.directory, entry.name),
72420
72511
  depth: current.depth + 1
72421
72512
  });
72422
72513
  }
@@ -72792,13 +72883,13 @@ async function readBody(request2) {
72792
72883
  }
72793
72884
 
72794
72885
  // src/maker/console/cli.ts
72795
- var VERSION3 = false ? "dev" : "0.0.34-beta.7";
72886
+ var VERSION3 = false ? "dev" : "0.0.34";
72796
72887
  var CONSOLE_PROTOCOL_VERSION = 2;
72797
72888
  function home() {
72798
- return path46.join(getMakerHome(), "console");
72889
+ return path47.join(getMakerHome(), "console");
72799
72890
  }
72800
72891
  function sessionPath() {
72801
- return path46.join(home(), "session.json");
72892
+ return path47.join(home(), "session.json");
72802
72893
  }
72803
72894
  function createConsoleLauncherIdentity(version2, developmentSource) {
72804
72895
  return createHash9("sha256").update(
@@ -72817,15 +72908,15 @@ function ensureCompatibleConsoleLauncher(actual, expected) {
72817
72908
  }
72818
72909
  }
72819
72910
  function launcherIdentity() {
72820
- const entry = fs44.realpathSync(process.argv[1]);
72911
+ const entry = fs45.realpathSync(process.argv[1]);
72821
72912
  return createConsoleLauncherIdentity(VERSION3, {
72822
72913
  entry,
72823
- mtimeMs: fs44.statSync(entry).mtimeMs
72914
+ mtimeMs: fs45.statSync(entry).mtimeMs
72824
72915
  });
72825
72916
  }
72826
72917
  function readSession() {
72827
- if (!fs44.existsSync(sessionPath())) return void 0;
72828
- const session = JSON.parse(fs44.readFileSync(sessionPath(), "utf8"));
72918
+ if (!fs45.existsSync(sessionPath())) return void 0;
72919
+ const session = JSON.parse(fs45.readFileSync(sessionPath(), "utf8"));
72829
72920
  if (session.schema !== 1 || !/^http:\/\/127\.0\.0\.1:[1-9][0-9]{0,4}$/.test(session.origin) || Number(new URL(session.origin).port) > 65535 || !/^[a-f0-9-]{36}$/.test(session.instanceId) || !Number.isInteger(session.pid) || session.pid <= 0 || typeof session.launcher !== "string" || session.draining !== void 0 && typeof session.draining !== "boolean")
72830
72921
  throw new ConsoleError(
72831
72922
  "Invalid local console session. Refusing to contact an unknown service."
@@ -72902,9 +72993,9 @@ async function runConsoleSupervisor() {
72902
72993
  registry: registry2,
72903
72994
  html: getConsoleHtml2(),
72904
72995
  version: VERSION3,
72905
- packageRoot: path46.dirname(path46.dirname(path46.resolve(process.argv[1]))),
72996
+ packageRoot: path47.dirname(path47.dirname(path47.resolve(process.argv[1]))),
72906
72997
  distribution: process.env.TAPTAP_MAKER_DISTRIBUTION,
72907
- historyFile: path46.join(home(), "tasks.json"),
72998
+ historyFile: path47.join(home(), "tasks.json"),
72908
72999
  instanceId,
72909
73000
  execute: createConsoleExecutor({ entry: process.argv[1] }),
72910
73001
  onDraining: () => {
@@ -72929,7 +73020,7 @@ async function runConsoleSupervisor() {
72929
73020
  const cleanup = () => {
72930
73021
  var _a3;
72931
73022
  try {
72932
- if (((_a3 = readSession()) == null ? void 0 : _a3.instanceId) === instanceId) fs44.unlinkSync(sessionPath());
73023
+ if (((_a3 = readSession()) == null ? void 0 : _a3.instanceId) === instanceId) fs45.unlinkSync(sessionPath());
72933
73024
  } catch {
72934
73025
  }
72935
73026
  release();
@@ -72952,11 +73043,11 @@ async function runConsoleSupervisor() {
72952
73043
  }
72953
73044
  }
72954
73045
  async function claimConsoleServerLock(directory) {
72955
- fs44.mkdirSync(directory, { recursive: true, mode: 448 });
72956
- return claimOwnedLock(path46.join(directory, "server.lock"));
73046
+ fs45.mkdirSync(directory, { recursive: true, mode: 448 });
73047
+ return claimOwnedLock(path47.join(directory, "server.lock"));
72957
73048
  }
72958
73049
  async function claimOwnedLock(filename2) {
72959
- filename2 = path46.join(fs44.realpathSync(path46.dirname(filename2)), path46.basename(filename2));
73050
+ filename2 = path47.join(fs45.realpathSync(path47.dirname(filename2)), path47.basename(filename2));
72960
73051
  const identity = `${process.pid}:${randomUUID8()}`;
72961
73052
  const recoveryFilename = filename2 + ".recovery";
72962
73053
  const releaseMutex = await claimRecoveryMutex2(filename2);
@@ -72964,10 +73055,10 @@ async function claimOwnedLock(filename2) {
72964
73055
  claimRecoveryGuard(recoveryFilename, identity);
72965
73056
  for (let attempt = 0; attempt < 3; attempt++) {
72966
73057
  try {
72967
- fs44.writeFileSync(filename2, identity, { flag: "wx", mode: 384 });
73058
+ fs45.writeFileSync(filename2, identity, { flag: "wx", mode: 384 });
72968
73059
  return () => {
72969
73060
  try {
72970
- if (fs44.readFileSync(filename2, "utf8") === identity) fs44.unlinkSync(filename2);
73061
+ if (fs45.readFileSync(filename2, "utf8") === identity) fs45.unlinkSync(filename2);
72971
73062
  } catch {
72972
73063
  }
72973
73064
  };
@@ -72975,7 +73066,7 @@ async function claimOwnedLock(filename2) {
72975
73066
  if (error2.code !== "EEXIST") throw error2;
72976
73067
  let previous;
72977
73068
  try {
72978
- previous = fs44.readFileSync(filename2, "utf8");
73069
+ previous = fs45.readFileSync(filename2, "utf8");
72979
73070
  } catch (cause) {
72980
73071
  if (cause.code === "ENOENT") continue;
72981
73072
  throw cause;
@@ -72990,7 +73081,7 @@ async function claimOwnedLock(filename2) {
72990
73081
  } catch (cause) {
72991
73082
  if (cause.code === "ESRCH") {
72992
73083
  try {
72993
- if (fs44.readFileSync(filename2, "utf8") === previous) fs44.unlinkSync(filename2);
73084
+ if (fs45.readFileSync(filename2, "utf8") === previous) fs45.unlinkSync(filename2);
72994
73085
  } catch (error3) {
72995
73086
  if (error3.code !== "ENOENT") throw error3;
72996
73087
  }
@@ -73022,19 +73113,19 @@ function claimRecoveryGuard(filename2, identity) {
73022
73113
  for (let attempt = 0; attempt < 3; attempt++) {
73023
73114
  let descriptor;
73024
73115
  try {
73025
- descriptor = fs44.openSync(filename2, "wx", 384);
73116
+ descriptor = fs45.openSync(filename2, "wx", 384);
73026
73117
  } catch (error2) {
73027
73118
  if (error2.code !== "EEXIST") throw error2;
73028
73119
  if (reclaimStaleRecoveryGuard(filename2)) continue;
73029
73120
  throw new ConsoleError("Console ownership recovery is already in progress.", 409);
73030
73121
  }
73031
73122
  try {
73032
- fs44.writeFileSync(descriptor, identity, "utf8");
73123
+ fs45.writeFileSync(descriptor, identity, "utf8");
73033
73124
  } catch (error2) {
73034
- fs44.unlinkSync(filename2);
73125
+ fs45.unlinkSync(filename2);
73035
73126
  throw error2;
73036
73127
  } finally {
73037
- fs44.closeSync(descriptor);
73128
+ fs45.closeSync(descriptor);
73038
73129
  }
73039
73130
  return;
73040
73131
  }
@@ -73044,8 +73135,8 @@ function reclaimStaleRecoveryGuard(filename2) {
73044
73135
  let content;
73045
73136
  let modified;
73046
73137
  try {
73047
- content = fs44.readFileSync(filename2, "utf8");
73048
- modified = fs44.statSync(filename2).mtimeMs;
73138
+ content = fs45.readFileSync(filename2, "utf8");
73139
+ modified = fs45.statSync(filename2).mtimeMs;
73049
73140
  } catch (error2) {
73050
73141
  return error2.code === "ENOENT";
73051
73142
  }
@@ -73053,8 +73144,8 @@ function reclaimStaleRecoveryGuard(filename2) {
73053
73144
  const stale = Number.isInteger(pid) && pid > 0 ? processPresence(pid) === "missing" : content === "" && Date.now() - modified >= 2e3;
73054
73145
  if (!stale) return false;
73055
73146
  try {
73056
- if (fs44.readFileSync(filename2, "utf8") === content && fs44.statSync(filename2).mtimeMs === modified) {
73057
- fs44.unlinkSync(filename2);
73147
+ if (fs45.readFileSync(filename2, "utf8") === content && fs45.statSync(filename2).mtimeMs === modified) {
73148
+ fs45.unlinkSync(filename2);
73058
73149
  return true;
73059
73150
  }
73060
73151
  } catch (error2) {
@@ -73064,19 +73155,19 @@ function reclaimStaleRecoveryGuard(filename2) {
73064
73155
  }
73065
73156
  function removeOwnedFile(filename2, identity) {
73066
73157
  try {
73067
- if (fs44.readFileSync(filename2, "utf8") === identity) fs44.unlinkSync(filename2);
73158
+ if (fs45.readFileSync(filename2, "utf8") === identity) fs45.unlinkSync(filename2);
73068
73159
  } catch {
73069
73160
  }
73070
73161
  }
73071
73162
  async function ensureSession() {
73072
73163
  var _a3;
73073
- fs44.mkdirSync(home(), { recursive: true, mode: 448 });
73164
+ fs45.mkdirSync(home(), { recursive: true, mode: 448 });
73074
73165
  const existing = await availableSession();
73075
73166
  if (existing) {
73076
73167
  ensureCompatibleConsoleLauncher(existing.launcher, launcherIdentity());
73077
73168
  return existing;
73078
73169
  }
73079
- const lock = path46.join(home(), "launch.lock");
73170
+ const lock = path47.join(home(), "launch.lock");
73080
73171
  let releaseLaunch;
73081
73172
  for (let attempt = 0; attempt < 60; attempt++) {
73082
73173
  try {
@@ -73105,7 +73196,7 @@ async function ensureSession() {
73105
73196
  execArgv: process.execArgv,
73106
73197
  entry: process.argv[1],
73107
73198
  cwd: home(),
73108
- logFile: path46.join(home(), "server.log"),
73199
+ logFile: path47.join(home(), "server.log"),
73109
73200
  env: process.env
73110
73201
  });
73111
73202
  for (let attempt = 0; attempt < 80; attempt++) {
@@ -73168,7 +73259,7 @@ async function runConsoleCli(action, options3) {
73168
73259
  if (action !== "open") throw new ConsoleError("Use console open|status|stop.");
73169
73260
  const target = typeof options3.target_dir === "string" ? options3.target_dir : void 0;
73170
73261
  if (target) {
73171
- if (!path46.isAbsolute(target))
73262
+ if (!path47.isAbsolute(target))
73172
73263
  throw new ConsoleError("--target-dir must be an absolute project path.");
73173
73264
  const { previewProject: previewProject2 } = await Promise.resolve().then(() => (init_protocol2(), protocol_exports));
73174
73265
  previewProject2(target);
@@ -73399,16 +73490,16 @@ init_diagnosticRedaction();
73399
73490
  init_identify();
73400
73491
  init_pluginDistribution();
73401
73492
  import { spawnSync as spawnSync7 } from "node:child_process";
73402
- import fs46 from "node:fs";
73493
+ import fs47 from "node:fs";
73403
73494
  import os9 from "node:os";
73404
- import path48 from "node:path";
73495
+ import path49 from "node:path";
73405
73496
  import { fileURLToPath as fileURLToPath4 } from "node:url";
73406
73497
 
73407
73498
  // src/maker/cli/dshMcpConfig.ts
73408
73499
  var import_yaml = __toESM(require_dist2());
73409
- import fs45 from "node:fs";
73500
+ import fs46 from "node:fs";
73410
73501
  import os8 from "node:os";
73411
- import path47 from "node:path";
73502
+ import path48 from "node:path";
73412
73503
  var DSH_MCP_PLUGIN_NAME = "@deepseek-ai/dsh-mcp-client";
73413
73504
  var DSH_MAKER_PLUGIN_ID = "mcp-taptap-maker";
73414
73505
  var DSH_MAKER_TOOL_CALL_TIMEOUT_MS = 60 * 60 * 1e3;
@@ -73416,10 +73507,10 @@ function getDshHome(options3 = {}) {
73416
73507
  var _a3;
73417
73508
  const configured = (_a3 = (options3.environment || process.env).DSH_HOME) == null ? void 0 : _a3.trim();
73418
73509
  if (configured) {
73419
- const expanded = configured === "~" ? options3.homeDir || os8.homedir() : configured.startsWith("~/") || configured.startsWith("~\\") ? path47.join(options3.homeDir || os8.homedir(), configured.slice(2)) : configured;
73420
- return path47.resolve(expanded);
73510
+ const expanded = configured === "~" ? options3.homeDir || os8.homedir() : configured.startsWith("~/") || configured.startsWith("~\\") ? path48.join(options3.homeDir || os8.homedir(), configured.slice(2)) : configured;
73511
+ return path48.resolve(expanded);
73421
73512
  }
73422
- return path47.join(options3.homeDir || os8.homedir(), ".dsh");
73513
+ return path48.join(options3.homeDir || os8.homedir(), ".dsh");
73423
73514
  }
73424
73515
  function createDshMakerPluginConfig(options3) {
73425
73516
  return {
@@ -73437,8 +73528,8 @@ function createDshMakerPluginConfig(options3) {
73437
73528
  };
73438
73529
  }
73439
73530
  function mergeDshMakerMcpConfig(configPath, desired) {
73440
- const existed = fs45.existsSync(configPath);
73441
- const previousContent = existed ? fs45.readFileSync(configPath, "utf8") : "[]\n";
73531
+ const existed = fs46.existsSync(configPath);
73532
+ const previousContent = existed ? fs46.readFileSync(configPath, "utf8") : "[]\n";
73442
73533
  const document = parseDshDocument(previousContent, configPath);
73443
73534
  const sequence = ensurePluginSequence(document, configPath);
73444
73535
  const candidates = findDshMakerPluginCandidates(
@@ -73497,7 +73588,7 @@ function findDshMakerPluginEntry(content, mcpName, source = "DSH config") {
73497
73588
  }
73498
73589
  function getDshMcpInstallPaths(options3) {
73499
73590
  const dshHome = getDshHome(options3);
73500
- const homePatchPath = path47.join(dshHome, "cordis.patch.yml");
73591
+ const homePatchPath = path48.join(dshHome, "cordis.patch.yml");
73501
73592
  const homeHasMaker = dshConfigFileHasMaker(homePatchPath, options3.mcpName);
73502
73593
  const profilePatchPaths = listDshProfilePatchPathsForInstall(dshHome).filter(
73503
73594
  (configPath) => dshConfigFileHasMaker(configPath, options3.mcpName)
@@ -73513,22 +73604,22 @@ function getDshMcpInstallPaths(options3) {
73513
73604
  return profilePatchPaths.length > 0 ? profilePatchPaths : [homePatchPath];
73514
73605
  }
73515
73606
  function listDshProfilePatchPathsForInstall(dshHome) {
73516
- const profilesDir = path47.join(dshHome, "profiles");
73607
+ const profilesDir = path48.join(dshHome, "profiles");
73517
73608
  let entries;
73518
73609
  try {
73519
- entries = fs45.readdirSync(profilesDir, { withFileTypes: true });
73610
+ entries = fs46.readdirSync(profilesDir, { withFileTypes: true });
73520
73611
  } catch (error2) {
73521
73612
  if (isMissingPathError(error2)) {
73522
73613
  return [];
73523
73614
  }
73524
73615
  throw error2;
73525
73616
  }
73526
- return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().map((profileName) => path47.join(profilesDir, profileName, "cordis.patch.yml"));
73617
+ return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().map((profileName) => path48.join(profilesDir, profileName, "cordis.patch.yml"));
73527
73618
  }
73528
73619
  function dshConfigFileHasMaker(configPath, mcpName) {
73529
73620
  let content;
73530
73621
  try {
73531
- content = fs45.readFileSync(configPath, "utf8");
73622
+ content = fs46.readFileSync(configPath, "utf8");
73532
73623
  } catch (error2) {
73533
73624
  if (isMissingPathError(error2)) {
73534
73625
  return false;
@@ -73541,21 +73632,21 @@ function isMissingPathError(error2) {
73541
73632
  return typeof error2 === "object" && error2 !== null && "code" in error2 && error2.code === "ENOENT";
73542
73633
  }
73543
73634
  function listDshMcpConfigPaths(options3) {
73544
- const dshHome = options3.dshHome || path47.join(options3.homeDir, ".dsh");
73545
- const paths = [path47.join(dshHome, "cordis.patch.yml")];
73546
- const profilesDir = path47.join(dshHome, "profiles");
73547
- if (!fs45.existsSync(profilesDir)) {
73635
+ const dshHome = options3.dshHome || path48.join(options3.homeDir, ".dsh");
73636
+ const paths = [path48.join(dshHome, "cordis.patch.yml")];
73637
+ const profilesDir = path48.join(dshHome, "profiles");
73638
+ if (!fs46.existsSync(profilesDir)) {
73548
73639
  return paths;
73549
73640
  }
73550
73641
  let profileNames = [];
73551
73642
  try {
73552
- profileNames = fs45.readdirSync(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().slice(0, 50);
73643
+ profileNames = fs46.readdirSync(profilesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort().slice(0, 50);
73553
73644
  } catch {
73554
73645
  return paths;
73555
73646
  }
73556
73647
  for (const profileName of profileNames) {
73557
- const profileDir = path47.join(profilesDir, profileName);
73558
- paths.push(path47.join(profileDir, "cordis.patch.yml"), path47.join(profileDir, "cordis.yml"));
73648
+ const profileDir = path48.join(profilesDir, profileName);
73649
+ paths.push(path48.join(profileDir, "cordis.patch.yml"), path48.join(profileDir, "cordis.yml"));
73559
73650
  }
73560
73651
  return paths;
73561
73652
  }
@@ -73607,14 +73698,14 @@ function findDshMakerPluginCandidates(patches, mcpName) {
73607
73698
  }
73608
73699
  function writeDshConfigWithBackup(configPath, previousContent, existed, nextContent, desired) {
73609
73700
  const backupPath = existed ? `${configPath}.taptap-maker.bak.latest` : void 0;
73610
- fs45.mkdirSync(path47.dirname(configPath), { recursive: true });
73701
+ fs46.mkdirSync(path48.dirname(configPath), { recursive: true });
73611
73702
  if (backupPath) {
73612
- fs45.writeFileSync(backupPath, previousContent, "utf8");
73703
+ fs46.writeFileSync(backupPath, previousContent, "utf8");
73613
73704
  }
73614
73705
  try {
73615
- fs45.writeFileSync(configPath, nextContent, "utf8");
73706
+ fs46.writeFileSync(configPath, nextContent, "utf8");
73616
73707
  const written = findDshMakerPluginEntry(
73617
- fs45.readFileSync(configPath, "utf8"),
73708
+ fs46.readFileSync(configPath, "utf8"),
73618
73709
  desired.config.serverName,
73619
73710
  configPath
73620
73711
  );
@@ -73626,9 +73717,9 @@ function writeDshConfigWithBackup(configPath, previousContent, existed, nextCont
73626
73717
  return { changed: true, backupPath };
73627
73718
  } catch (error2) {
73628
73719
  if (existed) {
73629
- fs45.writeFileSync(configPath, previousContent, "utf8");
73720
+ fs46.writeFileSync(configPath, previousContent, "utf8");
73630
73721
  } else {
73631
- fs45.rmSync(configPath, { force: true });
73722
+ fs46.rmSync(configPath, { force: true });
73632
73723
  }
73633
73724
  throw error2;
73634
73725
  }
@@ -73713,7 +73804,7 @@ function inspectMakerMcpClientConfig(options3) {
73713
73804
  if (!configPaths) {
73714
73805
  return { ide, status: "unsupported", entries: [] };
73715
73806
  }
73716
- const entries = configPaths.filter((configPath) => fs46.existsSync(configPath)).map((configPath) => inspectMcpConfigFile(configPath, ide, options3.mcpName || MAKER_MCP_NAME));
73807
+ const entries = configPaths.filter((configPath) => fs47.existsSync(configPath)).map((configPath) => inspectMcpConfigFile(configPath, ide, options3.mcpName || MAKER_MCP_NAME));
73717
73808
  const status = entries.some((entry) => entry.status === "found") ? "found" : entries.some((entry) => entry.status === "unreadable") ? "unreadable" : entries.length > 0 ? "missing_entry" : "not_found";
73718
73809
  return { ide, status, entries };
73719
73810
  }
@@ -73727,15 +73818,15 @@ function resolveMakerMcpReportRuntime(options3) {
73727
73818
  `${pluginDistribution.displayName} plugin diagnostics require the active Maker bundle URL.`
73728
73819
  );
73729
73820
  }
73730
- const bundlePath = path48.resolve(fileURLToPath4(options3.bundleUrl));
73731
- const pluginRoot = path48.dirname(path48.dirname(bundlePath));
73821
+ const bundlePath = path49.resolve(fileURLToPath4(options3.bundleUrl));
73822
+ const pluginRoot = path49.dirname(path49.dirname(bundlePath));
73732
73823
  const execPath = options3.execPath ?? process.execPath;
73733
73824
  return {
73734
73825
  distribution: pluginDistribution.id,
73735
73826
  client: pluginDistribution.client,
73736
73827
  config_source: {
73737
73828
  format: "json",
73738
- paths: [path48.join(pluginRoot, ".mcp.json")],
73829
+ paths: [path49.join(pluginRoot, ".mcp.json")],
73739
73830
  mcp_name: "taptap-maker-plugin"
73740
73831
  },
73741
73832
  launcher: {
@@ -73787,8 +73878,8 @@ async function collectMakerMcpIssueDiagnostics(options3) {
73787
73878
  var _a3, _b;
73788
73879
  const platform = options3.platform || process.platform;
73789
73880
  const homeDir = options3.homeDir || os9.homedir();
73790
- const processCwd = path48.resolve(options3.processCwd || process.cwd());
73791
- const targetDir = path48.resolve(options3.targetDir);
73881
+ const processCwd = path49.resolve(options3.processCwd || process.cwd());
73882
+ const targetDir = path49.resolve(options3.targetDir);
73792
73883
  const identify = identifyMakerProject({ cwd: targetDir });
73793
73884
  const projectContext = identify.projectRoot ? {
73794
73885
  status: "bound",
@@ -73868,29 +73959,29 @@ function submitMakerMcpIssue(issue3, options3 = {}) {
73868
73959
  function getMcpConfigPaths(options3) {
73869
73960
  const { ide, homeDir, platform } = options3;
73870
73961
  if (ide === "codex") {
73871
- return [path48.join(homeDir, ".codex", "config.toml")];
73962
+ return [path49.join(homeDir, ".codex", "config.toml")];
73872
73963
  }
73873
73964
  if (ide === "cursor") {
73874
- return [path48.join(homeDir, ".cursor", "mcp.json")];
73965
+ return [path49.join(homeDir, ".cursor", "mcp.json")];
73875
73966
  }
73876
73967
  if (ide === "claude") {
73877
- return [path48.join(homeDir, ".claude.json")];
73968
+ return [path49.join(homeDir, ".claude.json")];
73878
73969
  }
73879
73970
  if (ide === "opencode") {
73880
- return [path48.join(homeDir, ".config", "opencode", "opencode.jsonc")];
73971
+ return [path49.join(homeDir, ".config", "opencode", "opencode.jsonc")];
73881
73972
  }
73882
73973
  if (ide === "workbuddy") {
73883
- const primary = path48.join(homeDir, ".workbuddy", "mcp.json");
73884
- if (fs46.existsSync(primary)) {
73974
+ const primary = path49.join(homeDir, ".workbuddy", "mcp.json");
73975
+ if (fs47.existsSync(primary)) {
73885
73976
  return [primary];
73886
73977
  }
73887
- const legacy = path48.join(homeDir, ".workbuddy", ".mcp.json");
73888
- return fs46.existsSync(legacy) ? [legacy] : [primary];
73978
+ const legacy = path49.join(homeDir, ".workbuddy", ".mcp.json");
73979
+ return fs47.existsSync(legacy) ? [legacy] : [primary];
73889
73980
  }
73890
73981
  if (ide === "trae") {
73891
- const root2 = platform === "win32" ? options3.appData || path48.join(homeDir, "AppData", "Roaming") : path48.join(homeDir, "Library", "Application Support");
73982
+ const root2 = platform === "win32" ? options3.appData || path49.join(homeDir, "AppData", "Roaming") : path49.join(homeDir, "Library", "Application Support");
73892
73983
  return ["TRAE SOLO", "TRAE SOLO CN", "Trae", "TRAE", "Trae CN"].map(
73893
- (name) => path48.join(root2, name, "User", "mcp.json")
73984
+ (name) => path49.join(root2, name, "User", "mcp.json")
73894
73985
  );
73895
73986
  }
73896
73987
  if (ide === "dsh") {
@@ -73901,7 +73992,7 @@ function getMcpConfigPaths(options3) {
73901
73992
  function inspectMcpConfigFile(configPath, ide, mcpName, format) {
73902
73993
  try {
73903
73994
  const resolvedFormat = format ?? (ide === "codex" ? "codex_toml" : ide === "dsh" ? "dsh" : ide === "opencode" ? "jsonc" : "json");
73904
- const content = fs46.readFileSync(configPath, "utf8");
73995
+ const content = fs47.readFileSync(configPath, "utf8");
73905
73996
  const server = resolvedFormat === "codex_toml" ? extractCodexMcpServerConfig(content, mcpName) : resolvedFormat === "dsh" ? extractDshMcpServerConfig(content, mcpName, configPath) : extractMakerMcpServerConfig(
73906
73997
  parseJsonConfig(content, resolvedFormat === "jsonc"),
73907
73998
  mcpName
@@ -73912,7 +74003,7 @@ function inspectMcpConfigFile(configPath, ide, mcpName, format) {
73912
74003
  }
73913
74004
  }
73914
74005
  function inspectMakerMcpConfigSource(ide, source) {
73915
- const entries = source.paths.filter((configPath) => fs46.existsSync(configPath)).map((configPath) => inspectMcpConfigFile(configPath, ide, source.mcp_name, source.format));
74006
+ const entries = source.paths.filter((configPath) => fs47.existsSync(configPath)).map((configPath) => inspectMcpConfigFile(configPath, ide, source.mcp_name, source.format));
73916
74007
  const status = entries.some((entry) => entry.status === "found") ? "found" : entries.some((entry) => entry.status === "unreadable") ? "unreadable" : entries.length > 0 ? "missing_entry" : "not_found";
73917
74008
  return { ide, status, entries };
73918
74009
  }
@@ -74129,13 +74220,13 @@ function inspectWorkBuddyTrust(homeDir, mcpName) {
74129
74220
  pending_accounts: 0,
74130
74221
  unreadable_accounts: 0
74131
74222
  };
74132
- const connectorsDir = path48.join(homeDir, ".workbuddy", "connectors");
74133
- if (!fs46.existsSync(connectorsDir)) {
74223
+ const connectorsDir = path49.join(homeDir, ".workbuddy", "connectors");
74224
+ if (!fs47.existsSync(connectorsDir)) {
74134
74225
  return { status: "not_found", ...emptyCounts };
74135
74226
  }
74136
74227
  let entries;
74137
74228
  try {
74138
- entries = fs46.readdirSync(connectorsDir, { withFileTypes: true });
74229
+ entries = fs47.readdirSync(connectorsDir, { withFileTypes: true });
74139
74230
  } catch {
74140
74231
  return { status: "unreadable", ...emptyCounts };
74141
74232
  }
@@ -74144,12 +74235,12 @@ function inspectWorkBuddyTrust(homeDir, mcpName) {
74144
74235
  if (!entry.isDirectory()) {
74145
74236
  continue;
74146
74237
  }
74147
- const statePath = path48.join(connectorsDir, entry.name, "connector-states.json");
74148
- if (!fs46.existsSync(statePath)) {
74238
+ const statePath = path49.join(connectorsDir, entry.name, "connector-states.json");
74239
+ if (!fs47.existsSync(statePath)) {
74149
74240
  continue;
74150
74241
  }
74151
74242
  try {
74152
- const state = JSON.parse(fs46.readFileSync(statePath, "utf8"));
74243
+ const state = JSON.parse(fs47.readFileSync(statePath, "utf8"));
74153
74244
  if (!isRecord4(state)) {
74154
74245
  counts.accounts_checked += 1;
74155
74246
  counts.unreadable_accounts += 1;
@@ -74347,9 +74438,9 @@ function stripControlCharacters(value) {
74347
74438
 
74348
74439
  // src/maker/cli/pluginMigration.ts
74349
74440
  init_storage();
74350
- import fs48 from "node:fs";
74441
+ import fs49 from "node:fs";
74351
74442
  import os10 from "node:os";
74352
- import path50 from "node:path";
74443
+ import path51 from "node:path";
74353
74444
  import crypto3 from "node:crypto";
74354
74445
 
74355
74446
  // src/maker/cli/codexMcpConfig.ts
@@ -74556,28 +74647,28 @@ function escapeRegExp3(value) {
74556
74647
  }
74557
74648
 
74558
74649
  // src/maker/cli/configWrite.ts
74559
- import fs47 from "node:fs";
74560
- import path49 from "node:path";
74650
+ import fs48 from "node:fs";
74651
+ import path50 from "node:path";
74561
74652
  function writeConfigWithTapTapBackupIfChanged(filePath, nextContent, validate2) {
74562
- const existed = fs47.existsSync(filePath);
74563
- const previousContent = existed ? fs47.readFileSync(filePath, "utf8") : void 0;
74653
+ const existed = fs48.existsSync(filePath);
74654
+ const previousContent = existed ? fs48.readFileSync(filePath, "utf8") : void 0;
74564
74655
  if (previousContent === nextContent) {
74565
74656
  return { changed: false };
74566
74657
  }
74567
74658
  const backupPath = existed ? `${filePath}.taptap-maker.bak.latest` : void 0;
74568
- fs47.mkdirSync(path49.dirname(filePath), { recursive: true });
74659
+ fs48.mkdirSync(path50.dirname(filePath), { recursive: true });
74569
74660
  if (previousContent !== void 0 && backupPath) {
74570
- fs47.writeFileSync(backupPath, previousContent, "utf8");
74661
+ fs48.writeFileSync(backupPath, previousContent, "utf8");
74571
74662
  }
74572
74663
  try {
74573
- fs47.writeFileSync(filePath, nextContent, "utf8");
74574
- validate2 == null ? void 0 : validate2(fs47.readFileSync(filePath, "utf8"));
74664
+ fs48.writeFileSync(filePath, nextContent, "utf8");
74665
+ validate2 == null ? void 0 : validate2(fs48.readFileSync(filePath, "utf8"));
74575
74666
  return { changed: true, backupPath };
74576
74667
  } catch (error2) {
74577
74668
  if (previousContent !== void 0) {
74578
- fs47.writeFileSync(filePath, previousContent, "utf8");
74669
+ fs48.writeFileSync(filePath, previousContent, "utf8");
74579
74670
  } else {
74580
- fs47.rmSync(filePath, { force: true });
74671
+ fs48.rmSync(filePath, { force: true });
74581
74672
  }
74582
74673
  throw error2;
74583
74674
  }
@@ -74585,11 +74676,11 @@ function writeConfigWithTapTapBackupIfChanged(filePath, nextContent, validate2)
74585
74676
 
74586
74677
  // src/maker/cli/pluginMigration.ts
74587
74678
  function inspectCodexLegacyMakerMcp(options3 = {}) {
74588
- const configPath = options3.configPath ?? path50.join(os10.homedir(), ".codex", "config.toml");
74589
- if (!fs48.existsSync(configPath)) {
74679
+ const configPath = options3.configPath ?? path51.join(os10.homedir(), ".codex", "config.toml");
74680
+ if (!fs49.existsSync(configPath)) {
74590
74681
  return createInspection(configPath, "not_found", 0);
74591
74682
  }
74592
- const content = fs48.readFileSync(configPath, "utf8");
74683
+ const content = fs49.readFileSync(configPath, "utf8");
74593
74684
  const registrations = findCodexMakerMainTables(content);
74594
74685
  if (registrations.length === 0) {
74595
74686
  return createInspection(configPath, "not_found", 0);
@@ -74604,7 +74695,7 @@ function inspectCodexLegacyMakerMcp(options3 = {}) {
74604
74695
  };
74605
74696
  }
74606
74697
  function migrateCodexLegacyMakerMcp(options3 = {}) {
74607
- const configPath = options3.configPath ?? path50.join(os10.homedir(), ".codex", "config.toml");
74698
+ const configPath = options3.configPath ?? path51.join(os10.homedir(), ".codex", "config.toml");
74608
74699
  const makerHome = options3.makerHome ?? getMakerHome();
74609
74700
  const statePath = getCodexPluginMigrationStatePath(makerHome);
74610
74701
  const inspection = inspectCodexLegacyMakerMcp({ configPath });
@@ -74618,7 +74709,7 @@ function migrateCodexLegacyMakerMcp(options3 = {}) {
74618
74709
  }
74619
74710
  if (inspection.status === "disabled") {
74620
74711
  const state2 = readMigrationState(statePath);
74621
- const content = fs48.readFileSync(configPath, "utf8");
74712
+ const content = fs49.readFileSync(configPath, "utf8");
74622
74713
  const registration2 = findCodexMakerMainTables(content)[0];
74623
74714
  const owned = (state2 == null ? void 0 : state2.config_path) === configPath && sha256(readCodexMakerRegistration(content, registration2)) === state2.migrated_registration_sha256;
74624
74715
  return {
@@ -74631,7 +74722,7 @@ function migrateCodexLegacyMakerMcp(options3 = {}) {
74631
74722
  if (!options3.confirm) {
74632
74723
  throw new Error("Disabling the legacy Codex Maker MCP requires explicit confirmation.");
74633
74724
  }
74634
- const previousContent = fs48.readFileSync(configPath, "utf8");
74725
+ const previousContent = fs49.readFileSync(configPath, "utf8");
74635
74726
  const registration = findCodexMakerMainTables(previousContent)[0];
74636
74727
  const nextContent = disableCodexMakerRegistration(previousContent, registration);
74637
74728
  const state = {
@@ -74645,13 +74736,13 @@ function migrateCodexLegacyMakerMcp(options3 = {}) {
74645
74736
  ),
74646
74737
  migrated_at: (/* @__PURE__ */ new Date()).toISOString()
74647
74738
  };
74648
- fs48.mkdirSync(path50.dirname(statePath), { recursive: true });
74739
+ fs49.mkdirSync(path51.dirname(statePath), { recursive: true });
74649
74740
  const write = writeConfigWithTapTapBackupIfChanged(configPath, nextContent, () => {
74650
74741
  const migratedInspection = inspectCodexLegacyMakerMcp({ configPath });
74651
74742
  if (migratedInspection.status !== "disabled") {
74652
74743
  throw new Error("Codex Maker MCP migration validation did not find a disabled registration.");
74653
74744
  }
74654
- fs48.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
74745
+ fs49.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
74655
74746
  `, "utf8");
74656
74747
  });
74657
74748
  return {
@@ -74663,7 +74754,7 @@ function migrateCodexLegacyMakerMcp(options3 = {}) {
74663
74754
  };
74664
74755
  }
74665
74756
  function restoreCodexLegacyMakerMcp(options3 = {}) {
74666
- const configPath = options3.configPath ?? path50.join(os10.homedir(), ".codex", "config.toml");
74757
+ const configPath = options3.configPath ?? path51.join(os10.homedir(), ".codex", "config.toml");
74667
74758
  const makerHome = options3.makerHome ?? getMakerHome();
74668
74759
  const statePath = getCodexPluginMigrationStatePath(makerHome);
74669
74760
  const inspection = inspectCodexLegacyMakerMcp({ configPath });
@@ -74684,14 +74775,14 @@ function restoreCodexLegacyMakerMcp(options3 = {}) {
74684
74775
  "The migrated Codex Maker MCP registration no longer exists and cannot be restored."
74685
74776
  );
74686
74777
  }
74687
- const previousContent = fs48.readFileSync(configPath, "utf8");
74778
+ const previousContent = fs49.readFileSync(configPath, "utf8");
74688
74779
  const registration = findCodexMakerMainTables(previousContent)[0];
74689
74780
  const registrationSha256 = sha256(readCodexMakerRegistration(previousContent, registration));
74690
74781
  if (inspection.status === "active") {
74691
74782
  if (registrationSha256 !== state.original_registration_sha256) {
74692
74783
  return { ...inspection, action: "not_owned", changed: false };
74693
74784
  }
74694
- fs48.unlinkSync(statePath);
74785
+ fs49.unlinkSync(statePath);
74695
74786
  return { ...inspection, action: "already_restored", changed: false };
74696
74787
  }
74697
74788
  if (registrationSha256 !== state.migrated_registration_sha256) {
@@ -74705,12 +74796,12 @@ function restoreCodexLegacyMakerMcp(options3 = {}) {
74705
74796
  "Codex Maker MCP restoration validation did not find an active registration."
74706
74797
  );
74707
74798
  }
74708
- const restoredContent = fs48.readFileSync(configPath, "utf8");
74799
+ const restoredContent = fs49.readFileSync(configPath, "utf8");
74709
74800
  const restoredRegistration = findCodexMakerMainTables(restoredContent)[0];
74710
74801
  if (sha256(readCodexMakerRegistration(restoredContent, restoredRegistration)) !== state.original_registration_sha256) {
74711
74802
  throw new Error("Codex Maker MCP restoration changed the migrated registration identity.");
74712
74803
  }
74713
- fs48.unlinkSync(statePath);
74804
+ fs49.unlinkSync(statePath);
74714
74805
  });
74715
74806
  return {
74716
74807
  ...inspectCodexLegacyMakerMcp({ configPath }),
@@ -74773,14 +74864,14 @@ function readCodexMakerRegistration(content, registration) {
74773
74864
  return content.slice(registration.headerStart, registration.bodyEnd).trimEnd();
74774
74865
  }
74775
74866
  function getCodexPluginMigrationStatePath(makerHome) {
74776
- return path50.join(makerHome, "plugin-migrations", "codex.json");
74867
+ return path51.join(makerHome, "plugin-migrations", "codex.json");
74777
74868
  }
74778
74869
  function readMigrationState(statePath) {
74779
- if (!fs48.existsSync(statePath)) {
74870
+ if (!fs49.existsSync(statePath)) {
74780
74871
  return void 0;
74781
74872
  }
74782
74873
  try {
74783
- const state = JSON.parse(fs48.readFileSync(statePath, "utf8"));
74874
+ const state = JSON.parse(fs49.readFileSync(statePath, "utf8"));
74784
74875
  return (state == null ? void 0 : state.schema_version) === 2 && state.client === "codex" ? state : void 0;
74785
74876
  } catch {
74786
74877
  return void 0;
@@ -74870,7 +74961,7 @@ function migrateWorkBuddyLegacyMakerMcp(options3 = {}) {
74870
74961
  migrated_registration_sha256: hashWorkBuddyRegistration(migratedRegistration),
74871
74962
  migrated_at: (/* @__PURE__ */ new Date()).toISOString()
74872
74963
  };
74873
- fs48.mkdirSync(path50.dirname(statePath), { recursive: true });
74964
+ fs49.mkdirSync(path51.dirname(statePath), { recursive: true });
74874
74965
  const write = writeConfigWithTapTapBackupIfChanged(current.configPath, nextContent, () => {
74875
74966
  const migrated = findWorkBuddyMakerRegistrations(configPaths).find(
74876
74967
  (entry) => entry.configPath === current.configPath
@@ -74880,7 +74971,7 @@ function migrateWorkBuddyLegacyMakerMcp(options3 = {}) {
74880
74971
  "WorkBuddy Maker MCP migration validation did not find the disabled registration."
74881
74972
  );
74882
74973
  }
74883
- fs48.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
74974
+ fs49.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
74884
74975
  `, "utf8");
74885
74976
  });
74886
74977
  const migratedInspection = inspectWorkBuddyLegacyMakerMcp({ configPaths });
@@ -74934,7 +75025,7 @@ function restoreWorkBuddyLegacyMakerMcp(options3 = {}) {
74934
75025
  changed: false
74935
75026
  };
74936
75027
  }
74937
- fs48.unlinkSync(statePath);
75028
+ fs49.unlinkSync(statePath);
74938
75029
  return {
74939
75030
  ...inspection,
74940
75031
  config_path: current.configPath,
@@ -74967,7 +75058,7 @@ function restoreWorkBuddyLegacyMakerMcp(options3 = {}) {
74967
75058
  if (!restored || hashWorkBuddyRegistration(restored.registration) !== state.original_registration_sha256) {
74968
75059
  throw new Error("WorkBuddy Maker MCP restoration changed the registration identity.");
74969
75060
  }
74970
- fs48.unlinkSync(statePath);
75061
+ fs49.unlinkSync(statePath);
74971
75062
  });
74972
75063
  return {
74973
75064
  ...inspectWorkBuddyLegacyMakerMcp({ configPaths }),
@@ -74980,19 +75071,19 @@ function restoreWorkBuddyLegacyMakerMcp(options3 = {}) {
74980
75071
  }
74981
75072
  function getWorkBuddyConfigPaths(configPaths) {
74982
75073
  return configPaths ?? [
74983
- path50.join(os10.homedir(), ".workbuddy", "mcp.json"),
74984
- path50.join(os10.homedir(), ".workbuddy", ".mcp.json")
75074
+ path51.join(os10.homedir(), ".workbuddy", "mcp.json"),
75075
+ path51.join(os10.homedir(), ".workbuddy", ".mcp.json")
74985
75076
  ];
74986
75077
  }
74987
75078
  function findWorkBuddyMakerRegistrations(configPaths) {
74988
75079
  const registrations = [];
74989
75080
  for (const configPath of configPaths) {
74990
- if (!fs48.existsSync(configPath)) {
75081
+ if (!fs49.existsSync(configPath)) {
74991
75082
  continue;
74992
75083
  }
74993
75084
  let config2;
74994
75085
  try {
74995
- config2 = JSON.parse(fs48.readFileSync(configPath, "utf8"));
75086
+ config2 = JSON.parse(fs49.readFileSync(configPath, "utf8"));
74996
75087
  } catch (error2) {
74997
75088
  throw new Error(
74998
75089
  `Cannot parse WorkBuddy MCP config ${configPath}: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -75027,14 +75118,14 @@ function setWorkBuddyMakerRegistration(config2, registration) {
75027
75118
  servers["taptap-maker"] = registration;
75028
75119
  }
75029
75120
  function getWorkBuddyPluginMigrationStatePath(makerHome) {
75030
- return path50.join(makerHome, "plugin-migrations", "workbuddy.json");
75121
+ return path51.join(makerHome, "plugin-migrations", "workbuddy.json");
75031
75122
  }
75032
75123
  function readWorkBuddyMigrationState(statePath) {
75033
- if (!fs48.existsSync(statePath)) {
75124
+ if (!fs49.existsSync(statePath)) {
75034
75125
  return void 0;
75035
75126
  }
75036
75127
  try {
75037
- const state = JSON.parse(fs48.readFileSync(statePath, "utf8"));
75128
+ const state = JSON.parse(fs49.readFileSync(statePath, "utf8"));
75038
75129
  return (state == null ? void 0 : state.schema_version) === 1 && state.client === "workbuddy" ? state : void 0;
75039
75130
  } catch {
75040
75131
  return void 0;
@@ -75059,9 +75150,9 @@ function isRecord5(value) {
75059
75150
  // src/maker/cli/dshPluginMigration.ts
75060
75151
  var import_yaml2 = __toESM(require_dist2());
75061
75152
  init_storage();
75062
- import fs49 from "node:fs";
75153
+ import fs50 from "node:fs";
75063
75154
  import os11 from "node:os";
75064
- import path51 from "node:path";
75155
+ import path52 from "node:path";
75065
75156
  import crypto4 from "node:crypto";
75066
75157
  var DSH_MAKER_MCP_NAME = "taptap-maker";
75067
75158
  function inspectDshLegacyMakerMcp(options3 = {}) {
@@ -75094,7 +75185,7 @@ function migrateDshLegacyMakerMcp(options3 = {}) {
75094
75185
  );
75095
75186
  }
75096
75187
  const registration = registrations[0];
75097
- const previousContent = fs49.readFileSync(registration.configPath, "utf8");
75188
+ const previousContent = fs50.readFileSync(registration.configPath, "utf8");
75098
75189
  const document = (0, import_yaml2.parseDocument)(previousContent, { prettyErrors: true });
75099
75190
  if (document.errors.length > 0) {
75100
75191
  throw new Error(`Invalid YAML in ${registration.configPath}: ${document.errors[0].message}`);
@@ -75109,13 +75200,13 @@ function migrateDshLegacyMakerMcp(options3 = {}) {
75109
75200
  removed_registration_sha256: sha2562(JSON.stringify(registration.registration)),
75110
75201
  migrated_at: (/* @__PURE__ */ new Date()).toISOString()
75111
75202
  };
75112
- fs49.mkdirSync(path51.dirname(statePath), { recursive: true });
75203
+ fs50.mkdirSync(path52.dirname(statePath), { recursive: true });
75113
75204
  const write = writeConfigWithTapTapBackupIfChanged(registration.configPath, nextContent, () => {
75114
75205
  const after = findDshMakerRegistrations(options3.dshHome);
75115
75206
  if (after.some((entry) => entry.configPath === registration.configPath)) {
75116
75207
  throw new Error("DSH Maker MCP migration validation still found a registration.");
75117
75208
  }
75118
- fs49.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
75209
+ fs50.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}
75119
75210
  `, "utf8");
75120
75211
  });
75121
75212
  return {
@@ -75148,13 +75239,13 @@ function restoreDshLegacyMakerMcp(options3 = {}) {
75148
75239
  const current = findDshMakerRegistrations(options3.dshHome)[0];
75149
75240
  const currentSha = sha2562(JSON.stringify(current.registration));
75150
75241
  if (currentSha === state.removed_registration_sha256) {
75151
- fs49.rmSync(statePath, { force: true });
75242
+ fs50.rmSync(statePath, { force: true });
75152
75243
  return { ...inspection, action: "already_restored", changed: false, state_path: statePath };
75153
75244
  }
75154
75245
  return { ...inspection, action: "not_owned", changed: false };
75155
75246
  }
75156
75247
  const configPath = state.config_path;
75157
- const previousContent = fs49.readFileSync(configPath, "utf8");
75248
+ const previousContent = fs50.readFileSync(configPath, "utf8");
75158
75249
  const document = (0, import_yaml2.parseDocument)(previousContent, { prettyErrors: true });
75159
75250
  if (document.errors.length > 0) {
75160
75251
  throw new Error(`Invalid YAML in ${configPath}: ${document.errors[0].message}`);
@@ -75167,7 +75258,7 @@ function restoreDshLegacyMakerMcp(options3 = {}) {
75167
75258
  if (!match || sha2562(JSON.stringify(match.registration)) !== state.removed_registration_sha256) {
75168
75259
  throw new Error("DSH Maker MCP restoration changed the registration identity.");
75169
75260
  }
75170
- fs49.rmSync(statePath, { force: true });
75261
+ fs50.rmSync(statePath, { force: true });
75171
75262
  });
75172
75263
  return {
75173
75264
  ...inspectDshLegacyMakerMcp(options3),
@@ -75182,10 +75273,10 @@ function findDshMakerRegistrations(dshHome) {
75182
75273
  const configPaths = listDshMcpConfigPaths({ homeDir: os11.homedir(), dshHome: resolvedDshHome });
75183
75274
  const registrations = [];
75184
75275
  for (const configPath of configPaths) {
75185
- if (!fs49.existsSync(configPath)) {
75276
+ if (!fs50.existsSync(configPath)) {
75186
75277
  continue;
75187
75278
  }
75188
- const content = fs49.readFileSync(configPath, "utf8");
75279
+ const content = fs50.readFileSync(configPath, "utf8");
75189
75280
  const document = (0, import_yaml2.parseDocument)(content, { prettyErrors: true });
75190
75281
  if (document.errors.length > 0) {
75191
75282
  throw new Error(`Invalid YAML in ${configPath}: ${document.errors[0].message}`);
@@ -75270,14 +75361,14 @@ function isDshMakerPluginCandidate(value) {
75270
75361
  return value.name === DSH_MCP_PLUGIN_NAME && (config2 == null ? void 0 : config2.serverName) === DSH_MAKER_MCP_NAME;
75271
75362
  }
75272
75363
  function getDshPluginMigrationStatePath(makerHome) {
75273
- return path51.join(makerHome, "plugin-migrations", "dsh.json");
75364
+ return path52.join(makerHome, "plugin-migrations", "dsh.json");
75274
75365
  }
75275
75366
  function readDshMigrationState(statePath) {
75276
- if (!fs49.existsSync(statePath)) {
75367
+ if (!fs50.existsSync(statePath)) {
75277
75368
  return void 0;
75278
75369
  }
75279
75370
  try {
75280
- const state = JSON.parse(fs49.readFileSync(statePath, "utf8"));
75371
+ const state = JSON.parse(fs50.readFileSync(statePath, "utf8"));
75281
75372
  return (state == null ? void 0 : state.schema_version) === 1 && state.client === "dsh" ? state : void 0;
75282
75373
  } catch {
75283
75374
  return void 0;
@@ -75318,9 +75409,9 @@ init_config();
75318
75409
  init_fetchTimeout();
75319
75410
  init_identify();
75320
75411
  init_storage();
75321
- import fs50 from "node:fs";
75412
+ import fs51 from "node:fs";
75322
75413
  import os12 from "node:os";
75323
- import path52 from "node:path";
75414
+ import path53 from "node:path";
75324
75415
  import { randomUUID as randomUUID9 } from "node:crypto";
75325
75416
  import { Readable, Transform } from "node:stream";
75326
75417
  import { pipeline as pipeline2 } from "node:stream/promises";
@@ -75330,7 +75421,7 @@ var MAX_ARCHIVE_ENTRIES = 1e3;
75330
75421
  var MAX_ARCHIVE_EXTRACTED_BYTES = 128 * 1024 * 1024;
75331
75422
  async function pullMakerUserSkills(options3 = {}) {
75332
75423
  var _a3, _b;
75333
- const requestedDir = path52.resolve(options3.targetDir || process.cwd());
75424
+ const requestedDir = path53.resolve(options3.targetDir || process.cwd());
75334
75425
  const project = identifyMakerProject({ cwd: requestedDir });
75335
75426
  if (!project.projectRoot) {
75336
75427
  throw new Error(
@@ -75342,10 +75433,10 @@ async function pullMakerUserSkills(options3 = {}) {
75342
75433
  if (!token) {
75343
75434
  throw new Error("Maker authentication not found. Run `taptap-maker login` and try again.");
75344
75435
  }
75345
- const sourceDir = path52.join(project.projectRoot, ".installer", "skills");
75346
- const tempDir = fs50.mkdtempSync(path52.join(os12.tmpdir(), "taptap-maker-user-skills-"));
75347
- const archivePath = path52.join(tempDir, "user-skills.zip");
75348
- const stagingDir = path52.join(tempDir, "skills");
75436
+ const sourceDir = path53.join(project.projectRoot, ".installer", "skills");
75437
+ const tempDir = fs51.mkdtempSync(path53.join(os12.tmpdir(), "taptap-maker-user-skills-"));
75438
+ const archivePath = path53.join(tempDir, "user-skills.zip");
75439
+ const stagingDir = path53.join(tempDir, "skills");
75349
75440
  try {
75350
75441
  const response = await fetchWithTimeout(
75351
75442
  options3.fetchImpl || fetch,
@@ -75377,7 +75468,7 @@ async function pullMakerUserSkills(options3 = {}) {
75377
75468
  preservedSkills
75378
75469
  };
75379
75470
  } finally {
75380
- fs50.rmSync(tempDir, { recursive: true, force: true });
75471
+ fs51.rmSync(tempDir, { recursive: true, force: true });
75381
75472
  }
75382
75473
  }
75383
75474
  async function writeArchiveResponse(response, archivePath) {
@@ -75402,7 +75493,7 @@ async function writeArchiveResponse(response, archivePath) {
75402
75493
  await pipeline2(
75403
75494
  Readable.fromWeb(response.body),
75404
75495
  limit,
75405
- fs50.createWriteStream(archivePath, { flags: "wx" })
75496
+ fs51.createWriteStream(archivePath, { flags: "wx" })
75406
75497
  );
75407
75498
  }
75408
75499
  function validateUserSkillArchivePath(entryPath) {
@@ -75417,7 +75508,7 @@ function validateUserSkillArchivePath(entryPath) {
75417
75508
  return segments;
75418
75509
  }
75419
75510
  async function extractUserSkillsArchive(archivePath, stagingDir) {
75420
- fs50.mkdirSync(stagingDir, { recursive: true });
75511
+ fs51.mkdirSync(stagingDir, { recursive: true });
75421
75512
  const zipFile = await import_yauzl.default.openPromise(archivePath, {
75422
75513
  lazyEntries: true,
75423
75514
  decodeStrings: true,
@@ -75437,7 +75528,7 @@ async function extractUserSkillsArchive(archivePath, stagingDir) {
75437
75528
  );
75438
75529
  }
75439
75530
  const segments = validateUserSkillArchivePath(entry.fileName);
75440
- if (segments.some((segment) => path52.basename(segment).startsWith(".nfs"))) {
75531
+ if (segments.some((segment) => path53.basename(segment).startsWith(".nfs"))) {
75441
75532
  continue;
75442
75533
  }
75443
75534
  const isDirectory2 = isZipDirectory(entry);
@@ -75459,24 +75550,24 @@ async function extractUserSkillsArchive(archivePath, stagingDir) {
75459
75550
  }
75460
75551
  seenPaths.add(collisionKey);
75461
75552
  skillNames.add(segments[0]);
75462
- const destination = path52.join(stagingDir, ...segments);
75553
+ const destination = path53.join(stagingDir, ...segments);
75463
75554
  if (isDirectory2) {
75464
- fs50.mkdirSync(destination, { recursive: true });
75555
+ fs51.mkdirSync(destination, { recursive: true });
75465
75556
  continue;
75466
75557
  }
75467
- fs50.mkdirSync(path52.dirname(destination), { recursive: true });
75558
+ fs51.mkdirSync(path53.dirname(destination), { recursive: true });
75468
75559
  const input2 = await zipFile.openReadStreamPromise(entry);
75469
- await pipeline2(input2, fs50.createWriteStream(destination, { flags: "wx" }));
75560
+ await pipeline2(input2, fs51.createWriteStream(destination, { flags: "wx" }));
75470
75561
  }
75471
75562
  } finally {
75472
75563
  zipFile.close();
75473
75564
  }
75474
75565
  const installedSkills = [...skillNames].sort();
75475
75566
  for (const skillName of installedSkills) {
75476
- const definitionPath = path52.join(stagingDir, skillName, "SKILL.md");
75567
+ const definitionPath = path53.join(stagingDir, skillName, "SKILL.md");
75477
75568
  let definition;
75478
75569
  try {
75479
- definition = fs50.lstatSync(definitionPath);
75570
+ definition = fs51.lstatSync(definitionPath);
75480
75571
  } catch {
75481
75572
  throw new Error(`Maker user Skill "${skillName}" is missing SKILL.md.`);
75482
75573
  }
@@ -75510,31 +75601,31 @@ function installUserSkills(projectRoot, stagingDir, skillNames) {
75510
75601
  if (skillNames.length === 0) {
75511
75602
  return;
75512
75603
  }
75513
- const installerDir = path52.join(projectRoot, ".installer");
75514
- const sourceDir = path52.join(installerDir, "skills");
75515
- const transactionDir = path52.join(installerDir, `.user-skills-${randomUUID9()}`);
75516
- const preparedDir = path52.join(transactionDir, "prepared");
75517
- const backupDir = path52.join(transactionDir, "backup");
75604
+ const installerDir = path53.join(projectRoot, ".installer");
75605
+ const sourceDir = path53.join(installerDir, "skills");
75606
+ const transactionDir = path53.join(installerDir, `.user-skills-${randomUUID9()}`);
75607
+ const preparedDir = path53.join(transactionDir, "prepared");
75608
+ const backupDir = path53.join(transactionDir, "backup");
75518
75609
  const completed = [];
75519
75610
  let preserveTransaction = false;
75520
- fs50.mkdirSync(preparedDir, { recursive: true });
75521
- fs50.mkdirSync(sourceDir, { recursive: true });
75611
+ fs51.mkdirSync(preparedDir, { recursive: true });
75612
+ fs51.mkdirSync(sourceDir, { recursive: true });
75522
75613
  try {
75523
75614
  for (const skillName of skillNames) {
75524
- fs50.cpSync(path52.join(stagingDir, skillName), path52.join(preparedDir, skillName), {
75615
+ fs51.cpSync(path53.join(stagingDir, skillName), path53.join(preparedDir, skillName), {
75525
75616
  recursive: true
75526
75617
  });
75527
75618
  }
75528
75619
  for (const skillName of skillNames) {
75529
- const target = path52.join(sourceDir, skillName);
75530
- const backup = path52.join(backupDir, skillName);
75620
+ const target = path53.join(sourceDir, skillName);
75621
+ const backup = path53.join(backupDir, skillName);
75531
75622
  const hadExisting = pathExists(target);
75532
75623
  if (hadExisting) {
75533
- fs50.mkdirSync(path52.dirname(backup), { recursive: true });
75534
- fs50.renameSync(target, backup);
75624
+ fs51.mkdirSync(path53.dirname(backup), { recursive: true });
75625
+ fs51.renameSync(target, backup);
75535
75626
  }
75536
75627
  completed.push({ target, backup, hadExisting });
75537
- fs50.renameSync(path52.join(preparedDir, skillName), target);
75628
+ fs51.renameSync(path53.join(preparedDir, skillName), target);
75538
75629
  }
75539
75630
  installUserSkillsForClients(projectRoot, skillNames);
75540
75631
  } catch (error2) {
@@ -75548,7 +75639,7 @@ function installUserSkills(projectRoot, stagingDir, skillNames) {
75548
75639
  throw new Error(`Failed to install Maker user Skills: ${formatError5(error2)}`);
75549
75640
  } finally {
75550
75641
  if (!preserveTransaction) {
75551
- fs50.rmSync(transactionDir, { recursive: true, force: true });
75642
+ fs51.rmSync(transactionDir, { recursive: true, force: true });
75552
75643
  }
75553
75644
  }
75554
75645
  }
@@ -75556,27 +75647,27 @@ function installUserSkillsForClients(projectRoot, skillNames) {
75556
75647
  if (skillNames.length === 0) {
75557
75648
  return;
75558
75649
  }
75559
- const sourceRoot = path52.join(projectRoot, ".installer", "skills");
75560
- const transactionDir = path52.join(
75650
+ const sourceRoot = path53.join(projectRoot, ".installer", "skills");
75651
+ const transactionDir = path53.join(
75561
75652
  projectRoot,
75562
75653
  ".installer",
75563
75654
  `.user-skill-clients-${randomUUID9()}`
75564
75655
  );
75565
- const backupRoot = path52.join(transactionDir, "backup");
75656
+ const backupRoot = path53.join(transactionDir, "backup");
75566
75657
  const changed = [];
75567
75658
  let preserveTransaction = false;
75568
75659
  try {
75569
75660
  for (const clientDir of USER_SKILL_CLIENT_DIRS) {
75570
- const targetRoot = path52.join(projectRoot, clientDir, "skills");
75571
- fs50.mkdirSync(targetRoot, { recursive: true });
75661
+ const targetRoot = path53.join(projectRoot, clientDir, "skills");
75662
+ fs51.mkdirSync(targetRoot, { recursive: true });
75572
75663
  for (const skillName of skillNames) {
75573
- const source = path52.join(sourceRoot, skillName);
75574
- const target = path52.join(targetRoot, skillName);
75575
- const backup = path52.join(backupRoot, clientDir, skillName);
75664
+ const source = path53.join(sourceRoot, skillName);
75665
+ const target = path53.join(targetRoot, skillName);
75666
+ const backup = path53.join(backupRoot, clientDir, skillName);
75576
75667
  const hadExisting = pathExists(target);
75577
75668
  if (hadExisting) {
75578
- fs50.mkdirSync(path52.dirname(backup), { recursive: true });
75579
- fs50.renameSync(target, backup);
75669
+ fs51.mkdirSync(path53.dirname(backup), { recursive: true });
75670
+ fs51.renameSync(target, backup);
75580
75671
  }
75581
75672
  changed.push({ target, backup, hadExisting });
75582
75673
  linkOrCopySkill(source, target);
@@ -75593,7 +75684,7 @@ function installUserSkillsForClients(projectRoot, skillNames) {
75593
75684
  throw new Error(`Failed to install Maker user Skills for AI clients: ${formatError5(error2)}`);
75594
75685
  } finally {
75595
75686
  if (!preserveTransaction) {
75596
- fs50.rmSync(transactionDir, { recursive: true, force: true });
75687
+ fs51.rmSync(transactionDir, { recursive: true, force: true });
75597
75688
  }
75598
75689
  }
75599
75690
  }
@@ -75604,7 +75695,7 @@ function rollbackSkillChanges(changes) {
75604
75695
  try {
75605
75696
  removePathEntry(item.target);
75606
75697
  if (item.hadExisting && pathExists(item.backup)) {
75607
- fs50.renameSync(item.backup, item.target);
75698
+ fs51.renameSync(item.backup, item.target);
75608
75699
  }
75609
75700
  } catch (error2) {
75610
75701
  errors.push(`${item.target}: ${formatError5(error2)}`);
@@ -75614,12 +75705,12 @@ function rollbackSkillChanges(changes) {
75614
75705
  }
75615
75706
  function linkOrCopySkill(source, target) {
75616
75707
  try {
75617
- const linkTarget = process.platform === "win32" ? source : path52.relative(path52.dirname(target), source);
75618
- fs50.symlinkSync(linkTarget, target, process.platform === "win32" ? "junction" : "dir");
75708
+ const linkTarget = process.platform === "win32" ? source : path53.relative(path53.dirname(target), source);
75709
+ fs51.symlinkSync(linkTarget, target, process.platform === "win32" ? "junction" : "dir");
75619
75710
  } catch (linkError) {
75620
75711
  removePathEntry(target);
75621
75712
  try {
75622
- fs50.cpSync(source, target, { recursive: true });
75713
+ fs51.cpSync(source, target, { recursive: true });
75623
75714
  } catch (copyError) {
75624
75715
  throw new Error(
75625
75716
  `Failed to link ${source}: ${formatError5(linkError)}; copy fallback: ${formatError5(copyError)}`
@@ -75629,12 +75720,12 @@ function linkOrCopySkill(source, target) {
75629
75720
  }
75630
75721
  function removePathEntry(value) {
75631
75722
  try {
75632
- const stat = fs50.lstatSync(value);
75723
+ const stat = fs51.lstatSync(value);
75633
75724
  if (stat.isSymbolicLink()) {
75634
- fs50.unlinkSync(value);
75725
+ fs51.unlinkSync(value);
75635
75726
  return;
75636
75727
  }
75637
- fs50.rmSync(value, { recursive: true, force: true });
75728
+ fs51.rmSync(value, { recursive: true, force: true });
75638
75729
  } catch (error2) {
75639
75730
  if (error2.code !== "ENOENT") {
75640
75731
  throw error2;
@@ -75643,7 +75734,7 @@ function removePathEntry(value) {
75643
75734
  }
75644
75735
  function listLocalSkills(sourceDir) {
75645
75736
  try {
75646
- return fs50.readdirSync(sourceDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
75737
+ return fs51.readdirSync(sourceDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
75647
75738
  } catch {
75648
75739
  return [];
75649
75740
  }
@@ -75659,7 +75750,7 @@ function createDownloadError(status) {
75659
75750
  }
75660
75751
  function pathExists(value) {
75661
75752
  try {
75662
- fs50.lstatSync(value);
75753
+ fs51.lstatSync(value);
75663
75754
  return true;
75664
75755
  } catch {
75665
75756
  return false;
@@ -75676,7 +75767,7 @@ function hasControlCharacter(value) {
75676
75767
  }
75677
75768
 
75678
75769
  // src/maker/cli/commands.ts
75679
- var VERSION4 = true ? "0.0.34-beta.7" : "dev";
75770
+ var VERSION4 = true ? "0.0.34" : "dev";
75680
75771
  var DEFAULT_MCP_NAME = "taptap-maker";
75681
75772
  var MAKER_NPM_PACKAGE = "@taptap/maker";
75682
75773
  var TWO_PART_COMMANDS = /* @__PURE__ */ new Set([
@@ -75907,7 +75998,7 @@ function toOptionKey(value) {
75907
75998
  }
75908
75999
  async function runInit(parsed, ctx) {
75909
76000
  rejectPackageOption(parsed);
75910
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
76001
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
75911
76002
  const env = makerEnvOption(parsed);
75912
76003
  const skipConfirm = booleanOption(parsed, "skip_confirm");
75913
76004
  const skipMcpInstall = booleanOption(parsed, "skip_mcp_install");
@@ -76024,7 +76115,7 @@ async function runInit(parsed, ctx) {
76024
76115
  }
76025
76116
  async function runDoctor(parsed, ctx) {
76026
76117
  var _a3, _b;
76027
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
76118
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
76028
76119
  const env = makerEnvOption(parsed);
76029
76120
  const git2 = checkGitEnvironment();
76030
76121
  const python = checkMakerPythonEnvironment();
@@ -76115,8 +76206,8 @@ async function runDoctor(parsed, ctx) {
76115
76206
  );
76116
76207
  }
76117
76208
  function inspectMakerDoctorExecutionContext(options3) {
76118
- const doctorCwd = path53.resolve(process.cwd());
76119
- const makerProjectDir = options3.makerProjectDir ? path53.resolve(options3.makerProjectDir) : void 0;
76209
+ const doctorCwd = path54.resolve(process.cwd());
76210
+ const makerProjectDir = options3.makerProjectDir ? path54.resolve(options3.makerProjectDir) : void 0;
76120
76211
  if (!makerProjectDir) {
76121
76212
  return {
76122
76213
  active_client_session: "not_checked",
@@ -76151,9 +76242,9 @@ function samePath2(left, right) {
76151
76242
  return normalizePathForCompare3(left) === normalizePathForCompare3(right);
76152
76243
  }
76153
76244
  function normalizePathForCompare3(value) {
76154
- const resolved = path53.resolve(value);
76245
+ const resolved = path54.resolve(value);
76155
76246
  try {
76156
- return fs51.realpathSync.native(resolved);
76247
+ return fs52.realpathSync.native(resolved);
76157
76248
  } catch {
76158
76249
  return resolved;
76159
76250
  }
@@ -76471,7 +76562,7 @@ async function runPatSet(parsed, ctx) {
76471
76562
  }
76472
76563
  async function resolvePatSet(parsed, ctx) {
76473
76564
  if (booleanOption(parsed, "pat_stdin") || booleanOption(parsed, "pat_from_stdin")) {
76474
- const pat = fs51.readFileSync(0, "utf8").trim();
76565
+ const pat = fs52.readFileSync(0, "utf8").trim();
76475
76566
  if (!pat) {
76476
76567
  throw new Error("No PAT found on stdin.");
76477
76568
  }
@@ -76526,17 +76617,17 @@ async function prepareMcpLauncher(options3) {
76526
76617
  if (options3.mode === "self") {
76527
76618
  launcher = materializeMakerSelfLauncher({
76528
76619
  version: VERSION4,
76529
- bundleUrl: typeof __MAKER_BUNDLE_URL__ !== "undefined" ? __MAKER_BUNDLE_URL__ : pathToFileURL2(path53.resolve(process.cwd(), "dist", "maker.js")).href,
76620
+ bundleUrl: typeof __MAKER_BUNDLE_URL__ !== "undefined" ? __MAKER_BUNDLE_URL__ : pathToFileURL2(path54.resolve(process.cwd(), "dist", "maker.js")).href,
76530
76621
  makerHome: getMakerHome()
76531
76622
  });
76532
76623
  } else {
76533
76624
  const packageSpec = resolveMakerPackageSpec(MAKER_NPM_PACKAGE, VERSION4);
76534
76625
  launcher = resolveMakerMcpLauncher({ packageName: packageSpec });
76535
76626
  const configuredCache = process.env.npm_config_cache || process.env.NPM_CONFIG_CACHE;
76536
- const npmCacheDir = path53.resolve(
76537
- configuredCache || path53.join(getMakerHome(), "cache", "npm")
76627
+ const npmCacheDir = path54.resolve(
76628
+ configuredCache || path54.join(getMakerHome(), "cache", "npm")
76538
76629
  );
76539
- fs51.mkdirSync(npmCacheDir, { recursive: true });
76630
+ fs52.mkdirSync(npmCacheDir, { recursive: true });
76540
76631
  launcherEnv = { npm_config_cache: npmCacheDir };
76541
76632
  }
76542
76633
  } catch (error2) {
@@ -76669,7 +76760,7 @@ ${indent3(payload.stderr)}` : "",
76669
76760
  }
76670
76761
  async function runMcpReport(parsed, ctx) {
76671
76762
  rejectPackageOption(parsed);
76672
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
76763
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
76673
76764
  const contextInput = booleanOption(parsed, "context_stdin") ? await readStdinText() : "";
76674
76765
  const context = parseMakerMcpReportContext(contextInput);
76675
76766
  const contextValidation = validateMakerMcpReportContext(context);
@@ -76771,7 +76862,7 @@ async function runMcpReport(parsed, ctx) {
76771
76862
  );
76772
76863
  }
76773
76864
  async function runAgentsUpdate(parsed, ctx) {
76774
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
76865
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
76775
76866
  const result = updateMakerAgentsPolicy(targetDir);
76776
76867
  if (ctx.json) {
76777
76868
  writeJson(result);
@@ -76790,7 +76881,7 @@ async function runAgentsUpdate(parsed, ctx) {
76790
76881
  async function runUpgrade(parsed, ctx) {
76791
76882
  rejectPackageOption(parsed);
76792
76883
  const explicitTargetDir = stringOption(parsed, "target_dir");
76793
- const targetDir = path53.resolve(explicitTargetDir || process.cwd());
76884
+ const targetDir = path54.resolve(explicitTargetDir || process.cwd());
76794
76885
  const env = makerEnvOption(parsed);
76795
76886
  const ides = parseIdeList(stringOption(parsed, "ide") || stringOption(parsed, "ides") || "");
76796
76887
  const pluginDistribution = resolveMakerPluginDistribution();
@@ -76879,7 +76970,7 @@ function getMcpVerifyNextSteps(mode, commandText) {
76879
76970
  ];
76880
76971
  }
76881
76972
  async function runDevKitUpdate(parsed, ctx) {
76882
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
76973
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
76883
76974
  const result = await installAiDevKit({
76884
76975
  targetDir,
76885
76976
  preserveExisting: false,
@@ -76893,7 +76984,7 @@ async function runDevKitUpdate(parsed, ctx) {
76893
76984
  }
76894
76985
  async function runUserSkillsPull(parsed, ctx) {
76895
76986
  const result = await pullMakerUserSkills({
76896
- targetDir: path53.resolve(stringOption(parsed, "target_dir") || process.cwd()),
76987
+ targetDir: path54.resolve(stringOption(parsed, "target_dir") || process.cwd()),
76897
76988
  environment: makerEnvOption(parsed)
76898
76989
  });
76899
76990
  if (ctx.json) {
@@ -76912,7 +77003,7 @@ async function runUserSkillsPull(parsed, ctx) {
76912
77003
  );
76913
77004
  }
76914
77005
  async function runLogsWatch(parsed, ctx) {
76915
- const targetDir = path53.resolve(stringOption(parsed, "target_dir") || process.cwd());
77006
+ const targetDir = path54.resolve(stringOption(parsed, "target_dir") || process.cwd());
76916
77007
  const intervalMs = parseDurationMs(stringOption(parsed, "interval") || "5s");
76917
77008
  const timeoutMs = numberOption(parsed, "timeout_ms") ?? MAKER_TOOL_CALL_TIMEOUT_MS;
76918
77009
  const maxPolls = numberOption(parsed, "max_polls");
@@ -76922,9 +77013,9 @@ async function runLogsWatch(parsed, ctx) {
76922
77013
  serverUrl: stringOption(parsed, "server_url"),
76923
77014
  env: makerEnvOption(parsed)
76924
77015
  });
76925
- const runtimeDir = path53.join(proxy.projectRoot, ".maker", "logs", "runtime");
76926
- const runtimeLog = path53.join(runtimeDir, "runtime.log");
76927
- const pidFile = path53.join(runtimeDir, "watcher.pid");
77016
+ const runtimeDir = path54.join(proxy.projectRoot, ".maker", "logs", "runtime");
77017
+ const runtimeLog = path54.join(runtimeDir, "runtime.log");
77018
+ const pidFile = path54.join(runtimeDir, "watcher.pid");
76928
77019
  const replacedWatcher = registerRuntimeLogWatcherProcess(pidFile);
76929
77020
  const runtimeLogClient = createRemoteRuntimeLogClient(proxy, timeoutMs);
76930
77021
  emit(ctx, "logs_watch_start", "Maker runtime log watcher started", {
@@ -76969,10 +77060,10 @@ async function runLogsWatch(parsed, ctx) {
76969
77060
  }
76970
77061
  }
76971
77062
  function registerRuntimeLogWatcherProcess(pidFile) {
76972
- fs51.mkdirSync(path53.dirname(pidFile), { recursive: true });
77063
+ fs52.mkdirSync(path54.dirname(pidFile), { recursive: true });
76973
77064
  const existingPid = readPidFile(pidFile);
76974
77065
  const previous = existingPid && existingPid !== process.pid ? stopExistingRuntimeLogWatcher(pidFile) : {};
76975
- fs51.writeFileSync(
77066
+ fs52.writeFileSync(
76976
77067
  pidFile,
76977
77068
  `${JSON.stringify(
76978
77069
  {
@@ -76990,10 +77081,10 @@ function registerRuntimeLogWatcherProcess(pidFile) {
76990
77081
  return previous;
76991
77082
  }
76992
77083
  function readPidFile(pidFile) {
76993
- if (!fs51.existsSync(pidFile)) {
77084
+ if (!fs52.existsSync(pidFile)) {
76994
77085
  return void 0;
76995
77086
  }
76996
- const raw = fs51.readFileSync(pidFile, "utf8").trim();
77087
+ const raw = fs52.readFileSync(pidFile, "utf8").trim();
76997
77088
  let pid = Number(raw);
76998
77089
  if (!Number.isInteger(pid) || pid <= 0) {
76999
77090
  try {
@@ -77013,7 +77104,7 @@ function installRuntimeLogWatcherPidCleanup(pidFile) {
77013
77104
  }
77014
77105
  cleaned = true;
77015
77106
  if (readPidFile(pidFile) === process.pid) {
77016
- fs51.rmSync(pidFile, { force: true });
77107
+ fs52.rmSync(pidFile, { force: true });
77017
77108
  }
77018
77109
  };
77019
77110
  process.once("exit", cleanup);
@@ -77164,7 +77255,7 @@ async function prepareDevKit(targetDir, ctx, options3 = {}) {
77164
77255
  onStart: (event) => emitSkillInstallerStart(ctx, event)
77165
77256
  });
77166
77257
  writeDevKitStagedGitignore(
77167
- path53.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE),
77258
+ path54.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE),
77168
77259
  listPresentDevKitManagedEntries(targetDir)
77169
77260
  );
77170
77261
  syncWorkBuddyDevKitSkills(targetDir, ctx);
@@ -77182,7 +77273,7 @@ async function prepareDevKit(targetDir, ctx, options3 = {}) {
77182
77273
  );
77183
77274
  } catch (error2) {
77184
77275
  writeDevKitStagedGitignore(
77185
- path53.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE),
77276
+ path54.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE),
77186
77277
  listPresentDevKitManagedEntries(targetDir)
77187
77278
  );
77188
77279
  if (options3.finalizeGitignore) {
@@ -77229,10 +77320,10 @@ function syncWorkBuddyDevKitSkills(targetDir, ctx) {
77229
77320
  try {
77230
77321
  const result = syncWorkBuddyProjectSkills(targetDir);
77231
77322
  const managedSkillPaths = [...result.installedSkills, ...result.skippedSkills].map(
77232
- (skillName) => path53.join(".workbuddy", "skills", skillName)
77323
+ (skillName) => path54.join(".workbuddy", "skills", skillName)
77233
77324
  );
77234
77325
  if (managedSkillPaths.length > 0) {
77235
- writeDevKitStagedGitignore(path53.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE), [
77326
+ writeDevKitStagedGitignore(path54.join(targetDir, DEV_KIT_GITIGNORE_STAGING_FILE), [
77236
77327
  ...listPresentDevKitManagedEntries(targetDir),
77237
77328
  ...managedSkillPaths
77238
77329
  ]);
@@ -77309,12 +77400,12 @@ function installMcpConfig(ide, options3) {
77309
77400
  }
77310
77401
  function installMcpConfigUnsafe(ide, options3) {
77311
77402
  if (ide === "codex") {
77312
- const configPath = path53.join(os13.homedir(), ".codex", "config.toml");
77403
+ const configPath = path54.join(os13.homedir(), ".codex", "config.toml");
77313
77404
  const write = mergeCodexMcpConfig(configPath, withClientIde(options3, "codex"));
77314
77405
  return [createMcpInstallResult(ide, "Codex", configPath, write)];
77315
77406
  }
77316
77407
  if (ide === "cursor") {
77317
- const configPath = path53.join(os13.homedir(), ".cursor", "mcp.json");
77408
+ const configPath = path54.join(os13.homedir(), ".cursor", "mcp.json");
77318
77409
  const write = mergeJsonMcpConfig(configPath, withClientIde(options3, "cursor"));
77319
77410
  return [createMcpInstallResult(ide, "Cursor", configPath, write)];
77320
77411
  }
@@ -77331,7 +77422,7 @@ function installMcpConfigUnsafe(ide, options3) {
77331
77422
  }
77332
77423
  ];
77333
77424
  }
77334
- const configPath = path53.join(os13.homedir(), ".claude.json");
77425
+ const configPath = path54.join(os13.homedir(), ".claude.json");
77335
77426
  const write = mergeJsonMcpConfig(configPath, claudeOptions);
77336
77427
  return [createMcpInstallResult(ide, "Claude fallback", configPath, write)];
77337
77428
  }
@@ -77345,7 +77436,7 @@ function installMcpConfigUnsafe(ide, options3) {
77345
77436
  }
77346
77437
  if (ide === "opencode") {
77347
77438
  const configPath = getOpenCodeMcpConfigPath();
77348
- if (!fs51.existsSync(configPath)) {
77439
+ if (!fs52.existsSync(configPath)) {
77349
77440
  return [{ ide, ok: false, message: "Skipped OpenCode: no supported config file found" }];
77350
77441
  }
77351
77442
  const write = mergeOpenCodeMcpConfig(configPath, withClientIde(options3, "opencode"));
@@ -77428,13 +77519,13 @@ function getDefaultMcpInstallIdes() {
77428
77519
  if (getTraeMcpInstallPaths().length > 0) {
77429
77520
  ides.push("trae");
77430
77521
  }
77431
- if (fs51.existsSync(getOpenCodeMcpConfigPath())) {
77522
+ if (fs52.existsSync(getOpenCodeMcpConfigPath())) {
77432
77523
  ides.push("opencode");
77433
77524
  }
77434
77525
  if (getWorkBuddyMcpInstallPaths().length > 0) {
77435
77526
  ides.push("workbuddy");
77436
77527
  }
77437
- if (fs51.existsSync(getDshHome())) {
77528
+ if (fs52.existsSync(getDshHome())) {
77438
77529
  ides.push("dsh");
77439
77530
  }
77440
77531
  return ides;
@@ -77448,7 +77539,7 @@ function getExistingTraeUserConfigPaths(paths) {
77448
77539
  const seen = /* @__PURE__ */ new Set();
77449
77540
  return paths.filter((configPath) => {
77450
77541
  const key = normalizeConfigPathKey(configPath);
77451
- if (seen.has(key) || !fs51.existsSync(path53.dirname(configPath))) {
77542
+ if (seen.has(key) || !fs52.existsSync(path54.dirname(configPath))) {
77452
77543
  return false;
77453
77544
  }
77454
77545
  seen.add(key);
@@ -77459,7 +77550,7 @@ function getExistingConfigPaths(paths) {
77459
77550
  const seen = /* @__PURE__ */ new Set();
77460
77551
  return paths.filter((configPath) => {
77461
77552
  const key = normalizeConfigPathKey(configPath);
77462
- if (seen.has(key) || !fs51.existsSync(configPath)) {
77553
+ if (seen.has(key) || !fs52.existsSync(configPath)) {
77463
77554
  return false;
77464
77555
  }
77465
77556
  seen.add(key);
@@ -77467,62 +77558,62 @@ function getExistingConfigPaths(paths) {
77467
77558
  });
77468
77559
  }
77469
77560
  function normalizeConfigPathKey(configPath) {
77470
- const resolved = path53.resolve(configPath);
77561
+ const resolved = path54.resolve(configPath);
77471
77562
  return process.platform === "win32" || process.platform === "darwin" ? resolved.toLowerCase() : resolved;
77472
77563
  }
77473
77564
  function getTraeSoloMcpConfigPaths() {
77474
77565
  if (process.platform === "win32") {
77475
- const roaming = process.env.APPDATA || path53.join(os13.homedir(), "AppData", "Roaming");
77566
+ const roaming = process.env.APPDATA || path54.join(os13.homedir(), "AppData", "Roaming");
77476
77567
  return [
77477
- path53.join(roaming, "TRAE SOLO", "User", "mcp.json"),
77478
- path53.join(roaming, "TRAE SOLO CN", "User", "mcp.json")
77568
+ path54.join(roaming, "TRAE SOLO", "User", "mcp.json"),
77569
+ path54.join(roaming, "TRAE SOLO CN", "User", "mcp.json")
77479
77570
  ];
77480
77571
  }
77481
- const appSupport = path53.join(os13.homedir(), "Library", "Application Support");
77572
+ const appSupport = path54.join(os13.homedir(), "Library", "Application Support");
77482
77573
  return [
77483
- path53.join(appSupport, "TRAE SOLO CN", "User", "mcp.json"),
77484
- path53.join(appSupport, "TRAE SOLO", "User", "mcp.json")
77574
+ path54.join(appSupport, "TRAE SOLO CN", "User", "mcp.json"),
77575
+ path54.join(appSupport, "TRAE SOLO", "User", "mcp.json")
77485
77576
  ];
77486
77577
  }
77487
77578
  function getTraeUnverifiedMcpConfigPaths() {
77488
77579
  if (process.platform === "win32") {
77489
- const roaming = process.env.APPDATA || path53.join(os13.homedir(), "AppData", "Roaming");
77580
+ const roaming = process.env.APPDATA || path54.join(os13.homedir(), "AppData", "Roaming");
77490
77581
  return [
77491
- path53.join(roaming, "Trae", "User", "mcp.json"),
77492
- path53.join(roaming, "TRAE", "User", "mcp.json"),
77493
- path53.join(roaming, "Trae CN", "User", "mcp.json")
77582
+ path54.join(roaming, "Trae", "User", "mcp.json"),
77583
+ path54.join(roaming, "TRAE", "User", "mcp.json"),
77584
+ path54.join(roaming, "Trae CN", "User", "mcp.json")
77494
77585
  ];
77495
77586
  }
77496
- const appSupport = path53.join(os13.homedir(), "Library", "Application Support");
77587
+ const appSupport = path54.join(os13.homedir(), "Library", "Application Support");
77497
77588
  return [
77498
- path53.join(appSupport, "Trae", "User", "mcp.json"),
77499
- path53.join(appSupport, "TRAE", "User", "mcp.json"),
77500
- path53.join(appSupport, "Trae CN", "User", "mcp.json")
77589
+ path54.join(appSupport, "Trae", "User", "mcp.json"),
77590
+ path54.join(appSupport, "TRAE", "User", "mcp.json"),
77591
+ path54.join(appSupport, "Trae CN", "User", "mcp.json")
77501
77592
  ];
77502
77593
  }
77503
77594
  function getOpenCodeMcpConfigPath() {
77504
- return path53.join(os13.homedir(), ".config", "opencode", "opencode.jsonc");
77595
+ return path54.join(os13.homedir(), ".config", "opencode", "opencode.jsonc");
77505
77596
  }
77506
77597
  function getWorkBuddyHome() {
77507
- return path53.join(os13.homedir(), ".workbuddy");
77598
+ return path54.join(os13.homedir(), ".workbuddy");
77508
77599
  }
77509
77600
  function getWorkBuddyMcpInstallPaths(options3 = {}) {
77510
- const primary = path53.join(getWorkBuddyHome(), "mcp.json");
77511
- if (fs51.existsSync(primary) || options3.createPrimary) {
77601
+ const primary = path54.join(getWorkBuddyHome(), "mcp.json");
77602
+ if (fs52.existsSync(primary) || options3.createPrimary) {
77512
77603
  return [primary];
77513
77604
  }
77514
- const legacy = path53.join(getWorkBuddyHome(), ".mcp.json");
77515
- if (fs51.existsSync(legacy)) {
77605
+ const legacy = path54.join(getWorkBuddyHome(), ".mcp.json");
77606
+ if (fs52.existsSync(legacy)) {
77516
77607
  return [legacy];
77517
77608
  }
77518
77609
  return [];
77519
77610
  }
77520
77611
  function inspectWorkBuddyTrustState(mcpName) {
77521
77612
  const workbuddyHome = getWorkBuddyHome();
77522
- const connectorsDir = path53.join(workbuddyHome, "connectors");
77613
+ const connectorsDir = path54.join(workbuddyHome, "connectors");
77523
77614
  const accounts = [];
77524
77615
  const stateFiles = [];
77525
- if (!fs51.existsSync(connectorsDir)) {
77616
+ if (!fs52.existsSync(connectorsDir)) {
77526
77617
  return {
77527
77618
  status: "not_found",
77528
77619
  mcp_name: mcpName,
@@ -77532,12 +77623,12 @@ function inspectWorkBuddyTrustState(mcpName) {
77532
77623
  accounts
77533
77624
  };
77534
77625
  }
77535
- for (const entry of fs51.readdirSync(connectorsDir, { withFileTypes: true })) {
77626
+ for (const entry of fs52.readdirSync(connectorsDir, { withFileTypes: true })) {
77536
77627
  if (!entry.isDirectory()) {
77537
77628
  continue;
77538
77629
  }
77539
- const statePath = path53.join(connectorsDir, entry.name, "connector-states.json");
77540
- if (!fs51.existsSync(statePath)) {
77630
+ const statePath = path54.join(connectorsDir, entry.name, "connector-states.json");
77631
+ if (!fs52.existsSync(statePath)) {
77541
77632
  continue;
77542
77633
  }
77543
77634
  stateFiles.push(statePath);
@@ -77616,7 +77707,7 @@ function mergeJsonMcpConfig(configPath, options3) {
77616
77707
  );
77617
77708
  }
77618
77709
  function mergeOpenCodeMcpConfig(configPath, options3) {
77619
- const rawContent = fs51.readFileSync(configPath, "utf8");
77710
+ const rawContent = fs52.readFileSync(configPath, "utf8");
77620
77711
  const rewroteJsonc = normalizeJsonConfigContent(rawContent, { jsonc: true }) !== rawContent;
77621
77712
  const existing = readJsonObject(configPath, { jsonc: true });
77622
77713
  const mcp = asObject(existing.mcp);
@@ -77648,7 +77739,7 @@ function mergeOpenCodeMcpConfig(configPath, options3) {
77648
77739
  return { ...write, rewroteJsonc: write.changed && rewroteJsonc };
77649
77740
  }
77650
77741
  function mergeCodexMcpConfig(configPath, options3) {
77651
- const existing = fs51.existsSync(configPath) ? fs51.readFileSync(configPath, "utf8") : "";
77742
+ const existing = fs52.existsSync(configPath) ? fs52.readFileSync(configPath, "utf8") : "";
77652
77743
  const withoutOld = removeCodexMcpTables(existing, options3.mcpName).trimEnd();
77653
77744
  const launch = options3.launcher;
77654
77745
  const envValues = createMcpEnvironmentValues(options3.env, options3.clientIde, options3.launcherEnv);
@@ -77682,7 +77773,7 @@ function mergeCodexMcpConfig(configPath, options3) {
77682
77773
  );
77683
77774
  }
77684
77775
  function tryClaudeMcpAdd(options3) {
77685
- const configPath = path53.join(os13.homedir(), ".claude.json");
77776
+ const configPath = path54.join(os13.homedir(), ".claude.json");
77686
77777
  try {
77687
77778
  const existing = readJsonObject(configPath);
77688
77779
  const server = asObject(asObject(existing.mcpServers)[options3.mcpName]);
@@ -77775,10 +77866,10 @@ function rejectPackageOption(parsed) {
77775
77866
  }
77776
77867
  }
77777
77868
  function readJsonObject(filePath, options3 = {}) {
77778
- if (!fs51.existsSync(filePath)) {
77869
+ if (!fs52.existsSync(filePath)) {
77779
77870
  return {};
77780
77871
  }
77781
- const raw = fs51.readFileSync(filePath, "utf8");
77872
+ const raw = fs52.readFileSync(filePath, "utf8");
77782
77873
  try {
77783
77874
  const normalized = normalizeJsonConfigContent(raw, options3);
77784
77875
  const parsed = JSON.parse(normalized);
@@ -77950,10 +78041,10 @@ function formatMcpInstallMessage(label, configPath, write) {
77950
78041
  ].filter(Boolean).join("\n");
77951
78042
  }
77952
78043
  function saveInitState(targetDir, state) {
77953
- fs51.mkdirSync(getMakerHome(), { recursive: true });
77954
- const key = crypto5.createHash("sha256").update(path53.resolve(targetDir)).digest("hex").slice(0, 16);
77955
- fs51.writeFileSync(
77956
- path53.join(getMakerHome(), `init-state-${key}.json`),
78044
+ fs52.mkdirSync(getMakerHome(), { recursive: true });
78045
+ const key = crypto5.createHash("sha256").update(path54.resolve(targetDir)).digest("hex").slice(0, 16);
78046
+ fs52.writeFileSync(
78047
+ path54.join(getMakerHome(), `init-state-${key}.json`),
77957
78048
  `${JSON.stringify({ ...state, updated_at: (/* @__PURE__ */ new Date()).toISOString() }, null, 2)}
77958
78049
  `,
77959
78050
  "utf8"
@@ -78101,7 +78192,7 @@ function makerEnvOption(parsed) {
78101
78192
  return env;
78102
78193
  }
78103
78194
  const targetDir = stringOption(parsed, "target_dir");
78104
- return getMakerEnvironment(void 0, targetDir ? path53.resolve(targetDir) : process.cwd());
78195
+ return getMakerEnvironment(void 0, targetDir ? path54.resolve(targetDir) : process.cwd());
78105
78196
  }
78106
78197
  function makerMcpConfigEnvOption(parsed) {
78107
78198
  return stringOption(parsed, "env") === "rnd" ? "rnd" : "production";
@@ -79804,7 +79895,7 @@ var StreamableHTTPClientTransport = class {
79804
79895
 
79805
79896
  // src/mcp-proxy/proxy.ts
79806
79897
  init_types2();
79807
- import * as path55 from "node:path";
79898
+ import * as path56 from "node:path";
79808
79899
  import * as crypto8 from "node:crypto";
79809
79900
 
79810
79901
  // src/mcp-proxy/cookieJar.ts
@@ -80000,8 +80091,8 @@ function isStandaloneSseRequest(input2, init) {
80000
80091
  }
80001
80092
 
80002
80093
  // src/core/utils/logWriter.ts
80003
- import * as fs52 from "node:fs";
80004
- import * as path54 from "node:path";
80094
+ import * as fs53 from "node:fs";
80095
+ import * as path55 from "node:path";
80005
80096
  import * as crypto7 from "node:crypto";
80006
80097
 
80007
80098
  // src/core/types/log.ts
@@ -80042,7 +80133,7 @@ var LogWriter = class {
80042
80133
  return;
80043
80134
  }
80044
80135
  try {
80045
- await fs52.promises.mkdir(this.config.logDir, { recursive: true });
80136
+ await fs53.promises.mkdir(this.config.logDir, { recursive: true });
80046
80137
  await this.cleanupOldLogs();
80047
80138
  this.initialized = true;
80048
80139
  } catch (error2) {
@@ -80065,7 +80156,7 @@ var LogWriter = class {
80065
80156
  */
80066
80157
  getLogFilePath(date5) {
80067
80158
  const d = date5 || this.getCurrentDate();
80068
- return path54.join(this.config.logDir, `${this.config.prefix}-${d}.log`);
80159
+ return path55.join(this.config.logDir, `${this.config.prefix}-${d}.log`);
80069
80160
  }
80070
80161
  /**
80071
80162
  * 获取或创建写入流
@@ -80080,7 +80171,7 @@ var LogWriter = class {
80080
80171
  }
80081
80172
  this.currentDate = date5;
80082
80173
  try {
80083
- this.writeStream = fs52.createWriteStream(this.getLogFilePath(date5), {
80174
+ this.writeStream = fs53.createWriteStream(this.getLogFilePath(date5), {
80084
80175
  flags: "a",
80085
80176
  encoding: "utf8"
80086
80177
  });
@@ -80132,11 +80223,11 @@ var LogWriter = class {
80132
80223
  if (this.shouldWriteToFile(level) && this.initialized && this.config.enabled) {
80133
80224
  try {
80134
80225
  const filePath = this.getLogFilePath();
80135
- const dir = path54.dirname(filePath);
80136
- if (!fs52.existsSync(dir)) {
80137
- fs52.mkdirSync(dir, { recursive: true });
80226
+ const dir = path55.dirname(filePath);
80227
+ if (!fs53.existsSync(dir)) {
80228
+ fs53.mkdirSync(dir, { recursive: true });
80138
80229
  }
80139
- fs52.appendFileSync(filePath, message, "utf8");
80230
+ fs53.appendFileSync(filePath, message, "utf8");
80140
80231
  } catch {
80141
80232
  }
80142
80233
  }
@@ -80147,7 +80238,7 @@ var LogWriter = class {
80147
80238
  async cleanupOldLogs() {
80148
80239
  if (this.config.maxDays <= 0) return;
80149
80240
  try {
80150
- const files = await fs52.promises.readdir(this.config.logDir);
80241
+ const files = await fs53.promises.readdir(this.config.logDir);
80151
80242
  const cutoffDate = /* @__PURE__ */ new Date();
80152
80243
  cutoffDate.setDate(cutoffDate.getDate() - this.config.maxDays);
80153
80244
  const prefix = this.config.prefix;
@@ -80162,7 +80253,7 @@ var LogWriter = class {
80162
80253
  if (!Number.isNaN(year) && !Number.isNaN(month) && !Number.isNaN(day)) {
80163
80254
  const fileDate = new Date(year, month - 1, day);
80164
80255
  if (fileDate < cutoffDate) {
80165
- await fs52.promises.unlink(path54.join(this.config.logDir, file3));
80256
+ await fs53.promises.unlink(path55.join(this.config.logDir, file3));
80166
80257
  process.stderr.write(`[LogWriter] Deleted old log: ${file3}
80167
80258
  `);
80168
80259
  }
@@ -80296,10 +80387,10 @@ var TapTapMCPProxy = class {
80296
80387
  const { user_id, project_id } = this.config.tenant;
80297
80388
  let logDir;
80298
80389
  if (user_id && project_id) {
80299
- logDir = path55.join(logRoot, "proxy", user_id, project_id);
80390
+ logDir = path56.join(logRoot, "proxy", user_id, project_id);
80300
80391
  } else {
80301
80392
  const kidHash = crypto8.createHash("sha256").update(this.config.auth.kid).digest("hex").substring(0, 8);
80302
- logDir = path55.join(logRoot, "proxy", kidHash);
80393
+ logDir = path56.join(logRoot, "proxy", kidHash);
80303
80394
  }
80304
80395
  return new LogWriter({
80305
80396
  logDir,