udp-react-enterprise-component-library 26.7.0 → 26.8.0-beta.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 (532) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/UI/fluent-web-components/UdpAccordion.d.ts +2 -1
  3. package/dist/UI/fluent-web-components/UdpAccordion.d.ts.map +1 -1
  4. package/dist/UI/fluent-web-components/UdpAccordion.js.map +1 -1
  5. package/dist/UI/fluent-web-components/UdpAccordion.mjs.map +1 -1
  6. package/dist/UI/fluent-web-components/UdpAutocomplete.d.ts +2 -1
  7. package/dist/UI/fluent-web-components/UdpAutocomplete.d.ts.map +1 -1
  8. package/dist/UI/fluent-web-components/UdpAutocomplete.js.map +1 -1
  9. package/dist/UI/fluent-web-components/UdpAutocomplete.mjs.map +1 -1
  10. package/dist/UI/fluent-web-components/UdpAvatar.d.ts +2 -1
  11. package/dist/UI/fluent-web-components/UdpAvatar.d.ts.map +1 -1
  12. package/dist/UI/fluent-web-components/UdpAvatar.js.map +1 -1
  13. package/dist/UI/fluent-web-components/UdpAvatar.mjs.map +1 -1
  14. package/dist/UI/fluent-web-components/UdpBadge.d.ts +4 -1
  15. package/dist/UI/fluent-web-components/UdpBadge.d.ts.map +1 -1
  16. package/dist/UI/fluent-web-components/UdpBadge.js.map +1 -1
  17. package/dist/UI/fluent-web-components/UdpBadge.mjs.map +1 -1
  18. package/dist/UI/fluent-web-components/UdpButton.d.ts +4 -1
  19. package/dist/UI/fluent-web-components/UdpButton.d.ts.map +1 -1
  20. package/dist/UI/fluent-web-components/UdpButton.js.map +1 -1
  21. package/dist/UI/fluent-web-components/UdpButton.mjs.map +1 -1
  22. package/dist/UI/fluent-web-components/UdpCard.d.ts +2 -1
  23. package/dist/UI/fluent-web-components/UdpCard.d.ts.map +1 -1
  24. package/dist/UI/fluent-web-components/UdpCard.js.map +1 -1
  25. package/dist/UI/fluent-web-components/UdpCard.mjs.map +1 -1
  26. package/dist/UI/fluent-web-components/UdpCheckbox.d.ts +2 -1
  27. package/dist/UI/fluent-web-components/UdpCheckbox.d.ts.map +1 -1
  28. package/dist/UI/fluent-web-components/UdpCheckbox.js.map +1 -1
  29. package/dist/UI/fluent-web-components/UdpCheckbox.mjs.map +1 -1
  30. package/dist/UI/fluent-web-components/UdpChip.d.ts +2 -1
  31. package/dist/UI/fluent-web-components/UdpChip.d.ts.map +1 -1
  32. package/dist/UI/fluent-web-components/UdpChip.js.map +1 -1
  33. package/dist/UI/fluent-web-components/UdpChip.mjs.map +1 -1
  34. package/dist/UI/fluent-web-components/UdpCompoundButton.d.ts +2 -1
  35. package/dist/UI/fluent-web-components/UdpCompoundButton.d.ts.map +1 -1
  36. package/dist/UI/fluent-web-components/UdpCompoundButton.js.map +1 -1
  37. package/dist/UI/fluent-web-components/UdpCompoundButton.mjs.map +1 -1
  38. package/dist/UI/fluent-web-components/UdpContainerQuery.d.ts +2 -1
  39. package/dist/UI/fluent-web-components/UdpContainerQuery.d.ts.map +1 -1
  40. package/dist/UI/fluent-web-components/UdpContainerQuery.js.map +1 -1
  41. package/dist/UI/fluent-web-components/UdpContainerQuery.mjs.map +1 -1
  42. package/dist/UI/fluent-web-components/UdpContainerQueryGrid.d.ts +2 -1
  43. package/dist/UI/fluent-web-components/UdpContainerQueryGrid.d.ts.map +1 -1
  44. package/dist/UI/fluent-web-components/UdpContainerQueryGrid.js.map +1 -1
  45. package/dist/UI/fluent-web-components/UdpContainerQueryGrid.mjs.map +1 -1
  46. package/dist/UI/fluent-web-components/UdpCounterBadge.d.ts +2 -1
  47. package/dist/UI/fluent-web-components/UdpCounterBadge.d.ts.map +1 -1
  48. package/dist/UI/fluent-web-components/UdpCounterBadge.js.map +1 -1
  49. package/dist/UI/fluent-web-components/UdpCounterBadge.mjs.map +1 -1
  50. package/dist/UI/fluent-web-components/UdpDateInput.d.ts +2 -1
  51. package/dist/UI/fluent-web-components/UdpDateInput.d.ts.map +1 -1
  52. package/dist/UI/fluent-web-components/UdpDateInput.js.map +1 -1
  53. package/dist/UI/fluent-web-components/UdpDateInput.mjs.map +1 -1
  54. package/dist/UI/fluent-web-components/UdpDatePicker.d.ts +2 -1
  55. package/dist/UI/fluent-web-components/UdpDatePicker.d.ts.map +1 -1
  56. package/dist/UI/fluent-web-components/UdpDatePicker.js.map +1 -1
  57. package/dist/UI/fluent-web-components/UdpDatePicker.mjs.map +1 -1
  58. package/dist/UI/fluent-web-components/UdpDateTimeInput.d.ts +2 -1
  59. package/dist/UI/fluent-web-components/UdpDateTimeInput.d.ts.map +1 -1
  60. package/dist/UI/fluent-web-components/UdpDateTimeInput.js.map +1 -1
  61. package/dist/UI/fluent-web-components/UdpDateTimeInput.mjs.map +1 -1
  62. package/dist/UI/fluent-web-components/UdpDialog.d.ts +2 -1
  63. package/dist/UI/fluent-web-components/UdpDialog.d.ts.map +1 -1
  64. package/dist/UI/fluent-web-components/UdpDialog.js.map +1 -1
  65. package/dist/UI/fluent-web-components/UdpDialog.mjs.map +1 -1
  66. package/dist/UI/fluent-web-components/UdpDivider.d.ts +2 -1
  67. package/dist/UI/fluent-web-components/UdpDivider.d.ts.map +1 -1
  68. package/dist/UI/fluent-web-components/UdpDivider.js.map +1 -1
  69. package/dist/UI/fluent-web-components/UdpDivider.mjs.map +1 -1
  70. package/dist/UI/fluent-web-components/UdpDrawer.d.ts +9 -1
  71. package/dist/UI/fluent-web-components/UdpDrawer.d.ts.map +1 -1
  72. package/dist/UI/fluent-web-components/UdpDrawer.js +14 -2
  73. package/dist/UI/fluent-web-components/UdpDrawer.js.map +1 -1
  74. package/dist/UI/fluent-web-components/UdpDrawer.mjs +33 -22
  75. package/dist/UI/fluent-web-components/UdpDrawer.mjs.map +1 -1
  76. package/dist/UI/fluent-web-components/UdpDropdown.d.ts +2 -1
  77. package/dist/UI/fluent-web-components/UdpDropdown.d.ts.map +1 -1
  78. package/dist/UI/fluent-web-components/UdpDropdown.js.map +1 -1
  79. package/dist/UI/fluent-web-components/UdpDropdown.mjs.map +1 -1
  80. package/dist/UI/fluent-web-components/UdpDurationInput.d.ts +2 -1
  81. package/dist/UI/fluent-web-components/UdpDurationInput.d.ts.map +1 -1
  82. package/dist/UI/fluent-web-components/UdpDurationInput.js.map +1 -1
  83. package/dist/UI/fluent-web-components/UdpDurationInput.mjs.map +1 -1
  84. package/dist/UI/fluent-web-components/UdpEmptyState.d.ts +2 -1
  85. package/dist/UI/fluent-web-components/UdpEmptyState.d.ts.map +1 -1
  86. package/dist/UI/fluent-web-components/UdpEmptyState.js.map +1 -1
  87. package/dist/UI/fluent-web-components/UdpEmptyState.mjs.map +1 -1
  88. package/dist/UI/fluent-web-components/UdpFileInput.d.ts +2 -1
  89. package/dist/UI/fluent-web-components/UdpFileInput.d.ts.map +1 -1
  90. package/dist/UI/fluent-web-components/UdpFileInput.js.map +1 -1
  91. package/dist/UI/fluent-web-components/UdpFileInput.mjs.map +1 -1
  92. package/dist/UI/fluent-web-components/UdpFlexbox.d.ts +2 -1
  93. package/dist/UI/fluent-web-components/UdpFlexbox.d.ts.map +1 -1
  94. package/dist/UI/fluent-web-components/UdpFlexbox.js.map +1 -1
  95. package/dist/UI/fluent-web-components/UdpFlexbox.mjs.map +1 -1
  96. package/dist/UI/fluent-web-components/UdpIcon.d.ts +2 -1
  97. package/dist/UI/fluent-web-components/UdpIcon.d.ts.map +1 -1
  98. package/dist/UI/fluent-web-components/UdpIcon.js.map +1 -1
  99. package/dist/UI/fluent-web-components/UdpIcon.mjs.map +1 -1
  100. package/dist/UI/fluent-web-components/UdpIconButton.d.ts +4 -1
  101. package/dist/UI/fluent-web-components/UdpIconButton.d.ts.map +1 -1
  102. package/dist/UI/fluent-web-components/UdpIconButton.js.map +1 -1
  103. package/dist/UI/fluent-web-components/UdpIconButton.mjs.map +1 -1
  104. package/dist/UI/fluent-web-components/UdpIconGrid.d.ts +2 -1
  105. package/dist/UI/fluent-web-components/UdpIconGrid.d.ts.map +1 -1
  106. package/dist/UI/fluent-web-components/UdpIconGrid.js.map +1 -1
  107. package/dist/UI/fluent-web-components/UdpIconGrid.mjs.map +1 -1
  108. package/dist/UI/fluent-web-components/UdpImage.d.ts +2 -1
  109. package/dist/UI/fluent-web-components/UdpImage.d.ts.map +1 -1
  110. package/dist/UI/fluent-web-components/UdpImage.js.map +1 -1
  111. package/dist/UI/fluent-web-components/UdpImage.mjs.map +1 -1
  112. package/dist/UI/fluent-web-components/UdpInlineEdit.d.ts +17 -0
  113. package/dist/UI/fluent-web-components/UdpInlineEdit.d.ts.map +1 -1
  114. package/dist/UI/fluent-web-components/UdpInlineEdit.js +17 -0
  115. package/dist/UI/fluent-web-components/UdpInlineEdit.js.map +1 -1
  116. package/dist/UI/fluent-web-components/UdpInlineEdit.mjs +30 -0
  117. package/dist/UI/fluent-web-components/UdpInlineEdit.mjs.map +1 -0
  118. package/dist/UI/fluent-web-components/UdpLink.d.ts +2 -1
  119. package/dist/UI/fluent-web-components/UdpLink.d.ts.map +1 -1
  120. package/dist/UI/fluent-web-components/UdpLink.js.map +1 -1
  121. package/dist/UI/fluent-web-components/UdpLink.mjs.map +1 -1
  122. package/dist/UI/fluent-web-components/UdpList.d.ts +2 -1
  123. package/dist/UI/fluent-web-components/UdpList.d.ts.map +1 -1
  124. package/dist/UI/fluent-web-components/UdpList.js.map +1 -1
  125. package/dist/UI/fluent-web-components/UdpList.mjs.map +1 -1
  126. package/dist/UI/fluent-web-components/UdpListItem.d.ts +2 -1
  127. package/dist/UI/fluent-web-components/UdpListItem.d.ts.map +1 -1
  128. package/dist/UI/fluent-web-components/UdpListItem.js.map +1 -1
  129. package/dist/UI/fluent-web-components/UdpListItem.mjs.map +1 -1
  130. package/dist/UI/fluent-web-components/UdpLocationInput.d.ts +2 -1
  131. package/dist/UI/fluent-web-components/UdpLocationInput.d.ts.map +1 -1
  132. package/dist/UI/fluent-web-components/UdpLocationInput.js.map +1 -1
  133. package/dist/UI/fluent-web-components/UdpLocationInput.mjs.map +1 -1
  134. package/dist/UI/fluent-web-components/UdpMenu.d.ts +2 -1
  135. package/dist/UI/fluent-web-components/UdpMenu.d.ts.map +1 -1
  136. package/dist/UI/fluent-web-components/UdpMenu.js.map +1 -1
  137. package/dist/UI/fluent-web-components/UdpMenu.mjs.map +1 -1
  138. package/dist/UI/fluent-web-components/UdpMessageBar.d.ts +2 -1
  139. package/dist/UI/fluent-web-components/UdpMessageBar.d.ts.map +1 -1
  140. package/dist/UI/fluent-web-components/UdpMessageBar.js.map +1 -1
  141. package/dist/UI/fluent-web-components/UdpMessageBar.mjs.map +1 -1
  142. package/dist/UI/fluent-web-components/UdpNumberInput.d.ts +2 -1
  143. package/dist/UI/fluent-web-components/UdpNumberInput.d.ts.map +1 -1
  144. package/dist/UI/fluent-web-components/UdpNumberInput.js.map +1 -1
  145. package/dist/UI/fluent-web-components/UdpNumberInput.mjs.map +1 -1
  146. package/dist/UI/fluent-web-components/UdpPopover.d.ts +2 -1
  147. package/dist/UI/fluent-web-components/UdpPopover.d.ts.map +1 -1
  148. package/dist/UI/fluent-web-components/UdpPopover.js.map +1 -1
  149. package/dist/UI/fluent-web-components/UdpPopover.mjs.map +1 -1
  150. package/dist/UI/fluent-web-components/UdpPrimaryActionHeader.d.ts +2 -1
  151. package/dist/UI/fluent-web-components/UdpPrimaryActionHeader.d.ts.map +1 -1
  152. package/dist/UI/fluent-web-components/UdpPrimaryActionHeader.js.map +1 -1
  153. package/dist/UI/fluent-web-components/UdpPrimaryActionHeader.mjs.map +1 -1
  154. package/dist/UI/fluent-web-components/UdpProgressBar.d.ts +2 -1
  155. package/dist/UI/fluent-web-components/UdpProgressBar.d.ts.map +1 -1
  156. package/dist/UI/fluent-web-components/UdpProgressBar.js.map +1 -1
  157. package/dist/UI/fluent-web-components/UdpProgressBar.mjs.map +1 -1
  158. package/dist/UI/fluent-web-components/UdpRadioGroup.d.ts +2 -1
  159. package/dist/UI/fluent-web-components/UdpRadioGroup.d.ts.map +1 -1
  160. package/dist/UI/fluent-web-components/UdpRadioGroup.js.map +1 -1
  161. package/dist/UI/fluent-web-components/UdpRadioGroup.mjs.map +1 -1
  162. package/dist/UI/fluent-web-components/UdpSearchInput.d.ts +2 -1
  163. package/dist/UI/fluent-web-components/UdpSearchInput.d.ts.map +1 -1
  164. package/dist/UI/fluent-web-components/UdpSearchInput.js.map +1 -1
  165. package/dist/UI/fluent-web-components/UdpSearchInput.mjs.map +1 -1
  166. package/dist/UI/fluent-web-components/UdpSidebarLayout.d.ts +9 -0
  167. package/dist/UI/fluent-web-components/UdpSidebarLayout.d.ts.map +1 -0
  168. package/dist/UI/fluent-web-components/UdpSidebarLayout.js +6 -0
  169. package/dist/UI/fluent-web-components/UdpSidebarLayout.js.map +1 -0
  170. package/dist/UI/fluent-web-components/UdpSidebarLayout.mjs +18 -0
  171. package/dist/UI/fluent-web-components/UdpSidebarLayout.mjs.map +1 -0
  172. package/dist/UI/fluent-web-components/UdpSignatureInput.d.ts +2 -1
  173. package/dist/UI/fluent-web-components/UdpSignatureInput.d.ts.map +1 -1
  174. package/dist/UI/fluent-web-components/UdpSignatureInput.js.map +1 -1
  175. package/dist/UI/fluent-web-components/UdpSignatureInput.mjs.map +1 -1
  176. package/dist/UI/fluent-web-components/UdpSkeletonLoading.d.ts +8 -0
  177. package/dist/UI/fluent-web-components/UdpSkeletonLoading.d.ts.map +1 -0
  178. package/dist/UI/fluent-web-components/UdpSkeletonLoading.js +6 -0
  179. package/dist/UI/fluent-web-components/UdpSkeletonLoading.js.map +1 -0
  180. package/dist/UI/fluent-web-components/UdpSkeletonLoading.mjs +18 -0
  181. package/dist/UI/fluent-web-components/UdpSkeletonLoading.mjs.map +1 -0
  182. package/dist/UI/fluent-web-components/UdpSlider.d.ts +2 -1
  183. package/dist/UI/fluent-web-components/UdpSlider.d.ts.map +1 -1
  184. package/dist/UI/fluent-web-components/UdpSlider.js.map +1 -1
  185. package/dist/UI/fluent-web-components/UdpSlider.mjs.map +1 -1
  186. package/dist/UI/fluent-web-components/UdpSpinner.d.ts +2 -1
  187. package/dist/UI/fluent-web-components/UdpSpinner.d.ts.map +1 -1
  188. package/dist/UI/fluent-web-components/UdpSpinner.js.map +1 -1
  189. package/dist/UI/fluent-web-components/UdpSpinner.mjs.map +1 -1
  190. package/dist/UI/fluent-web-components/UdpSwatchPicker.d.ts +2 -1
  191. package/dist/UI/fluent-web-components/UdpSwatchPicker.d.ts.map +1 -1
  192. package/dist/UI/fluent-web-components/UdpSwatchPicker.js.map +1 -1
  193. package/dist/UI/fluent-web-components/UdpSwatchPicker.mjs.map +1 -1
  194. package/dist/UI/fluent-web-components/UdpSwitch.d.ts +2 -1
  195. package/dist/UI/fluent-web-components/UdpSwitch.d.ts.map +1 -1
  196. package/dist/UI/fluent-web-components/UdpSwitch.js.map +1 -1
  197. package/dist/UI/fluent-web-components/UdpSwitch.mjs.map +1 -1
  198. package/dist/UI/fluent-web-components/UdpTablist.d.ts +2 -1
  199. package/dist/UI/fluent-web-components/UdpTablist.d.ts.map +1 -1
  200. package/dist/UI/fluent-web-components/UdpTablist.js.map +1 -1
  201. package/dist/UI/fluent-web-components/UdpTablist.mjs.map +1 -1
  202. package/dist/UI/fluent-web-components/UdpText.d.ts +2 -1
  203. package/dist/UI/fluent-web-components/UdpText.d.ts.map +1 -1
  204. package/dist/UI/fluent-web-components/UdpText.js.map +1 -1
  205. package/dist/UI/fluent-web-components/UdpText.mjs.map +1 -1
  206. package/dist/UI/fluent-web-components/UdpTextInput.d.ts +2 -1
  207. package/dist/UI/fluent-web-components/UdpTextInput.d.ts.map +1 -1
  208. package/dist/UI/fluent-web-components/UdpTextInput.js.map +1 -1
  209. package/dist/UI/fluent-web-components/UdpTextInput.mjs.map +1 -1
  210. package/dist/UI/fluent-web-components/UdpTextarea.d.ts +4 -1
  211. package/dist/UI/fluent-web-components/UdpTextarea.d.ts.map +1 -1
  212. package/dist/UI/fluent-web-components/UdpTextarea.js.map +1 -1
  213. package/dist/UI/fluent-web-components/UdpTextarea.mjs.map +1 -1
  214. package/dist/UI/fluent-web-components/UdpTimeInput.d.ts +2 -1
  215. package/dist/UI/fluent-web-components/UdpTimeInput.d.ts.map +1 -1
  216. package/dist/UI/fluent-web-components/UdpTimeInput.js.map +1 -1
  217. package/dist/UI/fluent-web-components/UdpTimeInput.mjs.map +1 -1
  218. package/dist/UI/fluent-web-components/UdpToggleButton.d.ts +2 -1
  219. package/dist/UI/fluent-web-components/UdpToggleButton.d.ts.map +1 -1
  220. package/dist/UI/fluent-web-components/UdpToggleButton.js.map +1 -1
  221. package/dist/UI/fluent-web-components/UdpToggleButton.mjs.map +1 -1
  222. package/dist/UI/fluent-web-components/UdpTooltip.d.ts +2 -1
  223. package/dist/UI/fluent-web-components/UdpTooltip.d.ts.map +1 -1
  224. package/dist/UI/fluent-web-components/UdpTooltip.js.map +1 -1
  225. package/dist/UI/fluent-web-components/UdpTooltip.mjs.map +1 -1
  226. package/dist/UI/fluent-web-components/UdpVerticalSpacer.d.ts +2 -1
  227. package/dist/UI/fluent-web-components/UdpVerticalSpacer.d.ts.map +1 -1
  228. package/dist/UI/fluent-web-components/UdpVerticalSpacer.js.map +1 -1
  229. package/dist/UI/fluent-web-components/UdpVerticalSpacer.mjs.map +1 -1
  230. package/dist/UI/fluent-web-components/index.d.ts +4 -0
  231. package/dist/UI/fluent-web-components/index.d.ts.map +1 -1
  232. package/dist/UI/fluent-web-components/index.js +4 -0
  233. package/dist/UI/fluent-web-components/index.js.map +1 -1
  234. package/dist/UI/fluent-web-components/types.d.ts +26 -0
  235. package/dist/UI/fluent-web-components/types.d.ts.map +1 -0
  236. package/dist/UI/fluent-web-components/types.js +2 -0
  237. package/dist/UI/fluent-web-components/types.js.map +1 -0
  238. package/dist/UI/utilityDisplay/utilities/aggregateUtils.d.ts +8 -0
  239. package/dist/UI/utilityDisplay/utilities/aggregateUtils.d.ts.map +1 -1
  240. package/dist/UI/utilityDisplay/utilities/aggregateUtils.js +22 -0
  241. package/dist/UI/utilityDisplay/utilities/aggregateUtils.js.map +1 -1
  242. package/dist/UI/utilityDisplay/utilities/aggregateUtils.mjs.map +1 -1
  243. package/dist/actions/ActionSplitScreen.d.ts.map +1 -1
  244. package/dist/actions/ActionSplitScreen.js +2 -2
  245. package/dist/actions/ActionSplitScreen.js.map +1 -1
  246. package/dist/actions/ActionSplitScreen.mjs +155 -149
  247. package/dist/actions/ActionSplitScreen.mjs.map +1 -1
  248. package/dist/aiAssistant/AiMessageText.d.ts +5 -0
  249. package/dist/aiAssistant/AiMessageText.d.ts.map +1 -0
  250. package/dist/aiAssistant/AiMessageText.js +33 -0
  251. package/dist/aiAssistant/AiMessageText.js.map +1 -0
  252. package/dist/aiAssistant/AiMessageText.mjs +59 -0
  253. package/dist/aiAssistant/AiMessageText.mjs.map +1 -0
  254. package/dist/aiAssistant/AiMessageText.module.css +35 -0
  255. package/dist/aiAssistant/AiProposalCard.d.ts +18 -0
  256. package/dist/aiAssistant/AiProposalCard.d.ts.map +1 -0
  257. package/dist/aiAssistant/AiProposalCard.js +14 -0
  258. package/dist/aiAssistant/AiProposalCard.js.map +1 -0
  259. package/dist/aiAssistant/AiProposalCard.mjs +116 -0
  260. package/dist/aiAssistant/AiProposalCard.mjs.map +1 -0
  261. package/dist/aiAssistant/AiProposalCard.module.css +49 -0
  262. package/dist/aiAssistant/AssistantChat.d.ts +72 -0
  263. package/dist/aiAssistant/AssistantChat.d.ts.map +1 -0
  264. package/dist/aiAssistant/AssistantChat.js +195 -0
  265. package/dist/aiAssistant/AssistantChat.js.map +1 -0
  266. package/dist/aiAssistant/AssistantChat.mjs +514 -0
  267. package/dist/aiAssistant/AssistantChat.mjs.map +1 -0
  268. package/dist/aiAssistant/AssistantChat.module.css +120 -0
  269. package/dist/aiAssistant/UdpAiAssistant.d.ts +21 -0
  270. package/dist/aiAssistant/UdpAiAssistant.d.ts.map +1 -0
  271. package/dist/aiAssistant/UdpAiAssistant.js +49 -0
  272. package/dist/aiAssistant/UdpAiAssistant.js.map +1 -0
  273. package/dist/aiAssistant/UdpAiAssistant.mjs +108 -0
  274. package/dist/aiAssistant/UdpAiAssistant.mjs.map +1 -0
  275. package/dist/aiAssistant/UdpAiAssistant.module.css +8 -0
  276. package/dist/aiAssistant/askClarification.d.ts +5 -0
  277. package/dist/aiAssistant/askClarification.d.ts.map +1 -0
  278. package/dist/aiAssistant/askClarification.js +21 -0
  279. package/dist/aiAssistant/askClarification.js.map +1 -0
  280. package/dist/aiAssistant/askClarification.mjs +23 -0
  281. package/dist/aiAssistant/askClarification.mjs.map +1 -0
  282. package/dist/aiAssistant/conversation.d.ts +74 -0
  283. package/dist/aiAssistant/conversation.d.ts.map +1 -0
  284. package/dist/aiAssistant/conversation.js +75 -0
  285. package/dist/aiAssistant/conversation.js.map +1 -0
  286. package/dist/aiAssistant/conversation.mjs +72 -0
  287. package/dist/aiAssistant/conversation.mjs.map +1 -0
  288. package/dist/aiAssistant/conversationState.d.ts +74 -0
  289. package/dist/aiAssistant/conversationState.d.ts.map +1 -0
  290. package/dist/aiAssistant/conversationState.js +136 -0
  291. package/dist/aiAssistant/conversationState.js.map +1 -0
  292. package/dist/aiAssistant/conversationState.mjs +147 -0
  293. package/dist/aiAssistant/conversationState.mjs.map +1 -0
  294. package/dist/aiAssistant/engine.d.ts +62 -0
  295. package/dist/aiAssistant/engine.d.ts.map +1 -0
  296. package/dist/aiAssistant/engine.js +269 -0
  297. package/dist/aiAssistant/engine.js.map +1 -0
  298. package/dist/aiAssistant/engine.mjs +290 -0
  299. package/dist/aiAssistant/engine.mjs.map +1 -0
  300. package/dist/aiAssistant/index.d.ts +13 -0
  301. package/dist/aiAssistant/index.d.ts.map +1 -0
  302. package/dist/aiAssistant/index.js +13 -0
  303. package/dist/aiAssistant/index.js.map +1 -0
  304. package/dist/aiAssistant/openai.d.ts +90 -0
  305. package/dist/aiAssistant/openai.d.ts.map +1 -0
  306. package/dist/aiAssistant/openai.js +181 -0
  307. package/dist/aiAssistant/openai.js.map +1 -0
  308. package/dist/aiAssistant/openai.mjs +167 -0
  309. package/dist/aiAssistant/openai.mjs.map +1 -0
  310. package/dist/aiAssistant/provider/UdpAiProvider.d.ts +43 -0
  311. package/dist/aiAssistant/provider/UdpAiProvider.d.ts.map +1 -0
  312. package/dist/aiAssistant/provider/UdpAiProvider.js +65 -0
  313. package/dist/aiAssistant/provider/UdpAiProvider.js.map +1 -0
  314. package/dist/aiAssistant/provider/UdpAiProvider.mjs +66 -0
  315. package/dist/aiAssistant/provider/UdpAiProvider.mjs.map +1 -0
  316. package/dist/aiAssistant/provider/index.d.ts +3 -0
  317. package/dist/aiAssistant/provider/index.d.ts.map +1 -0
  318. package/dist/aiAssistant/provider/index.js +3 -0
  319. package/dist/aiAssistant/provider/index.js.map +1 -0
  320. package/dist/aiAssistant/types.d.ts +157 -0
  321. package/dist/aiAssistant/types.d.ts.map +1 -0
  322. package/dist/aiAssistant/types.js +2 -0
  323. package/dist/aiAssistant/types.js.map +1 -0
  324. package/dist/aiAssistant/useAiAssistant.d.ts +20 -0
  325. package/dist/aiAssistant/useAiAssistant.d.ts.map +1 -0
  326. package/dist/aiAssistant/useAiAssistant.js +26 -0
  327. package/dist/aiAssistant/useAiAssistant.js.map +1 -0
  328. package/dist/aiAssistant/useAiAssistant.mjs +98 -0
  329. package/dist/aiAssistant/useAiAssistant.mjs.map +1 -0
  330. package/dist/aiAssistant/useConversation.d.ts +17 -0
  331. package/dist/aiAssistant/useConversation.d.ts.map +1 -0
  332. package/dist/aiAssistant/useConversation.js +29 -0
  333. package/dist/aiAssistant/useConversation.js.map +1 -0
  334. package/dist/aiAssistant/useConversation.mjs +52 -0
  335. package/dist/aiAssistant/useConversation.mjs.map +1 -0
  336. package/dist/chatBot/ChatContainer.d.ts +4 -0
  337. package/dist/chatBot/ChatContainer.d.ts.map +1 -1
  338. package/dist/chatBot/ChatContainer.js +8 -0
  339. package/dist/chatBot/ChatContainer.js.map +1 -1
  340. package/dist/chatBot/ChatContainer.mjs +7 -0
  341. package/dist/chatBot/ChatContainer.mjs.map +1 -1
  342. package/dist/chatBot/ChatMessage.d.ts +4 -0
  343. package/dist/chatBot/ChatMessage.d.ts.map +1 -1
  344. package/dist/chatBot/ChatMessage.js +8 -0
  345. package/dist/chatBot/ChatMessage.js.map +1 -1
  346. package/dist/chatBot/ChatMessage.mjs +60 -47
  347. package/dist/chatBot/ChatMessage.mjs.map +1 -1
  348. package/dist/componentSystems/pageRenderer/hooks/useReadMetaData.d.ts +1 -1
  349. package/dist/domain/entityForm/entityFormModel.d.ts +41 -0
  350. package/dist/domain/entityForm/entityFormModel.d.ts.map +1 -0
  351. package/dist/domain/entityForm/entityFormModel.js +31 -0
  352. package/dist/domain/entityForm/entityFormModel.js.map +1 -0
  353. package/dist/domain/entityForm/entityFormModel.mjs +34 -0
  354. package/dist/domain/entityForm/entityFormModel.mjs.map +1 -0
  355. package/dist/hooks/crudActions.d.ts.map +1 -1
  356. package/dist/hooks/crudActions.js +2 -6
  357. package/dist/hooks/crudActions.js.map +1 -1
  358. package/dist/hooks/crudActions.mjs +2 -8
  359. package/dist/hooks/crudActions.mjs.map +1 -1
  360. package/dist/hooks/crudForeignKeyData.d.ts.map +1 -1
  361. package/dist/hooks/crudForeignKeyData.js +2 -7
  362. package/dist/hooks/crudForeignKeyData.js.map +1 -1
  363. package/dist/hooks/crudForeignKeyData.mjs +4 -9
  364. package/dist/hooks/crudForeignKeyData.mjs.map +1 -1
  365. package/dist/hooks/usePromotedLookupMethods.d.ts.map +1 -1
  366. package/dist/hooks/usePromotedLookupMethods.js +4 -1
  367. package/dist/hooks/usePromotedLookupMethods.js.map +1 -1
  368. package/dist/hooks/usePromotedLookupMethods.mjs +3 -1
  369. package/dist/hooks/usePromotedLookupMethods.mjs.map +1 -1
  370. package/dist/hooks/usePromotedMethodEntities.d.ts.map +1 -1
  371. package/dist/hooks/usePromotedMethodEntities.js +5 -1
  372. package/dist/hooks/usePromotedMethodEntities.js.map +1 -1
  373. package/dist/hooks/usePromotedMethodEntities.mjs +3 -1
  374. package/dist/hooks/usePromotedMethodEntities.mjs.map +1 -1
  375. package/dist/hooks/usePromotedMethodEntity.js +1 -1
  376. package/dist/hooks/usePromotedMethodEntity.js.map +1 -1
  377. package/dist/hooks/usePromotedMethodEntity.mjs +1 -1
  378. package/dist/hooks/usePromotedMethodEntity.mjs.map +1 -1
  379. package/dist/index.d.ts +2 -0
  380. package/dist/index.d.ts.map +1 -1
  381. package/dist/index.js +2 -0
  382. package/dist/index.js.map +1 -1
  383. package/dist/index.mjs +23 -3
  384. package/dist/maintenanceEngine/crudBrowser/CrudTableSidePanel.d.ts.map +1 -1
  385. package/dist/maintenanceEngine/crudBrowser/CrudTableSidePanel.js +2 -9
  386. package/dist/maintenanceEngine/crudBrowser/CrudTableSidePanel.js.map +1 -1
  387. package/dist/maintenanceEngine/crudBrowser/CrudTableSidePanel.mjs +69 -90
  388. package/dist/maintenanceEngine/crudBrowser/CrudTableSidePanel.mjs.map +1 -1
  389. package/dist/maintenanceEngine/entityFormInputs.d.ts +39 -0
  390. package/dist/maintenanceEngine/entityFormInputs.d.ts.map +1 -0
  391. package/dist/maintenanceEngine/entityFormInputs.js +174 -0
  392. package/dist/maintenanceEngine/entityFormInputs.js.map +1 -0
  393. package/dist/maintenanceEngine/entityFormInputs.mjs +133 -0
  394. package/dist/maintenanceEngine/entityFormInputs.mjs.map +1 -0
  395. package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts +1 -1
  396. package/dist/maintenanceEngine/tableBrowser/TableColumnDefs.d.ts.map +1 -1
  397. package/dist/maintenanceEngine/virtualBrowser/VirtualBrowser.js +2 -2
  398. package/dist/maintenanceEngine/virtualBrowser/VirtualBrowser.js.map +1 -1
  399. package/dist/maintenanceEngine/virtualBrowser/VirtualBrowser.mjs +2 -2
  400. package/dist/maintenanceEngine/virtualBrowser/VirtualBrowser.mjs.map +1 -1
  401. package/dist/notes/NotesScreen.d.ts.map +1 -1
  402. package/dist/notes/NotesScreen.js +8 -2
  403. package/dist/notes/NotesScreen.js.map +1 -1
  404. package/dist/notes/NotesScreen.mjs +5 -1
  405. package/dist/notes/NotesScreen.mjs.map +1 -1
  406. package/dist/providers/UdpAiAppSurface.d.ts +19 -0
  407. package/dist/providers/UdpAiAppSurface.d.ts.map +1 -0
  408. package/dist/providers/UdpAiAppSurface.js +39 -0
  409. package/dist/providers/UdpAiAppSurface.js.map +1 -0
  410. package/dist/providers/UdpAiAppSurface.mjs +56 -0
  411. package/dist/providers/UdpAiAppSurface.mjs.map +1 -0
  412. package/dist/providers/UdpAppProvider.d.ts +20 -0
  413. package/dist/providers/UdpAppProvider.d.ts.map +1 -1
  414. package/dist/providers/UdpAppProvider.js +6 -2
  415. package/dist/providers/UdpAppProvider.js.map +1 -1
  416. package/dist/providers/UdpAppProvider.mjs +30 -21
  417. package/dist/providers/UdpAppProvider.mjs.map +1 -1
  418. package/dist/reminders/RemindersScreen.d.ts.map +1 -1
  419. package/dist/reminders/RemindersScreen.js +8 -2
  420. package/dist/reminders/RemindersScreen.js.map +1 -1
  421. package/dist/reminders/RemindersScreen.mjs +5 -1
  422. package/dist/reminders/RemindersScreen.mjs.map +1 -1
  423. package/dist/routes/UdpRoutes.d.ts.map +1 -1
  424. package/dist/routes/UdpRoutes.js.map +1 -1
  425. package/dist/routes/UdpRoutes.mjs.map +1 -1
  426. package/dist/searchIntent/compile.d.ts +9 -0
  427. package/dist/searchIntent/compile.d.ts.map +1 -0
  428. package/dist/searchIntent/compile.js +127 -0
  429. package/dist/searchIntent/compile.js.map +1 -0
  430. package/dist/searchIntent/compile.mjs +120 -0
  431. package/dist/searchIntent/compile.mjs.map +1 -0
  432. package/dist/searchIntent/diff.d.ts +10 -0
  433. package/dist/searchIntent/diff.d.ts.map +1 -0
  434. package/dist/searchIntent/diff.js +90 -0
  435. package/dist/searchIntent/diff.js.map +1 -0
  436. package/dist/searchIntent/diff.mjs +88 -0
  437. package/dist/searchIntent/diff.mjs.map +1 -0
  438. package/dist/searchIntent/index.d.ts +13 -0
  439. package/dist/searchIntent/index.d.ts.map +1 -0
  440. package/dist/searchIntent/index.js +13 -0
  441. package/dist/searchIntent/index.js.map +1 -0
  442. package/dist/searchIntent/operators.d.ts +28 -0
  443. package/dist/searchIntent/operators.d.ts.map +1 -0
  444. package/dist/searchIntent/operators.js +184 -0
  445. package/dist/searchIntent/operators.js.map +1 -0
  446. package/dist/searchIntent/operators.mjs +164 -0
  447. package/dist/searchIntent/operators.mjs.map +1 -0
  448. package/dist/searchIntent/prompt.d.ts +36 -0
  449. package/dist/searchIntent/prompt.d.ts.map +1 -0
  450. package/dist/searchIntent/prompt.js +152 -0
  451. package/dist/searchIntent/prompt.js.map +1 -0
  452. package/dist/searchIntent/prompt.mjs +116 -0
  453. package/dist/searchIntent/prompt.mjs.map +1 -0
  454. package/dist/searchIntent/tools.d.ts +19 -0
  455. package/dist/searchIntent/tools.d.ts.map +1 -0
  456. package/dist/searchIntent/tools.js +189 -0
  457. package/dist/searchIntent/tools.js.map +1 -0
  458. package/dist/searchIntent/tools.mjs +209 -0
  459. package/dist/searchIntent/tools.mjs.map +1 -0
  460. package/dist/searchIntent/types.d.ts +95 -0
  461. package/dist/searchIntent/types.d.ts.map +1 -0
  462. package/dist/searchIntent/types.js +2 -0
  463. package/dist/searchIntent/types.js.map +1 -0
  464. package/dist/searchIntent/validate.d.ts +19 -0
  465. package/dist/searchIntent/validate.d.ts.map +1 -0
  466. package/dist/searchIntent/validate.js +136 -0
  467. package/dist/searchIntent/validate.js.map +1 -0
  468. package/dist/searchIntent/validate.mjs +103 -0
  469. package/dist/searchIntent/validate.mjs.map +1 -0
  470. package/dist/stores/inquiryStore.d.ts +2 -2
  471. package/dist/stores/inquiryStore.d.ts.map +1 -1
  472. package/dist/stores/inquiryStore.mjs.map +1 -1
  473. package/dist/udp/export/MyExportsPage.js +1 -1
  474. package/dist/udp/export/MyExportsPage.js.map +1 -1
  475. package/dist/udp/export/MyExportsPage.mjs +1 -1
  476. package/dist/udp/export/MyExportsPage.mjs.map +1 -1
  477. package/dist/udp/pages/UdpDataBrowserPage/UdpDataBrowserPage.js +4 -4
  478. package/dist/udp/pages/UdpDataBrowserPage/UdpDataBrowserPage.js.map +1 -1
  479. package/dist/udp/pages/UdpDataBrowserPage/UdpDataBrowserPage.mjs +4 -4
  480. package/dist/udp/pages/UdpDataBrowserPage/UdpDataBrowserPage.mjs.map +1 -1
  481. package/dist/udp/pages/UdpMaintenanceConfigPage/UdpMaintenanceConfigPage.js +1 -1
  482. package/dist/udp/pages/UdpMaintenanceConfigPage/UdpMaintenanceConfigPage.js.map +1 -1
  483. package/dist/udp/pages/UdpMaintenanceConfigPage/UdpMaintenanceConfigPage.mjs +1 -1
  484. package/dist/udp/pages/UdpMaintenanceConfigPage/UdpMaintenanceConfigPage.mjs.map +1 -1
  485. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.d.ts.map +1 -1
  486. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js +38 -206
  487. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.js.map +1 -1
  488. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs +63 -172
  489. package/dist/udp/pages/UdpMaintenanceEnginePage/UdpMaintenanceEnginePage.mjs.map +1 -1
  490. package/dist/udp/tags/useTags.d.ts +13 -1
  491. package/dist/udp/tags/useTags.d.ts.map +1 -1
  492. package/dist/udp/tags/useTags.js +16 -6
  493. package/dist/udp/tags/useTags.js.map +1 -1
  494. package/dist/udp/tags/useTags.mjs +41 -35
  495. package/dist/udp/tags/useTags.mjs.map +1 -1
  496. package/dist/udp/utilities/useDateStringColumnDef.d.ts +1 -1
  497. package/dist/utilities/configRequestDedupe.d.ts +31 -0
  498. package/dist/utilities/configRequestDedupe.d.ts.map +1 -0
  499. package/dist/utilities/configRequestDedupe.js +106 -0
  500. package/dist/utilities/configRequestDedupe.js.map +1 -0
  501. package/dist/utilities/configRequestDedupe.mjs +90 -0
  502. package/dist/utilities/configRequestDedupe.mjs.map +1 -0
  503. package/dist/utilities/crud/useDefaultFormValues.d.ts.map +1 -1
  504. package/dist/utilities/crud/useDefaultFormValues.js +14 -9
  505. package/dist/utilities/crud/useDefaultFormValues.js.map +1 -1
  506. package/dist/utilities/crud/useDefaultFormValues.mjs +23 -5
  507. package/dist/utilities/crud/useDefaultFormValues.mjs.map +1 -1
  508. package/dist/utilities/entities/entityUtilities.d.ts +9 -0
  509. package/dist/utilities/entities/entityUtilities.d.ts.map +1 -1
  510. package/dist/utilities/entities/entityUtilities.js +12 -1
  511. package/dist/utilities/entities/entityUtilities.js.map +1 -1
  512. package/dist/utilities/entities/entityUtilities.mjs +15 -2
  513. package/dist/utilities/entities/entityUtilities.mjs.map +1 -1
  514. package/dist/utilities/i18n/locales/es-US.json +104 -1
  515. package/dist/utilities/i18n/locales/es-US.mjs +98 -1
  516. package/dist/utilities/i18n/locales/fr-CA.json +104 -1
  517. package/dist/utilities/i18n/locales/fr-CA.mjs +98 -1
  518. package/dist/utilities/iconLibrary/SelectedLibraryItem.d.ts.map +1 -1
  519. package/dist/utilities/iconLibrary/SelectedLibraryItem.js +0 -1
  520. package/dist/utilities/iconLibrary/SelectedLibraryItem.js.map +1 -1
  521. package/dist/utilities/iconLibrary/SelectedLibraryItem.mjs.map +1 -1
  522. package/dist/utilities/provider/ActionProvider.d.ts.map +1 -1
  523. package/dist/utilities/provider/ActionProvider.js +23 -9
  524. package/dist/utilities/provider/ActionProvider.js.map +1 -1
  525. package/dist/utilities/provider/ActionProvider.mjs +382 -201
  526. package/dist/utilities/provider/ActionProvider.mjs.map +1 -1
  527. package/dist/utilities/useAxiosGet.d.ts.map +1 -1
  528. package/dist/utilities/useAxiosGet.js +3 -1
  529. package/dist/utilities/useAxiosGet.js.map +1 -1
  530. package/dist/utilities/useAxiosGet.mjs +4 -1
  531. package/dist/utilities/useAxiosGet.mjs.map +1 -1
  532. package/package.json +105 -4
