@solidxai/core-ui 0.1.20-beta.0 → 0.1.20

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 (252) hide show
  1. package/dist/components/common/Link.d.ts.map +1 -1
  2. package/dist/components/common/Link.js +2 -1
  3. package/dist/components/common/Link.js.map +1 -1
  4. package/dist/components/common/Link.tsx +2 -1
  5. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +1 -0
  6. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
  7. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +109 -23
  8. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
  9. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +155 -34
  10. package/dist/components/core/chatter/SolidChatter.js +2 -2
  11. package/dist/components/core/chatter/SolidChatter.js.map +1 -1
  12. package/dist/components/core/chatter/SolidChatter.tsx +2 -2
  13. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js +20 -19
  14. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.js.map +1 -1
  15. package/dist/components/core/common/SolidGenericImport/SolidImportTransaction.tsx +16 -16
  16. package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.d.ts.map +1 -1
  17. package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js +36 -9
  18. package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.js.map +1 -1
  19. package/dist/components/core/extension/solid-core/moduleMetadata/list/ExportModulePackageRowAction.tsx +78 -7
  20. package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts +1 -0
  21. package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.d.ts.map +1 -1
  22. package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js +1 -1
  23. package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.js.map +1 -1
  24. package/dist/components/core/extension/solid-core/moduleMetadata/list/ModuleImportListHeaderAction.tsx +1 -1
  25. package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts +4 -0
  26. package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.d.ts.map +1 -0
  27. package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js +131 -0
  28. package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.js.map +1 -0
  29. package/dist/components/core/extension/solid-core/moduleMetadata/list/RestoreModulePackageRowAction.tsx +151 -0
  30. package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts +4 -0
  31. package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.d.ts.map +1 -0
  32. package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js +13 -0
  33. package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.js.map +1 -0
  34. package/dist/components/core/extension/solid-core/moduleMetadata/list/UpdateModulePackageRowAction.tsx +20 -0
  35. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  36. package/dist/components/core/form/SolidFormView.js +4 -0
  37. package/dist/components/core/form/SolidFormView.js.map +1 -1
  38. package/dist/components/core/form/SolidFormView.tsx +4 -0
  39. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  40. package/dist/components/core/kanban/SolidKanbanView.js +50 -15
  41. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  42. package/dist/components/core/kanban/SolidKanbanView.tsx +22 -3
  43. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  44. package/dist/components/core/list/SolidListView.js +16 -3
  45. package/dist/components/core/list/SolidListView.js.map +1 -1
  46. package/dist/components/core/list/SolidListView.tsx +16 -2
  47. package/dist/components/core/list/columns/SolidMediaMultipleColumn.d.ts.map +1 -1
  48. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +4 -1
  49. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
  50. package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -1
  51. package/dist/components/core/module/ModulePackageDialog.css +102 -0
  52. package/dist/components/core/module/ModulePackageDialog.d.ts +2 -1
  53. package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -1
  54. package/dist/components/core/module/ModulePackageDialog.js +216 -68
  55. package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
  56. package/dist/components/core/module/ModulePackageDialog.tsx +356 -76
  57. package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
  58. package/dist/components/core/solid-agent/SolidAgentChat.js +9 -3
  59. package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
  60. package/dist/components/core/solid-agent/SolidAgentChat.tsx +9 -4
  61. package/dist/components/core/solid-agent/SolidAgentMarkdown.d.ts.map +1 -1
  62. package/dist/components/core/solid-agent/SolidAgentMarkdown.js +25 -6
  63. package/dist/components/core/solid-agent/SolidAgentMarkdown.js.map +1 -1
  64. package/dist/components/core/solid-agent/SolidAgentMarkdown.tsx +15 -1
  65. package/dist/components/core/solid-agent/client/agentRuntime.d.ts +5 -0
  66. package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
  67. package/dist/components/core/solid-agent/client/agentRuntime.js +77 -20
  68. package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
  69. package/dist/components/core/solid-agent/client/agentRuntime.ts +29 -1
  70. package/dist/components/core/solid-agent/client/agentSocket.d.ts +5 -1
  71. package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
  72. package/dist/components/core/solid-agent/client/agentSocket.js +27 -4
  73. package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
  74. package/dist/components/core/solid-agent/client/agentSocket.ts +14 -3
  75. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +2 -2
  76. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
  77. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +5 -5
  78. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +2 -0
  79. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
  80. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +2 -2
  81. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
  82. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +4 -4
  83. package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
  84. package/dist/components/core/solid-agent/thread/AgentThread.js +61 -26
  85. package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
  86. package/dist/components/core/solid-agent/thread/AgentThread.tsx +74 -40
  87. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +2 -1
  88. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
  89. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +2 -1
  90. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
  91. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +3 -1
  92. package/dist/components/core/solid-agent/types.d.ts +3 -0
  93. package/dist/components/core/solid-agent/types.d.ts.map +1 -1
  94. package/dist/components/core/solid-agent/types.js +0 -9
  95. package/dist/components/core/solid-agent/types.js.map +1 -1
  96. package/dist/components/core/solid-agent/types.ts +4 -2
  97. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts +1 -1
  98. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts.map +1 -1
  99. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js +5 -2
  100. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js.map +1 -1
  101. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.tsx +11 -5
  102. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js +3 -0
  103. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js.map +1 -1
  104. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.tsx +4 -0
  105. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +3 -0
  106. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -1
  107. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +4 -0
  108. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js +3 -0
  109. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js.map +1 -1
  110. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.tsx +4 -0
  111. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +3 -0
  112. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -1
  113. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +4 -0
  114. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js +3 -0
  115. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js.map +1 -1
  116. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.tsx +4 -0
  117. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +3 -0
  118. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
  119. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +4 -0
  120. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js +3 -0
  121. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js.map +1 -1
  122. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx +4 -0
  123. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js +3 -0
  124. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js.map +1 -1
  125. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx +4 -0
  126. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js +3 -0
  127. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js.map +1 -1
  128. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx +4 -0
  129. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js +19 -0
  130. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js.map +1 -1
  131. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.tsx +20 -0
  132. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js +3 -0
  133. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js.map +1 -1
  134. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx +4 -0
  135. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js +3 -0
  136. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js.map +1 -1
  137. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.tsx +4 -0
  138. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js +3 -0
  139. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js.map +1 -1
  140. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx +4 -0
  141. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +3 -0
  142. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -1
  143. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +4 -0
  144. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +3 -0
  145. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
  146. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +4 -0
  147. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +3 -0
  148. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -1
  149. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +4 -0
  150. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +3 -0
  151. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -1
  152. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +4 -0
  153. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +3 -0
  154. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
  155. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +4 -0
  156. package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +9 -1
  157. package/dist/components/core/users/CreateUser.d.ts.map +1 -1
  158. package/dist/components/core/users/CreateUser.js +23 -8
  159. package/dist/components/core/users/CreateUser.js.map +1 -1
  160. package/dist/components/core/users/CreateUser.tsx +10 -6
  161. package/dist/components/layout/AdminTopHeader.js +2 -2
  162. package/dist/components/layout/AdminTopHeader.js.map +1 -1
  163. package/dist/components/layout/AdminTopHeader.tsx +2 -2
  164. package/dist/components/layout/AppSidebar.d.ts.map +1 -1
  165. package/dist/components/layout/AppSidebar.js +21 -5
  166. package/dist/components/layout/AppSidebar.js.map +1 -1
  167. package/dist/components/layout/AppSidebar.tsx +24 -6
  168. package/dist/components/layout/SolidAiStudioLayout.d.ts.map +1 -1
  169. package/dist/components/layout/SolidAiStudioLayout.js +3 -4
  170. package/dist/components/layout/SolidAiStudioLayout.js.map +1 -1
  171. package/dist/components/layout/SolidAiStudioLayout.tsx +3 -4
  172. package/dist/components/layout/user-profile-menu.js +10 -10
  173. package/dist/components/layout/user-profile-menu.js.map +1 -1
  174. package/dist/components/layout/user-profile-menu.tsx +3 -3
  175. package/dist/components/shad-cn-ui/SolidLightbox.d.ts +2 -1
  176. package/dist/components/shad-cn-ui/SolidLightbox.d.ts.map +1 -1
  177. package/dist/components/shad-cn-ui/SolidLightbox.js +11 -4
  178. package/dist/components/shad-cn-ui/SolidLightbox.js.map +1 -1
  179. package/dist/components/shad-cn-ui/SolidLightbox.tsx +14 -1
  180. package/dist/helpers/modelViewPersistence.d.ts +2 -0
  181. package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
  182. package/dist/helpers/modelViewPersistence.js +72 -0
  183. package/dist/helpers/modelViewPersistence.js.map +1 -1
  184. package/dist/helpers/modelViewPersistence.ts +79 -0
  185. package/dist/helpers/registry.d.ts +6 -2
  186. package/dist/helpers/registry.d.ts.map +1 -1
  187. package/dist/helpers/registry.js +68 -3
  188. package/dist/helpers/registry.js.map +1 -1
  189. package/dist/helpers/registry.ts +62 -4
  190. package/dist/hooks/useModelsDevModels.d.ts +43 -0
  191. package/dist/hooks/useModelsDevModels.d.ts.map +1 -0
  192. package/dist/hooks/useModelsDevModels.js +81 -0
  193. package/dist/hooks/useModelsDevModels.js.map +1 -0
  194. package/dist/hooks/useModelsDevModels.ts +106 -0
  195. package/dist/hooks/useRouter.d.ts.map +1 -1
  196. package/dist/hooks/useRouter.js +3 -2
  197. package/dist/hooks/useRouter.js.map +1 -1
  198. package/dist/hooks/useRouter.ts +3 -2
  199. package/dist/index.d.ts +2 -2
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +1 -1
  202. package/dist/index.js.map +1 -1
  203. package/dist/index.ts +4 -1
  204. package/dist/modules/solidUiModule.d.ts +3 -2
  205. package/dist/modules/solidUiModule.d.ts.map +1 -1
  206. package/dist/modules/solidUiModule.js +1 -1
  207. package/dist/modules/solidUiModule.js.map +1 -1
  208. package/dist/modules/solidUiModule.ts +5 -1
  209. package/dist/redux/api/moduleApi.d.ts +12 -2
  210. package/dist/redux/api/moduleApi.d.ts.map +1 -1
  211. package/dist/redux/api/moduleApi.js +33 -3
  212. package/dist/redux/api/moduleApi.js.map +1 -1
  213. package/dist/redux/api/moduleApi.ts +17 -2
  214. package/dist/redux/api/solidChatterMessageApi.d.ts +3 -1
  215. package/dist/redux/api/solidChatterMessageApi.d.ts.map +1 -1
  216. package/dist/redux/api/solidChatterMessageApi.js +9 -1
  217. package/dist/redux/api/solidChatterMessageApi.js.map +1 -1
  218. package/dist/redux/api/solidChatterMessageApi.ts +9 -1
  219. package/dist/redux/store/defaultStoreConfig.d.ts +9 -1
  220. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  221. package/dist/resources/globals.css +30 -0
  222. package/dist/resources/solid-custom.css +10 -6
  223. package/dist/resources/solid-tailwind-generated.css +1 -1
  224. package/dist/routes/AppEventListener.js +1 -1
  225. package/dist/routes/AppEventListener.js.map +1 -1
  226. package/dist/routes/AppEventListener.tsx +1 -1
  227. package/dist/routes/pages/admin/core/AgentPersonaHistory.css +130 -0
  228. package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts +7 -0
  229. package/dist/routes/pages/admin/core/AgentPersonaHistory.d.ts.map +1 -0
  230. package/dist/routes/pages/admin/core/AgentPersonaHistory.js +228 -0
  231. package/dist/routes/pages/admin/core/AgentPersonaHistory.js.map +1 -0
  232. package/dist/routes/pages/admin/core/AgentPersonaHistory.tsx +234 -0
  233. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +6 -14
  234. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
  235. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +186 -146
  236. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
  237. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +170 -118
  238. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts +2 -0
  239. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -0
  240. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +108 -0
  241. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -0
  242. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +96 -0
  243. package/dist/routes/solidRoutes.d.ts.map +1 -1
  244. package/dist/routes/solidRoutes.js +2 -0
  245. package/dist/routes/solidRoutes.js.map +1 -1
  246. package/dist/routes/solidRoutes.tsx +2 -0
  247. package/dist/types/extension-registry.d.ts +12 -0
  248. package/dist/types/extension-registry.d.ts.map +1 -1
  249. package/dist/types/extension-registry.js.map +1 -1
  250. package/dist/types/extension-registry.ts +15 -0
  251. package/dist/types/solid-core.d.ts +2 -0
  252. package/package.json +2 -1
