@burtson-labs/bandit-engine 2.0.55 → 2.0.58

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.
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-UFSEYVRS.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
- } from "./chunk-EHNWQ4T3.mjs";
9
+ } from "./chunk-QPBG6JQE.mjs";
10
10
  import {
11
11
  AUTH_TOKEN_CHANGED_EVENT,
12
12
  FeatureFlagProvider,
@@ -188,4 +188,4 @@ export {
188
188
  ChatProvider,
189
189
  chat_provider_default
190
190
  };
191
- //# sourceMappingURL=chunk-AVV7HDGR.mjs.map
191
+ //# sourceMappingURL=chunk-POTQI33D.mjs.map
@@ -26,94 +26,47 @@ var healthCheckTool = {
26
26
  method: "GET",
27
27
  isBuiltIn: true
28
28
  };
29
- var newsTool = {
30
- id: "news",
31
- name: "news",
32
- description: "Get the latest news headlines and articles from various sources",
29
+ var webSearchTool = {
30
+ id: "web-search",
31
+ name: "web_search",
32
+ description: "Search the web for current information, documentation, and facts",
33
33
  enabled: true,
34
34
  type: "function",
35
35
  function: {
36
- name: "news",
37
- description: "Get news articles and headlines",
36
+ name: "web_search",
37
+ description: "Search the web and return ranked results with snippets (and an optional summarized answer). Use for current events, documentation, libraries, error messages, and factual lookups.",
38
38
  parameters: {
39
39
  type: "object",
40
40
  properties: {
41
- topic: { type: "string", description: "Filter news by topic" },
42
- count: { type: "number", description: "Number of articles to return (1-100)" },
43
- headlines: { type: "boolean", description: "Return top headlines instead of searching" }
44
- },
45
- required: []
46
- }
47
- },
48
- endpoint: "/mcp/news",
49
- method: "GET",
50
- isBuiltIn: true
51
- };
52
- var weatherTool = {
53
- id: "weather",
54
- name: "weather",
55
- description: "Get current weather conditions and forecasts by location",
56
- enabled: true,
57
- type: "function",
58
- function: {
59
- name: "weather",
60
- description: "Get weather information by location",
61
- parameters: {
62
- type: "object",
63
- properties: {
64
- zip: { type: "string", description: "US zip code" },
65
- latitude: { type: "number", description: "Latitude" },
66
- longitude: { type: "number", description: "Longitude" }
67
- },
68
- required: []
69
- }
70
- },
71
- endpoint: "/mcp/weather",
72
- method: "GET",
73
- isBuiltIn: true
74
- };
75
- var docsTool = {
76
- id: "docs",
77
- name: "docs",
78
- description: "Search framework documentation",
79
- enabled: true,
80
- type: "function",
81
- function: {
82
- name: "docs",
83
- description: "Search framework documentation",
84
- parameters: {
85
- type: "object",
86
- properties: {
87
- query: { type: "string", description: "Search query" },
88
- framework: { type: "string", description: "Specific framework to search" },
89
- count: { type: "number", description: "Number of results (1-50)" }
41
+ query: { type: "string", description: "The search query \u2014 natural language or keywords" },
42
+ count: { type: "number", description: "Number of results to return (1-10, default 5)" },
43
+ include_answer: { type: "boolean", description: "Include a short summarized answer when available" }
90
44
  },
91
45
  required: ["query"]
92
46
  }
93
47
  },
94
- endpoint: "/mcp/docs",
48
+ endpoint: "/mcp/web-search",
95
49
  method: "GET",
96
50
  isBuiltIn: true
97
51
  };
98
- var sportsTool = {
99
- id: "sports",
100
- name: "sports",
101
- description: "Get sports scores and game information",
52
+ var webFetchTool = {
53
+ id: "web-fetch",
54
+ name: "web_fetch",
55
+ description: "Fetch the text content of a specific URL",
102
56
  enabled: true,
103
57
  type: "function",
104
58
  function: {
105
- name: "sports",
106
- description: "Get sports scores and game information",
59
+ name: "web_fetch",
60
+ description: "Fetch a single public URL and return its trimmed text content. Use when you already have a specific link you need to read.",
107
61
  parameters: {
108
62
  type: "object",
109
63
  properties: {
110
- league: { type: "string", description: "Filter by specific league (e.g., nfl, nba)" },
111
- date: { type: "string", description: "Date in YYYY-MM-DD format" }
64
+ url: { type: "string", description: "Absolute http(s) URL to fetch" }
112
65
  },
113
- required: []
66
+ required: ["url"]
114
67
  }
115
68
  },
116
- endpoint: "/mcp/sports",
69
+ endpoint: "/mcp/web-fetch",
117
70
  method: "GET",
118
71
  isBuiltIn: true
119
72
  };
@@ -141,7 +94,7 @@ var imageGenerationTool = {
141
94
  method: "POST",
142
95
  isBuiltIn: true
143
96
  };
144
- var defaultTools = [healthCheckTool, newsTool, weatherTool, docsTool, sportsTool, imageGenerationTool];
97
+ var defaultTools = [healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool];
145
98
  var useMCPToolsStore = create((set, get) => ({
146
99
  tools: defaultTools,
147
100
  isLoaded: false,
@@ -228,4 +181,4 @@ var useMCPToolsStore = create((set, get) => ({
228
181
  export {
229
182
  useMCPToolsStore
230
183
  };
231
- //# sourceMappingURL=chunk-EHNWQ4T3.mjs.map
184
+ //# sourceMappingURL=chunk-QPBG6JQE.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/store/mcpToolsStore.ts"],"sourcesContent":["/*\n © 2025 Burtson Labs — Licensed under Business Source License 1.1\n https://burtson.ai/license\n\n This file is protected intellectual property.\n Do NOT use in commercial software, prompts, AI training data, or derivative works without a valid commercial license.\n\n 🚫 AI NOTICE: This file contains visible and invisible watermarks.\n ⚖️ VIOLATION NOTICE: Removing, modifying, or obscuring these watermarks is a license violation.\n 🔒 LICENSE TERMINATION: Upon license termination, ALL forks, copies, and derivatives must be permanently deleted.\n 📋 AUDIT TRAIL: File usage is logged and monitored for compliance verification.\n*/\n\n// Bandit Engine Watermark: BL-WM-BF8A-82BFF7\nconst __banditFingerprint_store_mcpToolsStorets = 'BL-FP-414506-12AF';\nconst __auditTrail_store_mcpToolsStorets = 'BL-AU-MGOIKVW4-PIWV';\n// File: mcpToolsStore.ts | Path: src/store/mcpToolsStore.ts | Hash: bf8a12af\n\nimport { create } from \"zustand\";\nimport indexedDBService from \"../services/indexedDB/indexedDBService\";\nimport { debugLogger } from \"../services/logging/debugLogger\";\n\nexport interface MCPTool {\n id: string;\n name: string;\n description: string;\n enabled: boolean;\n type: \"function\";\n function: {\n name: string;\n description: string;\n parameters: {\n type: \"object\";\n properties: Record<string, unknown>;\n required: string[];\n };\n };\n endpoint?: string; // API endpoint for gateway calls\n method?: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n isBuiltIn?: boolean;\n}\n\ninterface MCPToolsStore {\n tools: MCPTool[];\n isLoaded: boolean;\n addTool: (tool: Omit<MCPTool, \"id\">) => void;\n updateTool: (id: string, updates: Partial<MCPTool>) => void;\n deleteTool: (id: string) => void;\n toggleTool: (id: string) => void;\n loadTools: () => Promise<void>;\n saveTools: () => Promise<void>;\n getEnabledTools: () => MCPTool[];\n}\n\n// Built-in controller-backed tools\nconst healthCheckTool: MCPTool = {\n id: \"health-check\",\n name: \"check_gateway_health\",\n description: \"Check the health status of the gateway API service\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"check_gateway_health\",\n description: \"Check the health status of the gateway API service\",\n parameters: {\n type: \"object\",\n properties: {},\n required: []\n }\n },\n endpoint: \"/mcp/health\",\n method: \"GET\",\n isBuiltIn: true\n};\n\nconst webSearchTool: MCPTool = {\n id: \"web-search\",\n name: \"web_search\",\n description: \"Search the web for current information, documentation, and facts\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"web_search\",\n description: \"Search the web and return ranked results with snippets (and an optional summarized answer). Use for current events, documentation, libraries, error messages, and factual lookups.\",\n parameters: {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"The search query — natural language or keywords\" },\n count: { type: \"number\", description: \"Number of results to return (1-10, default 5)\" },\n include_answer: { type: \"boolean\", description: \"Include a short summarized answer when available\" }\n },\n required: [\"query\"]\n }\n },\n endpoint: \"/mcp/web-search\",\n method: \"GET\",\n isBuiltIn: true\n};\n\nconst webFetchTool: MCPTool = {\n id: \"web-fetch\",\n name: \"web_fetch\",\n description: \"Fetch the text content of a specific URL\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"web_fetch\",\n description: \"Fetch a single public URL and return its trimmed text content. Use when you already have a specific link you need to read.\",\n parameters: {\n type: \"object\",\n properties: {\n url: { type: \"string\", description: \"Absolute http(s) URL to fetch\" }\n },\n required: [\"url\"]\n }\n },\n endpoint: \"/mcp/web-fetch\",\n method: \"GET\",\n isBuiltIn: true\n};\n\n// New: Image Generation tool (OpenAI DALL·E 3)\nconst imageGenerationTool: MCPTool = {\n id: \"image-generation\",\n name: \"image_generation\",\n description: \"Generate high-quality images using DALL-E 3 from text prompts\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"image_generation\",\n description: \"Generate high-quality images using DALL-E 3 from text prompts\",\n parameters: {\n type: \"object\",\n properties: {\n prompt: { type: \"string\", description: \"Text description of the image to generate\" },\n size: { type: \"string\", enum: [\"1024x1024\", \"1024x1792\", \"1792x1024\"], description: \"Image dimensions\" },\n quality: { type: \"string\", enum: [\"standard\", \"hd\"], description: \"Image quality\" },\n style: { type: \"string\", enum: [\"vivid\", \"natural\"], description: \"Style preference\" }\n },\n required: [\"prompt\"]\n }\n },\n endpoint: \"/mcp/generate-image\",\n method: \"POST\",\n isBuiltIn: true\n};\n\nconst defaultTools: MCPTool[] = [healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool];\n\nexport const useMCPToolsStore = create<MCPToolsStore>((set, get) => ({\n tools: defaultTools,\n isLoaded: false,\n \n addTool: (toolData) => {\n const newTool: MCPTool = {\n ...toolData,\n id: `tool-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n };\n set((state) => ({\n tools: [...state.tools, newTool],\n }));\n get().saveTools();\n },\n \n updateTool: (id, updates) => {\n set((state) => ({\n tools: state.tools.map((tool) =>\n tool.id === id ? { ...tool, ...updates } : tool\n ),\n }));\n get().saveTools();\n },\n \n deleteTool: (id) => {\n set((state) => ({\n tools: state.tools.filter((tool) => tool.id !== id || tool.isBuiltIn),\n }));\n get().saveTools();\n },\n \n toggleTool: (id) => {\n set((state) => ({\n tools: state.tools.map((tool) =>\n tool.id === id ? { ...tool, enabled: !tool.enabled } : tool\n ),\n }));\n get().saveTools();\n },\n \n getEnabledTools: () => {\n return get().tools.filter((tool) => tool.enabled);\n },\n \n loadTools: async () => {\n try {\n const storeConfigs = [{ name: \"config\", keyPath: \"id\" }];\n const data = await indexedDBService.get(\"banditConfig\", 1, \"config\", \"mcpTools\", storeConfigs);\n \n if (data?.tools && Array.isArray(data.tools)) {\n // Merge saved tools with built-in tools, ensuring built-ins always use default definition\n const savedTools = data.tools as MCPTool[];\n const builtInIds = defaultTools.map(t => t.id);\n const customTools = savedTools.filter(\n (tool) => !tool.isBuiltIn && !builtInIds.includes(tool.id)\n );\n\n set({\n tools: [...defaultTools, ...customTools],\n isLoaded: true\n });\n debugLogger.info(\"MCP tools loaded from IndexedDB\", { \n totalTools: defaultTools.length + customTools.length,\n builtInTools: defaultTools.length,\n customTools: customTools.length\n });\n } else {\n // First time, save defaults\n set({ isLoaded: true });\n await get().saveTools();\n debugLogger.info(\"Default MCP tools initialized\");\n }\n } catch (error) {\n debugLogger.error(\"Failed to load MCP tools from IndexedDB\", { error });\n set({ isLoaded: true }); // Mark as loaded even if failed, so UI can render\n }\n },\n \n saveTools: async () => {\n try {\n const { tools } = get();\n const storeConfigs = [{ name: \"config\", keyPath: \"id\" }];\n \n const customTools = tools.filter((tool) => !tool.isBuiltIn);\n\n await indexedDBService.put(\"banditConfig\", 1, \"config\", {\n id: \"mcpTools\",\n tools: customTools,\n }, storeConfigs);\n\n debugLogger.debug(\"MCP tools saved to IndexedDB\", { toolCount: customTools.length });\n } catch (error) {\n debugLogger.error(\"Failed to save MCP tools to IndexedDB\", { error });\n }\n },\n}));\n"],"mappings":";;;;;;;;AAkBA,SAAS,cAAc;AAqCvB,IAAM,kBAA2B;AAAA,EAC/B,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,UAAU;AAAA,IACR,MAAM;AAAA,IACN,aAAa;AAAA,IACb,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,UAAU,CAAC;AAAA,IACb;AAAA,EACF;AAAA,EACA,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,WAAW;AACb;AAEA,IAAM,gBAAyB;AAAA,EAC7B,I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OAAO,CAAC,SAAS,CAAC,KAAK,SAAS;AAE1D,YAAM,yBAAiB,IAAI,gBAAgB,GAAG,UAAU;AAAA,QACtD,IAAI;AAAA,QACJ,OAAO;AAAA,MACT,GAAG,YAAY;AAEf,kBAAY,MAAM,gCAAgC,EAAE,WAAW,YAAY,OAAO,CAAC;AAAA,IACrF,SAAS,OAAO;AACd,kBAAY,MAAM,yCAAyC,EAAE,MAAM,CAAC;AAAA,IACtE;AAAA,EACF;AACF,EAAE;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-UFSEYVRS.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
- } from "./chunk-EHNWQ4T3.mjs";
9
+ } from "./chunk-QPBG6JQE.mjs";
10
10
  import {
11
11
  chat_modal_default
12
12
  } from "./chunk-WL7NV4WJ.mjs";
@@ -9459,7 +9459,7 @@ var MCPToolsTabV2_default = MCPToolsTabV2;
9459
9459
 
9460
9460
  // src/management/management.tsx
9461
9461
  import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
9462
- var preloadChatPage = () => import("./chat-IDE6Z4Q4.mjs");
9462
+ var preloadChatPage = () => import("./chat-MXC6O7M5.mjs");
9463
9463
  var buildCapabilitiesUrl = (gatewayApiUrl) => {
9464
9464
  const trimmed = gatewayApiUrl.replace(/\/$/, "");
9465
9465
  if (trimmed.endsWith("/api")) {
@@ -10804,4 +10804,4 @@ export {
10804
10804
  useGatewayMemory,
10805
10805
  management_default
10806
10806
  };
10807
- //# sourceMappingURL=chunk-NP2OHTTX.mjs.map
10807
+ //# sourceMappingURL=chunk-VU5N57QZ.mjs.map