@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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +134 -11
- package/dist/index.d.ts +134 -11
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/McpAppShareProtocol.ts +29 -0
- package/src/McpUiProtocol.ts +13 -0
- package/src/MenuProtocol.ts +2 -0
- package/src/OpenProtocol.ts +27 -1
- package/src/SandboxResourceProtocol.ts +91 -15
- package/src/__tests__/McpUiProtocol.toolName.test.ts +26 -0
- package/src/index.ts +1 -0
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
|
}
|