@muggleai/mcp 1.0.1 → 1.0.4
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/{chunk-IGLYJZH6.js → chunk-DX2A2FVG.js} +48 -5
- package/dist/chunk-DX2A2FVG.js.map +1 -0
- package/dist/cli/help.d.ts +20 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli.js +33 -24
- package/dist/cli.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/local-qa/services/execution-service.d.ts.map +1 -1
- package/dist/local-qa/types/execution-types.d.ts +76 -0
- package/dist/local-qa/types/execution-types.d.ts.map +1 -0
- package/dist/local-qa/types/index.d.ts +1 -0
- package/dist/local-qa/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-IGLYJZH6.js.map +0 -1
|
@@ -5426,6 +5426,8 @@ function buildSecretOptionsFromLocalSecrets(params) {
|
|
|
5426
5426
|
}
|
|
5427
5427
|
var DEFAULT_GENERATION_TIMEOUT_MS = 3e5;
|
|
5428
5428
|
var DEFAULT_REPLAY_TIMEOUT_MS = 18e4;
|
|
5429
|
+
var INACTIVITY_TIMEOUT_MS = 12e4;
|
|
5430
|
+
var INACTIVITY_CHECK_INTERVAL_MS = 5e3;
|
|
5429
5431
|
var activeProcesses = /* @__PURE__ */ new Map();
|
|
5430
5432
|
function generateRunId() {
|
|
5431
5433
|
return `run_${ulid()}`;
|
|
@@ -5696,6 +5698,7 @@ async function spawnElectronApp(params) {
|
|
|
5696
5698
|
if (!childProcess.pid) {
|
|
5697
5699
|
throw new Error("Failed to spawn electron-app process");
|
|
5698
5700
|
}
|
|
5701
|
+
const now = Date.now();
|
|
5699
5702
|
const executionProcess = {
|
|
5700
5703
|
runId,
|
|
5701
5704
|
projectId,
|
|
@@ -5703,20 +5706,41 @@ async function spawnElectronApp(params) {
|
|
|
5703
5706
|
runType,
|
|
5704
5707
|
process: childProcess,
|
|
5705
5708
|
pid: childProcess.pid,
|
|
5706
|
-
startedAt:
|
|
5709
|
+
startedAt: now,
|
|
5707
5710
|
status: "running" /* RUNNING */,
|
|
5708
5711
|
inputFilePath,
|
|
5709
5712
|
outputFilePath,
|
|
5710
5713
|
capturedStdout: "",
|
|
5711
5714
|
capturedStderr: "",
|
|
5712
|
-
hasExited: false
|
|
5715
|
+
hasExited: false,
|
|
5716
|
+
lastOutputAt: now,
|
|
5717
|
+
killedDueToInactivity: false
|
|
5713
5718
|
};
|
|
5714
5719
|
childProcess.stdout?.on("data", (data) => {
|
|
5715
5720
|
executionProcess.capturedStdout += data.toString();
|
|
5721
|
+
executionProcess.lastOutputAt = Date.now();
|
|
5716
5722
|
});
|
|
5717
5723
|
childProcess.stderr?.on("data", (data) => {
|
|
5718
5724
|
executionProcess.capturedStderr += data.toString();
|
|
5725
|
+
executionProcess.lastOutputAt = Date.now();
|
|
5719
5726
|
});
|
|
5727
|
+
const inactivityCheck = setInterval(() => {
|
|
5728
|
+
if (executionProcess.hasExited) {
|
|
5729
|
+
clearInterval(inactivityCheck);
|
|
5730
|
+
return;
|
|
5731
|
+
}
|
|
5732
|
+
const inactiveDuration = Date.now() - executionProcess.lastOutputAt;
|
|
5733
|
+
if (inactiveDuration >= INACTIVITY_TIMEOUT_MS) {
|
|
5734
|
+
executionProcess.killedDueToInactivity = true;
|
|
5735
|
+
executionProcess.status = "failed" /* FAILED */;
|
|
5736
|
+
clearInterval(inactivityCheck);
|
|
5737
|
+
try {
|
|
5738
|
+
executionProcess.process.kill("SIGKILL");
|
|
5739
|
+
} catch {
|
|
5740
|
+
}
|
|
5741
|
+
}
|
|
5742
|
+
}, INACTIVITY_CHECK_INTERVAL_MS);
|
|
5743
|
+
executionProcess.inactivityCheckInterval = inactivityCheck;
|
|
5720
5744
|
childProcess.on("close", (code, signal) => {
|
|
5721
5745
|
executionProcess.hasExited = true;
|
|
5722
5746
|
executionProcess.earlyExitInfo = {
|
|
@@ -5748,6 +5772,9 @@ function handleTimeout(params) {
|
|
|
5748
5772
|
const { executionProcess } = params;
|
|
5749
5773
|
if (executionProcess.status === "running" /* RUNNING */) {
|
|
5750
5774
|
executionProcess.status = "failed" /* FAILED */;
|
|
5775
|
+
if (executionProcess.inactivityCheckInterval) {
|
|
5776
|
+
clearInterval(executionProcess.inactivityCheckInterval);
|
|
5777
|
+
}
|
|
5751
5778
|
try {
|
|
5752
5779
|
executionProcess.process.kill("SIGTERM");
|
|
5753
5780
|
} catch {
|
|
@@ -5759,6 +5786,9 @@ async function handleProcessExit(params) {
|
|
|
5759
5786
|
if (executionProcess.timeoutTimer) {
|
|
5760
5787
|
clearTimeout(executionProcess.timeoutTimer);
|
|
5761
5788
|
}
|
|
5789
|
+
if (executionProcess.inactivityCheckInterval) {
|
|
5790
|
+
clearInterval(executionProcess.inactivityCheckInterval);
|
|
5791
|
+
}
|
|
5762
5792
|
activeProcesses.delete(executionProcess.runId);
|
|
5763
5793
|
if (executionProcess.status === "cancelled" /* CANCELLED */) {
|
|
5764
5794
|
return {
|
|
@@ -5768,6 +5798,16 @@ async function handleProcessExit(params) {
|
|
|
5768
5798
|
error: "Cancelled by user"
|
|
5769
5799
|
};
|
|
5770
5800
|
}
|
|
5801
|
+
if (executionProcess.killedDueToInactivity) {
|
|
5802
|
+
executionProcess.status = "failed" /* FAILED */;
|
|
5803
|
+
const stderrSummary = stderr.trim().slice(0, 500);
|
|
5804
|
+
return {
|
|
5805
|
+
success: false,
|
|
5806
|
+
status: "FAILURE",
|
|
5807
|
+
summary: "Process became unresponsive",
|
|
5808
|
+
error: `Process killed after ${INACTIVITY_TIMEOUT_MS / 1e3}s of inactivity (likely stuck on error dialog). ` + (stderrSummary ? `Last stderr: ${stderrSummary}` : "No stderr captured.")
|
|
5809
|
+
};
|
|
5810
|
+
}
|
|
5771
5811
|
if (code !== 0 || executionProcess.status === "failed" /* FAILED */) {
|
|
5772
5812
|
executionProcess.status = "failed" /* FAILED */;
|
|
5773
5813
|
const errorMessage = stderr || `Process exited with code ${code}`;
|
|
@@ -5775,7 +5815,7 @@ async function handleProcessExit(params) {
|
|
|
5775
5815
|
success: false,
|
|
5776
5816
|
status: "FAILURE",
|
|
5777
5817
|
summary: "Execution failed",
|
|
5778
|
-
error: code === -1 ? errorMessage : `Process
|
|
5818
|
+
error: code === -1 ? errorMessage : `Process exited with code ${code}. ${errorMessage}`
|
|
5779
5819
|
};
|
|
5780
5820
|
}
|
|
5781
5821
|
const outputData = await readTempFile(executionProcess.outputFilePath);
|
|
@@ -6105,6 +6145,9 @@ function cancelExecution(params) {
|
|
|
6105
6145
|
if (executionProcess.timeoutTimer) {
|
|
6106
6146
|
clearTimeout(executionProcess.timeoutTimer);
|
|
6107
6147
|
}
|
|
6148
|
+
if (executionProcess.inactivityCheckInterval) {
|
|
6149
|
+
clearInterval(executionProcess.inactivityCheckInterval);
|
|
6150
|
+
}
|
|
6108
6151
|
try {
|
|
6109
6152
|
executionProcess.process.kill("SIGTERM");
|
|
6110
6153
|
} catch {
|
|
@@ -7729,5 +7772,5 @@ function isLocalOnlyTool(toolName) {
|
|
|
7729
7772
|
}
|
|
7730
7773
|
|
|
7731
7774
|
export { __export, __require, createApiKeyWithToken, createChildLogger, createUnifiedMcpServer, deleteCredentials, getAuthStatus, getBundledElectronAppVersion, getCallerCredentials, getConfig, getCredentialsFilePath, getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getQaTools, getValidCredentials, isCredentialsExpired, isElectronAppInstalled, loadCredentials, local_qa_exports, openBrowserUrl, performLogin, performLogout, pollDeviceCode, qa_exports, registerTools, resetConfig, resetLogger, saveCredentials, server_exports, startDeviceCodeFlow, startStdioServer, toolRequiresAuth };
|
|
7732
|
-
//# sourceMappingURL=chunk-
|
|
7733
|
-
//# sourceMappingURL=chunk-
|
|
7775
|
+
//# sourceMappingURL=chunk-DX2A2FVG.js.map
|
|
7776
|
+
//# sourceMappingURL=chunk-DX2A2FVG.js.map
|