@athenaintel/react 0.17.0 → 0.19.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.
Files changed (128) hide show
  1. package/README.md +179 -43
  2. package/dist/AthenaContext-B1QMhIP-.cjs.map +1 -1
  3. package/dist/AthenaContext-MOslgOmE.js.map +1 -1
  4. package/dist/SuperGroupingCard-BsWbHyV_.js +795 -0
  5. package/dist/SuperGroupingCard-BsWbHyV_.js.map +1 -0
  6. package/dist/SuperGroupingCard-CRRFUgjN.cjs +794 -0
  7. package/dist/SuperGroupingCard-CRRFUgjN.cjs.map +1 -0
  8. package/dist/chat/StatewireApprovalCard.d.ts +59 -2
  9. package/dist/chat/StatewireClientToolBridge.d.ts +3 -3
  10. package/dist/chat/StatewireQueuedMessages.d.ts +105 -6
  11. package/dist/chat/statewire-approval.d.ts +1 -1
  12. package/dist/chat/statewire-banners.d.ts +5 -9
  13. package/dist/chat/statewire-client-tools.d.ts +15 -21
  14. package/dist/chat/super-grouping/CollapsibleGroup.d.ts +52 -11
  15. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +78 -21
  16. package/dist/chat/super-grouping/activity-timeline.d.ts +91 -0
  17. package/dist/chat/super-grouping/grouping-function.d.ts +13 -10
  18. package/dist/chat/super-grouping/index.d.ts +12 -0
  19. package/dist/chat/super-grouping/toolkit-map.d.ts +8 -1
  20. package/dist/chat/use-statewire-approval-request.d.ts +44 -0
  21. package/dist/chat-ui/header/conversation-history-panel.d.ts +11 -1
  22. package/dist/chat-ui/index.d.ts +9 -0
  23. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +24 -0
  24. package/dist/chat-ui/mentions/suggestions/data/sources/index.d.ts +5 -0
  25. package/dist/chat-ui/mentions/suggestions/data/use-mention-suggestions.d.ts +1 -1
  26. package/dist/chat-ui/mentions/suggestions/shims.d.ts +0 -4
  27. package/dist/chat-ui/messages/continue-pill.d.ts +13 -0
  28. package/dist/chat-ui/messages/message-components.d.ts +7 -2
  29. package/dist/chat-ui/messages/runtime-message.d.ts +21 -0
  30. package/dist/chat-ui/messages/statewire-continue-run.d.ts +82 -0
  31. package/dist/chat-ui/messages/user-edit-composer.d.ts +5 -2
  32. package/dist/chat-ui/statewire.d.ts +19 -0
  33. package/dist/chat-ui/thread/chat-composer-dock.d.ts +1 -1
  34. package/dist/chat-ui/thread/chat-thread-shell.d.ts +7 -1
  35. package/dist/chat-ui/thread/statewire-history-edge.d.ts +52 -0
  36. package/dist/chat-ui-statewire.cjs +25 -0
  37. package/dist/chat-ui-statewire.cjs.map +1 -0
  38. package/dist/chat-ui-statewire.js +25 -0
  39. package/dist/chat-ui-statewire.js.map +1 -0
  40. package/dist/chat-ui.cjs +292 -252
  41. package/dist/chat-ui.cjs.map +1 -1
  42. package/dist/chat-ui.js +289 -248
  43. package/dist/chat-ui.js.map +1 -1
  44. package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
  45. package/dist/diagnostics/errors.d.ts +4 -4
  46. package/dist/index.cjs +20237 -26233
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.ts +25 -14
  49. package/dist/index.js +18465 -24458
  50. package/dist/index.js.map +1 -1
  51. package/dist/lib/athena-urls.d.ts +0 -2
  52. package/dist/lib/posthog/wrap-posthog-client.d.ts +3 -1
  53. package/dist/misc-tool-uis-B2e0Okkn.cjs +43 -0
  54. package/dist/misc-tool-uis-B2e0Okkn.cjs.map +1 -0
  55. package/dist/misc-tool-uis-gAiQw0Yl.js +44 -0
  56. package/dist/misc-tool-uis-gAiQw0Yl.js.map +1 -0
  57. package/dist/provider/AthenaContext.d.ts +0 -7
  58. package/dist/provider/AthenaProvider.d.ts +28 -52
  59. package/dist/provider/config.d.ts +19 -15
  60. package/dist/provider/statewire-lifecycle-context.d.ts +3 -4
  61. package/dist/provider/statewire-window-context.d.ts +12 -0
  62. package/dist/provider/types.d.ts +0 -1
  63. package/dist/runtime/statewire-auth-headers.d.ts +38 -0
  64. package/dist/runtime/statewire-lifecycle.d.ts +25 -1
  65. package/dist/runtime/statewire-run-config.d.ts +18 -5
  66. package/dist/runtime/statewire-session-key.d.ts +13 -0
  67. package/dist/runtime/useAthenaStatewireRuntime.d.ts +42 -16
  68. package/dist/statewire-continue-run-D34gS7_1.js +132 -0
  69. package/dist/statewire-continue-run-D34gS7_1.js.map +1 -0
  70. package/dist/statewire-continue-run-nE9VCKUh.cjs +131 -0
  71. package/dist/statewire-continue-run-nE9VCKUh.cjs.map +1 -0
  72. package/dist/statewire-history-edge-C8uyTEjX.cjs +1711 -0
  73. package/dist/statewire-history-edge-C8uyTEjX.cjs.map +1 -0
  74. package/dist/statewire-history-edge-CPohUKMt.js +1712 -0
  75. package/dist/statewire-history-edge-CPohUKMt.js.map +1 -0
  76. package/dist/styles.css +1 -1
  77. package/dist/super-grouping.cjs +22 -0
  78. package/dist/super-grouping.cjs.map +1 -0
  79. package/dist/super-grouping.js +22 -0
  80. package/dist/super-grouping.js.map +1 -0
  81. package/dist/threads/ThreadList.d.ts +6 -1
  82. package/dist/threads/mint-thread-id.d.ts +8 -0
  83. package/dist/threads/statewire-thread-list.d.ts +26 -9
  84. package/dist/threads/thread-id-context.d.ts +9 -0
  85. package/dist/threads/use-statewire-conversation-history.d.ts +2 -0
  86. package/dist/threads/useAthenaThreadManager.d.ts +24 -12
  87. package/dist/tool-fallback-DkQ3DLkn.js +4281 -0
  88. package/dist/tool-fallback-DkQ3DLkn.js.map +1 -0
  89. package/dist/tool-fallback-kfhpJQZa.cjs +4297 -0
  90. package/dist/tool-fallback-kfhpJQZa.cjs.map +1 -0
  91. package/dist/tools/index.d.ts +14 -0
  92. package/dist/tools/misc-tool-uis.d.ts +2 -0
  93. package/dist/tools/primitives.d.ts +41 -0
  94. package/dist/tools/tool-fallback.d.ts +78 -6
  95. package/dist/tools/tool-icons.d.ts +10 -0
  96. package/dist/tools/tool-uis.d.ts +1 -23
  97. package/dist/tools.cjs +41 -0
  98. package/dist/tools.cjs.map +1 -0
  99. package/dist/tools.js +41 -0
  100. package/dist/tools.js.map +1 -0
  101. package/dist/trash-2-B5OaNAL7.cjs +5096 -0
  102. package/dist/trash-2-B5OaNAL7.cjs.map +1 -0
  103. package/dist/trash-2-CCwSURL-.js +5081 -0
  104. package/dist/trash-2-CCwSURL-.js.map +1 -0
  105. package/dist/{use-rest-conversation-history-BdnG8jEP.cjs → use-rest-conversation-history-Cm8qMRxp.cjs} +985 -5405
  106. package/dist/use-rest-conversation-history-Cm8qMRxp.cjs.map +1 -0
  107. package/dist/{use-rest-conversation-history-DpEswBqQ.js → use-rest-conversation-history-veDZS-oL.js} +1035 -5455
  108. package/dist/use-rest-conversation-history-veDZS-oL.js.map +1 -0
  109. package/dist/wrench-BEf72cyP.cjs +417 -0
  110. package/dist/wrench-BEf72cyP.cjs.map +1 -0
  111. package/dist/wrench-CbrOlVYm.js +418 -0
  112. package/dist/wrench-CbrOlVYm.js.map +1 -0
  113. package/dist/x-Dfd2NzK0.cjs +42 -0
  114. package/dist/x-Dfd2NzK0.cjs.map +1 -0
  115. package/dist/x-_DntAa_a.js +43 -0
  116. package/dist/x-_DntAa_a.js.map +1 -0
  117. package/package.json +29 -11
  118. package/dist/chat/super-grouping/tool-status-labels.d.ts +0 -1
  119. package/dist/runtime/converter.d.ts +0 -5
  120. package/dist/runtime/external-message-converter.d.ts +0 -21
  121. package/dist/runtime/schemas.d.ts +0 -24
  122. package/dist/runtime/transport.d.ts +0 -39
  123. package/dist/runtime/useAthenaRuntime.d.ts +0 -47
  124. package/dist/threads/adapter.d.ts +0 -42
  125. package/dist/threads/useActiveThreadStateHydration.d.ts +0 -12
  126. package/dist/threads/useThreadTitlePolling.d.ts +0 -14
  127. package/dist/use-rest-conversation-history-BdnG8jEP.cjs.map +0 -1
  128. package/dist/use-rest-conversation-history-DpEswBqQ.js.map +0 -1