@@ -56,8 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
58
58
  import React from "react";
59
- import { createPortal } from "react-dom";
60
- import { ArrowLeft, ChevronDown, Ellipsis, ExternalLink, Eye, FlaskConical, Pencil, Plus, RefreshCw, Trash2 } from "lucide-react";
59
+ import { ArrowLeft, Ellipsis, ExternalLink, Eye, FlaskConical, Pencil, Plus, RefreshCw, Trash2 } from "lucide-react";
61
60
  import { useDispatch } from "react-redux";
62
61
  import { useNavigate, useParams } from "react-router-dom";
63
62
  import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
@@ -65,13 +64,14 @@ import { useGetSolidSettingsQuery } from "../../../../redux/api/solidSettingsApi
65
64
  import { getSettingsMap } from "../../../../helpers/settingsPayload";
66
65
  import { showToast } from "../../../../redux/features/toastSlice";
67
66
  import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
67
+ import { AgentPersonaHistory } from "./AgentPersonaHistory";
68
68
  import { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload } from "./AgentHubTagsField";
69
69
  import { AgentResourceCardWidget } from "../../../../components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget";
70
70
  import { AgentSessionsPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel";
71
71
  import { AgentProcessesPanel } from "../../../../components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel";
72
72
  import { SolidWorkflowStatusPill } from "../../../../components/core/form/SolidDraftPublishWorkflow";
73
- import { ALLOWED_MODELS_BY_PROVIDER } from "../../../../constants/allowed-ai-models";
74
- import { SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidDropdownMenu, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuTrigger, SolidIconPicker, SolidInput, SolidTabGroup } from "../../../../components/shad-cn-ui";
73
+ import { getModelsDevModels, useModelsDevCatalog } from "../../../../hooks/useModelsDevModels";
74
+ import { SolidAutocomplete, SolidButton, SolidCodeEditor, SolidDialog, SolidDialogBody, SolidDropdownMenu, SolidDropdownMenuContent, SolidDropdownMenuItem, SolidDropdownMenuTrigger, SolidIconPicker, SolidInput, SolidTabGroup } from "../../../../components/shad-cn-ui";
75
75
  import { SolidAgentEmbedded } from "../../../../components/core/solid-agent/SolidAgentEmbedded";
76
76
  import { SolidAgentMarkdown } from "../../../../components/core/solid-agent/SolidAgentMarkdown";
77
77
  import { AgentEmbeddingPanel } from "../../../../components/core/solid-agent/embed/AgentEmbeddingPanel";
@@ -81,85 +81,76 @@ var PROVIDER_LABELS = {
81
81
  openai: "OpenAI",
82
82
  openrouter: "OpenRouter",
83
83
  };
84
- function ModelPicker(_a) {
85
- var value = _a.value, options = _a.options, placeholder = _a.placeholder, onChange = _a.onChange;
86
- var rootRef = React.useRef(null);
87
- var menuRef = React.useRef(null);
88
- var _b = React.useState(false), open = _b[0], setOpen = _b[1];
89
- var _c = React.useState(""), query = _c[0], setQuery = _c[1];
90
- var _d = React.useState(0), activeIndex = _d[0], setActiveIndex = _d[1];
91
- var _e = React.useState({}), menuStyle = _e[0], setMenuStyle = _e[1];
92
- var selected = options.find(function (option) { return option.value === value; });
93
- var filtered = options.filter(function (option) {
94
- return "".concat(PROVIDER_LABELS[option.provider], " ").concat(option.model).toLowerCase().includes(query.trim().toLowerCase());
84
+ var BUILT_IN_PROVIDER_TYPES = ["openai", "anthropic"];
85
+ /**
86
+ * Build picker options from the AI settings: every provider with an API key, its models from
87
+ * models.dev, plus the models chosen in settings and any already-saved values for this agent.
88
+ */
89
+ function buildModelOptions(providers, settingsModels, catalog, savedValues) {
90
+ var enabled = Object.entries(providers)
91
+ .filter(function (_a) {
92
+ var entry = _a[1];
93
+ return typeof (entry === null || entry === void 0 ? void 0 : entry.apiKey) === "string" && entry.apiKey.trim().length > 0;
95
94
  });
96
- var groups = Object.keys(ALLOWED_MODELS_BY_PROVIDER)
97
- .map(function (provider) { return ({ provider: provider, options: filtered.filter(function (option) { return option.provider === provider; }) }); })
98
- .filter(function (group) { return group.options.length > 0; });
99
- React.useEffect(function () {
100
- if (!open)
95
+ var options = [];
96
+ var seen = new Set();
97
+ var add = function (provider, model, note) {
98
+ var _a;
99
+ var value = "".concat(provider, ":").concat(model);
100
+ if (!model || seen.has(value))
101
101
  return;
102
- var positionMenu = function () {
103
- var _a;
104
- var bounds = (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
105
- if (!bounds)
106
- return;
107
- var gap = 6;
108
- var maxMenuHeight = Math.min(288, window.innerHeight - 24);
109
- var spaceBelow = window.innerHeight - bounds.bottom - gap - 12;
110
- var spaceAbove = bounds.top - gap - 12;
111
- var openAbove = spaceBelow < Math.min(220, maxMenuHeight) && spaceAbove > spaceBelow;
112
- var availableHeight = Math.max(120, Math.min(maxMenuHeight, openAbove ? spaceAbove : spaceBelow));
113
- setMenuStyle(__assign({ position: "fixed", left: bounds.left, width: bounds.width, maxHeight: availableHeight }, (openAbove
114
- ? { bottom: window.innerHeight - bounds.top + gap }
115
- : { top: bounds.bottom + gap })));
116
- };
117
- positionMenu();
118
- window.addEventListener("resize", positionMenu);
119
- window.addEventListener("scroll", positionMenu, true);
120
- var handleOutsideClick = function (event) {
121
- var _a, _b;
122
- var target = event.target;
123
- if (!((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) && !((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(target)))
124
- setOpen(false);
125
- };
126
- document.addEventListener("mousedown", handleOutsideClick);
127
- return function () {
128
- window.removeEventListener("resize", positionMenu);
129
- window.removeEventListener("scroll", positionMenu, true);
130
- document.removeEventListener("mousedown", handleOutsideClick);
131
- };
132
- }, [open]);
133
- var choose = function (option) {
134
- onChange(option.value);
135
- setQuery("");
136
- setOpen(false);
102
+ seen.add(value);
103
+ options.push({ provider: provider, providerLabel: (_a = PROVIDER_LABELS[provider]) !== null && _a !== void 0 ? _a : provider, model: model, value: value, note: note });
137
104
  };
138
- var flatIndex = -1;
139
- return _jsxs("div", { className: "agent-editor__model-picker", ref: rootRef, children: [_jsxs("div", { className: "agent-editor__model-control", children: [_jsx("input", { role: "combobox", "aria-expanded": open, "aria-autocomplete": "list", "aria-label": placeholder, placeholder: selected ? "".concat(PROVIDER_LABELS[selected.provider], " / ").concat(selected.model) : value || placeholder, value: open ? query : "", onFocus: function () { setQuery(""); setActiveIndex(0); setOpen(true); }, onChange: function (event) { setQuery(event.target.value); setActiveIndex(0); setOpen(true); }, onKeyDown: function (event) {
140
- if (event.key === "Escape") {
141
- setOpen(false);
142
- setQuery("");
143
- }
144
- if (event.key === "ArrowDown") {
145
- event.preventDefault();
146
- setOpen(true);
147
- setActiveIndex(function (index) { return Math.min(index + 1, filtered.length - 1); });
148
- }
149
- if (event.key === "ArrowUp") {
150
- event.preventDefault();
151
- setActiveIndex(function (index) { return Math.max(index - 1, 0); });
152
- }
153
- if (event.key === "Enter" && open && filtered[activeIndex]) {
154
- event.preventDefault();
155
- choose(filtered[activeIndex]);
156
- }
157
- } }), _jsx("button", { type: "button", "aria-label": open ? "Close model options" : "Show model options", onMouseDown: function (event) { return event.preventDefault(); }, onClick: function () { setOpen(function (current) { return !current; }); setQuery(""); }, children: _jsx(ChevronDown, { size: 16 }) })] }), open && createPortal(_jsx("div", { ref: menuRef, className: "agent-editor__model-menu", style: menuStyle, role: "listbox", children: !groups.length ? _jsx("div", { className: "agent-editor__model-empty", children: options.length ? "No matching models." : "No enabled providers. Add an API key in AI Settings." })
158
- : groups.map(function (group) { return _jsxs("section", { className: "agent-editor__model-group", children: [_jsx("h3", { children: PROVIDER_LABELS[group.provider] }), group.options.map(function (option) {
159
- flatIndex += 1;
160
- var index = flatIndex;
161
- return _jsxs("button", { type: "button", role: "option", "aria-selected": option.value === value, className: "agent-editor__model-option".concat(index === activeIndex ? " is-active" : ""), onMouseDown: function (event) { return event.preventDefault(); }, onMouseEnter: function () { return setActiveIndex(index); }, onClick: function () { return choose(option); }, children: [_jsx("span", { children: option.model }), _jsxs("small", { children: [option.provider, ":", option.model] })] }, option.value);
162
- })] }, group.provider); }) }), document.body)] });
105
+ for (var _i = 0, enabled_1 = enabled; _i < enabled_1.length; _i++) {
106
+ var _a = enabled_1[_i], provider = _a[0], entry = _a[1];
107
+ for (var _b = 0, _c = Object.entries(settingsModels); _b < _c.length; _b++) {
108
+ var _d = _c[_b], role = _d[0], config = _d[1];
109
+ if ((config === null || config === void 0 ? void 0 : config.providerId) === provider && config.model)
110
+ add(provider, config.model, "".concat(role, " model in AI settings"));
111
+ }
112
+ for (var _e = 0, savedValues_1 = savedValues; _e < savedValues_1.length; _e++) {
113
+ var value = savedValues_1[_e];
114
+ if (value.startsWith("".concat(provider, ":")))
115
+ add(provider, value.slice(provider.length + 1), "currently saved");
116
+ }
117
+ var type = entry.type && BUILT_IN_PROVIDER_TYPES.includes(entry.type) ? entry.type : undefined;
118
+ for (var _f = 0, _g = getModelsDevModels(catalog, [provider, type]); _f < _g.length; _f++) {
119
+ var model = _g[_f];
120
+ add(provider, model.id);
121
+ }
122
+ }
123
+ return options;
124
+ }
125
+ var OTHER_MODEL = "__other_model__";
126
+ function SearchableSelect(_a) {
127
+ var _b;
128
+ var value = _a.value, options = _a.options, placeholder = _a.placeholder, disabled = _a.disabled, onChange = _a.onChange;
129
+ var _c = React.useState(""), query = _c[0], setQuery = _c[1];
130
+ var selectedLabel = (_b = options.find(function (option) { return option.value === value; })) === null || _b === void 0 ? void 0 : _b.label;
131
+ var selected = React.useMemo(function () { return selectedLabel ? { label: selectedLabel, value: value } : null; }, [selectedLabel, value]);
132
+ var suggestions = options.filter(function (option) {
133
+ return "".concat(option.label, " ").concat(option.value).toLowerCase().includes(query.trim().toLowerCase());
134
+ });
135
+ return _jsx(SolidAutocomplete, { className: "solid-standard-autocomplete w-full", value: selected, suggestions: suggestions, completeMethod: function (_a) {
136
+ var next = _a.query;
137
+ return setQuery(next);
138
+ }, onChange: function (event) { var _a, _b; return onChange((_b = (_a = event.value) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""); }, field: "label", placeholder: placeholder, disabled: disabled, dropdown: true, forceSelection: true, portal: true });
139
+ }
140
+ function ModelPicker(_a) {
141
+ var _b, _c;
142
+ var value = _a.value, options = _a.options, providers = _a.providers, providerConfig = _a.providerConfig, onChange = _a.onChange;
143
+ var separator = value.indexOf(":");
144
+ var provider = separator < 0 ? "" : value.slice(0, separator);
145
+ var model = separator < 0 ? "" : value.slice(separator + 1);
146
+ var availableModels = options.filter(function (option) { return option.provider === provider; });
147
+ var _d = React.useState(false), otherSelected = _d[0], setOtherSelected = _d[1];
148
+ var showOther = !!provider && (otherSelected || (!!model && !availableModels.some(function (option) { return option.model === model; })));
149
+ return _jsxs("div", { className: "agent-editor__stack", children: [_jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Provider *" }), _jsx(SearchableSelect, { value: provider, options: providers, placeholder: "Select provider", onChange: function (next) { setOtherSelected(false); onChange("".concat(next, ":")); } }), ((_b = providerConfig[provider]) === null || _b === void 0 ? void 0 : _b.type) === "bedrock" && ((_c = providerConfig[provider]) === null || _c === void 0 ? void 0 : _c.region) &&
150
+ _jsx("small", { children: _jsxs("em", { children: ["Region: ", providerConfig[provider].region] }) })] }), _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Model *" }), _jsx(SearchableSelect, { value: showOther ? OTHER_MODEL : model, options: __spreadArray(__spreadArray([], availableModels.map(function (option) { return ({ label: option.model, value: option.model }); }), true), [{ label: "Other", value: OTHER_MODEL }], false), placeholder: "Select model", disabled: !provider, onChange: function (next) {
151
+ setOtherSelected(next === OTHER_MODEL);
152
+ onChange("".concat(provider, ":").concat(next === OTHER_MODEL ? "" : next));
153
+ } }), showOther && _jsx(SolidInput, { className: "w-full", "aria-label": "Custom model ID", placeholder: "Enter model ID", value: model, onChange: function (event) { return onChange("".concat(provider, ":").concat(event.target.value)); } })] })] });
163
154
  }
