meshy-node 0.5.1 → 0.5.3
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/README.md +1 -1
- package/dashboard/assets/DashboardPage-pZti6jEL.js +129 -0
- package/dashboard/assets/{DashboardShared-CfKjChkE.js → DashboardShared-D7zc-yh8.js} +1 -1
- package/dashboard/assets/{DiffTab-CHex6isk.js → DiffTab-CAEFXyW_.js} +1 -1
- package/dashboard/assets/{FilesTab-BCF4QVC7.js → FilesTab-Z7ofEslt.js} +1 -1
- package/dashboard/assets/{PreviewTab-kHR8XJHu.js → PreviewTab-2MoQNLMM.js} +1 -1
- package/dashboard/assets/{SharedConversationPage-DQObdkaU.js → SharedConversationPage-ZkyofiFZ.js} +3 -3
- package/dashboard/assets/{file-CivHJbXQ.js → file-Cwm3-BLo.js} +1 -1
- package/dashboard/assets/{folder-CiTzsQ19.js → folder-BXMAsfGn.js} +1 -1
- package/dashboard/assets/index-BS822Af4.css +1 -0
- package/dashboard/assets/{index-BzTROrJe.js → index-CK-fup_F.js} +19 -19
- package/dashboard/assets/{play-Bn74sNWK.js → play-BO4AI_wC.js} +1 -1
- package/dashboard/index.html +2 -2
- package/main.cjs +126 -90
- package/package.json +1 -1
- package/runtime-metadata.json +5 -5
- package/dashboard/assets/DashboardPage-CHasRg3S.js +0 -124
- package/dashboard/assets/index-BOC8nP24.css +0 -1
package/dashboard/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Meshy Dashboard</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🕸</text></svg>" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CK-fup_F.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BS822Af4.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
package/main.cjs
CHANGED
|
@@ -2878,7 +2878,7 @@ var require_semver2 = __commonJS({
|
|
|
2878
2878
|
"../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports2, module2) {
|
|
2879
2879
|
"use strict";
|
|
2880
2880
|
var internalRe = require_re();
|
|
2881
|
-
var
|
|
2881
|
+
var constants2 = require_constants();
|
|
2882
2882
|
var SemVer = require_semver();
|
|
2883
2883
|
var identifiers = require_identifiers();
|
|
2884
2884
|
var parse = require_parse();
|
|
@@ -2960,8 +2960,8 @@ var require_semver2 = __commonJS({
|
|
|
2960
2960
|
re: internalRe.re,
|
|
2961
2961
|
src: internalRe.src,
|
|
2962
2962
|
tokens: internalRe.t,
|
|
2963
|
-
SEMVER_SPEC_VERSION:
|
|
2964
|
-
RELEASE_TYPES:
|
|
2963
|
+
SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION,
|
|
2964
|
+
RELEASE_TYPES: constants2.RELEASE_TYPES,
|
|
2965
2965
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2966
2966
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2967
2967
|
};
|
|
@@ -6629,8 +6629,8 @@ var require_node2 = __commonJS({
|
|
|
6629
6629
|
}
|
|
6630
6630
|
break;
|
|
6631
6631
|
case "FILE":
|
|
6632
|
-
var
|
|
6633
|
-
stream2 = new
|
|
6632
|
+
var fs24 = require("fs");
|
|
6633
|
+
stream2 = new fs24.SyncWriteStream(fd2, { autoClose: false });
|
|
6634
6634
|
stream2._type = "fs";
|
|
6635
6635
|
break;
|
|
6636
6636
|
case "PIPE":
|
|
@@ -23749,7 +23749,7 @@ var require_view = __commonJS({
|
|
|
23749
23749
|
"use strict";
|
|
23750
23750
|
var debug = require_src2()("express:view");
|
|
23751
23751
|
var path23 = require("path");
|
|
23752
|
-
var
|
|
23752
|
+
var fs24 = require("fs");
|
|
23753
23753
|
var dirname8 = path23.dirname;
|
|
23754
23754
|
var basename5 = path23.basename;
|
|
23755
23755
|
var extname3 = path23.extname;
|
|
@@ -23815,7 +23815,7 @@ var require_view = __commonJS({
|
|
|
23815
23815
|
function tryStat(path24) {
|
|
23816
23816
|
debug('stat "%s"', path24);
|
|
23817
23817
|
try {
|
|
23818
|
-
return
|
|
23818
|
+
return fs24.statSync(path24);
|
|
23819
23819
|
} catch (e) {
|
|
23820
23820
|
return void 0;
|
|
23821
23821
|
}
|
|
@@ -24113,7 +24113,7 @@ var require_mime = __commonJS({
|
|
|
24113
24113
|
"../../node_modules/.pnpm/mime@1.6.0/node_modules/mime/mime.js"(exports2, module2) {
|
|
24114
24114
|
"use strict";
|
|
24115
24115
|
var path23 = require("path");
|
|
24116
|
-
var
|
|
24116
|
+
var fs24 = require("fs");
|
|
24117
24117
|
function Mime() {
|
|
24118
24118
|
this.types = /* @__PURE__ */ Object.create(null);
|
|
24119
24119
|
this.extensions = /* @__PURE__ */ Object.create(null);
|
|
@@ -24134,7 +24134,7 @@ var require_mime = __commonJS({
|
|
|
24134
24134
|
};
|
|
24135
24135
|
Mime.prototype.load = function(file) {
|
|
24136
24136
|
this._loading = file;
|
|
24137
|
-
var map = {}, content =
|
|
24137
|
+
var map = {}, content = fs24.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
|
|
24138
24138
|
lines.forEach(function(line) {
|
|
24139
24139
|
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
|
|
24140
24140
|
map[fields.shift()] = fields;
|
|
@@ -24256,7 +24256,7 @@ var require_send = __commonJS({
|
|
|
24256
24256
|
var escapeHtml2 = require_escape_html();
|
|
24257
24257
|
var etag = require_etag();
|
|
24258
24258
|
var fresh = require_fresh();
|
|
24259
|
-
var
|
|
24259
|
+
var fs24 = require("fs");
|
|
24260
24260
|
var mime = require_mime();
|
|
24261
24261
|
var ms = require_ms();
|
|
24262
24262
|
var onFinished = require_on_finished();
|
|
@@ -24589,7 +24589,7 @@ var require_send = __commonJS({
|
|
|
24589
24589
|
var i = 0;
|
|
24590
24590
|
var self2 = this;
|
|
24591
24591
|
debug('stat "%s"', path24);
|
|
24592
|
-
|
|
24592
|
+
fs24.stat(path24, function onstat(err, stat) {
|
|
24593
24593
|
if (err && err.code === "ENOENT" && !extname3(path24) && path24[path24.length - 1] !== sep4) {
|
|
24594
24594
|
return next(err);
|
|
24595
24595
|
}
|
|
@@ -24604,7 +24604,7 @@ var require_send = __commonJS({
|
|
|
24604
24604
|
}
|
|
24605
24605
|
var p = path24 + "." + self2._extensions[i++];
|
|
24606
24606
|
debug('stat "%s"', p);
|
|
24607
|
-
|
|
24607
|
+
fs24.stat(p, function(err2, stat) {
|
|
24608
24608
|
if (err2) return next(err2);
|
|
24609
24609
|
if (stat.isDirectory()) return next();
|
|
24610
24610
|
self2.emit("file", p, stat);
|
|
@@ -24622,7 +24622,7 @@ var require_send = __commonJS({
|
|
|
24622
24622
|
}
|
|
24623
24623
|
var p = join17(path24, self2._index[i]);
|
|
24624
24624
|
debug('stat "%s"', p);
|
|
24625
|
-
|
|
24625
|
+
fs24.stat(p, function(err2, stat) {
|
|
24626
24626
|
if (err2) return next(err2);
|
|
24627
24627
|
if (stat.isDirectory()) return next();
|
|
24628
24628
|
self2.emit("file", p, stat);
|
|
@@ -24634,7 +24634,7 @@ var require_send = __commonJS({
|
|
|
24634
24634
|
SendStream.prototype.stream = function stream(path24, options) {
|
|
24635
24635
|
var self2 = this;
|
|
24636
24636
|
var res = this.res;
|
|
24637
|
-
var stream2 =
|
|
24637
|
+
var stream2 = fs24.createReadStream(path24, options);
|
|
24638
24638
|
this.emit("stream", stream2);
|
|
24639
24639
|
stream2.pipe(res);
|
|
24640
24640
|
function cleanup() {
|
|
@@ -43460,7 +43460,7 @@ var BatchTaskIdsBody = external_exports.object({
|
|
|
43460
43460
|
|
|
43461
43461
|
// ../../packages/api/src/app/server.ts
|
|
43462
43462
|
var path20 = __toESM(require("path"), 1);
|
|
43463
|
-
var
|
|
43463
|
+
var fs20 = __toESM(require("fs"), 1);
|
|
43464
43464
|
var import_express14 = __toESM(require_express2(), 1);
|
|
43465
43465
|
|
|
43466
43466
|
// ../../packages/api/src/middleware/auth.ts
|
|
@@ -44306,37 +44306,71 @@ function readFileContent(root, relativePath) {
|
|
|
44306
44306
|
};
|
|
44307
44307
|
}
|
|
44308
44308
|
|
|
44309
|
-
// ../../packages/api/src/output/git-
|
|
44309
|
+
// ../../packages/api/src/output/git-command.ts
|
|
44310
|
+
var fs15 = __toESM(require("fs"), 1);
|
|
44310
44311
|
var import_node_child_process6 = require("child_process");
|
|
44312
|
+
var COMMON_GIT_BINARIES = [
|
|
44313
|
+
"/opt/homebrew/bin/git",
|
|
44314
|
+
"/usr/local/bin/git",
|
|
44315
|
+
"/usr/bin/git"
|
|
44316
|
+
];
|
|
44317
|
+
function isExecutable(filePath) {
|
|
44318
|
+
try {
|
|
44319
|
+
fs15.accessSync(filePath, fs15.constants.X_OK);
|
|
44320
|
+
return true;
|
|
44321
|
+
} catch {
|
|
44322
|
+
return false;
|
|
44323
|
+
}
|
|
44324
|
+
}
|
|
44325
|
+
function getGitCandidates() {
|
|
44326
|
+
const candidates = [
|
|
44327
|
+
process.env.MESHY_GIT_BINARY,
|
|
44328
|
+
"git",
|
|
44329
|
+
...COMMON_GIT_BINARIES.filter(isExecutable)
|
|
44330
|
+
].filter((candidate) => Boolean(candidate));
|
|
44331
|
+
return [...new Set(candidates)];
|
|
44332
|
+
}
|
|
44333
|
+
function isMissingBinaryError(error) {
|
|
44334
|
+
return typeof error === "object" && error !== null && error.code === "ENOENT";
|
|
44335
|
+
}
|
|
44336
|
+
function execGit(args, cwd, timeout = 1e4) {
|
|
44337
|
+
let lastError;
|
|
44338
|
+
for (const command of getGitCandidates()) {
|
|
44339
|
+
try {
|
|
44340
|
+
return (0, import_node_child_process6.execFileSync)(command, ["-C", cwd, ...args], {
|
|
44341
|
+
encoding: "utf-8",
|
|
44342
|
+
timeout,
|
|
44343
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
44344
|
+
windowsHide: true
|
|
44345
|
+
}).trim();
|
|
44346
|
+
} catch (err) {
|
|
44347
|
+
lastError = err;
|
|
44348
|
+
if (!isMissingBinaryError(err)) {
|
|
44349
|
+
throw err;
|
|
44350
|
+
}
|
|
44351
|
+
}
|
|
44352
|
+
}
|
|
44353
|
+
throw lastError instanceof Error ? lastError : new Error("git executable not found");
|
|
44354
|
+
}
|
|
44355
|
+
|
|
44356
|
+
// ../../packages/api/src/output/git-branches.ts
|
|
44311
44357
|
function git(args, cwd) {
|
|
44312
44358
|
try {
|
|
44313
|
-
return (
|
|
44314
|
-
encoding: "utf-8",
|
|
44315
|
-
timeout: 1e4,
|
|
44316
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
44317
|
-
}).trim();
|
|
44359
|
+
return execGit(args, cwd);
|
|
44318
44360
|
} catch {
|
|
44319
44361
|
return "";
|
|
44320
44362
|
}
|
|
44321
44363
|
}
|
|
44322
44364
|
function gitSucceeds(args, cwd) {
|
|
44323
44365
|
try {
|
|
44324
|
-
(
|
|
44325
|
-
encoding: "utf-8",
|
|
44326
|
-
timeout: 1e4,
|
|
44327
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
44328
|
-
});
|
|
44366
|
+
execGit(args, cwd);
|
|
44329
44367
|
return true;
|
|
44330
44368
|
} catch {
|
|
44331
44369
|
return false;
|
|
44332
44370
|
}
|
|
44333
44371
|
}
|
|
44334
44372
|
function runGit(args, cwd) {
|
|
44335
|
-
return (
|
|
44336
|
-
encoding: "utf-8",
|
|
44337
|
-
timeout: 1e4,
|
|
44338
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
44339
|
-
}).trim();
|
|
44373
|
+
return execGit(args, cwd);
|
|
44340
44374
|
}
|
|
44341
44375
|
function isGitRepo(dirPath) {
|
|
44342
44376
|
return git(["rev-parse", "--is-inside-work-tree"], dirPath) === "true";
|
|
@@ -44490,14 +44524,9 @@ function createGitBranch(dirPath, branchName, startPoint, options) {
|
|
|
44490
44524
|
}
|
|
44491
44525
|
|
|
44492
44526
|
// ../../packages/api/src/output/git-diff.ts
|
|
44493
|
-
var import_node_child_process7 = require("child_process");
|
|
44494
44527
|
function git2(args, cwd) {
|
|
44495
44528
|
try {
|
|
44496
|
-
return (
|
|
44497
|
-
encoding: "utf-8",
|
|
44498
|
-
timeout: 1e4,
|
|
44499
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
44500
|
-
}).trim();
|
|
44529
|
+
return execGit(args, cwd);
|
|
44501
44530
|
} catch {
|
|
44502
44531
|
return "";
|
|
44503
44532
|
}
|
|
@@ -44649,11 +44678,11 @@ function computeParentPath(rootPath, currentPath, useAbsolute) {
|
|
|
44649
44678
|
var import_node_crypto7 = require("crypto");
|
|
44650
44679
|
|
|
44651
44680
|
// ../../packages/api/src/node/agent-upgrade-service.ts
|
|
44652
|
-
var
|
|
44681
|
+
var import_node_child_process8 = require("child_process");
|
|
44653
44682
|
|
|
44654
44683
|
// ../../packages/api/src/app/system-info.ts
|
|
44655
44684
|
var os6 = __toESM(require("os"), 1);
|
|
44656
|
-
var
|
|
44685
|
+
var import_node_child_process7 = require("child_process");
|
|
44657
44686
|
var RUNTIME_TOOLS = [
|
|
44658
44687
|
{ id: "claude", label: "Claude Code", command: "claude", packageName: "@anthropic-ai/claude-code" },
|
|
44659
44688
|
{ id: "codex", label: "Codex", command: "codex", packageName: "@openai/codex" }
|
|
@@ -44667,7 +44696,7 @@ function clearRuntimeToolUpdateCache(packageName) {
|
|
|
44667
44696
|
runtimeToolUpdateCache.clear();
|
|
44668
44697
|
}
|
|
44669
44698
|
function runRuntimeToolCommand(command, args, platform2) {
|
|
44670
|
-
const result = (0,
|
|
44699
|
+
const result = (0, import_node_child_process7.spawnSync)(command, args, {
|
|
44671
44700
|
encoding: "utf-8",
|
|
44672
44701
|
shell: platform2 === "win32" && command !== "where",
|
|
44673
44702
|
windowsHide: true,
|
|
@@ -44872,7 +44901,7 @@ function summarizeOutput(value) {
|
|
|
44872
44901
|
return text.length > OUTPUT_LIMIT ? `${text.slice(0, OUTPUT_LIMIT)}\u2026` : text;
|
|
44873
44902
|
}
|
|
44874
44903
|
function defaultCommandRunner(command, args) {
|
|
44875
|
-
const result = (0,
|
|
44904
|
+
const result = (0, import_node_child_process8.spawnSync)(command, args, {
|
|
44876
44905
|
encoding: "utf-8",
|
|
44877
44906
|
shell: process.platform === "win32",
|
|
44878
44907
|
windowsHide: true,
|
|
@@ -45372,7 +45401,7 @@ async function sendNodeWorkDirBranchCreateOperation(req, res, nodeId) {
|
|
|
45372
45401
|
}
|
|
45373
45402
|
|
|
45374
45403
|
// ../../packages/api/src/tasks/task-route-utils.ts
|
|
45375
|
-
var
|
|
45404
|
+
var fs16 = __toESM(require("fs"), 1);
|
|
45376
45405
|
var import_node_stream2 = require("stream");
|
|
45377
45406
|
var import_promises5 = require("stream/promises");
|
|
45378
45407
|
|
|
@@ -45434,10 +45463,10 @@ function readLocalTaskLogs(engineRegistry, taskId, after, agent) {
|
|
|
45434
45463
|
throw new MeshyError("VALIDATION_ERROR", `Engine not registered for agent: ${agent}`, 400);
|
|
45435
45464
|
}
|
|
45436
45465
|
const logPath = engine.getLogPath(taskId);
|
|
45437
|
-
if (!
|
|
45466
|
+
if (!fs16.existsSync(logPath)) {
|
|
45438
45467
|
return { logs: [], total: 0 };
|
|
45439
45468
|
}
|
|
45440
|
-
const content =
|
|
45469
|
+
const content = fs16.readFileSync(logPath, "utf-8");
|
|
45441
45470
|
const allLines = content.trim().split("\n").filter(Boolean);
|
|
45442
45471
|
const logs = [];
|
|
45443
45472
|
for (let i = after; i < allLines.length; i++) {
|
|
@@ -45668,11 +45697,11 @@ async function maybeProxyReadToLeader(req, res, options = {}) {
|
|
|
45668
45697
|
}
|
|
45669
45698
|
|
|
45670
45699
|
// ../../packages/api/src/node/node-terminal-session-service.ts
|
|
45671
|
-
var
|
|
45700
|
+
var import_node_child_process9 = require("child_process");
|
|
45672
45701
|
var import_node_crypto8 = require("crypto");
|
|
45673
45702
|
|
|
45674
45703
|
// ../../packages/api/src/node/node-terminal-service.ts
|
|
45675
|
-
var
|
|
45704
|
+
var fs17 = __toESM(require("fs"), 1);
|
|
45676
45705
|
var path17 = __toESM(require("path"), 1);
|
|
45677
45706
|
var DEFAULT_OUTPUT_LIMIT_BYTES = 64 * 1024;
|
|
45678
45707
|
function isAbsolutePath2(value) {
|
|
@@ -45684,7 +45713,7 @@ function resolveNodeTerminalCwd(nodeId, rootPath, cwd) {
|
|
|
45684
45713
|
}
|
|
45685
45714
|
const requestedCwd = cwd?.trim() || ".";
|
|
45686
45715
|
const resolved = isAbsolutePath2(requestedCwd) ? path17.resolve(requestedCwd) : path17.resolve(rootPath, requestedCwd);
|
|
45687
|
-
if (!
|
|
45716
|
+
if (!fs17.existsSync(resolved) || !fs17.statSync(resolved).isDirectory()) {
|
|
45688
45717
|
throw new MeshyError("VALIDATION_ERROR", `Working directory does not exist: ${resolved}`, 400);
|
|
45689
45718
|
}
|
|
45690
45719
|
return resolved;
|
|
@@ -45748,7 +45777,7 @@ var NodeTerminalSessionService = class {
|
|
|
45748
45777
|
}
|
|
45749
45778
|
const cwd = resolveNodeTerminalCwd(nodeId, rootPath, options.cwd);
|
|
45750
45779
|
const startedAt = Date.now();
|
|
45751
|
-
const child = (0,
|
|
45780
|
+
const child = (0, import_node_child_process9.spawn)(normalizedCommand, {
|
|
45752
45781
|
cwd,
|
|
45753
45782
|
shell: true,
|
|
45754
45783
|
windowsHide: true,
|
|
@@ -45923,12 +45952,12 @@ function cancelTaskOnCurrentNode(deps, taskId, options = {}) {
|
|
|
45923
45952
|
}
|
|
45924
45953
|
|
|
45925
45954
|
// ../../packages/api/src/tasks/task-output-service.ts
|
|
45926
|
-
var
|
|
45955
|
+
var fs19 = __toESM(require("fs"), 1);
|
|
45927
45956
|
var path19 = __toESM(require("path"), 1);
|
|
45928
45957
|
|
|
45929
45958
|
// ../../packages/api/src/preview/preview-server.ts
|
|
45930
45959
|
var crypto3 = __toESM(require("crypto"), 1);
|
|
45931
|
-
var
|
|
45960
|
+
var fs18 = __toESM(require("fs"), 1);
|
|
45932
45961
|
var path18 = __toESM(require("path"), 1);
|
|
45933
45962
|
var http2 = __toESM(require("http"), 1);
|
|
45934
45963
|
var import_node_stream3 = require("stream");
|
|
@@ -46053,7 +46082,7 @@ function resolvePreviewPath(rootPath, relativePath) {
|
|
|
46053
46082
|
}
|
|
46054
46083
|
function resolvePreviewEntryPath(rootPath, entryPath) {
|
|
46055
46084
|
const { absolutePath, normalizedPath } = resolvePreviewPath(rootPath, entryPath ?? "index.html");
|
|
46056
|
-
if (!
|
|
46085
|
+
if (!fs18.existsSync(absolutePath) || !fs18.statSync(absolutePath).isFile()) {
|
|
46057
46086
|
throw new Error("Preview entry not found");
|
|
46058
46087
|
}
|
|
46059
46088
|
return normalizedPath;
|
|
@@ -46509,14 +46538,14 @@ async function sendPreviewAssetResponse(sessionManager, token, requestedPath, re
|
|
|
46509
46538
|
res.end("Invalid path");
|
|
46510
46539
|
return;
|
|
46511
46540
|
}
|
|
46512
|
-
if (!
|
|
46541
|
+
if (!fs18.existsSync(resolved) || !fs18.statSync(resolved).isFile()) {
|
|
46513
46542
|
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
46514
46543
|
res.end("File not found");
|
|
46515
46544
|
return;
|
|
46516
46545
|
}
|
|
46517
46546
|
const ext = path18.extname(resolved).toLowerCase();
|
|
46518
46547
|
const mime = ext === ".md" || ext === ".mdx" ? "text/html" : getMime(resolved);
|
|
46519
|
-
const content = ext === ".md" || ext === ".mdx" ? renderMarkdownDocument(
|
|
46548
|
+
const content = ext === ".md" || ext === ".mdx" ? renderMarkdownDocument(fs18.readFileSync(resolved, "utf8"), path18.basename(resolved)) : fs18.readFileSync(resolved);
|
|
46520
46549
|
res.writeHead(200, {
|
|
46521
46550
|
"Content-Type": mime,
|
|
46522
46551
|
"Content-Length": content.length,
|
|
@@ -46554,6 +46583,7 @@ async function handlePreviewRequest(sessionManager, req, res) {
|
|
|
46554
46583
|
|
|
46555
46584
|
// ../../packages/api/src/preview/preview-proxy.ts
|
|
46556
46585
|
var PREVIEW_ASSET_PROXY_TIMEOUT_MS = 1e4;
|
|
46586
|
+
var DEV_TUNNEL_SKIP_ANTIPHISHING_HEADER = "X-Tunnel-Skip-AntiPhishing-Page";
|
|
46557
46587
|
function describeProxyError(error) {
|
|
46558
46588
|
if (error instanceof Error) {
|
|
46559
46589
|
const errorCategory = error.name === "AbortError" || /aborted/i.test(error.message) ? "abort" : /timeout/i.test(error.message) ? "timeout" : "network";
|
|
@@ -46649,6 +46679,12 @@ function buildPreviewAssetProxyPath(token, requestedPath) {
|
|
|
46649
46679
|
}
|
|
46650
46680
|
return `/api/worker/preview-asset?${search.toString()}`;
|
|
46651
46681
|
}
|
|
46682
|
+
function buildPreviewNodeRequestHeaders(req) {
|
|
46683
|
+
return {
|
|
46684
|
+
...buildPreviewWorkerProxyHeaders(req),
|
|
46685
|
+
[DEV_TUNNEL_SKIP_ANTIPHISHING_HEADER]: "true"
|
|
46686
|
+
};
|
|
46687
|
+
}
|
|
46652
46688
|
var PreviewProxyManager = class {
|
|
46653
46689
|
sessions = /* @__PURE__ */ new Map();
|
|
46654
46690
|
register(token, nodeId, expiresAt) {
|
|
@@ -46733,7 +46769,7 @@ async function handlePreviewProxyRequest(manager, nodeRegistry, logger27, req, r
|
|
|
46733
46769
|
proxyPath,
|
|
46734
46770
|
{
|
|
46735
46771
|
method: req.method,
|
|
46736
|
-
headers:
|
|
46772
|
+
headers: buildPreviewNodeRequestHeaders(req),
|
|
46737
46773
|
...body !== void 0 ? { body } : {}
|
|
46738
46774
|
},
|
|
46739
46775
|
PREVIEW_ASSET_PROXY_TIMEOUT_MS,
|
|
@@ -46838,13 +46874,13 @@ function getLocalTaskOutputDownload(taskEngine, taskId, filePath) {
|
|
|
46838
46874
|
const rootPath = getTaskOutputRoot(taskEngine, taskId);
|
|
46839
46875
|
try {
|
|
46840
46876
|
const absolutePath = resolveOutputPath(rootPath, filePath);
|
|
46841
|
-
if (!
|
|
46877
|
+
if (!fs19.existsSync(absolutePath) || !fs19.statSync(absolutePath).isFile()) {
|
|
46842
46878
|
throw new MeshyError("TASK_NOT_FOUND", `File not found: ${filePath}`, 404);
|
|
46843
46879
|
}
|
|
46844
46880
|
const { mimeType } = classifyFile(absolutePath);
|
|
46845
46881
|
const fileName = path19.basename(absolutePath).replace(/"/g, "");
|
|
46846
46882
|
return {
|
|
46847
|
-
content:
|
|
46883
|
+
content: fs19.readFileSync(absolutePath),
|
|
46848
46884
|
headers: {
|
|
46849
46885
|
"Content-Type": mimeType,
|
|
46850
46886
|
"Content-Disposition": `inline; filename="${fileName}"`,
|
|
@@ -49918,7 +49954,7 @@ function hasAuthorizationHeader(req) {
|
|
|
49918
49954
|
function resolveRuntimeBaseDir() {
|
|
49919
49955
|
const entryPath = process.argv[1];
|
|
49920
49956
|
if (typeof entryPath === "string" && entryPath.length > 0) {
|
|
49921
|
-
const resolved =
|
|
49957
|
+
const resolved = fs20.realpathSync(path20.resolve(entryPath));
|
|
49922
49958
|
return path20.dirname(resolved);
|
|
49923
49959
|
}
|
|
49924
49960
|
return process.cwd();
|
|
@@ -49938,7 +49974,7 @@ function resolveStaticDir(baseDir) {
|
|
|
49938
49974
|
path20.resolve(process.cwd(), "packages/api/public")
|
|
49939
49975
|
].filter((value) => typeof value === "string" && value.length > 0);
|
|
49940
49976
|
for (const candidate of candidateDirs) {
|
|
49941
|
-
if (
|
|
49977
|
+
if (fs20.existsSync(candidate)) {
|
|
49942
49978
|
return candidate;
|
|
49943
49979
|
}
|
|
49944
49980
|
}
|
|
@@ -50044,7 +50080,7 @@ function createServer2(deps) {
|
|
|
50044
50080
|
app.use("/api/events", createEventRoutes());
|
|
50045
50081
|
if (staticDir) {
|
|
50046
50082
|
const indexPath = path20.join(staticDir, "index.html");
|
|
50047
|
-
if (
|
|
50083
|
+
if (fs20.existsSync(indexPath)) {
|
|
50048
50084
|
app.get("*", (req, res, next) => {
|
|
50049
50085
|
if (isApiRequest(req)) {
|
|
50050
50086
|
next();
|
|
@@ -50128,10 +50164,10 @@ var DirectTransport = class {
|
|
|
50128
50164
|
};
|
|
50129
50165
|
|
|
50130
50166
|
// ../../packages/transport/src/devtunnel.ts
|
|
50131
|
-
var
|
|
50167
|
+
var import_node_child_process10 = require("child_process");
|
|
50132
50168
|
function isInstalled(cmd) {
|
|
50133
50169
|
try {
|
|
50134
|
-
(0,
|
|
50170
|
+
(0, import_node_child_process10.execSync)(process.platform === "win32" ? `where ${cmd}` : `command -v ${cmd}`, { stdio: "pipe" });
|
|
50135
50171
|
return true;
|
|
50136
50172
|
} catch {
|
|
50137
50173
|
return false;
|
|
@@ -50154,14 +50190,14 @@ var DevTunnelTransport = class {
|
|
|
50154
50190
|
);
|
|
50155
50191
|
}
|
|
50156
50192
|
try {
|
|
50157
|
-
(0,
|
|
50193
|
+
(0, import_node_child_process10.execSync)("devtunnel user show", { stdio: "pipe" });
|
|
50158
50194
|
} catch {
|
|
50159
50195
|
throw new Error(
|
|
50160
50196
|
"Not logged in to devtunnel. Run: devtunnel user login"
|
|
50161
50197
|
);
|
|
50162
50198
|
}
|
|
50163
50199
|
const hostArgs = this.buildHostArgs(localPort);
|
|
50164
|
-
const child = (0,
|
|
50200
|
+
const child = (0, import_node_child_process10.spawn)("devtunnel", hostArgs, {
|
|
50165
50201
|
stdio: ["pipe", "pipe", "pipe"]
|
|
50166
50202
|
});
|
|
50167
50203
|
this.process = child;
|
|
@@ -50266,7 +50302,7 @@ ${lines.join("")}`
|
|
|
50266
50302
|
return;
|
|
50267
50303
|
}
|
|
50268
50304
|
try {
|
|
50269
|
-
(0,
|
|
50305
|
+
(0, import_node_child_process10.execFileSync)("devtunnel", ["access", "create", tunnelId, "--tenant"], { stdio: "pipe" });
|
|
50270
50306
|
} catch (err) {
|
|
50271
50307
|
if (isExistingTenantAccessError(err)) {
|
|
50272
50308
|
return;
|
|
@@ -50282,7 +50318,7 @@ ${lines.join("")}`
|
|
|
50282
50318
|
return void 0;
|
|
50283
50319
|
}
|
|
50284
50320
|
try {
|
|
50285
|
-
(0,
|
|
50321
|
+
(0, import_node_child_process10.execFileSync)("devtunnel", ["show", tunnelId], { stdio: "pipe" });
|
|
50286
50322
|
return tunnelId;
|
|
50287
50323
|
} catch {
|
|
50288
50324
|
const createArgs = ["create", tunnelId];
|
|
@@ -50290,7 +50326,7 @@ ${lines.join("")}`
|
|
|
50290
50326
|
createArgs.push("-a");
|
|
50291
50327
|
}
|
|
50292
50328
|
try {
|
|
50293
|
-
(0,
|
|
50329
|
+
(0, import_node_child_process10.execFileSync)("devtunnel", createArgs, { stdio: "pipe" });
|
|
50294
50330
|
return tunnelId;
|
|
50295
50331
|
} catch (err) {
|
|
50296
50332
|
throw new Error(
|
|
@@ -50302,13 +50338,13 @@ ${lines.join("")}`
|
|
|
50302
50338
|
ensureTunnelPort(tunnelId, localPort) {
|
|
50303
50339
|
const ports = this.listTunnelPorts(tunnelId);
|
|
50304
50340
|
for (const stalePort of ports.filter((p) => p !== localPort)) {
|
|
50305
|
-
(0,
|
|
50341
|
+
(0, import_node_child_process10.execFileSync)("devtunnel", ["port", "delete", tunnelId, "-p", String(stalePort)], { stdio: "pipe" });
|
|
50306
50342
|
}
|
|
50307
50343
|
if (ports.includes(localPort)) {
|
|
50308
50344
|
return;
|
|
50309
50345
|
}
|
|
50310
50346
|
try {
|
|
50311
|
-
(0,
|
|
50347
|
+
(0, import_node_child_process10.execFileSync)(
|
|
50312
50348
|
"devtunnel",
|
|
50313
50349
|
["port", "create", tunnelId, "-p", String(localPort), "--protocol", "http"],
|
|
50314
50350
|
{ stdio: "pipe" }
|
|
@@ -50324,7 +50360,7 @@ ${lines.join("")}`
|
|
|
50324
50360
|
}
|
|
50325
50361
|
listTunnelPorts(tunnelId) {
|
|
50326
50362
|
try {
|
|
50327
|
-
const output = (0,
|
|
50363
|
+
const output = (0, import_node_child_process10.execFileSync)("devtunnel", ["port", "list", tunnelId, "-j"], { stdio: "pipe" });
|
|
50328
50364
|
const parsed = JSON.parse(output.toString());
|
|
50329
50365
|
const items = Array.isArray(parsed) ? parsed : parsed && typeof parsed === "object" && Array.isArray(parsed.ports) ? parsed.ports : parsed && typeof parsed === "object" && Array.isArray(parsed.value) ? parsed.value : [];
|
|
50330
50366
|
return items.map((item) => getPortNumber(item)).filter((value) => value !== void 0);
|
|
@@ -50336,7 +50372,7 @@ ${lines.join("")}`
|
|
|
50336
50372
|
}
|
|
50337
50373
|
hasTunnelPort(tunnelId, localPort) {
|
|
50338
50374
|
try {
|
|
50339
|
-
(0,
|
|
50375
|
+
(0, import_node_child_process10.execFileSync)(
|
|
50340
50376
|
"devtunnel",
|
|
50341
50377
|
["port", "show", tunnelId, "-p", String(localPort), "-j"],
|
|
50342
50378
|
{ stdio: "pipe" }
|
|
@@ -50440,10 +50476,10 @@ var terminalWriter = {
|
|
|
50440
50476
|
};
|
|
50441
50477
|
|
|
50442
50478
|
// src/startup.ts
|
|
50443
|
-
var
|
|
50479
|
+
var fs21 = __toESM(require("fs"), 1);
|
|
50444
50480
|
var path21 = __toESM(require("path"), 1);
|
|
50445
50481
|
var readline = __toESM(require("readline/promises"), 1);
|
|
50446
|
-
var
|
|
50482
|
+
var import_node_child_process11 = require("child_process");
|
|
50447
50483
|
function getDefaultNodeName() {
|
|
50448
50484
|
return getDeviceNodeName();
|
|
50449
50485
|
}
|
|
@@ -50489,7 +50525,7 @@ function createPromptSession(prompt) {
|
|
|
50489
50525
|
}
|
|
50490
50526
|
function createDefaultCommandRunner(platform2) {
|
|
50491
50527
|
return (command, args, interactive = false) => {
|
|
50492
|
-
const result = (0,
|
|
50528
|
+
const result = (0, import_node_child_process11.spawnSync)(command, args, {
|
|
50493
50529
|
encoding: "utf-8",
|
|
50494
50530
|
shell: platform2 === "win32",
|
|
50495
50531
|
stdio: interactive ? "inherit" : "pipe"
|
|
@@ -50508,15 +50544,15 @@ function getNodeMetadataPath2(storagePath) {
|
|
|
50508
50544
|
}
|
|
50509
50545
|
function readStartupMetadataFile(storagePath) {
|
|
50510
50546
|
try {
|
|
50511
|
-
const raw = JSON.parse(
|
|
50547
|
+
const raw = JSON.parse(fs21.readFileSync(getNodeMetadataPath2(storagePath), "utf-8"));
|
|
50512
50548
|
return typeof raw === "object" && raw !== null ? raw : {};
|
|
50513
50549
|
} catch {
|
|
50514
50550
|
return {};
|
|
50515
50551
|
}
|
|
50516
50552
|
}
|
|
50517
50553
|
function writeStartupMetadataFile(storagePath, metadata) {
|
|
50518
|
-
|
|
50519
|
-
|
|
50554
|
+
fs21.mkdirSync(storagePath, { recursive: true });
|
|
50555
|
+
fs21.writeFileSync(getNodeMetadataPath2(storagePath), JSON.stringify(metadata, null, 2) + "\n", "utf-8");
|
|
50520
50556
|
}
|
|
50521
50557
|
function formatLocalDate2(now) {
|
|
50522
50558
|
const year = now.getFullYear();
|
|
@@ -50757,7 +50793,7 @@ async function ensureStartupRequirements(storagePath, options = {}) {
|
|
|
50757
50793
|
}
|
|
50758
50794
|
function loadConfigFile(path23) {
|
|
50759
50795
|
try {
|
|
50760
|
-
const raw =
|
|
50796
|
+
const raw = fs21.readFileSync(path23, "utf-8");
|
|
50761
50797
|
return JSON.parse(raw);
|
|
50762
50798
|
} catch {
|
|
50763
50799
|
return {};
|
|
@@ -50935,9 +50971,9 @@ function formatLoadedStartMetadata(info, authEnabled) {
|
|
|
50935
50971
|
}
|
|
50936
50972
|
|
|
50937
50973
|
// src/runtime-metadata.ts
|
|
50938
|
-
var
|
|
50974
|
+
var fs22 = __toESM(require("fs"), 1);
|
|
50939
50975
|
var path22 = __toESM(require("path"), 1);
|
|
50940
|
-
var
|
|
50976
|
+
var import_node_child_process12 = require("child_process");
|
|
50941
50977
|
var runtimeDir = resolveRuntimeDir();
|
|
50942
50978
|
var appRoot = resolveAppRoot(runtimeDir);
|
|
50943
50979
|
var repoRoot = path22.resolve(appRoot, "../..");
|
|
@@ -50945,7 +50981,7 @@ function resolveRuntimeDir() {
|
|
|
50945
50981
|
const entryPath = process.argv[1];
|
|
50946
50982
|
if (typeof entryPath === "string" && entryPath.length > 0) {
|
|
50947
50983
|
try {
|
|
50948
|
-
return path22.dirname(
|
|
50984
|
+
return path22.dirname(fs22.realpathSync(path22.resolve(entryPath)));
|
|
50949
50985
|
} catch {
|
|
50950
50986
|
return path22.dirname(path22.resolve(entryPath));
|
|
50951
50987
|
}
|
|
@@ -50954,7 +50990,7 @@ function resolveRuntimeDir() {
|
|
|
50954
50990
|
}
|
|
50955
50991
|
function readJsonFile(filePath) {
|
|
50956
50992
|
try {
|
|
50957
|
-
return JSON.parse(
|
|
50993
|
+
return JSON.parse(fs22.readFileSync(filePath, "utf-8"));
|
|
50958
50994
|
} catch {
|
|
50959
50995
|
return null;
|
|
50960
50996
|
}
|
|
@@ -50991,7 +51027,7 @@ function resolveAppRoot(baseDir) {
|
|
|
50991
51027
|
}
|
|
50992
51028
|
}
|
|
50993
51029
|
for (const candidate of candidates) {
|
|
50994
|
-
if (
|
|
51030
|
+
if (fs22.existsSync(path22.join(candidate, "package.json"))) {
|
|
50995
51031
|
return candidate;
|
|
50996
51032
|
}
|
|
50997
51033
|
}
|
|
@@ -51033,7 +51069,7 @@ function readRepositoryUrlFromManifest(manifest) {
|
|
|
51033
51069
|
}
|
|
51034
51070
|
function readGitValue(args) {
|
|
51035
51071
|
try {
|
|
51036
|
-
const output = (0,
|
|
51072
|
+
const output = (0, import_node_child_process12.execFileSync)("git", args, {
|
|
51037
51073
|
cwd: repoRoot,
|
|
51038
51074
|
encoding: "utf-8",
|
|
51039
51075
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -51079,9 +51115,9 @@ function buildRuntimeMetadata(storagePath) {
|
|
|
51079
51115
|
}
|
|
51080
51116
|
|
|
51081
51117
|
// src/bootstrap/runtime-restart.ts
|
|
51082
|
-
var
|
|
51118
|
+
var fs23 = __toESM(require("fs"), 1);
|
|
51083
51119
|
var nodePath2 = __toESM(require("path"), 1);
|
|
51084
|
-
var
|
|
51120
|
+
var import_node_child_process13 = require("child_process");
|
|
51085
51121
|
function resolveRuntimeRestartStartArgs(hydratedArgs, restartArgs) {
|
|
51086
51122
|
return restartArgs ? { ...restartArgs } : hydratedArgs;
|
|
51087
51123
|
}
|
|
@@ -51195,7 +51231,7 @@ function compareSemver2(left, right) {
|
|
|
51195
51231
|
return 0;
|
|
51196
51232
|
}
|
|
51197
51233
|
function runRuntimePackageCommand(command, args) {
|
|
51198
|
-
const result = (0,
|
|
51234
|
+
const result = (0, import_node_child_process13.spawnSync)(command, args, {
|
|
51199
51235
|
encoding: "utf-8",
|
|
51200
51236
|
windowsHide: true,
|
|
51201
51237
|
timeout: 2500
|
|
@@ -51234,7 +51270,7 @@ function createSpawnableCommand(command, args, platform2) {
|
|
|
51234
51270
|
}
|
|
51235
51271
|
function readProcessCommand(pid, platform2) {
|
|
51236
51272
|
if (platform2 === "win32") return null;
|
|
51237
|
-
const result = (0,
|
|
51273
|
+
const result = (0, import_node_child_process13.spawnSync)("ps", ["-p", String(pid), "-o", "args="], {
|
|
51238
51274
|
encoding: "utf-8",
|
|
51239
51275
|
windowsHide: true,
|
|
51240
51276
|
timeout: 1e3
|
|
@@ -51325,9 +51361,9 @@ function createRuntimeRestartLaunchPlan(options) {
|
|
|
51325
51361
|
};
|
|
51326
51362
|
}
|
|
51327
51363
|
function scheduleRuntimeRestart(plan, options = {}) {
|
|
51328
|
-
|
|
51329
|
-
const logFd =
|
|
51330
|
-
const spawnImpl = options.spawnImpl ??
|
|
51364
|
+
fs23.mkdirSync(nodePath2.dirname(plan.logPath), { recursive: true });
|
|
51365
|
+
const logFd = fs23.openSync(plan.logPath, "a");
|
|
51366
|
+
const spawnImpl = options.spawnImpl ?? import_node_child_process13.spawn;
|
|
51331
51367
|
const env = {
|
|
51332
51368
|
...process.env,
|
|
51333
51369
|
MESHY_RESTART_PARENT_PID: String(options.parentPid ?? process.pid),
|