@clipform/mcp-server 5.7.1 → 5.8.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.
@@ -2,7 +2,7 @@ import {
2
2
  CURRENT_PLAN_VERSIONS,
3
3
  PLAN_LIMITS,
4
4
  callApi
5
- } from "./chunk-D65NJDP5.js";
5
+ } from "./chunk-7PJHCRSD.js";
6
6
  import {
7
7
  getMcpAuth
8
8
  } from "./chunk-ENVV65JX.js";
@@ -145,4 +145,4 @@ export {
145
145
  getSessionContextWithAuth,
146
146
  getSessionContext
147
147
  };
148
- //# sourceMappingURL=chunk-7M2APEB6.js.map
148
+ //# sourceMappingURL=chunk-HHRUYPFP.js.map
@@ -0,0 +1,15 @@
1
+ // src/lib/error-kind.ts
2
+ var ERROR_KIND_META_KEY = "io.clipform/error_kind";
3
+ var SDK_INPUT_VALIDATION_PREFIX = "Input validation error";
4
+ function classifyToolError(response, errorMessage) {
5
+ const meta = response?._meta;
6
+ if (meta?.[ERROR_KIND_META_KEY] === "refused") return "refused";
7
+ if (typeof errorMessage === "string" && errorMessage.startsWith(SDK_INPUT_VALIDATION_PREFIX)) return "refused";
8
+ return "failed";
9
+ }
10
+
11
+ export {
12
+ ERROR_KIND_META_KEY,
13
+ classifyToolError
14
+ };
15
+ //# sourceMappingURL=chunk-XO7XBMRY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/error-kind.ts"],"sourcesContent":["/**\n * #5917: labels an error tool result as a correct refusal of a caller mistake\n * (`refusedResult` / `apiErrorResult` in api-client.ts set it on `_meta`).\n * instrument.ts reads it into `mcp_error_kind` on `$mcp_tool_call`, so\n * telemetry tells \"refused\" apart from \"failed\". Leaf module with no imports,\n * so the `./instrument` entry stays self-contained.\n */\nexport const ERROR_KIND_META_KEY = \"io.clipform/error_kind\";\n\nexport type McpErrorKind = \"refused\" | \"failed\";\n\n/** The MCP SDK's own input-schema rejection (SEP-1303): always a caller mistake. */\nconst SDK_INPUT_VALIDATION_PREFIX = \"Input validation error\";\n\n/** Classifies an errored tool call from its result and error message. */\nexport function classifyToolError(response: unknown, errorMessage: unknown): McpErrorKind {\n const meta = (response as { _meta?: Record<string, unknown> } | null | undefined)?._meta;\n if (meta?.[ERROR_KIND_META_KEY] === \"refused\") return \"refused\";\n if (typeof errorMessage === \"string\" && errorMessage.startsWith(SDK_INPUT_VALIDATION_PREFIX)) return \"refused\";\n return \"failed\";\n}\n"],"mappings":";AAOO,IAAM,sBAAsB;AAKnC,IAAM,8BAA8B;AAG7B,SAAS,kBAAkB,UAAmB,cAAqC;AACxF,QAAM,OAAQ,UAAqE;AACnF,MAAI,OAAO,mBAAmB,MAAM,UAAW,QAAO;AACtD,MAAI,OAAO,iBAAiB,YAAY,aAAa,WAAW,2BAA2B,EAAG,QAAO;AACrG,SAAO;AACT;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FULL_CAPS,
3
3
  getSessionContextWithAuth
4
- } from "./chunk-7M2APEB6.js";
4
+ } from "./chunk-HHRUYPFP.js";
5
5
  import {
6
6
  FORM_TYPES,
7
7
  MAX_CLIP_SECONDS,
@@ -10,7 +10,7 @@ import {
10
10
  WORKFLOW_TYPES,
11
11
  exposedCompositionIds,
12
12
  getDiscoveryParams
13
- } from "./chunk-D65NJDP5.js";
13
+ } from "./chunk-7PJHCRSD.js";
14
14
  import {
15
15
  __export
16
16
  } from "./chunk-PZ5AY32C.js";
@@ -15259,4 +15259,4 @@ export {
15259
15259
  getWorkflowText,
15260
15260
  registerPrompts
15261
15261
  };
15262
- //# sourceMappingURL=chunk-S4S6H7GF.js.map
15262
+ //# sourceMappingURL=chunk-YFOTTAGR.js.map