@yourgpt/copilot-sdk 2.1.1 → 2.1.3

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.
Files changed (75) hide show
  1. package/dist/{chunk-SNI7VN2U.js → chunk-DMBFN7KO.js} +311 -80
  2. package/dist/chunk-DMBFN7KO.js.map +1 -0
  3. package/dist/{chunk-7YZVSG62.js → chunk-LZMBBGWH.js} +3 -3
  4. package/dist/{chunk-7YZVSG62.js.map → chunk-LZMBBGWH.js.map} +1 -1
  5. package/dist/{chunk-HNRFRNMY.cjs → chunk-POZNNKNJ.cjs} +2 -2
  6. package/dist/{chunk-HNRFRNMY.cjs.map → chunk-POZNNKNJ.cjs.map} +1 -1
  7. package/dist/{chunk-BRUDSHCV.js → chunk-QLH6TSCC.js} +2 -2
  8. package/dist/{chunk-BRUDSHCV.js.map → chunk-QLH6TSCC.js.map} +1 -1
  9. package/dist/{chunk-5UMM5VYB.cjs → chunk-R6LKHKAI.cjs} +335 -104
  10. package/dist/chunk-R6LKHKAI.cjs.map +1 -0
  11. package/dist/{chunk-7PJ4GAJR.js → chunk-VFV5FVVI.js} +4 -4
  12. package/dist/{chunk-7PJ4GAJR.js.map → chunk-VFV5FVVI.js.map} +1 -1
  13. package/dist/{chunk-O33I4HBL.cjs → chunk-WAPGTQDR.cjs} +5 -5
  14. package/dist/{chunk-O33I4HBL.cjs.map → chunk-WAPGTQDR.cjs.map} +1 -1
  15. package/dist/{chunk-33JSFVGH.cjs → chunk-WQSK3Z4K.cjs} +23 -23
  16. package/dist/{chunk-33JSFVGH.cjs.map → chunk-WQSK3Z4K.cjs.map} +1 -1
  17. package/dist/core/index.cjs +80 -80
  18. package/dist/core/index.d.cts +3 -3
  19. package/dist/core/index.d.ts +3 -3
  20. package/dist/core/index.js +3 -3
  21. package/dist/{index-C261xY-B.d.cts → index-BHkRA0mM.d.cts} +1 -1
  22. package/dist/{index-25qIYJ21.d.ts → index-tB0qI8my.d.ts} +1 -1
  23. package/dist/mcp/index.d.cts +3 -3
  24. package/dist/mcp/index.d.ts +3 -3
  25. package/dist/react/index.cjs +53 -49
  26. package/dist/react/index.d.cts +69 -7
  27. package/dist/react/index.d.ts +69 -7
  28. package/dist/react/index.js +4 -4
  29. package/dist/tools/anthropic/index.d.cts +1 -1
  30. package/dist/tools/anthropic/index.d.ts +1 -1
  31. package/dist/tools/brave/index.cjs +2 -2
  32. package/dist/tools/brave/index.d.cts +1 -1
  33. package/dist/tools/brave/index.d.ts +1 -1
  34. package/dist/tools/brave/index.js +1 -1
  35. package/dist/tools/exa/index.cjs +2 -2
  36. package/dist/tools/exa/index.d.cts +1 -1
  37. package/dist/tools/exa/index.d.ts +1 -1
  38. package/dist/tools/exa/index.js +1 -1
  39. package/dist/tools/google/index.cjs +2 -2
  40. package/dist/tools/google/index.d.cts +1 -1
  41. package/dist/tools/google/index.d.ts +1 -1
  42. package/dist/tools/google/index.js +1 -1
  43. package/dist/tools/openai/index.cjs +2 -2
  44. package/dist/tools/openai/index.d.cts +1 -1
  45. package/dist/tools/openai/index.d.ts +1 -1
  46. package/dist/tools/openai/index.js +1 -1
  47. package/dist/tools/searxng/index.cjs +2 -2
  48. package/dist/tools/searxng/index.d.cts +1 -1
  49. package/dist/tools/searxng/index.d.ts +1 -1
  50. package/dist/tools/searxng/index.js +1 -1
  51. package/dist/tools/serper/index.cjs +2 -2
  52. package/dist/tools/serper/index.d.cts +1 -1
  53. package/dist/tools/serper/index.d.ts +1 -1
  54. package/dist/tools/serper/index.js +1 -1
  55. package/dist/tools/tavily/index.cjs +2 -2
  56. package/dist/tools/tavily/index.d.cts +1 -1
  57. package/dist/tools/tavily/index.d.ts +1 -1
  58. package/dist/tools/tavily/index.js +1 -1
  59. package/dist/tools/web-search/index.cjs +3 -3
  60. package/dist/tools/web-search/index.d.cts +2 -2
  61. package/dist/tools/web-search/index.d.ts +2 -2
  62. package/dist/tools/web-search/index.js +2 -2
  63. package/dist/{tools-Clyufshc.d.cts → tools-coIcskZ4.d.cts} +23 -4
  64. package/dist/{tools-Clyufshc.d.ts → tools-coIcskZ4.d.ts} +23 -4
  65. package/dist/{types-DM6M_pv_.d.cts → types-C8t4Ut8f.d.cts} +1 -1
  66. package/dist/{types-wudOhedT.d.ts → types-rjaSVmEF.d.ts} +1 -1
  67. package/dist/ui/index.cjs +39 -18
  68. package/dist/ui/index.cjs.map +1 -1
  69. package/dist/ui/index.d.cts +6 -1
  70. package/dist/ui/index.d.ts +6 -1
  71. package/dist/ui/index.js +35 -14
  72. package/dist/ui/index.js.map +1 -1
  73. package/package.json +1 -1
  74. package/dist/chunk-5UMM5VYB.cjs.map +0 -1
  75. package/dist/chunk-SNI7VN2U.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import '../../chunk-7W7QLZNC.js';