package/dist/chat-ui.cjs CHANGED
@@ -3,14 +3,19 @@ var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
- const useRestConversationHistory = require("./use-rest-conversation-history-BdnG8jEP.cjs");
6
+ const useRestConversationHistory = require("./use-rest-conversation-history-Cm8qMRxp.cjs");
7
+ const statewireHistoryEdge = require("./statewire-history-edge-C8uyTEjX.cjs");
7
8
  const jsxRuntime = require("react/jsx-runtime");
9
+ const trash2 = require("./trash-2-B5OaNAL7.cjs");
8
10
  const React = require("react");
11
+ const wrench = require("./wrench-BEf72cyP.cjs");
9
12
  const react = require("@assistant-ui/react");
10
13
  require("@assistant-ui/tap");
11
14
  require("statewire");
12
- require("@assistant-ui/store");
13
15
  require("@assistant-ui/react-statewire");
16
+ require("@assistant-ui/store");
17
+ require("@assistant-ui/core");
18
+ const statewireContinueRun = require("./statewire-continue-run-nE9VCKUh.cjs");
14
19
  const mentionHandlersByThread = /* @__PURE__ */ new Map();
15
20
  function registerChatAssetMentionHandler(threadId, handler) {
16
21
  mentionHandlersByThread.set(threadId, handler);
@@ -26,22 +31,19 @@ function registerChatAssetMentionHandler(threadId, handler) {
26
31
  * This source code is licensed under the ISC license.
27
32
  * See the LICENSE file in the root directory of this source tree.
28
33
  */
29
- const __iconNode$l = [
30
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
31
- ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
32
- ["path", { d: "M2 14h2", key: "vft8re" }],
33
- ["path", { d: "M20 14h2", key: "4cs60a" }],
34
- ["path", { d: "M15 13v2", key: "1xurst" }],
35
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
34
+ const __iconNode$e = [
35
+ ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
36
+ ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
37
+ ["path", { d: "M10 12h4", key: "a56b0p" }]
36
38
  ];
37
- const Bot = useRestConversationHistory.createLucideIcon("bot", __iconNode$l);
39
+ const Archive = trash2.createLucideIcon("archive", __iconNode$e);
38
40
  /**
39
41
  * @license lucide-react v0.575.0 - ISC
40
42
  *
41
43
  * This source code is licensed under the ISC license.
42
44
  * See the LICENSE file in the root directory of this source tree.
43
45
  */
44
- const __iconNode$k = [
46
+ const __iconNode$d = [
45
47
  ["path", { d: "M10 12h4", key: "a56b0p" }],
46
48
  ["path", { d: "M10 8h4", key: "1sr2af" }],
47
49
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -54,24 +56,24 @@ const __iconNode$k = [
54
56
  ],
55
57
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
56
58
  ];
57
- const Building2 = useRestConversationHistory.createLucideIcon("building-2", __iconNode$k);
59
+ const Building2 = trash2.createLucideIcon("building-2", __iconNode$d);
58
60
  /**
59
61
  * @license lucide-react v0.575.0 - ISC
60
62
  *
61
63
  * This source code is licensed under the ISC license.
62
64
  * See the LICENSE file in the root directory of this source tree.
63
65
  */
64
- const __iconNode$j = [
66
+ const __iconNode$c = [
65
67
  ["path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z", key: "p7xjir" }]
66
68
  ];
67
- const Cloud = useRestConversationHistory.createLucideIcon("cloud", __iconNode$j);
69
+ const Cloud = trash2.createLucideIcon("cloud", __iconNode$c);
68
70
  /**
69
71
  * @license lucide-react v0.575.0 - ISC
70
72
  *
71
73
  * This source code is licensed under the ISC license.
72
74
  * See the LICENSE file in the root directory of this source tree.
73
75
  */
74
- const __iconNode$i = [
76
+ const __iconNode$b = [
75
77
  [
76
78
  "path",
77
79
  {
@@ -81,14 +83,14 @@ const __iconNode$i = [
81
83
  ],
82
84
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
83
85
  ];
84
- const Eye = useRestConversationHistory.createLucideIcon("eye", __iconNode$i);
86
+ const Eye = trash2.createLucideIcon("eye", __iconNode$b);
85
87
  /**
86
88
  * @license lucide-react v0.575.0 - ISC
87
89
  *
88
90
  * This source code is licensed under the ISC license.
89
91
  * See the LICENSE file in the root directory of this source tree.
90
92
  */
91
- const __iconNode$h = [
93
+ const __iconNode$a = [
92
94
  [
93
95
  "path",
94
96
  {
@@ -100,14 +102,14 @@ const __iconNode$h = [
100
102
  ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
101
103
  ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
102
104
  ];
103
- const FileCode = useRestConversationHistory.createLucideIcon("file-code", __iconNode$h);
105
+ const FileCode = trash2.createLucideIcon("file-code", __iconNode$a);
104
106
  /**
105
107
  * @license lucide-react v0.575.0 - ISC
106
108
  *
107
109
  * This source code is licensed under the ISC license.
108
110
  * See the LICENSE file in the root directory of this source tree.
109
111
  */
110
- const __iconNode$g = [
112
+ const __iconNode$9 = [
111
113
  [
112
114
  "path",
113
115
  {
@@ -116,26 +118,26 @@ const __iconNode$g = [
116
118
  }
117
119
  ]
118
120
  ];
119
- const Headphones = useRestConversationHistory.createLucideIcon("headphones", __iconNode$g);
121
+ const Headphones = trash2.createLucideIcon("headphones", __iconNode$9);
120
122
  /**
121
123
  * @license lucide-react v0.575.0 - ISC
122
124
  *
123
125
  * This source code is licensed under the ISC license.
124
126
  * See the LICENSE file in the root directory of this source tree.
125
127
  */
126
- const __iconNode$f = [
128
+ const __iconNode$8 = [
127
129
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
128
130
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
129
131
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
130
132
  ];
131
- const Key = useRestConversationHistory.createLucideIcon("key", __iconNode$f);
133
+ const Key = trash2.createLucideIcon("key", __iconNode$8);
132
134
  /**
133
135
  * @license lucide-react v0.575.0 - ISC
134
136
  *
135
137
  * This source code is licensed under the ISC license.
136
138
  * See the LICENSE file in the root directory of this source tree.
137
139
  */
138
- const __iconNode$e = [
140
+ const __iconNode$7 = [
139
141
  ["path", { d: "M10 8h.01", key: "1r9ogq" }],
140
142
  ["path", { d: "M12 12h.01", key: "1mp3jc" }],
141
143
  ["path", { d: "M14 8h.01", key: "1primd" }],
@@ -146,84 +148,51 @@ const __iconNode$e = [
146
148
  ["path", { d: "M8 12h.01", key: "czm47f" }],
147
149
  ["rect", { width: "20", height: "16", x: "2", y: "4", rx: "2", key: "18n3k1" }]
148
150
  ];
149
- const Keyboard = useRestConversationHistory.createLucideIcon("keyboard", __iconNode$e);
151
+ const Keyboard = trash2.createLucideIcon("keyboard", __iconNode$7);
150
152
  /**
151
153
  * @license lucide-react v0.575.0 - ISC
152
154
  *
153
155
  * This source code is licensed under the ISC license.
154
156
  * See the LICENSE file in the root directory of this source tree.
155
157
  */
156
- const __iconNode$d = [
157
- ["rect", { width: "7", height: "9", x: "3", y: "3", rx: "1", key: "10lvy0" }],
158
- ["rect", { width: "7", height: "5", x: "14", y: "3", rx: "1", key: "16une8" }],
159
- ["rect", { width: "7", height: "9", x: "14", y: "12", rx: "1", key: "1hutg5" }],
160
- ["rect", { width: "7", height: "5", x: "3", y: "16", rx: "1", key: "ldoo1y" }]
161
- ];
162
- const LayoutDashboard = useRestConversationHistory.createLucideIcon("layout-dashboard", __iconNode$d);
163
- /**
164
- * @license lucide-react v0.575.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */
169
- const __iconNode$c = [
158
+ const __iconNode$6 = [
170
159
  ["path", { d: "m16 6 4 14", key: "ji33uf" }],
171
160
  ["path", { d: "M12 6v14", key: "1n7gus" }],
172
161
  ["path", { d: "M8 8v12", key: "1gg7y9" }],
173
162
  ["path", { d: "M4 4v16", key: "6qkkli" }]
174
163
  ];
175
- const Library = useRestConversationHistory.createLucideIcon("library", __iconNode$c);
164
+ const Library = trash2.createLucideIcon("library", __iconNode$6);
176
165
  /**
177
166
  * @license lucide-react v0.575.0 - ISC
178
167
  *
179
168
  * This source code is licensed under the ISC license.
180
169
  * See the LICENSE file in the root directory of this source tree.
181
170
  */
182
- const __iconNode$b = [
171
+ const __iconNode$5 = [
183
172
  ["path", { d: "M12 19v3", key: "npa21l" }],
184
173
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
185
174
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
186
175
  ];
187
- const Mic = useRestConversationHistory.createLucideIcon("mic", __iconNode$b);
188
- /**
189
- * @license lucide-react v0.575.0 - ISC
190
- *
191
- * This source code is licensed under the ISC license.
192
- * See the LICENSE file in the root directory of this source tree.
193
- */
194
- const __iconNode$a = [
195
- [
196
- "path",
197
- {
198
- d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
199
- key: "e79jfc"
200
- }
201
- ],
202
- ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
203
- ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
204
- ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
205
- ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
206
- ];
207
- const Palette = useRestConversationHistory.createLucideIcon("palette", __iconNode$a);
176
+ const Mic = trash2.createLucideIcon("mic", __iconNode$5);
208
177
  /**
209
178
  * @license lucide-react v0.575.0 - ISC
210
179
  *
211
180
  * This source code is licensed under the ISC license.
212
181
  * See the LICENSE file in the root directory of this source tree.
213
182
  */
214
- const __iconNode$9 = [
183
+ const __iconNode$4 = [
215
184
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
216
185
  ["path", { d: "M3 9h18", key: "1pudct" }],
217
186
  ["path", { d: "M9 21V9", key: "1oto5p" }]
218
187
  ];
219
- const PanelsTopLeft = useRestConversationHistory.createLucideIcon("panels-top-left", __iconNode$9);
188
+ const PanelsTopLeft = trash2.createLucideIcon("panels-top-left", __iconNode$4);
220
189
  /**
221
190
  * @license lucide-react v0.575.0 - ISC
222
191
  *
223
192
  * This source code is licensed under the ISC license.
224
193
  * See the LICENSE file in the root directory of this source tree.
225
194
  */
226
- const __iconNode$8 = [
195
+ const __iconNode$3 = [
227
196
  [
228
197
  "path",
229
198
  {
@@ -241,144 +210,60 @@ const __iconNode$8 = [
241
210
  ["path", { d: "m2.3 2.3 7.286 7.286", key: "1wuzzi" }],
242
211
  ["circle", { cx: "11", cy: "11", r: "2", key: "xmgehs" }]
243
212
  ];
244
- const PenTool = useRestConversationHistory.createLucideIcon("pen-tool", __iconNode$8);
245
- /**
246
- * @license lucide-react v0.575.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */
251
- const __iconNode$7 = [
252
- [
253
- "path",
254
- {
255
- d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
256
- key: "9njp5v"
257
- }
258
- ]
259
- ];
260
- const Phone = useRestConversationHistory.createLucideIcon("phone", __iconNode$7);
213
+ const PenTool = trash2.createLucideIcon("pen-tool", __iconNode$3);
261
214
  /**
262
215
  * @license lucide-react v0.575.0 - ISC
263
216
  *
264
217
  * This source code is licensed under the ISC license.
265
218
  * See the LICENSE file in the root directory of this source tree.
266
219
  */
267
- const __iconNode$6 = [
220
+ const __iconNode$2 = [
268
221
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
269
222
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
270
223
  ];
271
- const Smartphone = useRestConversationHistory.createLucideIcon("smartphone", __iconNode$6);
224
+ const Smartphone = trash2.createLucideIcon("smartphone", __iconNode$2);
272
225
  /**
273
226
  * @license lucide-react v0.575.0 - ISC
274
227
  *
275
228
  * This source code is licensed under the ISC license.
276
229
  * See the LICENSE file in the root directory of this source tree.
277
230
  */
278
- const __iconNode$5 = [
279
- [
280
- "path",
281
- {
282
- d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
283
- key: "1s2grr"
284
- }
285
- ],
286
- ["path", { d: "M20 2v4", key: "1rf3ol" }],
287
- ["path", { d: "M22 4h-4", key: "gwowj6" }],
288
- ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
289
- ];
290
- const Sparkles = useRestConversationHistory.createLucideIcon("sparkles", __iconNode$5);
291
- /**
292
- * @license lucide-react v0.575.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */
297
- const __iconNode$4 = [
231
+ const __iconNode$1 = [
298
232
  [
299
233
  "path",
300
234
  { d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
301
235
  ],
302
236
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
303
237
  ];
304
- const SquareCheckBig = useRestConversationHistory.createLucideIcon("square-check-big", __iconNode$4);
238
+ const SquareCheckBig = trash2.createLucideIcon("square-check-big", __iconNode$1);
305
239
  /**
306
240
  * @license lucide-react v0.575.0 - ISC
307
241
  *
308
242
  * This source code is licensed under the ISC license.
309
243
  * See the LICENSE file in the root directory of this source tree.
310
244
  */
311
- const __iconNode$3 = [
312
- [
313
- "path",
314
- {
315
- d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
316
- key: "r04s7s"
317
- }
318
- ]
319
- ];
320
- const Star = useRestConversationHistory.createLucideIcon("star", __iconNode$3);
321
- /**
322
- * @license lucide-react v0.575.0 - ISC
323
- *
324
- * This source code is licensed under the ISC license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */
327
- const __iconNode$2 = [
245
+ const __iconNode = [
328
246
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
329
247
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
330
248
  ];
331
- const User = useRestConversationHistory.createLucideIcon("user", __iconNode$2);
332
- /**
333
- * @license lucide-react v0.575.0 - ISC
334
- *
335
- * This source code is licensed under the ISC license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */
338
- const __iconNode$1 = [
339
- [
340
- "path",
341
- {
342
- d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
343
- key: "ftymec"
344
- }
345
- ],
346
- ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
347
- ];
348
- const Video = useRestConversationHistory.createLucideIcon("video", __iconNode$1);
349
- /**
350
- * @license lucide-react v0.575.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */
355
- const __iconNode = [
356
- [
357
- "path",
358
- {
359
- d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
360
- key: "1xq2db"
361
- }
362
- ]
363
- ];
364
- const Zap = useRestConversationHistory.createLucideIcon("zap", __iconNode);
249
+ const User = trash2.createLucideIcon("user", __iconNode);
365
250
  function ChatHeaderRoot({
366
251
  children,
367
252
  className
368
253
  }) {
369
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: useRestConversationHistory.cn(useRestConversationHistory.THREAD_HEADER_CLASS, className), children });
254
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: trash2.cn(useRestConversationHistory.THREAD_HEADER_CLASS, className), children });
370
255
  }
371
256
  function ChatHeaderIdentity({
372
257
  children,
373
258
  className
374
259
  }) {
375
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: useRestConversationHistory.cn(useRestConversationHistory.THREAD_HEADER_PILL_CLASS, className), children });
260
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: trash2.cn(useRestConversationHistory.THREAD_HEADER_PILL_CLASS, className), children });
376
261
  }
377
262
  function ChatHeaderActions({
378
263
  children,
379
264
  className
380
265
  }) {
381
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: useRestConversationHistory.cn(useRestConversationHistory.THREAD_HEADER_ACTIONS_CLASS, className), children });
266
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: trash2.cn(useRestConversationHistory.THREAD_HEADER_ACTIONS_CLASS, className), children });
382
267
  }
383
268
  const ChatHeader = {
384
269
  Root: ChatHeaderRoot,
@@ -461,7 +346,7 @@ function ConversationTypeIcon({
461
346
  }) {
462
347
  if (conversation.state === "running") {
463
348
  return /* @__PURE__ */ jsxRuntime.jsx(
464
- useRestConversationHistory.LoaderCircle,
349
+ statewireHistoryEdge.LoaderCircle,
465
350
  {
466
351
  "aria-label": "Conversation running",
467
352
  className: "mt-0.5 size-4 shrink-0 animate-spin text-primary"
@@ -472,7 +357,7 @@ function ConversationTypeIcon({
472
357
  if (thumbnail) {
473
358
  return /* @__PURE__ */ jsxRuntime.jsx("img", { src: thumbnail, alt: "", className: "mt-0.5 size-4 shrink-0" });
474
359
  }
475
- return automated ? /* @__PURE__ */ jsxRuntime.jsx(Bot, { className: "mt-0.5 size-4 shrink-0 text-primary" }) : /* @__PURE__ */ jsxRuntime.jsx(useRestConversationHistory.MessageSquare, { className: "mt-0.5 size-4 shrink-0 text-emerald-500" });
360
+ return automated ? /* @__PURE__ */ jsxRuntime.jsx(wrench.Bot, { className: "mt-0.5 size-4 shrink-0 text-primary" }) : /* @__PURE__ */ jsxRuntime.jsx(wrench.MessageSquare, { className: "mt-0.5 size-4 shrink-0 text-emerald-500" });
476
361
  }
477
362
  function ConversationHistoryPanel({
478
363
  conversations,
@@ -492,8 +377,51 @@ function ConversationHistoryPanel({
492
377
  isRefreshing = false,
493
378
  hasNextPage = false,
494
379
  isFetchingNextPage = false,
495
- onLoadMore
380
+ onLoadMore,
381
+ onHoverIntent,
382
+ onHoverIntentEnd,
383
+ hoverIntentDelayMs = 150
496
384
  }) {
385
+ const hoverTimer = React.useRef(null);
386
+ const hoverIntentThreadId = React.useRef(null);
387
+ const onHoverIntentRef = React.useRef(onHoverIntent);
388
+ onHoverIntentRef.current = onHoverIntent;
389
+ const onHoverIntentEndRef = React.useRef(onHoverIntentEnd);
390
+ onHoverIntentEndRef.current = onHoverIntentEnd;
391
+ const cancelHoverTimer = React.useCallback(() => {
392
+ if (hoverTimer.current === null) return;
393
+ clearTimeout(hoverTimer.current);
394
+ hoverTimer.current = null;
395
+ }, []);
396
+ const endHoverIntent = React.useCallback(() => {
397
+ var _a;
398
+ const threadId = hoverIntentThreadId.current;
399
+ if (threadId === null) return;
400
+ hoverIntentThreadId.current = null;
401
+ (_a = onHoverIntentEndRef.current) == null ? void 0 : _a.call(onHoverIntentEndRef, threadId);
402
+ }, []);
403
+ React.useEffect(
404
+ () => () => {
405
+ cancelHoverTimer();
406
+ endHoverIntent();
407
+ },
408
+ [cancelHoverTimer, endHoverIntent]
409
+ );
410
+ const handleRowEnter = (threadId) => {
411
+ if (!onHoverIntentRef.current) return;
412
+ cancelHoverTimer();
413
+ hoverTimer.current = setTimeout(() => {
414
+ var _a;
415
+ hoverTimer.current = null;
416
+ hoverIntentThreadId.current = threadId;
417
+ (_a = onHoverIntentRef.current) == null ? void 0 : _a.call(onHoverIntentRef, threadId);
418
+ }, hoverIntentDelayMs);
419
+ };
420
+ const handleRowLeave = (threadId) => {
421
+ cancelHoverTimer();
422
+ if (hoverIntentThreadId.current !== threadId) return;
423
+ endHoverIntent();
424
+ };
497
425
  const origins = React.useMemo(
498
426
  () => [...new Set(conversations.map(originKey))].sort(),
499
427
  [conversations]
@@ -517,6 +445,14 @@ function ConversationHistoryPanel({
517
445
  return items ? [{ group, items }] : [];
518
446
  });
519
447
  }, [activityFilter, conversations, originFilter]);
448
+ React.useEffect(() => {
449
+ const threadId = hoverIntentThreadId.current;
450
+ if (threadId === null) return;
451
+ const stillVisible = grouped.some(
452
+ ({ items }) => items.some((conversation) => conversation.threadId === threadId)
453
+ );
454
+ if (!stillVisible) endHoverIntent();
455
+ }, [grouped, endHoverIntent]);
520
456
  const visibleCount = grouped.reduce(
521
457
  (count, group) => count + group.items.length,
522
458
  0
@@ -543,7 +479,7 @@ function ConversationHistoryPanel({
543
479
  children: /* @__PURE__ */ jsxRuntime.jsx(
544
480
  useRestConversationHistory.RefreshCw,
545
481
  {
546
- className: useRestConversationHistory.cn("size-3.5", isRefreshing && "animate-spin")
482
+ className: trash2.cn("size-3.5", isRefreshing && "animate-spin")
547
483
  }
548
484
  )
549
485
  }
@@ -562,7 +498,7 @@ function ConversationHistoryPanel({
562
498
  )
563
499
  ] }),
564
500
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "relative block min-w-0 px-1 pb-2", children: [
565
- /* @__PURE__ */ jsxRuntime.jsx(useRestConversationHistory.Search, { className: "pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-[calc(50%+0.25rem)] text-muted-foreground" }),
501
+ /* @__PURE__ */ jsxRuntime.jsx(wrench.Search, { className: "pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-[calc(50%+0.25rem)] text-muted-foreground" }),
566
502
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Search sessions" }),
567
503
  /* @__PURE__ */ jsxRuntime.jsx(
568
504
  "input",
@@ -580,7 +516,7 @@ function ConversationHistoryPanel({
580
516
  {
581
517
  type: "button",
582
518
  onClick: () => onActivityFilterChange(filter),
583
- className: useRestConversationHistory.cn(
519
+ className: trash2.cn(
584
520
  "rounded-full border px-2 py-1 capitalize",
585
521
  activityFilter === filter ? "border-primary bg-primary/10 text-primary" : "border-border text-muted-foreground"
586
522
  ),
@@ -604,7 +540,7 @@ function ConversationHistoryPanel({
604
540
  ] }),
605
541
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-[min(60vh,28rem)] overflow-y-auto px-0.5", children: [
606
542
  isLoading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-2 py-4 text-xs text-muted-foreground", children: [
607
- /* @__PURE__ */ jsxRuntime.jsx(useRestConversationHistory.LoaderCircle, { className: "size-3.5 animate-spin" }),
543
+ /* @__PURE__ */ jsxRuntime.jsx(statewireHistoryEdge.LoaderCircle, { className: "size-3.5 animate-spin" }),
608
544
  " Loading sessions…"
609
545
  ] }) : visibleCount === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-4 text-xs text-muted-foreground", children: "No matching sessions." }) : grouped.map(({ group, items }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
610
546
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "px-2 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/75", children: group }),
@@ -613,10 +549,12 @@ function ConversationHistoryPanel({
613
549
  return /* @__PURE__ */ jsxRuntime.jsxs(
614
550
  "div",
615
551
  {
616
- className: useRestConversationHistory.cn(
552
+ className: trash2.cn(
617
553
  "group flex items-start gap-2 rounded-md px-2 py-2 hover:bg-accent",
618
554
  conversation.threadId === activeThreadId && "bg-primary/10 text-primary"
619
555
  ),
556
+ onMouseEnter: () => handleRowEnter(conversation.threadId),
557
+ onMouseLeave: () => handleRowLeave(conversation.threadId),
620
558
  children: [
621
559
  /* @__PURE__ */ jsxRuntime.jsxs(
622
560
  "button",
@@ -665,7 +603,7 @@ function ConversationHistoryPanel({
665
603
  title: "Archive conversation",
666
604
  onClick: () => onArchive(conversation.threadId),
667
605
  className: "invisible rounded p-1 text-muted-foreground hover:bg-background hover:text-foreground group-hover:visible focus:visible",
668
- children: /* @__PURE__ */ jsxRuntime.jsx(useRestConversationHistory.Archive, { className: "size-3.5" })
606
+ children: /* @__PURE__ */ jsxRuntime.jsx(Archive, { className: "size-3.5" })
669
607
  }
670
608
  )
671
609
  ]
@@ -690,8 +628,8 @@ function ConversationHistoryPanel({
690
628
  );
691
629
  }
692
630
  function makeMentionUrl(attrs) {
693
- if (attrs.type === "tool") {
694
- return `mention://tool?name=${encodeURIComponent(attrs.id)}&description=${encodeURIComponent(attrs.description ?? "")}`;
631
+ if (attrs.type === "tool" || attrs.type === "toolkit") {
632
+ return `mention://${attrs.type}?name=${encodeURIComponent(attrs.id)}&description=${encodeURIComponent(attrs.description ?? "")}`;
695
633
  }
696
634
  if (attrs.type === "asset") {
697
635
  const params2 = new URLSearchParams({ asset_ids: attrs.id });
@@ -892,7 +830,7 @@ const MentionSuggestionsExtension = useRestConversationHistory.Extension.create(
892
830
  }
893
831
  });
894
832
  const MentionSuggestionPopup = ({ clientRect, children }) => {
895
- const { refs, floatingStyles } = useRestConversationHistory.useFloating$1({
833
+ const { refs, floatingStyles } = useRestConversationHistory.useFloating({
896
834
  placement: "bottom-start",
897
835
  middleware: [useRestConversationHistory.offset(10), useRestConversationHistory.flip(), useRestConversationHistory.shift({ padding: 8 })],
898
836
  whileElementsMounted: useRestConversationHistory.autoUpdate
@@ -1004,11 +942,28 @@ function triggerFetchIfNeeded(store, scope, query, _targetCount, parentScope) {
1004
942
  );
1005
943
  store.setState((prev) => ({ ...prev }));
1006
944
  }).catch((error) => {
1007
- console.error(`[orchestrator] Fetch error for scope ${scopeId}:`, error);
1008
945
  const currentState = store.state;
1009
946
  const currentMeta = fetchState.meta || {};
1010
947
  const errorAttempts = (currentMeta.errorAttempts || 0) + 1;
1011
948
  const retriable = errorAttempts < MAX_ERROR_RETRIES;
949
+ if (retriable) {
950
+ useRestConversationHistory.athenaDiagnostics.emit("mentions.fetch.error", {
951
+ level: "warn",
952
+ data: {
953
+ scopeId,
954
+ attempt: errorAttempts,
955
+ retriable,
956
+ error: error instanceof Error ? error.message : String(error)
957
+ }
958
+ });
959
+ } else {
960
+ useRestConversationHistory.athenaDiagnostics.error(
961
+ "mentions.fetch.error",
962
+ error,
963
+ { code: "mentions_fetch_failed", message: `Mention suggestions failed for ${scopeId}` },
964
+ { scopeId, attempt: errorAttempts, retriable }
965
+ );
966
+ }
1012
967
  useRestConversationHistory.updateFetchState(
1013
968
  currentState.registry,
1014
969
  scopeId,
@@ -1101,53 +1056,60 @@ const MentionMenuSection = {
1101
1056
  const ICON_MAP = {
1102
1057
  // General
1103
1058
  file: useRestConversationHistory.File,
1104
- "file-text": useRestConversationHistory.FileText,
1059
+ "file-text": wrench.FileText,
1105
1060
  "file-code": FileCode,
1106
- folder: useRestConversationHistory.Folder,
1061
+ folder: wrench.Folder,
1107
1062
  "folder-kanban": useRestConversationHistory.FolderKanban,
1108
- globe: useRestConversationHistory.Globe,
1109
- search: useRestConversationHistory.Search,
1110
- star: Star,
1111
- users: useRestConversationHistory.Users,
1063
+ globe: wrench.Globe,
1064
+ search: wrench.Search,
1065
+ star: wrench.Star,
1066
+ users: wrench.Users,
1112
1067
  user: User,
1113
- wrench: useRestConversationHistory.Wrench,
1114
- package: useRestConversationHistory.Package,
1068
+ wrench: wrench.Wrench,
1069
+ package: wrench.Package,
1115
1070
  "building-2": Building2,
1116
- "hard-drive": useRestConversationHistory.HardDrive,
1071
+ "hard-drive": wrench.HardDrive,
1117
1072
  "layout-grid": useRestConversationHistory.LayoutGrid,
1118
- zap: Zap,
1073
+ zap: statewireHistoryEdge.Zap,
1119
1074
  eye: Eye,
1120
1075
  // Chrome tools
1121
- camera: useRestConversationHistory.Camera,
1076
+ camera: wrench.Camera,
1122
1077
  keyboard: Keyboard,
1123
- code: useRestConversationHistory.Code,
1124
- monitor: useRestConversationHistory.Monitor,
1078
+ code: wrench.Code,
1079
+ monitor: wrench.Monitor,
1125
1080
  // Asset types
1126
- image: useRestConversationHistory.Image,
1127
- video: Video,
1081
+ image: wrench.Image,
1082
+ video: wrench.Video,
1128
1083
  headphones: Headphones,
1129
1084
  mic: Mic,
1130
- mail: useRestConversationHistory.Mail,
1131
- calendar: useRestConversationHistory.Calendar,
1132
- phone: Phone,
1133
- database: useRestConversationHistory.Database,
1134
- table: useRestConversationHistory.Table,
1085
+ mail: wrench.Mail,
1086
+ calendar: wrench.Calendar,
1087
+ phone: wrench.Phone,
1088
+ database: wrench.Database,
1089
+ table: wrench.Table,
1135
1090
  sheet: useRestConversationHistory.Sheet,
1136
- palette: Palette,
1091
+ palette: wrench.Palette,
1137
1092
  "pen-tool": PenTool,
1138
1093
  layout: PanelsTopLeft,
1139
- "layout-dashboard": LayoutDashboard,
1094
+ "layout-dashboard": wrench.LayoutDashboard,
1140
1095
  library: Library,
1141
- "book-open": useRestConversationHistory.BookOpen,
1142
- sparkles: Sparkles,
1096
+ "book-open": wrench.BookOpen,
1097
+ sparkles: wrench.Sparkles,
1143
1098
  "check-square": SquareCheckBig,
1144
1099
  key: Key,
1145
1100
  smartphone: Smartphone,
1146
1101
  cloud: Cloud,
1147
- workflow: useRestConversationHistory.Workflow,
1148
- presentation: useRestConversationHistory.FileText
1102
+ workflow: wrench.Workflow,
1103
+ presentation: wrench.FileText
1149
1104
  // Fallback for presentation type
1150
1105
  };
1106
+ function toKebabIconName(name) {
1107
+ return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
1108
+ }
1109
+ function resolveIcon(name) {
1110
+ return ICON_MAP[name] ?? ICON_MAP[toKebabIconName(name)];
1111
+ }
1112
+ const ICON_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9-]*$/;
1151
1113
  function MentionIcon({
1152
1114
  fallbackIcon,
1153
1115
  thumbnailUrl,
@@ -1157,9 +1119,11 @@ function MentionIcon({
1157
1119
  if (thumbnailUrl) {
1158
1120
  return /* @__PURE__ */ jsxRuntime.jsx("img", { src: thumbnailUrl, alt: alt ?? "", className });
1159
1121
  }
1160
- const Icon = fallbackIcon ? ICON_MAP[fallbackIcon] : void 0;
1122
+ const Icon = fallbackIcon ? resolveIcon(fallbackIcon) : void 0;
1161
1123
  if (Icon) return /* @__PURE__ */ jsxRuntime.jsx(Icon, { className });
1162
- if (fallbackIcon) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm flex-shrink-0", children: fallbackIcon });
1124
+ if (fallbackIcon && !ICON_NAME_PATTERN.test(fallbackIcon)) {
1125
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm flex-shrink-0", children: fallbackIcon });
1126
+ }
1163
1127
  return /* @__PURE__ */ jsxRuntime.jsx(useRestConversationHistory.File, { className });
1164
1128
  }
1165
1129
  function MenuItemRow({
@@ -1169,7 +1133,7 @@ function MenuItemRow({
1169
1133
  onClick,
1170
1134
  showArrow
1171
1135
  }) {
1172
- var _a, _b;
1136
+ var _a, _b, _c, _d;
1173
1137
  const hasTwoLines = item.type === "tool" && item.description || item.type === "user" && item.email || item.type === "workspace_item" && item.description || item.type === "tab" && item.description;
1174
1138
  return /* @__PURE__ */ jsxRuntime.jsxs(
1175
1139
  "div",
@@ -1178,30 +1142,38 @@ function MenuItemRow({
1178
1142
  tabIndex: -1,
1179
1143
  onClick,
1180
1144
  onMouseEnter,
1181
- className: useRestConversationHistory.cn(
1145
+ className: trash2.cn(
1182
1146
  "mention-item flex items-center justify-between gap-2 px-2 py-1.5 rounded cursor-pointer transition-colors",
1183
1147
  "hover:bg-gray-100",
1184
1148
  item.menuSection === MentionMenuSection.CURRENT_WEBPAGE && !isSelected && "bg-sky-50/70",
1185
1149
  isSelected && "bg-gray-100 is-selected"
1186
1150
  ),
1187
1151
  children: [
1188
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `flex items-center flex-shrink-0 ${hasTwoLines ? "self-start mt-0.5" : ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(
1189
- MentionIcon,
1152
+ /* @__PURE__ */ jsxRuntime.jsx(
1153
+ "span",
1190
1154
  {
1191
- fallbackIcon: item.fallbackIcon,
1192
- thumbnailUrl: item.thumbnailUrl,
1193
- alt: item.name
1155
+ className: `flex items-center flex-shrink-0 ${hasTwoLines ? "self-start mt-0.5" : ""}`,
1156
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1157
+ MentionIcon,
1158
+ {
1159
+ fallbackIcon: item.fallbackIcon,
1160
+ thumbnailUrl: item.thumbnailUrl,
1161
+ alt: item.name
1162
+ }
1163
+ )
1194
1164
  }
1195
- ) }),
1165
+ ),
1196
1166
  hasTwoLines ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col gap-0 min-w-0 -mt-0.5", children: [
1197
1167
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm leading-tight flex items-center gap-1.5", children: [
1198
1168
  item.name,
1199
- ((_a = item.extra) == null ? void 0 : _a.isAdminOnly) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 flex-shrink-0" })
1169
+ ((_a = item.extra) == null ? void 0 : _a.isAdminOnly) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 flex-shrink-0" }),
1170
+ ((_b = item.extra) == null ? void 0 : _b.isExperimental) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-blue-50 px-1.5 py-0.5 text-[9px] font-medium text-blue-700", children: "Experimental" })
1200
1171
  ] }),
1201
1172
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-gray-500 leading-tight mt-0.5 truncate", children: item.type === "user" ? item.email : item.description })
1202
1173
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex-1 text-sm truncate min-w-0 flex items-center gap-1.5", children: [
1203
1174
  item.name,
1204
- ((_b = item.extra) == null ? void 0 : _b.isAdminOnly) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 flex-shrink-0" })
1175
+ ((_c = item.extra) == null ? void 0 : _c.isAdminOnly) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-purple-400 flex-shrink-0" }),
1176
+ ((_d = item.extra) == null ? void 0 : _d.isExperimental) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-blue-50 px-1.5 py-0.5 text-[9px] font-medium text-blue-700", children: "Experimental" })
1205
1177
  ] }),
1206
1178
  showArrow && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 flex-shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400 text-sm px-1 rounded transition-all cursor-pointer hover:text-gray-600 hover:bg-gray-200", children: "→" }) })
1207
1179
  ]
@@ -1560,17 +1532,19 @@ const MentionSuggestionList = React.forwardRef(({ store, editor, query, command,
1560
1532
  MentionSuggestionList.displayName = "MentionSuggestionList";
1561
1533
  function assetToMenuItem(asset) {
1562
1534
  const isFolder = asset.athenaOriginalType === "folder";
1535
+ const displayType = asset.athenaConvertedType || asset.athenaOriginalType;
1563
1536
  return {
1564
1537
  id: asset.id,
1565
1538
  name: asset.title || "Untitled",
1566
1539
  type: isFolder ? "folder" : "asset",
1567
- thumbnailUrl: useRestConversationHistory.assetTypeToThumb(asset.athenaOriginalType),
1568
- fallbackIcon: useRestConversationHistory.assetTypeToIcon(asset.athenaOriginalType),
1540
+ thumbnailUrl: useRestConversationHistory.assetTypeToThumb(displayType),
1541
+ fallbackIcon: useRestConversationHistory.assetTypeToIcon(displayType),
1569
1542
  navigatesToScope: isFolder ? asset.id : void 0,
1570
1543
  visibleInScopes: /* @__PURE__ */ new Set(),
1571
1544
  updatedAt: asset.updatedAt ?? void 0,
1572
1545
  extra: {
1573
1546
  athenaOriginalType: asset.athenaOriginalType,
1547
+ athenaConvertedType: asset.athenaConvertedType,
1574
1548
  parentFolderId: asset.parentFolderId
1575
1549
  }
1576
1550
  };
@@ -1591,11 +1565,7 @@ async function querySimpleSearch(auth, opts) {
1591
1565
  sort: { field: "UPDATED_AT", direction: "DESC" },
1592
1566
  filterColumns: { isArchived: false, isHidden: false }
1593
1567
  };
1594
- const data = await useRestConversationHistory.fetchGraphQL(
1595
- auth,
1596
- useRestConversationHistory.SIMPLE_SEARCH_QUERY,
1597
- { input }
1598
- );
1568
+ const data = await useRestConversationHistory.fetchGraphQL(auth, useRestConversationHistory.SIMPLE_SEARCH_QUERY, { input });
1599
1569
  const assets = ((_b = data.simpleSearch) == null ? void 0 : _b.assets) || [];
1600
1570
  return {
1601
1571
  items: assets.map(assetToMenuItem),
@@ -1605,9 +1575,19 @@ async function querySimpleSearch(auth, opts) {
1605
1575
  const CATEGORY_DEFS = {
1606
1576
  favorites: { name: "Favorites", icon: "star", scope: "favorites" },
1607
1577
  assets: { name: "Assets", icon: "file-text", scope: "athena_assets" },
1608
- projects: { name: "Projects", icon: "folder-kanban", scope: "athena_projects" },
1609
- browse_profiles: { name: "Browse Profiles", icon: "globe", scope: "athena_browse_profiles" },
1578
+ projects: {
1579
+ name: "Projects",
1580
+ icon: "folder-kanban",
1581
+ scope: "athena_projects"
1582
+ },
1583
+ browse_profiles: {
1584
+ name: "Browse Profiles",
1585
+ icon: "globe",
1586
+ scope: "athena_browse_profiles"
1587
+ },
1610
1588
  folders: { name: "Folders", icon: "folder", scope: "athena_folders" },
1589
+ tools: { name: "Tools", icon: "wrench", scope: "tools" },
1590
+ toolkits: { name: "Toolkits", icon: "package", scope: "toolkits" },
1611
1591
  team: { name: "Team", icon: "users", scope: "team" },
1612
1592
  drives: { name: "Drives", icon: "hard-drive", scope: "drive_catalogs" }
1613
1593
  };
@@ -1674,7 +1654,14 @@ const fetchAssets = async (context) => {
1674
1654
  query,
1675
1655
  limit,
1676
1656
  offset,
1677
- excludeTypes: ["folder", "catalog", "spaces", "session", "table", "task_item"]
1657
+ excludeTypes: [
1658
+ "folder",
1659
+ "catalog",
1660
+ "spaces",
1661
+ "session",
1662
+ "table",
1663
+ "task_item"
1664
+ ]
1678
1665
  });
1679
1666
  return {
1680
1667
  items: result.items,
@@ -1686,21 +1673,17 @@ const fetchFavorites = async (context) => {
1686
1673
  const limit = sourceConfig.limit ?? 50;
1687
1674
  const meta = fetchState.meta || {};
1688
1675
  const offset = meta.validatedCount || 0;
1689
- const data = await useRestConversationHistory.fetchGraphQL(
1690
- sourceConfig.auth,
1691
- useRestConversationHistory.PAGINATED_ASSETS_QUERY,
1692
- {
1693
- limit,
1694
- offset,
1695
- parentFolderId: null,
1696
- filterTypes: null,
1697
- filterColumns: {
1698
- isFavorited: true,
1699
- isArchived: false,
1700
- isHidden: false
1701
- }
1676
+ const data = await useRestConversationHistory.fetchGraphQL(sourceConfig.auth, useRestConversationHistory.PAGINATED_ASSETS_QUERY, {
1677
+ limit,
1678
+ offset,
1679
+ parentFolderId: null,
1680
+ filterTypes: null,
1681
+ filterColumns: {
1682
+ isFavorited: true,
1683
+ isArchived: false,
1684
+ isHidden: false
1702
1685
  }
1703
- );
1686
+ });
1704
1687
  const assets = data.getPaginatedAssetsForWorkspace || [];
1705
1688
  const items = assets.map(assetToMenuItem);
1706
1689
  return {
@@ -1730,21 +1713,17 @@ const fetchFolderContents = async (context) => {
1730
1713
  const meta = fetchState.meta || {};
1731
1714
  const offset = meta.validatedCount || 0;
1732
1715
  const parentFolderId = scope === "internal_drive" ? null : scope;
1733
- const data = await useRestConversationHistory.fetchGraphQL(
1734
- sourceConfig.auth,
1735
- useRestConversationHistory.PAGINATED_ASSETS_QUERY,
1736
- {
1737
- limit,
1738
- offset,
1739
- parentFolderId,
1740
- filterTypes: null,
1741
- filterColumns: {
1742
- isArchived: false,
1743
- isHidden: false,
1744
- ...query ? { title: [{ op: "LIKE", value: `%${query}%` }] } : {}
1745
- }
1716
+ const data = await useRestConversationHistory.fetchGraphQL(sourceConfig.auth, useRestConversationHistory.PAGINATED_ASSETS_QUERY, {
1717
+ limit,
1718
+ offset,
1719
+ parentFolderId,
1720
+ filterTypes: null,
1721
+ filterColumns: {
1722
+ isArchived: false,
1723
+ isHidden: false,
1724
+ ...query ? { title: [{ op: "LIKE", value: `%${query}%` }] } : {}
1746
1725
  }
1747
- );
1726
+ });
1748
1727
  const rawAssets = data.getPaginatedAssetsForWorkspace || [];
1749
1728
  const assets = rawAssets.filter(
1750
1729
  (a) => a.athenaConvertedType !== "catalog" && a.athenaOriginalType !== "catalog"
@@ -1800,6 +1779,36 @@ const fetchTeam = async (context) => {
1800
1779
  });
1801
1780
  return { items, pagination: { hasMore: false } };
1802
1781
  };
1782
+ async function queryToolCatalog(auth) {
1783
+ const data = await useRestConversationHistory.fetchGraphQL(auth, useRestConversationHistory.TOOL_CATALOG_QUERY);
1784
+ return data.getToolkitToToolsMapping;
1785
+ }
1786
+ const fetchTools = async (context) => {
1787
+ const catalog = await queryToolCatalog(context.sourceConfig.auth);
1788
+ const items = catalog.tools.filter((tool) => tool.isMentionable).map((tool) => ({
1789
+ id: tool.id,
1790
+ name: tool.name,
1791
+ type: "tool",
1792
+ fallbackIcon: tool.icon,
1793
+ description: tool.description ?? void 0,
1794
+ visibleInScopes: /* @__PURE__ */ new Set(),
1795
+ ...tool.adminOnly ? { extra: { isAdminOnly: true } } : {}
1796
+ }));
1797
+ return { items, pagination: { hasMore: false } };
1798
+ };
1799
+ const fetchToolkits = async (context) => {
1800
+ const catalog = await queryToolCatalog(context.sourceConfig.auth);
1801
+ const items = catalog.toolkits.filter((toolkit) => toolkit.isMentionable && !toolkit.hideFromMenu).map((toolkit) => ({
1802
+ id: toolkit.name,
1803
+ name: toolkit.displayName,
1804
+ type: "toolkit",
1805
+ fallbackIcon: toolkit.icon,
1806
+ description: toolkit.description || void 0,
1807
+ visibleInScopes: /* @__PURE__ */ new Set(),
1808
+ ...toolkit.onlyAdmin ? { extra: { isAdminOnly: true } } : {}
1809
+ }));
1810
+ return { items, pagination: { hasMore: false } };
1811
+ };
1803
1812
  const fetchDrives = async (context) => {
1804
1813
  const { fetchState, sourceConfig } = context;
1805
1814
  const meta = fetchState.meta || {};
@@ -1859,6 +1868,8 @@ const ROOT_MENTION_CATEGORIES = [
1859
1868
  "projects",
1860
1869
  "browse_profiles",
1861
1870
  "folders",
1871
+ "tools",
1872
+ "toolkits",
1862
1873
  "team",
1863
1874
  "drives"
1864
1875
  ];
@@ -1883,9 +1894,11 @@ function buildStore({
1883
1894
  fetchFolders,
1884
1895
  { auth, limit: 50 },
1885
1896
  true
1886
- /* isFlat */
1887
1897
  );
1888
- useRestConversationHistory.registerSource(registry, "internal_drive", fetchFolderContents, { auth, limit: 50 });
1898
+ useRestConversationHistory.registerSource(registry, "internal_drive", fetchFolderContents, {
1899
+ auth,
1900
+ limit: 50
1901
+ });
1889
1902
  useRestConversationHistory.registerSource(registry, "athena_projects", fetchTypedAssets, {
1890
1903
  auth,
1891
1904
  includeOnlyTypes: ["project"],
@@ -1896,6 +1909,8 @@ function buildStore({
1896
1909
  includeOnlyTypes: ["browse_profile"],
1897
1910
  limit: 50
1898
1911
  });
1912
+ useRestConversationHistory.registerSource(registry, "tools", fetchTools, { auth });
1913
+ useRestConversationHistory.registerSource(registry, "toolkits", fetchToolkits, { auth });
1899
1914
  useRestConversationHistory.registerSource(registry, "team", fetchTeam, { auth });
1900
1915
  useRestConversationHistory.registerSource(registry, "drive_catalogs", fetchDrives, { auth });
1901
1916
  return new useRestConversationHistory.Store({ registry, cache });
@@ -2127,7 +2142,12 @@ const TiptapComposer = React.forwardRef(({ placeholder = "Message Athena... (typ
2127
2142
  const ext = item.type.split("/")[1] || "png";
2128
2143
  const file = new File([blob], `pasted-image-${Date.now()}.${ext}`, { type: item.type });
2129
2144
  void addAttachment(file).catch((error) => {
2130
- console.error("[attach] Pasted image upload failed:", error);
2145
+ useRestConversationHistory.athenaDiagnostics.error(
2146
+ "composer.attachment.error",
2147
+ error,
2148
+ { code: "attachment_failed", message: "Pasted image upload failed" },
2149
+ { source: "paste", type: file.type }
2150
+ );
2131
2151
  });
2132
2152
  }
2133
2153
  handled = true;
@@ -2147,7 +2167,12 @@ const TiptapComposer = React.forwardRef(({ placeholder = "Message Athena... (typ
2147
2167
  if (file.type.startsWith("image/")) {
2148
2168
  event.preventDefault();
2149
2169
  void addAttachment(file).catch((error) => {
2150
- console.error("[attach] Dropped image upload failed:", error);
2170
+ useRestConversationHistory.athenaDiagnostics.error(
2171
+ "composer.attachment.error",
2172
+ error,
2173
+ { code: "attachment_failed", message: "Dropped image upload failed" },
2174
+ { source: "drop", type: file.type }
2175
+ );
2151
2176
  });
2152
2177
  handled = true;
2153
2178
  }
@@ -2320,7 +2345,7 @@ const SignInTextField = ({ label, placeholder, value, onChange, type = "text", c
2320
2345
  /* @__PURE__ */ jsxRuntime.jsx(
2321
2346
  "input",
2322
2347
  {
2323
- className: useRestConversationHistory.cn(
2348
+ className: trash2.cn(
2324
2349
  "h-9 w-full rounded-md border bg-background px-2.5 text-xs outline-none focus:ring-2 focus:ring-ring/20",
2325
2350
  className
2326
2351
  ),
@@ -2414,6 +2439,21 @@ exports.parseMentionsInText = useRestConversationHistory.parseMentionsInText;
2414
2439
  exports.resolveComposerAction = useRestConversationHistory.resolveComposerAction;
2415
2440
  exports.useMentionAuth = useRestConversationHistory.useMentionAuth;
2416
2441
  exports.useMessageActionsReadOnly = useRestConversationHistory.useMessageActionsReadOnly;
2442
+ exports.ContinuePill = statewireHistoryEdge.ContinuePill;
2443
+ exports.HISTORY_EDGE_NEAR_MARGIN_PX = statewireHistoryEdge.HISTORY_EDGE_NEAR_MARGIN_PX;
2444
+ exports.HITL_PENDING_RESUME_GRACE_MS = statewireHistoryEdge.HITL_PENDING_RESUME_GRACE_MS;
2445
+ exports.HistoryEdgeRow = statewireHistoryEdge.HistoryEdgeRow;
2446
+ exports.RuntimeMessageCard = statewireHistoryEdge.RuntimeMessageCard;
2447
+ exports.StatewireApprovalCard = statewireHistoryEdge.StatewireApprovalCard;
2448
+ exports.StatewireHistoryEdge = statewireHistoryEdge.StatewireHistoryEdge;
2449
+ exports.StatewireQueuedMessages = statewireHistoryEdge.StatewireQueuedMessages;
2450
+ exports.StatewireToolOutputsContext = statewireHistoryEdge.StatewireToolOutputsContext;
2451
+ exports.THREAD_VIEWPORT_ATTR = statewireHistoryEdge.THREAD_VIEWPORT_ATTR;
2452
+ exports.useStatewireApprovalRequest = statewireHistoryEdge.useStatewireApprovalRequest;
2453
+ exports.useStatewireToolOutputs = statewireHistoryEdge.useStatewireToolOutputs;
2454
+ exports.StatewireContinueRunAffordance = statewireContinueRun.StatewireContinueRunAffordance;
2455
+ exports.StatewireContinueRunButton = statewireContinueRun.StatewireContinueRunButton;
2456
+ exports.StatewireRunEndedFooter = statewireContinueRun.StatewireRunEndedFooter;
2417
2457
  exports.ChatHeader = ChatHeader;
2418
2458
  exports.ChatHeaderActions = ChatHeaderActions;
2419
2459
  exports.ChatHeaderIdentity = ChatHeaderIdentity;