touchdesigner-mcp-server 1.1.0 → 1.1.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/README.ja.md +26 -75
- package/README.md +25 -74
- package/dist/core/constants.js +0 -1
- package/dist/features/tools/handlers/tdTools.js +50 -162
- package/dist/features/tools/types.js +1 -26
- package/dist/gen/endpoints/TouchDesignerAPI.js +1 -1
- package/dist/gen/mcp/touchDesignerAPI.zod.js +1 -1
- package/dist/server/touchDesignerServer.js +1 -1
- package/package.json +3 -4
- package/dist/features/tools/metadata/touchDesignerToolMetadata.js +0 -402
- package/dist/features/tools/presenter/classListFormatter.js +0 -187
- package/dist/features/tools/presenter/index.js +0 -11
- package/dist/features/tools/presenter/markdownRenderer.js +0 -25
- package/dist/features/tools/presenter/nodeDetailsFormatter.js +0 -140
- package/dist/features/tools/presenter/nodeListFormatter.js +0 -124
- package/dist/features/tools/presenter/operationFormatter.js +0 -117
- package/dist/features/tools/presenter/presenter.js +0 -62
- package/dist/features/tools/presenter/responseFormatter.js +0 -66
- package/dist/features/tools/presenter/scriptResultFormatter.js +0 -171
- package/dist/features/tools/presenter/templates/markdown/classDetailsSummary.md +0 -13
- package/dist/features/tools/presenter/templates/markdown/classListSummary.md +0 -7
- package/dist/features/tools/presenter/templates/markdown/default.md +0 -3
- package/dist/features/tools/presenter/templates/markdown/detailedPayload.md +0 -5
- package/dist/features/tools/presenter/templates/markdown/nodeDetailsSummary.md +0 -10
- package/dist/features/tools/presenter/templates/markdown/nodeListSummary.md +0 -8
- package/dist/features/tools/presenter/templates/markdown/scriptSummary.md +0 -15
- package/dist/features/tools/presenter/toolMetadataFormatter.js +0 -118
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
## Node {{nodePath}}
|
|
2
|
-
- Type: `{{type}}` (ID: {{id}})
|
|
3
|
-
- Properties shown: {{displayed}} / {{total}}
|
|
4
|
-
|
|
5
|
-
| Property | Value |
|
|
6
|
-
| --- | --- |
|
|
7
|
-
{{#properties}}| {{name}} | {{{value}}} |
|
|
8
|
-
{{/properties}}
|
|
9
|
-
|
|
10
|
-
{{#truncated}}_💡 {{omittedCount}} more properties omitted._{{/truncated}}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## Nodes in {{{parentPath}}} ({{totalCount}} total)
|
|
2
|
-
{{#groups}}
|
|
3
|
-
### {{type}} ({{count}})
|
|
4
|
-
{{#nodes}}- **{{name}}** — `{{{path}}}`
|
|
5
|
-
{{/nodes}}
|
|
6
|
-
|
|
7
|
-
{{/groups}}
|
|
8
|
-
{{#truncated}}_💡 {{omittedCount}} more node(s) omitted. Use `limit` or `detailLevel=detailed` to view all._{{/truncated}}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
## Script Result
|
|
2
|
-
- Snippet: `{{{snippet}}}`
|
|
3
|
-
- Return type: {{resultType}}
|
|
4
|
-
{{#hasOutput}}- Output type: {{outputType}}
|
|
5
|
-
{{/hasOutput}}
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
{{{resultPreview}}}
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
{{#outputPreview}}
|
|
12
|
-
```text
|
|
13
|
-
{{{outputPreview}}}
|
|
14
|
-
```
|
|
15
|
-
{{/outputPreview}}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { finalizeFormattedText, mergeFormatterOptions, } from "./responseFormatter.js";
|
|
2
|
-
export function formatToolMetadata(entries, options) {
|
|
3
|
-
const { detailLevel, responseFormat } = mergeFormatterOptions(options);
|
|
4
|
-
if (entries.length === 0) {
|
|
5
|
-
return finalizeFormattedText("No tools matched the requested criteria.", { detailLevel, responseFormat }, {
|
|
6
|
-
context: { totalTools: 0, filter: options?.filter },
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
const sortedEntries = [...entries].sort((a, b) => a.modulePath.localeCompare(b.modulePath));
|
|
10
|
-
const structured = sortedEntries.map((entry) => ({
|
|
11
|
-
tool: entry.tool,
|
|
12
|
-
modulePath: entry.modulePath,
|
|
13
|
-
functionName: entry.functionName,
|
|
14
|
-
description: entry.description,
|
|
15
|
-
category: entry.category,
|
|
16
|
-
parameters: entry.parameters,
|
|
17
|
-
returns: entry.returns,
|
|
18
|
-
notes: entry.notes,
|
|
19
|
-
}));
|
|
20
|
-
const text = buildText(sortedEntries, detailLevel);
|
|
21
|
-
return finalizeFormattedText(text, { detailLevel, responseFormat }, {
|
|
22
|
-
structured,
|
|
23
|
-
context: {
|
|
24
|
-
totalTools: sortedEntries.length,
|
|
25
|
-
filter: options?.filter,
|
|
26
|
-
},
|
|
27
|
-
template: detailLevel === "detailed" ? "detailedPayload" : undefined,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function buildText(entries, detailLevel) {
|
|
31
|
-
switch (detailLevel) {
|
|
32
|
-
case "minimal":
|
|
33
|
-
return formatTree(entries);
|
|
34
|
-
case "detailed":
|
|
35
|
-
return formatDetailed(entries);
|
|
36
|
-
default:
|
|
37
|
-
return formatSummary(entries);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function formatTree(entries) {
|
|
41
|
-
const segmentsList = entries.map((entry) => entry.modulePath.replace(/^\.\//, "").split("/"));
|
|
42
|
-
const commonSegments = findCommonDirectorySegments(segmentsList);
|
|
43
|
-
const basePath = commonSegments.length > 0 ? `${commonSegments.join("/")}/` : "./";
|
|
44
|
-
const relativePaths = entries.map((entry, index) => {
|
|
45
|
-
const segments = segmentsList[index];
|
|
46
|
-
const relative = segments.slice(commonSegments.length).join("/");
|
|
47
|
-
const connector = index === entries.length - 1 ? "└──" : "├──";
|
|
48
|
-
return `${connector} ${relative} — ${entry.description}`;
|
|
49
|
-
});
|
|
50
|
-
return ["Filesystem blueprint:", basePath, ...relativePaths].join("\n");
|
|
51
|
-
}
|
|
52
|
-
function formatSummary(entries) {
|
|
53
|
-
return entries
|
|
54
|
-
.map((entry) => {
|
|
55
|
-
const params = entry.parameters.length > 0
|
|
56
|
-
? entry.parameters
|
|
57
|
-
.map((param) => `- ${param.name}${param.required ? "" : "?"} (${param.type})${param.description ? ` — ${param.description}` : ""}`)
|
|
58
|
-
.join("\n")
|
|
59
|
-
: "- (no parameters)";
|
|
60
|
-
return `${entry.functionName} (${entry.modulePath})
|
|
61
|
-
Tool: ${entry.tool}
|
|
62
|
-
Category: ${entry.category}
|
|
63
|
-
Description: ${entry.description}
|
|
64
|
-
Parameters:
|
|
65
|
-
${params}
|
|
66
|
-
Returns: ${entry.returns}`;
|
|
67
|
-
})
|
|
68
|
-
.join("\n\n");
|
|
69
|
-
}
|
|
70
|
-
function formatDetailed(entries) {
|
|
71
|
-
return entries
|
|
72
|
-
.map((entry) => {
|
|
73
|
-
const params = entry.parameters.length > 0
|
|
74
|
-
? entry.parameters
|
|
75
|
-
.map((param) => `- ${param.name}${param.required ? "" : "?"} (${param.type})${param.description ? ` — ${param.description}` : ""}`)
|
|
76
|
-
.join("\n")
|
|
77
|
-
: "- (no parameters)";
|
|
78
|
-
const sections = [
|
|
79
|
-
`### ${entry.functionName} (${entry.tool})`,
|
|
80
|
-
`Module: ${entry.modulePath}`,
|
|
81
|
-
`Category: ${entry.category}`,
|
|
82
|
-
`Description: ${entry.description}`,
|
|
83
|
-
"Parameters:",
|
|
84
|
-
params,
|
|
85
|
-
`Returns: ${entry.returns}`,
|
|
86
|
-
"Example:",
|
|
87
|
-
"```ts",
|
|
88
|
-
entry.example.trim(),
|
|
89
|
-
"```",
|
|
90
|
-
];
|
|
91
|
-
if (entry.notes) {
|
|
92
|
-
sections.push(`Notes: ${entry.notes}`);
|
|
93
|
-
}
|
|
94
|
-
return sections.join("\n");
|
|
95
|
-
})
|
|
96
|
-
.join("\n\n---\n\n");
|
|
97
|
-
}
|
|
98
|
-
function findCommonDirectorySegments(segmentsList) {
|
|
99
|
-
if (segmentsList.length === 0) {
|
|
100
|
-
return [];
|
|
101
|
-
}
|
|
102
|
-
const directories = segmentsList.map((parts) => parts.slice(0, Math.max(parts.length - 1, 0)));
|
|
103
|
-
let prefix = directories[0];
|
|
104
|
-
for (let i = 1; i < directories.length; i += 1) {
|
|
105
|
-
const current = directories[i];
|
|
106
|
-
let j = 0;
|
|
107
|
-
while (j < prefix.length &&
|
|
108
|
-
j < current.length &&
|
|
109
|
-
prefix[j] === current[j]) {
|
|
110
|
-
j += 1;
|
|
111
|
-
}
|
|
112
|
-
prefix = prefix.slice(0, j);
|
|
113
|
-
if (prefix.length === 0) {
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return prefix;
|
|
118
|
-
}
|