@taptap/maker 0.0.35 → 0.0.36
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.
|
|
3
|
+
// TapTap Maker MCP version: 0.0.36
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
const require = createRequire(import.meta.url);
|
|
6
6
|
const __MAKER_BUNDLE_URL__ = import.meta.url;
|
|
@@ -28541,690 +28541,6 @@ var init_client2 = __esm({
|
|
|
28541
28541
|
}
|
|
28542
28542
|
});
|
|
28543
28543
|
|
|
28544
|
-
// node_modules/isexe/windows.js
|
|
28545
|
-
var require_windows = __commonJS({
|
|
28546
|
-
"node_modules/isexe/windows.js"(exports, module) {
|
|
28547
|
-
module.exports = isexe;
|
|
28548
|
-
isexe.sync = sync;
|
|
28549
|
-
var fs56 = __require("fs");
|
|
28550
|
-
function checkPathExt(path59, options3) {
|
|
28551
|
-
var pathext = options3.pathExt !== void 0 ? options3.pathExt : process.env.PATHEXT;
|
|
28552
|
-
if (!pathext) {
|
|
28553
|
-
return true;
|
|
28554
|
-
}
|
|
28555
|
-
pathext = pathext.split(";");
|
|
28556
|
-
if (pathext.indexOf("") !== -1) {
|
|
28557
|
-
return true;
|
|
28558
|
-
}
|
|
28559
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
28560
|
-
var p = pathext[i].toLowerCase();
|
|
28561
|
-
if (p && path59.substr(-p.length).toLowerCase() === p) {
|
|
28562
|
-
return true;
|
|
28563
|
-
}
|
|
28564
|
-
}
|
|
28565
|
-
return false;
|
|
28566
|
-
}
|
|
28567
|
-
function checkStat(stat, path59, options3) {
|
|
28568
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
28569
|
-
return false;
|
|
28570
|
-
}
|
|
28571
|
-
return checkPathExt(path59, options3);
|
|
28572
|
-
}
|
|
28573
|
-
function isexe(path59, options3, cb) {
|
|
28574
|
-
fs56.stat(path59, function(er, stat) {
|
|
28575
|
-
cb(er, er ? false : checkStat(stat, path59, options3));
|
|
28576
|
-
});
|
|
28577
|
-
}
|
|
28578
|
-
function sync(path59, options3) {
|
|
28579
|
-
return checkStat(fs56.statSync(path59), path59, options3);
|
|
28580
|
-
}
|
|
28581
|
-
}
|
|
28582
|
-
});
|
|
28583
|
-
|
|
28584
|
-
// node_modules/isexe/mode.js
|
|
28585
|
-
var require_mode = __commonJS({
|
|
28586
|
-
"node_modules/isexe/mode.js"(exports, module) {
|
|
28587
|
-
module.exports = isexe;
|
|
28588
|
-
isexe.sync = sync;
|
|
28589
|
-
var fs56 = __require("fs");
|
|
28590
|
-
function isexe(path59, options3, cb) {
|
|
28591
|
-
fs56.stat(path59, function(er, stat) {
|
|
28592
|
-
cb(er, er ? false : checkStat(stat, options3));
|
|
28593
|
-
});
|
|
28594
|
-
}
|
|
28595
|
-
function sync(path59, options3) {
|
|
28596
|
-
return checkStat(fs56.statSync(path59), options3);
|
|
28597
|
-
}
|
|
28598
|
-
function checkStat(stat, options3) {
|
|
28599
|
-
return stat.isFile() && checkMode(stat, options3);
|
|
28600
|
-
}
|
|
28601
|
-
function checkMode(stat, options3) {
|
|
28602
|
-
var mod = stat.mode;
|
|
28603
|
-
var uid = stat.uid;
|
|
28604
|
-
var gid = stat.gid;
|
|
28605
|
-
var myUid = options3.uid !== void 0 ? options3.uid : process.getuid && process.getuid();
|
|
28606
|
-
var myGid = options3.gid !== void 0 ? options3.gid : process.getgid && process.getgid();
|
|
28607
|
-
var u = parseInt("100", 8);
|
|
28608
|
-
var g = parseInt("010", 8);
|
|
28609
|
-
var o = parseInt("001", 8);
|
|
28610
|
-
var ug = u | g;
|
|
28611
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
28612
|
-
return ret;
|
|
28613
|
-
}
|
|
28614
|
-
}
|
|
28615
|
-
});
|
|
28616
|
-
|
|
28617
|
-
// node_modules/isexe/index.js
|
|
28618
|
-
var require_isexe = __commonJS({
|
|
28619
|
-
"node_modules/isexe/index.js"(exports, module) {
|
|
28620
|
-
var fs56 = __require("fs");
|
|
28621
|
-
var core;
|
|
28622
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
28623
|
-
core = require_windows();
|
|
28624
|
-
} else {
|
|
28625
|
-
core = require_mode();
|
|
28626
|
-
}
|
|
28627
|
-
module.exports = isexe;
|
|
28628
|
-
isexe.sync = sync;
|
|
28629
|
-
function isexe(path59, options3, cb) {
|
|
28630
|
-
if (typeof options3 === "function") {
|
|
28631
|
-
cb = options3;
|
|
28632
|
-
options3 = {};
|
|
28633
|
-
}
|
|
28634
|
-
if (!cb) {
|
|
28635
|
-
if (typeof Promise !== "function") {
|
|
28636
|
-
throw new TypeError("callback not provided");
|
|
28637
|
-
}
|
|
28638
|
-
return new Promise(function(resolve, reject) {
|
|
28639
|
-
isexe(path59, options3 || {}, function(er, is) {
|
|
28640
|
-
if (er) {
|
|
28641
|
-
reject(er);
|
|
28642
|
-
} else {
|
|
28643
|
-
resolve(is);
|
|
28644
|
-
}
|
|
28645
|
-
});
|
|
28646
|
-
});
|
|
28647
|
-
}
|
|
28648
|
-
core(path59, options3 || {}, function(er, is) {
|
|
28649
|
-
if (er) {
|
|
28650
|
-
if (er.code === "EACCES" || options3 && options3.ignoreErrors) {
|
|
28651
|
-
er = null;
|
|
28652
|
-
is = false;
|
|
28653
|
-
}
|
|
28654
|
-
}
|
|
28655
|
-
cb(er, is);
|
|
28656
|
-
});
|
|
28657
|
-
}
|
|
28658
|
-
function sync(path59, options3) {
|
|
28659
|
-
try {
|
|
28660
|
-
return core.sync(path59, options3 || {});
|
|
28661
|
-
} catch (er) {
|
|
28662
|
-
if (options3 && options3.ignoreErrors || er.code === "EACCES") {
|
|
28663
|
-
return false;
|
|
28664
|
-
} else {
|
|
28665
|
-
throw er;
|
|
28666
|
-
}
|
|
28667
|
-
}
|
|
28668
|
-
}
|
|
28669
|
-
}
|
|
28670
|
-
});
|
|
28671
|
-
|
|
28672
|
-
// node_modules/which/which.js
|
|
28673
|
-
var require_which = __commonJS({
|
|
28674
|
-
"node_modules/which/which.js"(exports, module) {
|
|
28675
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
28676
|
-
var path59 = __require("path");
|
|
28677
|
-
var COLON = isWindows ? ";" : ":";
|
|
28678
|
-
var isexe = require_isexe();
|
|
28679
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
28680
|
-
var getPathInfo = (cmd, opt) => {
|
|
28681
|
-
const colon = opt.colon || COLON;
|
|
28682
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
28683
|
-
// windows always checks the cwd first
|
|
28684
|
-
...isWindows ? [process.cwd()] : [],
|
|
28685
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
28686
|
-
"").split(colon)
|
|
28687
|
-
];
|
|
28688
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
28689
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
28690
|
-
if (isWindows) {
|
|
28691
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
28692
|
-
pathExt.unshift("");
|
|
28693
|
-
}
|
|
28694
|
-
return {
|
|
28695
|
-
pathEnv,
|
|
28696
|
-
pathExt,
|
|
28697
|
-
pathExtExe
|
|
28698
|
-
};
|
|
28699
|
-
};
|
|
28700
|
-
var which = (cmd, opt, cb) => {
|
|
28701
|
-
if (typeof opt === "function") {
|
|
28702
|
-
cb = opt;
|
|
28703
|
-
opt = {};
|
|
28704
|
-
}
|
|
28705
|
-
if (!opt)
|
|
28706
|
-
opt = {};
|
|
28707
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
28708
|
-
const found = [];
|
|
28709
|
-
const step = (i) => new Promise((resolve, reject) => {
|
|
28710
|
-
if (i === pathEnv.length)
|
|
28711
|
-
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
28712
|
-
const ppRaw = pathEnv[i];
|
|
28713
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
28714
|
-
const pCmd = path59.join(pathPart, cmd);
|
|
28715
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
28716
|
-
resolve(subStep(p, i, 0));
|
|
28717
|
-
});
|
|
28718
|
-
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
28719
|
-
if (ii === pathExt.length)
|
|
28720
|
-
return resolve(step(i + 1));
|
|
28721
|
-
const ext = pathExt[ii];
|
|
28722
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
28723
|
-
if (!er && is) {
|
|
28724
|
-
if (opt.all)
|
|
28725
|
-
found.push(p + ext);
|
|
28726
|
-
else
|
|
28727
|
-
return resolve(p + ext);
|
|
28728
|
-
}
|
|
28729
|
-
return resolve(subStep(p, i, ii + 1));
|
|
28730
|
-
});
|
|
28731
|
-
});
|
|
28732
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
28733
|
-
};
|
|
28734
|
-
var whichSync = (cmd, opt) => {
|
|
28735
|
-
opt = opt || {};
|
|
28736
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
28737
|
-
const found = [];
|
|
28738
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
28739
|
-
const ppRaw = pathEnv[i];
|
|
28740
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
28741
|
-
const pCmd = path59.join(pathPart, cmd);
|
|
28742
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
28743
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
28744
|
-
const cur = p + pathExt[j];
|
|
28745
|
-
try {
|
|
28746
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
28747
|
-
if (is) {
|
|
28748
|
-
if (opt.all)
|
|
28749
|
-
found.push(cur);
|
|
28750
|
-
else
|
|
28751
|
-
return cur;
|
|
28752
|
-
}
|
|
28753
|
-
} catch (ex) {
|
|
28754
|
-
}
|
|
28755
|
-
}
|
|
28756
|
-
}
|
|
28757
|
-
if (opt.all && found.length)
|
|
28758
|
-
return found;
|
|
28759
|
-
if (opt.nothrow)
|
|
28760
|
-
return null;
|
|
28761
|
-
throw getNotFoundError(cmd);
|
|
28762
|
-
};
|
|
28763
|
-
module.exports = which;
|
|
28764
|
-
which.sync = whichSync;
|
|
28765
|
-
}
|
|
28766
|
-
});
|
|
28767
|
-
|
|
28768
|
-
// node_modules/path-key/index.js
|
|
28769
|
-
var require_path_key = __commonJS({
|
|
28770
|
-
"node_modules/path-key/index.js"(exports, module) {
|
|
28771
|
-
"use strict";
|
|
28772
|
-
var pathKey = (options3 = {}) => {
|
|
28773
|
-
const environment = options3.env || process.env;
|
|
28774
|
-
const platform = options3.platform || process.platform;
|
|
28775
|
-
if (platform !== "win32") {
|
|
28776
|
-
return "PATH";
|
|
28777
|
-
}
|
|
28778
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
28779
|
-
};
|
|
28780
|
-
module.exports = pathKey;
|
|
28781
|
-
module.exports.default = pathKey;
|
|
28782
|
-
}
|
|
28783
|
-
});
|
|
28784
|
-
|
|
28785
|
-
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
28786
|
-
var require_resolveCommand = __commonJS({
|
|
28787
|
-
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
28788
|
-
"use strict";
|
|
28789
|
-
var path59 = __require("path");
|
|
28790
|
-
var which = require_which();
|
|
28791
|
-
var getPathKey = require_path_key();
|
|
28792
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
28793
|
-
const env = parsed.options.env || process.env;
|
|
28794
|
-
const cwd = process.cwd();
|
|
28795
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
28796
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
28797
|
-
if (shouldSwitchCwd) {
|
|
28798
|
-
try {
|
|
28799
|
-
process.chdir(parsed.options.cwd);
|
|
28800
|
-
} catch (err) {
|
|
28801
|
-
}
|
|
28802
|
-
}
|
|
28803
|
-
let resolved;
|
|
28804
|
-
try {
|
|
28805
|
-
resolved = which.sync(parsed.command, {
|
|
28806
|
-
path: env[getPathKey({ env })],
|
|
28807
|
-
pathExt: withoutPathExt ? path59.delimiter : void 0
|
|
28808
|
-
});
|
|
28809
|
-
} catch (e) {
|
|
28810
|
-
} finally {
|
|
28811
|
-
if (shouldSwitchCwd) {
|
|
28812
|
-
process.chdir(cwd);
|
|
28813
|
-
}
|
|
28814
|
-
}
|
|
28815
|
-
if (resolved) {
|
|
28816
|
-
resolved = path59.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
28817
|
-
}
|
|
28818
|
-
return resolved;
|
|
28819
|
-
}
|
|
28820
|
-
function resolveCommand(parsed) {
|
|
28821
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
28822
|
-
}
|
|
28823
|
-
module.exports = resolveCommand;
|
|
28824
|
-
}
|
|
28825
|
-
});
|
|
28826
|
-
|
|
28827
|
-
// node_modules/cross-spawn/lib/util/escape.js
|
|
28828
|
-
var require_escape = __commonJS({
|
|
28829
|
-
"node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
28830
|
-
"use strict";
|
|
28831
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
28832
|
-
function escapeCommand(arg) {
|
|
28833
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
28834
|
-
return arg;
|
|
28835
|
-
}
|
|
28836
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
28837
|
-
arg = `${arg}`;
|
|
28838
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
28839
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
28840
|
-
arg = `"${arg}"`;
|
|
28841
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
28842
|
-
if (doubleEscapeMetaChars) {
|
|
28843
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
28844
|
-
}
|
|
28845
|
-
return arg;
|
|
28846
|
-
}
|
|
28847
|
-
module.exports.command = escapeCommand;
|
|
28848
|
-
module.exports.argument = escapeArgument;
|
|
28849
|
-
}
|
|
28850
|
-
});
|
|
28851
|
-
|
|
28852
|
-
// node_modules/shebang-regex/index.js
|
|
28853
|
-
var require_shebang_regex = __commonJS({
|
|
28854
|
-
"node_modules/shebang-regex/index.js"(exports, module) {
|
|
28855
|
-
"use strict";
|
|
28856
|
-
module.exports = /^#!(.*)/;
|
|
28857
|
-
}
|
|
28858
|
-
});
|
|
28859
|
-
|
|
28860
|
-
// node_modules/shebang-command/index.js
|
|
28861
|
-
var require_shebang_command = __commonJS({
|
|
28862
|
-
"node_modules/shebang-command/index.js"(exports, module) {
|
|
28863
|
-
"use strict";
|
|
28864
|
-
var shebangRegex = require_shebang_regex();
|
|
28865
|
-
module.exports = (string4 = "") => {
|
|
28866
|
-
const match = string4.match(shebangRegex);
|
|
28867
|
-
if (!match) {
|
|
28868
|
-
return null;
|
|
28869
|
-
}
|
|
28870
|
-
const [path59, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
28871
|
-
const binary = path59.split("/").pop();
|
|
28872
|
-
if (binary === "env") {
|
|
28873
|
-
return argument;
|
|
28874
|
-
}
|
|
28875
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
28876
|
-
};
|
|
28877
|
-
}
|
|
28878
|
-
});
|
|
28879
|
-
|
|
28880
|
-
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
28881
|
-
var require_readShebang = __commonJS({
|
|
28882
|
-
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
28883
|
-
"use strict";
|
|
28884
|
-
var fs56 = __require("fs");
|
|
28885
|
-
var shebangCommand = require_shebang_command();
|
|
28886
|
-
function readShebang(command) {
|
|
28887
|
-
const size = 150;
|
|
28888
|
-
const buffer = Buffer.alloc(size);
|
|
28889
|
-
let fd;
|
|
28890
|
-
try {
|
|
28891
|
-
fd = fs56.openSync(command, "r");
|
|
28892
|
-
fs56.readSync(fd, buffer, 0, size, 0);
|
|
28893
|
-
fs56.closeSync(fd);
|
|
28894
|
-
} catch (e) {
|
|
28895
|
-
}
|
|
28896
|
-
return shebangCommand(buffer.toString());
|
|
28897
|
-
}
|
|
28898
|
-
module.exports = readShebang;
|
|
28899
|
-
}
|
|
28900
|
-
});
|
|
28901
|
-
|
|
28902
|
-
// node_modules/cross-spawn/lib/parse.js
|
|
28903
|
-
var require_parse = __commonJS({
|
|
28904
|
-
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
28905
|
-
"use strict";
|
|
28906
|
-
var path59 = __require("path");
|
|
28907
|
-
var resolveCommand = require_resolveCommand();
|
|
28908
|
-
var escape3 = require_escape();
|
|
28909
|
-
var readShebang = require_readShebang();
|
|
28910
|
-
var isWin = process.platform === "win32";
|
|
28911
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
28912
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
28913
|
-
function detectShebang(parsed) {
|
|
28914
|
-
parsed.file = resolveCommand(parsed);
|
|
28915
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
28916
|
-
if (shebang) {
|
|
28917
|
-
parsed.args.unshift(parsed.file);
|
|
28918
|
-
parsed.command = shebang;
|
|
28919
|
-
return resolveCommand(parsed);
|
|
28920
|
-
}
|
|
28921
|
-
return parsed.file;
|
|
28922
|
-
}
|
|
28923
|
-
function parseNonShell(parsed) {
|
|
28924
|
-
if (!isWin) {
|
|
28925
|
-
return parsed;
|
|
28926
|
-
}
|
|
28927
|
-
const commandFile = detectShebang(parsed);
|
|
28928
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
28929
|
-
if (parsed.options.forceShell || needsShell) {
|
|
28930
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
28931
|
-
parsed.command = path59.normalize(parsed.command);
|
|
28932
|
-
parsed.command = escape3.command(parsed.command);
|
|
28933
|
-
parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
|
|
28934
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
28935
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
28936
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
28937
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
28938
|
-
}
|
|
28939
|
-
return parsed;
|
|
28940
|
-
}
|
|
28941
|
-
function parse4(command, args, options3) {
|
|
28942
|
-
if (args && !Array.isArray(args)) {
|
|
28943
|
-
options3 = args;
|
|
28944
|
-
args = null;
|
|
28945
|
-
}
|
|
28946
|
-
args = args ? args.slice(0) : [];
|
|
28947
|
-
options3 = Object.assign({}, options3);
|
|
28948
|
-
const parsed = {
|
|
28949
|
-
command,
|
|
28950
|
-
args,
|
|
28951
|
-
options: options3,
|
|
28952
|
-
file: void 0,
|
|
28953
|
-
original: {
|
|
28954
|
-
command,
|
|
28955
|
-
args
|
|
28956
|
-
}
|
|
28957
|
-
};
|
|
28958
|
-
return options3.shell ? parsed : parseNonShell(parsed);
|
|
28959
|
-
}
|
|
28960
|
-
module.exports = parse4;
|
|
28961
|
-
}
|
|
28962
|
-
});
|
|
28963
|
-
|
|
28964
|
-
// node_modules/cross-spawn/lib/enoent.js
|
|
28965
|
-
var require_enoent = __commonJS({
|
|
28966
|
-
"node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
28967
|
-
"use strict";
|
|
28968
|
-
var isWin = process.platform === "win32";
|
|
28969
|
-
function notFoundError(original, syscall) {
|
|
28970
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
28971
|
-
code: "ENOENT",
|
|
28972
|
-
errno: "ENOENT",
|
|
28973
|
-
syscall: `${syscall} ${original.command}`,
|
|
28974
|
-
path: original.command,
|
|
28975
|
-
spawnargs: original.args
|
|
28976
|
-
});
|
|
28977
|
-
}
|
|
28978
|
-
function hookChildProcess(cp, parsed) {
|
|
28979
|
-
if (!isWin) {
|
|
28980
|
-
return;
|
|
28981
|
-
}
|
|
28982
|
-
const originalEmit = cp.emit;
|
|
28983
|
-
cp.emit = function(name, arg1) {
|
|
28984
|
-
if (name === "exit") {
|
|
28985
|
-
const err = verifyENOENT(arg1, parsed);
|
|
28986
|
-
if (err) {
|
|
28987
|
-
return originalEmit.call(cp, "error", err);
|
|
28988
|
-
}
|
|
28989
|
-
}
|
|
28990
|
-
return originalEmit.apply(cp, arguments);
|
|
28991
|
-
};
|
|
28992
|
-
}
|
|
28993
|
-
function verifyENOENT(status, parsed) {
|
|
28994
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
28995
|
-
return notFoundError(parsed.original, "spawn");
|
|
28996
|
-
}
|
|
28997
|
-
return null;
|
|
28998
|
-
}
|
|
28999
|
-
function verifyENOENTSync(status, parsed) {
|
|
29000
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
29001
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
29002
|
-
}
|
|
29003
|
-
return null;
|
|
29004
|
-
}
|
|
29005
|
-
module.exports = {
|
|
29006
|
-
hookChildProcess,
|
|
29007
|
-
verifyENOENT,
|
|
29008
|
-
verifyENOENTSync,
|
|
29009
|
-
notFoundError
|
|
29010
|
-
};
|
|
29011
|
-
}
|
|
29012
|
-
});
|
|
29013
|
-
|
|
29014
|
-
// node_modules/cross-spawn/index.js
|
|
29015
|
-
var require_cross_spawn = __commonJS({
|
|
29016
|
-
"node_modules/cross-spawn/index.js"(exports, module) {
|
|
29017
|
-
"use strict";
|
|
29018
|
-
var cp = __require("child_process");
|
|
29019
|
-
var parse4 = require_parse();
|
|
29020
|
-
var enoent = require_enoent();
|
|
29021
|
-
function spawn12(command, args, options3) {
|
|
29022
|
-
const parsed = parse4(command, args, options3);
|
|
29023
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
29024
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
29025
|
-
return spawned;
|
|
29026
|
-
}
|
|
29027
|
-
function spawnSync10(command, args, options3) {
|
|
29028
|
-
const parsed = parse4(command, args, options3);
|
|
29029
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
29030
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
29031
|
-
return result;
|
|
29032
|
-
}
|
|
29033
|
-
module.exports = spawn12;
|
|
29034
|
-
module.exports.spawn = spawn12;
|
|
29035
|
-
module.exports.sync = spawnSync10;
|
|
29036
|
-
module.exports._parse = parse4;
|
|
29037
|
-
module.exports._enoent = enoent;
|
|
29038
|
-
}
|
|
29039
|
-
});
|
|
29040
|
-
|
|
29041
|
-
// node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
|
|
29042
|
-
import process4 from "node:process";
|
|
29043
|
-
import { PassThrough } from "node:stream";
|
|
29044
|
-
function getDefaultEnvironment() {
|
|
29045
|
-
const env = {};
|
|
29046
|
-
for (const key of DEFAULT_INHERITED_ENV_VARS) {
|
|
29047
|
-
const value = process4.env[key];
|
|
29048
|
-
if (value === void 0) {
|
|
29049
|
-
continue;
|
|
29050
|
-
}
|
|
29051
|
-
if (value.startsWith("()")) {
|
|
29052
|
-
continue;
|
|
29053
|
-
}
|
|
29054
|
-
env[key] = value;
|
|
29055
|
-
}
|
|
29056
|
-
return env;
|
|
29057
|
-
}
|
|
29058
|
-
function isElectron() {
|
|
29059
|
-
return "type" in process4;
|
|
29060
|
-
}
|
|
29061
|
-
var import_cross_spawn, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
|
|
29062
|
-
var init_stdio3 = __esm({
|
|
29063
|
-
"node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js"() {
|
|
29064
|
-
import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
29065
|
-
init_stdio();
|
|
29066
|
-
DEFAULT_INHERITED_ENV_VARS = process4.platform === "win32" ? [
|
|
29067
|
-
"APPDATA",
|
|
29068
|
-
"HOMEDRIVE",
|
|
29069
|
-
"HOMEPATH",
|
|
29070
|
-
"LOCALAPPDATA",
|
|
29071
|
-
"PATH",
|
|
29072
|
-
"PROCESSOR_ARCHITECTURE",
|
|
29073
|
-
"SYSTEMDRIVE",
|
|
29074
|
-
"SYSTEMROOT",
|
|
29075
|
-
"TEMP",
|
|
29076
|
-
"USERNAME",
|
|
29077
|
-
"USERPROFILE",
|
|
29078
|
-
"PROGRAMFILES"
|
|
29079
|
-
] : (
|
|
29080
|
-
/* list inspired by the default env inheritance of sudo */
|
|
29081
|
-
["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]
|
|
29082
|
-
);
|
|
29083
|
-
StdioClientTransport = class {
|
|
29084
|
-
constructor(server) {
|
|
29085
|
-
this._readBuffer = new ReadBuffer();
|
|
29086
|
-
this._stderrStream = null;
|
|
29087
|
-
this._serverParams = server;
|
|
29088
|
-
if (server.stderr === "pipe" || server.stderr === "overlapped") {
|
|
29089
|
-
this._stderrStream = new PassThrough();
|
|
29090
|
-
}
|
|
29091
|
-
}
|
|
29092
|
-
/**
|
|
29093
|
-
* Starts the server process and prepares to communicate with it.
|
|
29094
|
-
*/
|
|
29095
|
-
async start() {
|
|
29096
|
-
if (this._process) {
|
|
29097
|
-
throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
29098
|
-
}
|
|
29099
|
-
return new Promise((resolve, reject) => {
|
|
29100
|
-
var _a3, _b, _c;
|
|
29101
|
-
this._process = (0, import_cross_spawn.default)(this._serverParams.command, this._serverParams.args ?? [], {
|
|
29102
|
-
// merge default env with server env because mcp server needs some env vars
|
|
29103
|
-
env: {
|
|
29104
|
-
...getDefaultEnvironment(),
|
|
29105
|
-
...this._serverParams.env
|
|
29106
|
-
},
|
|
29107
|
-
stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
|
|
29108
|
-
shell: false,
|
|
29109
|
-
windowsHide: process4.platform === "win32" && isElectron(),
|
|
29110
|
-
cwd: this._serverParams.cwd
|
|
29111
|
-
});
|
|
29112
|
-
this._process.on("error", (error2) => {
|
|
29113
|
-
var _a4;
|
|
29114
|
-
reject(error2);
|
|
29115
|
-
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
29116
|
-
});
|
|
29117
|
-
this._process.on("spawn", () => {
|
|
29118
|
-
resolve();
|
|
29119
|
-
});
|
|
29120
|
-
this._process.on("close", (_code) => {
|
|
29121
|
-
var _a4;
|
|
29122
|
-
this._process = void 0;
|
|
29123
|
-
(_a4 = this.onclose) == null ? void 0 : _a4.call(this);
|
|
29124
|
-
});
|
|
29125
|
-
(_a3 = this._process.stdin) == null ? void 0 : _a3.on("error", (error2) => {
|
|
29126
|
-
var _a4;
|
|
29127
|
-
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
29128
|
-
});
|
|
29129
|
-
(_b = this._process.stdout) == null ? void 0 : _b.on("data", (chunk) => {
|
|
29130
|
-
this._readBuffer.append(chunk);
|
|
29131
|
-
this.processReadBuffer();
|
|
29132
|
-
});
|
|
29133
|
-
(_c = this._process.stdout) == null ? void 0 : _c.on("error", (error2) => {
|
|
29134
|
-
var _a4;
|
|
29135
|
-
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
29136
|
-
});
|
|
29137
|
-
if (this._stderrStream && this._process.stderr) {
|
|
29138
|
-
this._process.stderr.pipe(this._stderrStream);
|
|
29139
|
-
}
|
|
29140
|
-
});
|
|
29141
|
-
}
|
|
29142
|
-
/**
|
|
29143
|
-
* The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped".
|
|
29144
|
-
*
|
|
29145
|
-
* If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to
|
|
29146
|
-
* attach listeners before the start method is invoked. This prevents loss of any early
|
|
29147
|
-
* error output emitted by the child process.
|
|
29148
|
-
*/
|
|
29149
|
-
get stderr() {
|
|
29150
|
-
var _a3;
|
|
29151
|
-
if (this._stderrStream) {
|
|
29152
|
-
return this._stderrStream;
|
|
29153
|
-
}
|
|
29154
|
-
return ((_a3 = this._process) == null ? void 0 : _a3.stderr) ?? null;
|
|
29155
|
-
}
|
|
29156
|
-
/**
|
|
29157
|
-
* The child process pid spawned by this transport.
|
|
29158
|
-
*
|
|
29159
|
-
* This is only available after the transport has been started.
|
|
29160
|
-
*/
|
|
29161
|
-
get pid() {
|
|
29162
|
-
var _a3;
|
|
29163
|
-
return ((_a3 = this._process) == null ? void 0 : _a3.pid) ?? null;
|
|
29164
|
-
}
|
|
29165
|
-
processReadBuffer() {
|
|
29166
|
-
var _a3, _b;
|
|
29167
|
-
while (true) {
|
|
29168
|
-
try {
|
|
29169
|
-
const message = this._readBuffer.readMessage();
|
|
29170
|
-
if (message === null) {
|
|
29171
|
-
break;
|
|
29172
|
-
}
|
|
29173
|
-
(_a3 = this.onmessage) == null ? void 0 : _a3.call(this, message);
|
|
29174
|
-
} catch (error2) {
|
|
29175
|
-
(_b = this.onerror) == null ? void 0 : _b.call(this, error2);
|
|
29176
|
-
}
|
|
29177
|
-
}
|
|
29178
|
-
}
|
|
29179
|
-
async close() {
|
|
29180
|
-
var _a3;
|
|
29181
|
-
if (this._process) {
|
|
29182
|
-
const processToClose = this._process;
|
|
29183
|
-
this._process = void 0;
|
|
29184
|
-
const closePromise = new Promise((resolve) => {
|
|
29185
|
-
processToClose.once("close", () => {
|
|
29186
|
-
resolve();
|
|
29187
|
-
});
|
|
29188
|
-
});
|
|
29189
|
-
try {
|
|
29190
|
-
(_a3 = processToClose.stdin) == null ? void 0 : _a3.end();
|
|
29191
|
-
} catch {
|
|
29192
|
-
}
|
|
29193
|
-
await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
|
|
29194
|
-
if (processToClose.exitCode === null) {
|
|
29195
|
-
try {
|
|
29196
|
-
processToClose.kill("SIGTERM");
|
|
29197
|
-
} catch {
|
|
29198
|
-
}
|
|
29199
|
-
await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
|
|
29200
|
-
}
|
|
29201
|
-
if (processToClose.exitCode === null) {
|
|
29202
|
-
try {
|
|
29203
|
-
processToClose.kill("SIGKILL");
|
|
29204
|
-
} catch {
|
|
29205
|
-
}
|
|
29206
|
-
}
|
|
29207
|
-
}
|
|
29208
|
-
this._readBuffer.clear();
|
|
29209
|
-
}
|
|
29210
|
-
send(message) {
|
|
29211
|
-
return new Promise((resolve) => {
|
|
29212
|
-
var _a3;
|
|
29213
|
-
if (!((_a3 = this._process) == null ? void 0 : _a3.stdin)) {
|
|
29214
|
-
throw new Error("Not connected");
|
|
29215
|
-
}
|
|
29216
|
-
const json2 = serializeMessage(message);
|
|
29217
|
-
if (this._process.stdin.write(json2)) {
|
|
29218
|
-
resolve();
|
|
29219
|
-
} else {
|
|
29220
|
-
this._process.stdin.once("drain", resolve);
|
|
29221
|
-
}
|
|
29222
|
-
});
|
|
29223
|
-
}
|
|
29224
|
-
};
|
|
29225
|
-
}
|
|
29226
|
-
});
|
|
29227
|
-
|
|
29228
28544
|
// src/maker/storage.ts
|
|
29229
28545
|
import fs from "node:fs";
|
|
29230
28546
|
import os from "node:os";
|
|
@@ -29398,8 +28714,8 @@ var init_identify = __esm({
|
|
|
29398
28714
|
});
|
|
29399
28715
|
|
|
29400
28716
|
// src/maker/server/hiddenStdioTransport.ts
|
|
29401
|
-
import { spawn
|
|
29402
|
-
import { PassThrough
|
|
28717
|
+
import { spawn } from "node:child_process";
|
|
28718
|
+
import { PassThrough } from "node:stream";
|
|
29403
28719
|
var HiddenStdioClientTransport;
|
|
29404
28720
|
var init_hiddenStdioTransport = __esm({
|
|
29405
28721
|
"src/maker/server/hiddenStdioTransport.ts"() {
|
|
@@ -29410,7 +28726,7 @@ var init_hiddenStdioTransport = __esm({
|
|
|
29410
28726
|
this.serverParams = serverParams;
|
|
29411
28727
|
this.abortController = new AbortController();
|
|
29412
28728
|
this.readBuffer = new ReadBuffer();
|
|
29413
|
-
this.stderrStream = serverParams.stderr === "pipe" || serverParams.stderr === "overlapped" ? new
|
|
28729
|
+
this.stderrStream = serverParams.stderr === "pipe" || serverParams.stderr === "overlapped" ? new PassThrough() : null;
|
|
29414
28730
|
}
|
|
29415
28731
|
async start() {
|
|
29416
28732
|
if (this.process) {
|
|
@@ -29418,7 +28734,7 @@ var init_hiddenStdioTransport = __esm({
|
|
|
29418
28734
|
}
|
|
29419
28735
|
await new Promise((resolve, reject) => {
|
|
29420
28736
|
var _a3, _b, _c;
|
|
29421
|
-
this.process =
|
|
28737
|
+
this.process = spawn(this.serverParams.command, this.serverParams.args ?? [], {
|
|
29422
28738
|
env: this.serverParams.env,
|
|
29423
28739
|
stdio: ["pipe", "pipe", this.serverParams.stderr ?? "inherit"],
|
|
29424
28740
|
shell: false,
|
|
@@ -29467,9 +28783,45 @@ var init_hiddenStdioTransport = __esm({
|
|
|
29467
28783
|
return ((_a3 = this.process) == null ? void 0 : _a3.pid) ?? null;
|
|
29468
28784
|
}
|
|
29469
28785
|
async close() {
|
|
29470
|
-
|
|
28786
|
+
var _a3;
|
|
28787
|
+
const child = this.process;
|
|
29471
28788
|
this.process = void 0;
|
|
29472
28789
|
this.readBuffer.clear();
|
|
28790
|
+
if (!child || child.exitCode !== null || child.signalCode !== null) {
|
|
28791
|
+
this.abortController.abort();
|
|
28792
|
+
return;
|
|
28793
|
+
}
|
|
28794
|
+
const exited = new Promise((resolve) => {
|
|
28795
|
+
child.once("close", () => resolve());
|
|
28796
|
+
});
|
|
28797
|
+
const wait = (ms) => Promise.race([
|
|
28798
|
+
exited,
|
|
28799
|
+
new Promise((resolve) => {
|
|
28800
|
+
var _a4;
|
|
28801
|
+
const timer = setTimeout(resolve, ms);
|
|
28802
|
+
(_a4 = timer.unref) == null ? void 0 : _a4.call(timer);
|
|
28803
|
+
})
|
|
28804
|
+
]);
|
|
28805
|
+
try {
|
|
28806
|
+
(_a3 = child.stdin) == null ? void 0 : _a3.end();
|
|
28807
|
+
} catch {
|
|
28808
|
+
}
|
|
28809
|
+
await wait(2e3);
|
|
28810
|
+
if (child.exitCode === null && child.signalCode === null) {
|
|
28811
|
+
try {
|
|
28812
|
+
child.kill("SIGTERM");
|
|
28813
|
+
} catch {
|
|
28814
|
+
}
|
|
28815
|
+
await wait(2e3);
|
|
28816
|
+
}
|
|
28817
|
+
if (child.exitCode === null && child.signalCode === null) {
|
|
28818
|
+
try {
|
|
28819
|
+
child.kill("SIGKILL");
|
|
28820
|
+
} catch {
|
|
28821
|
+
}
|
|
28822
|
+
await wait(2e3);
|
|
28823
|
+
}
|
|
28824
|
+
this.abortController.abort();
|
|
29473
28825
|
}
|
|
29474
28826
|
async send(message) {
|
|
29475
28827
|
var _a3;
|
|
@@ -29731,14 +29083,14 @@ var init_lifecycle = __esm({
|
|
|
29731
29083
|
// src/core/utils/env.ts
|
|
29732
29084
|
import * as path4 from "node:path";
|
|
29733
29085
|
import * as os2 from "node:os";
|
|
29734
|
-
import
|
|
29086
|
+
import process4 from "node:process";
|
|
29735
29087
|
function getEnv(newKey, defaultValue) {
|
|
29736
29088
|
const mapping = ENV_MAPPINGS.find((m) => m.new === newKey);
|
|
29737
29089
|
if (!mapping) {
|
|
29738
|
-
return
|
|
29090
|
+
return process4.env[newKey] ?? defaultValue;
|
|
29739
29091
|
}
|
|
29740
|
-
const newValue =
|
|
29741
|
-
const oldValue =
|
|
29092
|
+
const newValue = process4.env[mapping.new];
|
|
29093
|
+
const oldValue = process4.env[mapping.old];
|
|
29742
29094
|
if (newValue !== void 0) {
|
|
29743
29095
|
return newValue;
|
|
29744
29096
|
}
|
|
@@ -29873,7 +29225,7 @@ var init_env = __esm({
|
|
|
29873
29225
|
}
|
|
29874
29226
|
/** 工作区根目录 */
|
|
29875
29227
|
static get workspaceRoot() {
|
|
29876
|
-
return getEnv("TAPTAP_MCP_WORKSPACE_ROOT",
|
|
29228
|
+
return getEnv("TAPTAP_MCP_WORKSPACE_ROOT", process4.cwd());
|
|
29877
29229
|
}
|
|
29878
29230
|
// --------------------------------------------------------------------------
|
|
29879
29231
|
// 日志配置
|
|
@@ -30284,7 +29636,8 @@ function checkGitEnvironment() {
|
|
|
30284
29636
|
const command = getGitCommand();
|
|
30285
29637
|
const verifyCommand = `${command} --version`;
|
|
30286
29638
|
const result = spawnSync(command, ["--version"], {
|
|
30287
|
-
encoding: "utf8"
|
|
29639
|
+
encoding: "utf8",
|
|
29640
|
+
windowsHide: true
|
|
30288
29641
|
});
|
|
30289
29642
|
const version2 = (_a3 = result.stdout) == null ? void 0 : _a3.trim();
|
|
30290
29643
|
const error2 = ((_b = result.error) == null ? void 0 : _b.message) || (result.status && result.status !== 0 ? (_c = result.stderr) == null ? void 0 : _c.trim() : void 0);
|
|
@@ -30627,7 +29980,7 @@ function createMakerAgentsPolicyBody() {
|
|
|
30627
29980
|
" `mcp report --ide <client> --target-dir <project> --context-stdin --consent --json`.",
|
|
30628
29981
|
"- This preserves the configured package version and the absolute Windows node.exe/npm-cli.js.",
|
|
30629
29982
|
"- Only with a known exact installed version, fallback to",
|
|
30630
|
-
" `npx -y --package @taptap/maker@0.0.
|
|
29983
|
+
" `npx -y --package @taptap/maker@0.0.36 taptap-maker mcp report ...`.",
|
|
30631
29984
|
"- Never use an unversioned npm package, or assume `taptap-maker`/`npx` is globally available.",
|
|
30632
29985
|
"- Never include the complete conversation, project source, other MCP server entries, PAT/token",
|
|
30633
29986
|
" values, or full environment variables. Normalize the user home path to `~`.",
|
|
@@ -32501,7 +31854,8 @@ async function withQrcodeFastForward(cwd, remoteRef, fastForward) {
|
|
|
32501
31854
|
timeout: 15e3,
|
|
32502
31855
|
maxBuffer: 2 * 1024 * 1024,
|
|
32503
31856
|
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0", ...index2 ? { GIT_INDEX_FILE: index2 } : {} },
|
|
32504
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
31857
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
31858
|
+
windowsHide: true
|
|
32505
31859
|
});
|
|
32506
31860
|
const head = git3(["rev-parse", "HEAD"]).trim();
|
|
32507
31861
|
const remote = git3(["rev-parse", remoteRef]).trim();
|
|
@@ -32588,7 +31942,7 @@ var init_qrcodeSync = __esm({
|
|
|
32588
31942
|
});
|
|
32589
31943
|
|
|
32590
31944
|
// src/maker/cli/projects.ts
|
|
32591
|
-
import { spawn as
|
|
31945
|
+
import { spawn as spawn2, spawnSync as spawnSync3 } from "node:child_process";
|
|
32592
31946
|
import fs13 from "node:fs";
|
|
32593
31947
|
import path14 from "node:path";
|
|
32594
31948
|
function getConfiguredMakerApiBase() {
|
|
@@ -33476,9 +32830,10 @@ function nextActionForFailure(classification) {
|
|
|
33476
32830
|
function pushGit(args, cwd, onProgress) {
|
|
33477
32831
|
return new Promise((resolve, reject) => {
|
|
33478
32832
|
const gitCommand = getGitCommand();
|
|
33479
|
-
const child =
|
|
32833
|
+
const child = spawn2(gitCommand, args, {
|
|
33480
32834
|
cwd,
|
|
33481
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
32835
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
32836
|
+
windowsHide: true
|
|
33482
32837
|
});
|
|
33483
32838
|
let stdout = "";
|
|
33484
32839
|
let stderr = "";
|
|
@@ -33944,7 +33299,8 @@ async function resolveRemoteDefaultBranch(cwd) {
|
|
|
33944
33299
|
function readGitSync(args) {
|
|
33945
33300
|
const gitCommand = getGitCommand();
|
|
33946
33301
|
const result = spawnSync3(gitCommand, args, {
|
|
33947
|
-
encoding: "utf8"
|
|
33302
|
+
encoding: "utf8",
|
|
33303
|
+
windowsHide: true
|
|
33948
33304
|
});
|
|
33949
33305
|
if (result.status !== 0) {
|
|
33950
33306
|
throw new Error(result.stderr || `${gitCommand} ${args.join(" ")} failed`);
|
|
@@ -33954,9 +33310,10 @@ function readGitSync(args) {
|
|
|
33954
33310
|
function readGit(args, cwd) {
|
|
33955
33311
|
return new Promise((resolve, reject) => {
|
|
33956
33312
|
const gitCommand = getGitCommand();
|
|
33957
|
-
const child =
|
|
33313
|
+
const child = spawn2(gitCommand, args, {
|
|
33958
33314
|
cwd,
|
|
33959
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
33315
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
33316
|
+
windowsHide: true
|
|
33960
33317
|
});
|
|
33961
33318
|
let stdout = "";
|
|
33962
33319
|
let stderr = "";
|
|
@@ -34087,9 +33444,10 @@ function sleep(ms) {
|
|
|
34087
33444
|
function runGitCapture(args, options3 = {}) {
|
|
34088
33445
|
return new Promise((resolve, reject) => {
|
|
34089
33446
|
const gitCommand = getGitCommand();
|
|
34090
|
-
const child =
|
|
33447
|
+
const child = spawn2(gitCommand, args, {
|
|
34091
33448
|
cwd: options3.cwd,
|
|
34092
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
33449
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
33450
|
+
windowsHide: true
|
|
34093
33451
|
});
|
|
34094
33452
|
let stdout = "";
|
|
34095
33453
|
let stderr = "";
|
|
@@ -34120,9 +33478,10 @@ function runGitCapture(args, options3 = {}) {
|
|
|
34120
33478
|
function runGit(args, options3) {
|
|
34121
33479
|
return new Promise((resolve, reject) => {
|
|
34122
33480
|
const gitCommand = getGitCommand();
|
|
34123
|
-
const child =
|
|
33481
|
+
const child = spawn2(gitCommand, args, {
|
|
34124
33482
|
cwd: options3.cwd,
|
|
34125
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
33483
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
33484
|
+
windowsHide: true
|
|
34126
33485
|
});
|
|
34127
33486
|
let stdout = "";
|
|
34128
33487
|
let stderr = "";
|
|
@@ -34413,9 +33772,16 @@ var init_patTap = __esm({
|
|
|
34413
33772
|
});
|
|
34414
33773
|
|
|
34415
33774
|
// src/maker/system/python.ts
|
|
34416
|
-
import { spawn as
|
|
33775
|
+
import { spawn as spawn3, spawnSync as spawnSync4 } from "node:child_process";
|
|
34417
33776
|
import fs14 from "node:fs";
|
|
34418
33777
|
import path15 from "node:path";
|
|
33778
|
+
function spawnSyncHidden(command, args, options3 = {}) {
|
|
33779
|
+
return spawnSync4(command, args, {
|
|
33780
|
+
...options3,
|
|
33781
|
+
encoding: options3.encoding ?? "utf8",
|
|
33782
|
+
windowsHide: true
|
|
33783
|
+
});
|
|
33784
|
+
}
|
|
34419
33785
|
function getMakerPythonConfigPath() {
|
|
34420
33786
|
return path15.join(getMakerHome(), "python.json");
|
|
34421
33787
|
}
|
|
@@ -34430,7 +33796,7 @@ function getMakerUvPythonInstallDir() {
|
|
|
34430
33796
|
}
|
|
34431
33797
|
function checkMakerPythonEnvironment(options3 = {}) {
|
|
34432
33798
|
const platform = options3.platform || process.platform;
|
|
34433
|
-
const runner = options3.spawn ||
|
|
33799
|
+
const runner = options3.spawn || spawnSyncHidden;
|
|
34434
33800
|
const env = options3.env || process.env;
|
|
34435
33801
|
const uvPath = getMakerUvPath(platform);
|
|
34436
33802
|
const setupCommand = "taptap-maker python setup";
|
|
@@ -34517,7 +33883,7 @@ function setupMakerPythonEnvironment(options3 = {}) {
|
|
|
34517
33883
|
return { changed: false, environment: before, uvInstalled: before.uv.installed };
|
|
34518
33884
|
}
|
|
34519
33885
|
const platform = options3.platform || process.platform;
|
|
34520
|
-
const runner = options3.spawn ||
|
|
33886
|
+
const runner = options3.spawn || spawnSyncHidden;
|
|
34521
33887
|
try {
|
|
34522
33888
|
const uvPath = ensureUvInstalled(platform, runner);
|
|
34523
33889
|
const uvEnv = createUvPythonEnv();
|
|
@@ -34569,7 +33935,7 @@ async function runPythonCommand(command, args, signal, env = process.env, timeou
|
|
|
34569
33935
|
if (signal == null ? void 0 : signal.aborted) throw new Error("CANCELLED: Python preparation.");
|
|
34570
33936
|
return new Promise((resolve, reject) => {
|
|
34571
33937
|
const grouped = process.platform !== "win32";
|
|
34572
|
-
const child =
|
|
33938
|
+
const child = spawn3(command, args, {
|
|
34573
33939
|
env,
|
|
34574
33940
|
shell: false,
|
|
34575
33941
|
detached: grouped,
|
|
@@ -34620,7 +33986,7 @@ async function runPythonCommand(command, args, signal, env = process.env, timeou
|
|
|
34620
33986
|
unverified(reason);
|
|
34621
33987
|
} else {
|
|
34622
33988
|
cleanup = new Promise((done) => {
|
|
34623
|
-
const killer =
|
|
33989
|
+
const killer = spawn3("taskkill.exe", ["/PID", String(child.pid), "/T", "/F"], {
|
|
34624
33990
|
windowsHide: true,
|
|
34625
33991
|
shell: false,
|
|
34626
33992
|
stdio: "ignore"
|
|
@@ -35071,7 +34437,7 @@ var init_python = __esm({
|
|
|
35071
34437
|
// src/maker/system/luaLspDiagnostics.ts
|
|
35072
34438
|
async function queryMakerLuaDiagnostics(options3) {
|
|
35073
34439
|
var _a3, _b, _c, _d, _e, _f;
|
|
35074
|
-
const transport = new
|
|
34440
|
+
const transport = new HiddenStdioClientTransport({
|
|
35075
34441
|
command: options3.command,
|
|
35076
34442
|
args: [
|
|
35077
34443
|
"--mode",
|
|
@@ -35162,7 +34528,7 @@ var init_luaLspDiagnostics = __esm({
|
|
|
35162
34528
|
"src/maker/system/luaLspDiagnostics.ts"() {
|
|
35163
34529
|
"use strict";
|
|
35164
34530
|
init_client2();
|
|
35165
|
-
|
|
34531
|
+
init_hiddenStdioTransport();
|
|
35166
34532
|
}
|
|
35167
34533
|
});
|
|
35168
34534
|
|
|
@@ -35171,6 +34537,13 @@ import { spawnSync as spawnSync5 } from "node:child_process";
|
|
|
35171
34537
|
import fs15 from "node:fs";
|
|
35172
34538
|
import os4 from "node:os";
|
|
35173
34539
|
import path16 from "node:path";
|
|
34540
|
+
function spawnSyncHidden2(command, args, options3 = {}) {
|
|
34541
|
+
return spawnSync5(command, args, {
|
|
34542
|
+
...options3,
|
|
34543
|
+
encoding: options3.encoding ?? "utf8",
|
|
34544
|
+
windowsHide: true
|
|
34545
|
+
});
|
|
34546
|
+
}
|
|
35174
34547
|
function getMakerLuaLspConfigPath() {
|
|
35175
34548
|
return path16.join(getMakerHome(), "lua-lsp.json");
|
|
35176
34549
|
}
|
|
@@ -35178,7 +34551,7 @@ function getMakerLuaLspVenvDir() {
|
|
|
35178
34551
|
return path16.join(getMakerHome(), "lua-lsp-venv");
|
|
35179
34552
|
}
|
|
35180
34553
|
function checkMakerLuaLspEnvironment(options3 = {}) {
|
|
35181
|
-
const runner = options3.spawn ||
|
|
34554
|
+
const runner = options3.spawn || spawnSyncHidden2;
|
|
35182
34555
|
const python = options3.pythonEnvironment || checkMakerPythonEnvironment(options3);
|
|
35183
34556
|
const platform = options3.platform || python.platform || process.platform;
|
|
35184
34557
|
const base = createLuaLspBase(platform);
|
|
@@ -35338,7 +34711,7 @@ async function checkMakerLuaLspEnvironmentAsync(signal) {
|
|
|
35338
34711
|
};
|
|
35339
34712
|
}
|
|
35340
34713
|
function setupMakerLuaLspEnvironment(options3 = {}) {
|
|
35341
|
-
const runner = options3.spawn ||
|
|
34714
|
+
const runner = options3.spawn || spawnSyncHidden2;
|
|
35342
34715
|
const python = options3.pythonEnvironment || ensurePythonForLuaLsp(options3);
|
|
35343
34716
|
const platform = options3.platform || python.platform || process.platform;
|
|
35344
34717
|
if (!python.ready || !python.python) {
|
|
@@ -39764,145 +39137,829 @@ var init_remoteProxyToolSnapshot = __esm({
|
|
|
39764
39137
|
}
|
|
39765
39138
|
});
|
|
39766
39139
|
|
|
39767
|
-
// src/maker/proxyPolicy.ts
|
|
39768
|
-
var MAKER_TOOL_CALL_TIMEOUT_MS, MAKER_PROXY_RUNTIME_OPTIONS;
|
|
39769
|
-
var init_proxyPolicy = __esm({
|
|
39770
|
-
"src/maker/proxyPolicy.ts"() {
|
|
39140
|
+
// src/maker/proxyPolicy.ts
|
|
39141
|
+
var MAKER_TOOL_CALL_TIMEOUT_MS, MAKER_PROXY_RUNTIME_OPTIONS;
|
|
39142
|
+
var init_proxyPolicy = __esm({
|
|
39143
|
+
"src/maker/proxyPolicy.ts"() {
|
|
39144
|
+
"use strict";
|
|
39145
|
+
MAKER_TOOL_CALL_TIMEOUT_MS = 60 * 60 * 1e3;
|
|
39146
|
+
MAKER_PROXY_RUNTIME_OPTIONS = {
|
|
39147
|
+
sourceTag: "local",
|
|
39148
|
+
remoteErrorMode: "tool-result",
|
|
39149
|
+
recoveryMode: "resilient"
|
|
39150
|
+
};
|
|
39151
|
+
}
|
|
39152
|
+
});
|
|
39153
|
+
|
|
39154
|
+
// src/maker/tracking.ts
|
|
39155
|
+
function buildMakerMcpTrackingPayload(event) {
|
|
39156
|
+
var _a3, _b, _c;
|
|
39157
|
+
const userId = event.context.userId.trim();
|
|
39158
|
+
const projectId = event.context.projectId.trim();
|
|
39159
|
+
const toolName = event.toolName.trim();
|
|
39160
|
+
if (!userId || !projectId || !toolName) {
|
|
39161
|
+
return null;
|
|
39162
|
+
}
|
|
39163
|
+
const args = {
|
|
39164
|
+
user_id: userId,
|
|
39165
|
+
project_id: projectId,
|
|
39166
|
+
tool_name: toolName,
|
|
39167
|
+
source: MAKER_MCP_TRACKING_SOURCE,
|
|
39168
|
+
mcp_version: MAKER_MCP_VERSION
|
|
39169
|
+
};
|
|
39170
|
+
if (event.requestId !== void 0 && String(event.requestId).trim()) {
|
|
39171
|
+
args.tool_id = String(event.requestId);
|
|
39172
|
+
}
|
|
39173
|
+
if (event.durationMs !== void 0 && Number.isFinite(event.durationMs) && event.durationMs >= 0) {
|
|
39174
|
+
args.duration_ms = Math.round(event.durationMs);
|
|
39175
|
+
}
|
|
39176
|
+
if (event.success !== void 0) {
|
|
39177
|
+
args.success = event.success;
|
|
39178
|
+
}
|
|
39179
|
+
if ((_a3 = event.errorCode) == null ? void 0 : _a3.trim()) {
|
|
39180
|
+
args.error_code = event.errorCode.trim();
|
|
39181
|
+
}
|
|
39182
|
+
if ((_b = event.errorMessage) == null ? void 0 : _b.trim()) {
|
|
39183
|
+
args.error_message = sanitizeMakerMcpTrackingError(event.errorMessage);
|
|
39184
|
+
}
|
|
39185
|
+
return {
|
|
39186
|
+
action: MAKER_MCP_TRACKING_ACTION,
|
|
39187
|
+
...((_c = event.userAgent) == null ? void 0 : _c.trim()) ? { user_agent: event.userAgent.trim() } : {},
|
|
39188
|
+
args
|
|
39189
|
+
};
|
|
39190
|
+
}
|
|
39191
|
+
function isMakerBuildActivitySuccessful(mode) {
|
|
39192
|
+
return mode === "remote_build";
|
|
39193
|
+
}
|
|
39194
|
+
function sanitizeMakerMcpTrackingError(message) {
|
|
39195
|
+
return message.replace(/Bearer\s+[^,\s"'}<]+/gi, "<redacted>").replace(
|
|
39196
|
+
/((?:authorization|access[_-]?token|refresh[_-]?token|mac[_\s-]?key|\bpat\b|token)\s*[:=]\s*)(["']?)[^,\s"'}<]+/gi,
|
|
39197
|
+
"$1$2<redacted>"
|
|
39198
|
+
).replace(/(https?:\/\/[^:\s/@]+:)[^@\s]+@/gi, "$1<redacted>@").replace(/(https?:\/\/)[^:/\s@]+@/gi, "$1<redacted>@").trim().slice(0, TRACKING_ERROR_MAX_LENGTH);
|
|
39199
|
+
}
|
|
39200
|
+
async function reportMakerMcpActivity(event) {
|
|
39201
|
+
var _a3;
|
|
39202
|
+
const payload = buildMakerMcpTrackingPayload(event);
|
|
39203
|
+
if (!payload) {
|
|
39204
|
+
return;
|
|
39205
|
+
}
|
|
39206
|
+
const fetchImpl = event.fetchImpl || fetch;
|
|
39207
|
+
const controller = new AbortController();
|
|
39208
|
+
const timeout = setTimeout(
|
|
39209
|
+
() => controller.abort(),
|
|
39210
|
+
event.timeoutMs ?? MAKER_MCP_TRACKING_TIMEOUT_MS
|
|
39211
|
+
);
|
|
39212
|
+
try {
|
|
39213
|
+
const response = await fetchImpl(`${getMakerApiBaseUrl()}/tracking`, {
|
|
39214
|
+
method: "POST",
|
|
39215
|
+
headers: { "Content-Type": "application/json" },
|
|
39216
|
+
body: JSON.stringify(payload),
|
|
39217
|
+
signal: controller.signal
|
|
39218
|
+
});
|
|
39219
|
+
await ((_a3 = response.body) == null ? void 0 : _a3.cancel());
|
|
39220
|
+
if (!response.ok) {
|
|
39221
|
+
throw new Error(`tracking request failed with HTTP ${response.status}`);
|
|
39222
|
+
}
|
|
39223
|
+
} catch {
|
|
39224
|
+
} finally {
|
|
39225
|
+
clearTimeout(timeout);
|
|
39226
|
+
}
|
|
39227
|
+
}
|
|
39228
|
+
var MAKER_MCP_TRACKING_ACTION, MAKER_MCP_TRACKING_SOURCE, MAKER_MCP_TRACKING_TIMEOUT_MS, MAKER_MCP_VERSION, TRACKING_ERROR_MAX_LENGTH;
|
|
39229
|
+
var init_tracking = __esm({
|
|
39230
|
+
"src/maker/tracking.ts"() {
|
|
39231
|
+
"use strict";
|
|
39232
|
+
init_config();
|
|
39233
|
+
MAKER_MCP_TRACKING_ACTION = "tapmaker_mcp_call";
|
|
39234
|
+
MAKER_MCP_TRACKING_SOURCE = "local_mcp";
|
|
39235
|
+
MAKER_MCP_TRACKING_TIMEOUT_MS = 1500;
|
|
39236
|
+
MAKER_MCP_VERSION = "0.0.36".trim() ? "0.0.36".trim() : "dev";
|
|
39237
|
+
TRACKING_ERROR_MAX_LENGTH = 500;
|
|
39238
|
+
}
|
|
39239
|
+
});
|
|
39240
|
+
|
|
39241
|
+
// src/maker/server/adIntegrationGuide.ts
|
|
39242
|
+
function formatMakerAdsIntegrationGuide() {
|
|
39243
|
+
return `TapTap Maker ads integration guide
|
|
39244
|
+
|
|
39245
|
+
Workflow: confirm project -> get ad configuration -> verify remote/local configuration ->
|
|
39246
|
+
read project SDK docs -> implement ads and rewards -> real-device validation.
|
|
39247
|
+
These are consecutive steps for Maker/UrhoX, not the separate Minigame/H5 ad workflow.
|
|
39248
|
+
|
|
39249
|
+
1. Confirm the intended project directory, binding and primary configs via maker://status.
|
|
39250
|
+
If unavailable or pointing elsewhere, call maker_status_lite with explicit target_dir.
|
|
39251
|
+
Status does not bind or switch projects; pass the same target_dir to subsequent tools.
|
|
39252
|
+
2. Call get_ad_config for current activation and configuration; local files are not activation proof.
|
|
39253
|
+
Missing app_id/developer_id: call generate_test_qrcode once, then retry get_ad_config.
|
|
39254
|
+
If ad.status is not 1, show warning, ad.url and next_action; wait for user action before retrying.
|
|
39255
|
+
3. Check configuration location: synchronization reported by the remote tool concerns its workspace
|
|
39256
|
+
.project/settings.json at @runtime.ad. The local proxy does not write this result to local files.
|
|
39257
|
+
settings_path may be remote (e.g. /userspaces/...); never treat it as a local path.
|
|
39258
|
+
Request success or synced_at is not local synchronization proof; ad.status=1 is activation only.
|
|
39259
|
+
Read the intended local project's .project/settings.json and compare @runtime.ad with the
|
|
39260
|
+
returned configuration. If absent, different or unverifiable, pause ad implementation/testing
|
|
39261
|
+
and report "remote configuration obtained; local synchronization not verified" with the missing
|
|
39262
|
+
evidence. No automatic local sync is provided by this call. Do not copy another project's
|
|
39263
|
+
configuration, guess fields, overwrite settings, or pull/build to resolve this automatically.
|
|
39264
|
+
4. Once configuration is verified, read the advertising section of project-local
|
|
39265
|
+
engine-docs/recipes/sdk.md; it is the implementation source of truth, not another game's code
|
|
39266
|
+
or a web search. Use sdk:ShowRewardVideoAd; grant rewards only when result.success is true.
|
|
39267
|
+
5. Verify playback and rewards on a supported real-device environment. Local preview or activation
|
|
39268
|
+
success alone does not prove ads work.
|
|
39269
|
+
|
|
39270
|
+
Missing primary local configs: stop and report the gap; do not build automatically.
|
|
39271
|
+
Use maker_build_current_directory only for an explicit build, submit or remote Web preview request.
|
|
39272
|
+
Local window preview uses CLI and does not authorize commit or push.`;
|
|
39273
|
+
}
|
|
39274
|
+
var MAKER_ADS_INTEGRATION_GUIDE_URI;
|
|
39275
|
+
var init_adIntegrationGuide = __esm({
|
|
39276
|
+
"src/maker/server/adIntegrationGuide.ts"() {
|
|
39277
|
+
"use strict";
|
|
39278
|
+
MAKER_ADS_INTEGRATION_GUIDE_URI = "maker://ads-integration-guide";
|
|
39279
|
+
}
|
|
39280
|
+
});
|
|
39281
|
+
|
|
39282
|
+
// node_modules/isexe/windows.js
|
|
39283
|
+
var require_windows = __commonJS({
|
|
39284
|
+
"node_modules/isexe/windows.js"(exports, module) {
|
|
39285
|
+
module.exports = isexe;
|
|
39286
|
+
isexe.sync = sync;
|
|
39287
|
+
var fs56 = __require("fs");
|
|
39288
|
+
function checkPathExt(path59, options3) {
|
|
39289
|
+
var pathext = options3.pathExt !== void 0 ? options3.pathExt : process.env.PATHEXT;
|
|
39290
|
+
if (!pathext) {
|
|
39291
|
+
return true;
|
|
39292
|
+
}
|
|
39293
|
+
pathext = pathext.split(";");
|
|
39294
|
+
if (pathext.indexOf("") !== -1) {
|
|
39295
|
+
return true;
|
|
39296
|
+
}
|
|
39297
|
+
for (var i = 0; i < pathext.length; i++) {
|
|
39298
|
+
var p = pathext[i].toLowerCase();
|
|
39299
|
+
if (p && path59.substr(-p.length).toLowerCase() === p) {
|
|
39300
|
+
return true;
|
|
39301
|
+
}
|
|
39302
|
+
}
|
|
39303
|
+
return false;
|
|
39304
|
+
}
|
|
39305
|
+
function checkStat(stat, path59, options3) {
|
|
39306
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
39307
|
+
return false;
|
|
39308
|
+
}
|
|
39309
|
+
return checkPathExt(path59, options3);
|
|
39310
|
+
}
|
|
39311
|
+
function isexe(path59, options3, cb) {
|
|
39312
|
+
fs56.stat(path59, function(er, stat) {
|
|
39313
|
+
cb(er, er ? false : checkStat(stat, path59, options3));
|
|
39314
|
+
});
|
|
39315
|
+
}
|
|
39316
|
+
function sync(path59, options3) {
|
|
39317
|
+
return checkStat(fs56.statSync(path59), path59, options3);
|
|
39318
|
+
}
|
|
39319
|
+
}
|
|
39320
|
+
});
|
|
39321
|
+
|
|
39322
|
+
// node_modules/isexe/mode.js
|
|
39323
|
+
var require_mode = __commonJS({
|
|
39324
|
+
"node_modules/isexe/mode.js"(exports, module) {
|
|
39325
|
+
module.exports = isexe;
|
|
39326
|
+
isexe.sync = sync;
|
|
39327
|
+
var fs56 = __require("fs");
|
|
39328
|
+
function isexe(path59, options3, cb) {
|
|
39329
|
+
fs56.stat(path59, function(er, stat) {
|
|
39330
|
+
cb(er, er ? false : checkStat(stat, options3));
|
|
39331
|
+
});
|
|
39332
|
+
}
|
|
39333
|
+
function sync(path59, options3) {
|
|
39334
|
+
return checkStat(fs56.statSync(path59), options3);
|
|
39335
|
+
}
|
|
39336
|
+
function checkStat(stat, options3) {
|
|
39337
|
+
return stat.isFile() && checkMode(stat, options3);
|
|
39338
|
+
}
|
|
39339
|
+
function checkMode(stat, options3) {
|
|
39340
|
+
var mod = stat.mode;
|
|
39341
|
+
var uid = stat.uid;
|
|
39342
|
+
var gid = stat.gid;
|
|
39343
|
+
var myUid = options3.uid !== void 0 ? options3.uid : process.getuid && process.getuid();
|
|
39344
|
+
var myGid = options3.gid !== void 0 ? options3.gid : process.getgid && process.getgid();
|
|
39345
|
+
var u = parseInt("100", 8);
|
|
39346
|
+
var g = parseInt("010", 8);
|
|
39347
|
+
var o = parseInt("001", 8);
|
|
39348
|
+
var ug = u | g;
|
|
39349
|
+
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
39350
|
+
return ret;
|
|
39351
|
+
}
|
|
39352
|
+
}
|
|
39353
|
+
});
|
|
39354
|
+
|
|
39355
|
+
// node_modules/isexe/index.js
|
|
39356
|
+
var require_isexe = __commonJS({
|
|
39357
|
+
"node_modules/isexe/index.js"(exports, module) {
|
|
39358
|
+
var fs56 = __require("fs");
|
|
39359
|
+
var core;
|
|
39360
|
+
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
39361
|
+
core = require_windows();
|
|
39362
|
+
} else {
|
|
39363
|
+
core = require_mode();
|
|
39364
|
+
}
|
|
39365
|
+
module.exports = isexe;
|
|
39366
|
+
isexe.sync = sync;
|
|
39367
|
+
function isexe(path59, options3, cb) {
|
|
39368
|
+
if (typeof options3 === "function") {
|
|
39369
|
+
cb = options3;
|
|
39370
|
+
options3 = {};
|
|
39371
|
+
}
|
|
39372
|
+
if (!cb) {
|
|
39373
|
+
if (typeof Promise !== "function") {
|
|
39374
|
+
throw new TypeError("callback not provided");
|
|
39375
|
+
}
|
|
39376
|
+
return new Promise(function(resolve, reject) {
|
|
39377
|
+
isexe(path59, options3 || {}, function(er, is) {
|
|
39378
|
+
if (er) {
|
|
39379
|
+
reject(er);
|
|
39380
|
+
} else {
|
|
39381
|
+
resolve(is);
|
|
39382
|
+
}
|
|
39383
|
+
});
|
|
39384
|
+
});
|
|
39385
|
+
}
|
|
39386
|
+
core(path59, options3 || {}, function(er, is) {
|
|
39387
|
+
if (er) {
|
|
39388
|
+
if (er.code === "EACCES" || options3 && options3.ignoreErrors) {
|
|
39389
|
+
er = null;
|
|
39390
|
+
is = false;
|
|
39391
|
+
}
|
|
39392
|
+
}
|
|
39393
|
+
cb(er, is);
|
|
39394
|
+
});
|
|
39395
|
+
}
|
|
39396
|
+
function sync(path59, options3) {
|
|
39397
|
+
try {
|
|
39398
|
+
return core.sync(path59, options3 || {});
|
|
39399
|
+
} catch (er) {
|
|
39400
|
+
if (options3 && options3.ignoreErrors || er.code === "EACCES") {
|
|
39401
|
+
return false;
|
|
39402
|
+
} else {
|
|
39403
|
+
throw er;
|
|
39404
|
+
}
|
|
39405
|
+
}
|
|
39406
|
+
}
|
|
39407
|
+
}
|
|
39408
|
+
});
|
|
39409
|
+
|
|
39410
|
+
// node_modules/which/which.js
|
|
39411
|
+
var require_which = __commonJS({
|
|
39412
|
+
"node_modules/which/which.js"(exports, module) {
|
|
39413
|
+
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
39414
|
+
var path59 = __require("path");
|
|
39415
|
+
var COLON = isWindows ? ";" : ":";
|
|
39416
|
+
var isexe = require_isexe();
|
|
39417
|
+
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
39418
|
+
var getPathInfo = (cmd, opt) => {
|
|
39419
|
+
const colon = opt.colon || COLON;
|
|
39420
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
39421
|
+
// windows always checks the cwd first
|
|
39422
|
+
...isWindows ? [process.cwd()] : [],
|
|
39423
|
+
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
39424
|
+
"").split(colon)
|
|
39425
|
+
];
|
|
39426
|
+
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
39427
|
+
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
39428
|
+
if (isWindows) {
|
|
39429
|
+
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
39430
|
+
pathExt.unshift("");
|
|
39431
|
+
}
|
|
39432
|
+
return {
|
|
39433
|
+
pathEnv,
|
|
39434
|
+
pathExt,
|
|
39435
|
+
pathExtExe
|
|
39436
|
+
};
|
|
39437
|
+
};
|
|
39438
|
+
var which = (cmd, opt, cb) => {
|
|
39439
|
+
if (typeof opt === "function") {
|
|
39440
|
+
cb = opt;
|
|
39441
|
+
opt = {};
|
|
39442
|
+
}
|
|
39443
|
+
if (!opt)
|
|
39444
|
+
opt = {};
|
|
39445
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
39446
|
+
const found = [];
|
|
39447
|
+
const step = (i) => new Promise((resolve, reject) => {
|
|
39448
|
+
if (i === pathEnv.length)
|
|
39449
|
+
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
39450
|
+
const ppRaw = pathEnv[i];
|
|
39451
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
39452
|
+
const pCmd = path59.join(pathPart, cmd);
|
|
39453
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
39454
|
+
resolve(subStep(p, i, 0));
|
|
39455
|
+
});
|
|
39456
|
+
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
39457
|
+
if (ii === pathExt.length)
|
|
39458
|
+
return resolve(step(i + 1));
|
|
39459
|
+
const ext = pathExt[ii];
|
|
39460
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
39461
|
+
if (!er && is) {
|
|
39462
|
+
if (opt.all)
|
|
39463
|
+
found.push(p + ext);
|
|
39464
|
+
else
|
|
39465
|
+
return resolve(p + ext);
|
|
39466
|
+
}
|
|
39467
|
+
return resolve(subStep(p, i, ii + 1));
|
|
39468
|
+
});
|
|
39469
|
+
});
|
|
39470
|
+
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
39471
|
+
};
|
|
39472
|
+
var whichSync = (cmd, opt) => {
|
|
39473
|
+
opt = opt || {};
|
|
39474
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
39475
|
+
const found = [];
|
|
39476
|
+
for (let i = 0; i < pathEnv.length; i++) {
|
|
39477
|
+
const ppRaw = pathEnv[i];
|
|
39478
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
39479
|
+
const pCmd = path59.join(pathPart, cmd);
|
|
39480
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
39481
|
+
for (let j = 0; j < pathExt.length; j++) {
|
|
39482
|
+
const cur = p + pathExt[j];
|
|
39483
|
+
try {
|
|
39484
|
+
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
39485
|
+
if (is) {
|
|
39486
|
+
if (opt.all)
|
|
39487
|
+
found.push(cur);
|
|
39488
|
+
else
|
|
39489
|
+
return cur;
|
|
39490
|
+
}
|
|
39491
|
+
} catch (ex) {
|
|
39492
|
+
}
|
|
39493
|
+
}
|
|
39494
|
+
}
|
|
39495
|
+
if (opt.all && found.length)
|
|
39496
|
+
return found;
|
|
39497
|
+
if (opt.nothrow)
|
|
39498
|
+
return null;
|
|
39499
|
+
throw getNotFoundError(cmd);
|
|
39500
|
+
};
|
|
39501
|
+
module.exports = which;
|
|
39502
|
+
which.sync = whichSync;
|
|
39503
|
+
}
|
|
39504
|
+
});
|
|
39505
|
+
|
|
39506
|
+
// node_modules/path-key/index.js
|
|
39507
|
+
var require_path_key = __commonJS({
|
|
39508
|
+
"node_modules/path-key/index.js"(exports, module) {
|
|
39509
|
+
"use strict";
|
|
39510
|
+
var pathKey = (options3 = {}) => {
|
|
39511
|
+
const environment = options3.env || process.env;
|
|
39512
|
+
const platform = options3.platform || process.platform;
|
|
39513
|
+
if (platform !== "win32") {
|
|
39514
|
+
return "PATH";
|
|
39515
|
+
}
|
|
39516
|
+
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
39517
|
+
};
|
|
39518
|
+
module.exports = pathKey;
|
|
39519
|
+
module.exports.default = pathKey;
|
|
39520
|
+
}
|
|
39521
|
+
});
|
|
39522
|
+
|
|
39523
|
+
// node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
39524
|
+
var require_resolveCommand = __commonJS({
|
|
39525
|
+
"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
39526
|
+
"use strict";
|
|
39527
|
+
var path59 = __require("path");
|
|
39528
|
+
var which = require_which();
|
|
39529
|
+
var getPathKey = require_path_key();
|
|
39530
|
+
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
39531
|
+
const env = parsed.options.env || process.env;
|
|
39532
|
+
const cwd = process.cwd();
|
|
39533
|
+
const hasCustomCwd = parsed.options.cwd != null;
|
|
39534
|
+
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
39535
|
+
if (shouldSwitchCwd) {
|
|
39536
|
+
try {
|
|
39537
|
+
process.chdir(parsed.options.cwd);
|
|
39538
|
+
} catch (err) {
|
|
39539
|
+
}
|
|
39540
|
+
}
|
|
39541
|
+
let resolved;
|
|
39542
|
+
try {
|
|
39543
|
+
resolved = which.sync(parsed.command, {
|
|
39544
|
+
path: env[getPathKey({ env })],
|
|
39545
|
+
pathExt: withoutPathExt ? path59.delimiter : void 0
|
|
39546
|
+
});
|
|
39547
|
+
} catch (e) {
|
|
39548
|
+
} finally {
|
|
39549
|
+
if (shouldSwitchCwd) {
|
|
39550
|
+
process.chdir(cwd);
|
|
39551
|
+
}
|
|
39552
|
+
}
|
|
39553
|
+
if (resolved) {
|
|
39554
|
+
resolved = path59.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
39555
|
+
}
|
|
39556
|
+
return resolved;
|
|
39557
|
+
}
|
|
39558
|
+
function resolveCommand(parsed) {
|
|
39559
|
+
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
39560
|
+
}
|
|
39561
|
+
module.exports = resolveCommand;
|
|
39562
|
+
}
|
|
39563
|
+
});
|
|
39564
|
+
|
|
39565
|
+
// node_modules/cross-spawn/lib/util/escape.js
|
|
39566
|
+
var require_escape = __commonJS({
|
|
39567
|
+
"node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
39568
|
+
"use strict";
|
|
39569
|
+
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
39570
|
+
function escapeCommand(arg) {
|
|
39571
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
39572
|
+
return arg;
|
|
39573
|
+
}
|
|
39574
|
+
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
39575
|
+
arg = `${arg}`;
|
|
39576
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
39577
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
39578
|
+
arg = `"${arg}"`;
|
|
39579
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
39580
|
+
if (doubleEscapeMetaChars) {
|
|
39581
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
39582
|
+
}
|
|
39583
|
+
return arg;
|
|
39584
|
+
}
|
|
39585
|
+
module.exports.command = escapeCommand;
|
|
39586
|
+
module.exports.argument = escapeArgument;
|
|
39587
|
+
}
|
|
39588
|
+
});
|
|
39589
|
+
|
|
39590
|
+
// node_modules/shebang-regex/index.js
|
|
39591
|
+
var require_shebang_regex = __commonJS({
|
|
39592
|
+
"node_modules/shebang-regex/index.js"(exports, module) {
|
|
39771
39593
|
"use strict";
|
|
39772
|
-
|
|
39773
|
-
MAKER_PROXY_RUNTIME_OPTIONS = {
|
|
39774
|
-
sourceTag: "local",
|
|
39775
|
-
remoteErrorMode: "tool-result",
|
|
39776
|
-
recoveryMode: "resilient"
|
|
39777
|
-
};
|
|
39594
|
+
module.exports = /^#!(.*)/;
|
|
39778
39595
|
}
|
|
39779
39596
|
});
|
|
39780
39597
|
|
|
39781
|
-
//
|
|
39782
|
-
|
|
39783
|
-
|
|
39784
|
-
|
|
39785
|
-
|
|
39786
|
-
|
|
39787
|
-
|
|
39788
|
-
|
|
39789
|
-
|
|
39790
|
-
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
39794
|
-
|
|
39795
|
-
|
|
39796
|
-
|
|
39797
|
-
|
|
39798
|
-
args.tool_id = String(event.requestId);
|
|
39799
|
-
}
|
|
39800
|
-
if (event.durationMs !== void 0 && Number.isFinite(event.durationMs) && event.durationMs >= 0) {
|
|
39801
|
-
args.duration_ms = Math.round(event.durationMs);
|
|
39802
|
-
}
|
|
39803
|
-
if (event.success !== void 0) {
|
|
39804
|
-
args.success = event.success;
|
|
39805
|
-
}
|
|
39806
|
-
if ((_a3 = event.errorCode) == null ? void 0 : _a3.trim()) {
|
|
39807
|
-
args.error_code = event.errorCode.trim();
|
|
39808
|
-
}
|
|
39809
|
-
if ((_b = event.errorMessage) == null ? void 0 : _b.trim()) {
|
|
39810
|
-
args.error_message = sanitizeMakerMcpTrackingError(event.errorMessage);
|
|
39811
|
-
}
|
|
39812
|
-
return {
|
|
39813
|
-
action: MAKER_MCP_TRACKING_ACTION,
|
|
39814
|
-
...((_c = event.userAgent) == null ? void 0 : _c.trim()) ? { user_agent: event.userAgent.trim() } : {},
|
|
39815
|
-
args
|
|
39816
|
-
};
|
|
39817
|
-
}
|
|
39818
|
-
function isMakerBuildActivitySuccessful(mode) {
|
|
39819
|
-
return mode === "remote_build";
|
|
39820
|
-
}
|
|
39821
|
-
function sanitizeMakerMcpTrackingError(message) {
|
|
39822
|
-
return message.replace(/Bearer\s+[^,\s"'}<]+/gi, "<redacted>").replace(
|
|
39823
|
-
/((?:authorization|access[_-]?token|refresh[_-]?token|mac[_\s-]?key|\bpat\b|token)\s*[:=]\s*)(["']?)[^,\s"'}<]+/gi,
|
|
39824
|
-
"$1$2<redacted>"
|
|
39825
|
-
).replace(/(https?:\/\/[^:\s/@]+:)[^@\s]+@/gi, "$1<redacted>@").replace(/(https?:\/\/)[^:/\s@]+@/gi, "$1<redacted>@").trim().slice(0, TRACKING_ERROR_MAX_LENGTH);
|
|
39826
|
-
}
|
|
39827
|
-
async function reportMakerMcpActivity(event) {
|
|
39828
|
-
var _a3;
|
|
39829
|
-
const payload = buildMakerMcpTrackingPayload(event);
|
|
39830
|
-
if (!payload) {
|
|
39831
|
-
return;
|
|
39598
|
+
// node_modules/shebang-command/index.js
|
|
39599
|
+
var require_shebang_command = __commonJS({
|
|
39600
|
+
"node_modules/shebang-command/index.js"(exports, module) {
|
|
39601
|
+
"use strict";
|
|
39602
|
+
var shebangRegex = require_shebang_regex();
|
|
39603
|
+
module.exports = (string4 = "") => {
|
|
39604
|
+
const match = string4.match(shebangRegex);
|
|
39605
|
+
if (!match) {
|
|
39606
|
+
return null;
|
|
39607
|
+
}
|
|
39608
|
+
const [path59, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
39609
|
+
const binary = path59.split("/").pop();
|
|
39610
|
+
if (binary === "env") {
|
|
39611
|
+
return argument;
|
|
39612
|
+
}
|
|
39613
|
+
return argument ? `${binary} ${argument}` : binary;
|
|
39614
|
+
};
|
|
39832
39615
|
}
|
|
39833
|
-
|
|
39834
|
-
|
|
39835
|
-
|
|
39836
|
-
|
|
39837
|
-
|
|
39838
|
-
|
|
39839
|
-
|
|
39840
|
-
|
|
39841
|
-
|
|
39842
|
-
|
|
39843
|
-
|
|
39844
|
-
|
|
39845
|
-
|
|
39846
|
-
|
|
39847
|
-
|
|
39848
|
-
|
|
39616
|
+
});
|
|
39617
|
+
|
|
39618
|
+
// node_modules/cross-spawn/lib/util/readShebang.js
|
|
39619
|
+
var require_readShebang = __commonJS({
|
|
39620
|
+
"node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
|
|
39621
|
+
"use strict";
|
|
39622
|
+
var fs56 = __require("fs");
|
|
39623
|
+
var shebangCommand = require_shebang_command();
|
|
39624
|
+
function readShebang(command) {
|
|
39625
|
+
const size = 150;
|
|
39626
|
+
const buffer = Buffer.alloc(size);
|
|
39627
|
+
let fd;
|
|
39628
|
+
try {
|
|
39629
|
+
fd = fs56.openSync(command, "r");
|
|
39630
|
+
fs56.readSync(fd, buffer, 0, size, 0);
|
|
39631
|
+
fs56.closeSync(fd);
|
|
39632
|
+
} catch (e) {
|
|
39633
|
+
}
|
|
39634
|
+
return shebangCommand(buffer.toString());
|
|
39849
39635
|
}
|
|
39850
|
-
|
|
39851
|
-
} finally {
|
|
39852
|
-
clearTimeout(timeout);
|
|
39636
|
+
module.exports = readShebang;
|
|
39853
39637
|
}
|
|
39854
|
-
}
|
|
39855
|
-
|
|
39856
|
-
|
|
39857
|
-
|
|
39638
|
+
});
|
|
39639
|
+
|
|
39640
|
+
// node_modules/cross-spawn/lib/parse.js
|
|
39641
|
+
var require_parse = __commonJS({
|
|
39642
|
+
"node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
39858
39643
|
"use strict";
|
|
39859
|
-
|
|
39860
|
-
|
|
39861
|
-
|
|
39862
|
-
|
|
39863
|
-
|
|
39864
|
-
|
|
39644
|
+
var path59 = __require("path");
|
|
39645
|
+
var resolveCommand = require_resolveCommand();
|
|
39646
|
+
var escape3 = require_escape();
|
|
39647
|
+
var readShebang = require_readShebang();
|
|
39648
|
+
var isWin = process.platform === "win32";
|
|
39649
|
+
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
39650
|
+
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
39651
|
+
function detectShebang(parsed) {
|
|
39652
|
+
parsed.file = resolveCommand(parsed);
|
|
39653
|
+
const shebang = parsed.file && readShebang(parsed.file);
|
|
39654
|
+
if (shebang) {
|
|
39655
|
+
parsed.args.unshift(parsed.file);
|
|
39656
|
+
parsed.command = shebang;
|
|
39657
|
+
return resolveCommand(parsed);
|
|
39658
|
+
}
|
|
39659
|
+
return parsed.file;
|
|
39660
|
+
}
|
|
39661
|
+
function parseNonShell(parsed) {
|
|
39662
|
+
if (!isWin) {
|
|
39663
|
+
return parsed;
|
|
39664
|
+
}
|
|
39665
|
+
const commandFile = detectShebang(parsed);
|
|
39666
|
+
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
39667
|
+
if (parsed.options.forceShell || needsShell) {
|
|
39668
|
+
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
39669
|
+
parsed.command = path59.normalize(parsed.command);
|
|
39670
|
+
parsed.command = escape3.command(parsed.command);
|
|
39671
|
+
parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
|
|
39672
|
+
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
39673
|
+
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
39674
|
+
parsed.command = process.env.comspec || "cmd.exe";
|
|
39675
|
+
parsed.options.windowsVerbatimArguments = true;
|
|
39676
|
+
}
|
|
39677
|
+
return parsed;
|
|
39678
|
+
}
|
|
39679
|
+
function parse4(command, args, options3) {
|
|
39680
|
+
if (args && !Array.isArray(args)) {
|
|
39681
|
+
options3 = args;
|
|
39682
|
+
args = null;
|
|
39683
|
+
}
|
|
39684
|
+
args = args ? args.slice(0) : [];
|
|
39685
|
+
options3 = Object.assign({}, options3);
|
|
39686
|
+
const parsed = {
|
|
39687
|
+
command,
|
|
39688
|
+
args,
|
|
39689
|
+
options: options3,
|
|
39690
|
+
file: void 0,
|
|
39691
|
+
original: {
|
|
39692
|
+
command,
|
|
39693
|
+
args
|
|
39694
|
+
}
|
|
39695
|
+
};
|
|
39696
|
+
return options3.shell ? parsed : parseNonShell(parsed);
|
|
39697
|
+
}
|
|
39698
|
+
module.exports = parse4;
|
|
39865
39699
|
}
|
|
39866
39700
|
});
|
|
39867
39701
|
|
|
39868
|
-
//
|
|
39869
|
-
|
|
39870
|
-
|
|
39871
|
-
|
|
39872
|
-
|
|
39873
|
-
|
|
39874
|
-
|
|
39702
|
+
// node_modules/cross-spawn/lib/enoent.js
|
|
39703
|
+
var require_enoent = __commonJS({
|
|
39704
|
+
"node_modules/cross-spawn/lib/enoent.js"(exports, module) {
|
|
39705
|
+
"use strict";
|
|
39706
|
+
var isWin = process.platform === "win32";
|
|
39707
|
+
function notFoundError(original, syscall) {
|
|
39708
|
+
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
39709
|
+
code: "ENOENT",
|
|
39710
|
+
errno: "ENOENT",
|
|
39711
|
+
syscall: `${syscall} ${original.command}`,
|
|
39712
|
+
path: original.command,
|
|
39713
|
+
spawnargs: original.args
|
|
39714
|
+
});
|
|
39715
|
+
}
|
|
39716
|
+
function hookChildProcess(cp, parsed) {
|
|
39717
|
+
if (!isWin) {
|
|
39718
|
+
return;
|
|
39719
|
+
}
|
|
39720
|
+
const originalEmit = cp.emit;
|
|
39721
|
+
cp.emit = function(name, arg1) {
|
|
39722
|
+
if (name === "exit") {
|
|
39723
|
+
const err = verifyENOENT(arg1, parsed);
|
|
39724
|
+
if (err) {
|
|
39725
|
+
return originalEmit.call(cp, "error", err);
|
|
39726
|
+
}
|
|
39727
|
+
}
|
|
39728
|
+
return originalEmit.apply(cp, arguments);
|
|
39729
|
+
};
|
|
39730
|
+
}
|
|
39731
|
+
function verifyENOENT(status, parsed) {
|
|
39732
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
39733
|
+
return notFoundError(parsed.original, "spawn");
|
|
39734
|
+
}
|
|
39735
|
+
return null;
|
|
39736
|
+
}
|
|
39737
|
+
function verifyENOENTSync(status, parsed) {
|
|
39738
|
+
if (isWin && status === 1 && !parsed.file) {
|
|
39739
|
+
return notFoundError(parsed.original, "spawnSync");
|
|
39740
|
+
}
|
|
39741
|
+
return null;
|
|
39742
|
+
}
|
|
39743
|
+
module.exports = {
|
|
39744
|
+
hookChildProcess,
|
|
39745
|
+
verifyENOENT,
|
|
39746
|
+
verifyENOENTSync,
|
|
39747
|
+
notFoundError
|
|
39748
|
+
};
|
|
39749
|
+
}
|
|
39750
|
+
});
|
|
39875
39751
|
|
|
39876
|
-
|
|
39877
|
-
|
|
39878
|
-
|
|
39879
|
-
|
|
39880
|
-
|
|
39881
|
-
|
|
39882
|
-
|
|
39883
|
-
|
|
39884
|
-
|
|
39885
|
-
|
|
39886
|
-
|
|
39887
|
-
|
|
39888
|
-
|
|
39889
|
-
|
|
39890
|
-
|
|
39891
|
-
|
|
39892
|
-
|
|
39893
|
-
|
|
39894
|
-
|
|
39895
|
-
|
|
39752
|
+
// node_modules/cross-spawn/index.js
|
|
39753
|
+
var require_cross_spawn = __commonJS({
|
|
39754
|
+
"node_modules/cross-spawn/index.js"(exports, module) {
|
|
39755
|
+
"use strict";
|
|
39756
|
+
var cp = __require("child_process");
|
|
39757
|
+
var parse4 = require_parse();
|
|
39758
|
+
var enoent = require_enoent();
|
|
39759
|
+
function spawn12(command, args, options3) {
|
|
39760
|
+
const parsed = parse4(command, args, options3);
|
|
39761
|
+
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
39762
|
+
enoent.hookChildProcess(spawned, parsed);
|
|
39763
|
+
return spawned;
|
|
39764
|
+
}
|
|
39765
|
+
function spawnSync10(command, args, options3) {
|
|
39766
|
+
const parsed = parse4(command, args, options3);
|
|
39767
|
+
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
39768
|
+
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
39769
|
+
return result;
|
|
39770
|
+
}
|
|
39771
|
+
module.exports = spawn12;
|
|
39772
|
+
module.exports.spawn = spawn12;
|
|
39773
|
+
module.exports.sync = spawnSync10;
|
|
39774
|
+
module.exports._parse = parse4;
|
|
39775
|
+
module.exports._enoent = enoent;
|
|
39776
|
+
}
|
|
39777
|
+
});
|
|
39896
39778
|
|
|
39897
|
-
|
|
39898
|
-
|
|
39899
|
-
|
|
39779
|
+
// node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js
|
|
39780
|
+
import process5 from "node:process";
|
|
39781
|
+
import { PassThrough as PassThrough2 } from "node:stream";
|
|
39782
|
+
function getDefaultEnvironment() {
|
|
39783
|
+
const env = {};
|
|
39784
|
+
for (const key of DEFAULT_INHERITED_ENV_VARS) {
|
|
39785
|
+
const value = process5.env[key];
|
|
39786
|
+
if (value === void 0) {
|
|
39787
|
+
continue;
|
|
39788
|
+
}
|
|
39789
|
+
if (value.startsWith("()")) {
|
|
39790
|
+
continue;
|
|
39791
|
+
}
|
|
39792
|
+
env[key] = value;
|
|
39793
|
+
}
|
|
39794
|
+
return env;
|
|
39900
39795
|
}
|
|
39901
|
-
|
|
39902
|
-
|
|
39903
|
-
|
|
39904
|
-
|
|
39905
|
-
|
|
39796
|
+
function isElectron() {
|
|
39797
|
+
return "type" in process5;
|
|
39798
|
+
}
|
|
39799
|
+
var import_cross_spawn, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
|
|
39800
|
+
var init_stdio3 = __esm({
|
|
39801
|
+
"node_modules/@modelcontextprotocol/sdk/dist/esm/client/stdio.js"() {
|
|
39802
|
+
import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
39803
|
+
init_stdio();
|
|
39804
|
+
DEFAULT_INHERITED_ENV_VARS = process5.platform === "win32" ? [
|
|
39805
|
+
"APPDATA",
|
|
39806
|
+
"HOMEDRIVE",
|
|
39807
|
+
"HOMEPATH",
|
|
39808
|
+
"LOCALAPPDATA",
|
|
39809
|
+
"PATH",
|
|
39810
|
+
"PROCESSOR_ARCHITECTURE",
|
|
39811
|
+
"SYSTEMDRIVE",
|
|
39812
|
+
"SYSTEMROOT",
|
|
39813
|
+
"TEMP",
|
|
39814
|
+
"USERNAME",
|
|
39815
|
+
"USERPROFILE",
|
|
39816
|
+
"PROGRAMFILES"
|
|
39817
|
+
] : (
|
|
39818
|
+
/* list inspired by the default env inheritance of sudo */
|
|
39819
|
+
["HOME", "LOGNAME", "PATH", "SHELL", "TERM", "USER"]
|
|
39820
|
+
);
|
|
39821
|
+
StdioClientTransport = class {
|
|
39822
|
+
constructor(server) {
|
|
39823
|
+
this._readBuffer = new ReadBuffer();
|
|
39824
|
+
this._stderrStream = null;
|
|
39825
|
+
this._serverParams = server;
|
|
39826
|
+
if (server.stderr === "pipe" || server.stderr === "overlapped") {
|
|
39827
|
+
this._stderrStream = new PassThrough2();
|
|
39828
|
+
}
|
|
39829
|
+
}
|
|
39830
|
+
/**
|
|
39831
|
+
* Starts the server process and prepares to communicate with it.
|
|
39832
|
+
*/
|
|
39833
|
+
async start() {
|
|
39834
|
+
if (this._process) {
|
|
39835
|
+
throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");
|
|
39836
|
+
}
|
|
39837
|
+
return new Promise((resolve, reject) => {
|
|
39838
|
+
var _a3, _b, _c;
|
|
39839
|
+
this._process = (0, import_cross_spawn.default)(this._serverParams.command, this._serverParams.args ?? [], {
|
|
39840
|
+
// merge default env with server env because mcp server needs some env vars
|
|
39841
|
+
env: {
|
|
39842
|
+
...getDefaultEnvironment(),
|
|
39843
|
+
...this._serverParams.env
|
|
39844
|
+
},
|
|
39845
|
+
stdio: ["pipe", "pipe", this._serverParams.stderr ?? "inherit"],
|
|
39846
|
+
shell: false,
|
|
39847
|
+
windowsHide: process5.platform === "win32" && isElectron(),
|
|
39848
|
+
cwd: this._serverParams.cwd
|
|
39849
|
+
});
|
|
39850
|
+
this._process.on("error", (error2) => {
|
|
39851
|
+
var _a4;
|
|
39852
|
+
reject(error2);
|
|
39853
|
+
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
39854
|
+
});
|
|
39855
|
+
this._process.on("spawn", () => {
|
|
39856
|
+
resolve();
|
|
39857
|
+
});
|
|
39858
|
+
this._process.on("close", (_code) => {
|
|
39859
|
+
var _a4;
|
|
39860
|
+
this._process = void 0;
|
|
39861
|
+
(_a4 = this.onclose) == null ? void 0 : _a4.call(this);
|
|
39862
|
+
});
|
|
39863
|
+
(_a3 = this._process.stdin) == null ? void 0 : _a3.on("error", (error2) => {
|
|
39864
|
+
var _a4;
|
|
39865
|
+
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
39866
|
+
});
|
|
39867
|
+
(_b = this._process.stdout) == null ? void 0 : _b.on("data", (chunk) => {
|
|
39868
|
+
this._readBuffer.append(chunk);
|
|
39869
|
+
this.processReadBuffer();
|
|
39870
|
+
});
|
|
39871
|
+
(_c = this._process.stdout) == null ? void 0 : _c.on("error", (error2) => {
|
|
39872
|
+
var _a4;
|
|
39873
|
+
(_a4 = this.onerror) == null ? void 0 : _a4.call(this, error2);
|
|
39874
|
+
});
|
|
39875
|
+
if (this._stderrStream && this._process.stderr) {
|
|
39876
|
+
this._process.stderr.pipe(this._stderrStream);
|
|
39877
|
+
}
|
|
39878
|
+
});
|
|
39879
|
+
}
|
|
39880
|
+
/**
|
|
39881
|
+
* The stderr stream of the child process, if `StdioServerParameters.stderr` was set to "pipe" or "overlapped".
|
|
39882
|
+
*
|
|
39883
|
+
* If stderr piping was requested, a PassThrough stream is returned _immediately_, allowing callers to
|
|
39884
|
+
* attach listeners before the start method is invoked. This prevents loss of any early
|
|
39885
|
+
* error output emitted by the child process.
|
|
39886
|
+
*/
|
|
39887
|
+
get stderr() {
|
|
39888
|
+
var _a3;
|
|
39889
|
+
if (this._stderrStream) {
|
|
39890
|
+
return this._stderrStream;
|
|
39891
|
+
}
|
|
39892
|
+
return ((_a3 = this._process) == null ? void 0 : _a3.stderr) ?? null;
|
|
39893
|
+
}
|
|
39894
|
+
/**
|
|
39895
|
+
* The child process pid spawned by this transport.
|
|
39896
|
+
*
|
|
39897
|
+
* This is only available after the transport has been started.
|
|
39898
|
+
*/
|
|
39899
|
+
get pid() {
|
|
39900
|
+
var _a3;
|
|
39901
|
+
return ((_a3 = this._process) == null ? void 0 : _a3.pid) ?? null;
|
|
39902
|
+
}
|
|
39903
|
+
processReadBuffer() {
|
|
39904
|
+
var _a3, _b;
|
|
39905
|
+
while (true) {
|
|
39906
|
+
try {
|
|
39907
|
+
const message = this._readBuffer.readMessage();
|
|
39908
|
+
if (message === null) {
|
|
39909
|
+
break;
|
|
39910
|
+
}
|
|
39911
|
+
(_a3 = this.onmessage) == null ? void 0 : _a3.call(this, message);
|
|
39912
|
+
} catch (error2) {
|
|
39913
|
+
(_b = this.onerror) == null ? void 0 : _b.call(this, error2);
|
|
39914
|
+
}
|
|
39915
|
+
}
|
|
39916
|
+
}
|
|
39917
|
+
async close() {
|
|
39918
|
+
var _a3;
|
|
39919
|
+
if (this._process) {
|
|
39920
|
+
const processToClose = this._process;
|
|
39921
|
+
this._process = void 0;
|
|
39922
|
+
const closePromise = new Promise((resolve) => {
|
|
39923
|
+
processToClose.once("close", () => {
|
|
39924
|
+
resolve();
|
|
39925
|
+
});
|
|
39926
|
+
});
|
|
39927
|
+
try {
|
|
39928
|
+
(_a3 = processToClose.stdin) == null ? void 0 : _a3.end();
|
|
39929
|
+
} catch {
|
|
39930
|
+
}
|
|
39931
|
+
await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
|
|
39932
|
+
if (processToClose.exitCode === null) {
|
|
39933
|
+
try {
|
|
39934
|
+
processToClose.kill("SIGTERM");
|
|
39935
|
+
} catch {
|
|
39936
|
+
}
|
|
39937
|
+
await Promise.race([closePromise, new Promise((resolve) => setTimeout(resolve, 2e3).unref())]);
|
|
39938
|
+
}
|
|
39939
|
+
if (processToClose.exitCode === null) {
|
|
39940
|
+
try {
|
|
39941
|
+
processToClose.kill("SIGKILL");
|
|
39942
|
+
} catch {
|
|
39943
|
+
}
|
|
39944
|
+
}
|
|
39945
|
+
}
|
|
39946
|
+
this._readBuffer.clear();
|
|
39947
|
+
}
|
|
39948
|
+
send(message) {
|
|
39949
|
+
return new Promise((resolve) => {
|
|
39950
|
+
var _a3;
|
|
39951
|
+
if (!((_a3 = this._process) == null ? void 0 : _a3.stdin)) {
|
|
39952
|
+
throw new Error("Not connected");
|
|
39953
|
+
}
|
|
39954
|
+
const json2 = serializeMessage(message);
|
|
39955
|
+
if (this._process.stdin.write(json2)) {
|
|
39956
|
+
resolve();
|
|
39957
|
+
} else {
|
|
39958
|
+
this._process.stdin.once("drain", resolve);
|
|
39959
|
+
}
|
|
39960
|
+
});
|
|
39961
|
+
}
|
|
39962
|
+
};
|
|
39906
39963
|
}
|
|
39907
39964
|
});
|
|
39908
39965
|
|
|
@@ -40210,7 +40267,7 @@ async function listRemoteProxyTools(options3) {
|
|
|
40210
40267
|
exposedTools: MAKER_REMOTE_PROXY_EXPOSED_TOOL_NAMES
|
|
40211
40268
|
});
|
|
40212
40269
|
const transport = trackMakerChildTransport(
|
|
40213
|
-
new
|
|
40270
|
+
new HiddenStdioClientTransport({
|
|
40214
40271
|
command: proxy.command,
|
|
40215
40272
|
args: proxy.args,
|
|
40216
40273
|
env: mergeStringEnv2(process.env, proxy.envVars),
|
|
@@ -40274,7 +40331,7 @@ async function callRemoteProxyTool(options3) {
|
|
|
40274
40331
|
} : async () => {
|
|
40275
40332
|
proxy = createProxy();
|
|
40276
40333
|
const transport = trackMakerChildTransport(
|
|
40277
|
-
new
|
|
40334
|
+
new HiddenStdioClientTransport({
|
|
40278
40335
|
command: proxy.command,
|
|
40279
40336
|
args: proxy.args,
|
|
40280
40337
|
env: mergeStringEnv2(process.env, proxy.envVars),
|
|
@@ -41928,7 +41985,7 @@ async function runRemoteBuildCurrentDirectory(options3, targetDir) {
|
|
|
41928
41985
|
);
|
|
41929
41986
|
} : async () => {
|
|
41930
41987
|
const transport = trackMakerChildTransport(
|
|
41931
|
-
new
|
|
41988
|
+
new HiddenStdioClientTransport({
|
|
41932
41989
|
command: proxy.command,
|
|
41933
41990
|
args: proxy.args,
|
|
41934
41991
|
env: mergeStringEnv2(process.env, proxy.envVars),
|
|
@@ -43152,7 +43209,6 @@ var init_mcp = __esm({
|
|
|
43152
43209
|
init_stdio2();
|
|
43153
43210
|
init_types2();
|
|
43154
43211
|
init_client2();
|
|
43155
|
-
init_stdio3();
|
|
43156
43212
|
init_identify();
|
|
43157
43213
|
init_hiddenStdioTransport();
|
|
43158
43214
|
init_childTransports();
|
|
@@ -43186,7 +43242,7 @@ var init_mcp = __esm({
|
|
|
43186
43242
|
init_remoteProxyManager();
|
|
43187
43243
|
init_proxyAssets();
|
|
43188
43244
|
init_diagnosticRedaction();
|
|
43189
|
-
VERSION = true ? "0.0.
|
|
43245
|
+
VERSION = true ? "0.0.36" : "dev";
|
|
43190
43246
|
DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
43191
43247
|
DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
|
|
43192
43248
|
DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
|
|
@@ -43369,7 +43425,7 @@ var init_mcp = __esm({
|
|
|
43369
43425
|
mimeType: "text/plain"
|
|
43370
43426
|
}
|
|
43371
43427
|
];
|
|
43372
|
-
MAKER_SERVER_SHUTDOWN_TIMEOUT_MS =
|
|
43428
|
+
MAKER_SERVER_SHUTDOWN_TIMEOUT_MS = 7e3;
|
|
43373
43429
|
MakerProjectContextAmbiguousError = class extends Error {
|
|
43374
43430
|
constructor(message) {
|
|
43375
43431
|
super(message);
|
|
@@ -57959,6 +58015,7 @@ async function git(root2, args, timeout, options3) {
|
|
|
57959
58015
|
...timeout > 0 ? { timeout, killSignal: "SIGTERM" } : {},
|
|
57960
58016
|
maxBuffer: 1024 * 1024,
|
|
57961
58017
|
signal: options3.signal,
|
|
58018
|
+
windowsHide: true,
|
|
57962
58019
|
env: {
|
|
57963
58020
|
...process.env,
|
|
57964
58021
|
GIT_OPTIONAL_LOCKS: "0",
|
|
@@ -58178,6 +58235,7 @@ async function git2(root2, args, signal, timeout = 15e3) {
|
|
|
58178
58235
|
maxBuffer: 1024 * 1024,
|
|
58179
58236
|
signal,
|
|
58180
58237
|
killSignal: "SIGKILL",
|
|
58238
|
+
windowsHide: true,
|
|
58181
58239
|
env: { ...process.env, GIT_OPTIONAL_LOCKS: "0", GIT_TERMINAL_PROMPT: "0" }
|
|
58182
58240
|
}
|
|
58183
58241
|
);
|
|
@@ -63048,6 +63106,10 @@ let detail = null;
|
|
|
63048
63106
|
let preview = null;
|
|
63049
63107
|
let previewError = '';
|
|
63050
63108
|
let previewLoading = false;
|
|
63109
|
+
let previewProbeFailures = 0;
|
|
63110
|
+
const PREVIEW_PROBE_RETRY_LIMIT = 3;
|
|
63111
|
+
const settledTaskRefresh = new Set();
|
|
63112
|
+
const settledTaskPending = new Map();
|
|
63051
63113
|
const logViews = new Map();
|
|
63052
63114
|
function logView() {
|
|
63053
63115
|
if (!logViews.has(selected)) logViews.set(selected,{tab:'build',runtime:'',loading:false,wrap:false,cleared:{}});
|
|
@@ -64323,25 +64385,32 @@ function updateBuild() {
|
|
|
64323
64385
|
tasks.forEach(task => history.push(taskBlock(task)));
|
|
64324
64386
|
replace($('task-history'),history);
|
|
64325
64387
|
}
|
|
64326
|
-
async function refreshPreview() {
|
|
64388
|
+
async function refreshPreview(options = {}) {
|
|
64327
64389
|
const key = selected, epoch = selectionEpoch;
|
|
64328
64390
|
if (!key || !currentProject()?.valid) return;
|
|
64329
|
-
|
|
64330
|
-
if (
|
|
64391
|
+
const quiet = options.quiet === true;
|
|
64392
|
+
if (!quiet) previewProbeFailures = 0;
|
|
64393
|
+
if (!quiet) {
|
|
64394
|
+
previewLoading = true;
|
|
64395
|
+
if (page === 'build') updateBuild();
|
|
64396
|
+
}
|
|
64331
64397
|
try {
|
|
64332
64398
|
const result = await api(projectPath(key,'/preview'));
|
|
64333
64399
|
if (!selectionMatches(key,epoch)) return;
|
|
64334
64400
|
const changed = JSON.stringify(preview) !== JSON.stringify(result) || previewError;
|
|
64335
64401
|
preview = result; previewError = '';
|
|
64402
|
+
previewProbeFailures = 0;
|
|
64336
64403
|
if (changed && page === 'overview') renderOverview();
|
|
64337
64404
|
if (changed && page === 'build') updateBuild();
|
|
64338
64405
|
} catch (error) {
|
|
64339
64406
|
if (!selectionMatches(key,epoch)) return;
|
|
64340
|
-
|
|
64407
|
+
previewError = error.message;
|
|
64408
|
+
previewProbeFailures++;
|
|
64409
|
+
if (preview?.process_alive !== true) preview = null;
|
|
64341
64410
|
if (page === 'build') updateBuild();
|
|
64342
64411
|
if (page === 'overview') renderOverview();
|
|
64343
64412
|
} finally {
|
|
64344
|
-
if (selectionMatches(key,epoch)) {
|
|
64413
|
+
if (!quiet && selectionMatches(key,epoch)) {
|
|
64345
64414
|
previewLoading = false;
|
|
64346
64415
|
if (page === 'build') updateBuild();
|
|
64347
64416
|
}
|
|
@@ -64592,6 +64661,41 @@ function runProjectAction(action) {
|
|
|
64592
64661
|
navigate('build');
|
|
64593
64662
|
return runAction(action, {startAfterInstall:action === 'preview.install'});
|
|
64594
64663
|
}
|
|
64664
|
+
function shouldQuietProbePreview() {
|
|
64665
|
+
return previewProbeFailures < PREVIEW_PROBE_RETRY_LIMIT &&
|
|
64666
|
+
(preview?.process_alive === true || previewProbeFailures > 0);
|
|
64667
|
+
}
|
|
64668
|
+
async function refreshSettledTask(task) {
|
|
64669
|
+
const key = selected, epoch = selectionEpoch;
|
|
64670
|
+
if (task?.projectKey !== selected) {
|
|
64671
|
+
if (task) settledTaskPending.set(task.id,task);
|
|
64672
|
+
return;
|
|
64673
|
+
}
|
|
64674
|
+
if (!task || task.status === 'running' || settledTaskRefresh.has(task.id)) return;
|
|
64675
|
+
settledTaskRefresh.add(task.id);
|
|
64676
|
+
if (settledTaskRefresh.size > 100) settledTaskRefresh.delete(settledTaskRefresh.values().next().value);
|
|
64677
|
+
announce((actionLabels[task.action] || task.action) + ' · ' + text(task.projectName) + ' · ' + (statusLabels[task.status] || '结果未知'));
|
|
64678
|
+
await refreshPreview();
|
|
64679
|
+
if (!selectionMatches(key,epoch)) {
|
|
64680
|
+
settledTaskPending.set(task.id,task);
|
|
64681
|
+
settledTaskRefresh.delete(task.id);
|
|
64682
|
+
return;
|
|
64683
|
+
}
|
|
64684
|
+
if (task.action === 'build' || task.action === 'qrcode') await loadProject({preview:false});
|
|
64685
|
+
if (!selectionMatches(key,epoch)) {
|
|
64686
|
+
settledTaskPending.set(task.id,task);
|
|
64687
|
+
settledTaskRefresh.delete(task.id);
|
|
64688
|
+
return;
|
|
64689
|
+
}
|
|
64690
|
+
settledTaskPending.delete(task.id);
|
|
64691
|
+
settledTaskRefresh.delete(task.id);
|
|
64692
|
+
handleQrcodeCompletion(task);
|
|
64693
|
+
}
|
|
64694
|
+
async function refreshPendingSettledTasks(projectKey) {
|
|
64695
|
+
for (const task of [...settledTaskPending.values()]) {
|
|
64696
|
+
if (task.projectKey === projectKey) await refreshSettledTask(task);
|
|
64697
|
+
}
|
|
64698
|
+
}
|
|
64595
64699
|
async function pollTask(id,key,epoch) {
|
|
64596
64700
|
try {
|
|
64597
64701
|
const prior = tasksFor(key).find(t => t.id === id);
|
|
@@ -64603,11 +64707,7 @@ async function pollTask(id,key,epoch) {
|
|
|
64603
64707
|
if (index >= 0) state.tasks[index] = task; else state.tasks.push(task);
|
|
64604
64708
|
if (!selectionMatches(key,epoch)) return task;
|
|
64605
64709
|
updateChrome(); updateBuild();
|
|
64606
|
-
if (task.status !== 'running' && prior?.status === 'running')
|
|
64607
|
-
announce((actionLabels[task.action] || task.action) + ' · ' + text(task.projectName) + ' · ' + (statusLabels[task.status] || '结果未知'));
|
|
64608
|
-
await refreshPreview();
|
|
64609
|
-
if (selectionMatches(key,epoch)) handleQrcodeCompletion(task);
|
|
64610
|
-
}
|
|
64710
|
+
if (task.status !== 'running' && prior?.status === 'running') await refreshSettledTask(task);
|
|
64611
64711
|
showPendingIssueReport();
|
|
64612
64712
|
return task;
|
|
64613
64713
|
} catch (error) { if (selectionMatches(key,epoch)) notify(error.message); }
|
|
@@ -64747,6 +64847,7 @@ async function pullGit() {
|
|
|
64747
64847
|
if (result.outcome === 'updated') {
|
|
64748
64848
|
git = null;
|
|
64749
64849
|
void loadGit(false);
|
|
64850
|
+
void loadProject({preview:false});
|
|
64750
64851
|
}
|
|
64751
64852
|
} catch (error) {
|
|
64752
64853
|
if (selectionMatches(key,epoch) && request === gitPullRequest) {
|
|
@@ -64814,7 +64915,7 @@ function render() {
|
|
|
64814
64915
|
else if (page === 'git') renderGit();
|
|
64815
64916
|
else renderOverview();
|
|
64816
64917
|
}
|
|
64817
|
-
async function loadProject() {
|
|
64918
|
+
async function loadProject(options = {}) {
|
|
64818
64919
|
const key = selected, epoch = selectionEpoch;
|
|
64819
64920
|
try {
|
|
64820
64921
|
const result = await api(projectPath(key));
|
|
@@ -64831,7 +64932,7 @@ async function loadProject() {
|
|
|
64831
64932
|
button('重试',() => void loadProject())]);
|
|
64832
64933
|
}
|
|
64833
64934
|
}
|
|
64834
|
-
if (selectionMatches(key,epoch)) await refreshPreview();
|
|
64935
|
+
if (options.preview !== false && selectionMatches(key,epoch)) await refreshPreview();
|
|
64835
64936
|
}
|
|
64836
64937
|
async function pollState() {
|
|
64837
64938
|
const result = await api('/api/state');
|
|
@@ -64848,6 +64949,7 @@ async function pollState() {
|
|
|
64848
64949
|
page = currentProject()?.valid ? 'overview' : 'projects';
|
|
64849
64950
|
if (!selected) notify('请从项目列表选择对应的本地目录:项目未登记或有多个本地副本。','warning');
|
|
64850
64951
|
}
|
|
64952
|
+
const settled = [];
|
|
64851
64953
|
state.tasks.forEach(task => {
|
|
64852
64954
|
const prior = acceptedTasks.get(task.id);
|
|
64853
64955
|
if (prior?.status !== 'running' && task.status === 'running' && prior?.finishedAt) {
|
|
@@ -64855,8 +64957,7 @@ async function pollState() {
|
|
|
64855
64957
|
} else if (prior) rememberTask(task);
|
|
64856
64958
|
if (task.projectKey === selected && previousTasks.get(task.id) === 'running' && task.status !== 'running') {
|
|
64857
64959
|
offerIssueReport(task);
|
|
64858
|
-
|
|
64859
|
-
handleQrcodeCompletion(task);
|
|
64960
|
+
settled.push(task);
|
|
64860
64961
|
}
|
|
64861
64962
|
});
|
|
64862
64963
|
showPendingIssueReport();
|
|
@@ -64877,6 +64978,7 @@ async function pollState() {
|
|
|
64877
64978
|
if (page === 'build' && priorTasks !== JSON.stringify(tasksFor(selected))) updateBuild();
|
|
64878
64979
|
if (page === 'overview' && detail && priorLua !== JSON.stringify(state.luaLsp)) renderOverview();
|
|
64879
64980
|
}
|
|
64981
|
+
for (const task of settled) await refreshSettledTask(task);
|
|
64880
64982
|
}
|
|
64881
64983
|
async function poll() {
|
|
64882
64984
|
if (polling || document.hidden || offline || disposed) return;
|
|
@@ -64884,7 +64986,11 @@ async function poll() {
|
|
|
64884
64986
|
try {
|
|
64885
64987
|
await pollState();
|
|
64886
64988
|
if (offline || disposed) return;
|
|
64887
|
-
|
|
64989
|
+
// 首屏在状态返回后才选定项目,这里只补一次详情。之后的心跳不再读 Git。
|
|
64990
|
+
if (page === 'overview' && !detail && currentProject()?.valid) {
|
|
64991
|
+
render();
|
|
64992
|
+
await loadProject();
|
|
64993
|
+
} else if (shouldQuietProbePreview()) await refreshPreview({quiet:true});
|
|
64888
64994
|
for (const task of tasksFor(selected).filter(t => t.status === 'running')) {
|
|
64889
64995
|
if (document.hidden) break;
|
|
64890
64996
|
await pollTask(task.id,selected,selectionEpoch);
|
|
@@ -64899,6 +65005,7 @@ async function poll() {
|
|
|
64899
65005
|
}
|
|
64900
65006
|
// 子页面在这里绑定切换:清掉自己的当前数据;正打开本页时再拉取。
|
|
64901
65007
|
onProjectChange(project => {
|
|
65008
|
+
if (project?.key) void refreshPendingSettledTasks(project.key);
|
|
64902
65009
|
detail = null;
|
|
64903
65010
|
if (page === 'overview' && project?.valid) void loadProject();
|
|
64904
65011
|
});
|
|
@@ -65886,7 +65993,7 @@ var init_cli = __esm({
|
|
|
65886
65993
|
init_types3();
|
|
65887
65994
|
init_owner();
|
|
65888
65995
|
init_diagnosticRedaction();
|
|
65889
|
-
VERSION3 = false ? "dev" : "0.0.
|
|
65996
|
+
VERSION3 = false ? "dev" : "0.0.36";
|
|
65890
65997
|
CONSOLE_PROTOCOL_VERSION = 3;
|
|
65891
65998
|
}
|
|
65892
65999
|
});
|
|
@@ -77613,7 +77720,7 @@ function hasControlCharacter(value) {
|
|
|
77613
77720
|
}
|
|
77614
77721
|
|
|
77615
77722
|
// src/maker/cli/commands.ts
|
|
77616
|
-
var VERSION4 = true ? "0.0.
|
|
77723
|
+
var VERSION4 = true ? "0.0.36" : "dev";
|
|
77617
77724
|
var DEFAULT_MCP_NAME = "taptap-maker";
|
|
77618
77725
|
var MAKER_NPM_PACKAGE = "@taptap/maker";
|
|
77619
77726
|
var TWO_PART_COMMANDS = /* @__PURE__ */ new Set([
|