164
155
  var entityApi = createSolidEntityApi("agentRegistry");
165
156
  var skillApi = createSolidEntityApi("agentSkillRegistry");
@@ -244,27 +235,55 @@ function parseInputs(value) {
244
235
  var parsed = typeof value === "string" ? JSON.parse(value) : value;
245
236
  if (Array.isArray(parsed))
246
237
  return parsed.map(function (input) {
247
- var _a, _b, _c, _d, _e;
238
+ var _a, _b, _c, _d, _e, _f;
248
239
  return ({
249
240
  name: String((_b = (_a = input.name) !== null && _a !== void 0 ? _a : input.variableName) !== null && _b !== void 0 ? _b : ""), description: String((_c = input.description) !== null && _c !== void 0 ? _c : ""),
250
- dataType: String((_e = (_d = input.dataType) !== null && _d !== void 0 ? _d : input.type) !== null && _e !== void 0 ? _e : "string"),
241
+ dataType: String((_e = (_d = input.dataType) !== null && _d !== void 0 ? _d : input.type) !== null && _e !== void 0 ? _e : "string"), defaultValue: (_f = input.defaultValue) !== null && _f !== void 0 ? _f : null,
242
+ optional: input.optional === true,
251
243
  });
252
244
  });
253
245
  // Existing agent definitions may use a name-keyed object.
254
246
  if (parsed && typeof parsed === "object")
255
247
  return Object.entries(parsed).map(function (_a) {
256
- var _b, _c, _d;
248
+ var _b, _c, _d, _e;
257
249
  var name = _a[0], definition = _a[1];
258
250
  return ({
259
251
  name: name,
260
252
  description: String((_b = definition === null || definition === void 0 ? void 0 : definition.description) !== null && _b !== void 0 ? _b : ""),
261
- dataType: String((_d = (_c = definition === null || definition === void 0 ? void 0 : definition.dataType) !== null && _c !== void 0 ? _c : definition === null || definition === void 0 ? void 0 : definition.type) !== null && _d !== void 0 ? _d : "string"),
253
+ dataType: String((_d = (_c = definition === null || definition === void 0 ? void 0 : definition.dataType) !== null && _c !== void 0 ? _c : definition === null || definition === void 0 ? void 0 : definition.type) !== null && _d !== void 0 ? _d : "string"), defaultValue: (_e = definition === null || definition === void 0 ? void 0 : definition.defaultValue) !== null && _e !== void 0 ? _e : null,
254
+ optional: (definition === null || definition === void 0 ? void 0 : definition.optional) === true,
262
255
  });
263
256
  });
264
257
  }
