modality-kit 0.14.8 → 0.14.10

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/index.js CHANGED
@@ -36,24 +36,20 @@ var ContentType = [
36
36
  "resource_link",
37
37
  "resource"
38
38
  ];
39
- function formatSuccessResponse(successData, meta) {
39
+ function formatSuccessResponse(successData, content) {
40
40
  const data = structuredClone(successData);
41
- const { instructions, content: dataContent, ...restData } = data;
41
+ const contentData = content ? structuredClone(content) : null;
42
42
  const result = {
43
43
  isError: false,
44
44
  content: [
45
45
  {
46
46
  type: "text",
47
- text: JSON.stringify({
48
- instructions,
49
- meta,
50
- ...restData
51
- })
47
+ text: JSON.stringify(data)
52
48
  }
53
49
  ]
54
50
  };
55
- if (Array.isArray(dataContent)) {
56
- result.content.push(...dataContent.map((item) => {
51
+ if (Array.isArray(contentData)) {
52
+ result.content.push(...contentData.map((item) => {
57
53
  if (typeof item === "string") {
58
54
  return { type: "text", text: item };
59
55
  } else if (item.type && ContentType.includes(item.type)) {
@@ -62,6 +58,8 @@ function formatSuccessResponse(successData, meta) {
62
58
  return { type: "text", text: JSON.stringify(item) };
63
59
  }
64
60
  }));
61
+ } else if (contentData != null) {
62
+ result.content.push({ type: "text", text: JSON.stringify(contentData) });
65
63
  }
66
64
  return result;
67
65
  }
@@ -25,7 +25,7 @@ interface ErrorData extends Record<string, any> {
25
25
  message: string;
26
26
  operation?: string;
27
27
  }
28
- export declare function formatSuccessResponse(successData: SuccessData, meta?: any): CallToolResult;
28
+ export declare function formatSuccessResponse(successData: SuccessData, content?: any): CallToolResult;
29
29
  /**
30
30
  * Format an error response for MCP tools using generic error data
31
31
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.14.8",
2
+ "version": "0.14.10",
3
3
  "name": "modality-kit",
4
4
  "repository": {
5
5
  "type": "git",