@alpic-ai/insights 0.0.0-dev.c609bbe → 0.0.0-dev.f8c409f

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 +9 -10
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -28,19 +28,18 @@ function userPromptMiddleware(options) {
28
28
  const args = parsedRequest.data.params.arguments ?? {};
29
29
  const userPrompt = typeof args.user_prompt === "string" ? args.user_prompt : void 0;
30
30
  const hasUserPrompt = userPrompt != null && userPrompt.length > 0;
31
- if (hasUserPrompt) {
32
- const toolName = parsedRequest.data.params.name;
33
- if (options?.handler) try {
34
- await options.handler({
35
- toolName,
36
- userPrompt
37
- });
38
- } catch (error) {
39
- console.error("Error calling user prompt handler", error);
40
- }
31
+ if ("user_prompt" in args) {
41
32
  delete args.user_prompt;
42
33
  request.params.arguments = args;
43
34
  }
35
+ if (hasUserPrompt && options?.handler) try {
36
+ await options.handler({
37
+ toolName: parsedRequest.data.params.name,
38
+ userPrompt
39
+ });
40
+ } catch (error) {
41
+ console.error("Error calling user prompt handler", error);
42
+ }
44
43
  const rawResult = await next();
45
44
  const parsedResult = CallToolResultSchema.safeParse(rawResult);
46
45
  if (!parsedResult.success) return rawResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/insights",
3
- "version": "0.0.0-dev.c609bbe",
3
+ "version": "0.0.0-dev.f8c409f",
4
4
  "description": "User insights middlewares for Alpic-hosted MCP servers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",