@solidxai/core-ui 0.1.22-beta.2 → 0.1.22-beta.4

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 (231) hide show
  1. package/dist/components/auth/AuthLayout.js +1 -1
  2. package/dist/components/auth/AuthLayout.js.map +1 -1
  3. package/dist/components/auth/AuthLayout.tsx +1 -1
  4. package/dist/components/common/CancelButton.js +1 -1
  5. package/dist/components/common/CancelButton.js.map +1 -1
  6. package/dist/components/common/CancelButton.tsx +3 -3
  7. package/dist/components/common/SolidModuleHome.js +1 -1
  8. package/dist/components/common/SolidModuleHome.js.map +1 -1
  9. package/dist/components/common/SolidModuleHome.tsx +1 -1
  10. package/dist/components/core/card/SolidCardView.js.map +1 -1
  11. package/dist/components/core/card/SolidCardView.tsx +1 -1
  12. package/dist/components/core/card/SolidCardViewConfigure.js +1 -1
  13. package/dist/components/core/card/SolidCardViewConfigure.js.map +1 -1
  14. package/dist/components/core/card/SolidCardViewConfigure.tsx +1 -1
  15. package/dist/components/core/common/SolidCreateButton.js +1 -1
  16. package/dist/components/core/common/SolidCreateButton.js.map +1 -1
  17. package/dist/components/core/common/SolidCreateButton.tsx +4 -4
  18. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.module.css +51 -0
  19. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts +2 -0
  20. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts.map +1 -1
  21. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js +20 -5
  22. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js.map +1 -1
  23. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.tsx +32 -4
  24. package/dist/components/core/form/SolidFormActionHeader.js +18 -18
  25. package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
  26. package/dist/components/core/form/SolidFormActionHeader.tsx +28 -28
  27. package/dist/components/core/form/SolidFormViewShimmerLoading.js +1 -1
  28. package/dist/components/core/form/SolidFormViewShimmerLoading.js.map +1 -1
  29. package/dist/components/core/form/SolidFormViewShimmerLoading.tsx +2 -2
  30. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js +2 -2
  31. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.js.map +1 -1
  32. package/dist/components/core/form/fields/widgets/SolidIconEditWidget.tsx +2 -2
  33. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  34. package/dist/components/core/kanban/SolidKanbanView.js +27 -24
  35. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  36. package/dist/components/core/kanban/SolidKanbanView.tsx +15 -8
  37. package/dist/components/core/kanban/SolidKanbanViewConfigure.js +1 -1
  38. package/dist/components/core/kanban/SolidKanbanViewConfigure.js.map +1 -1
  39. package/dist/components/core/kanban/SolidKanbanViewConfigure.tsx +1 -1
  40. package/dist/components/core/list/SolidListView.js +1 -1
  41. package/dist/components/core/list/SolidListView.js.map +1 -1
  42. package/dist/components/core/list/SolidListView.tsx +2 -2
  43. package/dist/components/core/list/SolidListViewConfigure.js +1 -1
  44. package/dist/components/core/list/SolidListViewConfigure.js.map +1 -1
  45. package/dist/components/core/list/SolidListViewConfigure.tsx +2 -2
  46. package/dist/components/core/module/ModulePackageDialog.d.ts.map +1 -1
  47. package/dist/components/core/module/ModulePackageDialog.js +28 -22
  48. package/dist/components/core/module/ModulePackageDialog.js.map +1 -1
  49. package/dist/components/core/module/ModulePackageDialog.tsx +24 -2
  50. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.d.ts +10 -0
  51. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.d.ts.map +1 -0
  52. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.js +35 -0
  53. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.js.map +1 -0
  54. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.module.css +46 -0
  55. package/dist/components/core/solid-agent/AgentWorkspaceAgentSelector.tsx +57 -0
  56. package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.d.ts +3 -0
  57. package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.d.ts.map +1 -0
  58. package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.js +9 -0
  59. package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.js.map +1 -0
  60. package/dist/components/core/solid-agent/AgentWorkspaceHeaderActions.tsx +32 -0
  61. package/dist/components/core/solid-agent/SolidAgent.module.css +25 -0
  62. package/dist/components/core/solid-agent/SolidAgentChat.d.ts +4 -1
  63. package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
  64. package/dist/components/core/solid-agent/SolidAgentChat.js +53 -50
  65. package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
  66. package/dist/components/core/solid-agent/SolidAgentChat.tsx +51 -64
  67. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +4 -0
  68. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -1
  69. package/dist/components/core/solid-agent/SolidAgentEmbedded.js +1 -1
  70. package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -1
  71. package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +6 -2
  72. package/dist/components/core/solid-agent/agentEvents.d.ts +4 -0
  73. package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -1
  74. package/dist/components/core/solid-agent/agentEvents.js +126 -32
  75. package/dist/components/core/solid-agent/agentEvents.js.map +1 -1
  76. package/dist/components/core/solid-agent/agentEvents.ts +94 -3
  77. package/dist/components/core/solid-agent/client/agentAuth.d.ts.map +1 -1
  78. package/dist/components/core/solid-agent/client/agentAuth.js +27 -11
  79. package/dist/components/core/solid-agent/client/agentAuth.js.map +1 -1
  80. package/dist/components/core/solid-agent/client/agentAuth.ts +10 -3
  81. package/dist/components/core/solid-agent/client/agentRuntime.d.ts +2 -1
  82. package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
  83. package/dist/components/core/solid-agent/client/agentRuntime.js +66 -27
  84. package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
  85. package/dist/components/core/solid-agent/client/agentRuntime.ts +35 -3
  86. package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
  87. package/dist/components/core/solid-agent/client/agentSocket.js +6 -0
  88. package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
  89. package/dist/components/core/solid-agent/client/agentSocket.ts +6 -0
  90. package/dist/components/core/solid-agent/embed/agentWorkspace.d.ts +16 -0
  91. package/dist/components/core/solid-agent/embed/agentWorkspace.d.ts.map +1 -0
  92. package/dist/components/core/solid-agent/embed/agentWorkspace.js +16 -0
  93. package/dist/components/core/solid-agent/embed/agentWorkspace.js.map +1 -0
  94. package/dist/components/core/solid-agent/embed/agentWorkspace.ts +29 -0
  95. package/dist/components/core/solid-agent/humanReview.d.ts +19 -0
  96. package/dist/components/core/solid-agent/humanReview.d.ts.map +1 -0
  97. package/dist/components/core/solid-agent/humanReview.js +54 -0
  98. package/dist/components/core/solid-agent/humanReview.js.map +1 -0
  99. package/dist/components/core/solid-agent/humanReview.ts +63 -0
  100. package/dist/components/core/solid-agent/thread/AgentThread.d.ts +2 -1
  101. package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
  102. package/dist/components/core/solid-agent/thread/AgentThread.js +17 -68
  103. package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
  104. package/dist/components/core/solid-agent/thread/AgentThread.tsx +21 -106
  105. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +4 -2
  106. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
  107. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +34 -12
  108. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
  109. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +33 -10
  110. package/dist/components/core/solid-agent/types.d.ts +6 -0
  111. package/dist/components/core/solid-agent/types.d.ts.map +1 -1
  112. package/dist/components/core/solid-agent/types.js.map +1 -1
  113. package/dist/components/core/solid-agent/types.ts +1 -0
  114. package/dist/components/core/solid-agent/useAgentChat.d.ts +1 -1
  115. package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -1
  116. package/dist/components/core/solid-agent/useAgentChat.js +3 -3
  117. package/dist/components/core/solid-agent/useAgentChat.js.map +1 -1
  118. package/dist/components/core/solid-agent/useAgentChat.ts +3 -3
  119. package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.d.ts +3 -0
  120. package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.d.ts.map +1 -0
  121. package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.js +24 -0
  122. package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.js.map +1 -0
  123. package/dist/components/core/solid-agent/widgets/DefaultAgentChatHeaderWidget.tsx +60 -0
  124. package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.d.ts +7 -0
  125. package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.d.ts.map +1 -0
  126. package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.js +39 -0
  127. package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.js.map +1 -0
  128. package/dist/components/core/solid-agent/widgets/DefaultAgentToolCallWidget.tsx +96 -0
  129. package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.d.ts +4 -0
  130. package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.d.ts.map +1 -0
  131. package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.js +60 -0
  132. package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.js.map +1 -0
  133. package/dist/components/core/solid-agent/widgets/DefaultAgentToolGroupWidget.tsx +79 -0
  134. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.d.ts +7 -0
  135. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.d.ts.map +1 -0
  136. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.js +18 -0
  137. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.js.map +1 -0
  138. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWidget.tsx +30 -0
  139. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.d.ts +4 -0
  140. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.d.ts.map +1 -0
  141. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.js +8 -0
  142. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.js.map +1 -0
  143. package/dist/components/core/solid-agent/widgets/DefaultAgentTurnCompletionWrapperWidget.tsx +11 -0
  144. package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.d.ts +8 -0
  145. package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.d.ts.map +1 -0
  146. package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.js +41 -0
  147. package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.js.map +1 -0
  148. package/dist/components/core/solid-agent/widgets/DefaultAgentUserTurnCompletionWidget.tsx +99 -0
  149. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +2 -2
  150. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -1
  151. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +2 -2
  152. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.d.ts.map +1 -1
  153. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +10 -4
  154. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
  155. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +28 -5
  156. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts +1 -1
  157. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +1 -1
  158. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
  159. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +1 -1
  160. package/dist/components/core/tree/SolidTreeView.js +1 -1
  161. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  162. package/dist/components/core/tree/SolidTreeView.tsx +2 -2
  163. package/dist/components/layout/AdminHeaderActions.js +1 -1
  164. package/dist/components/layout/AdminHeaderActions.js.map +1 -1
  165. package/dist/components/layout/AdminHeaderActions.tsx +1 -1
  166. package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
  167. package/dist/components/layout/user-profile-menu.js +7 -1
  168. package/dist/components/layout/user-profile-menu.js.map +1 -1
  169. package/dist/components/layout/user-profile-menu.tsx +21 -3
  170. package/dist/helpers/registry.d.ts +13 -1
  171. package/dist/helpers/registry.d.ts.map +1 -1
  172. package/dist/helpers/registry.js +77 -25
  173. package/dist/helpers/registry.js.map +1 -1
  174. package/dist/helpers/registry.ts +75 -25
  175. package/dist/index.d.ts +2 -1
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +1 -0
  178. package/dist/index.js.map +1 -1
  179. package/dist/index.ts +4 -0
  180. package/dist/redux/features/agentSlice.d.ts.map +1 -1
  181. package/dist/redux/features/agentSlice.js +4 -1
  182. package/dist/redux/features/agentSlice.js.map +1 -1
  183. package/dist/redux/features/agentSlice.ts +3 -1
  184. package/dist/resources/globals.css +10 -1
  185. package/dist/resources/solid-custom.css +24 -0
  186. package/dist/resources/solid-responsive.css +13 -0
  187. package/dist/resources/solid-tailwind-generated.css +1 -1
  188. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js +2 -2
  189. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js.map +1 -1
  190. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.tsx +3 -3
  191. package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts +13 -0
  192. package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts.map +1 -0
  193. package/dist/routes/pages/admin/core/AgentDeploymentPanel.js +88 -0
  194. package/dist/routes/pages/admin/core/AgentDeploymentPanel.js.map +1 -0
  195. package/dist/routes/pages/admin/core/AgentDeploymentPanel.tsx +71 -0
  196. package/dist/routes/pages/admin/core/AgentJobsInboxPage.d.ts +2 -0
  197. package/dist/routes/pages/admin/core/AgentJobsInboxPage.d.ts.map +1 -0
  198. package/dist/routes/pages/admin/core/AgentJobsInboxPage.js +539 -0
  199. package/dist/routes/pages/admin/core/AgentJobsInboxPage.js.map +1 -0
  200. package/dist/routes/pages/admin/core/AgentJobsInboxPage.module.css +87 -0
  201. package/dist/routes/pages/admin/core/AgentJobsInboxPage.tsx +422 -0
  202. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +52 -9
  203. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
  204. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +144 -79
  205. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
  206. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +139 -33
  207. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.css +29 -0
  208. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
  209. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +26 -21
  210. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
  211. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +14 -7
  212. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
  213. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +42 -27
  214. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
  215. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +12 -5
  216. package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -1
  217. package/dist/routes/pages/embed/AgentEmbedPage.js +13 -5
  218. package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -1
  219. package/dist/routes/pages/embed/AgentEmbedPage.tsx +10 -2
  220. package/dist/routes/solidRoutes.d.ts.map +1 -1
  221. package/dist/routes/solidRoutes.js +2 -0
  222. package/dist/routes/solidRoutes.js.map +1 -1
  223. package/dist/routes/solidRoutes.tsx +2 -0
  224. package/dist/types/extension-registry.d.ts +7 -1
  225. package/dist/types/extension-registry.d.ts.map +1 -1
  226. package/dist/types/extension-registry.js +9 -1
  227. package/dist/types/extension-registry.js.map +1 -1
  228. package/dist/types/extension-registry.ts +10 -1
  229. package/dist/types/index.d.ts +6 -0
  230. package/dist/types/solid-core.d.ts +30 -2
  231. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"AgentSkillRegistryEditorPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAoB,MAAM,qBAAqB,CAAC;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SAAS,EAChB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAC,0BAA0B,EACpC,aAAa,EAAC,8BAA8B,EAC5C,cAAc,EAAC,+BAA+B,GAC9C,CACH,IACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, RefreshCw } from \"lucide-react\";\nimport { useDispatch } from \"react-redux\";\nimport { useNavigate, useParams } from \"react-router-dom\";\nimport { createSolidEntityApi } from \"../../../../redux/api/solidEntityApi\";\nimport { showToast } from \"../../../../redux/features/toastSlice\";\nimport { AgentRegistryAuditPanel } from \"./AgentRegistryAuditPanel\";\nimport { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from \"./AgentHubTagsField\";\nimport { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from \"./AgentHubModuleField\";\nimport {\n SolidButton,\n SolidCodeEditor,\n SolidDialog,\n SolidDialogBody,\n SolidIconPicker,\n SolidInput,\n SolidTabGroup,\n} from \"../../../../components/shad-cn-ui\";\nimport \"./AgentSkillRegistryEditorPage.css\";\n\ntype AgentReference = {\n id?: number | string;\n name?: string;\n title?: string;\n agentRegistry?: AgentReference | number | string | null;\n};\n\ntype SkillRecord = {\n id: number;\n name?: string;\n type?: string;\n iconName?: string | null;\n description?: string;\n body?: string;\n tags?: AgentHubTag[];\n module?: AgentHubModule | null;\n agentSkills?: AgentReference[] | AgentReference | null;\n};\n\nfunction extractEntityRecord(response: unknown): Record<string, any> | undefined {\n let candidate: unknown = response;\n for (let depth = 0; depth < 3; depth += 1) {\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const value = candidate as Record<string, unknown>;\n if (\"id\" in value || \"name\" in value) return value;\n candidate = value.data;\n }\n return candidate && typeof candidate === \"object\" ? candidate as Record<string, any> : undefined;\n}\n\nfunction formatErrorMessage(value: unknown): string | undefined {\n if (typeof value === \"string\") return value.trim() || undefined;\n if (Array.isArray(value)) {\n const messages = value.map(formatErrorMessage).filter((message): message is string => Boolean(message));\n return messages.length ? messages.join(\"; \") : undefined;\n }\n if (value && typeof value === \"object\") {\n const error = value as Record<string, unknown>;\n return formatErrorMessage(error.message)\n ?? formatErrorMessage(error.constraints)\n ?? formatErrorMessage(error.error);\n }\n return undefined;\n}\n\nfunction getSaveErrorMessage(error: unknown): string {\n if (!error || typeof error !== \"object\") return \"Failed to save skill.\";\n const apiError = error as Record<string, any>;\n // Nest validation details are nested at data.data.message; prefer them over\n // the generic outer \"Bad Request Exception\" message.\n return formatErrorMessage(apiError.data?.data?.message)\n ?? formatErrorMessage(apiError.data?.message)\n ?? formatErrorMessage(apiError.data?.error)\n ?? formatErrorMessage(apiError.message)\n ?? \"Failed to save skill.\";\n}\n\nfunction skillAgents(record?: SkillRecord): AgentReference[] {\n const related = record?.agentSkills;\n const links = Array.isArray(related)\n ? related\n : related\n ? [related]\n : [];\n const seen = new Set<string>();\n\n return links\n .map((link) => link.agentRegistry)\n .filter((agent): agent is AgentReference => Boolean(agent && typeof agent === \"object\"))\n .filter((agent) => {\n const key = String(agent.id ?? agent.name ?? agent.title ?? \"\");\n if (!key || seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nexport function AgentSkillRegistryEditorPage() {\n const { id = \"\" } = useParams<{ id: string }>();\n const navigate = useNavigate();\n const dispatch = useDispatch();\n const entityApi = React.useMemo(() => createSolidEntityApi(\"agentSkillRegistry\"), []);\n const {\n useCreateSolidEntityMutation,\n useGetSolidEntityByIdQuery,\n useUpdateSolidEntityMutation,\n } = entityApi;\n\n const { data: response, isLoading, isFetching, refetch } = useGetSolidEntityByIdQuery(\n {\n id,\n qs: \"populate[0]=agentSkills&populate[1]=agentSkills.agentRegistry&populate[2]=tags&populate[3]=module\",\n },\n { skip: !id || id === \"new\" },\n );\n const [createSkill, { isLoading: isCreating }] = useCreateSolidEntityMutation();\n const [updateSkill, { isLoading: isSaving }] = useUpdateSolidEntityMutation();\n const record = extractEntityRecord(response) as SkillRecord | undefined;\n\n const [activeTab, setActiveTab] = React.useState(\"general\");\n const [name, setName] = React.useState(\"\");\n const [type, setType] = React.useState(\"custom\");\n const [iconName, setIconName] = React.useState(\"\");\n const [description, setDescription] = React.useState(\"\");\n const [body, setBody] = React.useState(\"\");\n const [tags, setTags] = React.useState<AgentHubTag[]>([]);\n const [module, setModule] = React.useState<AgentHubModule | null>(null);\n const [creatingTag, setCreatingTag] = React.useState(false);\n const [fieldErrors, setFieldErrors] = React.useState<Record<string, string>>({});\n const [auditRefreshVersion, setAuditRefreshVersion] = React.useState(0);\n const [confirmRefresh, setConfirmRefresh] = React.useState(false);\n const baseline = React.useRef(\"\");\n const currentForm = () => JSON.stringify({ name, type, iconName, description, body, tags, moduleId: module?.id ?? null });\n\n React.useEffect(() => {\n const nextTags = agentHubTagsFrom(record?.tags);\n const nextModule = agentHubModuleFrom(record?.module);\n setName(record?.name ?? \"\");\n setType(record?.type ?? \"custom\");\n setIconName(record?.iconName ?? \"\");\n setDescription(record?.description ?? \"\");\n setBody(record?.body ?? \"\");\n setTags(nextTags);\n setModule(nextModule);\n baseline.current = JSON.stringify({ name: record?.name ?? \"\", type: record?.type ?? \"custom\", iconName: record?.iconName ?? \"\", description: record?.description ?? \"\", body: record?.body ?? \"\", tags: nextTags, moduleId: nextModule?.id ?? null });\n }, [record]);\n\n const isReadOnly = record?.type === \"solidx\";\n const isDirty = Boolean(record?.id) && currentForm() !== baseline.current;\n const requestRefresh = () => isDirty ? setConfirmRefresh(true) : void refetch();\n\n const handleSave = async () => {\n if (creatingTag) return;\n const nextErrors: Record<string, string> = {};\n if (!name.trim()) nextErrors.name = \"Name is required.\";\n if (!type.trim()) nextErrors.type = \"Skill type is required.\";\n if (!description.trim()) nextErrors.description = \"Description is required.\";\n if (!body.trim()) nextErrors.body = \"Skill instructions are required.\";\n if (!module) nextErrors.module = \"Module is required. Select a module before saving this skill.\";\n\n setFieldErrors(nextErrors);\n if (Object.keys(nextErrors).length > 0) {\n setActiveTab(nextErrors.body ? \"skill\" : \"general\");\n dispatch(showToast({\n severity: \"error\",\n summary: \"Missing information\",\n detail: Object.values(nextErrors).join(\" \"),\n }));\n return;\n }\n\n const payload = {\n name: name.trim(),\n type,\n iconName: iconName || null,\n description: description.trim(),\n body,\n ...agentHubTagsPayload(tags),\n ...agentHubModulePayload(module),\n };\n\n try {\n if (record?.id) {\n await updateSkill({ id: record.id, data: payload }).unwrap();\n dispatch(showToast({\n severity: \"success\",\n summary: \"Saved\",\n detail: \"Skill updated successfully.\",\n }));\n setAuditRefreshVersion((version) => version + 1);\n refetch();\n } else {\n const result: any = await createSkill(payload).unwrap();\n const createdId = result?.data?.id ?? result?.id;\n dispatch(showToast({\n severity: \"success\",\n summary: \"Created\",\n detail: \"Skill created successfully.\",\n }));\n if (createdId) {\n navigate(`/admin/core/solid-core/agent-skill-registry/editor/${createdId}`, {\n replace: true,\n });\n }\n }\n } catch (error: any) {\n const errorDetail = getSaveErrorMessage(error);\n const serverFieldErrors: Record<string, string> = {};\n if (/required|not be empty|cannot be empty|should not be empty/i.test(errorDetail)) {\n for (const field of [\"name\", \"type\", \"description\", \"body\", \"module\"]) {\n if (!new RegExp(`\\\\b${field}\\\\b`, \"i\").test(errorDetail)) continue;\n const label = field === \"body\" ? \"Skill instructions\" : field === \"module\" ? \"Module\" : field[0].toUpperCase() + field.slice(1);\n serverFieldErrors[field] = `${label} is required.`;\n }\n }\n if (Object.keys(serverFieldErrors).length > 0) {\n setFieldErrors(serverFieldErrors);\n setActiveTab(serverFieldErrors.body ? \"skill\" : \"general\");\n }\n dispatch(showToast({\n severity: \"error\",\n summary: \"Save failed\",\n detail: errorDetail,\n }));\n }\n };\n\n const agents = skillAgents(record);\n const tabs = [\n {\n value: \"general\",\n label: \"General Info\",\n content: (\n <fieldset className=\"agent-skill-editor__general\" disabled={isReadOnly}>\n {isReadOnly && <p className=\"agent-skill-editor__readonly-note\">SolidX skills cannot be edited.</p>}\n <div className=\"agent-skill-editor__fields\">\n <label className=\"agent-skill-editor__field\">\n <span>Name <b>*</b></span>\n <SolidInput\n value={name}\n aria-invalid={Boolean(fieldErrors.name)}\n aria-describedby={fieldErrors.name ? \"agent-skill-name-error\" : undefined}\n className={fieldErrors.name ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setName(event.target.value);\n setFieldErrors((current) => ({ ...current, name: \"\" }));\n }}\n />\n {fieldErrors.name && <small id=\"agent-skill-name-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.name}</small>}\n </label>\n <div className=\"agent-skill-editor__field\">\n <span>Icon</span>\n <SolidIconPicker value={iconName} onChange={setIconName} />\n </div>\n <label className=\"agent-skill-editor__field\">\n <span>Description <b>*</b></span>\n <SolidInput\n value={description}\n aria-invalid={Boolean(fieldErrors.description)}\n aria-describedby={fieldErrors.description ? \"agent-skill-description-error\" : undefined}\n className={fieldErrors.description ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setDescription(event.target.value);\n setFieldErrors((current) => ({ ...current, description: \"\" }));\n }}\n />\n {fieldErrors.description && <small id=\"agent-skill-description-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.description}</small>}\n </label>\n </div>\n <label className=\"agent-skill-editor__field\">\n <span>Skill type <b>*</b></span>\n <select\n value={type}\n aria-invalid={Boolean(fieldErrors.type)}\n aria-describedby={fieldErrors.type ? \"agent-skill-type-error\" : undefined}\n className={fieldErrors.type ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setType(event.target.value);\n setFieldErrors((current) => ({ ...current, type: \"\" }));\n }}\n >\n {isReadOnly && <option value=\"solidx\">SolidX</option>}\n <option value=\"thirdparty\">Third Party</option>\n <option value=\"custom\">Custom</option>\n </select>\n {fieldErrors.type && <small id=\"agent-skill-type-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.type}</small>}\n </label>\n <AgentHubModuleField className=\"agent-skill-editor__field\" value={module} onChange={(value) => { setModule(value); setFieldErrors((current) => ({ ...current, module: \"\" })); }} disabled={isReadOnly || isCreating || isSaving} clearable={false} required error={fieldErrors.module} />\n <AgentHubTagsField value={tags} onChange={setTags} module={module} disabled={isReadOnly || isCreating || isSaving} onBusyChange={setCreatingTag} />\n </fieldset>\n ),\n },\n {\n value: \"skill\",\n label: \"Skill\",\n content: (\n <div className=\"agent-skill-editor__skill\">\n <section className=\"agent-skill-editor__panel\">\n <header>\n <h2>Skill instructions <b>*</b></h2>\n <p>Write the skill's Markdown body here.</p>\n </header>\n <SolidCodeEditor\n value={body}\n onChange={(value) => {\n setBody(value ?? \"\");\n setFieldErrors((current) => ({ ...current, body: \"\" }));\n }}\n language=\"markdown\"\n wordWrap=\"on\"\n readOnly={isReadOnly}\n fontSize={11}\n height=\"max(32rem, calc(100dvh - 18rem))\"\n className={`agent-skill-editor__code${fieldErrors.body ? \" agent-skill-editor__code--invalid\" : \"\"}`}\n />\n {fieldErrors.body && <small className=\"agent-skill-editor__field-error agent-skill-editor__body-error\">{fieldErrors.body}</small>}\n </section>\n </div>\n ),\n },\n {\n value: \"agents\",\n label: \"Agents\",\n content: (\n <section className=\"agent-skill-editor__agents\">\n <div>\n <h2>Associated agents</h2>\n <p>Agents linked to this skill. Associations are read-only here.</p>\n </div>\n {isLoading ? (\n <p>Loading associated agents…</p>\n ) : agents.length ? (\n <div className=\"agent-skill-editor__agent-grid\">\n {agents.map((agent, index) => (\n <article className=\"agent-skill-editor__agent-card\" key={String(agent.id ?? agent.name ?? index)}>\n <span>{(agent.name ?? agent.title ?? \"A\").slice(0, 1).toUpperCase()}</span>\n <strong>{agent.name ?? agent.title ?? \"Unnamed agent\"}</strong>\n </article>\n ))}\n </div>\n ) : (\n <div className=\"agent-skill-editor__empty\">No agents are currently associated with this skill.</div>\n )}\n </section>\n ),\n },\n ];\n\n return (\n <main className=\"agent-skill-editor\">\n <header className=\"agent-skill-editor__header\">\n <div>\n <div className=\"agent-skill-editor__heading-with-refresh\"><h1>{record ? \"Edit Skill\" : \"Create Skill\"}</h1>{record?.id && <button type=\"button\" className={`agent-skill-editor__refresh${isFetching ? \" is-loading\" : \"\"}`} aria-label=\"Refresh skill\" title=\"Refresh skill\" disabled={isFetching || isSaving} onClick={requestRefresh}><RefreshCw size={14} /></button>}</div>\n </div>\n <div className=\"agent-skill-editor__actions\">\n <SolidButton variant=\"secondary\" leftIcon={<ArrowLeft size={16} />} onClick={() => navigate(-1)}>\n Back\n </SolidButton>\n {!isReadOnly && (\n <SolidButton loading={isCreating || isSaving} disabled={creatingTag} onClick={handleSave}>\n Save Skill\n </SolidButton>\n )}\n </div>\n </header>\n\n <SolidDialog open={confirmRefresh} onOpenChange={setConfirmRefresh} header=\"Discard unsaved changes?\" style={{ width: \"min(28rem, 94vw)\" }}\n footer={<><SolidButton type=\"button\" variant=\"secondary\" onClick={() => setConfirmRefresh(false)}>Cancel</SolidButton><SolidButton type=\"button\" disabled={isFetching} onClick={() => { setConfirmRefresh(false); void refetch(); }}>Refresh and discard</SolidButton></>}>\n <SolidDialogBody><p>You have unsaved changes. Refreshing will discard them and load the latest skill content.</p></SolidDialogBody>\n </SolidDialog>\n\n {isLoading ? (\n <div className=\"agent-skill-editor__loading\">Loading skill…</div>\n ) : record?.id ? (\n <AgentRegistryAuditPanel\n modelSingularName=\"agentSkillRegistry\"\n recordId={record.id}\n refreshVersion={auditRefreshVersion}\n modelUserKey={record.name}\n >\n <SolidTabGroup\n tabs={tabs}\n value={activeTab}\n onValueChange={setActiveTab}\n className=\"agent-skill-editor__tabs\"\n listClassName=\"agent-skill-editor__tab-list\"\n panelClassName=\"agent-skill-editor__tab-panel\"\n />\n </AgentRegistryAuditPanel>\n ) : (\n <SolidTabGroup\n tabs={tabs}\n value={activeTab}\n onValueChange={setActiveTab}\n className=\"agent-skill-editor__tabs\"\n listClassName=\"agent-skill-editor__tab-list\"\n panelClassName=\"agent-skill-editor__tab-panel\"\n />\n )}\n </main>\n );\n}\n"]}