4
4
  import '../../chunk-CEOMTQTP.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHNRFRNMY_cjs = require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkPOZNNKNJ_cjs = require('../../chunk-POZNNKNJ.cjs');
4
4
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
5
5
  require('../../chunk-CBAHCI4R.cjs');
6
6
  require('../../chunk-MEBXW75C.cjs');
@@ -66,7 +66,7 @@ function googleSearch(config) {
66
66
  };
67
67
  } catch (error) {
68
68
  const errorMessage = error instanceof Error ? error.message : "Web search failed";
69
- return chunkHNRFRNMY_cjs.failure(errorMessage);
69
+ return chunkPOZNNKNJ_cjs.failure(errorMessage);
70
70
  }
71
71
  }
72
72
  };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.cjs';
2
2
  export { g as googleProvider } from '../../google-CHU2yycE.cjs';
3
3
  import '../../types-ZguuKEs_.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.js';
2
2
  export { g as googleProvider } from '../../google-Da8IQxaI.js';
3
3
  import '../../types-ZguuKEs_.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import '../../chunk-7W7QLZNC.js';
4
4
  import '../../chunk-CEOMTQTP.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHNRFRNMY_cjs = require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkPOZNNKNJ_cjs = require('../../chunk-POZNNKNJ.cjs');
4
4
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
5
5
  require('../../chunk-CBAHCI4R.cjs');
6
6
  require('../../chunk-MEBXW75C.cjs');
@@ -68,7 +68,7 @@ function openaiSearch(config) {
68
68
  } catch (error) {
69
69
  const errorMessage = error instanceof Error ? error.message : "Web search failed";
70
70
  console.error("[OpenAI Search] Error:", errorMessage);
71
- return chunkHNRFRNMY_cjs.failure(errorMessage);
71
+ return chunkPOZNNKNJ_cjs.failure(errorMessage);
72
72
  }
73
73
  }
74
74
  };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.cjs';
2
2
  export { o as openaiProvider } from '../../openai-HVSCuXgO.cjs';
3
3
  import '../../types-ZguuKEs_.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.js';