265
258
  catch ( /* Keep malformed historical values from crashing the editor. */_a) { /* Keep malformed historical values from crashing the editor. */ }
266
259
  return [];
267
260
  }
261
+ function parseDefaultValue(raw, dataType) {
262
+ if (dataType === "string" || dataType === "date" || dataType === "datetime")
263
+ return raw;
264
+ if (dataType === "boolean") {
265
+ if (raw !== "true" && raw !== "false")
266
+ throw new Error("Default value must be true or false for ".concat(dataType, "."));
267
+ return raw === "true";
268
+ }
269
+ if (dataType === "number" || dataType === "integer") {
270
+ var value_1 = Number(raw);
271
+ if (!Number.isFinite(value_1) || (dataType === "integer" && !Number.isSafeInteger(value_1)))
272
+ throw new Error("Default value must be a valid ".concat(dataType, "."));
273
+ return value_1;
274
+ }
275
+ var value = JSON.parse(raw);
276
+ if (dataType === "array" && !Array.isArray(value))
277
+ throw new Error("Default value must be a JSON array.");
278
+ if (dataType === "object" && (!value || typeof value !== "object" || Array.isArray(value)))
279
+ throw new Error("Default value must be a JSON object.");
280
+ return value;
281
+ }
282
+ function formatDefaultValue(value) {
283
+ if (value == null)
284
+ return "";
285
+ return typeof value === "string" ? value : JSON.stringify(value);
286
+ }
268
287
  function apiError(error) {
269
288
  var _a, _b, _c, _d, _e;
270
289
  var value = (_e = (_c = (_b = (_a = error === null || error === void 0 ? void 0 : error.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : (_d = error === null || error === void 0 ? void 0 : error.data) === null || _d === void 0 ? void 0 : _d.message) !== null && _e !== void 0 ? _e : error === null || error === void 0 ? void 0 : error.message;
@@ -294,12 +313,13 @@ function LinkPicker(_a) {
294
313
  var label = _a.label, description = _a.description, options = _a.options, selected = _a.selected, onAdd = _a.onAdd, onRemove = _a.onRemove, createUrl = _a.createUrl, render = _a.render, renderSettings = _a.renderSettings, linkFor = _a.linkFor, onView = _a.onView, editUrlFor = _a.editUrlFor;
295
314
  var _b = React.useState(""), search = _b[0], setSearch = _b[1];
296
315
  var _c = React.useState(false), open = _c[0], setOpen = _c[1];
316
+ var showAssociatedCount = label === "Skills" || label === "Tools";
297
317
  var available = options.filter(function (item) {
298
318
  var _a, _b, _c, _d;
299
319
  return !selected.some(function (selectedItem) { return selectedItem.id === item.id; })
300
320
  && "".concat((_c = (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key) !== null && _c !== void 0 ? _c : "", " ").concat((_d = item.description) !== null && _d !== void 0 ? _d : "").toLowerCase().includes(search.toLowerCase());
301
321
  }).slice(0, 20);
302
- return _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: label }), _jsx("p", { children: description })] }), createUrl && _jsxs("a", { href: createUrl, target: "_blank", rel: "noopener noreferrer", className: "agent-editor__new-link", children: ["Create ", label === "Skills" ? "skill" : "tool", " ", _jsx(ExternalLink, { size: 14 })] })] }), _jsxs("div", { className: "agent-editor__picker", children: [_jsx(SolidInput, { value: search, placeholder: "Search and add ".concat(label.toLowerCase(), "\u2026"), "aria-label": "Search ".concat(label.toLowerCase()), onFocus: function () { return setOpen(true); }, onChange: function (event) { setSearch(event.target.value); setOpen(true); } }), open && _jsx("div", { className: "agent-editor__picker-results", children: available.length ? available.map(function (item) {
322
+ return _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: label }), _jsx("p", { children: description })] }), createUrl && _jsxs("a", { href: createUrl, target: "_blank", rel: "noopener noreferrer", className: "agent-editor__new-link", children: ["Create ", label === "Skills" ? "skill" : "tool", " ", _jsx(ExternalLink, { size: 14 })] })] }), showAssociatedCount && _jsxs("div", { className: "agent-editor__linked-count", role: "status", children: [selected.length, " ", label.toLowerCase(), " associated"] }), _jsxs("div", { className: "agent-editor__picker", children: [_jsx(SolidInput, { value: search, placeholder: "Search and add ".concat(label.toLowerCase(), "\u2026"), "aria-label": "Search ".concat(label.toLowerCase()), onFocus: function () { return setOpen(true); }, onChange: function (event) { setSearch(event.target.value); setOpen(true); } }), open && _jsx("div", { className: "agent-editor__picker-results", children: available.length ? available.map(function (item) {
303
323
  var _a, _b;
304
324
  return _jsxs("button", { type: "button", onClick: function () { onAdd(item.id); setSearch(""); setOpen(false); }, children: [_jsx("strong", { children: (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.displayName) !== null && _b !== void 0 ? _b : item.key }), _jsx("span", { children: item.description })] }, item.id);
305
325
  }) : _jsxs("p", { children: ["No available ", label.toLowerCase(), " found."] }) })] }), selected.length ? _jsx("div", { className: "agent-editor__cards", children: selected.map(function (item) {
@@ -309,8 +329,8 @@ function LinkPicker(_a) {
309
329
  }
310
330
  export function AgentRegistryEditorPage() {
311
331
  var _this = this;
312
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
313
- var _l = useParams().id, id = _l === void 0 ? "new" : _l;
332
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
333
+ var _t = useParams().id, id = _t === void 0 ? "new" : _t;
314
334
  var navigate = useNavigate();
315
335
  var dispatch = useDispatch();
316
336
  var agentResult = entityApi.useGetSolidEntityByIdQuery({ id: id, qs: detailQuery }, { skip: id === "new" });
@@ -325,13 +345,13 @@ export function AgentRegistryEditorPage() {
325
345
  return undefined;
326
346
  return __assign(__assign({}, agent), { agentSkills: resourceLinksFrom(skillLinks.currentData, "agentSkills", "agentSkillRegistry", "alwaysInclude", skillFields), agentTools: resourceLinksFrom(toolLinks.currentData, "agentTools", "agentToolRegistry", "requiresApproval", toolFields) });
327
347
  }, [agentResult.currentData, skillLinks.currentData, toolLinks.currentData]);
328
- var _m = useGetSolidSettingsQuery(undefined), settings = _m.data, settingsError = _m.isError;
348
+ var _u = useGetSolidSettingsQuery(undefined), settings = _u.data, settingsError = _u.isError;
329
349
  var skills = useCatalog(skillApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(skillFields)));
330
350
  var tools = useCatalog(toolApi, "offset=0&limit=1000&populate[0]=tags&".concat(fieldsQuery(toolFields)));
331
351
  var roles = useCatalog(roleApi, "offset=0&limit=1000&populate[0]=module");
332
352
  var secrets = useCatalog(secretApi, "offset=0&limit=1000&fields[0]=id&fields[1]=key&fields[2]=displayName&fields[3]=description");
333
- var _o = entityApi.useCreateSolidEntityMutation(), createAgent = _o[0], creating = _o[1].isLoading;
334
- var _p = entityApi.useUpdateSolidEntityMutation(), updateAgent = _p[0], updating = _p[1].isLoading;
353
+ var _v = entityApi.useCreateSolidEntityMutation(), createAgent = _v[0], creating = _v[1].isLoading;
354
+ var _w = entityApi.useUpdateSolidEntityMutation(), updateAgent = _w[0], updating = _w[1].isLoading;
335
355
  var createSkillLink = agentSkillApi.useCreateSolidEntityMutation()[0];
336
356
  var deleteSkillLink = agentSkillApi.useDeleteSolidEntityMutation()[0];
337
357
  var updateSkillLink = agentSkillApi.useUpdateSolidEntityMutation()[0];
@@ -344,7 +364,7 @@ export function AgentRegistryEditorPage() {
344
364
  var deleteSecretLink = agentSecretApi.useDeleteSolidEntityMutation()[0];
345
365
  var updateSecretLink = agentSecretApi.useUpdateSolidEntityMutation()[0];
346
366
  var record = recordFrom(response);
347
- var _q = React.useState("basics"), tab = _q[0], setTab = _q[1];
367
+ var _x = React.useState("basics"), tab = _x[0], setTab = _x[1];
348
368
  var jobs = jobApi.useGetSolidEntitiesQuery("offset=0&limit=1000&filters[agent][id][$eq]=".concat(encodeURIComponent(id), "&").concat(fieldsQuery(["id", "status"])), { skip: id === "new" || tab !== "jobs" });
349
369
  var refetch = function () {
350
370
  void agentResult.refetch();
@@ -353,35 +373,35 @@ export function AgentRegistryEditorPage() {
353
373
  if (tab === "jobs")
354
374
  void jobs.refetch();
355
375
  };
356
- var _r = React.useState(false), testAgentOpen = _r[0], setTestAgentOpen = _r[1];
357
- var _s = React.useState(null), preview = _s[0], setPreview = _s[1];
358
- var _t = React.useState("maximized"), testAgentWindowMode = _t[0], setTestAgentWindowMode = _t[1];
359
- var _u = React.useState(""), name = _u[0], setName = _u[1];
360
- var _v = React.useState(""), title = _v[0], setTitle = _v[1];
361
- var _w = React.useState(""), description = _w[0], setDescription = _w[1];
362
- var _x = React.useState(""), iconName = _x[0], setIconName = _x[1];
363
- var _y = React.useState([]), inputs = _y[0], setInputs = _y[1];
364
- var _z = React.useState(""), reasoningModelKey = _z[0], setReasoningModelKey = _z[1];
365
- var _0 = React.useState(""), fastModelKey = _0[0], setFastModelKey = _0[1];
366
- var _1 = React.useState(""), systemPrompt = _1[0], setSystemPrompt = _1[1];
367
- var _2 = React.useState(100), stepLimit = _2[0], setStepLimit = _2[1];
368
- var _3 = React.useState(20), turnStepLimit = _3[0], setTurnStepLimit = _3[1];
369
- var _4 = React.useState(3), costLimit = _4[0], setCostLimit = _4[1];
370
- var _5 = React.useState([]), tags = _5[0], setTags = _5[1];
371
- var _6 = React.useState(false), creatingTag = _6[0], setCreatingTag = _6[1];
372
- var _7 = React.useState([]), skillIds = _7[0], setSkillIds = _7[1];
373
- var _8 = React.useState([]), toolIds = _8[0], setToolIds = _8[1];
374
- var _9 = React.useState([]), roleIds = _9[0], setRoleIds = _9[1];
375
- var _10 = React.useState([]), secretIds = _10[0], setSecretIds = _10[1];
376
- var _11 = React.useState({}), alwaysIncludeValues = _11[0], setAlwaysIncludeValues = _11[1];
377
- var _12 = React.useState({}), requiresApprovalValues = _12[0], setRequiresApprovalValues = _12[1];
378
- var _13 = React.useState({}), secretEnvVarNames = _13[0], setSecretEnvVarNames = _13[1];
379
- var _14 = React.useState(null), pendingSecret = _14[0], setPendingSecret = _14[1];
380
- var _15 = React.useState(""), secretEnvVarDraft = _15[0], setSecretEnvVarDraft = _15[1];
381
- var _16 = React.useState(""), secretEnvVarError = _16[0], setSecretEnvVarError = _16[1];
382
- var _17 = React.useState({}), errors = _17[0], setErrors = _17[1];
383
- var _18 = React.useState(0), auditVersion = _18[0], setAuditVersion = _18[1];
384
- var _19 = React.useState(false), confirmRefresh = _19[0], setConfirmRefresh = _19[1];
376
+ var _y = React.useState(false), testAgentOpen = _y[0], setTestAgentOpen = _y[1];
377
+ var _z = React.useState(null), preview = _z[0], setPreview = _z[1];
378
+ var _0 = React.useState("maximized"), testAgentWindowMode = _0[0], setTestAgentWindowMode = _0[1];
379
+ var _1 = React.useState(""), name = _1[0], setName = _1[1];
380
+ var _2 = React.useState(""), title = _2[0], setTitle = _2[1];
381
+ var _3 = React.useState(""), description = _3[0], setDescription = _3[1];
382
+ var _4 = React.useState(""), iconName = _4[0], setIconName = _4[1];
383
+ var _5 = React.useState([]), inputs = _5[0], setInputs = _5[1];
384
+ var _6 = React.useState(""), reasoningModelKey = _6[0], setReasoningModelKey = _6[1];
385
+ var _7 = React.useState(""), fastModelKey = _7[0], setFastModelKey = _7[1];
386
+ var _8 = React.useState(""), systemPrompt = _8[0], setSystemPrompt = _8[1];
387
+ var _9 = React.useState(100), stepLimit = _9[0], setStepLimit = _9[1];
388
+ var _10 = React.useState(20), turnStepLimit = _10[0], setTurnStepLimit = _10[1];
389
+ var _11 = React.useState(3), costLimit = _11[0], setCostLimit = _11[1];
390
+ var _12 = React.useState([]), tags = _12[0], setTags = _12[1];
391
+ var _13 = React.useState(false), creatingTag = _13[0], setCreatingTag = _13[1];
392
+ var _14 = React.useState([]), skillIds = _14[0], setSkillIds = _14[1];
393
+ var _15 = React.useState([]), toolIds = _15[0], setToolIds = _15[1];
394
+ var _16 = React.useState([]), roleIds = _16[0], setRoleIds = _16[1];
395
+ var _17 = React.useState([]), secretIds = _17[0], setSecretIds = _17[1];
396
+ var _18 = React.useState({}), alwaysIncludeValues = _18[0], setAlwaysIncludeValues = _18[1];
397
+ var _19 = React.useState({}), requiresApprovalValues = _19[0], setRequiresApprovalValues = _19[1];
398
+ var _20 = React.useState({}), secretEnvVarNames = _20[0], setSecretEnvVarNames = _20[1];
399
+ var _21 = React.useState(null), pendingSecret = _21[0], setPendingSecret = _21[1];
400
+ var _22 = React.useState(""), secretEnvVarDraft = _22[0], setSecretEnvVarDraft = _22[1];
401
+ var _23 = React.useState(""), secretEnvVarError = _23[0], setSecretEnvVarError = _23[1];
402
+ var _24 = React.useState({}), errors = _24[0], setErrors = _24[1];
403
+ var _25 = React.useState(0), auditVersion = _25[0], setAuditVersion = _25[1];
404
+ var _26 = React.useState(false), confirmRefresh = _26[0], setConfirmRefresh = _26[1];
385
405
  var baseline = React.useRef("");
386
406
  var currentForm = function () { return JSON.stringify({ name: name, title: title, description: description, iconName: iconName, inputs: inputs, reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit), tags: tags, skillIds: skillIds, toolIds: toolIds, roleIds: roleIds, secretIds: secretIds, alwaysIncludeValues: alwaysIncludeValues, requiresApprovalValues: requiresApprovalValues, secretEnvVarNames: secretEnvVarNames }); };
387
407
  React.useEffect(function () {
@@ -430,19 +450,29 @@ export function AgentRegistryEditorPage() {
430
450
  return function () { return window.removeEventListener("focus", refresh); };
431
451
  }, [skills.refetch, tools.refetch]);
432
452
  var configValue = getSettingsMap(settings).solidXGenAiCodeBuilderConfig;
433
- var enabledProviders = {};
453
+ var aiConfig = {};
434
454
  try {
435
- var config = typeof configValue === "string" ? JSON.parse(configValue) : configValue;
436
- enabledProviders = (_a = config === null || config === void 0 ? void 0 : config.providers) !== null && _a !== void 0 ? _a : {};
455
+ aiConfig = (_a = (typeof configValue === "string" ? JSON.parse(configValue) : configValue)) !== null && _a !== void 0 ? _a : {};
437
456
  }
438
- catch ( /* Invalid configuration has no enabled providers. */_20) { /* Invalid configuration has no enabled providers. */ }
439
- var modelOptions = Object.keys(ALLOWED_MODELS_BY_PROVIDER)
440
- .filter(function (provider) { var _a; return typeof ((_a = enabledProviders[provider]) === null || _a === void 0 ? void 0 : _a.apiKey) === "string" && enabledProviders[provider].apiKey.trim().length > 0; })
441
- .flatMap(function (provider) { return ALLOWED_MODELS_BY_PROVIDER[provider].map(function (model) { return ({
442
- provider: provider,
443
- model: model,
444
- value: "".concat(provider, ":").concat(model),
445
- }); }); });
457
+ catch ( /* Invalid configuration has no enabled providers. */_27) { /* Invalid configuration has no enabled providers. */ }
458
+ var modelsCatalog = useModelsDevCatalog().catalog;
459
+ var savedModelKeys = [record === null || record === void 0 ? void 0 : record.reasoningModelKey, record === null || record === void 0 ? void 0 : record.fastModelKey].filter(function (key) { return !!key; });
460
+ var modelOptions = buildModelOptions((_b = aiConfig.providers) !== null && _b !== void 0 ? _b : {}, { Reasoning: (_d = (_c = aiConfig.models) === null || _c === void 0 ? void 0 : _c.default) !== null && _d !== void 0 ? _d : (_e = aiConfig.models) === null || _e === void 0 ? void 0 : _e.main, Fast: (_f = aiConfig.models) === null || _f === void 0 ? void 0 : _f.fast }, modelsCatalog, savedModelKeys);
461
+ var providerOptions = Object.entries((_g = aiConfig.providers) !== null && _g !== void 0 ? _g : {})
462
+ .filter(function (_a) {
463
+ var entry = _a[1];
464
+ return typeof (entry === null || entry === void 0 ? void 0 : entry.apiKey) === "string" && entry.apiKey.trim().length > 0;
465
+ })
466
+ .map(function (_a) {
467
+ var _b, _c, _d;
468
+ var provider = _a[0];
469
+ return ({ label: (_d = (_c = (_b = modelsCatalog === null || modelsCatalog === void 0 ? void 0 : modelsCatalog[provider]) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : PROVIDER_LABELS[provider]) !== null && _d !== void 0 ? _d : provider, value: provider });
470
+ });
471
+ var isValidModelKey = function (value) {
472
+ var separator = value.indexOf(":");
473
+ return separator > 0 && providerOptions.some(function (provider) { return provider.value === value.slice(0, separator); }) &&
474
+ !!value.slice(separator + 1).trim();
475
+ };
446
476
  var toggle = function (setter, value) {
447
477
  return setter(function (current) { return current.includes(value) ? current.filter(function (id) { return id !== value; }) : __spreadArray(__spreadArray([], current, true), [value], false); });
448
478
  };
@@ -514,7 +544,7 @@ export function AgentRegistryEditorPage() {
514
544
  });
515
545
  };
516
546
  var save = function (nextStatus) { return __awaiter(_this, void 0, void 0, function () {
517
- var next, payload, newlyCreatedId, scalarSaved, result, _a, savedId, error_1;
547
+ var next, normalizedInputs, payload, newlyCreatedId, scalarSaved, result, _a, savedId, error_1;
518
548
  var _b, _c, _d;
519
549
  return __generator(this, function (_e) {
520
550
  switch (_e.label) {
@@ -528,9 +558,9 @@ export function AgentRegistryEditorPage() {
528
558
  next.title = "Title is required.";
529
559
  if (!systemPrompt.trim())
530
560
  next.systemPrompt = "Persona instructions are required.";
531
- if (!modelOptions.some(function (option) { return option.value === reasoningModelKey; }))
561
+ if (!isValidModelKey(reasoningModelKey))
532
562
  next.reasoningModelKey = "Choose an enabled reasoning provider and model.";
533
- if (!modelOptions.some(function (option) { return option.value === fastModelKey; }))
563
+ if (!isValidModelKey(fastModelKey))
534
564
  next.fastModelKey = "Choose an enabled fast provider and model.";
535
565
  if (inputs.some(function (input) { return !input.name.trim() || !input.dataType; }))
536
566
  next.inputs = "Each input needs a name and data type.";
@@ -544,7 +574,16 @@ export function AgentRegistryEditorPage() {
544
574
  dispatch(showToast({ severity: "error", summary: "Missing information", detail: Object.values(next).join(" ") }));
545
575
  return [2 /*return*/];
546
576
  }
547
- payload = __assign(__assign({ name: name.trim(), title: title.trim(), description: description.trim(), iconName: iconName, requiredInputs: JSON.stringify(inputs.map(function (input) { return (__assign(__assign({}, input), { name: input.name.trim(), description: input.description.trim() })); })), reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit) }, agentHubTagsPayload(tags)), { status: (_b = nextStatus !== null && nextStatus !== void 0 ? nextStatus : record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft" });
577
+ try {
578
+ normalizedInputs = inputs.map(function (input) { return (__assign(__assign({}, input), { name: input.name.trim(), description: input.description.trim(), defaultValue: input.defaultValue === "" || input.defaultValue == null ? null : parseDefaultValue(String(input.defaultValue), input.dataType) })); });
579
+ }
580
+ catch (error) {
581
+ next.inputs = error instanceof Error ? error.message : "Check the default input values.";
582
+ setErrors(next);
583
+ setTab("basics");
584
+ return [2 /*return*/];
585
+ }
586
+ payload = __assign(__assign({ name: name.trim(), title: title.trim(), description: description.trim(), iconName: iconName, requiredInputs: JSON.stringify(normalizedInputs), reasoningModelKey: reasoningModelKey, fastModelKey: fastModelKey, systemPrompt: systemPrompt, stepLimit: Number(stepLimit), turnStepLimit: Number(turnStepLimit), costLimit: Number(costLimit) }, agentHubTagsPayload(tags)), { status: (_b = nextStatus !== null && nextStatus !== void 0 ? nextStatus : record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft" });
548
587
  scalarSaved = false;
549
588
  _e.label = 1;
550
589
  case 1:
@@ -650,14 +689,15 @@ export function AgentRegistryEditorPage() {
650
689
  var linkSetting = function (label, checked, onChange, hint) {
651
690
  return _jsxs("label", { className: "agent-editor__link-setting", children: [_jsx("input", { type: "checkbox", checked: checked, onChange: function (event) { return onChange(event.target.checked); } }), _jsxs("span", { children: [_jsx("strong", { children: label }), _jsx("small", { children: hint })] })] });
652
691
  };
653
- var agentStatus = (_b = record === null || record === void 0 ? void 0 : record.status) !== null && _b !== void 0 ? _b : "draft";
692
+ var agentStatus = (_h = record === null || record === void 0 ? void 0 : record.status) !== null && _h !== void 0 ? _h : "draft";
654
693
  var tabs = __spreadArray(__spreadArray(__spreadArray(__spreadArray([
655
- { value: "basics", label: "Basics", content: _jsxs("div", { className: "agent-editor__stack", children: [_jsxs("div", { className: "agent-editor__grid", children: [field("Name", name, setName, "name", true), field("Title", title, setTitle, "title", true), field("Description", description, setDescription, "description"), _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] })] }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, disabled: creating || updating || isLoading || isFetching || isError, onBusyChange: setCreatingTag }), _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "Required inputs" }), _jsx("p", { children: "Define the variables people must provide when starting this agent." })] }), inputs.length > 0 && _jsxs(SolidButton, { type: "button", variant: "secondary", size: "small", onClick: function () { return setInputs(function (current) { return __spreadArray(__spreadArray([], current, true), [{ name: "", description: "", dataType: "string" }], false); }); }, children: [_jsx(Plus, { size: 15 }), " Add input"] })] }), !inputs.length ? _jsxs("div", { className: "agent-editor__empty", children: ["This agent has no required inputs. ", _jsxs("button", { type: "button", onClick: function () { return setInputs([{ name: "", description: "", dataType: "string" }]); }, children: [_jsx(Plus, { size: 15 }), " Add an input variable"] })] })
656
- : _jsx("div", { className: "agent-editor__inputs", children: inputs.map(function (input, index) { return _jsxs("div", { className: "agent-editor__input-row", children: [_jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " name"), placeholder: "Variable name", value: input.name, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { name: event.target.value }) : item; }); }); } }), _jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " description"), placeholder: "Description", value: input.description, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { description: event.target.value }) : item; }); }); } }), _jsx("select", { "aria-label": "Input ".concat(index + 1, " data type"), value: input.dataType, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { dataType: event.target.value }) : item; }); }); }, children: ["string", "number", "integer", "boolean", "date", "datetime", "object", "array"].map(function (type) { return _jsx("option", { value: type, children: type }, type); }) }), _jsx("button", { type: "button", "aria-label": "Remove input ".concat(index + 1), onClick: function () { return setInputs(function (current) { return current.filter(function (_, i) { return i !== index; }); }); }, children: _jsx(Trash2, { size: 17 }) })] }, index); }) }), errors.inputs && _jsx("small", { className: "agent-editor__error", children: errors.inputs })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "Models" }), _jsx("p", { children: "Choose any configured provider and model pair for each role. Both lists use the models enabled in AI settings." }), _jsx("div", { className: "agent-editor__grid", children: [["Reasoning model", reasoningModelKey, setReasoningModelKey, "reasoningModelKey"], ["Fast model", fastModelKey, setFastModelKey, "fastModelKey"]].map(function (_a) {
694
+ { value: "basics", label: "Basics", content: _jsxs("div", { className: "agent-editor__stack", children: [_jsxs("div", { className: "agent-editor__grid", children: [field("Name", name, setName, "name", true), field("Title", title, setTitle, "title", true), field("Description", description, setDescription, "description"), _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] })] }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, disabled: creating || updating || isLoading || isFetching || isError, onBusyChange: setCreatingTag }), _jsxs("section", { className: "agent-editor__section", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "Inputs" }), _jsx("p", { children: "Define the variables this agent can use. Mark inputs optional or provide a default value when people do not need to enter them." })] }), inputs.length > 0 && _jsxs(SolidButton, { type: "button", variant: "secondary", size: "small", onClick: function () { return setInputs(function (current) { return __spreadArray(__spreadArray([], current, true), [{ name: "", description: "", dataType: "string", defaultValue: null, optional: false }], false); }); }, children: [_jsx(Plus, { size: 15 }), " Add input"] })] }), !inputs.length ? _jsxs("div", { className: "agent-editor__empty", children: ["This agent has no inputs. ", _jsxs("button", { type: "button", onClick: function () { return setInputs([{ name: "", description: "", dataType: "string", defaultValue: null, optional: false }]); }, children: [_jsx(Plus, { size: 15 }), " Add an input variable"] })] })
695
+ : _jsx("div", { className: "agent-editor__inputs", children: inputs.map(function (input, index) { return _jsxs("div", { className: "agent-editor__input-row", children: [_jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " name"), placeholder: "Variable name", value: input.name, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { name: event.target.value }) : item; }); }); } }), _jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " description"), placeholder: "Description", value: input.description, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { description: event.target.value }) : item; }); }); } }), _jsx(SolidInput, { "aria-label": "Input ".concat(index + 1, " default value"), placeholder: "Default value", value: formatDefaultValue(input.defaultValue), onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { defaultValue: event.target.value }) : item; }); }); } }), _jsx("select", { "aria-label": "Input ".concat(index + 1, " data type"), value: input.dataType, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { dataType: event.target.value }) : item; }); }); }, children: ["string", "number", "integer", "boolean", "date", "datetime", "object", "array"].map(function (type) { return _jsx("option", { value: type, children: type }, type); }) }), _jsxs("label", { className: "agent-editor__input-optional", children: [_jsx("input", { type: "checkbox", checked: input.optional, onChange: function (event) { return setInputs(function (current) { return current.map(function (item, i) { return i === index ? __assign(__assign({}, item), { optional: event.target.checked }) : item; }); }); } }), " Optional"] }), _jsx("button", { type: "button", "aria-label": "Remove input ".concat(index + 1), onClick: function () { return setInputs(function (current) { return current.filter(function (_, i) { return i !== index; }); }); }, children: _jsx(Trash2, { size: 17 }) })] }, index); }) }), errors.inputs && _jsx("small", { className: "agent-editor__error", children: errors.inputs })] }), _jsxs("section", { className: "agent-editor__section agent-editor__models", children: [_jsx("h2", { children: "Models" }), _jsx("p", { children: "Choose a configured provider and model for each role. Select Other to enter a model ID manually." }), _jsx("div", { className: "agent-editor__grid", children: [["Reasoning model", reasoningModelKey, setReasoningModelKey, "reasoningModelKey"], ["Fast model", fastModelKey, setFastModelKey, "fastModelKey"]].map(function (_a) {
696
+ var _b;
657
697
  var label = _a[0], value = _a[1], setter = _a[2], key = _a[3];
658
- return _jsxs("label", { className: "agent-editor__field", children: [_jsxs("span", { children: [label, " *"] }), _jsx(ModelPicker, { value: value, options: modelOptions, placeholder: "Search providers and models\u2026", onChange: function (next) { return setter(next); } }), errors[key] && _jsx("small", { className: "agent-editor__error", children: errors[key] })] }, key);
698
+ return _jsxs("div", { className: "agent-editor__field", children: [_jsx("span", { children: label }), _jsx(ModelPicker, { value: value, options: modelOptions, providers: providerOptions, providerConfig: (_b = aiConfig.providers) !== null && _b !== void 0 ? _b : {}, onChange: setter }), errors[key] && _jsx("small", { className: "agent-editor__error", children: errors[key] })] }, key);
659
699
  }) }), settingsError ? _jsx("p", { className: "agent-editor__hint", children: "Settings could not be loaded. Try refreshing this page." })
660
- : !modelOptions.length && _jsx("p", { className: "agent-editor__hint", children: "No configured models are available. Check the AI settings and your permission to view encrypted settings." })] }), _jsxs("section", { className: "agent-editor__section agent-editor__workflow", "aria-labelledby": "agent-lifecycle-title", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { id: "agent-lifecycle-title", children: "Agent lifecycle" }), _jsx("p", { children: "Track this agent through its available stages. Select a stage to update its status." })] }), _jsxs("div", { className: "agent-editor__workflow-meta", children: [(record === null || record === void 0 ? void 0 : record.configVersion) != null && _jsxs("span", { className: "agent-editor__config-version", "aria-label": "Configuration version ".concat(record.configVersion), children: ["Config v", record.configVersion] }), _jsx(SolidWorkflowStatusPill, { label: agentStatus })] })] }), _jsx("div", { className: "agent-editor__workflow-stages", "aria-label": "Current agent stage: ".concat(agentStatus), children: [[
700
+ : !providerOptions.length && _jsx("p", { className: "agent-editor__hint", children: "No enabled providers are available. Check the AI settings and your permission to view encrypted settings." })] }), _jsxs("section", { className: "agent-editor__section agent-editor__workflow", "aria-labelledby": "agent-lifecycle-title", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { id: "agent-lifecycle-title", children: "Agent lifecycle" }), _jsx("p", { children: "Track this agent through its available stages. Select a stage to update its status." })] }), _jsxs("div", { className: "agent-editor__workflow-meta", children: [(record === null || record === void 0 ? void 0 : record.configVersion) != null && _jsxs("span", { className: "agent-editor__config-version", "aria-label": "Configuration version ".concat(record.configVersion), children: ["Config v", record.configVersion] }), _jsx(SolidWorkflowStatusPill, { label: agentStatus })] })] }), _jsx("div", { className: "agent-editor__workflow-stages", "aria-label": "Current agent stage: ".concat(agentStatus), children: [[
661
701
  "draft", "Draft", "Editable configuration; not available to users."
662
702
  ],
663
703
  ["active", "Active", "Available to authorized users and the AgentHub runtime."],
@@ -666,7 +706,7 @@ export function AgentRegistryEditorPage() {
666
706
  var value = _a[0], label = _a[1], description = _a[2];
667
707
  return _jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "agent-editor__workflow-connector", "aria-hidden": "true" }), _jsxs("button", { type: "button", className: "agent-editor__workflow-stage".concat(agentStatus === value ? " is-current" : ""), "aria-current": agentStatus === value ? "step" : undefined, "aria-pressed": agentStatus === value, disabled: creating || updating || agentStatus === value, onClick: function () { return void save(value); }, children: [_jsx("span", { className: "agent-editor__workflow-stage-mark", children: index + 1 }), _jsxs("div", { className: "agent-editor__workflow-stage-copy", children: [_jsx("strong", { children: label }), _jsx("small", { children: description }), _jsx("small", { className: "agent-editor__workflow-stage-cta", children: agentStatus === value ? "Current stage" : "Click to move to this stage" })] }), agentStatus === value && _jsx("span", { className: "agent-editor__workflow-current", children: "Current" })] })] }, value);