1
+ {"version":3,"file":"AgentSkillRegistryEditorPage.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/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AAM,uBAAN,MAAM,CAAE,EAAE,EAAC,CAAC,CAAC,CACf,KAAC,uBAAuB,IACtB,iBAAiB,EAAC,oBAAoB,EACtC,QAAQ,EAAE,MAAM,CAAC,EAAE,EACnB,cAAc,EAAE,mBAAmB,EACnC,YAAY,EAAE,MAAM,CAAC,IAAI,YAEzB,KAAC,aAAa,IACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAC,0BAA0B,EACpC,aAAa,EAAC,8BAA8B,EAC5C,cAAc,EAAC,+BAA+B,GAC9C,GACsB,CAC3B,CAAC,CAAC,CAAC,CACF,KAAC,aAAa,IACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAC,0BAA0B,EACpC,aAAa,EAAC,8BAA8B,EAC5C,cAAc,EAAC,+BAA+B,GAC9C,CACH,IACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from \"react\";\nimport { ArrowLeft, Eye, Pencil, RefreshCw } from \"lucide-react\";\nimport { useDispatch } from \"react-redux\";\nimport { useNavigate, useParams, useSearchParams } from \"react-router-dom\";\nimport { createSolidEntityApi } from \"../../../../redux/api/solidEntityApi\";\nimport { showToast } from \"../../../../redux/features/toastSlice\";\nimport { AgentRegistryAuditPanel } from \"./AgentRegistryAuditPanel\";\nimport { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from \"./AgentHubTagsField\";\nimport { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from \"./AgentHubModuleField\";\nimport { SolidAgentMarkdown } from \"../../../../components/core/solid-agent/SolidAgentMarkdown\";\nimport {\n SolidButton,\n SolidCodeEditor,\n SolidDialog,\n SolidDialogBody,\n SolidIconPicker,\n SolidInput,\n SolidTabGroup,\n} from \"../../../../components/shad-cn-ui\";\nimport \"./AgentSkillRegistryEditorPage.css\";\n\ntype AgentReference = {\n id?: number | string;\n name?: string;\n title?: string;\n agentRegistry?: AgentReference | number | string | null;\n};\n\ntype SkillRecord = {\n id: number;\n name?: string;\n type?: string;\n iconName?: string | null;\n description?: string;\n body?: string;\n tags?: AgentHubTag[];\n module?: AgentHubModule | null;\n agentSkills?: AgentReference[] | AgentReference | null;\n};\n\nfunction extractEntityRecord(response: unknown): Record<string, any> | undefined {\n let candidate: unknown = response;\n for (let depth = 0; depth < 3; depth += 1) {\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const value = candidate as Record<string, unknown>;\n if (\"id\" in value || \"name\" in value) return value;\n candidate = value.data;\n }\n return candidate && typeof candidate === \"object\" ? candidate as Record<string, any> : undefined;\n}\n\nfunction formatErrorMessage(value: unknown): string | undefined {\n if (typeof value === \"string\") return value.trim() || undefined;\n if (Array.isArray(value)) {\n const messages = value.map(formatErrorMessage).filter((message): message is string => Boolean(message));\n return messages.length ? messages.join(\"; \") : undefined;\n }\n if (value && typeof value === \"object\") {\n const error = value as Record<string, unknown>;\n return formatErrorMessage(error.message)\n ?? formatErrorMessage(error.constraints)\n ?? formatErrorMessage(error.error);\n }\n return undefined;\n}\n\nfunction getSaveErrorMessage(error: unknown): string {\n if (!error || typeof error !== \"object\") return \"Failed to save skill.\";\n const apiError = error as Record<string, any>;\n // Nest validation details are nested at data.data.message; prefer them over\n // the generic outer \"Bad Request Exception\" message.\n return formatErrorMessage(apiError.data?.data?.message)\n ?? formatErrorMessage(apiError.data?.message)\n ?? formatErrorMessage(apiError.data?.error)\n ?? formatErrorMessage(apiError.message)\n ?? \"Failed to save skill.\";\n}\n\nfunction skillAgents(record?: SkillRecord): AgentReference[] {\n const related = record?.agentSkills;\n const links = Array.isArray(related)\n ? related\n : related\n ? [related]\n : [];\n const seen = new Set<string>();\n\n return links\n .map((link) => link.agentRegistry)\n .filter((agent): agent is AgentReference => Boolean(agent && typeof agent === \"object\"))\n .filter((agent) => {\n const key = String(agent.id ?? agent.name ?? agent.title ?? \"\");\n if (!key || seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nexport function AgentSkillRegistryEditorPage() {\n const { id = \"\" } = useParams<{ id: string }>();\n const [searchParams] = useSearchParams();\n const initialName = id === \"new\" ? searchParams.get(\"name\") ?? \"\" : \"\";\n const navigate = useNavigate();\n const dispatch = useDispatch();\n const entityApi = React.useMemo(() => createSolidEntityApi(\"agentSkillRegistry\"), []);\n const {\n useCreateSolidEntityMutation,\n useGetSolidEntityByIdQuery,\n useUpdateSolidEntityMutation,\n } = entityApi;\n\n const { data: response, isLoading, isFetching, refetch } = useGetSolidEntityByIdQuery(\n {\n id,\n qs: \"populate[0]=agentSkills&populate[1]=agentSkills.agentRegistry&populate[2]=tags&populate[3]=module\",\n },\n { skip: !id || id === \"new\" },\n );\n const [createSkill, { isLoading: isCreating }] = useCreateSolidEntityMutation();\n const [updateSkill, { isLoading: isSaving }] = useUpdateSolidEntityMutation();\n const record = extractEntityRecord(response) as SkillRecord | undefined;\n\n const [activeTab, setActiveTab] = React.useState(\"general\");\n const [name, setName] = React.useState(\"\");\n const [type, setType] = React.useState(\"custom\");\n const [iconName, setIconName] = React.useState(\"\");\n const [description, setDescription] = React.useState(\"\");\n const [body, setBody] = React.useState(\"\");\n const [previewBody, setPreviewBody] = React.useState(false);\n const [tags, setTags] = React.useState<AgentHubTag[]>([]);\n const [module, setModule] = React.useState<AgentHubModule | null>(null);\n const [creatingTag, setCreatingTag] = React.useState(false);\n const [fieldErrors, setFieldErrors] = React.useState<Record<string, string>>({});\n const [auditRefreshVersion, setAuditRefreshVersion] = React.useState(0);\n const [confirmRefresh, setConfirmRefresh] = React.useState(false);\n const baseline = React.useRef(\"\");\n const currentForm = () => JSON.stringify({ name, type, iconName, description, body, tags, moduleId: module?.id ?? null });\n\n React.useEffect(() => {\n const nextTags = agentHubTagsFrom(record?.tags);\n const nextModule = agentHubModuleFrom(record?.module);\n setName(record?.name ?? initialName);\n setType(record?.type ?? \"custom\");\n setIconName(record?.iconName ?? \"\");\n setDescription(record?.description ?? \"\");\n setBody(record?.body ?? \"\");\n setTags(nextTags);\n setModule(nextModule);\n baseline.current = JSON.stringify({ name: record?.name ?? \"\", type: record?.type ?? \"custom\", iconName: record?.iconName ?? \"\", description: record?.description ?? \"\", body: record?.body ?? \"\", tags: nextTags, moduleId: nextModule?.id ?? null });\n }, [record]);\n\n const isReadOnly = record?.type === \"solidx\";\n const isDirty = Boolean(record?.id) && currentForm() !== baseline.current;\n const requestRefresh = () => isDirty ? setConfirmRefresh(true) : void refetch();\n\n const handleSave = async () => {\n if (creatingTag) return;\n const nextErrors: Record<string, string> = {};\n if (!name.trim()) nextErrors.name = \"Name is required.\";\n if (!type.trim()) nextErrors.type = \"Skill type is required.\";\n if (!description.trim()) nextErrors.description = \"Description is required.\";\n if (!body.trim()) nextErrors.body = \"Skill instructions are required.\";\n if (!module) nextErrors.module = \"Module is required. Select a module before saving this skill.\";\n\n setFieldErrors(nextErrors);\n if (Object.keys(nextErrors).length > 0) {\n setActiveTab(nextErrors.body ? \"skill\" : \"general\");\n dispatch(showToast({\n severity: \"error\",\n summary: \"Missing information\",\n detail: Object.values(nextErrors).join(\" \"),\n }));\n return;\n }\n\n const payload = {\n name: name.trim(),\n type,\n iconName: iconName || null,\n description: description.trim(),\n body,\n ...agentHubTagsPayload(tags),\n ...agentHubModulePayload(module),\n };\n\n try {\n if (record?.id) {\n await updateSkill({ id: record.id, data: payload }).unwrap();\n dispatch(showToast({\n severity: \"success\",\n summary: \"Saved\",\n detail: \"Skill updated successfully.\",\n }));\n setAuditRefreshVersion((version) => version + 1);\n refetch();\n } else {\n const result: any = await createSkill(payload).unwrap();\n const createdId = result?.data?.id ?? result?.id;\n dispatch(showToast({\n severity: \"success\",\n summary: \"Created\",\n detail: \"Skill created successfully.\",\n }));\n if (createdId) {\n navigate(`/admin/core/solid-core/agent-skill-registry/editor/${createdId}`, {\n replace: true,\n });\n }\n }\n } catch (error: any) {\n const errorDetail = getSaveErrorMessage(error);\n const serverFieldErrors: Record<string, string> = {};\n if (/required|not be empty|cannot be empty|should not be empty/i.test(errorDetail)) {\n for (const field of [\"name\", \"type\", \"description\", \"body\", \"module\"]) {\n if (!new RegExp(`\\\\b${field}\\\\b`, \"i\").test(errorDetail)) continue;\n const label = field === \"body\" ? \"Skill instructions\" : field === \"module\" ? \"Module\" : field[0].toUpperCase() + field.slice(1);\n serverFieldErrors[field] = `${label} is required.`;\n }\n }\n if (Object.keys(serverFieldErrors).length > 0) {\n setFieldErrors(serverFieldErrors);\n setActiveTab(serverFieldErrors.body ? \"skill\" : \"general\");\n }\n dispatch(showToast({\n severity: \"error\",\n summary: \"Save failed\",\n detail: errorDetail,\n }));\n }\n };\n\n const agents = skillAgents(record);\n const tabs = [\n {\n value: \"general\",\n label: \"General Info\",\n content: (\n <fieldset className=\"agent-skill-editor__general\" disabled={isReadOnly}>\n {isReadOnly && <p className=\"agent-skill-editor__readonly-note\">SolidX skills cannot be edited.</p>}\n <div className=\"agent-skill-editor__fields\">\n <label className=\"agent-skill-editor__field\">\n <span>Name <b>*</b></span>\n <SolidInput\n value={name}\n aria-invalid={Boolean(fieldErrors.name)}\n aria-describedby={fieldErrors.name ? \"agent-skill-name-error\" : undefined}\n className={fieldErrors.name ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setName(event.target.value);\n setFieldErrors((current) => ({ ...current, name: \"\" }));\n }}\n />\n {fieldErrors.name && <small id=\"agent-skill-name-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.name}</small>}\n </label>\n <div className=\"agent-skill-editor__field\">\n <span>Icon</span>\n <SolidIconPicker value={iconName} onChange={setIconName} />\n </div>\n <label className=\"agent-skill-editor__field\">\n <span>Description <b>*</b></span>\n <SolidInput\n value={description}\n aria-invalid={Boolean(fieldErrors.description)}\n aria-describedby={fieldErrors.description ? \"agent-skill-description-error\" : undefined}\n className={fieldErrors.description ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setDescription(event.target.value);\n setFieldErrors((current) => ({ ...current, description: \"\" }));\n }}\n />\n {fieldErrors.description && <small id=\"agent-skill-description-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.description}</small>}\n </label>\n </div>\n <label className=\"agent-skill-editor__field\">\n <span>Skill type <b>*</b></span>\n <select\n value={type}\n aria-invalid={Boolean(fieldErrors.type)}\n aria-describedby={fieldErrors.type ? \"agent-skill-type-error\" : undefined}\n className={fieldErrors.type ? \"agent-skill-editor__input--invalid\" : undefined}\n onChange={(event) => {\n setType(event.target.value);\n setFieldErrors((current) => ({ ...current, type: \"\" }));\n }}\n >\n {isReadOnly && <option value=\"solidx\">SolidX</option>}\n <option value=\"thirdparty\">Third Party</option>\n <option value=\"custom\">Custom</option>\n </select>\n {fieldErrors.type && <small id=\"agent-skill-type-error\" className=\"agent-skill-editor__field-error\">{fieldErrors.type}</small>}\n </label>\n <AgentHubModuleField className=\"agent-skill-editor__field\" value={module} onChange={(value) => { setModule(value); setFieldErrors((current) => ({ ...current, module: \"\" })); }} disabled={isReadOnly || isCreating || isSaving} clearable={false} required error={fieldErrors.module} />\n <AgentHubTagsField value={tags} onChange={setTags} module={module} disabled={isReadOnly || isCreating || isSaving} onBusyChange={setCreatingTag} />\n </fieldset>\n ),\n },\n {\n value: \"skill\",\n label: \"Skill\",\n content: (\n <div className=\"agent-skill-editor__skill\">\n <section className=\"agent-skill-editor__panel\">\n <header>\n <div><h2>Skill instructions <b>*</b></h2>\n <p>Write the skill's Markdown body here.</p></div>\n <button type=\"button\" className=\"agent-skill-editor__preview-toggle\" aria-pressed={previewBody} aria-label={previewBody ? \"Edit skill body\" : \"Preview skill body\"} title={previewBody ? \"Edit skill body\" : \"Preview skill body\"} onClick={() => setPreviewBody((current) => !current)}>\n {previewBody ? <Pencil size={15} aria-hidden=\"true\" /> : <Eye size={15} aria-hidden=\"true\" />}\n </button>\n </header>\n {previewBody ? <div className=\"agent-skill-editor__preview\" role=\"region\" aria-label=\"Skill body preview\">{body.trim() ? <SolidAgentMarkdown text={body} /> : <p className=\"agent-skill-editor__preview-empty\">Nothing to preview yet.</p>}</div> : <SolidCodeEditor\n value={body}\n onChange={(value) => {\n setBody(value ?? \"\");\n setFieldErrors((current) => ({ ...current, body: \"\" }));\n }}\n language=\"markdown\"\n wordWrap=\"on\"\n readOnly={isReadOnly}\n fontSize={11}\n height=\"max(32rem, calc(100dvh - 18rem))\"\n className={`agent-skill-editor__code${fieldErrors.body ? \" agent-skill-editor__code--invalid\" : \"\"}`}\n />}\n {fieldErrors.body && <small className=\"agent-skill-editor__field-error agent-skill-editor__body-error\">{fieldErrors.body}</small>}\n </section>\n </div>\n ),\n },\n {\n value: \"agents\",\n label: \"Agents\",\n content: (\n <section className=\"agent-skill-editor__agents\">\n <div>\n <h2>Associated agents</h2>\n <p>Agents linked to this skill. Associations are read-only here.</p>\n </div>\n {isLoading ? (\n <p>Loading associated agents…</p>\n ) : agents.length ? (\n <div className=\"agent-skill-editor__agent-grid\">\n {agents.map((agent, index) => (\n <article className=\"agent-skill-editor__agent-card\" key={String(agent.id ?? agent.name ?? index)}>\n <span>{(agent.name ?? agent.title ?? \"A\").slice(0, 1).toUpperCase()}</span>\n <strong>{agent.name ?? agent.title ?? \"Unnamed agent\"}</strong>\n </article>\n ))}\n </div>\n ) : (\n <div className=\"agent-skill-editor__empty\">No agents are currently associated with this skill.</div>\n )}\n </section>\n ),\n },\n ];\n\n return (\n <main className=\"agent-skill-editor\">\n <header className=\"agent-skill-editor__header\">\n <div>\n <div className=\"agent-skill-editor__heading-with-refresh\"><h1>{record ? \"Edit Skill\" : \"Create Skill\"}</h1>{record?.id && <button type=\"button\" className={`agent-skill-editor__refresh${isFetching ? \" is-loading\" : \"\"}`} aria-label=\"Refresh skill\" title=\"Refresh skill\" disabled={isFetching || isSaving} onClick={requestRefresh}><RefreshCw size={14} /></button>}</div>\n </div>\n <div className=\"agent-skill-editor__actions\">\n <SolidButton variant=\"secondary\" leftIcon={<ArrowLeft size={16} />} onClick={() => navigate(-1)}>\n Back\n </SolidButton>\n {!isReadOnly && (\n <SolidButton loading={isCreating || isSaving} disabled={creatingTag} onClick={handleSave}>\n Save Skill\n </SolidButton>\n )}\n </div>\n </header>\n\n <SolidDialog open={confirmRefresh} onOpenChange={setConfirmRefresh} header=\"Discard unsaved changes?\" style={{ width: \"min(28rem, 94vw)\" }}\n footer={<><SolidButton type=\"button\" variant=\"secondary\" onClick={() => setConfirmRefresh(false)}>Cancel</SolidButton><SolidButton type=\"button\" disabled={isFetching} onClick={() => { setConfirmRefresh(false); void refetch(); }}>Refresh and discard</SolidButton></>}>\n <SolidDialogBody><p>You have unsaved changes. Refreshing will discard them and load the latest skill content.</p></SolidDialogBody>\n </SolidDialog>\n\n {isLoading ? (\n <div className=\"agent-skill-editor__loading\">Loading skill…</div>\n ) : record?.id ? (\n <AgentRegistryAuditPanel\n modelSingularName=\"agentSkillRegistry\"\n recordId={record.id}\n refreshVersion={auditRefreshVersion}\n modelUserKey={record.name}\n >\n <SolidTabGroup\n tabs={tabs}\n value={activeTab}\n onValueChange={setActiveTab}\n className=\"agent-skill-editor__tabs\"\n listClassName=\"agent-skill-editor__tab-list\"\n panelClassName=\"agent-skill-editor__tab-panel\"\n />\n </AgentRegistryAuditPanel>\n ) : (\n <SolidTabGroup\n tabs={tabs}\n value={activeTab}\n onValueChange={setActiveTab}\n className=\"agent-skill-editor__tabs\"\n listClassName=\"agent-skill-editor__tab-list\"\n panelClassName=\"agent-skill-editor__tab-panel\"\n />\n )}\n </main>\n );\n}\n"]}
@@ -1,12 +1,13 @@
1
1
  import React from "react";