2
2
  export { o as openaiProvider } from '../../openai-Cam8hF4f.js';
3
3
  import '../../types-ZguuKEs_.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import '../../chunk-7W7QLZNC.js';
4
4
  import '../../chunk-CEOMTQTP.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHNRFRNMY_cjs = require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkPOZNNKNJ_cjs = require('../../chunk-POZNNKNJ.cjs');
4
4
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
5
5
  require('../../chunk-CBAHCI4R.cjs');
6
6
  require('../../chunk-MEBXW75C.cjs');
@@ -70,7 +70,7 @@ function searxngSearch(config) {
70
70
  };
71
71
  } catch (error) {
72
72
  const errorMessage = error instanceof Error ? error.message : "Web search failed";
73
- return chunkHNRFRNMY_cjs.failure(errorMessage);
73
+ return chunkPOZNNKNJ_cjs.failure(errorMessage);
74
74
  }
75
75
  }
76
76
  };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.cjs';
2
2
  export { s as searxngProvider } from '../../searxng-QGOte_Gq.cjs';
3
3
  import '../../types-ZguuKEs_.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.js';
2
2
  export { s as searxngProvider } from '../../searxng-K0qtY9vp.js';
3
3
  import '../../types-ZguuKEs_.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import '../../chunk-7W7QLZNC.js';
4
4
  import '../../chunk-CEOMTQTP.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHNRFRNMY_cjs = require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkPOZNNKNJ_cjs = require('../../chunk-POZNNKNJ.cjs');
4
4
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
5
5
  require('../../chunk-CBAHCI4R.cjs');
6
6
  var chunkMEBXW75C_cjs = require('../../chunk-MEBXW75C.cjs');
@@ -70,7 +70,7 @@ function serperSearch(config) {
70
70
  };
71
71
  } catch (error) {
72
72
  const errorMessage = error instanceof Error ? error.message : "Web search failed";
73
- return chunkHNRFRNMY_cjs.failure(errorMessage);
73
+ return chunkPOZNNKNJ_cjs.failure(errorMessage);
74
74
  }
75
75
  }
76
76
  };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.cjs';
2
2
  export { s as serperProvider } from '../../serper-JzdaSnS9.cjs';
3
3
  import '../../types-ZguuKEs_.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.js';
2
2
  export { s as serperProvider } from '../../serper-7Czya3PW.js';
3
3
  import '../../types-ZguuKEs_.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import '../../chunk-7W7QLZNC.js';
4
4
  import { searchSerper } from '../../chunk-CEOMTQTP.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkHNRFRNMY_cjs = require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkPOZNNKNJ_cjs = require('../../chunk-POZNNKNJ.cjs');
4
4
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
5
5
  var chunkCBAHCI4R_cjs = require('../../chunk-CBAHCI4R.cjs');
6
6
  require('../../chunk-MEBXW75C.cjs');
@@ -76,7 +76,7 @@ function tavilySearch(config) {
76
76
  };
77
77
  } catch (error) {
78
78
  const errorMessage = error instanceof Error ? error.message : "Web search failed";
79
- return chunkHNRFRNMY_cjs.failure(errorMessage);
79
+ return chunkPOZNNKNJ_cjs.failure(errorMessage);
80
80
  }
81
81
  }
82
82
  };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.cjs';
2
2
  export { t as tavilyProvider } from '../../tavily-C8cXXojE.cjs';
3
3
  import '../../types-ZguuKEs_.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from '../../tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from '../../tools-coIcskZ4.js';
2
2
  export { t as tavilyProvider } from '../../tavily-DdSGVgkE.js';
3
3
  import '../../types-ZguuKEs_.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { failure } from '../../chunk-BRUDSHCV.js';