668
708
  }) }), _jsx("small", { className: "agent-editor__workflow-save-hint", children: "Changing stage saves the current form and its linked skills, tools, roles, and secrets." })] })] }) },
669
- { value: "persona", label: "Persona", content: _jsxs("section", { className: "agent-editor__section agent-editor__persona", children: [_jsx("div", { className: "agent-editor__section-head", children: _jsxs("div", { children: [_jsx("h2", { children: "System prompt *" }), _jsx("p", { children: "Describe the agent's role, behavior, and instructions in Markdown." })] }) }), _jsx(SolidCodeEditor, { value: systemPrompt, onChange: function (value) { setSystemPrompt(value !== null && value !== void 0 ? value : ""); setErrors(function (current) { return (__assign(__assign({}, current), { systemPrompt: "" })); }); }, language: "markdown", fontSize: 11, height: "max(34rem, calc(100dvh - 18rem))" }), errors.systemPrompt && _jsx("small", { className: "agent-editor__error", children: errors.systemPrompt })] }) },
709
+ { value: "persona", label: "Persona", content: _jsxs("section", { className: "agent-editor__section agent-editor__persona", children: [_jsxs("div", { className: "agent-editor__section-head", children: [_jsxs("div", { children: [_jsx("h2", { children: "System prompt *" }), _jsx("p", { children: "Describe the agent's role, behavior, and instructions in Markdown." })] }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(AgentPersonaHistory, { agentId: record.id, savedPrompt: (_j = record.systemPrompt) !== null && _j !== void 0 ? _j : "", refreshVersion: auditVersion })] }), _jsx(SolidCodeEditor, { value: systemPrompt, onChange: function (value) { setSystemPrompt(value !== null && value !== void 0 ? value : ""); setErrors(function (current) { return (__assign(__assign({}, current), { systemPrompt: "" })); }); }, language: "markdown", fontSize: 11, height: "max(34rem, calc(100dvh - 18rem))" }), errors.systemPrompt && _jsx("small", { className: "agent-editor__error", children: errors.systemPrompt })] }) },
670
710
  { value: "skills", label: "Skills", content: _jsx(LinkPicker, { label: "Skills", description: "Skills available to this agent.", options: skills.records, selected: linked(skillIds, skills.records, items(record === null || record === void 0 ? void 0 : record.agentSkills).map(function (link) { return link.agentSkillRegistry; }).filter(Boolean)), onAdd: function (id) { return toggle(setSkillIds, id); }, onRemove: function (id) { return toggle(setSkillIds, id); }, createUrl: "/admin/core/solid-core/agent-skill-registry/editor/new", onView: function (item) { return setPreview({ item: item, kind: "skill" }); }, editUrlFor: function (item) { return "/admin/core/solid-core/agent-skill-registry/editor/".concat(item.id); }, linkFor: function (id) { return linkForTarget(record === null || record === void 0 ? void 0 : record.agentSkills, "agentSkillRegistry", id); }, render: function (item) { return _jsx(AgentResourceCardWidget, __assign({}, { rowData: item })); }, renderSettings: function (item) {
671
711
  var _a;
672
712
  return _jsx("div", { className: "agent-editor__link-settings", children: linkSetting("Always include", (_a = alwaysIncludeValues[item.id]) !== null && _a !== void 0 ? _a : true, function (checked) { return setAlwaysIncludeValues(function (current) {
@@ -693,23 +733,23 @@ export function AgentRegistryEditorPage() {
693
733
  var _a, _b, _c, _d, _e, _f;
694
734
  return _jsxs("div", { className: "agent-editor__secret", children: [_jsx("strong", { children: (_b = (_a = item.displayName) !== null && _a !== void 0 ? _a : item.name) !== null && _b !== void 0 ? _b : item.key }), _jsx("span", { children: item.key }), _jsx("p", { children: item.description }), _jsxs("div", { className: "agent-editor__secret-env", children: [_jsx("span", { children: "Process environment" }), _jsx("code", { children: (_e = (_d = (_c = secretEnvVarNames[item.id]) !== null && _c !== void 0 ? _c : link === null || link === void 0 ? void 0 : link.envVarName) !== null && _d !== void 0 ? _d : item.key) !== null && _e !== void 0 ? _e : item.name }), _jsx("button", { type: "button", "aria-label": "Edit environment variable name for ".concat((_f = item.displayName) !== null && _f !== void 0 ? _f : item.key), onClick: function () { return beginSecretEnvVarEdit(item); }, children: _jsx(Pencil, { size: 14 }) })] })] });
695
735
  } }) }
696
- ], ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "processes", label: "Processes", content: _jsx(AgentProcessesPanel, { agentId: record.id, agentLabel: (_c = record.name) !== null && _c !== void 0 ? _c : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [
697
- ["jobs", "Jobs", (_d = jobs.currentData) === null || _d === void 0 ? void 0 : _d.records],
736
+ ], ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "processes", label: "Processes", content: _jsx(AgentProcessesPanel, { agentId: record.id, agentLabel: (_k = record.name) !== null && _k !== void 0 ? _k : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [
737
+ ["jobs", "Jobs", (_l = jobs.currentData) === null || _l === void 0 ? void 0 : _l.records],
698
738
  ] : []).map(function (_a) {
699
739
  var value = _a[0], label = _a[1], related = _a[2];
700
740
  return ({ value: value, label: label, content: _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: label }), jobs.isLoading || jobs.isFetching ? _jsx("div", { className: "agent-editor__empty", children: "Loading jobs\u2026" })
701
741
  : jobs.isError ? _jsx("div", { className: "agent-editor__empty", children: "Jobs could not be loaded." })
702
742
  : items(related).length ? _jsx("div", { className: "agent-editor__related", children: items(related).map(function (item) { var _a, _b, _c; return _jsxs("article", { children: [_jsx("strong", { children: (_b = (_a = item.name) !== null && _a !== void 0 ? _a : item.title) !== null && _b !== void 0 ? _b : "#".concat(item.id) }), _jsx("span", { children: (_c = item.status) !== null && _c !== void 0 ? _c : "" })] }, item.id); }) })
703
743
  : _jsxs("div", { className: "agent-editor__empty", children: ["No ", label.toLowerCase(), " for this agent yet."] })] }) });
704
- }), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentSessionsPanel, { agentId: record.id, agentLabel: (_e = record.name) !== null && _e !== void 0 ? _e : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "embedding", label: "Embedding", content: _jsx(AgentEmbeddingPanel, { agentId: record.id, fields: parseInputs(record.requiredInputs), active: record.status === "active", hubUrl: String((_f = getSettingsMap(settings).solidxAgentHubBackendUrl) !== null && _f !== void 0 ? _f : "") }) }] : []), true);
744
+ }), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentSessionsPanel, { agentId: record.id, agentLabel: (_m = record.name) !== null && _m !== void 0 ? _m : record.title }) }] : []), true), ((record === null || record === void 0 ? void 0 : record.id) ? [{ value: "embedding", label: "Embedding", content: _jsx(AgentEmbeddingPanel, { agentId: record.id, fields: parseInputs(record.requiredInputs), active: record.status === "active", hubUrl: String((_o = getSettingsMap(settings).solidxAgentHubBackendUrl) !== null && _o !== void 0 ? _o : "") }) }] : []), true);
705
745
  var content = _jsx(SolidTabGroup, { tabs: tabs, value: tab, onValueChange: setTab, className: "agent-editor__tabs", listClassName: "agent-editor__tab-list", panelClassName: "agent-editor__tab-panel" });
