@muggleai/works 5.9.0 → 5.10.0
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 +8 -0
- package/dist/{chunk-5PYK7DWB.js → chunk-7NC2DJTK.js} +10 -4
- package/dist/{chunk-LVUJ4E62.js → chunk-OCLMXAVJ.js} +245 -167
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/README.md +19 -13
- package/dist/plugin/agents/test-prepare-runner.md +1 -0
- package/dist/plugin/scripts/ensure-electron-app.sh +62 -47
- package/dist/plugin/scripts/guardrails.mjs +47 -46
- package/dist/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -0
- package/dist/plugin/skills/muggle/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-preferences/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-preferences/evals/evals.json +45 -0
- package/dist/plugin/skills/muggle-preferences/ops/change-one.md +1 -1
- package/dist/plugin/skills/muggle-preferences/ops/configure.md +4 -5
- package/dist/plugin/skills/muggle-preferences/ops/list.md +1 -1
- package/dist/plugin/skills/muggle-preferences/ops/set.md +3 -4
- package/dist/plugin/skills/muggle-preferences/preference-gates/README.md +3 -3
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoSelectLocalHost.md +2 -2
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoSelectProject.md +1 -1
- package/dist/plugin/skills/muggle-test/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-test/execute-local.md +2 -0
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +3 -1
- package/dist/plugin/skills/muggle-test-import/SKILL.md +1 -1
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +10 -4
- package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -1
- package/dist/plugin/skills/muggle-test-prepare/steps/e2e-instructions.md +100 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/readiness-report.md +9 -4
- package/dist/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +5 -4
- package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +1 -1
- package/dist/release-manifest.json +4 -4
- package/dist/src-AWUORQZZ.js +1 -0
- package/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/README.md +19 -13
- package/plugin/agents/test-prepare-runner.md +1 -0
- package/plugin/scripts/ensure-electron-app.sh +62 -47
- package/plugin/scripts/guardrails.mjs +47 -46
- package/plugin/skills/_shared/resolve-e2e-validation-context.md +1 -0
- package/plugin/skills/muggle/SKILL.md +1 -1
- package/plugin/skills/muggle-preferences/SKILL.md +1 -1
- package/plugin/skills/muggle-preferences/evals/evals.json +45 -0
- package/plugin/skills/muggle-preferences/ops/change-one.md +1 -1
- package/plugin/skills/muggle-preferences/ops/configure.md +4 -5
- package/plugin/skills/muggle-preferences/ops/list.md +1 -1
- package/plugin/skills/muggle-preferences/ops/set.md +3 -4
- package/plugin/skills/muggle-preferences/preference-gates/README.md +3 -3
- package/plugin/skills/muggle-preferences/preference-gates/autoSelectLocalHost.md +2 -2
- package/plugin/skills/muggle-preferences/preference-gates/autoSelectProject.md +1 -1
- package/plugin/skills/muggle-test/SKILL.md +1 -1
- package/plugin/skills/muggle-test/execute-local.md +2 -0
- package/plugin/skills/muggle-test-feature-local/SKILL.md +3 -1
- package/plugin/skills/muggle-test-import/SKILL.md +1 -1
- package/plugin/skills/muggle-test-prepare/SKILL.md +10 -4
- package/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -1
- package/plugin/skills/muggle-test-prepare/steps/e2e-instructions.md +100 -0
- package/plugin/skills/muggle-test-prepare/steps/readiness-report.md +9 -4
- package/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +5 -4
- package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +1 -1
- package/dist/src-FDK2KQSZ.js +0 -1
|
@@ -37,6 +37,7 @@ __export(src_exports, {
|
|
|
37
37
|
PREFERENCE_ALLOWED_VALUES: () => PREFERENCE_ALLOWED_VALUES,
|
|
38
38
|
PreferenceKey: () => PreferenceKey,
|
|
39
39
|
PreferenceValue: () => PreferenceValue,
|
|
40
|
+
ProjectPreferencesReconcileOutcome: () => ProjectPreferencesReconcileOutcome,
|
|
40
41
|
buildElectronAppChecksumsUrl: () => buildElectronAppChecksumsUrl,
|
|
41
42
|
buildElectronAppReleaseAssetUrl: () => buildElectronAppReleaseAssetUrl,
|
|
42
43
|
buildElectronAppReleaseTag: () => buildElectronAppReleaseTag,
|
|
@@ -80,8 +81,7 @@ __export(src_exports, {
|
|
|
80
81
|
performLogout: () => performLogout,
|
|
81
82
|
pollDeviceCode: () => pollDeviceCode,
|
|
82
83
|
qa: () => e2e_exports2,
|
|
83
|
-
|
|
84
|
-
readProjectPreferences: () => readProjectPreferences,
|
|
84
|
+
reconcileProjectPreferences: () => reconcileProjectPreferences,
|
|
85
85
|
resetConfig: () => resetConfig,
|
|
86
86
|
resetLogger: () => resetLogger,
|
|
87
87
|
resetPreference: () => resetPreference,
|
|
@@ -542,14 +542,14 @@ function getPlatformKey() {
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
async function calculateFileChecksum(filePath) {
|
|
545
|
-
return new Promise((
|
|
545
|
+
return new Promise((resolve5, reject) => {
|
|
546
546
|
const hash = crypto.createHash("sha256");
|
|
547
547
|
const stream = fs5.createReadStream(filePath);
|
|
548
548
|
stream.on("data", (data) => {
|
|
549
549
|
hash.update(data);
|
|
550
550
|
});
|
|
551
551
|
stream.on("end", () => {
|
|
552
|
-
|
|
552
|
+
resolve5(hash.digest("hex"));
|
|
553
553
|
});
|
|
554
554
|
stream.on("error", (error) => {
|
|
555
555
|
reject(error);
|
|
@@ -627,7 +627,7 @@ function getOpenCommand(url) {
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
async function openBrowserUrl(options) {
|
|
630
|
-
return new Promise((
|
|
630
|
+
return new Promise((resolve5) => {
|
|
631
631
|
try {
|
|
632
632
|
const command = getOpenCommand(options.url);
|
|
633
633
|
logger2.debug("[Browser] Opening URL", { url: options.url, command });
|
|
@@ -637,13 +637,13 @@ async function openBrowserUrl(options) {
|
|
|
637
637
|
url: options.url,
|
|
638
638
|
error: error.message
|
|
639
639
|
});
|
|
640
|
-
|
|
640
|
+
resolve5({
|
|
641
641
|
opened: false,
|
|
642
642
|
error: error.message
|
|
643
643
|
});
|
|
644
644
|
} else {
|
|
645
645
|
logger2.info("[Browser] URL opened successfully", { url: options.url });
|
|
646
|
-
|
|
646
|
+
resolve5({ opened: true });
|
|
647
647
|
}
|
|
648
648
|
});
|
|
649
649
|
} catch (error) {
|
|
@@ -652,7 +652,7 @@ async function openBrowserUrl(options) {
|
|
|
652
652
|
url: options.url,
|
|
653
653
|
error: errorMessage
|
|
654
654
|
});
|
|
655
|
-
|
|
655
|
+
resolve5({
|
|
656
656
|
opened: false,
|
|
657
657
|
error: errorMessage
|
|
658
658
|
});
|
|
@@ -1357,9 +1357,9 @@ function resetAuthService() {
|
|
|
1357
1357
|
serviceInstance = null;
|
|
1358
1358
|
}
|
|
1359
1359
|
function sleep(params) {
|
|
1360
|
-
return new Promise((
|
|
1360
|
+
return new Promise((resolve5) => {
|
|
1361
1361
|
setTimeout(() => {
|
|
1362
|
-
|
|
1362
|
+
resolve5();
|
|
1363
1363
|
}, params.durationMs);
|
|
1364
1364
|
});
|
|
1365
1365
|
}
|
|
@@ -2620,7 +2620,7 @@ async function executeElectronAppAsync(params) {
|
|
|
2620
2620
|
capturedStderr: ""
|
|
2621
2621
|
};
|
|
2622
2622
|
activeProcesses.set(params.runId, processInfo);
|
|
2623
|
-
return await new Promise((
|
|
2623
|
+
return await new Promise((resolve5, reject) => {
|
|
2624
2624
|
let settled = false;
|
|
2625
2625
|
const finalize = (result) => {
|
|
2626
2626
|
if (settled) {
|
|
@@ -2632,7 +2632,7 @@ async function executeElectronAppAsync(params) {
|
|
|
2632
2632
|
}
|
|
2633
2633
|
activeProcesses.delete(params.runId);
|
|
2634
2634
|
if (result.ok) {
|
|
2635
|
-
|
|
2635
|
+
resolve5(result.payload);
|
|
2636
2636
|
} else {
|
|
2637
2637
|
reject(result.payload);
|
|
2638
2638
|
}
|
|
@@ -3493,9 +3493,9 @@ function isValid2(value) {
|
|
|
3493
3493
|
function readReleaseManifest2() {
|
|
3494
3494
|
if (cachedManifest2 !== void 0)
|
|
3495
3495
|
return cachedManifest2;
|
|
3496
|
-
const
|
|
3496
|
+
const path15 = MANIFEST_PATH2;
|
|
3497
3497
|
try {
|
|
3498
|
-
const raw = readFileSync(
|
|
3498
|
+
const raw = readFileSync(path15, "utf8");
|
|
3499
3499
|
const parsed = JSON.parse(raw);
|
|
3500
3500
|
cachedManifest2 = isValid2(parsed) ? parsed : DEV_MANIFEST2;
|
|
3501
3501
|
return cachedManifest2;
|
|
@@ -4274,17 +4274,17 @@ var PromptServiceClient = class {
|
|
|
4274
4274
|
* @param path - Path to validate.
|
|
4275
4275
|
* @throws GatewayError if path is not allowed.
|
|
4276
4276
|
*/
|
|
4277
|
-
validatePath(
|
|
4278
|
-
const isAllowed = ALLOWED_UPSTREAM_PREFIXES.some((prefix) =>
|
|
4277
|
+
validatePath(path15) {
|
|
4278
|
+
const isAllowed = ALLOWED_UPSTREAM_PREFIXES.some((prefix) => path15.startsWith(prefix));
|
|
4279
4279
|
if (!isAllowed) {
|
|
4280
4280
|
const logger6 = getLogger();
|
|
4281
4281
|
logger6.error("Path not in allowlist", {
|
|
4282
|
-
path:
|
|
4282
|
+
path: path15,
|
|
4283
4283
|
allowedPrefixes: ALLOWED_UPSTREAM_PREFIXES
|
|
4284
4284
|
});
|
|
4285
4285
|
throw new GatewayError({
|
|
4286
4286
|
code: "FORBIDDEN" /* FORBIDDEN */,
|
|
4287
|
-
message: `Path '${
|
|
4287
|
+
message: `Path '${path15}' is not allowed`
|
|
4288
4288
|
});
|
|
4289
4289
|
}
|
|
4290
4290
|
}
|
|
@@ -6431,12 +6431,15 @@ var PREFERENCES_SCHEMA = {
|
|
|
6431
6431
|
// packages/mcps/src/mcp/local/contracts/preferences-schemas.ts
|
|
6432
6432
|
var preferenceKeyValues = Object.values(PreferenceKey);
|
|
6433
6433
|
var preferenceValueValues = Object.values(PreferenceValue);
|
|
6434
|
-
var PreferencesSetInputSchema = z.object(
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6434
|
+
var PreferencesSetInputSchema = z.object(
|
|
6435
|
+
{
|
|
6436
|
+
key: z.enum(preferenceKeyValues).describe("The preference key to set."),
|
|
6437
|
+
value: z.enum(preferenceValueValues).describe("The value. Most keys accept always/ask/never; defaultExecutionMode accepts local/remote/ask.")
|
|
6438
|
+
},
|
|
6439
|
+
{
|
|
6440
|
+
error: "Expected only { key, value }: per-project preferences were removed, so scope and cwd are no longer accepted."
|
|
6441
|
+
}
|
|
6442
|
+
).strict().superRefine((data, ctx) => {
|
|
6440
6443
|
const allowed = PREFERENCE_ALLOWED_VALUES[data.key];
|
|
6441
6444
|
if (!allowed.includes(data.value)) {
|
|
6442
6445
|
ctx.addIssue({
|
|
@@ -6518,9 +6521,21 @@ function appendFailureEvent(record) {
|
|
|
6518
6521
|
});
|
|
6519
6522
|
}
|
|
6520
6523
|
}
|
|
6524
|
+
|
|
6525
|
+
// packages/mcps/src/shared/project-preferences-reconcile-types.ts
|
|
6526
|
+
var ProjectPreferencesReconcileOutcome = /* @__PURE__ */ ((ProjectPreferencesReconcileOutcome2) => {
|
|
6527
|
+
ProjectPreferencesReconcileOutcome2["NoAction"] = "noAction";
|
|
6528
|
+
ProjectPreferencesReconcileOutcome2["CopiedToGlobal"] = "copiedToGlobal";
|
|
6529
|
+
ProjectPreferencesReconcileOutcome2["KeysShadowed"] = "keysShadowed";
|
|
6530
|
+
return ProjectPreferencesReconcileOutcome2;
|
|
6531
|
+
})(ProjectPreferencesReconcileOutcome || {});
|
|
6532
|
+
|
|
6533
|
+
// packages/mcps/src/shared/preferences-service.ts
|
|
6534
|
+
function getGlobalPreferencesFilePath(dataDirOverride2) {
|
|
6535
|
+
return path9.join(dataDirOverride2 ?? getDataDir(), PREFERENCES_FILE_NAME);
|
|
6536
|
+
}
|
|
6521
6537
|
function isFirstRun(dataDirOverride2) {
|
|
6522
|
-
|
|
6523
|
-
return !fs5.existsSync(filePath);
|
|
6538
|
+
return !fs5.existsSync(getGlobalPreferencesFilePath(dataDirOverride2));
|
|
6524
6539
|
}
|
|
6525
6540
|
function readPreferencesFile(filePath) {
|
|
6526
6541
|
try {
|
|
@@ -6537,53 +6552,64 @@ function readPreferencesFile(filePath) {
|
|
|
6537
6552
|
return {};
|
|
6538
6553
|
}
|
|
6539
6554
|
}
|
|
6540
|
-
function
|
|
6541
|
-
const filePath = path9.join(dataDirOverride2 ?? getDataDir(), PREFERENCES_FILE_NAME);
|
|
6542
|
-
const partial = readPreferencesFile(filePath);
|
|
6543
|
-
return { ...DEFAULT_PREFERENCES, ...partial };
|
|
6544
|
-
}
|
|
6545
|
-
function readProjectPreferences(cwd) {
|
|
6546
|
-
const filePath = path9.join(cwd, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_FILE_NAME);
|
|
6547
|
-
return readPreferencesFile(filePath);
|
|
6548
|
-
}
|
|
6549
|
-
function resolvePreferences(dataDirOverride2, cwd) {
|
|
6550
|
-
const global = readGlobalPreferences(dataDirOverride2);
|
|
6551
|
-
if (!cwd) {
|
|
6552
|
-
return global;
|
|
6553
|
-
}
|
|
6554
|
-
const project = readProjectPreferences(cwd);
|
|
6555
|
-
return { ...global, ...project };
|
|
6556
|
-
}
|
|
6557
|
-
function writePreferences2(prefs, scope, dataDirOverride2, cwd) {
|
|
6558
|
-
const dir = scope === "project" && cwd ? path9.join(cwd, PREFERENCES_PROJECT_DIR_NAME) : dataDirOverride2 ?? getDataDir();
|
|
6559
|
-
fs5.mkdirSync(dir, { recursive: true });
|
|
6560
|
-
const filePath = path9.join(dir, PREFERENCES_FILE_NAME);
|
|
6561
|
-
const existing = readPreferencesFile(filePath);
|
|
6562
|
-
const merged = { ...existing, ...prefs };
|
|
6555
|
+
function writePreferencesFile(filePath, prefs) {
|
|
6563
6556
|
const file = {
|
|
6564
6557
|
version: PREFERENCES_VERSION,
|
|
6565
|
-
preferences:
|
|
6558
|
+
preferences: prefs
|
|
6566
6559
|
};
|
|
6567
6560
|
fs5.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}
|
|
6568
6561
|
`, "utf-8");
|
|
6569
6562
|
}
|
|
6570
|
-
function
|
|
6571
|
-
const
|
|
6563
|
+
function resolvePreferences(dataDirOverride2) {
|
|
6564
|
+
const saved = readPreferencesFile(getGlobalPreferencesFilePath(dataDirOverride2));
|
|
6565
|
+
return { ...DEFAULT_PREFERENCES, ...saved };
|
|
6566
|
+
}
|
|
6567
|
+
function writePreferences2(prefs, dataDirOverride2) {
|
|
6568
|
+
const dir = dataDirOverride2 ?? getDataDir();
|
|
6569
|
+
fs5.mkdirSync(dir, { recursive: true });
|
|
6572
6570
|
const filePath = path9.join(dir, PREFERENCES_FILE_NAME);
|
|
6571
|
+
const existing = readPreferencesFile(filePath);
|
|
6572
|
+
writePreferencesFile(filePath, { ...existing, ...prefs });
|
|
6573
|
+
}
|
|
6574
|
+
function resetPreference(key, dataDirOverride2) {
|
|
6575
|
+
const filePath = getGlobalPreferencesFilePath(dataDirOverride2);
|
|
6573
6576
|
if (!fs5.existsSync(filePath)) {
|
|
6574
6577
|
return;
|
|
6575
6578
|
}
|
|
6576
6579
|
if (!key) {
|
|
6577
|
-
|
|
6578
|
-
fs5.writeFileSync(filePath, `${JSON.stringify(file2, null, 2)}
|
|
6579
|
-
`, "utf-8");
|
|
6580
|
+
writePreferencesFile(filePath, {});
|
|
6580
6581
|
return;
|
|
6581
6582
|
}
|
|
6582
6583
|
const existing = readPreferencesFile(filePath);
|
|
6583
6584
|
delete existing[key];
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6585
|
+
writePreferencesFile(filePath, existing);
|
|
6586
|
+
}
|
|
6587
|
+
function reconcileProjectPreferences(cwd, dataDirOverride2) {
|
|
6588
|
+
const projectFilePath = path9.join(cwd, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_FILE_NAME);
|
|
6589
|
+
const projectPreferences = readPreferencesFile(projectFilePath);
|
|
6590
|
+
const projectKeys = Object.keys(projectPreferences);
|
|
6591
|
+
if (projectKeys.length === 0) {
|
|
6592
|
+
return {
|
|
6593
|
+
outcome: "noAction" /* NoAction */,
|
|
6594
|
+
projectFilePath,
|
|
6595
|
+
shadowedKeys: []
|
|
6596
|
+
};
|
|
6597
|
+
}
|
|
6598
|
+
if (isFirstRun(dataDirOverride2)) {
|
|
6599
|
+
writePreferences2(projectPreferences, dataDirOverride2);
|
|
6600
|
+
return {
|
|
6601
|
+
outcome: "copiedToGlobal" /* CopiedToGlobal */,
|
|
6602
|
+
projectFilePath,
|
|
6603
|
+
shadowedKeys: []
|
|
6604
|
+
};
|
|
6605
|
+
}
|
|
6606
|
+
const resolved = resolvePreferences(dataDirOverride2);
|
|
6607
|
+
const shadowedKeys = projectKeys.filter((key) => projectPreferences[key] !== resolved[key]);
|
|
6608
|
+
return {
|
|
6609
|
+
outcome: shadowedKeys.length > 0 ? "keysShadowed" /* KeysShadowed */ : "noAction" /* NoAction */,
|
|
6610
|
+
projectFilePath,
|
|
6611
|
+
shadowedKeys
|
|
6612
|
+
};
|
|
6587
6613
|
}
|
|
6588
6614
|
function validatePreference(key, value) {
|
|
6589
6615
|
const validKeys = Object.values(PreferenceKey);
|
|
@@ -6596,77 +6622,134 @@ function validatePreference(key, value) {
|
|
|
6596
6622
|
function formatPreferencesOneLiner(prefs) {
|
|
6597
6623
|
return Object.entries(prefs).map(([key, value]) => `${key}=${value}`).join(" ");
|
|
6598
6624
|
}
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
var
|
|
6602
|
-
|
|
6603
|
-
|
|
6625
|
+
|
|
6626
|
+
// packages/mcps/src/shared/cwd-keyed-cache-constants.ts
|
|
6627
|
+
var CWD_KEYED_CACHE_VERSION = 1;
|
|
6628
|
+
var LEGACY_CACHE_DIR_NAME = ".muggle-ai";
|
|
6629
|
+
var MUGGLE_HOME_DISPLAY_DIR = "~/.muggle-ai";
|
|
6630
|
+
|
|
6631
|
+
// packages/mcps/src/shared/cwd-keyed-cache.ts
|
|
6632
|
+
function resolveHomeFilePath(cache) {
|
|
6633
|
+
return path9.join(getDataDir(), cache.fileName);
|
|
6634
|
+
}
|
|
6635
|
+
function resolveLegacyFilePath(cache, cwd) {
|
|
6636
|
+
return path9.join(cwd, LEGACY_CACHE_DIR_NAME, cache.fileName);
|
|
6637
|
+
}
|
|
6638
|
+
function parseJsonFile(filePath) {
|
|
6604
6639
|
try {
|
|
6605
6640
|
if (!fs5.existsSync(filePath)) {
|
|
6606
6641
|
return null;
|
|
6607
6642
|
}
|
|
6608
|
-
|
|
6609
|
-
return raw.lastProject ?? null;
|
|
6643
|
+
return JSON.parse(fs5.readFileSync(filePath, "utf-8"));
|
|
6610
6644
|
} catch (error) {
|
|
6611
|
-
getLogger().warn("Failed to read
|
|
6645
|
+
getLogger().warn("Failed to read cache file", {
|
|
6612
6646
|
path: filePath,
|
|
6613
6647
|
error: error instanceof Error ? error.message : String(error)
|
|
6614
6648
|
});
|
|
6615
6649
|
return null;
|
|
6616
6650
|
}
|
|
6617
6651
|
}
|
|
6618
|
-
function
|
|
6619
|
-
const
|
|
6620
|
-
|
|
6621
|
-
|
|
6652
|
+
function readHomeEntries(cache) {
|
|
6653
|
+
const parsed = parseJsonFile(resolveHomeFilePath(cache));
|
|
6654
|
+
return parsed?.entries ?? {};
|
|
6655
|
+
}
|
|
6656
|
+
function writeHomeEntries(cache, entries) {
|
|
6657
|
+
fs5.mkdirSync(getDataDir(), { recursive: true });
|
|
6622
6658
|
const file = {
|
|
6623
|
-
version:
|
|
6624
|
-
|
|
6659
|
+
version: CWD_KEYED_CACHE_VERSION,
|
|
6660
|
+
entries
|
|
6625
6661
|
};
|
|
6626
|
-
fs5.writeFileSync(
|
|
6627
|
-
|
|
6662
|
+
fs5.writeFileSync(
|
|
6663
|
+
resolveHomeFilePath(cache),
|
|
6664
|
+
`${JSON.stringify(file, null, 2)}
|
|
6665
|
+
`,
|
|
6666
|
+
"utf-8"
|
|
6667
|
+
);
|
|
6628
6668
|
}
|
|
6629
|
-
function
|
|
6630
|
-
const
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6669
|
+
function readLegacyEntry(cache, cwd) {
|
|
6670
|
+
const parsed = parseJsonFile(
|
|
6671
|
+
resolveLegacyFilePath(cache, cwd)
|
|
6672
|
+
);
|
|
6673
|
+
return parsed?.[cache.legacyEntryKey] ?? null;
|
|
6634
6674
|
}
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6675
|
+
function readCwdEntry(cache, cwd) {
|
|
6676
|
+
const cwdKey = path9.resolve(cwd);
|
|
6677
|
+
const entries = readHomeEntries(cache);
|
|
6678
|
+
const homeEntry = entries[cwdKey];
|
|
6679
|
+
if (homeEntry) {
|
|
6680
|
+
return homeEntry;
|
|
6681
|
+
}
|
|
6682
|
+
const legacyEntry = readLegacyEntry(cache, cwd);
|
|
6683
|
+
if (!legacyEntry) {
|
|
6684
|
+
return null;
|
|
6685
|
+
}
|
|
6640
6686
|
try {
|
|
6641
|
-
|
|
6642
|
-
return null;
|
|
6643
|
-
}
|
|
6644
|
-
const raw = JSON.parse(fs5.readFileSync(filePath, "utf-8"));
|
|
6645
|
-
return raw.lastHost ?? null;
|
|
6687
|
+
writeHomeEntries(cache, { ...entries, [cwdKey]: legacyEntry });
|
|
6646
6688
|
} catch (error) {
|
|
6647
|
-
getLogger().warn("Failed to
|
|
6648
|
-
path:
|
|
6689
|
+
getLogger().warn("Failed to migrate cache entry to the home directory", {
|
|
6690
|
+
path: resolveHomeFilePath(cache),
|
|
6649
6691
|
error: error instanceof Error ? error.message : String(error)
|
|
6650
6692
|
});
|
|
6651
|
-
return null;
|
|
6652
6693
|
}
|
|
6694
|
+
return legacyEntry;
|
|
6695
|
+
}
|
|
6696
|
+
function writeCwdEntry(cache, cwd, entry) {
|
|
6697
|
+
const entries = readHomeEntries(cache);
|
|
6698
|
+
writeHomeEntries(cache, { ...entries, [path9.resolve(cwd)]: entry });
|
|
6699
|
+
}
|
|
6700
|
+
function clearCwdEntry(cache, cwd) {
|
|
6701
|
+
const entries = readHomeEntries(cache);
|
|
6702
|
+
const cwdKey = path9.resolve(cwd);
|
|
6703
|
+
if (cwdKey in entries) {
|
|
6704
|
+
delete entries[cwdKey];
|
|
6705
|
+
writeHomeEntries(cache, entries);
|
|
6706
|
+
}
|
|
6707
|
+
const legacyFilePath = resolveLegacyFilePath(cache, cwd);
|
|
6708
|
+
if (fs5.existsSync(legacyFilePath)) {
|
|
6709
|
+
fs5.unlinkSync(legacyFilePath);
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6712
|
+
|
|
6713
|
+
// packages/mcps/src/shared/last-project-constants.ts
|
|
6714
|
+
var LAST_PROJECT_FILE_NAME = "last-project.json";
|
|
6715
|
+
var LAST_PROJECT_CACHE = {
|
|
6716
|
+
fileName: LAST_PROJECT_FILE_NAME,
|
|
6717
|
+
legacyEntryKey: "lastProject"
|
|
6718
|
+
};
|
|
6719
|
+
|
|
6720
|
+
// packages/mcps/src/shared/last-project.ts
|
|
6721
|
+
function readLastProject(cwd) {
|
|
6722
|
+
return readCwdEntry(LAST_PROJECT_CACHE, cwd);
|
|
6723
|
+
}
|
|
6724
|
+
function writeLastProject(cwd, lastProject) {
|
|
6725
|
+
writeCwdEntry(LAST_PROJECT_CACHE, cwd, {
|
|
6726
|
+
...lastProject,
|
|
6727
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6728
|
+
});
|
|
6729
|
+
}
|
|
6730
|
+
function clearLastProject(cwd) {
|
|
6731
|
+
clearCwdEntry(LAST_PROJECT_CACHE, cwd);
|
|
6732
|
+
}
|
|
6733
|
+
|
|
6734
|
+
// packages/mcps/src/shared/last-host-constants.ts
|
|
6735
|
+
var LAST_HOST_FILE_NAME = "last-host.json";
|
|
6736
|
+
var LAST_HOST_CACHE = {
|
|
6737
|
+
fileName: LAST_HOST_FILE_NAME,
|
|
6738
|
+
legacyEntryKey: "lastHost"
|
|
6739
|
+
};
|
|
6740
|
+
|
|
6741
|
+
// packages/mcps/src/shared/last-host.ts
|
|
6742
|
+
function readLastHost(cwd) {
|
|
6743
|
+
return readCwdEntry(LAST_HOST_CACHE, cwd);
|
|
6653
6744
|
}
|
|
6654
6745
|
function writeLastHost(cwd, host) {
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
version: LAST_HOST_VERSION,
|
|
6660
|
-
lastHost: { host, savedAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
6661
|
-
};
|
|
6662
|
-
fs5.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}
|
|
6663
|
-
`, "utf-8");
|
|
6746
|
+
writeCwdEntry(LAST_HOST_CACHE, cwd, {
|
|
6747
|
+
host,
|
|
6748
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6749
|
+
});
|
|
6664
6750
|
}
|
|
6665
6751
|
function clearLastHost(cwd) {
|
|
6666
|
-
|
|
6667
|
-
if (fs5.existsSync(filePath)) {
|
|
6668
|
-
fs5.unlinkSync(filePath);
|
|
6669
|
-
}
|
|
6752
|
+
clearCwdEntry(LAST_HOST_CACHE, cwd);
|
|
6670
6753
|
}
|
|
6671
6754
|
|
|
6672
6755
|
// packages/mcps/src/mcp/tools/local/tool-registry.ts
|
|
@@ -6765,42 +6848,42 @@ var runResultGetTool = {
|
|
|
6765
6848
|
logger6.info("Executing muggle-local-run-result-get");
|
|
6766
6849
|
const input = RunResultGetInputSchema.parse(ctx.input);
|
|
6767
6850
|
const storage = getRunResultStorageService();
|
|
6768
|
-
const
|
|
6769
|
-
if (!
|
|
6851
|
+
const storedRunResult = storage.getRunResult(input.runId);
|
|
6852
|
+
if (!storedRunResult) {
|
|
6770
6853
|
return { content: `Run result not found: ${input.runId}`, isError: true };
|
|
6771
6854
|
}
|
|
6772
6855
|
const contentParts = [
|
|
6773
6856
|
"## Run Result Details",
|
|
6774
6857
|
"",
|
|
6775
|
-
`**ID:** ${
|
|
6776
|
-
`**Type:** ${
|
|
6777
|
-
`**Status:** ${
|
|
6778
|
-
`**Cloud Test Case:** ${
|
|
6779
|
-
`**Duration:** ${
|
|
6780
|
-
|
|
6858
|
+
`**ID:** ${storedRunResult.id}`,
|
|
6859
|
+
`**Type:** ${storedRunResult.runType}`,
|
|
6860
|
+
`**Status:** ${storedRunResult.status}`,
|
|
6861
|
+
`**Cloud Test Case:** ${storedRunResult.cloudTestCaseId}`,
|
|
6862
|
+
`**Duration:** ${storedRunResult.executionTimeMs ?? 0}ms`,
|
|
6863
|
+
storedRunResult.errorMessage ? `**Error:** ${storedRunResult.errorMessage}` : "",
|
|
6781
6864
|
// The studio publishes the run during execution; these are its returned cloud refs.
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6865
|
+
storedRunResult.viewUrl ? `**View URL:** ${storedRunResult.viewUrl}` : "",
|
|
6866
|
+
storedRunResult.cloudTestScriptId ? `**Cloud Test Script ID:** ${storedRunResult.cloudTestScriptId}` : "",
|
|
6867
|
+
storedRunResult.cloudActionScriptId ? `**Cloud Action Script ID:** ${storedRunResult.cloudActionScriptId}` : ""
|
|
6785
6868
|
];
|
|
6786
6869
|
let testScriptSteps;
|
|
6787
|
-
if (
|
|
6788
|
-
const testScript = storage.getTestScript(
|
|
6870
|
+
if (storedRunResult.testScriptId) {
|
|
6871
|
+
const testScript = storage.getTestScript(storedRunResult.testScriptId);
|
|
6789
6872
|
testScriptSteps = testScript?.actionScript?.length;
|
|
6790
6873
|
}
|
|
6791
|
-
if (
|
|
6874
|
+
if (storedRunResult.artifactsDir && fs5.existsSync(storedRunResult.artifactsDir)) {
|
|
6792
6875
|
contentParts.push(
|
|
6793
6876
|
"",
|
|
6794
6877
|
"### Artifacts (view action script + screenshots)",
|
|
6795
6878
|
"",
|
|
6796
|
-
`**Location:** \`${
|
|
6879
|
+
`**Location:** \`${storedRunResult.artifactsDir}\``,
|
|
6797
6880
|
""
|
|
6798
6881
|
);
|
|
6799
|
-
const actionScriptPath = path9.join(
|
|
6800
|
-
const resultsMdPath = path9.join(
|
|
6801
|
-
const screenshotsDir = path9.join(
|
|
6802
|
-
const stdoutLogPath = path9.join(
|
|
6803
|
-
const stderrLogPath = path9.join(
|
|
6882
|
+
const actionScriptPath = path9.join(storedRunResult.artifactsDir, "action-script.json");
|
|
6883
|
+
const resultsMdPath = path9.join(storedRunResult.artifactsDir, "results.md");
|
|
6884
|
+
const screenshotsDir = path9.join(storedRunResult.artifactsDir, "screenshots");
|
|
6885
|
+
const stdoutLogPath = path9.join(storedRunResult.artifactsDir, "stdout.log");
|
|
6886
|
+
const stderrLogPath = path9.join(storedRunResult.artifactsDir, "stderr.log");
|
|
6804
6887
|
const artifactItems = [];
|
|
6805
6888
|
if (fs5.existsSync(actionScriptPath)) {
|
|
6806
6889
|
artifactItems.push("- `action-script.json` \u2014 generated test steps");
|
|
@@ -6826,13 +6909,13 @@ var runResultGetTool = {
|
|
|
6826
6909
|
"",
|
|
6827
6910
|
"### Ending state",
|
|
6828
6911
|
"",
|
|
6829
|
-
`- **Status:** ${
|
|
6830
|
-
`- **Duration:** ${
|
|
6912
|
+
`- **Status:** ${storedRunResult.status}`,
|
|
6913
|
+
`- **Duration:** ${storedRunResult.executionTimeMs ?? 0}ms`,
|
|
6831
6914
|
testScriptSteps !== void 0 ? `- **Steps generated:** ${testScriptSteps}` : "",
|
|
6832
|
-
|
|
6915
|
+
storedRunResult.artifactsDir ? `- **Artifacts path:** \`${storedRunResult.artifactsDir}\`` : ""
|
|
6833
6916
|
);
|
|
6834
6917
|
const content = contentParts.filter(Boolean).join("\n");
|
|
6835
|
-
return { content, isError: false, data:
|
|
6918
|
+
return { content, isError: false, data: storedRunResult };
|
|
6836
6919
|
}
|
|
6837
6920
|
};
|
|
6838
6921
|
var testScriptListTool = {
|
|
@@ -6892,7 +6975,7 @@ var executeTestGenerationTool = {
|
|
|
6892
6975
|
const input = ExecuteTestGenerationInputSchema.parse(ctx.input);
|
|
6893
6976
|
const showUi = input.showUi !== false;
|
|
6894
6977
|
try {
|
|
6895
|
-
const
|
|
6978
|
+
const generationRun = await executeTestGeneration({
|
|
6896
6979
|
testCase: input.testCase,
|
|
6897
6980
|
localUrl: input.localUrl,
|
|
6898
6981
|
cwd: input.cwd,
|
|
@@ -6902,19 +6985,19 @@ var executeTestGenerationTool = {
|
|
|
6902
6985
|
freshSession: input.freshSession
|
|
6903
6986
|
});
|
|
6904
6987
|
const content = [
|
|
6905
|
-
"## Test Generation " + (
|
|
6988
|
+
"## Test Generation " + (generationRun.status === "passed" ? "Successful" : "Failed"),
|
|
6906
6989
|
"",
|
|
6907
|
-
`**Run ID:** ${
|
|
6908
|
-
`**Test Script ID:** ${
|
|
6909
|
-
`**Status:** ${
|
|
6910
|
-
`**Duration:** ${
|
|
6990
|
+
`**Run ID:** ${generationRun.id}`,
|
|
6991
|
+
`**Test Script ID:** ${generationRun.testScriptId}`,
|
|
6992
|
+
`**Status:** ${generationRun.status}`,
|
|
6993
|
+
`**Duration:** ${generationRun.executionTimeMs}ms`,
|
|
6911
6994
|
`**UI:** ${showUi ? "visible GUI" : "headless"}`,
|
|
6912
|
-
|
|
6995
|
+
generationRun.errorMessage ? `**Error:** ${generationRun.errorMessage}` : ""
|
|
6913
6996
|
].filter(Boolean).join("\n");
|
|
6914
6997
|
return {
|
|
6915
6998
|
content,
|
|
6916
|
-
isError:
|
|
6917
|
-
data:
|
|
6999
|
+
isError: generationRun.status !== "passed",
|
|
7000
|
+
data: generationRun
|
|
6918
7001
|
};
|
|
6919
7002
|
} catch (error) {
|
|
6920
7003
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -6933,7 +7016,7 @@ var executeReplayTool = {
|
|
|
6933
7016
|
const input = ExecuteReplayInputSchema.parse(ctx.input);
|
|
6934
7017
|
const showUi = input.showUi !== false;
|
|
6935
7018
|
try {
|
|
6936
|
-
const
|
|
7019
|
+
const replayRun = await executeReplay({
|
|
6937
7020
|
testScript: input.testScript,
|
|
6938
7021
|
actionScript: input.actionScript,
|
|
6939
7022
|
localUrl: input.localUrl,
|
|
@@ -6944,19 +7027,19 @@ var executeReplayTool = {
|
|
|
6944
7027
|
freshSession: input.freshSession
|
|
6945
7028
|
});
|
|
6946
7029
|
const content = [
|
|
6947
|
-
"## Test Replay " + (
|
|
7030
|
+
"## Test Replay " + (replayRun.status === "passed" ? "Successful" : "Failed"),
|
|
6948
7031
|
"",
|
|
6949
|
-
`**Run ID:** ${
|
|
6950
|
-
`**Test Script ID:** ${
|
|
6951
|
-
`**Status:** ${
|
|
6952
|
-
`**Duration:** ${
|
|
7032
|
+
`**Run ID:** ${replayRun.id}`,
|
|
7033
|
+
`**Test Script ID:** ${replayRun.testScriptId}`,
|
|
7034
|
+
`**Status:** ${replayRun.status}`,
|
|
7035
|
+
`**Duration:** ${replayRun.executionTimeMs}ms`,
|
|
6953
7036
|
`**UI:** ${showUi ? "visible GUI" : "headless"}`,
|
|
6954
|
-
|
|
7037
|
+
replayRun.errorMessage ? `**Error:** ${replayRun.errorMessage}` : ""
|
|
6955
7038
|
].filter(Boolean).join("\n");
|
|
6956
7039
|
return {
|
|
6957
7040
|
content,
|
|
6958
|
-
isError:
|
|
6959
|
-
data:
|
|
7041
|
+
isError: replayRun.status !== "passed",
|
|
7042
|
+
data: replayRun
|
|
6960
7043
|
};
|
|
6961
7044
|
} catch (error) {
|
|
6962
7045
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -6982,27 +7065,22 @@ var cancelExecutionTool = {
|
|
|
6982
7065
|
};
|
|
6983
7066
|
var preferencesSetTool = {
|
|
6984
7067
|
name: "muggle-local-preferences-set",
|
|
6985
|
-
description: "Set a Muggle AI user preference. Preferences control automation behavior (auto-login, show browser, suggest test cases, etc.). Values: 'always' (proceed without asking), 'ask' (prompt each time), 'never' (skip without asking).
|
|
7068
|
+
description: "Set a Muggle AI user preference. Preferences control automation behavior (auto-login, show browser, suggest test cases, etc.). Values: 'always' (proceed without asking), 'ask' (prompt each time), 'never' (skip without asking). Preferences are user-level: they always write to ~/.muggle-ai/preferences.json and apply to every repo.",
|
|
6986
7069
|
inputSchema: PreferencesSetInputSchema,
|
|
6987
7070
|
execute: async (ctx) => {
|
|
6988
7071
|
const logger6 = createChildLogger2(ctx.correlationId);
|
|
6989
7072
|
logger6.info("Executing muggle-local-preferences-set");
|
|
6990
7073
|
const input = PreferencesSetInputSchema.parse(ctx.input);
|
|
6991
|
-
writePreferences2(
|
|
6992
|
-
{ [input.key]: input.value },
|
|
6993
|
-
input.scope,
|
|
6994
|
-
void 0,
|
|
6995
|
-
input.cwd
|
|
6996
|
-
);
|
|
7074
|
+
writePreferences2({ [input.key]: input.value });
|
|
6997
7075
|
return {
|
|
6998
|
-
content: `**${input.key}** set to **${input.value}
|
|
7076
|
+
content: `**${input.key}** set to **${input.value}**.`,
|
|
6999
7077
|
isError: false
|
|
7000
7078
|
};
|
|
7001
7079
|
}
|
|
7002
7080
|
};
|
|
7003
7081
|
var lastProjectGetTool = {
|
|
7004
7082
|
name: "muggle-local-last-project-get",
|
|
7005
|
-
description:
|
|
7083
|
+
description: `Get the cached last-used Muggle Test project for a repo (read from the entry keyed on <cwd> in ${MUGGLE_HOME_DISPLAY_DIR}/${LAST_PROJECT_FILE_NAME}). Returns the project ID, URL, name, and saved-at timestamp, or null if no cache exists. Skills consult this when 'autoSelectProject = always' to silently reuse the project the user picked previously, instead of presenting the project picker every time.`,
|
|
7006
7084
|
inputSchema: LastProjectGetInputSchema,
|
|
7007
7085
|
execute: async (ctx) => {
|
|
7008
7086
|
const logger6 = createChildLogger2(ctx.correlationId);
|
|
@@ -7013,7 +7091,7 @@ var lastProjectGetTool = {
|
|
|
7013
7091
|
const content2 = [
|
|
7014
7092
|
"No cached last-used project for this repo.",
|
|
7015
7093
|
"",
|
|
7016
|
-
`Looked at: \`${
|
|
7094
|
+
`Looked at: \`${MUGGLE_HOME_DISPLAY_DIR}/${LAST_PROJECT_FILE_NAME}\` (entry for \`${input.cwd}\`)`,
|
|
7017
7095
|
"",
|
|
7018
7096
|
"The cache is populated when a user picks an existing project AND chooses 'Yes, save it' on the memory picker (the autoSelectProject preference)."
|
|
7019
7097
|
].join("\n");
|
|
@@ -7032,7 +7110,7 @@ var lastProjectGetTool = {
|
|
|
7032
7110
|
};
|
|
7033
7111
|
var lastProjectSetTool = {
|
|
7034
7112
|
name: "muggle-local-last-project-set",
|
|
7035
|
-
description:
|
|
7113
|
+
description: `Save the user's selected Muggle Test project as the cached last-used project for this repo. Writes the entry keyed on <cwd> in ${MUGGLE_HOME_DISPLAY_DIR}/${LAST_PROJECT_FILE_NAME}. Subsequent skill invocations honor 'autoSelectProject = always' by silently reusing this entry \u2014 no project picker shown. Always pair this call with 'muggle-local-preferences-set autoSelectProject=always' when the user chose 'Yes, save it'.`,
|
|
7036
7114
|
inputSchema: LastProjectSetInputSchema,
|
|
7037
7115
|
execute: async (ctx) => {
|
|
7038
7116
|
const logger6 = createChildLogger2(ctx.correlationId);
|
|
@@ -7046,7 +7124,7 @@ var lastProjectSetTool = {
|
|
|
7046
7124
|
const content = [
|
|
7047
7125
|
`Cached **${input.projectName}** as the last-used project for this repo.`,
|
|
7048
7126
|
"",
|
|
7049
|
-
`Written to: \`${
|
|
7127
|
+
`Written to: \`${MUGGLE_HOME_DISPLAY_DIR}/${LAST_PROJECT_FILE_NAME}\` (entry for \`${input.cwd}\`)`,
|
|
7050
7128
|
"",
|
|
7051
7129
|
"Skills will silently reuse this project on future runs when `autoSelectProject = always`."
|
|
7052
7130
|
].join("\n");
|
|
@@ -7065,14 +7143,14 @@ var lastProjectClearTool = {
|
|
|
7065
7143
|
const content = [
|
|
7066
7144
|
"Cleared the cached last-used project for this repo.",
|
|
7067
7145
|
"",
|
|
7068
|
-
`Path: \`${
|
|
7146
|
+
`Path: \`${MUGGLE_HOME_DISPLAY_DIR}/${LAST_PROJECT_FILE_NAME}\` (entry for \`${input.cwd}\`)`
|
|
7069
7147
|
].join("\n");
|
|
7070
7148
|
return { content, isError: false };
|
|
7071
7149
|
}
|
|
7072
7150
|
};
|
|
7073
7151
|
var lastHostGetTool = {
|
|
7074
7152
|
name: "muggle-local-last-host-get",
|
|
7075
|
-
description:
|
|
7153
|
+
description: `Get the cached last-used local dev server URL for a repo (read from the entry keyed on <cwd> in ${MUGGLE_HOME_DISPLAY_DIR}/${LAST_HOST_FILE_NAME}). Returns the URL and saved-at timestamp, or null if no cache exists. Skills consult this when 'autoSelectLocalHost = always' to silently reuse the URL the user used previously.`,
|
|
7076
7154
|
inputSchema: LastHostGetInputSchema,
|
|
7077
7155
|
execute: async (ctx) => {
|
|
7078
7156
|
const logger6 = createChildLogger2(ctx.correlationId);
|
|
@@ -7083,7 +7161,7 @@ var lastHostGetTool = {
|
|
|
7083
7161
|
const content2 = [
|
|
7084
7162
|
"No cached last-used host for this repo.",
|
|
7085
7163
|
"",
|
|
7086
|
-
`Looked at: \`${
|
|
7164
|
+
`Looked at: \`${MUGGLE_HOME_DISPLAY_DIR}/${LAST_HOST_FILE_NAME}\` (entry for \`${input.cwd}\`)`
|
|
7087
7165
|
].join("\n");
|
|
7088
7166
|
return { content: content2, isError: false };
|
|
7089
7167
|
}
|
|
@@ -7098,7 +7176,7 @@ var lastHostGetTool = {
|
|
|
7098
7176
|
};
|
|
7099
7177
|
var lastHostSetTool = {
|
|
7100
7178
|
name: "muggle-local-last-host-set",
|
|
7101
|
-
description:
|
|
7179
|
+
description: `Save the user's chosen local dev server URL as the cached last-used host for this repo. Writes the entry keyed on <cwd> in ${MUGGLE_HOME_DISPLAY_DIR}/${LAST_HOST_FILE_NAME}. Call this on every host pick (independent of 'Remember this URL?' Picker 2) so future runs can offer 'Use {lastHost}' regardless of whether the user opted to set autoSelectLocalHost=always.`,
|
|
7102
7180
|
inputSchema: LastHostSetInputSchema,
|
|
7103
7181
|
execute: async (ctx) => {
|
|
7104
7182
|
const logger6 = createChildLogger2(ctx.correlationId);
|
|
@@ -7208,7 +7286,7 @@ async function executeTool(name, input, correlationId) {
|
|
|
7208
7286
|
props: { toolName: name, toolSurface: ToolSurface.Local, correlationId }
|
|
7209
7287
|
});
|
|
7210
7288
|
try {
|
|
7211
|
-
const
|
|
7289
|
+
const toolResult = await tool.execute({ input, correlationId });
|
|
7212
7290
|
safeTrack2({
|
|
7213
7291
|
name: EventName.McpToolCompleted,
|
|
7214
7292
|
props: {
|
|
@@ -7216,10 +7294,10 @@ async function executeTool(name, input, correlationId) {
|
|
|
7216
7294
|
toolSurface: ToolSurface.Local,
|
|
7217
7295
|
correlationId,
|
|
7218
7296
|
durationMs: Date.now() - startTime,
|
|
7219
|
-
outcome:
|
|
7297
|
+
outcome: toolResult.isError ? Outcome.Error : Outcome.Success
|
|
7220
7298
|
}
|
|
7221
7299
|
});
|
|
7222
|
-
return
|
|
7300
|
+
return toolResult;
|
|
7223
7301
|
} catch (err) {
|
|
7224
7302
|
safeTrack2({
|
|
7225
7303
|
name: EventName.McpToolCompleted,
|
|
@@ -7463,4 +7541,4 @@ var plugins_exports = {};
|
|
|
7463
7541
|
// packages/mcps/src/mcp/agents/index.ts
|
|
7464
7542
|
var agents_exports = {};
|
|
7465
7543
|
|
|
7466
|
-
export { DEFAULT_PREFERENCES, EventName, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ServiceName, Surface, __export, __require, buildElectronAppChecksumsUrl, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, calculateFileChecksum, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports2 as e2e_exports, formatPreferencesOneLiner, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDataDir2 as getDataDir, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getPlatformKey, getQaTools, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isFirstRun, loadApiKeyData, loadCredentials, local_exports2 as local_exports, markDisclosureShown, mcp_exports, openBrowserUrl, performLogin, performLogout, pollDeviceCode,
|
|
7544
|
+
export { DEFAULT_PREFERENCES, EventName, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, ServiceName, Surface, __export, __require, buildElectronAppChecksumsUrl, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, calculateFileChecksum, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports2 as e2e_exports, formatPreferencesOneLiner, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDataDir2 as getDataDir, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getPlatformKey, getQaTools, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isFirstRun, loadApiKeyData, loadCredentials, local_exports2 as local_exports, markDisclosureShown, mcp_exports, openBrowserUrl, performLogin, performLogout, pollDeviceCode, reconcileProjectPreferences, resetConfig, resetLogger, resetPreference, resolveElectronAppPathOrNull, resolvePreferences, saveApiKey, saveApiKeyData, saveCredentials, src_exports, startDeviceCodeFlow, toolRequiresAuth, track, validatePreference, verifyFileChecksum, writePreferences2 as writePreferences };
|