@swmansion/argent 0.31.2-next.0 → 0.31.2-next.1
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/mcp-server.mjs +191 -50
- package/package.json +1 -1
package/dist/mcp-server.mjs
CHANGED
|
@@ -11621,9 +11621,9 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
11621
11621
|
res += parseCharCode(source, i + 1, length, onError);
|
|
11622
11622
|
i += length;
|
|
11623
11623
|
} else {
|
|
11624
|
-
const
|
|
11625
|
-
onError(i - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${
|
|
11626
|
-
res +=
|
|
11624
|
+
const raw2 = source.substr(i - 1, 2);
|
|
11625
|
+
onError(i - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw2}`);
|
|
11626
|
+
res += raw2;
|
|
11627
11627
|
}
|
|
11628
11628
|
} else if (ch === " " || ch === " ") {
|
|
11629
11629
|
const wsStart = i;
|
|
@@ -11695,9 +11695,9 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
11695
11695
|
try {
|
|
11696
11696
|
return String.fromCodePoint(code);
|
|
11697
11697
|
} catch {
|
|
11698
|
-
const
|
|
11699
|
-
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${
|
|
11700
|
-
return
|
|
11698
|
+
const raw2 = source.substr(offset - 2, length + 2);
|
|
11699
|
+
onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw2}`);
|
|
11700
|
+
return raw2;
|
|
11701
11701
|
}
|
|
11702
11702
|
}
|
|
11703
11703
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
@@ -14826,9 +14826,9 @@ function putProp(target, key, value) {
|
|
|
14826
14826
|
target[key] = value;
|
|
14827
14827
|
}
|
|
14828
14828
|
function mirrorShape(target, source, keys, wrap) {
|
|
14829
|
-
const
|
|
14829
|
+
const raw2 = sourceShape(source);
|
|
14830
14830
|
for (const key of keys) {
|
|
14831
|
-
const desc = Object.getOwnPropertyDescriptor(
|
|
14831
|
+
const desc = Object.getOwnPropertyDescriptor(raw2, key);
|
|
14832
14832
|
if (!desc.enumerable)
|
|
14833
14833
|
continue;
|
|
14834
14834
|
if (desc.get) {
|
|
@@ -15094,10 +15094,10 @@ function pick(schema, mask) {
|
|
|
15094
15094
|
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
15095
15095
|
}
|
|
15096
15096
|
function maskedKeys(schema, mask) {
|
|
15097
|
-
const
|
|
15097
|
+
const raw2 = sourceShape(schema);
|
|
15098
15098
|
const keys = [];
|
|
15099
15099
|
for (const key of Reflect.ownKeys(mask)) {
|
|
15100
|
-
if (!Object.getOwnPropertyDescriptor(
|
|
15100
|
+
if (!Object.getOwnPropertyDescriptor(raw2, key)?.enumerable) {
|
|
15101
15101
|
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
15102
15102
|
}
|
|
15103
15103
|
if (mask[key])
|
|
@@ -18011,8 +18011,8 @@ function isRecursive(inst, stack, resolve10) {
|
|
|
18011
18011
|
const kind = def.type;
|
|
18012
18012
|
switch (kind) {
|
|
18013
18013
|
case "object": {
|
|
18014
|
-
const
|
|
18015
|
-
merge2(
|
|
18014
|
+
const raw2 = rawShape(def);
|
|
18015
|
+
merge2(raw2 ? shape(raw2, true) : ASSUMED);
|
|
18016
18016
|
check(def.catchall);
|
|
18017
18017
|
break;
|
|
18018
18018
|
}
|
|
@@ -24622,8 +24622,8 @@ function stateFileForBundle(bundlePath) {
|
|
|
24622
24622
|
}
|
|
24623
24623
|
async function readStateFile(file) {
|
|
24624
24624
|
try {
|
|
24625
|
-
const
|
|
24626
|
-
return JSON.parse(
|
|
24625
|
+
const raw2 = await readFile(file, "utf8");
|
|
24626
|
+
return JSON.parse(raw2);
|
|
24627
24627
|
} catch {
|
|
24628
24628
|
return null;
|
|
24629
24629
|
}
|
|
@@ -24972,15 +24972,15 @@ function getFlagsPath(scope, options = {}) {
|
|
|
24972
24972
|
return path2.join(resolveProjectRoot(cwd), ".argent", "flags.json");
|
|
24973
24973
|
}
|
|
24974
24974
|
function readFlagsFile(filePath) {
|
|
24975
|
-
let
|
|
24975
|
+
let raw2;
|
|
24976
24976
|
try {
|
|
24977
|
-
|
|
24977
|
+
raw2 = fs2.readFileSync(filePath, "utf8");
|
|
24978
24978
|
} catch {
|
|
24979
24979
|
return {};
|
|
24980
24980
|
}
|
|
24981
24981
|
let parsed;
|
|
24982
24982
|
try {
|
|
24983
|
-
parsed = JSON.parse(
|
|
24983
|
+
parsed = JSON.parse(raw2);
|
|
24984
24984
|
} catch {
|
|
24985
24985
|
return {};
|
|
24986
24986
|
}
|
|
@@ -25042,8 +25042,8 @@ import * as fs3 from "node:fs";
|
|
|
25042
25042
|
import * as path4 from "node:path";
|
|
25043
25043
|
function readConfigObject(scope = "global", options = {}) {
|
|
25044
25044
|
try {
|
|
25045
|
-
const
|
|
25046
|
-
const json = JSON.parse(
|
|
25045
|
+
const raw2 = fs3.readFileSync(configFilePath(scope, options), "utf8");
|
|
25046
|
+
const json = JSON.parse(raw2);
|
|
25047
25047
|
if (json && typeof json === "object" && !Array.isArray(json)) {
|
|
25048
25048
|
return json;
|
|
25049
25049
|
}
|
|
@@ -25308,23 +25308,23 @@ function applyMergePolicy(policy, local, global) {
|
|
|
25308
25308
|
|
|
25309
25309
|
// ../configuration-core/src/config-schema.ts
|
|
25310
25310
|
import { isAbsolute as isAbsolute2 } from "node:path";
|
|
25311
|
-
function asBoolean(
|
|
25312
|
-
return typeof
|
|
25311
|
+
function asBoolean(raw2) {
|
|
25312
|
+
return typeof raw2 === "boolean" ? raw2 : void 0;
|
|
25313
25313
|
}
|
|
25314
|
-
function asString(
|
|
25315
|
-
if (typeof
|
|
25316
|
-
const trimmed =
|
|
25314
|
+
function asString(raw2) {
|
|
25315
|
+
if (typeof raw2 !== "string") return void 0;
|
|
25316
|
+
const trimmed = raw2.trim();
|
|
25317
25317
|
return trimmed === "" ? void 0 : trimmed;
|
|
25318
25318
|
}
|
|
25319
|
-
function asPositiveInteger(
|
|
25320
|
-
return typeof
|
|
25319
|
+
function asPositiveInteger(raw2) {
|
|
25320
|
+
return typeof raw2 === "number" && Number.isSafeInteger(raw2) && raw2 > 0 ? raw2 : void 0;
|
|
25321
25321
|
}
|
|
25322
25322
|
var MIN_SCRIPT_HEAP_LIMIT_MB = 32;
|
|
25323
25323
|
var MIN_SCRIPT_TIMEOUT_MS = 100;
|
|
25324
|
-
function asStringArray(
|
|
25325
|
-
if (!Array.isArray(
|
|
25324
|
+
function asStringArray(raw2) {
|
|
25325
|
+
if (!Array.isArray(raw2)) return void 0;
|
|
25326
25326
|
const out = [];
|
|
25327
|
-
for (const item of
|
|
25327
|
+
for (const item of raw2) {
|
|
25328
25328
|
if (typeof item === "string" && item.trim() !== "") out.push(item.trim());
|
|
25329
25329
|
}
|
|
25330
25330
|
return out;
|
|
@@ -25374,8 +25374,8 @@ var CONFIG_SCHEMA = [
|
|
|
25374
25374
|
key: "android.sdkRoot",
|
|
25375
25375
|
description: "Android SDK root argent uses instead of `ANDROID_HOME`, for hosts whose SDK is not where the environment says (Nix, custom layouts). Absolute or `~/`-prefixed. Applies to the tool-server and to the simulator-server it starts. `adb` on PATH still wins, as it does with the environment variable.",
|
|
25376
25376
|
scopes: ["project", "global"],
|
|
25377
|
-
parse: (
|
|
25378
|
-
const value = asString(
|
|
25377
|
+
parse: (raw2) => {
|
|
25378
|
+
const value = asString(raw2);
|
|
25379
25379
|
return value !== void 0 && (value === "~" || value.startsWith("~/") || isAbsolute2(value)) ? value : void 0;
|
|
25380
25380
|
},
|
|
25381
25381
|
expected: "an absolute path, or one starting with `~/`",
|
|
@@ -25386,8 +25386,8 @@ var CONFIG_SCHEMA = [
|
|
|
25386
25386
|
key: "android.adbServerPort",
|
|
25387
25387
|
description: "Port of the adb server argent uses, for hosts that run Android devices on a server other than the default 5037 (a device pool with its own server, for example). Applies when the tool-server starts, to the tool-server and every adb and simulator-server it runs. `ANDROID_ADB_SERVER_PORT` or `ADB_SERVER_SOCKET` in the tool-server's environment still wins, as it does for adb itself.",
|
|
25388
25388
|
scopes: ["project", "global"],
|
|
25389
|
-
parse: (
|
|
25390
|
-
const value = asPositiveInteger(
|
|
25389
|
+
parse: (raw2) => {
|
|
25390
|
+
const value = asPositiveInteger(raw2);
|
|
25391
25391
|
return value !== void 0 && value < 65536 ? value : void 0;
|
|
25392
25392
|
},
|
|
25393
25393
|
expected: "a TCP port, 1-65535",
|
|
@@ -25411,8 +25411,8 @@ var CONFIG_SCHEMA = [
|
|
|
25411
25411
|
key: "scripts.maxTimeoutMs",
|
|
25412
25412
|
description: `Upper bound, in milliseconds, on the time limit an e2e test \`script\` step may ask for (default 300000 \u2014 five minutes). Bounds how long one script can occupy the host. Values below ${MIN_SCRIPT_TIMEOUT_MS} ms are refused: the step starts a Node process before the script runs, so a smaller ceiling ends a script that did nothing wrong.`,
|
|
25413
25413
|
scopes: ["global"],
|
|
25414
|
-
parse: (
|
|
25415
|
-
const value = asPositiveInteger(
|
|
25414
|
+
parse: (raw2) => {
|
|
25415
|
+
const value = asPositiveInteger(raw2);
|
|
25416
25416
|
return value !== void 0 && value >= MIN_SCRIPT_TIMEOUT_MS ? value : void 0;
|
|
25417
25417
|
},
|
|
25418
25418
|
expected: `a whole number of milliseconds, at least ${MIN_SCRIPT_TIMEOUT_MS}`,
|
|
@@ -25424,8 +25424,8 @@ var CONFIG_SCHEMA = [
|
|
|
25424
25424
|
key: "scripts.heapLimitMb",
|
|
25425
25425
|
description: `Old-space heap limit, in MiB, given to each e2e test \`script\` process (default 512). Values below ${MIN_SCRIPT_HEAP_LIMIT_MB} MiB are refused: that is already below what importing a real npm dependency needs, and under about 5 MiB the process dies inside V8's own startup before any script runs.`,
|
|
25426
25426
|
scopes: ["global"],
|
|
25427
|
-
parse: (
|
|
25428
|
-
const value = asPositiveInteger(
|
|
25427
|
+
parse: (raw2) => {
|
|
25428
|
+
const value = asPositiveInteger(raw2);
|
|
25429
25429
|
return value !== void 0 && value >= MIN_SCRIPT_HEAP_LIMIT_MB ? value : void 0;
|
|
25430
25430
|
},
|
|
25431
25431
|
expected: `a whole number of MiB, at least ${MIN_SCRIPT_HEAP_LIMIT_MB}`,
|
|
@@ -25442,8 +25442,8 @@ function getConfigDefinition(key, registry2 = CONFIG_SCHEMA) {
|
|
|
25442
25442
|
import * as path6 from "node:path";
|
|
25443
25443
|
function readScopeValue(def, scope, options) {
|
|
25444
25444
|
if (!def.scopes.includes(scope)) return void 0;
|
|
25445
|
-
const
|
|
25446
|
-
return
|
|
25445
|
+
const raw2 = getAtPath(readConfigObject(scope, options), def.key);
|
|
25446
|
+
return raw2 === void 0 ? void 0 : def.parse(raw2);
|
|
25447
25447
|
}
|
|
25448
25448
|
function getConfigValue(def, options = {}) {
|
|
25449
25449
|
const local = readScopeValue(def, "project", options);
|
|
@@ -26137,8 +26137,8 @@ var LINK_DIR = path9.join(homedir4(), ".argent");
|
|
|
26137
26137
|
var LINK_FILE = path9.join(LINK_DIR, "link.json");
|
|
26138
26138
|
async function readLinkConfig() {
|
|
26139
26139
|
try {
|
|
26140
|
-
const
|
|
26141
|
-
const parsed = JSON.parse(
|
|
26140
|
+
const raw2 = await readFile2(LINK_FILE, "utf8");
|
|
26141
|
+
const parsed = JSON.parse(raw2);
|
|
26142
26142
|
if (!parsed || typeof parsed.url !== "string" || typeof parsed.host !== "string" || typeof parsed.port !== "number" || typeof parsed.createdAt !== "string") {
|
|
26143
26143
|
return null;
|
|
26144
26144
|
}
|
|
@@ -28439,8 +28439,8 @@ function readConfigOverrideAt(filePath) {
|
|
|
28439
28439
|
}
|
|
28440
28440
|
let parsedEnabled = null;
|
|
28441
28441
|
try {
|
|
28442
|
-
const
|
|
28443
|
-
const json = JSON.parse(
|
|
28442
|
+
const raw2 = fs10.readFileSync(filePath, "utf8");
|
|
28443
|
+
const json = JSON.parse(raw2);
|
|
28444
28444
|
if (json && typeof json === "object") {
|
|
28445
28445
|
const t = json.telemetry;
|
|
28446
28446
|
if (t && typeof t === "object") {
|
|
@@ -28865,6 +28865,144 @@ function getAutoScreenshotDelayMs(toolName) {
|
|
|
28865
28865
|
return base;
|
|
28866
28866
|
}
|
|
28867
28867
|
|
|
28868
|
+
// ../argent-mcp/src/keyword-facts.ts
|
|
28869
|
+
var SHOWS_KEYWORDS = [
|
|
28870
|
+
/^claude-code\b/,
|
|
28871
|
+
/^gemini-cli-mcp-client\b/,
|
|
28872
|
+
/^zed\b/,
|
|
28873
|
+
/^kiro\b/,
|
|
28874
|
+
/^q dev cli\b/,
|
|
28875
|
+
/^copilot-cli\b/
|
|
28876
|
+
];
|
|
28877
|
+
function showsSchemaKeywords(clientName) {
|
|
28878
|
+
const name = clientName?.trim().toLowerCase() ?? "";
|
|
28879
|
+
return SHOWS_KEYWORDS.some((pattern) => pattern.test(name));
|
|
28880
|
+
}
|
|
28881
|
+
function withKeywordFacts(schema) {
|
|
28882
|
+
const properties = asSchema(schema.properties);
|
|
28883
|
+
return properties ? { ...schema, properties: withPropertyFacts(properties) } : schema;
|
|
28884
|
+
}
|
|
28885
|
+
function withPropertyFacts(properties) {
|
|
28886
|
+
return Object.fromEntries(
|
|
28887
|
+
Object.entries(properties).map(([key, value]) => {
|
|
28888
|
+
const prop = asSchema(value);
|
|
28889
|
+
return [key, prop ? withFacts(prop) : value];
|
|
28890
|
+
})
|
|
28891
|
+
);
|
|
28892
|
+
}
|
|
28893
|
+
function withFacts(prop) {
|
|
28894
|
+
const out = { ...prop };
|
|
28895
|
+
const nested = asSchema(prop.properties);
|
|
28896
|
+
if (nested) out.properties = withPropertyFacts(nested);
|
|
28897
|
+
const items = asSchema(prop.items);
|
|
28898
|
+
if (items) out.items = withKeywordFacts(items);
|
|
28899
|
+
const description = typeof prop.description === "string" ? prop.description.trimEnd() : "";
|
|
28900
|
+
const facts = factsOf(prop, description);
|
|
28901
|
+
if (facts.length === 0) return out;
|
|
28902
|
+
const separator = description === "" ? "" : /[.!?:]$/.test(description) ? " " : ". ";
|
|
28903
|
+
out.description = `${description}${separator}${facts.join(" ")}`;
|
|
28904
|
+
return out;
|
|
28905
|
+
}
|
|
28906
|
+
function factsOf(prop, description) {
|
|
28907
|
+
const facts = [];
|
|
28908
|
+
if (prop.default !== void 0 && !statesDefault(description, prop.default)) {
|
|
28909
|
+
facts.push(`Default: ${show(prop.default)}.`);
|
|
28910
|
+
}
|
|
28911
|
+
for (const branch of [prop, ...branchesOf(prop)]) {
|
|
28912
|
+
facts.push(...boundFacts(branch, description));
|
|
28913
|
+
if (branch.const !== void 0 && !mentions(description, branch.const)) {
|
|
28914
|
+
facts.push(`Also accepts ${show(branch.const)}.`);
|
|
28915
|
+
}
|
|
28916
|
+
}
|
|
28917
|
+
return facts;
|
|
28918
|
+
}
|
|
28919
|
+
function branchesOf(prop) {
|
|
28920
|
+
const branches = [prop.anyOf, prop.oneOf].flatMap((list) => Array.isArray(list) ? list : []);
|
|
28921
|
+
return branches.map(asSchema).filter((branch) => branch !== void 0);
|
|
28922
|
+
}
|
|
28923
|
+
function boundFacts(schema, description) {
|
|
28924
|
+
const facts = [];
|
|
28925
|
+
const min = bound(schema.minimum);
|
|
28926
|
+
const max = bound(schema.maximum);
|
|
28927
|
+
const above = bound(schema.exclusiveMinimum);
|
|
28928
|
+
const below = bound(schema.exclusiveMaximum);
|
|
28929
|
+
const rangeStated = min !== void 0 && max !== void 0 && statesRange(description, min, max);
|
|
28930
|
+
const showMin = min !== void 0 && !rangeStated && !statesLimit(description, MIN_WORDS, min);
|
|
28931
|
+
const showMax = max !== void 0 && !rangeStated && !statesLimit(description, MAX_WORDS, max);
|
|
28932
|
+
if (showMin && showMax) facts.push(`Range: ${min} to ${max}.`);
|
|
28933
|
+
else if (showMin) facts.push(`Minimum: ${min}.`);
|
|
28934
|
+
else if (showMax) facts.push(`Maximum: ${max}.`);
|
|
28935
|
+
if (above !== void 0 && !statesAbove(description, above)) {
|
|
28936
|
+
facts.push(`Must be greater than ${above}.`);
|
|
28937
|
+
}
|
|
28938
|
+
if (below !== void 0 && !statesLimit(description, BELOW_WORDS, below)) {
|
|
28939
|
+
facts.push(`Must be less than ${below}.`);
|
|
28940
|
+
}
|
|
28941
|
+
const lengthOrCount = [
|
|
28942
|
+
[schema.minLength, "Min length", MIN_WORDS],
|
|
28943
|
+
[schema.maxLength, "Max length", MAX_WORDS],
|
|
28944
|
+
[schema.minItems, "Min items", MIN_WORDS],
|
|
28945
|
+
[schema.maxItems, "Max items", MAX_WORDS]
|
|
28946
|
+
];
|
|
28947
|
+
for (const [value, label, words] of lengthOrCount) {
|
|
28948
|
+
const n = bound(value);
|
|
28949
|
+
const trivialMin = label.startsWith("Min") && n !== void 0 && n <= 1;
|
|
28950
|
+
if (n !== void 0 && !trivialMin && !statesLimit(description, words, n)) {
|
|
28951
|
+
facts.push(`${label}: ${n}.`);
|
|
28952
|
+
}
|
|
28953
|
+
}
|
|
28954
|
+
return facts;
|
|
28955
|
+
}
|
|
28956
|
+
var MIN_WORDS = /\b(min(imum)?|at least|no less than)\b|>=|≥/;
|
|
28957
|
+
var MAX_WORDS = /\b(max(imum)?|at most|up to|no more than|caps? at|capped at|limit)\b|<=|≤/;
|
|
28958
|
+
var BELOW_WORDS = /\b(less than|below|under)\b|</;
|
|
28959
|
+
function statesLimit(description, words, value) {
|
|
28960
|
+
return new RegExp(`(${words.source})[^.;\\n]{0,24}?${numberPattern(value)}`, "i").test(
|
|
28961
|
+
description
|
|
28962
|
+
);
|
|
28963
|
+
}
|
|
28964
|
+
function statesRange(description, min, max) {
|
|
28965
|
+
return new RegExp(
|
|
28966
|
+
`${numberPattern(min)}\\s*(\\([^)]{0,20}\\)\\s*)?(\u2013|\u2014|-|to|\\.\\.)\\s*${numberPattern(max)}`,
|
|
28967
|
+
"i"
|
|
28968
|
+
).test(description);
|
|
28969
|
+
}
|
|
28970
|
+
function statesAbove(description, value) {
|
|
28971
|
+
if (value === 0 && /\bpositive\b/i.test(description)) return true;
|
|
28972
|
+
return statesLimit(description, /\b(greater than|more than|above|over)\b|>/, value);
|
|
28973
|
+
}
|
|
28974
|
+
function statesDefault(description, value) {
|
|
28975
|
+
const v = valuePattern(raw(value));
|
|
28976
|
+
return new RegExp(
|
|
28977
|
+
`\\bdefault(s|s to| is|:)?[^.;\\n]{0,24}?${v}|${v}[^.;\\n]{0,16}\\bby default|${v}\\s*\\(default\\)`,
|
|
28978
|
+
"i"
|
|
28979
|
+
).test(description);
|
|
28980
|
+
}
|
|
28981
|
+
function mentions(description, value) {
|
|
28982
|
+
return new RegExp(valuePattern(raw(value)), "i").test(description);
|
|
28983
|
+
}
|
|
28984
|
+
function valuePattern(value) {
|
|
28985
|
+
return `(?<![\\w.])${escapeRegExp(value)}(?![\\w])`;
|
|
28986
|
+
}
|
|
28987
|
+
function numberPattern(value) {
|
|
28988
|
+
return `(?<![\\w.])${escapeRegExp(String(value))}(\\.0+)?(?![\\w]|\\.\\d)`;
|
|
28989
|
+
}
|
|
28990
|
+
function escapeRegExp(value) {
|
|
28991
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
28992
|
+
}
|
|
28993
|
+
function bound(value) {
|
|
28994
|
+
return typeof value === "number" && Math.abs(value) < Number.MAX_SAFE_INTEGER ? value : void 0;
|
|
28995
|
+
}
|
|
28996
|
+
function raw(value) {
|
|
28997
|
+
return typeof value === "string" ? value : JSON.stringify(value);
|
|
28998
|
+
}
|
|
28999
|
+
function show(value) {
|
|
29000
|
+
return JSON.stringify(value);
|
|
29001
|
+
}
|
|
29002
|
+
function asSchema(value) {
|
|
29003
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
29004
|
+
}
|
|
29005
|
+
|
|
28868
29006
|
// ../argent-mcp/src/tool-mapping.ts
|
|
28869
29007
|
function withoutRetiredParams(schema) {
|
|
28870
29008
|
const properties = schema.properties;
|
|
@@ -28875,24 +29013,25 @@ function withoutRetiredParams(schema) {
|
|
|
28875
29013
|
if (live.length === Object.keys(properties).length) return schema;
|
|
28876
29014
|
return { ...schema, properties: Object.fromEntries(live) };
|
|
28877
29015
|
}
|
|
28878
|
-
function toMcpTool(t) {
|
|
29016
|
+
function toMcpTool(t, { keywordFacts = false } = {}) {
|
|
28879
29017
|
const meta2 = {};
|
|
28880
29018
|
if (t.alwaysLoad) meta2["anthropic/alwaysLoad"] = true;
|
|
28881
29019
|
if (t.searchHint) meta2["anthropic/searchHint"] = t.searchHint;
|
|
29020
|
+
const schema = withoutRetiredParams(t.inputSchema);
|
|
28882
29021
|
return {
|
|
28883
29022
|
name: t.name,
|
|
28884
29023
|
description: t.description,
|
|
28885
|
-
inputSchema: { type: "object", ...
|
|
29024
|
+
inputSchema: { type: "object", ...keywordFacts ? withKeywordFacts(schema) : schema },
|
|
28886
29025
|
...t.readOnly ? { annotations: { readOnlyHint: true } } : {},
|
|
28887
29026
|
...Object.keys(meta2).length > 0 ? { _meta: meta2 } : {}
|
|
28888
29027
|
};
|
|
28889
29028
|
}
|
|
28890
|
-
function toMcpToolList(tools) {
|
|
28891
|
-
return tools.filter((t) => !t.hideFromMcp).map(toMcpTool);
|
|
29029
|
+
function toMcpToolList(tools, options = {}) {
|
|
29030
|
+
return tools.filter((t) => !t.hideFromMcp).map((t) => toMcpTool(t, options));
|
|
28892
29031
|
}
|
|
28893
29032
|
|
|
28894
29033
|
// ../argent-mcp/src/instructions.ts
|
|
28895
|
-
var SERVER_INSTRUCTIONS = "Argent \u2014 iOS Simulator, Android Emulator, and Chromium app control for interacting, testing, profiling and debugging mobile and Chromium applications. Interaction tools return the screen after the action: a screenshot plus the accessibility element tree with normalized tap frames. Take coordinates from that tree; call describe (or debugger-component-tree) only when no fresh tree is available \u2014 never guess coordinates from pixels. Do not stop simulator servers when a task finishes: the next task reuses them. Call stop-all-simulator-servers when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, always with devices: [...] naming the devices this session used. Never stop a Metro the user started unless they ask. One tool-server is shared by every agent using this argent install, so an unscoped call tears down their devices too \u2014 reserve it for a deliberate machine-wide cleanup.
|
|
29034
|
+
var SERVER_INSTRUCTIONS = "Argent \u2014 iOS Simulator, Android Emulator, and Chromium app control for interacting, testing, profiling and debugging mobile and Chromium applications. Interaction tools return the screen after the action: a screenshot plus the accessibility element tree with normalized tap frames. Take coordinates from that tree; call describe (or debugger-component-tree) only when no fresh tree is available \u2014 never guess coordinates from pixels. Do not stop simulator servers when a task finishes: the next task reuses them. Call stop-all-simulator-servers when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, always with devices: [...] naming the devices this session used. Never stop a Metro the user started unless they ask. One tool-server is shared by every agent using this argent install, so an unscoped call tears down their devices too \u2014 reserve it for a deliberate machine-wide cleanup.";
|
|
28896
29035
|
|
|
28897
29036
|
// ../argent-mcp/src/installed-version.ts
|
|
28898
29037
|
import * as fs11 from "node:fs";
|
|
@@ -29159,11 +29298,13 @@ ${desc}` }];
|
|
|
29159
29298
|
);
|
|
29160
29299
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
29161
29300
|
try {
|
|
29162
|
-
const
|
|
29301
|
+
const keywordFacts = !showsSchemaKeywords(server.getClientVersion()?.name);
|
|
29302
|
+
const tools = toMcpToolList(await fetchTools(), { keywordFacts });
|
|
29163
29303
|
await spyLog({
|
|
29164
29304
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
29165
29305
|
event: "list_tools",
|
|
29166
|
-
count: tools.length
|
|
29306
|
+
count: tools.length,
|
|
29307
|
+
keywordFacts
|
|
29167
29308
|
});
|
|
29168
29309
|
return { tools };
|
|
29169
29310
|
} catch (err) {
|
package/package.json
CHANGED