706
746
  return _jsxs("main", { className: "agent-editor", children: [_jsxs("header", { className: "agent-editor__header", children: [_jsxs("div", { className: "agent-editor__heading-with-refresh", children: [_jsx("h1", { children: (record === null || record === void 0 ? void 0 : record.id) ? "Edit Agent" : "Create Agent" }), (record === null || record === void 0 ? void 0 : record.id) && _jsx("button", { type: "button", className: "agent-editor__refresh".concat(isFetching ? " is-loading" : ""), "aria-label": "Refresh agent", title: "Refresh agent", disabled: isFetching || updating, onClick: requestRefresh, children: _jsx(RefreshCw, { size: 14 }) })] }), _jsxs("div", { className: "agent-editor__actions", children: [_jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(ArrowLeft, { size: 16 }), onClick: function () { return navigate(-1); }, children: "Back" }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(FlaskConical, { size: 16 }), onClick: openAgentTest, children: "Test Agent" }), _jsx(SolidButton, { loading: creating || updating, disabled: creatingTag || isLoading || isFetching || isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)), onClick: function () { return void save(); }, children: "Save Agent" })] })] }), preview && _jsx(ResourcePreviewDialog, { item: preview.item, kind: preview.kind, onClose: function () { return setPreview(null); } }), _jsx(SolidDialog, { open: confirmRefresh, onOpenChange: setConfirmRefresh, header: "Discard unsaved changes?", style: { width: "min(28rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { return setConfirmRefresh(false); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", disabled: isFetching, onClick: function () { setConfirmRefresh(false); void refetch(); }, children: "Refresh and discard" })] }), children: _jsx(SolidDialogBody, { children: _jsx("p", { children: "You have unsaved changes. Refreshing will discard them and load the latest agent content." }) }) }), isLoading ? _jsx("div", { className: "agent-editor__empty", children: "Loading agent\u2026" }) : isError || (id !== "new" && !(record === null || record === void 0 ? void 0 : record.id)) ?
