@atlisp/mcp 1.3.2 → 1.3.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/dist/atlisp-mcp.js +6 -6
- package/package.json +1 -1
package/dist/atlisp-mcp.js
CHANGED
|
@@ -633,7 +633,7 @@ async function getFunctionUsage(funcName, packageName) {
|
|
|
633
633
|
const response = await fetch(FUNCTIONS_URL, { headers: { "User-Agent": "atlisp-mcp" } });
|
|
634
634
|
if (response.ok) {
|
|
635
635
|
const data = await response.json();
|
|
636
|
-
const funcs = data.
|
|
636
|
+
const funcs = Object.values(data.all_functions || {});
|
|
637
637
|
const func = funcs.find((f2) => f2.name === funcName || f2.name === `${packageName}:${funcName}`);
|
|
638
638
|
if (func) results.push(func);
|
|
639
639
|
}
|
|
@@ -663,14 +663,14 @@ async function getFunctionUsage(funcName, packageName) {
|
|
|
663
663
|
return { content: [{ type: "text", text: `\u9519\u8BEF: ${e.message}` }], isError: true };
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
async function
|
|
666
|
+
async function listSymbols(packageName) {
|
|
667
667
|
try {
|
|
668
668
|
let allFuncs = [];
|
|
669
669
|
try {
|
|
670
670
|
const response = await fetch(FUNCTIONS_URL, { headers: { "User-Agent": "atlisp-mcp" } });
|
|
671
671
|
if (response.ok) {
|
|
672
672
|
const data = await response.json();
|
|
673
|
-
const funcs = data.
|
|
673
|
+
const funcs = Object.values(data.all_functions || {});
|
|
674
674
|
if (packageName) {
|
|
675
675
|
allFuncs = funcs.filter((f) => f.name.startsWith(`${packageName}:`));
|
|
676
676
|
} else {
|
|
@@ -686,7 +686,7 @@ async function listFunctions(packageName) {
|
|
|
686
686
|
try {
|
|
687
687
|
const raw = await fs2.readFile(path3.join(FUNCTIONS_DIR, file), "utf-8");
|
|
688
688
|
const data = JSON.parse(raw);
|
|
689
|
-
const funcs = data.
|
|
689
|
+
const funcs = Object.values(data.all_functions || {});
|
|
690
690
|
if (packageName) {
|
|
691
691
|
allFuncs = funcs.filter((f) => f.name.startsWith(`${packageName}:`));
|
|
692
692
|
} else {
|
|
@@ -1864,12 +1864,12 @@ ${CAD_PLATFORMS.join("\n")}
|
|
|
1864
1864
|
install_atlisp: () => installAtlisp(),
|
|
1865
1865
|
init_atlisp: () => initAtlisp(),
|
|
1866
1866
|
get_function_usage: (a) => getFunctionUsage(a.name, a.package),
|
|
1867
|
-
list_symbols: (a) =>
|
|
1867
|
+
list_symbols: (a) => listSymbols(a.package),
|
|
1868
1868
|
import_funlib: async (a) => {
|
|
1869
1869
|
const data = await loadAtlibFunctionLib();
|
|
1870
1870
|
if (!data) return { content: [{ type: "text", text: "\u52A0\u8F7D\u51FD\u6570\u5E93\u5931\u8D25" }], isError: true };
|
|
1871
1871
|
if (a.format === "list") {
|
|
1872
|
-
const items = data.
|
|
1872
|
+
const items = Object.values(data.all_functions || {}).map((f) => `${f.name}: ${f.description || ""}`);
|
|
1873
1873
|
return { content: [{ type: "text", text: items.join("\n") }] };
|
|
1874
1874
|
}
|
|
1875
1875
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|