1
+ import { failure } from '../../chunk-QLH6TSCC.js';
2
2
  import { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
3
3
  import { searchTavily } from '../../chunk-7W7QLZNC.js';
4
4
  export { tavilyProvider } from '../../chunk-7W7QLZNC.js';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkO33I4HBL_cjs = require('../../chunk-O33I4HBL.cjs');
4
- require('../../chunk-HNRFRNMY.cjs');
3
+ var chunkWAPGTQDR_cjs = require('../../chunk-WAPGTQDR.cjs');
4
+ require('../../chunk-POZNNKNJ.cjs');
5
5
  var chunkASV6JLYG_cjs = require('../../chunk-ASV6JLYG.cjs');
6
6
  require('../../chunk-CBAHCI4R.cjs');
7
7
  require('../../chunk-MEBXW75C.cjs');
@@ -17,7 +17,7 @@ require('../../chunk-JEQ2X3Z6.cjs');
17
17
 
18
18
  Object.defineProperty(exports, "webSearchTool", {
19
19
  enumerable: true,
20
- get: function () { return chunkO33I4HBL_cjs.webSearchTool; }
20
+ get: function () { return chunkWAPGTQDR_cjs.webSearchTool; }
21
21
  });
22
22
  Object.defineProperty(exports, "formatSearchResultsForAI", {
23
23
  enumerable: true,
@@ -1,3 +1,3 @@
1
1
  export { b as WebSearchConfig, e as WebSearchImage, c as WebSearchParams, a as WebSearchProvider, W as WebSearchProviderInterface, f as WebSearchResponse, d as WebSearchResult } from '../../types-ZguuKEs_.cjs';
2
- export { f as formatSearchResultsForAI, s as summarizeSearchResults, w as webSearchTool } from '../../index-C261xY-B.cjs';
3
- import '../../tools-Clyufshc.cjs';
2
+ export { f as formatSearchResultsForAI, s as summarizeSearchResults, w as webSearchTool } from '../../index-BHkRA0mM.cjs';
3
+ import '../../tools-coIcskZ4.cjs';
@@ -1,3 +1,3 @@
1
1
  export { b as WebSearchConfig, e as WebSearchImage, c as WebSearchParams, a as WebSearchProvider, W as WebSearchProviderInterface, f as WebSearchResponse, d as WebSearchResult } from '../../types-ZguuKEs_.js';
2
- export { f as formatSearchResultsForAI, s as summarizeSearchResults, w as webSearchTool } from '../../index-25qIYJ21.js';
3
- import '../../tools-Clyufshc.js';
2
+ export { f as formatSearchResultsForAI, s as summarizeSearchResults, w as webSearchTool } from '../../index-tB0qI8my.js';
3
+ import '../../tools-coIcskZ4.js';
@@ -1,5 +1,5 @@
1
- export { webSearchTool } from '../../chunk-7YZVSG62.js';
2
- import '../../chunk-BRUDSHCV.js';
1
+ export { webSearchTool } from '../../chunk-LZMBBGWH.js';
2
+ import '../../chunk-QLH6TSCC.js';
3
3
  export { formatSearchResultsForAI, summarizeSearchResults } from '../../chunk-XGITAEXU.js';
4
4
  import '../../chunk-7W7QLZNC.js';
5
5
  import '../../chunk-CEOMTQTP.js';
@@ -532,6 +532,11 @@ interface ToolExecution {
532
532
  approvalMessage?: string;
533
533
  /** Timestamp when user responded to approval request */
534
534
  approvalTimestamp?: number;
535
+ /**
536
+ * Whether this tool execution should be hidden from the UI.
537
+ * Server-side tools can set this to hide internal operations from users.
538
+ */
539
+ hidden?: boolean;
535
540
  }
536
541
  /**
537
542
  * Agentic loop configuration
@@ -559,18 +564,32 @@ interface AgentLoopState {
559
564
  /** Whether the loop was aborted */
560
565
  aborted: boolean;
561
566
  }
567
+ /**
568
+ * A tool definition without the name (name is derived from the key in ToolSet)
569
+ */
570
+ type ToolSetEntry<TParams = Record<string, unknown>> = Omit<ToolDefinition<TParams>, "name">;
562
571
  /**
563
572
  * A set of tools, keyed by tool name
564
573
  *
574
+ * The key becomes the tool name, so tool definitions don't need a name property.
575
+ * Use with the `tool()` helper for clean syntax.
576
+ *
565
577
  * @example
566
578
  * ```typescript
567
579
  * const myTools: ToolSet = {
568
- * capture_screenshot: screenshotTool,
569
- * get_weather: weatherTool,
580
+ * capture_screenshot: tool({
581
+ * description: 'Capture screenshot',
582
+ * handler: async () => ({ success: true }),
583
+ * }),
584
+ * get_weather: tool({
585
+ * description: 'Get weather',
586
+ * inputSchema: { type: 'object', properties: { city: { type: 'string' } } },
587
+ * handler: async ({ city }) => ({ success: true, data: { temp: 72 } }),
588
+ * }),
570
589
  * };
571
590
  * ```
572
591
  */
573
- type ToolSet = Record<string, ToolDefinition>;
592
+ type ToolSet = Record<string, ToolSetEntry>;
574
593
  /**
575
594
  * Configuration for creating a tool
576
595
  */
@@ -647,4 +666,4 @@ declare function success<T = unknown>(data?: T, message?: string): ToolResponse<
647
666
  */
648
667
  declare function failure(error: string): ToolResponse;
649
668
 
650
- export { type AIProvider as A, type JSONSchemaProperty as J, type PermissionLevel as P, type ToolDefinition as T, type UnifiedToolCall as U, type ToolExecutionStatus as a, type ToolResponse as b, type ToolInputSchema as c, type ToolLocation as d, type ToolContext as e, type ToolSource as f, type ToolRenderProps as g, type ToolConfig as h, type ToolSet as i, type UnifiedToolResult as j, type ToolApprovalStatus as k, type ToolExecution as l, type AgentLoopConfig as m, type AgentLoopState as n, type AIResponseMode as o, type AIContent as p, type ToolPermission as q, type PermissionStorageConfig as r, type PermissionStorageAdapter as s, tool as t, toolToOpenAIFormat as u, toolToAnthropicFormat as v, createToolResult as w, success as x, failure as y };
669
+ export { type AIProvider as A, type JSONSchemaProperty as J, type PermissionLevel as P, type ToolDefinition as T, type UnifiedToolCall as U, type ToolExecutionStatus as a, type ToolResponse as b, type ToolInputSchema as c, type ToolLocation as d, type ToolContext as e, type ToolSource as f, type ToolRenderProps as g, type ToolConfig as h, type ToolSet as i, type ToolSetEntry as j, type UnifiedToolResult as k, type ToolApprovalStatus as l, type ToolExecution as m, type AgentLoopConfig as n, type AgentLoopState as o, type AIResponseMode as p, type AIContent as q, type ToolPermission as r, type PermissionStorageConfig as s, type PermissionStorageAdapter as t, tool as u, toolToOpenAIFormat as v, toolToAnthropicFormat as w, createToolResult as x, success as y, failure as z };
@@ -532,6 +532,11 @@ interface ToolExecution {
532
532
  approvalMessage?: string;
533
533
  /** Timestamp when user responded to approval request */
534
534
  approvalTimestamp?: number;
535
+ /**
536
+ * Whether this tool execution should be hidden from the UI.
537
+ * Server-side tools can set this to hide internal operations from users.
538
+ */
539
+ hidden?: boolean;
535
540
  }
536
541
  /**
537
542
  * Agentic loop configuration
@@ -559,18 +564,32 @@ interface AgentLoopState {
559
564
  /** Whether the loop was aborted */
560
565
  aborted: boolean;
561
566
  }
567
+ /**
568
+ * A tool definition without the name (name is derived from the key in ToolSet)
569
+ */
570
+ type ToolSetEntry<TParams = Record<string, unknown>> = Omit<ToolDefinition<TParams>, "name">;
562
571
  /**
563
572
  * A set of tools, keyed by tool name
564
573
  *
574
+ * The key becomes the tool name, so tool definitions don't need a name property.
575
+ * Use with the `tool()` helper for clean syntax.
576
+ *
565
577
  * @example
566
578
  * ```typescript
567
579
  * const myTools: ToolSet = {
568
- * capture_screenshot: screenshotTool,
569
- * get_weather: weatherTool,
580
+ * capture_screenshot: tool({
581
+ * description: 'Capture screenshot',
582
+ * handler: async () => ({ success: true }),
583
+ * }),
584
+ * get_weather: tool({
585
+ * description: 'Get weather',
586
+ * inputSchema: { type: 'object', properties: { city: { type: 'string' } } },
587
+ * handler: async ({ city }) => ({ success: true, data: { temp: 72 } }),
588
+ * }),
570
589
  * };
571
590
  * ```
572
591
  */
573
- type ToolSet = Record<string, ToolDefinition>;
592
+ type ToolSet = Record<string, ToolSetEntry>;
574
593
  /**
575
594
  * Configuration for creating a tool
576
595
  */
@@ -647,4 +666,4 @@ declare function success<T = unknown>(data?: T, message?: string): ToolResponse<
647
666
  */
648
667
  declare function failure(error: string): ToolResponse;
649
668
 
650
- export { type AIProvider as A, type JSONSchemaProperty as J, type PermissionLevel as P, type ToolDefinition as T, type UnifiedToolCall as U, type ToolExecutionStatus as a, type ToolResponse as b, type ToolInputSchema as c, type ToolLocation as d, type ToolContext as e, type ToolSource as f, type ToolRenderProps as g, type ToolConfig as h, type ToolSet as i, type UnifiedToolResult as j, type ToolApprovalStatus as k, type ToolExecution as l, type AgentLoopConfig as m, type AgentLoopState as n, type AIResponseMode as o, type AIContent as p, type ToolPermission as q, type PermissionStorageConfig as r, type PermissionStorageAdapter as s, tool as t, toolToOpenAIFormat as u, toolToAnthropicFormat as v, createToolResult as w, success as x, failure as y };
669
+ export { type AIProvider as A, type JSONSchemaProperty as J, type PermissionLevel as P, type ToolDefinition as T, type UnifiedToolCall as U, type ToolExecutionStatus as a, type ToolResponse as b, type ToolInputSchema as c, type ToolLocation as d, type ToolContext as e, type ToolSource as f, type ToolRenderProps as g, type ToolConfig as h, type ToolSet as i, type ToolSetEntry as j, type UnifiedToolResult as k, type ToolApprovalStatus as l, type ToolExecution as m, type AgentLoopConfig as n, type AgentLoopState as o, type AIResponseMode as p, type AIContent as q, type ToolPermission as r, type PermissionStorageConfig as s, type PermissionStorageAdapter as t, tool as u, toolToOpenAIFormat as v, toolToAnthropicFormat as w, createToolResult as x, success as y, failure as z };
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from './tools-Clyufshc.cjs';
1
+ import { T as ToolDefinition } from './tools-coIcskZ4.cjs';
2
2
 
3
3
  /**
4
4
  * MCP (Model Context Protocol) Type Definitions
@@ -1,4 +1,4 @@
1
- import { T as ToolDefinition } from './tools-Clyufshc.js';
1
+ import { T as ToolDefinition } from './tools-coIcskZ4.js';
2
2
 
3
3
  /**
4
4
  * MCP (Model Context Protocol) Type Definitions
package/dist/ui/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunk5UMM5VYB_cjs = require('../chunk-5UMM5VYB.cjs');
4
- var chunk33JSFVGH_cjs = require('../chunk-33JSFVGH.cjs');
3
+ var chunkR6LKHKAI_cjs = require('../chunk-R6LKHKAI.cjs');
4
+ var chunkWQSK3Z4K_cjs = require('../chunk-WQSK3Z4K.cjs');
5
5
  var chunkJO4BHPAD_cjs = require('../chunk-JO4BHPAD.cjs');
6
6
  require('../chunk-JGPDQDY4.cjs');
7
- require('../chunk-O33I4HBL.cjs');
8
- require('../chunk-HNRFRNMY.cjs');
7
+ require('../chunk-WAPGTQDR.cjs');
8
+ require('../chunk-POZNNKNJ.cjs');
9
9
  require('../chunk-ASV6JLYG.cjs');
10
10
  require('../chunk-CBAHCI4R.cjs');
11
11
  require('../chunk-MEBXW75C.cjs');
@@ -4363,15 +4363,16 @@ function DefaultMessage({
4363
4363
  }
4364
4364
  );
4365
4365
  }
4366
- const isToolHidden = (toolName) => {
4367
- const toolDef = registeredTools?.find((t) => t.name === toolName);
4366
+ const isToolHidden = (exec) => {
4367
+ if (exec.hidden === true) return true;
4368
+ const toolDef = registeredTools?.find((t) => t.name === exec.name);
4368
4369
  return toolDef?.hidden === true;
4369
4370
  };
4370
4371
  const pendingApprovalTools = message.toolExecutions?.filter(
4371
- (exec) => exec.approvalStatus === "required" && !isToolHidden(exec.name)
4372
+ (exec) => exec.approvalStatus === "required" && !isToolHidden(exec)
4372
4373
  );
4373
4374
  const completedTools = message.toolExecutions?.filter(
4374
- (exec) => exec.approvalStatus !== "required" && !isToolHidden(exec.name)
4375
+ (exec) => exec.approvalStatus !== "required" && !isToolHidden(exec)
4375
4376
  );
4376
4377
  const hasCustomRender = (toolName, execSource) => {
4377
4378
  if (toolRenderers?.[toolName]) return true;
@@ -4508,7 +4509,7 @@ function DefaultMessage({
4508
4509
  children: /* @__PURE__ */ jsxRuntime.jsx(ToolSteps, { steps: toolSteps })
4509
4510
  }