@@ -0,0 +1,116 @@
1
+ import { MULTI_VALUE_OPERATORS, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, OPERATOR_FROM_BACKEND } from "./operators.mjs";
2
+ import { LogicalSearchOperator } from "udp-stencil-component-library";
3
+ //#region src/searchIntent/prompt.ts
4
+ /** "2026-07-06 (Monday)" — for resolving relative dates in user requests. */
5
+ const formatTodayForPrompt = () => {
6
+ const today = /* @__PURE__ */ new Date();
7
+ return `${today.toISOString().slice(0, 10)} (${today.toLocaleDateString("en-US", { weekday: "long" })})`;
8
+ };
9
+ /**
10
+ * One "path (type)" line per filterable field. Paths deeper than
11
+ * maxListedSegments dot segments are omitted — hosts with deep association
12
+ * paths describe those by construction rule instead, because the full list
13
+ * is too large for the prompt.
14
+ */
15
+ const renderFilterFieldLines = (ctx, maxListedSegments = 2) => (ctx.filterFields ?? []).filter((f) => f?.path && f.path.split(".").length <= maxListedSegments).map((f) => `${f.path} (${f.type ?? "default"})`).join("\n");
16
+ /** One "name (type) [capabilities]" line per column. */
17
+ const renderColumnLines = (ctx) => (ctx.columns ?? []).map((c) => {
18
+ const caps = [];
19
+ if (c.orderable) caps.push("sortable");
20
+ caps.push("groupable");
21
+ if (c.aggregatable) caps.push("aggregatable");
22
+ if (!c.visible) caps.push("currently hidden");
23
+ return `${c.name} (${c.type}) [${caps.join(", ")}]`;
24
+ }).join("\n");
25
+ /** One "type: op, op, ..." line per normalized field type. */
26
+ const renderOperatorLines = () => Object.entries(OPERATORS_BY_TYPE).filter(([type]) => type !== "default").map(([type, ops]) => `${type}: ${ops.join(", ")}`).join("\n");
27
+ const toIntentOp = (logicalSearchOperator) => logicalSearchOperator === LogicalSearchOperator.Or ? "or" : "and";
28
+ /**
29
+ * One stored filter element read back as an intent condition. Operators are
30
+ * un-mapped from their backend constants ("LIKE" → "contains") and multi-value
31
+ * operators get their comma-joined storage split back into `values`, so the
32
+ * state the model is shown uses the exact vocabulary the propose tool expects
33
+ * — it can echo any part of it back verbatim as a full-state replacement.
34
+ */
35
+ const toIntentCondition = (element) => {
36
+ const operator = OPERATOR_FROM_BACKEND[element.searchOperator] ?? element.searchOperator ?? null;
37
+ const stored = element.searchValue ?? "";
38
+ const values = operator && MULTI_VALUE_OPERATORS.has(operator) ? { values: stored === "" ? [] : stored.split(",") } : operator && NO_VALUE_OPERATORS.has(operator) ? {} : { value: stored };
39
+ return {
40
+ field: element.searchField ?? null,
41
+ operator,
42
+ ...values,
43
+ ...element.aggregateFunction ? { aggregateFunction: element.aggregateFunction } : {}
44
+ };
45
+ };
46
+ /**
47
+ * Compact summary of the live query state, injected fresh on every request.
48
+ * Rendered in the intent vocabulary (not raw Search field names) and shaped
49
+ * like the propose tool's payload: filters are reassembled into root
50
+ * conditions plus one entry per filter group, so nothing about the current
51
+ * query — the AND/OR that joins it included — is missing from what the model
52
+ * has to reproduce when it replaces a section.
53
+ */
54
+ const describeCurrentSearchState = (searchBody, ctx) => {
55
+ const parts = [];
56
+ const filterGroups = searchBody.filterGroups ?? [];
57
+ const rootGroup = filterGroups.find((g) => g.parentGroupId == null);
58
+ const opByGroupId = new Map(filterGroups.map((g) => [g.groupId, toIntentOp(g.logicalSearchOperator)]));
59
+ const rootOp = rootGroup ? toIntentOp(rootGroup.logicalSearchOperator) : toIntentOp(searchBody.logicalSearchOperator);
60
+ const conditions = [];
61
+ const grouped = /* @__PURE__ */ new Map();
62
+ for (const element of searchBody.filterElements ?? []) {
63
+ const groupId = element.groupId;
64
+ if (groupId == null || groupId === rootGroup?.groupId) {
65
+ conditions.push(toIntentCondition(element));
66
+ continue;
67
+ }
68
+ const bucket = grouped.get(groupId) ?? [];
69
+ bucket.push(toIntentCondition(element));
70
+ grouped.set(groupId, bucket);
71
+ }
72
+ const groups = [...grouped].map(([groupId, groupConditions]) => ({
73
+ op: opByGroupId.get(groupId) ?? "and",
74
+ conditions: groupConditions
75
+ }));
76
+ parts.push(`filters: ${JSON.stringify({
77
+ op: rootOp,
78
+ conditions,
79
+ groups
80
+ })}`);
81
+ parts.push(`sorts: ${JSON.stringify((searchBody.orderElements ?? []).map((o) => ({
82
+ field: o.sortColumn ?? null,
83
+ direction: o.sortDirection ?? "ASC",
84
+ ...o.aggregateFunction ? { aggregateFunction: o.aggregateFunction } : {}
85
+ })))}`);
86
+ parts.push(`grouping: ${JSON.stringify({
87
+ groupBy: searchBody.groupProperty ?? [],
88
+ aggregates: (searchBody.groupOperationList ?? []).map((g) => ({
89
+ field: g.property ?? null,
90
+ operation: g.operation ?? null
91
+ }))
92
+ })}`);
93
+ const hidden = (ctx.columns ?? []).filter((c) => !c.visible).map((c) => c.name);
94
+ parts.push(`hiddenColumns: ${JSON.stringify(hidden)}`);
95
+ parts.push(`pageSize: ${searchBody.pageSize ?? "(host default)"}`);
96
+ return parts.join("\n");
97
+ };
98
+ /**
99
+ * The surface-agnostic rules every search-intent copilot needs (declarative
100
+ * tri-state sections, capability gates, value formats, clarification). New
101
+ * hosts start from these and append their own domain rules; hosts with
102
+ * bespoke prompts may keep their own copy instead.
103
+ */
104
+ const STANDARD_INTENT_RULES = [
105
+ "Each section (filters, sorts, grouping, columns, pageSize) is declarative: pass null (or omit) to leave it unchanged, or pass the complete new state to replace it. When the user asks to add/remove one filter, return the FULL new filter state including everything that should be kept from the current state.",
106
+ "Only sort by columns marked [sortable]. Only aggregate columns marked [aggregatable]. Aggregates require at least one groupBy column.",
107
+ "When grouping is active, results can only be sorted by grouped columns — do not propose sorts on other columns alongside grouping.",
108
+ "Value formats: booleans \"true\"/\"false\"; dates \"YYYY-MM-DD\"; datetimes \"YYYY-MM-DDTHH:mm:ss\"; numbers as plain strings (\"42\"). between takes exactly 2 values (low, high); in/not_in take 1-500 values.",
109
+ "\"contains\" does substring matching — prefer it over equals for free-text name/description searches.",
110
+ "Do not invent field paths, GUID values, or lookup IDs. If the user references a value that needs an ID you don't have (e.g. a person or status by name for a guid field), use ask_clarification.",
111
+ "If the user's request is ambiguous, use ask_clarification rather than guessing."
112
+ ];
113
+ //#endregion
114
+ export { STANDARD_INTENT_RULES, describeCurrentSearchState, formatTodayForPrompt, renderColumnLines, renderFilterFieldLines, renderOperatorLines };
115
+
116
+ //# sourceMappingURL=prompt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.mjs","names":["LogicalSearchOperator","FilterElement","Search","MULTI_VALUE_OPERATORS","NO_VALUE_OPERATORS","OPERATOR_FROM_BACKEND","OPERATORS_BY_TYPE","AiSearchSchemaContext","formatTodayForPrompt","today","Date","iso","toISOString","slice","weekday","toLocaleDateString","renderFilterFieldLines","ctx","maxListedSegments","filterFields","filter","f","path","split","length","map","type","join","renderColumnLines","columns","c","caps","orderable","push","aggregatable","visible","name","renderOperatorLines","Object","entries","ops","toIntentOp","logicalSearchOperator","Or","toIntentCondition","element","operator","searchOperator","stored","searchValue","values","has","value","field","searchField","aggregateFunction","describeCurrentSearchState","searchBody","parts","filterGroups","rootGroup","find","g","parentGroupId","opByGroupId","Map","groupId","rootOp","conditions","ReturnType","grouped","filterElements","bucket","get","set","groups","groupConditions","op","JSON","stringify","orderElements","o","sortColumn","direction","sortDirection","groupBy","groupProperty","aggregates","groupOperationList","property","operation","hidden","pageSize","STANDARD_INTENT_RULES"],"sources":["../../src/searchIntent/prompt.ts"],"sourcesContent":["import { LogicalSearchOperator } from '@univerus/udp-stencil-component-library';\nimport type {\n FilterElement,\n Search\n} from '@univerus/udp-stencil-component-library';\nimport {\n MULTI_VALUE_OPERATORS,\n NO_VALUE_OPERATORS,\n OPERATOR_FROM_BACKEND,\n OPERATORS_BY_TYPE\n} from './operators';\nimport type { AiSearchSchemaContext } from './types';\n\n// Prompt building blocks for search-intent copilots. Hosts own their full\n// system prompt (the preamble and domain rules are surface-specific copy);\n// these renderers cover the mechanical, schema-driven sections so every host\n// describes fields, operators, and live query state identically.\n\n/** \"2026-07-06 (Monday)\" — for resolving relative dates in user requests. */\nexport const formatTodayForPrompt = (): string => {\n const today = new Date();\n const iso = today.toISOString().slice(0, 10);\n const weekday = today.toLocaleDateString('en-US', { weekday: 'long' });\n return `${iso} (${weekday})`;\n};\n\n/**\n * One \"path (type)\" line per filterable field. Paths deeper than\n * maxListedSegments dot segments are omitted — hosts with deep association\n * paths describe those by construction rule instead, because the full list\n * is too large for the prompt.\n */\nexport const renderFilterFieldLines = (\n ctx: AiSearchSchemaContext,\n maxListedSegments: number = 2\n): string =>\n (ctx.filterFields ?? [])\n // A field with no path cannot be named in a filter, so it is not listed —\n // hosts derive paths from their own schema source and can produce one.\n .filter((f) => f?.path && f.path.split('.').length <= maxListedSegments)\n .map((f) => `${f.path} (${f.type ?? 'default'})`)\n .join('\\n');\n\n/** One \"name (type) [capabilities]\" line per column. */\nexport const renderColumnLines = (ctx: AiSearchSchemaContext): string =>\n (ctx.columns ?? [])\n .map((c) => {\n const caps: string[] = [];\n if (c.orderable) caps.push('sortable');\n caps.push('groupable');\n if (c.aggregatable) caps.push('aggregatable');\n if (!c.visible) caps.push('currently hidden');\n return `${c.name} (${c.type}) [${caps.join(', ')}]`;\n })\n .join('\\n');\n\n/** One \"type: op, op, ...\" line per normalized field type. */\nexport const renderOperatorLines = (): string =>\n Object.entries(OPERATORS_BY_TYPE)\n .filter(([type]) => type !== 'default')\n .map(([type, ops]) => `${type}: ${ops.join(', ')}`)\n .join('\\n');\n\nconst toIntentOp = (logicalSearchOperator: LogicalSearchOperator | undefined): 'and' | 'or' =>\n logicalSearchOperator === LogicalSearchOperator.Or ? 'or' : 'and';\n\n/**\n * One stored filter element read back as an intent condition. Operators are\n * un-mapped from their backend constants (\"LIKE\" → \"contains\") and multi-value\n * operators get their comma-joined storage split back into `values`, so the\n * state the model is shown uses the exact vocabulary the propose tool expects\n * — it can echo any part of it back verbatim as a full-state replacement.\n */\nconst toIntentCondition = (element: FilterElement) => {\n const operator =\n OPERATOR_FROM_BACKEND[element.searchOperator] ??\n element.searchOperator ??\n null;\n const stored = element.searchValue ?? '';\n const values =\n operator && MULTI_VALUE_OPERATORS.has(operator)\n ? { values: stored === '' ? [] : stored.split(',') }\n : operator && NO_VALUE_OPERATORS.has(operator)\n ? {}\n : { value: stored };\n return {\n field: element.searchField ?? null,\n operator,\n ...values,\n ...(element.aggregateFunction\n ? { aggregateFunction: element.aggregateFunction }\n : {})\n };\n};\n\n/**\n * Compact summary of the live query state, injected fresh on every request.\n * Rendered in the intent vocabulary (not raw Search field names) and shaped\n * like the propose tool's payload: filters are reassembled into root\n * conditions plus one entry per filter group, so nothing about the current\n * query — the AND/OR that joins it included — is missing from what the model\n * has to reproduce when it replaces a section.\n */\nexport const describeCurrentSearchState = (\n searchBody: Search,\n ctx: AiSearchSchemaContext\n): string => {\n const parts: string[] = [];\n\n // The root group is the parentless one; older/manually built states have no\n // groups at all and are joined by the top-level logicalSearchOperator.\n const filterGroups = searchBody.filterGroups ?? [];\n const rootGroup = filterGroups.find((g) => g.parentGroupId == null);\n const opByGroupId = new Map(\n filterGroups.map((g) => [g.groupId, toIntentOp(g.logicalSearchOperator)])\n );\n const rootOp = rootGroup\n ? toIntentOp(rootGroup.logicalSearchOperator)\n : toIntentOp(searchBody.logicalSearchOperator);\n\n const conditions: ReturnType<typeof toIntentCondition>[] = [];\n const grouped = new Map<number, ReturnType<typeof toIntentCondition>[]>();\n for (const element of searchBody.filterElements ?? []) {\n const groupId = element.groupId;\n if (groupId == null || groupId === rootGroup?.groupId) {\n conditions.push(toIntentCondition(element));\n continue;\n }\n const bucket = grouped.get(groupId) ?? [];\n bucket.push(toIntentCondition(element));\n grouped.set(groupId, bucket);\n }\n const groups = [...grouped].map(([groupId, groupConditions]) => ({\n op: opByGroupId.get(groupId) ?? 'and',\n conditions: groupConditions\n }));\n parts.push(`filters: ${JSON.stringify({ op: rootOp, conditions, groups })}`);\n\n parts.push(\n `sorts: ${JSON.stringify(\n (searchBody.orderElements ?? []).map((o) => ({\n field: o.sortColumn ?? null,\n direction: o.sortDirection ?? 'ASC',\n ...(o.aggregateFunction\n ? { aggregateFunction: o.aggregateFunction }\n : {})\n }))\n )}`\n );\n\n parts.push(\n `grouping: ${JSON.stringify({\n groupBy: searchBody.groupProperty ?? [],\n aggregates: (searchBody.groupOperationList ?? []).map((g) => ({\n field: g.property ?? null,\n operation: g.operation ?? null\n }))\n })}`\n );\n\n const hidden = (ctx.columns ?? [])\n .filter((c) => !c.visible)\n .map((c) => c.name);\n parts.push(`hiddenColumns: ${JSON.stringify(hidden)}`);\n parts.push(`pageSize: ${searchBody.pageSize ?? '(host default)'}`);\n return parts.join('\\n');\n};\n\n/**\n * The surface-agnostic rules every search-intent copilot needs (declarative\n * tri-state sections, capability gates, value formats, clarification). New\n * hosts start from these and append their own domain rules; hosts with\n * bespoke prompts may keep their own copy instead.\n */\nexport const STANDARD_INTENT_RULES: string[] = [\n 'Each section (filters, sorts, grouping, columns, pageSize) is declarative: pass null (or omit) to leave it unchanged, or pass the complete new state to replace it. When the user asks to add/remove one filter, return the FULL new filter state including everything that should be kept from the current state.',\n 'Only sort by columns marked [sortable]. Only aggregate columns marked [aggregatable]. Aggregates require at least one groupBy column.',\n 'When grouping is active, results can only be sorted by grouped columns — do not propose sorts on other columns alongside grouping.',\n 'Value formats: booleans \"true\"/\"false\"; dates \"YYYY-MM-DD\"; datetimes \"YYYY-MM-DDTHH:mm:ss\"; numbers as plain strings (\"42\"). between takes exactly 2 values (low, high); in/not_in take 1-500 values.',\n '\"contains\" does substring matching — prefer it over equals for free-text name/description searches.',\n \"Do not invent field paths, GUID values, or lookup IDs. If the user references a value that needs an ID you don't have (e.g. a person or status by name for a guid field), use ask_clarification.\",\n \"If the user's request is ambiguous, use ask_clarification rather than guessing.\"\n];\n"],"mappings":";;;;AAmBA,MAAaQ,6BAAqC;CAChD,MAAMC,wBAAQ,IAAIC,MAAM;AAGxB,QAAO,GAFKD,MAAMG,aAAa,CAACC,MAAM,GAAG,GAAG,CAE/B,IADGJ,MAAMM,mBAAmB,SAAS,EAAED,SAAS,QAAQ,CAAC,CAC7C;;;;;;;;AAS3B,MAAaE,0BACXC,KACAC,oBAA4B,OAE3BD,IAAIE,gBAAgB,EAAA,EAGlBC,QAAQC,MAAMA,GAAGC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EAAE1B,mBAAmB,GAC1C,EAAE;EACP,EACH,CAAC,GACF;AAEDG,OAAMzB,KACJ,aAAa6C,KAAKC,UAAU;EAC1BM,SAAS5B,WAAW6B,iBAAiB,EAAE;EACvCC,aAAa9B,WAAW+B,sBAAsB,EAAE,EAAE/D,KAAKqC,OAAO;GAC5DT,OAAOS,EAAE2B,YAAY;GACrBC,WAAW5B,EAAE4B,aAAa;GAC3B,EAAC;EACH,CAAC,GACH;CAED,MAAMC,UAAU1E,IAAIY,WAAW,EAAE,EAC9BT,QAAQU,MAAM,CAACA,EAAEK,QAAQ,CACzBV,KAAKK,MAAMA,EAAEM,KAAK;AACrBsB,OAAMzB,KAAK,kBAAkB6C,KAAKC,UAAUY,OAAO,GAAG;AACtDjC,OAAMzB,KAAK,aAAawB,WAAWmC,YAAY,mBAAmB;AAClE,QAAOlC,MAAM/B,KAAK,KAAK;;;;;;;;AASzB,MAAakE,wBAAkC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -0,0 +1,19 @@
1
+ import type { OpenAiToolDefinition } from '../aiAssistant/openai';
2
+ export declare const PROPOSE_QUERY_TOOL_NAME = "propose_query_changes";
3
+ export declare const GET_ENTITY_SCHEMA_TOOL_NAME = "get_entity_schema";
4
+ export type ProposeQuerySection = 'filters' | 'sorts' | 'grouping' | 'columns' | 'pageSize';
5
+ export interface ProposeQueryToolOptions {
6
+ /** Upper bound mentioned in the pageSize description. Default: SearchConstants.MAX_PAGE_SIZE. */
7
+ maxPageSize?: number;
8
+ /**
9
+ * Which intent sections the host can actually apply — sections not listed are
10
+ * omitted from the tool schema entirely, so the model cannot propose them
11
+ * (e.g. a grid filter assistant passes ['filters']). Default: all sections.
12
+ */
13
+ sections?: ProposeQuerySection[];
14
+ }
15
+ /** The propose tool: declarative full-state-per-section query changes. */
16
+ export declare const buildProposeQueryChangesTool: (options?: ProposeQueryToolOptions) => OpenAiToolDefinition;
17
+ /** Entity-schema lookup tool; the host supplies the execute implementation. */
18
+ export declare const buildGetEntitySchemaTool: () => OpenAiToolDefinition;
19
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/searchIntent/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAiDlE,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAC/D,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAC7B,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,iGAAiG;IACjG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAClC;AAED,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,6DAqIxC,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,4BAmBnC,CAAC"}
@@ -0,0 +1,189 @@
1
+ import { SearchConstants } from 'udp-stencil-component-library';
2
+ // OpenAI-compatible tool definitions for the search-intent copilot pattern.
3
+ // Kept deliberately union-free (no oneOf/anyOf) — small models are far more
4
+ // reliable against flat schemas. Groups are a parallel array instead of
5
+ // recursive conditions, which also matches the builder's max nesting depth.
6
+ const CONDITION_SCHEMA = {
7
+ type: 'object',
8
+ additionalProperties: false,
9
+ properties: {
10
+ field: {
11
+ type: 'string',
12
+ description: 'A field path from the "Filterable fields" list, exactly as written there.'
13
+ },
14
+ operator: {
15
+ type: 'string',
16
+ enum: [
17
+ 'equals',
18
+ 'not_equals',
19
+ 'contains',
20
+ 'starts_with',
21
+ 'greater_than',
22
+ 'greater_than_or_equal',
23
+ 'less_than',
24
+ 'less_than_or_equal',
25
+ 'between',
26
+ 'in',
27
+ 'not_in',
28
+ 'is_empty',
29
+ 'is_not_empty'
30
+ ]
31
+ },
32
+ value: {
33
+ type: 'string',
34
+ description: 'Value for single-value operators. Booleans: "true"/"false". Dates: YYYY-MM-DD. Datetimes: YYYY-MM-DDTHH:mm:ss. Omit for is_empty/is_not_empty.'
35
+ },
36
+ values: {
37
+ type: 'array',
38
+ items: { type: 'string' },
39
+ description: 'Values for between (exactly 2, low then high) and in/not_in (1 or more).'
40
+ }
41
+ },
42
+ required: ['field', 'operator']
43
+ };
44
+ export const PROPOSE_QUERY_TOOL_NAME = 'propose_query_changes';
45
+ export const GET_ENTITY_SCHEMA_TOOL_NAME = 'get_entity_schema';
46
+ /** The propose tool: declarative full-state-per-section query changes. */
47
+ export const buildProposeQueryChangesTool = (options) => {
48
+ var _a, _b;
49
+ const maxPageSize = (_a = options === null || options === void 0 ? void 0 : options.maxPageSize) !== null && _a !== void 0 ? _a : SearchConstants.MAX_PAGE_SIZE;
50
+ const sections = (_b = options === null || options === void 0 ? void 0 : options.sections) !== null && _b !== void 0 ? _b : [
51
+ 'filters',
52
+ 'sorts',
53
+ 'grouping',
54
+ 'columns',
55
+ 'pageSize'
56
+ ];
57
+ const sectionSchemas = {
58
+ filters: {
59
+ type: ['object', 'null'],
60
+ description: 'Full replacement of the filter state. Use {"op":"and","conditions":[]} to clear all filters. null = leave filters unchanged.',
61
+ additionalProperties: false,
62
+ properties: {
63
+ op: {
64
+ type: 'string',
65
+ enum: ['and', 'or'],
66
+ description: 'How root-level conditions and groups combine.'
67
+ },
68
+ conditions: { type: 'array', items: CONDITION_SCHEMA },
69
+ groups: {
70
+ type: 'array',
71
+ description: 'Optional nested condition groups (one level deep only).',
72
+ items: {
73
+ type: 'object',
74
+ additionalProperties: false,
75
+ properties: {
76
+ op: { type: 'string', enum: ['and', 'or'] },
77
+ conditions: { type: 'array', items: CONDITION_SCHEMA }
78
+ },
79
+ required: ['op', 'conditions']
80
+ }
81
+ }
82
+ },
83
+ required: ['op', 'conditions']
84
+ },
85
+ sorts: {
86
+ type: ['array', 'null'],
87
+ description: 'Full replacement of sorting. [] clears sorting. null = leave unchanged. Only columns marked orderable.',
88
+ items: {
89
+ type: 'object',
90
+ additionalProperties: false,
91
+ properties: {
92
+ field: {
93
+ type: 'string',
94
+ description: 'A root column name marked orderable.'
95
+ },
96
+ direction: { type: 'string', enum: ['ASC', 'DESC'] }
97
+ },
98
+ required: ['field', 'direction']
99
+ }
100
+ },
101
+ grouping: {
102
+ type: ['object', 'null'],
103
+ description: 'Full replacement of grouping. {"groupBy":[],"aggregates":[]} clears grouping. null = leave unchanged. Aggregates require at least one groupBy column.',
104
+ additionalProperties: false,
105
+ properties: {
106
+ groupBy: {
107
+ type: 'array',
108
+ items: { type: 'string' },
109
+ description: 'Root column names to group by.'
110
+ },
111
+ aggregates: {
112
+ type: 'array',
113
+ items: {
114
+ type: 'object',
115
+ additionalProperties: false,
116
+ properties: {
117
+ field: {
118
+ type: 'string',
119
+ description: 'A root column name marked aggregatable.'
120
+ },
121
+ operation: {
122
+ type: 'string',
123
+ enum: ['COUNT', 'SUM', 'MIN', 'MAX', 'AVG']
124
+ }
125
+ },
126
+ required: ['field', 'operation']
127
+ }
128
+ }
129
+ },
130
+ required: ['groupBy', 'aggregates']
131
+ },
132
+ columns: {
133
+ type: ['object', 'null'],
134
+ description: 'Column visibility changes. null = leave unchanged. showOnly: make exactly these visible; otherwise show/hide adjust individual columns.',
135
+ additionalProperties: false,
136
+ properties: {
137
+ showOnly: { type: 'array', items: { type: 'string' } },
138
+ show: { type: 'array', items: { type: 'string' } },
139
+ hide: { type: 'array', items: { type: 'string' } }
140
+ }
141
+ },
142
+ pageSize: {
143
+ type: ['number', 'null'],
144
+ description: `New page size (1-${maxPageSize}). null = leave unchanged.`
145
+ }
146
+ };
147
+ const properties = {
148
+ explanation: {
149
+ type: 'string',
150
+ description: 'One short sentence describing the proposed change, shown to the user.'
151
+ }
152
+ };
153
+ for (const section of sections) {
154
+ properties[section] = sectionSchemas[section];
155
+ }
156
+ return {
157
+ type: 'function',
158
+ function: {
159
+ name: PROPOSE_QUERY_TOOL_NAME,
160
+ description: 'Propose changes to the current query. Each top-level section is declarative: null (or omitted) leaves that section unchanged; a present value fully replaces it.',
161
+ parameters: {
162
+ type: 'object',
163
+ additionalProperties: false,
164
+ properties,
165
+ required: ['explanation']
166
+ }
167
+ }
168
+ };
169
+ };
170
+ /** Entity-schema lookup tool; the host supplies the execute implementation. */
171
+ export const buildGetEntitySchemaTool = () => ({
172
+ type: 'function',
173
+ function: {
174
+ name: GET_ENTITY_SCHEMA_TOOL_NAME,
175
+ description: "Look up an entity's schema: its fields (with types and filter/sort/aggregate capabilities) and how it relates to other entities. Use this to answer schema questions or to check an entity before discussing it. Results come back as a tool message; then answer the user in plain text.",
176
+ parameters: {
177
+ type: 'object',
178
+ additionalProperties: false,
179
+ properties: {
180
+ entityName: {
181
+ type: 'string',
182
+ description: 'Simple entity name from the catalog list, e.g. "ChargeCode".'
183
+ }
184
+ },
185
+ required: ['entityName']
186
+ }
187
+ }
188
+ });
189
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/searchIntent/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,4EAA4E;AAC5E,8EAA4E;AAC5E,wEAAwE;AACxE,4EAA4E;AAE5E,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2EAA2E;SAC9E;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE;gBACJ,QAAQ;gBACR,YAAY;gBACZ,UAAU;gBACV,aAAa;gBACb,cAAc;gBACd,uBAAuB;gBACvB,WAAW;gBACX,oBAAoB;gBACpB,SAAS;gBACT,IAAI;gBACJ,QAAQ;gBACR,UAAU;gBACV,cAAc;aAC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ACV,QAAQ,EAAE,CAAC,aAAa,CAAC;aAC1B;SACF;KACF,CAAC;AAAA,CACH,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAyB,EAAE,CAAC,CAAC;IACnE,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,2BAA2B;QACjC,WAAW,EACT,2RAA2R;QAC7R,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,8DAA8D;iBACjE;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,209 @@
1
+ import { SearchConstants } from "udp-stencil-component-library";
2
+ //#region src/searchIntent/tools.ts
3
+ const CONDITION_SCHEMA = {
4
+ type: "object",
5
+ additionalProperties: false,
6
+ properties: {
7
+ field: {
8
+ type: "string",
9
+ description: "A field path from the \"Filterable fields\" list, exactly as written there."
10
+ },
11
+ operator: {
12
+ type: "string",
13
+ enum: [
14
+ "equals",
15
+ "not_equals",
16
+ "contains",
17
+ "starts_with",
18
+ "greater_than",
19
+ "greater_than_or_equal",
20
+ "less_than",
21
+ "less_than_or_equal",
22
+ "between",
23
+ "in",
24
+ "not_in",
25
+ "is_empty",
26
+ "is_not_empty"
27
+ ]
28
+ },
29
+ value: {
30
+ type: "string",
31
+ description: "Value for single-value operators. Booleans: \"true\"/\"false\". Dates: YYYY-MM-DD. Datetimes: YYYY-MM-DDTHH:mm:ss. Omit for is_empty/is_not_empty."
32
+ },
33
+ values: {
34
+ type: "array",
35
+ items: { type: "string" },
36
+ description: "Values for between (exactly 2, low then high) and in/not_in (1 or more)."
37
+ }
38
+ },
39
+ required: ["field", "operator"]
40
+ };
41
+ const PROPOSE_QUERY_TOOL_NAME = "propose_query_changes";
42
+ const GET_ENTITY_SCHEMA_TOOL_NAME = "get_entity_schema";
43
+ /** The propose tool: declarative full-state-per-section query changes. */
44
+ const buildProposeQueryChangesTool = (options) => {
45
+ const maxPageSize = options?.maxPageSize ?? SearchConstants.MAX_PAGE_SIZE;
46
+ const sections = options?.sections ?? [
47
+ "filters",
48
+ "sorts",
49
+ "grouping",
50
+ "columns",
51
+ "pageSize"
52
+ ];
53
+ const sectionSchemas = {
54
+ filters: {
55
+ type: ["object", "null"],
56
+ description: "Full replacement of the filter state. Use {\"op\":\"and\",\"conditions\":[]} to clear all filters. null = leave filters unchanged.",
57
+ additionalProperties: false,
58
+ properties: {
59
+ op: {
60
+ type: "string",
61
+ enum: ["and", "or"],
62
+ description: "How root-level conditions and groups combine."
63
+ },
64
+ conditions: {
65
+ type: "array",
66
+ items: CONDITION_SCHEMA
67
+ },
68
+ groups: {
69
+ type: "array",
70
+ description: "Optional nested condition groups (one level deep only).",
71
+ items: {
72
+ type: "object",
73
+ additionalProperties: false,
74
+ properties: {
75
+ op: {
76
+ type: "string",
77
+ enum: ["and", "or"]
78
+ },
79
+ conditions: {
80
+ type: "array",
81
+ items: CONDITION_SCHEMA
82
+ }
83
+ },
84
+ required: ["op", "conditions"]
85
+ }
86
+ }
87
+ },
88
+ required: ["op", "conditions"]
89
+ },
90
+ sorts: {
91
+ type: ["array", "null"],
92
+ description: "Full replacement of sorting. [] clears sorting. null = leave unchanged. Only columns marked orderable.",
93
+ items: {
94
+ type: "object",
95
+ additionalProperties: false,
96
+ properties: {
97
+ field: {
98
+ type: "string",
99
+ description: "A root column name marked orderable."
100
+ },
101
+ direction: {
102
+ type: "string",
103
+ enum: ["ASC", "DESC"]
104
+ }
105
+ },
106
+ required: ["field", "direction"]
107
+ }
108
+ },
109
+ grouping: {
110
+ type: ["object", "null"],
111
+ description: "Full replacement of grouping. {\"groupBy\":[],\"aggregates\":[]} clears grouping. null = leave unchanged. Aggregates require at least one groupBy column.",
112
+ additionalProperties: false,
113
+ properties: {
114
+ groupBy: {
115
+ type: "array",
116
+ items: { type: "string" },
117
+ description: "Root column names to group by."
118
+ },
119
+ aggregates: {
120
+ type: "array",
121
+ items: {
122
+ type: "object",
123
+ additionalProperties: false,
124
+ properties: {
125
+ field: {
126
+ type: "string",
127
+ description: "A root column name marked aggregatable."
128
+ },
129
+ operation: {
130
+ type: "string",
131
+ enum: [
132
+ "COUNT",
133
+ "SUM",
134
+ "MIN",
135
+ "MAX",
136
+ "AVG"
137
+ ]
138
+ }
139
+ },
140
+ required: ["field", "operation"]
141
+ }
142
+ }
143
+ },
144
+ required: ["groupBy", "aggregates"]
145
+ },
146
+ columns: {
147
+ type: ["object", "null"],
148
+ description: "Column visibility changes. null = leave unchanged. showOnly: make exactly these visible; otherwise show/hide adjust individual columns.",
149
+ additionalProperties: false,
150
+ properties: {
151
+ showOnly: {
152
+ type: "array",
153
+ items: { type: "string" }
154
+ },
155
+ show: {
156
+ type: "array",
157
+ items: { type: "string" }
158
+ },
159
+ hide: {
160
+ type: "array",
161
+ items: { type: "string" }
162
+ }
163
+ }
164
+ },
165
+ pageSize: {
166
+ type: ["number", "null"],
167
+ description: `New page size (1-${maxPageSize}). null = leave unchanged.`
168
+ }
169
+ };
170
+ const properties = { explanation: {
171
+ type: "string",
172
+ description: "One short sentence describing the proposed change, shown to the user."
173
+ } };
174
+ for (const section of sections) properties[section] = sectionSchemas[section];
175
+ return {
176
+ type: "function",
177
+ function: {
178
+ name: PROPOSE_QUERY_TOOL_NAME,
179
+ description: "Propose changes to the current query. Each top-level section is declarative: null (or omitted) leaves that section unchanged; a present value fully replaces it.",
180
+ parameters: {
181
+ type: "object",
182
+ additionalProperties: false,
183
+ properties,
184
+ required: ["explanation"]
185
+ }
186
+ }
187
+ };
188
+ };
189
+ /** Entity-schema lookup tool; the host supplies the execute implementation. */
190
+ const buildGetEntitySchemaTool = () => ({
191
+ type: "function",
192
+ function: {
193
+ name: GET_ENTITY_SCHEMA_TOOL_NAME,
194
+ description: "Look up an entity's schema: its fields (with types and filter/sort/aggregate capabilities) and how it relates to other entities. Use this to answer schema questions or to check an entity before discussing it. Results come back as a tool message; then answer the user in plain text.",
195
+ parameters: {
196
+ type: "object",
197
+ additionalProperties: false,
198
+ properties: { entityName: {
199
+ type: "string",
200
+ description: "Simple entity name from the catalog list, e.g. \"ChargeCode\"."
201
+ } },
202
+ required: ["entityName"]
203
+ }
204
+ }
205
+ });
206
+ //#endregion
207
+ export { GET_ENTITY_SCHEMA_TOOL_NAME, PROPOSE_QUERY_TOOL_NAME, buildGetEntitySchemaTool, buildProposeQueryChangesTool };
208
+
209
+ //# sourceMappingURL=tools.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.mjs","names":["SearchConstants","OpenAiToolDefinition","CONDITION_SCHEMA","type","additionalProperties","properties","field","description","operator","enum","value","values","items","required","PROPOSE_QUERY_TOOL_NAME","GET_ENTITY_SCHEMA_TOOL_NAME","ProposeQuerySection","ProposeQueryToolOptions","maxPageSize","sections","buildProposeQueryChangesTool","options","MAX_PAGE_SIZE","sectionSchemas","Record","filters","op","conditions","groups","sorts","direction","grouping","groupBy","aggregates","operation","columns","showOnly","show","hide","pageSize","explanation","section","function","name","parameters","buildGetEntitySchemaTool","entityName"],"sources":["../../src/searchIntent/tools.ts"],"sourcesContent":["import { SearchConstants } from '@univerus/udp-stencil-component-library';\nimport type { OpenAiToolDefinition } from '../aiAssistant/openai';\n\n// OpenAI-compatible tool definitions for the search-intent copilot pattern.\n// Kept deliberately union-free (no oneOf/anyOf) — small models are far more\n// reliable against flat schemas. Groups are a parallel array instead of\n// recursive conditions, which also matches the builder's max nesting depth.\n\nconst CONDITION_SCHEMA = {\n type: 'object',\n additionalProperties: false,\n properties: {\n field: {\n type: 'string',\n description:\n 'A field path from the \"Filterable fields\" list, exactly as written there.'\n },\n operator: {\n type: 'string',\n enum: [\n 'equals',\n 'not_equals',\n 'contains',\n 'starts_with',\n 'greater_than',\n 'greater_than_or_equal',\n 'less_than',\n 'less_than_or_equal',\n 'between',\n 'in',\n 'not_in',\n 'is_empty',\n 'is_not_empty'\n ]\n },\n value: {\n type: 'string',\n description:\n 'Value for single-value operators. Booleans: \"true\"/\"false\". Dates: YYYY-MM-DD. Datetimes: YYYY-MM-DDTHH:mm:ss. Omit for is_empty/is_not_empty.'\n },\n values: {\n type: 'array',\n items: { type: 'string' },\n description:\n 'Values for between (exactly 2, low then high) and in/not_in (1 or more).'\n }\n },\n required: ['field', 'operator']\n};\n\nexport const PROPOSE_QUERY_TOOL_NAME = 'propose_query_changes';\nexport const GET_ENTITY_SCHEMA_TOOL_NAME = 'get_entity_schema';\n\nexport type ProposeQuerySection =\n 'filters' | 'sorts' | 'grouping' | 'columns' | 'pageSize';\n\nexport interface ProposeQueryToolOptions {\n /** Upper bound mentioned in the pageSize description. Default: SearchConstants.MAX_PAGE_SIZE. */\n maxPageSize?: number;\n /**\n * Which intent sections the host can actually apply — sections not listed are\n * omitted from the tool schema entirely, so the model cannot propose them\n * (e.g. a grid filter assistant passes ['filters']). Default: all sections.\n */\n sections?: ProposeQuerySection[];\n}\n\n/** The propose tool: declarative full-state-per-section query changes. */\nexport const buildProposeQueryChangesTool = (\n options?: ProposeQueryToolOptions\n): OpenAiToolDefinition => {\n const maxPageSize = options?.maxPageSize ?? SearchConstants.MAX_PAGE_SIZE;\n const sections = options?.sections ?? [\n 'filters',\n 'sorts',\n 'grouping',\n 'columns',\n 'pageSize'\n ];\n\n const sectionSchemas: Record<ProposeQuerySection, object> = {\n filters: {\n type: ['object', 'null'],\n description:\n 'Full replacement of the filter state. Use {\"op\":\"and\",\"conditions\":[]} to clear all filters. null = leave filters unchanged.',\n additionalProperties: false,\n properties: {\n op: {\n type: 'string',\n enum: ['and', 'or'],\n description: 'How root-level conditions and groups combine.'\n },\n conditions: { type: 'array', items: CONDITION_SCHEMA },\n groups: {\n type: 'array',\n description:\n 'Optional nested condition groups (one level deep only).',\n items: {\n type: 'object',\n additionalProperties: false,\n properties: {\n op: { type: 'string', enum: ['and', 'or'] },\n conditions: { type: 'array', items: CONDITION_SCHEMA }\n },\n required: ['op', 'conditions']\n }\n }\n },\n required: ['op', 'conditions']\n },\n sorts: {\n type: ['array', 'null'],\n description:\n 'Full replacement of sorting. [] clears sorting. null = leave unchanged. Only columns marked orderable.',\n items: {\n type: 'object',\n additionalProperties: false,\n properties: {\n field: {\n type: 'string',\n description: 'A root column name marked orderable.'\n },\n direction: { type: 'string', enum: ['ASC', 'DESC'] }\n },\n required: ['field', 'direction']\n }\n },\n grouping: {\n type: ['object', 'null'],\n description:\n 'Full replacement of grouping. {\"groupBy\":[],\"aggregates\":[]} clears grouping. null = leave unchanged. Aggregates require at least one groupBy column.',\n additionalProperties: false,\n properties: {\n groupBy: {\n type: 'array',\n items: { type: 'string' },\n description: 'Root column names to group by.'\n },\n aggregates: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: false,\n properties: {\n field: {\n type: 'string',\n description: 'A root column name marked aggregatable.'\n },\n operation: {\n type: 'string',\n enum: ['COUNT', 'SUM', 'MIN', 'MAX', 'AVG']\n }\n },\n required: ['field', 'operation']\n }\n }\n },\n required: ['groupBy', 'aggregates']\n },\n columns: {\n type: ['object', 'null'],\n description:\n 'Column visibility changes. null = leave unchanged. showOnly: make exactly these visible; otherwise show/hide adjust individual columns.',\n additionalProperties: false,\n properties: {\n showOnly: { type: 'array', items: { type: 'string' } },\n show: { type: 'array', items: { type: 'string' } },\n hide: { type: 'array', items: { type: 'string' } }\n }\n },\n pageSize: {\n type: ['number', 'null'],\n description: `New page size (1-${maxPageSize}). null = leave unchanged.`\n }\n };\n\n const properties: Record<string, object> = {\n explanation: {\n type: 'string',\n description:\n 'One short sentence describing the proposed change, shown to the user.'\n }\n };\n for (const section of sections) {\n properties[section] = sectionSchemas[section];\n }\n\n return {\n type: 'function',\n function: {\n name: PROPOSE_QUERY_TOOL_NAME,\n description:\n 'Propose changes to the current query. Each top-level section is declarative: null (or omitted) leaves that section unchanged; a present value fully replaces it.',\n parameters: {\n type: 'object',\n additionalProperties: false,\n properties,\n required: ['explanation']\n }\n }\n };\n};\n\n/** Entity-schema lookup tool; the host supplies the execute implementation. */\nexport const buildGetEntitySchemaTool = (): OpenAiToolDefinition => ({\n type: 'function',\n function: {\n name: GET_ENTITY_SCHEMA_TOOL_NAME,\n description:\n \"Look up an entity's schema: its fields (with types and filter/sort/aggregate capabilities) and how it relates to other entities. Use this to answer schema questions or to check an entity before discussing it. Results come back as a tool message; then answer the user in plain text.\",\n parameters: {\n type: 'object',\n additionalProperties: false,\n properties: {\n entityName: {\n type: 'string',\n description:\n 'Simple entity name from the catalog list, e.g. \"ChargeCode\".'\n }\n },\n required: ['entityName']\n }\n }\n});\n"],"mappings":";;AAQA,MAAME,mBAAmB;CACvBC,MAAM;CACNC,sBAAsB;CACtBC,YAAY;EACVC,OAAO;GACLH,MAAM;GACNI,aACE;GACH;EACDC,UAAU;GACRL,MAAM;GACNM,MAAM;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAAc;GAEjB;EACDC,OAAO;GACLP,MAAM;GACNI,aACE;GACH;EACDI,QAAQ;GACNR,MAAM;GACNS,OAAO,EAAET,MAAM,UAAU;GACzBI,aACE;GACJ;EACD;CACDM,UAAU,CAAC,SAAS,WAAU;CAC/B;AAED,MAAaC,0BAA0B;AACvC,MAAaC,8BAA8B;;AAiB3C,MAAaK,gCACXC,YACyB;CACzB,MAAMH,cAAcG,SAASH,eAAelB,gBAAgBsB;CAC5D,MAAMH,WAAWE,SAASF,YAAY;EACpC;EACA;EACA;EACA;EACA;EACD;CAED,MAAMI,iBAAsD;EAC1DE,SAAS;GACPtB,MAAM,CAAC,UAAU,OAAO;GACxBI,aACE;GACFH,sBAAsB;GACtBC,YAAY;IACVqB,IAAI;KACFvB,MAAM;KACNM,MAAM,CAAC,OAAO,KAAK;KACnBF,aAAa;KACd;IACDoB,YAAY;KAAExB,MAAM;KAASS,OAAOV;KAAkB;IACtD0B,QAAQ;KACNzB,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