2
- import { ArrowLeft, RefreshCw } from "lucide-react";
2
+ import { ArrowLeft, Eye, Pencil, RefreshCw } from "lucide-react";
3
3
  import { useDispatch } from "react-redux";
4
- import { useNavigate, useParams } from "react-router-dom";
4
+ import { useNavigate, useParams, useSearchParams } from "react-router-dom";
5
5
  import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
6
6
  import { showToast } from "../../../../redux/features/toastSlice";
7
7
  import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
8
8
  import { AgentHubTagsField, agentHubTagsFrom, agentHubTagsPayload, type AgentHubTag } from "./AgentHubTagsField";
9
9
  import { AgentHubModuleField, agentHubModuleFrom, agentHubModulePayload, type AgentHubModule } from "./AgentHubModuleField";
10
+ import { SolidAgentMarkdown } from "../../../../components/core/solid-agent/SolidAgentMarkdown";
10
11
  import {
11
12
  SolidButton,
12
13
  SolidCodeEditor,
@@ -97,6 +98,8 @@ function skillAgents(record?: SkillRecord): AgentReference[] {
97
98
 
98
99
  export function AgentSkillRegistryEditorPage() {
99
100
  const { id = "" } = useParams<{ id: string }>();
101
+ const [searchParams] = useSearchParams();
102
+ const initialName = id === "new" ? searchParams.get("name") ?? "" : "";
100
103
  const navigate = useNavigate();
101
104
  const dispatch = useDispatch();
102
105
  const entityApi = React.useMemo(() => createSolidEntityApi("agentSkillRegistry"), []);
@@ -123,6 +126,7 @@ export function AgentSkillRegistryEditorPage() {
123
126
  const [iconName, setIconName] = React.useState("");
124
127
  const [description, setDescription] = React.useState("");
125
128
  const [body, setBody] = React.useState("");
129
+ const [previewBody, setPreviewBody] = React.useState(false);
126
130
  const [tags, setTags] = React.useState<AgentHubTag[]>([]);
127
131
  const [module, setModule] = React.useState<AgentHubModule | null>(null);
128
132
  const [creatingTag, setCreatingTag] = React.useState(false);
@@ -135,7 +139,7 @@ export function AgentSkillRegistryEditorPage() {
135
139
  React.useEffect(() => {
136
140
  const nextTags = agentHubTagsFrom(record?.tags);
137
141
  const nextModule = agentHubModuleFrom(record?.module);
138
- setName(record?.name ?? "");
142
+ setName(record?.name ?? initialName);
139
143
  setType(record?.type ?? "custom");
140
144
  setIconName(record?.iconName ?? "");
141
145
  setDescription(record?.description ?? "");
@@ -297,10 +301,13 @@ export function AgentSkillRegistryEditorPage() {
297
301
  <div className="agent-skill-editor__skill">
298
302
  <section className="agent-skill-editor__panel">
299
303
  <header>
300
- <h2>Skill instructions <b>*</b></h2>
301
- <p>Write the skill's Markdown body here.</p>
304
+ <div><h2>Skill instructions <b>*</b></h2>
305
+ <p>Write the skill's Markdown body here.</p></div>
306
+ <button type="button" className="agent-skill-editor__preview-toggle" aria-pressed={previewBody} aria-label={previewBody ? "Edit skill body" : "Preview skill body"} title={previewBody ? "Edit skill body" : "Preview skill body"} onClick={() => setPreviewBody((current) => !current)}>
307
+ {previewBody ? <Pencil size={15} aria-hidden="true" /> : <Eye size={15} aria-hidden="true" />}
308
+ </button>
302
309
  </header>
303
- <SolidCodeEditor
310
+ {previewBody ? <div className="agent-skill-editor__preview" role="region" aria-label="Skill body preview">{body.trim() ? <SolidAgentMarkdown text={body} /> : <p className="agent-skill-editor__preview-empty">Nothing to preview yet.</p>}</div> : <SolidCodeEditor
304
311
  value={body}
305
312
  onChange={(value) => {
306
313
  setBody(value ?? "");
@@ -312,7 +319,7 @@ export function AgentSkillRegistryEditorPage() {
312
319
  fontSize={11}
313
320
  height="max(32rem, calc(100dvh - 18rem))"
314
321
  className={`agent-skill-editor__code${fieldErrors.body ? " agent-skill-editor__code--invalid" : ""}`}
315
- />
322
+ />}
316
323
  {fieldErrors.body && <small className="agent-skill-editor__field-error agent-skill-editor__body-error">{fieldErrors.body}</small>}
317
324
  </section>
318
325
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"AgentToolRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx"],"names":[],"mappings":"AAcA,OAAO,mCAAmC,CAAC;AA8D3C,wBAAgB,2BAA2B,4CAqN1C"}
1
+ {"version":3,"file":"AgentToolRegistryEditorPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx"],"names":[],"mappings":"AAgBA,OAAO,mCAAmC,CAAC;AA8D3C,wBAAgB,2BAA2B,4CA0N1C"}
@@ -45,12 +45,23 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
+ if (ar || !(i in from)) {
51
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
+ ar[i] = from[i];
53
+ }
54
+ }
55
+ return to.concat(ar || Array.prototype.slice.call(from));
56
+ };
48
57
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
49
58
  import React from "react";
50
59
  import { ArrowLeft, RefreshCw } from "lucide-react";
51
60
  import { useDispatch } from "react-redux";
52
- import { useNavigate, useParams } from "react-router-dom";
61
+ import { useNavigate, useParams, useSearchParams } from "react-router-dom";
53
62
  import { createSolidEntityApi } from "../../../../redux/api/solidEntityApi";
63
+ import { hasAnyRole } from "../../../../helpers/rolesHelper";
64
+ import { useSession } from "../../../../hooks/useSession";
54
65
  import { showToast } from "../../../../redux/features/toastSlice";
55
66
  import { solidPatch } from "../../../../http/solidHttp";
56
67
  import { AgentRegistryAuditPanel } from "./AgentRegistryAuditPanel";
@@ -110,30 +121,34 @@ function getSaveErrorMessage(error) {
110
121
  }
111
122
  export function AgentToolRegistryEditorPage() {
112
123
  var _this = this;
113
- var _a;
114
- var _b = useParams().id, id = _b === void 0 ? "" : _b;
124
+ var _a, _b, _c;
125
+ var _d = useParams().id, id = _d === void 0 ? "" : _d;
126
+ var searchParams = useSearchParams()[0];
127
+ var initialName = id === "new" ? (_a = searchParams.get("name")) !== null && _a !== void 0 ? _a : "" : "";
128
+ var session = useSession().data;
129
+ var isAdmin = hasAnyRole((_b = session === null || session === void 0 ? void 0 : session.user) === null || _b === void 0 ? void 0 : _b.roles, ["Admin"]);
115
130
  var navigate = useNavigate();
116
131
  var dispatch = useDispatch();
117
132
  var entityApi = React.useMemo(function () { return createSolidEntityApi("agentToolRegistry"); }, []);
118
133
  var useCreateSolidEntityMutation = entityApi.useCreateSolidEntityMutation, useGetSolidEntityByIdQuery = entityApi.useGetSolidEntityByIdQuery, useUpdateSolidEntityMutation = entityApi.useUpdateSolidEntityMutation;
119
- var _c = useGetSolidEntityByIdQuery({ id: id, qs: "populate[0]=agentTools&populate[1]=agentTools.agentRegistry&populate[2]=tags&populate[3]=module" }, { skip: !id || id === "new" }), response = _c.data, isLoading = _c.isLoading, isFetching = _c.isFetching, refetch = _c.refetch;
120
- var _d = useCreateSolidEntityMutation(), createTool = _d[0], isCreating = _d[1].isLoading;
121
- var _e = useUpdateSolidEntityMutation(), updateTool = _e[0], isSaving = _e[1].isLoading;
134
+ var _e = useGetSolidEntityByIdQuery({ id: id, qs: "populate[0]=agentTools&populate[1]=agentTools.agentRegistry&populate[2]=tags&populate[3]=module" }, { skip: !id || id === "new" }), response = _e.data, isLoading = _e.isLoading, isFetching = _e.isFetching, refetch = _e.refetch;
135
+ var _f = useCreateSolidEntityMutation(), createTool = _f[0], isCreating = _f[1].isLoading;
136
+ var _g = useUpdateSolidEntityMutation(), updateTool = _g[0], isSaving = _g[1].isLoading;
122
137
  var record = extractEntityRecord(response);
123
- var _f = React.useState("general"), activeTab = _f[0], setActiveTab = _f[1];
124
- var _g = React.useState(""), name = _g[0], setName = _g[1];
125
- var _h = React.useState(""), iconName = _h[0], setIconName = _h[1];
126
- var _j = React.useState(""), description = _j[0], setDescription = _j[1];
127
- var _k = React.useState("custom"), type = _k[0], setType = _k[1];
128
- var _l = React.useState(""), sourceCode = _l[0], setSourceCode = _l[1];
129
- var _m = React.useState([]), tags = _m[0], setTags = _m[1];
130
- var _o = React.useState(null), module = _o[0], setModule = _o[1];
131
- var _p = React.useState(false), creatingTag = _p[0], setCreatingTag = _p[1];
132
- var _q = React.useState({}), fieldErrors = _q[0], setFieldErrors = _q[1];
133
- var _r = React.useState(0), auditRefreshVersion = _r[0], setAuditRefreshVersion = _r[1];
134
- var _s = React.useState(false), confirmRefresh = _s[0], setConfirmRefresh = _s[1];
135
- var _t = React.useState(false), activationOpen = _t[0], setActivationOpen = _t[1];
136
- var _u = React.useState(null), activationTool = _u[0], setActivationTool = _u[1];
138
+ var _h = React.useState("general"), activeTab = _h[0], setActiveTab = _h[1];
139
+ var _j = React.useState(""), name = _j[0], setName = _j[1];
140
+ var _k = React.useState(""), iconName = _k[0], setIconName = _k[1];
141
+ var _l = React.useState(""), description = _l[0], setDescription = _l[1];
142
+ var _m = React.useState("custom"), type = _m[0], setType = _m[1];
143
+ var _o = React.useState(""), sourceCode = _o[0], setSourceCode = _o[1];
144
+ var _p = React.useState([]), tags = _p[0], setTags = _p[1];
145
+ var _q = React.useState(null), module = _q[0], setModule = _q[1];
146
+ var _r = React.useState(false), creatingTag = _r[0], setCreatingTag = _r[1];
147
+ var _s = React.useState({}), fieldErrors = _s[0], setFieldErrors = _s[1];
148
+ var _t = React.useState(0), auditRefreshVersion = _t[0], setAuditRefreshVersion = _t[1];
149
+ var _u = React.useState(false), confirmRefresh = _u[0], setConfirmRefresh = _u[1];
150
+ var _v = React.useState(false), activationOpen = _v[0], setActivationOpen = _v[1];
151
+ var _w = React.useState(null), activationTool = _w[0], setActivationTool = _w[1];
137
152
  var preparingActivation = React.useRef(false);
138
153
  var baseline = React.useRef("");
139
154
  var currentForm = function () { var _a; return JSON.stringify({ name: name, iconName: iconName, description: description, type: type, sourceCode: sourceCode, tags: tags, moduleId: (_a = module === null || module === void 0 ? void 0 : module.id) !== null && _a !== void 0 ? _a : null }); };
@@ -141,7 +156,7 @@ export function AgentToolRegistryEditorPage() {
141
156
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
142
157
  var nextTags = agentHubTagsFrom(record === null || record === void 0 ? void 0 : record.tags);
143
158
  var nextModule = agentHubModuleFrom(record === null || record === void 0 ? void 0 : record.module);
144
- setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a : "");
159
+ setName((_a = record === null || record === void 0 ? void 0 : record.name) !== null && _a !== void 0 ? _a : initialName);
145
160
  setIconName((_b = record === null || record === void 0 ? void 0 : record.iconName) !== null && _b !== void 0 ? _b : "");
146
161
  setDescription((_c = record === null || record === void 0 ? void 0 : record.description) !== null && _c !== void 0 ? _c : "");
147
162
  setType((_d = record === null || record === void 0 ? void 0 : record.type) !== null && _d !== void 0 ? _d : "custom");
@@ -293,8 +308,8 @@ export function AgentToolRegistryEditorPage() {
293
308
  });
294
309
  }, [record === null || record === void 0 ? void 0 : record.agentTools]);
295
310
  var sessionAgents = React.useMemo(function () { return agents.filter(function (agent) { return agent.id !== undefined && agent.id !== null; }); }, [agents]);
296
- var tabs = [
297
- { value: "general", label: "General Info", content: _jsxs("fieldset", { className: "agent-tool-editor__general", disabled: isReadOnly, children: [isReadOnly && _jsx("p", { className: "agent-tool-editor__readonly-note", children: "SolidX tools cannot be edited." }), (record === null || record === void 0 ? void 0 : record.status) && _jsxs("section", { className: "agent-tool-editor__runtime-status".concat(record.status === "load_failed" ? " agent-tool-editor__runtime-status--failed" : ""), role: record.status === "load_failed" ? "alert" : "status", children: [_jsxs("div", { className: "agent-tool-editor__runtime-heading", children: [_jsx("strong", { children: "Runtime status" }), _jsx("span", { children: record.status.replace(/[_-]+/g, " ") })] }), record.status === "load_failed" ? _jsxs(_Fragment, { children: [_jsx("p", { children: "The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it." }), record.lastLoadError && _jsx("pre", { children: record.lastLoadError })] }) : _jsx("p", { children: record.lastLoadError || "No tool load error has been reported." })] }), _jsxs("div", { className: "agent-tool-editor__fields", children: [_jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Name ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: name, "aria-invalid": Boolean(fieldErrors.name), "aria-describedby": fieldErrors.name ? "agent-tool-name-error" : undefined, className: fieldErrors.name ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setName(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { name: "" })); }); } }), fieldErrors.name && _jsx("small", { id: "agent-tool-name-error", className: "agent-tool-editor__field-error", children: fieldErrors.name })] }), _jsxs("div", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Description ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: description, "aria-invalid": Boolean(fieldErrors.description), "aria-describedby": fieldErrors.description ? "agent-tool-description-error" : undefined, className: fieldErrors.description ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setDescription(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { description: "" })); }); } }), fieldErrors.description && _jsx("small", { id: "agent-tool-description-error", className: "agent-tool-editor__field-error", children: fieldErrors.description })] })] }), !(record === null || record === void 0 ? void 0 : record.id) && _jsxs("label", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Tool status" }), _jsx("select", { value: "inactive", disabled: true, "aria-label": "Tool status", children: _jsx("option", { value: "inactive", children: "Inactive" }) }), _jsx("small", { children: "New tools start inactive. Run configuration and initialization checks to activate." })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Tool type ", _jsx("b", { children: "*" })] }), _jsxs("select", { value: type, "aria-invalid": Boolean(fieldErrors.type), "aria-describedby": fieldErrors.type ? "agent-tool-type-error" : undefined, className: fieldErrors.type ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setType(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { type: "" })); }); }, children: [isReadOnly && _jsx("option", { value: "solidx", children: "SolidX" }), _jsx("option", { value: "thirdparty", children: "Third Party" }), _jsx("option", { value: "custom", children: "Custom" })] }), fieldErrors.type && _jsx("small", { id: "agent-tool-type-error", className: "agent-tool-editor__field-error", children: fieldErrors.type })] }), _jsx(AgentHubModuleField, { className: "agent-tool-editor__field", value: module, onChange: function (value) { setModule(value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { module: "" })); }); }, disabled: isReadOnly || isCreating || isSaving, clearable: false, required: true, error: fieldErrors.module }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, module: module, disabled: isReadOnly || isCreating || isSaving, onBusyChange: setCreatingTag }), (record === null || record === void 0 ? void 0 : record.id) && _jsxs("section", { className: "agent-tool-editor__workflow", "aria-labelledby": "agent-tool-lifecycle-title", children: [_jsx("div", { className: "agent-tool-editor__workflow-head", children: _jsxs("div", { children: [_jsx("h2", { id: "agent-tool-lifecycle-title", children: "Tool lifecycle" }), _jsx("p", { children: "Configuration and initialization must pass before this tool can be activated." })] }) }), _jsx("div", { className: "agent-tool-editor__workflow-stages", "aria-label": "Current tool stage: ".concat(((_a = record.status) !== null && _a !== void 0 ? _a : "inactive").replace(/[_-]+/g, " ")), children: [["active", "Active", "Enabled for loading into linked agents."], ["inactive", "Inactive", "Not loaded for linked agents."], ["load_failed", "Load failed", "AgentHub could not load this tool."]].map(function (_a, index) {
311
+ var tabs = __spreadArray([
312
+ { value: "general", label: "General Info", content: _jsxs("fieldset", { className: "agent-tool-editor__general", disabled: isReadOnly, children: [isReadOnly && _jsx("p", { className: "agent-tool-editor__readonly-note", children: "SolidX tools cannot be edited." }), (record === null || record === void 0 ? void 0 : record.status) && _jsxs("section", { className: "agent-tool-editor__runtime-status".concat(record.status === "load_failed" ? " agent-tool-editor__runtime-status--failed" : ""), role: record.status === "load_failed" ? "alert" : "status", children: [_jsxs("div", { className: "agent-tool-editor__runtime-heading", children: [_jsx("strong", { children: "Runtime status" }), _jsx("span", { children: record.status.replace(/[_-]+/g, " ") })] }), record.status === "load_failed" ? _jsxs(_Fragment, { children: [_jsx("p", { children: "The AgentHub runtime could not load this tool. After correcting its source or checksum, restart linked agent processes so the runtime retries loading it." }), record.lastLoadError && _jsx("pre", { children: record.lastLoadError })] }) : _jsx("p", { children: record.lastLoadError || "No tool load error has been reported." })] }), _jsxs("div", { className: "agent-tool-editor__fields", children: [_jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Name ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: name, "aria-invalid": Boolean(fieldErrors.name), "aria-describedby": fieldErrors.name ? "agent-tool-name-error" : undefined, className: fieldErrors.name ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setName(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { name: "" })); }); } }), fieldErrors.name && _jsx("small", { id: "agent-tool-name-error", className: "agent-tool-editor__field-error", children: fieldErrors.name })] }), _jsxs("div", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Icon" }), _jsx(SolidIconPicker, { value: iconName, onChange: setIconName })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Description ", _jsx("b", { children: "*" })] }), _jsx(SolidInput, { value: description, "aria-invalid": Boolean(fieldErrors.description), "aria-describedby": fieldErrors.description ? "agent-tool-description-error" : undefined, className: fieldErrors.description ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setDescription(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { description: "" })); }); } }), fieldErrors.description && _jsx("small", { id: "agent-tool-description-error", className: "agent-tool-editor__field-error", children: fieldErrors.description })] })] }), !(record === null || record === void 0 ? void 0 : record.id) && _jsxs("label", { className: "agent-tool-editor__field", children: [_jsx("span", { children: "Tool status" }), _jsx("select", { value: "inactive", disabled: true, "aria-label": "Tool status", children: _jsx("option", { value: "inactive", children: "Inactive" }) }), _jsx("small", { children: "New tools start inactive. Run configuration and initialization checks to activate." })] }), _jsxs("label", { className: "agent-tool-editor__field", children: [_jsxs("span", { children: ["Tool type ", _jsx("b", { children: "*" })] }), _jsxs("select", { value: type, "aria-invalid": Boolean(fieldErrors.type), "aria-describedby": fieldErrors.type ? "agent-tool-type-error" : undefined, className: fieldErrors.type ? "agent-tool-editor__input--invalid" : undefined, onChange: function (e) { setType(e.target.value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { type: "" })); }); }, children: [isReadOnly && _jsx("option", { value: "solidx", children: "SolidX" }), _jsx("option", { value: "thirdparty", children: "Third Party" }), _jsx("option", { value: "custom", children: "Custom" })] }), fieldErrors.type && _jsx("small", { id: "agent-tool-type-error", className: "agent-tool-editor__field-error", children: fieldErrors.type })] }), _jsx(AgentHubModuleField, { className: "agent-tool-editor__field", value: module, onChange: function (value) { setModule(value); setFieldErrors(function (current) { return (__assign(__assign({}, current), { module: "" })); }); }, disabled: isReadOnly || isCreating || isSaving, clearable: false, required: true, error: fieldErrors.module }), _jsx(AgentHubTagsField, { value: tags, onChange: setTags, module: module, disabled: isReadOnly || isCreating || isSaving, onBusyChange: setCreatingTag }), (record === null || record === void 0 ? void 0 : record.id) && _jsxs("section", { className: "agent-tool-editor__workflow", "aria-labelledby": "agent-tool-lifecycle-title", children: [_jsx("div", { className: "agent-tool-editor__workflow-head", children: _jsxs("div", { children: [_jsx("h2", { id: "agent-tool-lifecycle-title", children: "Tool lifecycle" }), _jsx("p", { children: "Configuration and initialization must pass before this tool can be activated." })] }) }), _jsx("div", { className: "agent-tool-editor__workflow-stages", "aria-label": "Current tool stage: ".concat(((_c = record.status) !== null && _c !== void 0 ? _c : "inactive").replace(/[_-]+/g, " ")), children: [["active", "Active", "Enabled for loading into linked agents."], ["inactive", "Inactive", "Not loaded for linked agents."], ["load_failed", "Load failed", "AgentHub could not load this tool."]].map(function (_a, index) {
298
313
  var _b;
299
314
  var value = _a[0], label = _a[1], description = _a[2];
300
315
  var currentStatus = (_b = record.status) !== null && _b !== void 0 ? _b : "inactive";
@@ -304,9 +319,9 @@ export function AgentToolRegistryEditorPage() {
304
319
  return _jsxs(React.Fragment, { children: [index > 0 && _jsx("div", { className: "agent-tool-editor__workflow-connector", "aria-hidden": "true" }), _jsxs("button", { type: "button", className: "agent-tool-editor__workflow-stage agent-tool-editor__workflow-stage--".concat(value).concat(isCurrent ? " is-current" : ""), "aria-current": isCurrent ? "step" : undefined, "aria-pressed": isCurrent, disabled: disabled, onClick: function () { return value === "inactive" ? void save("inactive") : void beginActivation(); }, children: [_jsx("span", { className: "agent-tool-editor__workflow-mark", children: index + 1 }), _jsxs("span", { className: "agent-tool-editor__workflow-copy", children: [_jsx("strong", { children: label }), _jsx("small", { children: description }), _jsx("small", { className: "agent-tool-editor__workflow-cta", children: canRetry ? "Run checks and retry activation" : isCurrent ? "Current stage" : value === "load_failed" ? "Set automatically by AgentHub" : value === "active" ? "Run checks to activate" : "Click to deactivate" })] }), isCurrent && _jsx("span", { className: "agent-tool-editor__workflow-current", children: "Current" })] })] }, value);
305
320
  }) }), record.status === "load_failed" && _jsx("small", { className: "agent-tool-editor__workflow-hint", children: "Fix the source or checksum, then run configuration and initialization checks before retrying activation." }), _jsx("small", { className: "agent-tool-editor__workflow-hint", children: "Activation checks use the saved tool configuration. Restart linked agent processes to apply status changes." })] })] }) },