4510
4511
  ),
4511
- message.toolExecutions?.filter((exec) => !isToolHidden(exec.name)).map((exec) => {
4512
+ message.toolExecutions?.filter((exec) => !isToolHidden(exec)).map((exec) => {
4512
4513
  const uiResources = exec.result?._uiResources;
4513
4514
  if (!uiResources || uiResources.length === 0) return null;
4514
4515
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5944,7 +5945,7 @@ function useInternalThreadManager(config = {}) {
5944
5945
  saveDebounce,
5945
5946
  autoRestoreLastThread
5946
5947
  };
5947
- const threadManager = chunk5UMM5VYB_cjs.useThreadManager(threadManagerConfig);
5948
+ const threadManager = chunkR6LKHKAI_cjs.useThreadManager(threadManagerConfig);
5948
5949
  const {
5949
5950
  currentThread,
5950
5951
  currentThreadId,
@@ -5954,7 +5955,7 @@ function useInternalThreadManager(config = {}) {
5954
5955
  clearCurrentThread,
5955
5956
  refreshThreads
5956
5957
  } = threadManager;
5957
- const { messages, setMessages, status, isLoading } = chunk5UMM5VYB_cjs.useCopilot();
5958
+ const { messages, setMessages, status, isLoading } = chunkR6LKHKAI_cjs.useCopilot();
5958
5959
  const isLoadingMessagesRef = React20.useRef(false);
5959
5960
  const savingToThreadRef = React20.useRef(null);
5960
5961
  const lastSavedSnapshotRef = React20.useRef("");
@@ -6121,7 +6122,7 @@ function parsePersistenceConfig(persistence, onThreadChange) {
6121
6122
  };
6122
6123
  case "server":
6123
6124
  return {
6124
- adapter: chunk33JSFVGH_cjs.createServerAdapter({
6125
+ adapter: chunkWQSK3Z4K_cjs.createServerAdapter({
6125
6126
  endpoint: persistence.endpoint,
6126
6127
  headers: persistence.headers
6127
6128
  }),
@@ -6171,7 +6172,7 @@ function CopilotChatBase(props) {
6171
6172
  approveToolExecution,
6172
6173
  rejectToolExecution,
6173
6174
  registeredTools
6174
- } = chunk5UMM5VYB_cjs.useCopilot();
6175
+ } = chunkR6LKHKAI_cjs.useCopilot();
6175
6176
  const toolExecutions = rawToolExecutions.map(
6176
6177
  (exec) => ({
6177
6178
  id: exec.id,
@@ -6181,7 +6182,8 @@ function CopilotChatBase(props) {
6181
6182
  result: exec.result,
6182
6183
  error: exec.error,
6183
6184
  timestamp: exec.startedAt ? exec.startedAt.getTime() : Date.now(),
6184
- approvalStatus: exec.approvalStatus
6185
+ approvalStatus: exec.approvalStatus,
6186
+ hidden: exec.hidden
6185
6187
  })
6186
6188
  );
6187
6189
  const toolResultsMap = /* @__PURE__ */ new Map();
@@ -6215,6 +6217,7 @@ function CopilotChatBase(props) {
6215
6217
  }
6216
6218
  );
6217
6219
  } else {
6220
+ const toolCallsHidden = m.metadata?.toolCallsHidden;
6218
6221
  messageToolExecutions = m.toolCalls.map(
6219
6222
  (tc) => {
6220
6223
  const resultContent = toolResultsMap.get(tc.id);
@@ -6231,14 +6234,22 @@ function CopilotChatBase(props) {
6231
6234
  args = JSON.parse(tc.function.arguments || "{}");
6232
6235
  } catch {
6233
6236
  }
6237
+ let hidden = toolCallsHidden?.[tc.id];
6238
+ if (hidden === void 0) {
6239
+ const toolDef = registeredTools?.find(
6240
+ (t) => t.name === tc.function.name
6241
+ );
6242
+ hidden = toolDef?.hidden;
6243
+ }
6234
6244
  return {
6235
6245
  id: tc.id,
6236
6246
  name: tc.function.name,
6237
6247
  args,
6238
6248
  status: result ? "completed" : "pending",
6239
6249
  result,
6240
- timestamp: Date.now()
6250
+ timestamp: Date.now(),
6241
6251
  // Historical - use current time
6252
+ hidden
6242
6253
  };
6243
6254
  }
6244
6255
  );
@@ -6248,6 +6259,9 @@ function CopilotChatBase(props) {
6248
6259
  if (savedExecutions && savedExecutions.length > 0 && !messageToolExecutions) {
6249
6260
  messageToolExecutions = savedExecutions;
6250
6261
  }
6262
+ const visibleToolExecutions = messageToolExecutions?.filter(
6263
+ (exec) => !exec.hidden
6264
+ );
6251
6265
  return {
6252
6266
  id: m.id,
6253
6267
  role: m.role,
@@ -6257,11 +6271,18 @@ function CopilotChatBase(props) {
6257
6271
  attachments: m.attachments,
6258
6272
  // Include tool_calls for assistant messages
6259
6273
  tool_calls: m.toolCalls,
6260
- // Attach matched tool executions to assistant messages
6261
- toolExecutions: messageToolExecutions,
6274
+ // Attach matched tool executions to assistant messages (only visible ones)
6275
+ toolExecutions: visibleToolExecutions,
6262
6276
  // Include metadata (citations from native web search, etc.)
6263
- metadata: m.metadata
6277
+ metadata: m.metadata,
6278
+ // Mark if this message had only hidden tools (for filtering empty bubbles)
6279
+ _hasOnlyHiddenTools: messageToolExecutions && messageToolExecutions.length > 0 && (!visibleToolExecutions || visibleToolExecutions.length === 0)
6264
6280
  };
6281
+ }).filter((m) => {
6282
+ if (m.role === "assistant" && !m.content && m._hasOnlyHiddenTools) {
6283
+ return false;
6284
+ }
6285
+ return true;
6265
6286
  });
6266
6287
  const suggestions = visibleMessages.length === 0 && chatProps.suggestions?.length ? chatProps.suggestions : [];
6267
6288
  const lastMessage = messages[messages.length - 1];