Changeset 3810832
- Timestamp:
- 11/19/2026 06:53:21 AM (less than one hour ago)
- Location:
- ibs-webmcp-gateway
- Files:
-
- 2 edited
-
tags/1.0.8/public/js/ibs-webmcp-gateway-public.js (modified) (7 diffs)
-
trunk/public/js/ibs-webmcp-gateway-public.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ibs-webmcp-gateway/tags/1.0.8/public/js/ibs-webmcp-gateway-public.js
r3804794 r3810832 17 17 18 18 cartTokenKey: "ibs_webmcp_gateway_cart_token", 19 20 debug: false, 19 21 }; 20 22 … … 27 29 class IbsWebMCPGatewayLogger { 28 30 static log(...args) { 31 if (!CONFIG.debug) { 32 return; 33 } 34 29 35 console.log("[ibsWebMCPGateway]", ...args); 30 36 } … … 1908 1914 if (!this.supported()) { 1909 1915 IbsWebMCPGatewayLogger.warn("ModelContext API unavailable"); 1910 1911 1916 return; 1912 1917 } 1913 1918 1914 1919 let registeredCount = 0; 1920 let skippedCount = 0; 1915 1921 1916 1922 for (const tool of registry.getAll()) { 1923 /* 1924 * Form integration tools are registered directly by their 1925 * respective add-on plugins. 1926 * 1927 * Avoid registering them again through the Gateway. 1928 */ 1929 const formGroups = [ 1930 "form", 1931 "forms", 1932 "form_tools", 1933 "wpforms", 1934 "ninja_forms", 1935 "gravity_forms", 1936 "contact_form_7", 1937 ]; 1938 1939 if (formGroups.includes(String(tool.group || "").toLowerCase())) { 1940 skippedCount++; 1941 1942 IbsWebMCPGatewayLogger.log( 1943 `Skipping duplicate registration for ${tool.name}; handled by its form add-on.`, 1944 ); 1945 1946 continue; 1947 } 1948 1917 1949 try { 1918 1950 await modelContext.registerTool({ … … 1930 1962 1931 1963 execute: async (input = {}, { signal } = {}) => { 1932 // WebMCP passes the input object directly.1933 1964 const params = 1934 1965 input && typeof input === "object" && !Array.isArray(input) … … 1936 1967 : {}; 1937 1968 1938 // Do not log customer inputs or coupon codes.1939 1969 IbsWebMCPGatewayLogger.log("WebMCP tool invoked:", tool.name); 1940 1970 … … 1946 1976 }, 1947 1977 }); 1978 1948 1979 registeredCount++; 1949 1980 } catch (error) { … … 1955 1986 } 1956 1987 1957 // IbsWebMCPGatewayLogger.log(`${registeredCount} WebMCP tools registered`); 1988 IbsWebMCPGatewayLogger.log( 1989 `Gateway tools registered: ${registeredCount}, form tools skipped: ${skippedCount}`, 1990 ); 1958 1991 } 1959 1992 -
ibs-webmcp-gateway/trunk/public/js/ibs-webmcp-gateway-public.js
r3781783 r3810832 17 17 18 18 cartTokenKey: "ibs_webmcp_gateway_cart_token", 19 20 debug: false, 19 21 }; 20 22 … … 27 29 class IbsWebMCPGatewayLogger { 28 30 static log(...args) { 31 if (!CONFIG.debug) { 32 return; 33 } 34 29 35 console.log("[ibsWebMCPGateway]", ...args); 30 36 } … … 1908 1914 if (!this.supported()) { 1909 1915 IbsWebMCPGatewayLogger.warn("ModelContext API unavailable"); 1910 1911 1916 return; 1912 1917 } 1913 1918 1914 1919 let registeredCount = 0; 1920 let skippedCount = 0; 1915 1921 1916 1922 for (const tool of registry.getAll()) { 1923 /* 1924 * Form integration tools are registered directly by their 1925 * respective add-on plugins. 1926 * 1927 * Avoid registering them again through the Gateway. 1928 */ 1929 const formGroups = [ 1930 "form", 1931 "forms", 1932 "form_tools", 1933 "wpforms", 1934 "ninja_forms", 1935 "gravity_forms", 1936 "contact_form_7", 1937 ]; 1938 1939 if (formGroups.includes(String(tool.group || "").toLowerCase())) { 1940 skippedCount++; 1941 1942 IbsWebMCPGatewayLogger.log( 1943 `Skipping duplicate registration for ${tool.name}; handled by its form add-on.`, 1944 ); 1945 1946 continue; 1947 } 1948 1917 1949 try { 1918 1950 await modelContext.registerTool({ … … 1930 1962 1931 1963 execute: async (input = {}, { signal } = {}) => { 1932 // WebMCP passes the input object directly.1933 1964 const params = 1934 1965 input && typeof input === "object" && !Array.isArray(input) … … 1936 1967 : {}; 1937 1968 1938 // Do not log customer inputs or coupon codes.1939 1969 IbsWebMCPGatewayLogger.log("WebMCP tool invoked:", tool.name); 1940 1970 … … 1946 1976 }, 1947 1977 }); 1978 1948 1979 registeredCount++; 1949 1980 } catch (error) { … … 1955 1986 } 1956 1987 1957 // IbsWebMCPGatewayLogger.log(`${registeredCount} WebMCP tools registered`); 1988 IbsWebMCPGatewayLogger.log( 1989 `Gateway tools registered: ${registeredCount}, form tools skipped: ${skippedCount}`, 1990 ); 1958 1991 } 1959 1992
Note:
See TracChangeset
for help on using the changeset viewer.