@alpic-ai/insights 0.0.0-dev.gf4f3876 → 0.0.0-dev.gf5cd963

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.
Files changed (2) hide show
  1. package/dist/index.mjs +23 -7
  2. package/package.json +5 -5
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: true,
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 { content: [{
79
- type: "text",
80
- text: FEEDBACK_RESPONSE_TEXT
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
@@ -105,7 +121,7 @@ const captureFeedback = (server, options) => {
105
121
  if (marked[INSTALLED_MARKER$1]) return;
106
122
  marked[INSTALLED_MARKER$1] = true;
107
123
  const middleware = feedbackMiddleware(options);
108
- const targets = new Set(["tools/list", "tools/call"]);
124
+ const targets = /* @__PURE__ */ new Set(["tools/list", "tools/call"]);
109
125
  const wrap = (method, handler) => {
110
126
  if (!targets.has(method)) return handler;
111
127
  return async (...args) => {
@@ -250,7 +266,7 @@ const captureIntents = (server, options) => {
250
266
  if (marked[INSTALLED_MARKER]) return;
251
267
  marked[INSTALLED_MARKER] = true;
252
268
  const middleware = intentMiddleware(options);
253
- const targets = new Set(["tools/list", "tools/call"]);
269
+ const targets = /* @__PURE__ */ new Set(["tools/list", "tools/call"]);
254
270
  const wrap = (method, handler) => {
255
271
  if (!targets.has(method)) return handler;
256
272
  return async (...args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/insights",
3
- "version": "0.0.0-dev.gf4f3876",
3
+ "version": "0.0.0-dev.gf5cd963",
4
4
  "description": "User insights middlewares for Alpic-hosted MCP servers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -28,12 +28,12 @@
28
28
  "devDependencies": {
29
29
  "@modelcontextprotocol/sdk": "^1.29.0",
30
30
  "@total-typescript/tsconfig": "^1.0.4",
31
- "@types/node": "^25.9.1",
31
+ "@types/node": "^25.9.4",
32
32
  "shx": "^0.4.0",
33
- "skybridge": "^1.0.4",
34
- "tsdown": "^0.22.1",
33
+ "skybridge": "^1.1.1",
34
+ "tsdown": "^0.22.3",
35
35
  "typescript": "^6.0.3",
36
- "vitest": "^4.1.8",
36
+ "vitest": "^4.1.9",
37
37
  "zod": "^4.4.3"
38
38
  },
39
39
  "scripts": {