@livx.cc/agentx 0.99.26 → 0.99.27
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/cli.js +21 -38
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -14819,33 +14819,28 @@ ${task}`;
|
|
|
14819
14819
|
}
|
|
14820
14820
|
return;
|
|
14821
14821
|
}
|
|
14822
|
-
const
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
`
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
{ label: "reconnect", value: "reconnect", desc: "remount a server (hung/restarted)" },
|
|
14840
|
-
{ label: "remove", value: "remove", desc: "unmount an MCP server" },
|
|
14841
|
-
{ label: "resources", value: "resources", desc: "list server resources" }
|
|
14842
|
-
] : []
|
|
14843
|
-
];
|
|
14844
|
-
const picked = await selectMenu(process.stderr, { title: "MCP servers", items });
|
|
14822
|
+
const items = mounted.map((m) => {
|
|
14823
|
+
const ver = m.serverInfo?.name ? ` \xB7 ${m.serverInfo.name}${m.serverInfo.version ? " v" + m.serverInfo.version : ""}` : "";
|
|
14824
|
+
return {
|
|
14825
|
+
label: `${green("\u2713")} ${cyan(m.name)}`,
|
|
14826
|
+
value: `__srv_${m.name}`,
|
|
14827
|
+
desc: `${m.tools.length} tools${ver}`,
|
|
14828
|
+
children: [
|
|
14829
|
+
{ label: "tools", value: `tools:${m.name}`, desc: "list this server's tools" },
|
|
14830
|
+
{ label: "resources", value: `resources:${m.name}`, desc: "list server resources" },
|
|
14831
|
+
{ label: "reconnect", value: `reconnect:${m.name}`, desc: "remount (hung/restarted)" },
|
|
14832
|
+
...m.config?.url ? [{ label: "login", value: `login:${m.name}`, desc: "authenticate (OAuth)" }] : [],
|
|
14833
|
+
{ label: "remove", value: `remove:${m.name}`, desc: "unmount this server" }
|
|
14834
|
+
]
|
|
14835
|
+
};
|
|
14836
|
+
});
|
|
14837
|
+
items.push({ label: `${dim("+")} add server`, value: "add", desc: "mount a new MCP server" });
|
|
14838
|
+
const picked = await selectMenu(process.stderr, { title: `MCP servers (${mounted.length})`, items });
|
|
14845
14839
|
if (!picked) return;
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14840
|
+
const ci = picked.indexOf(":");
|
|
14841
|
+
if (ci >= 0) {
|
|
14842
|
+
a = [picked.slice(0, ci), picked.slice(ci + 1)];
|
|
14843
|
+
return builtins.mcp.run(a);
|
|
14849
14844
|
}
|
|
14850
14845
|
a = [picked];
|
|
14851
14846
|
if (picked === "add") {
|
|
@@ -14861,18 +14856,6 @@ ${task}`;
|
|
|
14861
14856
|
} finally {
|
|
14862
14857
|
io.close();
|
|
14863
14858
|
}
|
|
14864
|
-
} else if (picked === "remove" || picked === "reconnect") {
|
|
14865
|
-
const rv = await selectMenu(process.stderr, { title: `${picked} server`, items: mounted.map((m) => ({ label: m.name, value: m.name })) });
|
|
14866
|
-
if (!rv) return;
|
|
14867
|
-
a = [picked, rv];
|
|
14868
|
-
} else if (picked === "tools" || picked === "resources") {
|
|
14869
|
-
if (mounted.length === 1) {
|
|
14870
|
-
a = [picked, mounted[0].name];
|
|
14871
|
-
} else {
|
|
14872
|
-
const rv = await selectMenu(process.stderr, { title: `server ${picked}`, items: [{ label: "(all)", value: "" }, ...mounted.map((m) => ({ label: m.name, value: m.name }))] });
|
|
14873
|
-
if (rv === null) return;
|
|
14874
|
-
a = rv ? [picked, rv] : [picked];
|
|
14875
|
-
}
|
|
14876
14859
|
}
|
|
14877
14860
|
return builtins.mcp.run(a);
|
|
14878
14861
|
}
|