@axiom-lattice/protocols 6.2.0 → 6.3.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 CHANGED
@@ -1105,6 +1105,7 @@ function effectiveGrants(record) {
1105
1105
  // src/McpUiProtocol.ts
1106
1106
  var MODES = ["inline", "fullscreen", "pip"];
1107
1107
  var MAX_MCP_UI_SCOPE_LENGTH = 4096;
1108
+ var MAX_MCP_UI_TOOL_NAME_LENGTH = 128;
1108
1109
  var isObj = (v) => typeof v === "object" && v !== null;
1109
1110
  function isMcpUiRef(value) {
1110
1111
  return parseMcpUiRef(value) !== null;
@@ -1113,6 +1114,7 @@ function parseMcpUiRef(value) {
1113
1114
  if (!isObj(value)) return null;
1114
1115
  const displayMode = MODES.includes(value.displayMode) ? value.displayMode : "inline";
1115
1116
  const title = typeof value.title === "string" ? value.title : void 0;
1117
+ const toolName = typeof value.toolName === "string" && value.toolName.length > 0 && value.toolName.length <= MAX_MCP_UI_TOOL_NAME_LENGTH ? value.toolName : void 0;
1116
1118
  if (value.kind === "mcp" && typeof value.serverKey === "string" && typeof value.resourceUri === "string") {
1117
1119
  return {
1118
1120
  kind: "mcp",
@@ -1120,6 +1122,7 @@ function parseMcpUiRef(value) {
1120
1122
  resourceUri: value.resourceUri,
1121
1123
  displayMode,
1122
1124
  ...title ? { title } : {},
1125
+ ...toolName ? { toolName } : {},
1123
1126
  ...value.structuredContent !== void 0 ? { structuredContent: value.structuredContent } : {}
1124
1127
  };
1125
1128
  }
@@ -1131,6 +1134,7 @@ function parseMcpUiRef(value) {
1131
1134
  resource: value.resource,
1132
1135
  displayMode,
1133
1136
  ...title ? { title } : {},
1137
+ ...toolName ? { toolName } : {},
1134
1138
  ...scope ? { scope } : {}
1135
1139
  };
1136
1140
  }