@alpic-ai/insights 1.138.0 → 1.140.0
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.mjs +21 -5
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,17 @@ import { CallToolRequestSchema, CallToolResultSchema, ListToolsResultSchema } fr
|
|
|
3
3
|
const FEEDBACK_TOOL_NAME = "send_feedback";
|
|
4
4
|
const FEEDBACK_TOOL_DESCRIPTION = "Send feedback about this MCP server to its operators. Use this tool ONLY for feedback about this MCP server itself, never about other tools, services, or the host. You MAY call this tool when you detect a genuine issue with this server (e.g. a tool that failed unexpectedly, an unhelpful response, a missing capability). You MAY also call it when the user explicitly asks to send feedback. Before sending, strip all personally identifiable information (PII) from the content, including names, email addresses, phone numbers, physical addresses, dates of birth, ID numbers, payment information, and any other information that could identify a specific individual. Replace stripped values with generic placeholders (e.g. \"[name]\", \"[email]\").";
|
|
5
5
|
const FEEDBACK_RESPONSE_TEXT = "Feedback received. Thanks!";
|
|
6
|
+
const FEEDBACK_OUTPUT_SCHEMA = {
|
|
7
|
+
type: "object",
|
|
8
|
+
properties: { status: {
|
|
9
|
+
type: "string",
|
|
10
|
+
enum: ["received"],
|
|
11
|
+
description: "Confirmation that the feedback was received by the server operators."
|
|
12
|
+
} },
|
|
13
|
+
required: ["status"],
|
|
14
|
+
additionalProperties: false
|
|
15
|
+
};
|
|
16
|
+
const FEEDBACK_STRUCTURED_CONTENT = { status: "received" };
|
|
6
17
|
/**
|
|
7
18
|
* Lets MCP server builders collect qualitative feedback from end users about their
|
|
8
19
|
* tool/server. Injects a `send_feedback` tool at `tools/list` time and intercepts calls
|
|
@@ -36,10 +47,11 @@ function feedbackMiddleware(options) {
|
|
|
36
47
|
},
|
|
37
48
|
required: ["content", "source"]
|
|
38
49
|
},
|
|
50
|
+
outputSchema: FEEDBACK_OUTPUT_SCHEMA,
|
|
39
51
|
annotations: {
|
|
40
52
|
readOnlyHint: false,
|
|
41
53
|
destructiveHint: false,
|
|
42
|
-
openWorldHint:
|
|
54
|
+
openWorldHint: false,
|
|
43
55
|
idempotentHint: true
|
|
44
56
|
}
|
|
45
57
|
});
|
|
@@ -73,12 +85,16 @@ function feedbackMiddleware(options) {
|
|
|
73
85
|
type: "text",
|
|
74
86
|
text: FEEDBACK_RESPONSE_TEXT
|
|
75
87
|
}],
|
|
88
|
+
structuredContent: FEEDBACK_STRUCTURED_CONTENT,
|
|
76
89
|
_meta: { [metaKeyName]: feedback }
|
|
77
90
|
};
|
|
78
|
-
return {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
91
|
+
return {
|
|
92
|
+
content: [{
|
|
93
|
+
type: "text",
|
|
94
|
+
text: FEEDBACK_RESPONSE_TEXT
|
|
95
|
+
}],
|
|
96
|
+
structuredContent: FEEDBACK_STRUCTURED_CONTENT
|
|
97
|
+
};
|
|
82
98
|
};
|
|
83
99
|
}
|
|
84
100
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/insights",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.140.0",
|
|
4
4
|
"description": "User insights middlewares for Alpic-hosted MCP servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
30
30
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
31
|
-
"@types/node": "^25.9.
|
|
31
|
+
"@types/node": "^25.9.3",
|
|
32
32
|
"shx": "^0.4.0",
|
|
33
|
-
"skybridge": "^1.0
|
|
34
|
-
"tsdown": "^0.22.
|
|
33
|
+
"skybridge": "^1.1.0",
|
|
34
|
+
"tsdown": "^0.22.2",
|
|
35
35
|
"typescript": "^6.0.3",
|
|
36
36
|
"vitest": "^4.1.8",
|
|
37
37
|
"zod": "^4.4.3"
|