306
321
  { value: "tool", label: "Tool", content: _jsx("div", { className: "agent-tool-editor__tool", children: _jsxs("section", { className: "agent-tool-editor__panel", children: [_jsxs("header", { children: [_jsxs("h2", { children: ["Tool source code ", _jsx("b", { children: "*" })] }), _jsx("p", { children: "Write the tool's Python code here." })] }), _jsx(SolidCodeEditor, { value: sourceCode, onChange: function (value) { setSourceCode(value !== null && value !== void 0 ? value : ""); setFieldErrors(function (current) { return (__assign(__assign({}, current), { sourceCode: "" })); }); }, language: "python", wordWrap: "on", readOnly: isReadOnly, fontSize: 11, height: "max(32rem, calc(100dvh - 18rem))", className: "agent-tool-editor__code".concat(fieldErrors.sourceCode ? " agent-tool-editor__code--invalid" : "") }), fieldErrors.sourceCode && _jsx("small", { className: "agent-tool-editor__field-error agent-tool-editor__code-error", children: fieldErrors.sourceCode })] }) }) },
307
- { value: "agents", label: "Agents", content: _jsxs("section", { className: "agent-tool-editor__agents", children: [_jsxs("div", { children: [_jsx("h2", { children: "Associated agents" }), _jsx("p", { children: "Agents linked to this tool. Associations are read-only here." })] }), isLoading ? _jsx("p", { children: "Loading associated agents\u2026" }) : agents.length ? _jsx("div", { className: "agent-tool-editor__agent-grid", children: agents.map(function (agent, index) { var _a, _b; return _jsx("div", { className: "agent-tool-editor__agent-card", children: _jsx(SharedAgentRegistryCard, { rowData: agent }) }, String((_b = (_a = agent.id) !== null && _a !== void 0 ? _a : agent.name) !== null && _b !== void 0 ? _b : index)); }) }) : _jsx("div", { className: "agent-tool-editor__empty", children: "No agents are currently associated with this tool." })] }) },
308
- { value: "sessions", label: "Sessions", content: _jsx(AgentToolSessionsPanel, { agents: sessionAgents }) },
309
- ];
322
+ { value: "agents", label: "Agents", content: _jsxs("section", { className: "agent-tool-editor__agents", children: [_jsxs("div", { children: [_jsx("h2", { children: "Associated agents" }), _jsx("p", { children: "Agents linked to this tool. Associations are read-only here." })] }), isLoading ? _jsx("p", { children: "Loading associated agents\u2026" }) : agents.length ? _jsx("div", { className: "agent-tool-editor__agent-grid", children: agents.map(function (agent, index) { var _a, _b; return _jsx("div", { className: "agent-tool-editor__agent-card", children: _jsx(SharedAgentRegistryCard, { rowData: agent }) }, String((_b = (_a = agent.id) !== null && _a !== void 0 ? _a : agent.name) !== null && _b !== void 0 ? _b : index)); }) }) : _jsx("div", { className: "agent-tool-editor__empty", children: "No agents are currently associated with this tool." })] }) }
323
+ ], (isAdmin ? [{ value: "sessions", label: "Sessions", content: _jsx(AgentToolSessionsPanel, { agents: sessionAgents }) }] : []), true);
324
+ var visibleActiveTab = !isAdmin && activeTab === "sessions" ? "general" : activeTab;
310
325
  return _jsxs("main", { className: "agent-tool-editor", children: [_jsxs("header", { className: "agent-tool-editor__header", children: [_jsx("div", { children: _jsxs("div", { className: "agent-tool-editor__heading-with-refresh", children: [_jsx("h1", { children: record ? "Edit Tool" : "Create Tool" }), (record === null || record === void 0 ? void 0 : record.id) && _jsx("button", { type: "button", className: "agent-tool-editor__refresh".concat(isFetching ? " is-loading" : ""), "aria-label": "Refresh tool", title: "Refresh tool", disabled: isFetching || isSaving, onClick: requestRefresh, children: _jsx(RefreshCw, { size: 14 }) })] }) }), _jsxs("div", { className: "agent-tool-editor__actions", children: [_jsx(SolidButton, { variant: "secondary", leftIcon: _jsx(ArrowLeft, { size: 16 }), onClick: function () { return navigate(-1); }, children: "Back" }), !isReadOnly && _jsx(SolidButton, { disabled: activationOpen || creatingTag, loading: isCreating || isSaving, onClick: function () { return void save(); }, children: "Save Tool" })] })] }), _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 tool content." }) }) }), activationOpen && activationTool && _jsx(AgentToolActivationDialog, { open: activationOpen, onOpenChange: setActivationOpen, toolId: activationTool.id, checksum: activationTool.checksum, toolName: activationTool.name, onActivated: function () { return __awaiter(_this, void 0, void 0, function () {
311
326
  return __generator(this, function (_a) {
312
327
  switch (_a.label) {
@@ -319,6 +334,6 @@ export function AgentToolRegistryEditorPage() {
319
334
  return [2 /*return*/];
320
335
  }
321
336
  });
322
- }); } }), isLoading ? _jsx("div", { className: "agent-tool-editor__loading", children: "Loading tool\u2026" }) : (record === null || record === void 0 ? void 0 : record.id) ? (_jsx(AgentRegistryAuditPanel, { modelSingularName: "agentToolRegistry", recordId: record.id, refreshVersion: auditRefreshVersion, modelUserKey: record.name, children: _jsx(SolidTabGroup, { tabs: tabs, value: activeTab, onValueChange: setActiveTab, className: "agent-tool-editor__tabs", listClassName: "agent-tool-editor__tab-list", panelClassName: "agent-tool-editor__tab-panel" }) })) : _jsx(SolidTabGroup, { tabs: tabs, value: activeTab, onValueChange: setActiveTab, className: "agent-tool-editor__tabs", listClassName: "agent-tool-editor__tab-list", panelClassName: "agent-tool-editor__tab-panel" })] });
337
+ }); } }), isLoading ? _jsx("div", { className: "agent-tool-editor__loading", children: "Loading tool\u2026" }) : (record === null || record === void 0 ? void 0 : record.id) ? (_jsx(AgentRegistryAuditPanel, { modelSingularName: "agentToolRegistry", recordId: record.id, refreshVersion: auditRefreshVersion, modelUserKey: record.name, children: _jsx(SolidTabGroup, { tabs: tabs, value: visibleActiveTab, onValueChange: setActiveTab, className: "agent-tool-editor__tabs", listClassName: "agent-tool-editor__tab-list", panelClassName: "agent-tool-editor__tab-panel" }) })) : _jsx(SolidTabGroup, { tabs: tabs, value: visibleActiveTab, onValueChange: setActiveTab, className: "agent-tool-editor__tabs", listClassName: "agent-tool-editor__tab-list", panelClassName: "agent-tool-editor__tab-panel" })] });
323
338
  }
324
339
  //# sourceMappingURL=AgentToolRegistryEditorPage.js.map