707
747
  _jsx("div", { className: "agent-editor__empty", children: "This agent could not be loaded." }) : (record === null || record === void 0 ? void 0 : record.id) ?
708
748
  _jsx(AgentRegistryAuditPanel, { modelSingularName: "agentRegistry", recordId: record.id, refreshVersion: auditVersion, modelUserKey: record.name, children: content }) : content, _jsx(SolidDialog, { open: Boolean(pendingSecret), onOpenChange: function (open) { if (!open) {
709
749
  setPendingSecret(null);
710
750
  setSecretEnvVarError("");
711
- } }, header: "Set secret environment variable", style: { width: "min(34rem, 94vw)" }, footer: _jsxs("div", { className: "agent-editor__secret-dialog-actions", children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { setPendingSecret(null); setSecretEnvVarError(""); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", onClick: commitSecretEnvVar, children: "Use secret" })] }), children: _jsx(SolidDialogBody, { className: "agent-editor__secret-dialog-body", children: _jsxs("div", { className: "agent-editor__secret-dialog", children: [_jsxs("p", { children: ["Choose the environment variable name AgentHub will set for ", _jsx("strong", { children: (_h = (_g = pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.displayName) !== null && _g !== void 0 ? _g : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.name) !== null && _h !== void 0 ? _h : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.key }), ". The default is the secret name."] }), _jsxs("label", { className: "agent-editor__field", children: [_jsx("span", { children: "Environment variable name" }), _jsx(SolidInput, { autoFocus: true, value: secretEnvVarDraft, "aria-invalid": Boolean(secretEnvVarError), onChange: function (event) { setSecretEnvVarDraft(event.target.value); setSecretEnvVarError(""); } }), secretEnvVarError && _jsx("small", { className: "agent-editor__error", children: secretEnvVarError })] })] }) }) }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(SolidDialog, { open: testAgentOpen, onOpenChange: setTestAgentOpen, onHide: function () { return setTestAgentOpen(false); }, showHeader: false, overlayClassName: "agent-editor__test-dialog-overlay", ariaLabel: "Test ".concat((_j = record.name) !== null && _j !== void 0 ? _j : "SolidX Agent"), className: "agent-editor__test-dialog", style: testAgentWindowMode === "maximized"
751
+ } }, header: "Set secret environment variable", style: { width: "min(34rem, 94vw)" }, footer: _jsxs("div", { className: "agent-editor__secret-dialog-actions", children: [_jsx(SolidButton, { type: "button", variant: "secondary", onClick: function () { setPendingSecret(null); setSecretEnvVarError(""); }, children: "Cancel" }), _jsx(SolidButton, { type: "button", onClick: commitSecretEnvVar, children: "Use secret" })] }), children: _jsx(SolidDialogBody, { className: "agent-editor__secret-dialog-body", children: _jsxs("div", { className: "agent-editor__secret-dialog", children: [_jsxs("p", { children: ["Choose the environment variable name AgentHub will set for ", _jsx("strong", { children: (_q = (_p = pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.displayName) !== null && _p !== void 0 ? _p : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.name) !== null && _q !== void 0 ? _q : pendingSecret === null || pendingSecret === void 0 ? void 0 : pendingSecret.key }), ". The default is the secret name."] }), _jsxs("label", { className: "agent-editor__field", children: [_jsx("span", { children: "Environment variable name" }), _jsx(SolidInput, { autoFocus: true, value: secretEnvVarDraft, "aria-invalid": Boolean(secretEnvVarError), onChange: function (event) { setSecretEnvVarDraft(event.target.value); setSecretEnvVarError(""); } }), secretEnvVarError && _jsx("small", { className: "agent-editor__error", children: secretEnvVarError })] })] }) }) }), (record === null || record === void 0 ? void 0 : record.id) && _jsx(SolidDialog, { open: testAgentOpen, onOpenChange: setTestAgentOpen, onHide: function () { return setTestAgentOpen(false); }, showHeader: false, overlayClassName: "agent-editor__test-dialog-overlay", ariaLabel: "Test ".concat((_r = record.name) !== null && _r !== void 0 ? _r : "SolidX Agent"), className: "agent-editor__test-dialog", style: testAgentWindowMode === "maximized"
712
752
  ? { position: "fixed", inset: 16, width: "auto", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }
713
- : { position: "fixed", top: 16, right: 16, bottom: 16, left: "auto", width: "min(28rem, calc(100vw - 32px))", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: _jsx("div", { className: "agent-editor__test-dialog-body", children: _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: record.id, title: (_k = record.name) !== null && _k !== void 0 ? _k : "SolidX Agent", requiredInputs: parseInputs(record.requiredInputs), height: "100%", className: "agent-editor__test-chat", windowControls: { mode: testAgentWindowMode, onDock: function () { return setTestAgentWindowMode("docked"); }, onMaximize: function () { return setTestAgentWindowMode("maximized"); }, onRestore: function () { return setTestAgentWindowMode("docked"); }, onClose: function () { return setTestAgentOpen(false); } } }) }) })] });
753
+ : { position: "fixed", top: 16, right: 16, bottom: 16, left: "auto", width: "min(28rem, calc(100vw - 32px))", maxWidth: "none", height: "auto", maxHeight: "none", transform: "none", borderRadius: 14, padding: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: _jsx("div", { className: "agent-editor__test-dialog-body", children: _jsx(SolidAgentEmbedded, { agentRuntime: "agentHub", agentId: record.id, title: (_s = record.name) !== null && _s !== void 0 ? _s : "SolidX Agent", requiredInputs: parseInputs(record.requiredInputs), height: "100%", className: "agent-editor__test-chat", windowControls: { mode: testAgentWindowMode, onDock: function () { return setTestAgentWindowMode("docked"); }, onMaximize: function () { return setTestAgentWindowMode("maximized"); }, onRestore: function () { return setTestAgentWindowMode("docked"); }, onClose: function () { return setTestAgentOpen(false); } } }) }) })] });
714
754
  }
715
755
  //# sourceMappingURL=AgentRegistryEditorPage.js.map