@burtson-labs/bandit-engine 2.0.153 → 2.0.154

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.
@@ -125,6 +125,28 @@ var webFetchTool = {
125
125
  method: "GET",
126
126
  isBuiltIn: true
127
127
  };
128
+ var imageGenerationTool = {
129
+ id: "image-generation",
130
+ name: "image_generation",
131
+ description: "Generate an image from a text prompt on the Burtson Labs GPU",
132
+ enabled: true,
133
+ type: "function",
134
+ function: {
135
+ name: "image_generation",
136
+ description: "Generate an image from a text prompt on the Burtson Labs GPU",
137
+ parameters: {
138
+ type: "object",
139
+ properties: {
140
+ prompt: { type: "string", description: "Text description of the image to generate" },
141
+ size: { type: "string", enum: ["1024x1024", "1344x768", "768x1344"], description: "Canvas: square, landscape, or portrait" }
142
+ },
143
+ required: ["prompt"]
144
+ }
145
+ },
146
+ endpoint: "/mcp/generate-image",
147
+ method: "POST",
148
+ isBuiltIn: true
149
+ };
128
150
  var createFileTool = {
129
151
  id: "create-file",
130
152
  name: "create_file",
@@ -152,7 +174,7 @@ var createFileTool = {
152
174
  method: "POST",
153
175
  isBuiltIn: true
154
176
  };
155
- var defaultTools = [healthCheckTool, webSearchTool, webFetchTool, createFileTool];
177
+ var defaultTools = [healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool];
156
178
  var useMCPToolsStore = create((set, get) => ({
157
179
  tools: defaultTools,
158
180
  isLoaded: false,
@@ -286,4 +308,4 @@ export {
286
308
  discoverMcpTools,
287
309
  useMCPToolsStore
288
310
  };
289
- //# sourceMappingURL=chunk-6KOEXQJN.mjs.map
311
+ //# sourceMappingURL=chunk-IS2LWSBZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/store/mcpToolsStore.ts","../src/services/mcp/mcpServersService.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\";\nimport { listMcpServers, discoverMcpTools } from \"../services/mcp/mcpServersService\";\n\n// Sanitize an MCP tool into a valid, namespaced function name for the model.\nconst sanitizeMcpToolName = (raw: string): string =>\n raw.replace(/[^a-zA-Z0-9_]/g, \"_\").replace(/_+/g, \"_\").replace(/^_|_$/g, \"\").slice(0, 60);\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 // Set when this tool comes from a user-connected MCP server. Such tools are\n // invoked through POST /mcp/invoke (not a fixed endpoint) and are never\n // persisted to IndexedDB — they're re-discovered from the gateway each load.\n mcpServerId?: string;\n mcpToolName?: string; // the tool's real name on the MCP server\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 loadMcpServerTools: () => Promise<void>;\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// Image generation runs on Burtson's own GPU (the Image Studio backend behind\n// the gateway) — never a third-party image API. The gateway forwards the\n// user's token to Anton, whose admin/partner gate decides who may take the\n// GPU; everyone else gets a clear \"limited to admin and partner accounts\"\n// message. Cold starts can take a couple of minutes.\nconst imageGenerationTool: MCPTool = {\n id: \"image-generation\",\n name: \"image_generation\",\n description: \"Generate an image from a text prompt on the Burtson Labs GPU\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"image_generation\",\n description: \"Generate an image from a text prompt on the Burtson Labs GPU\",\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\", \"1344x768\", \"768x1344\"], description: \"Canvas: square, landscape, or portrait\" }\n },\n required: [\"prompt\"]\n }\n },\n endpoint: \"/mcp/generate-image\",\n method: \"POST\",\n isBuiltIn: true\n};\n\n// Create a downloadable file for the user (stored ~1 hour at a gateway URL).\nconst createFileTool: MCPTool = {\n id: \"create-file\",\n name: \"create_file\",\n description: \"Create a downloadable file for the user (md, txt, csv, json, html, docx, pptx, pdf). Returns a temporary (~1 hour) download link.\",\n enabled: true,\n type: \"function\",\n function: {\n name: \"create_file\",\n description:\n \"Generate a file the user can download. For docx/pptx write well-structured Markdown (headings, lists, tables; use '## ' headings to start each slide). For pdf, prefer complete HTML with inline CSS (branded proposals, print layouts) — Chromium renders it without browser headers/footers; Markdown also works. Returns a short-lived (~1 hour) download URL — tell the user it expires.\",\n parameters: {\n type: \"object\",\n properties: {\n content: { type: \"string\", description: \"The file content (HTML preferred for pdf; Markdown for docx/pptx/pdf; raw text for others).\" },\n filename: { type: \"string\", description: \"Desired filename, e.g. 'report.pdf' or 'notes.md'.\" },\n format: {\n type: \"string\",\n enum: [\"md\", \"txt\", \"csv\", \"json\", \"html\", \"xml\", \"yaml\", \"docx\", \"pptx\", \"pdf\"],\n description: \"File format. Defaults to md.\",\n },\n },\n required: [\"content\", \"format\"],\n },\n },\n endpoint: \"/mcp/create-file\",\n method: \"POST\",\n isBuiltIn: true,\n};\n\nconst defaultTools: MCPTool[] = [healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool];\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 // Persist only user-defined custom tools — never built-ins or the dynamic\n // tools discovered from MCP servers (those are re-fetched from the gateway).\n const customTools = tools.filter((tool) => !tool.isBuiltIn && !tool.mcpServerId);\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 // Discover the user's connected MCP servers' tools from the gateway and merge\n // them into the tool list (so the model can call them). Replaces any prior\n // MCP-server tools; best-effort — a single unreachable server is skipped.\n loadMcpServerTools: async () => {\n let servers;\n try {\n servers = await listMcpServers();\n } catch (error) {\n debugLogger.warn(\"Could not list MCP servers\", { error: String(error) });\n return;\n }\n\n const collected: MCPTool[] = [];\n for (const server of servers.filter((s) => s.enabled)) {\n try {\n const { tools } = await discoverMcpTools(server.id);\n for (const t of tools) {\n const fnName = sanitizeMcpToolName(`mcp_${server.name}_${t.name}`);\n const schema =\n t.inputSchema && typeof t.inputSchema === \"object\" && (t.inputSchema as { type?: string }).type === \"object\"\n ? (t.inputSchema as MCPTool[\"function\"][\"parameters\"])\n : { type: \"object\" as const, properties: {}, required: [] };\n collected.push({\n id: `mcp-${server.id}-${t.name}`,\n name: fnName,\n description: t.description || `${t.name} (via ${server.name})`,\n enabled: true,\n type: \"function\",\n function: {\n name: fnName,\n description: t.description || `${t.name} — provided by the ${server.name} MCP server.`,\n parameters: schema,\n },\n mcpServerId: server.id,\n mcpToolName: t.name,\n });\n }\n } catch (error) {\n debugLogger.warn(\"Failed to discover tools for MCP server\", { server: server.name, error: String(error) });\n }\n }\n\n set((state) => ({\n tools: [...state.tools.filter((t) => !t.mcpServerId), ...collected],\n }));\n debugLogger.info(\"MCP server tools loaded\", { count: collected.length });\n },\n}));\n","import { usePackageSettingsStore } from \"../../store/packageSettingsStore\";\nimport { authenticationService } from \"../auth/authenticationService\";\n\n/**\n * Client for the gateway's MCP host (phase 1 backend at /api/mcp/servers + /invoke).\n * Lets users connect their own remote MCP servers; the gateway holds the configs\n * and proxies discovery/invocation. Mirrors mcpService's gateway-base + bearer\n * conventions (gatewayApiUrl already ends in /api, so paths start with /mcp/...).\n */\n\nexport interface McpServer {\n id: string;\n name: string;\n url: string;\n authType: string;\n hasAuth: boolean;\n headerName?: string | null;\n enabled: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface McpServerInput {\n name: string;\n url: string;\n authType?: \"none\" | \"bearer\" | \"header\";\n authValue?: string;\n headerName?: string;\n enabled?: boolean;\n}\n\nexport interface McpDiscoveredTool {\n name: string;\n description?: string;\n inputSchema?: Record<string, unknown>;\n}\n\nconst gatewayBase = (): string => {\n const settings = usePackageSettingsStore.getState().settings;\n const url = settings?.gatewayApiUrl?.replace(/\\/$/, \"\");\n if (!url) throw new Error(\"Gateway API is not configured.\");\n return url;\n};\n\nconst authHeaders = (): Record<string, string> => {\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n const token = authenticationService.getToken();\n if (token) headers[\"Authorization\"] = `Bearer ${token}`;\n return headers;\n};\n\nconst parse = async (res: Response) => {\n const text = await res.text();\n const body = text ? JSON.parse(text) : null;\n if (!res.ok) {\n const message =\n (body && typeof body === \"object\" && (body.error || body.message)) ||\n `Request failed (${res.status})`;\n throw new Error(String(message));\n }\n return body;\n};\n\nexport const listMcpServers = async (): Promise<McpServer[]> =>\n parse(await fetch(`${gatewayBase()}/mcp/servers`, { headers: authHeaders() }));\n\nexport const addMcpServer = async (input: McpServerInput): Promise<McpServer> =>\n parse(\n await fetch(`${gatewayBase()}/mcp/servers`, {\n method: \"POST\",\n headers: authHeaders(),\n body: JSON.stringify(input),\n }),\n );\n\nexport const updateMcpServer = async (\n id: string,\n input: Partial<McpServerInput>,\n): Promise<McpServer> =>\n parse(\n await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}`, {\n method: \"PUT\",\n headers: authHeaders(),\n body: JSON.stringify(input),\n }),\n );\n\nexport const deleteMcpServer = async (id: string): Promise<void> => {\n const res = await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}`, {\n method: \"DELETE\",\n headers: authHeaders(),\n });\n if (!res.ok && res.status !== 204) {\n throw new Error(`Could not remove the server (${res.status}).`);\n }\n};\n\nexport const discoverMcpTools = async (\n id: string,\n): Promise<{ serverId: string; server: string; tools: McpDiscoveredTool[] }> =>\n parse(await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}/tools`, { headers: authHeaders() }));\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAS,cAAc;;;ACmBvB,IAAM,cAAc,MAAc;AAChC,QAAM,WAAW,wBAAwB,SAAS,EAAE;AACpD,QAAM,MAAM,UAAU,eAAe,QAAQ,OAAO,EAAE;AACtD,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,gCAAgC;AAC1D,SAAO;AACT;AAEA,IAAM,cAAc,MAA8B;AAChD,QAAM,UAAkC,EAAE,gBAAgB,mBAAmB;AAC7E,QAAM,QAAQ,sBAAsB,SAAS;AAC7C,MAAI,MAAO,SAAQ,eAAe,IAAI,UAAU,KAAK;AACrD,SAAO;AACT;AAEA,IAAM,QAAQ,OAAO,QAAkB;AACrC,QAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,QAAM,OAAO,OAAO,KAAK,MAAM,IAAI,IAAI;AACvC,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,UACH,QAAQ,OAAO,SAAS,aAAa,KAAK,SAAS,KAAK,YACzD,mBAAmB,IAAI,MAAM;AAC/B,UAAM,IAAI,MAAM,OAAO,OAAO,CAAC;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,iBAAiB,YAC5B,MAAM,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;AAExE,IAAM,eAAe,OAAO,UACjC;AAAA,EACE,MAAM,MAAM,GAAG,YAAY,CAAC,gBAAgB;AAAA,IAC1C,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,EAAE,gBAAgB,YAAa,EAAE,YAAkC,SAAS,WAC/F,EAAE,cACH,EAAE,MAAM,UAAmB,YAAY,CAAC,GAAG,UAAU,CAAC,EAAE;AAC9D,oBAAU,KAAK;AAAA,YACb,IAAI,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI;AAAA,YAC9B,MAAM;AAAA,YACN,aAAa,EAAE,eAAe,GAAG,EAAE,IAAI,SAAS,OAAO,IAAI;AAAA,YAC3D,SAAS;AAAA,YACT,MAAM;AAAA,YACN,UAAU;AAAA,cACR,MAAM;AAAA,cACN,aAAa,EAAE,eAAe,GAAG,EAAE,IAAI,2BAAsB,OAAO,IAAI;AAAA,cACxE,YAAY;AAAA,YACd;AAAA,YACA,aAAa,OAAO;AAAA,YACpB,aAAa,EAAE;AAAA,UACjB,CAAC;AAAA,QACH;AAAA,MACF,SAAS,OAAO;AACd,oBAAY,KAAK,2CAA2C,EAAE,QAAQ,OAAO,MAAM,OAAO,OAAO,KAAK,EAAE,CAAC;AAAA,MAC3G;AAAA,IACF;AAEA,QAAI,CAAC,WAAW;AAAA,MACd,OAAO,CAAC,GAAG,MAAM,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,GAAG,SAAS;AAAA,IACpE,EAAE;AACF,gBAAY,KAAK,2BAA2B,EAAE,OAAO,UAAU,OAAO,CAAC;AAAA,EACzE;AACF,EAAE;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-B2TJZM4Z.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
- } from "./chunk-6KOEXQJN.mjs";
9
+ } from "./chunk-IS2LWSBZ.mjs";
10
10
  import {
11
11
  FeatureFlagProvider,
12
12
  NotificationProvider,
@@ -191,4 +191,4 @@ export {
191
191
  ChatProvider,
192
192
  chat_provider_default
193
193
  };
194
- //# sourceMappingURL=chunk-AJL3JOD6.mjs.map
194
+ //# sourceMappingURL=chunk-TVPYBRWF.mjs.map
package/dist/index.js CHANGED
@@ -3384,7 +3384,7 @@ var init_mcpServersService = __esm({
3384
3384
  });
3385
3385
 
3386
3386
  // src/store/mcpToolsStore.ts
3387
- var import_zustand11, sanitizeMcpToolName, healthCheckTool, webSearchTool, webFetchTool, createFileTool, defaultTools, useMCPToolsStore;
3387
+ var import_zustand11, sanitizeMcpToolName, healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool, defaultTools, useMCPToolsStore;
3388
3388
  var init_mcpToolsStore = __esm({
3389
3389
  "src/store/mcpToolsStore.ts"() {
3390
3390
  "use strict";
@@ -3456,6 +3456,28 @@ var init_mcpToolsStore = __esm({
3456
3456
  method: "GET",
3457
3457
  isBuiltIn: true
3458
3458
  };
3459
+ imageGenerationTool = {
3460
+ id: "image-generation",
3461
+ name: "image_generation",
3462
+ description: "Generate an image from a text prompt on the Burtson Labs GPU",
3463
+ enabled: true,
3464
+ type: "function",
3465
+ function: {
3466
+ name: "image_generation",
3467
+ description: "Generate an image from a text prompt on the Burtson Labs GPU",
3468
+ parameters: {
3469
+ type: "object",
3470
+ properties: {
3471
+ prompt: { type: "string", description: "Text description of the image to generate" },
3472
+ size: { type: "string", enum: ["1024x1024", "1344x768", "768x1344"], description: "Canvas: square, landscape, or portrait" }
3473
+ },
3474
+ required: ["prompt"]
3475
+ }
3476
+ },
3477
+ endpoint: "/mcp/generate-image",
3478
+ method: "POST",
3479
+ isBuiltIn: true
3480
+ };
3459
3481
  createFileTool = {
3460
3482
  id: "create-file",
3461
3483
  name: "create_file",
@@ -3483,7 +3505,7 @@ var init_mcpToolsStore = __esm({
3483
3505
  method: "POST",
3484
3506
  isBuiltIn: true
3485
3507
  };
3486
- defaultTools = [healthCheckTool, webSearchTool, webFetchTool, createFileTool];
3508
+ defaultTools = [healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool];
3487
3509
  useMCPToolsStore = (0, import_zustand11.create)((set, get) => ({
3488
3510
  tools: defaultTools,
3489
3511
  isLoaded: false,
@@ -20950,6 +20972,7 @@ TOOL USAGE PROTOCOL (conservative approach)
20950
20972
  - Only call tools for SPECIFIC, CURRENT information that requires real-time data or a source you don't already have:
20951
20973
  * web_search() - when asked about recent/current events, breaking news, live information (weather, prices, sports scores), or when you need to look up documentation, libraries, APIs, error messages, or verify a specific fact
20952
20974
  * web_fetch() - to read the FULL contents of a specific URL you already have. Reach for this when the user wants to "tell me more", "go deeper", "read/open that article", or asks for details about a specific source, link, or article from an EARLIER answer: take that item's URL from the previous Sources list in this conversation and fetch it, then answer from the page's actual content (not just the prior summary)
20975
+ * image_generation() - ONLY when explicitly asked to create or generate an image. Runs on Burtson's local GPU; it can take a couple of minutes when the GPU is cold, and is limited to admin and partner accounts
20953
20976
  * create_file({"content": "...", "filename": "report.docx", "format": "docx"}) - when the user asks for a downloadable FILE (a document, spreadsheet, slides, markdown, code, etc.) or to "export"/"download"/"save" something. Formats: md, txt, csv, json, html, xml, yaml, docx, pptx. PDF is NOT a supported format \u2014 if the user asks for a PDF, create a docx instead. For docx/pptx write well-structured Markdown (use "## " headings to start each slide for pptx). It returns a temporary download link \u2014 ALWAYS tell the user the file expires (~1 hour). If it is unclear whether they want it shown inline vs. as a downloadable file, use ask_user first.
20954
20977
  * ask_user({"questions": [{"question": "...", "header": "Format", "options": [{"label": "Inline (Recommended)"}, {"label": "Download a file"}]}]}) - when the request is AMBIGUOUS or missing a detail you need to do a good job (unclear scope, audience, format, tone, which of several interpretations they meant), or you are blocked on a decision that is the user's to make and cannot resolve from the request, context, or sensible defaults. Renders clickable options the user answers in one step \u2014 ALWAYS prefer this over asking a clarifying question in prose and ending your turn. Give 1-4 questions, each with 2-4 short options; if one is clearly best, list it first and append " (Recommended)". The user may also type their own answer; act on it directly. Don't overuse it \u2014 when a sensible default exists, take it and note the assumption instead.
20955
20978
  - For general questions about concepts, definitions, explanations, or how-to topics, use your built-in knowledge WITHOUT calling tools.