@stigmer/react 0.4.8 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (631) hide show
  1. package/action-menu/ActionMenu.d.ts +64 -0
  2. package/action-menu/ActionMenu.d.ts.map +1 -0
  3. package/action-menu/ActionMenu.js +78 -0
  4. package/action-menu/ActionMenu.js.map +1 -0
  5. package/action-menu/index.d.ts +3 -0
  6. package/action-menu/index.d.ts.map +1 -0
  7. package/action-menu/index.js +2 -0
  8. package/action-menu/index.js.map +1 -0
  9. package/action-menu/types.d.ts +65 -0
  10. package/action-menu/types.d.ts.map +1 -0
  11. package/action-menu/types.js +2 -0
  12. package/action-menu/types.js.map +1 -0
  13. package/agent/AgentCreationWizard.d.ts +55 -0
  14. package/agent/AgentCreationWizard.d.ts.map +1 -0
  15. package/agent/AgentCreationWizard.js +115 -0
  16. package/agent/AgentCreationWizard.js.map +1 -0
  17. package/agent/AgentDetailView.d.ts +77 -9
  18. package/agent/AgentDetailView.d.ts.map +1 -1
  19. package/agent/AgentDetailView.js +265 -87
  20. package/agent/AgentDetailView.js.map +1 -1
  21. package/agent/index.d.ts +8 -0
  22. package/agent/index.d.ts.map +1 -1
  23. package/agent/index.js +4 -0
  24. package/agent/index.js.map +1 -1
  25. package/agent/internal/agentToInput.d.ts +12 -0
  26. package/agent/internal/agentToInput.d.ts.map +1 -0
  27. package/agent/internal/agentToInput.js +72 -0
  28. package/agent/internal/agentToInput.js.map +1 -0
  29. package/agent/steps/CapabilitiesStep.d.ts +16 -0
  30. package/agent/steps/CapabilitiesStep.d.ts.map +1 -0
  31. package/agent/steps/CapabilitiesStep.js +80 -0
  32. package/agent/steps/CapabilitiesStep.js.map +1 -0
  33. package/agent/steps/IdentityStep.d.ts +18 -0
  34. package/agent/steps/IdentityStep.d.ts.map +1 -0
  35. package/agent/steps/IdentityStep.js +43 -0
  36. package/agent/steps/IdentityStep.js.map +1 -0
  37. package/agent/steps/ReviewStep.d.ts +23 -0
  38. package/agent/steps/ReviewStep.d.ts.map +1 -0
  39. package/agent/steps/ReviewStep.js +73 -0
  40. package/agent/steps/ReviewStep.js.map +1 -0
  41. package/agent/steps/types.d.ts +35 -0
  42. package/agent/steps/types.d.ts.map +1 -0
  43. package/agent/steps/types.js +16 -0
  44. package/agent/steps/types.js.map +1 -0
  45. package/agent/useCreateAgent.d.ts +45 -0
  46. package/agent/useCreateAgent.d.ts.map +1 -0
  47. package/agent/useCreateAgent.js +50 -0
  48. package/agent/useCreateAgent.js.map +1 -0
  49. package/agent/useUpdateAgent.d.ts +24 -0
  50. package/agent/useUpdateAgent.d.ts.map +1 -0
  51. package/agent/useUpdateAgent.js +35 -0
  52. package/agent/useUpdateAgent.js.map +1 -0
  53. package/dependency-graph/DependencyGraph.d.ts +37 -0
  54. package/dependency-graph/DependencyGraph.d.ts.map +1 -0
  55. package/dependency-graph/DependencyGraph.js +88 -0
  56. package/dependency-graph/DependencyGraph.js.map +1 -0
  57. package/dependency-graph/DependencyTreeNode.d.ts +23 -0
  58. package/dependency-graph/DependencyTreeNode.d.ts.map +1 -0
  59. package/dependency-graph/DependencyTreeNode.js +99 -0
  60. package/dependency-graph/DependencyTreeNode.js.map +1 -0
  61. package/dependency-graph/index.d.ts +4 -0
  62. package/dependency-graph/index.d.ts.map +1 -0
  63. package/dependency-graph/index.js +5 -0
  64. package/dependency-graph/index.js.map +1 -0
  65. package/dependency-graph/types.d.ts +130 -0
  66. package/dependency-graph/types.d.ts.map +1 -0
  67. package/dependency-graph/types.js +2 -0
  68. package/dependency-graph/types.js.map +1 -0
  69. package/dependency-graph/useDependencyGraph.d.ts +27 -0
  70. package/dependency-graph/useDependencyGraph.d.ts.map +1 -0
  71. package/dependency-graph/useDependencyGraph.js +129 -0
  72. package/dependency-graph/useDependencyGraph.js.map +1 -0
  73. package/empty-state/EmptyState.d.ts +29 -0
  74. package/empty-state/EmptyState.d.ts.map +1 -0
  75. package/empty-state/EmptyState.js +45 -0
  76. package/empty-state/EmptyState.js.map +1 -0
  77. package/empty-state/index.d.ts +4 -0
  78. package/empty-state/index.d.ts.map +1 -0
  79. package/empty-state/index.js +3 -0
  80. package/empty-state/index.js.map +1 -0
  81. package/empty-state/types.d.ts +73 -0
  82. package/empty-state/types.d.ts.map +1 -0
  83. package/empty-state/types.js +2 -0
  84. package/empty-state/types.js.map +1 -0
  85. package/empty-state/useEmptyState.d.ts +18 -0
  86. package/empty-state/useEmptyState.d.ts.map +1 -0
  87. package/empty-state/useEmptyState.js +72 -0
  88. package/empty-state/useEmptyState.js.map +1 -0
  89. package/feedback/StigmerToaster.d.ts +18 -0
  90. package/feedback/StigmerToaster.d.ts.map +1 -0
  91. package/feedback/StigmerToaster.js +31 -0
  92. package/feedback/StigmerToaster.js.map +1 -0
  93. package/feedback/index.d.ts +4 -0
  94. package/feedback/index.d.ts.map +1 -0
  95. package/feedback/index.js +3 -0
  96. package/feedback/index.js.map +1 -0
  97. package/feedback/toast.d.ts +14 -0
  98. package/feedback/toast.d.ts.map +1 -0
  99. package/feedback/toast.js +14 -0
  100. package/feedback/toast.js.map +1 -0
  101. package/feedback/types.d.ts +4 -0
  102. package/feedback/types.d.ts.map +1 -0
  103. package/feedback/types.js +2 -0
  104. package/feedback/types.js.map +1 -0
  105. package/index.d.ts +30 -10
  106. package/index.d.ts.map +1 -1
  107. package/index.js +29 -9
  108. package/index.js.map +1 -1
  109. package/inline-edit/InlineEditImage.d.ts +20 -0
  110. package/inline-edit/InlineEditImage.d.ts.map +1 -0
  111. package/inline-edit/InlineEditImage.js +85 -0
  112. package/inline-edit/InlineEditImage.js.map +1 -0
  113. package/inline-edit/InlineEditKeyValue.d.ts +29 -0
  114. package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
  115. package/inline-edit/InlineEditKeyValue.js +67 -0
  116. package/inline-edit/InlineEditKeyValue.js.map +1 -0
  117. package/inline-edit/InlineEditResourceList.d.ts +34 -0
  118. package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
  119. package/inline-edit/InlineEditResourceList.js +99 -0
  120. package/inline-edit/InlineEditResourceList.js.map +1 -0
  121. package/inline-edit/InlineEditSelect.d.ts +18 -0
  122. package/inline-edit/InlineEditSelect.d.ts.map +1 -0
  123. package/inline-edit/InlineEditSelect.js +54 -0
  124. package/inline-edit/InlineEditSelect.js.map +1 -0
  125. package/inline-edit/InlineEditText.d.ts +23 -0
  126. package/inline-edit/InlineEditText.d.ts.map +1 -0
  127. package/inline-edit/InlineEditText.js +79 -0
  128. package/inline-edit/InlineEditText.js.map +1 -0
  129. package/inline-edit/InlineEditTextarea.d.ts +22 -0
  130. package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
  131. package/inline-edit/InlineEditTextarea.js +83 -0
  132. package/inline-edit/InlineEditTextarea.js.map +1 -0
  133. package/inline-edit/index.d.ts +16 -0
  134. package/inline-edit/index.d.ts.map +1 -0
  135. package/inline-edit/index.js +8 -0
  136. package/inline-edit/index.js.map +1 -0
  137. package/inline-edit/types.d.ts +42 -0
  138. package/inline-edit/types.d.ts.map +1 -0
  139. package/inline-edit/types.js +2 -0
  140. package/inline-edit/types.js.map +1 -0
  141. package/inline-edit/useInlineFieldSave.d.ts +23 -0
  142. package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
  143. package/inline-edit/useInlineFieldSave.js +44 -0
  144. package/inline-edit/useInlineFieldSave.js.map +1 -0
  145. package/internal/Tabs.d.ts +4 -38
  146. package/internal/Tabs.d.ts.map +1 -1
  147. package/internal/Tabs.js +3 -62
  148. package/internal/Tabs.js.map +1 -1
  149. package/library/ImportResourceDialog.d.ts +43 -0
  150. package/library/ImportResourceDialog.d.ts.map +1 -0
  151. package/library/ImportResourceDialog.js +90 -0
  152. package/library/ImportResourceDialog.js.map +1 -0
  153. package/library/index.d.ts +7 -4
  154. package/library/index.d.ts.map +1 -1
  155. package/library/index.js +4 -2
  156. package/library/index.js.map +1 -1
  157. package/library/serialize-resource-yaml.d.ts +53 -0
  158. package/library/serialize-resource-yaml.d.ts.map +1 -1
  159. package/library/serialize-resource-yaml.js +275 -0
  160. package/library/serialize-resource-yaml.js.map +1 -1
  161. package/library/useExportResource.d.ts +56 -0
  162. package/library/useExportResource.d.ts.map +1 -0
  163. package/library/useExportResource.js +137 -0
  164. package/library/useExportResource.js.map +1 -0
  165. package/library/useImportResource.d.ts +84 -0
  166. package/library/useImportResource.d.ts.map +1 -0
  167. package/library/useImportResource.js +188 -0
  168. package/library/useImportResource.js.map +1 -0
  169. package/mcp-server/McpServerCreationWizard.d.ts +55 -0
  170. package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
  171. package/mcp-server/McpServerCreationWizard.js +121 -0
  172. package/mcp-server/McpServerCreationWizard.js.map +1 -0
  173. package/mcp-server/McpServerDetailView.d.ts +21 -1
  174. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  175. package/mcp-server/McpServerDetailView.js +113 -20
  176. package/mcp-server/McpServerDetailView.js.map +1 -1
  177. package/mcp-server/index.d.ts +8 -0
  178. package/mcp-server/index.d.ts.map +1 -1
  179. package/mcp-server/index.js +4 -0
  180. package/mcp-server/index.js.map +1 -1
  181. package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
  182. package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
  183. package/mcp-server/internal/mcpServerToInput.js +81 -0
  184. package/mcp-server/internal/mcpServerToInput.js.map +1 -0
  185. package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
  186. package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
  187. package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
  188. package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
  189. package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
  190. package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
  191. package/mcp-server/steps/IdentityTransportStep.js +73 -0
  192. package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
  193. package/mcp-server/steps/ReviewStep.d.ts +23 -0
  194. package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
  195. package/mcp-server/steps/ReviewStep.js +137 -0
  196. package/mcp-server/steps/ReviewStep.js.map +1 -0
  197. package/mcp-server/steps/types.d.ts +56 -0
  198. package/mcp-server/steps/types.d.ts.map +1 -0
  199. package/mcp-server/steps/types.js +27 -0
  200. package/mcp-server/steps/types.js.map +1 -0
  201. package/mcp-server/useCreateMcpServer.d.ts +45 -0
  202. package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
  203. package/mcp-server/useCreateMcpServer.js +50 -0
  204. package/mcp-server/useCreateMcpServer.js.map +1 -0
  205. package/mcp-server/useUpdateMcpServer.d.ts +24 -0
  206. package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
  207. package/mcp-server/useUpdateMcpServer.js +35 -0
  208. package/mcp-server/useUpdateMcpServer.js.map +1 -0
  209. package/package.json +8 -4
  210. package/resource-creation/CreationPicker.d.ts +60 -0
  211. package/resource-creation/CreationPicker.d.ts.map +1 -0
  212. package/resource-creation/CreationPicker.js +74 -0
  213. package/resource-creation/CreationPicker.js.map +1 -0
  214. package/resource-creation/StepIndicator.d.ts +28 -0
  215. package/resource-creation/StepIndicator.d.ts.map +1 -0
  216. package/resource-creation/StepIndicator.js +40 -0
  217. package/resource-creation/StepIndicator.js.map +1 -0
  218. package/resource-creation/TemplateCard.d.ts +24 -0
  219. package/resource-creation/TemplateCard.d.ts.map +1 -0
  220. package/resource-creation/TemplateCard.js +68 -0
  221. package/resource-creation/TemplateCard.js.map +1 -0
  222. package/resource-creation/TemplateGallery.d.ts +43 -0
  223. package/resource-creation/TemplateGallery.d.ts.map +1 -0
  224. package/resource-creation/TemplateGallery.js +78 -0
  225. package/resource-creation/TemplateGallery.js.map +1 -0
  226. package/resource-creation/WizardNav.d.ts +31 -0
  227. package/resource-creation/WizardNav.d.ts.map +1 -0
  228. package/resource-creation/WizardNav.js +29 -0
  229. package/resource-creation/WizardNav.js.map +1 -0
  230. package/resource-creation/WizardShell.d.ts +41 -0
  231. package/resource-creation/WizardShell.d.ts.map +1 -0
  232. package/resource-creation/WizardShell.js +55 -0
  233. package/resource-creation/WizardShell.js.map +1 -0
  234. package/resource-creation/index.d.ts +21 -0
  235. package/resource-creation/index.d.ts.map +1 -0
  236. package/resource-creation/index.js +14 -0
  237. package/resource-creation/index.js.map +1 -0
  238. package/resource-creation/templates/agent-templates.d.ts +15 -0
  239. package/resource-creation/templates/agent-templates.d.ts.map +1 -0
  240. package/resource-creation/templates/agent-templates.js +148 -0
  241. package/resource-creation/templates/agent-templates.js.map +1 -0
  242. package/resource-creation/templates/index.d.ts +5 -0
  243. package/resource-creation/templates/index.d.ts.map +1 -0
  244. package/resource-creation/templates/index.js +5 -0
  245. package/resource-creation/templates/index.js.map +1 -0
  246. package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
  247. package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
  248. package/resource-creation/templates/mcp-server-templates.js +92 -0
  249. package/resource-creation/templates/mcp-server-templates.js.map +1 -0
  250. package/resource-creation/templates/types.d.ts +48 -0
  251. package/resource-creation/templates/types.d.ts.map +1 -0
  252. package/resource-creation/templates/types.js +16 -0
  253. package/resource-creation/templates/types.js.map +1 -0
  254. package/resource-creation/types.d.ts +88 -0
  255. package/resource-creation/types.d.ts.map +1 -0
  256. package/resource-creation/types.js +2 -0
  257. package/resource-creation/types.js.map +1 -0
  258. package/resource-creation/useTemplateFilter.d.ts +43 -0
  259. package/resource-creation/useTemplateFilter.d.ts.map +1 -0
  260. package/resource-creation/useTemplateFilter.js +73 -0
  261. package/resource-creation/useTemplateFilter.js.map +1 -0
  262. package/resource-creation/useWizardState.d.ts +67 -0
  263. package/resource-creation/useWizardState.d.ts.map +1 -0
  264. package/resource-creation/useWizardState.js +143 -0
  265. package/resource-creation/useWizardState.js.map +1 -0
  266. package/resource-detail/ConfirmDialog.d.ts +44 -0
  267. package/resource-detail/ConfirmDialog.d.ts.map +1 -0
  268. package/resource-detail/ConfirmDialog.js +62 -0
  269. package/resource-detail/ConfirmDialog.js.map +1 -0
  270. package/resource-detail/ResourceActionBar.d.ts +42 -0
  271. package/resource-detail/ResourceActionBar.d.ts.map +1 -0
  272. package/resource-detail/ResourceActionBar.js +64 -0
  273. package/resource-detail/ResourceActionBar.js.map +1 -0
  274. package/resource-detail/ResourceDetailShell.d.ts +36 -0
  275. package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
  276. package/resource-detail/ResourceDetailShell.js +65 -0
  277. package/resource-detail/ResourceDetailShell.js.map +1 -0
  278. package/resource-detail/Section.d.ts +18 -0
  279. package/resource-detail/Section.d.ts.map +1 -0
  280. package/resource-detail/Section.js +18 -0
  281. package/resource-detail/Section.js.map +1 -0
  282. package/resource-detail/index.d.ts +15 -0
  283. package/resource-detail/index.d.ts.map +1 -0
  284. package/resource-detail/index.js +10 -0
  285. package/resource-detail/index.js.map +1 -0
  286. package/resource-detail/types.d.ts +146 -0
  287. package/resource-detail/types.d.ts.map +1 -0
  288. package/resource-detail/types.js +2 -0
  289. package/resource-detail/types.js.map +1 -0
  290. package/resource-detail/useConfirmAction.d.ts +41 -0
  291. package/resource-detail/useConfirmAction.d.ts.map +1 -0
  292. package/resource-detail/useConfirmAction.js +30 -0
  293. package/resource-detail/useConfirmAction.js.map +1 -0
  294. package/resource-detail/useCopyResource.d.ts +28 -0
  295. package/resource-detail/useCopyResource.d.ts.map +1 -0
  296. package/resource-detail/useCopyResource.js +46 -0
  297. package/resource-detail/useCopyResource.js.map +1 -0
  298. package/resource-detail/useDeleteResource.d.ts +40 -0
  299. package/resource-detail/useDeleteResource.d.ts.map +1 -0
  300. package/resource-detail/useDeleteResource.js +83 -0
  301. package/resource-detail/useDeleteResource.js.map +1 -0
  302. package/resource-detail/useDetailTabs.d.ts +46 -0
  303. package/resource-detail/useDetailTabs.d.ts.map +1 -0
  304. package/resource-detail/useDetailTabs.js +47 -0
  305. package/resource-detail/useDetailTabs.js.map +1 -0
  306. package/resource-workbench/components/BulkActionBar.d.ts +36 -0
  307. package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
  308. package/resource-workbench/components/BulkActionBar.js +35 -0
  309. package/resource-workbench/components/BulkActionBar.js.map +1 -0
  310. package/resource-workbench/components/ColumnHeader.d.ts +23 -0
  311. package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
  312. package/resource-workbench/components/ColumnHeader.js +25 -0
  313. package/resource-workbench/components/ColumnHeader.js.map +1 -0
  314. package/resource-workbench/components/FilterBar.d.ts +33 -0
  315. package/resource-workbench/components/FilterBar.d.ts.map +1 -0
  316. package/resource-workbench/components/FilterBar.js +72 -0
  317. package/resource-workbench/components/FilterBar.js.map +1 -0
  318. package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
  319. package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
  320. package/resource-workbench/components/ResourceAvatar.js +51 -0
  321. package/resource-workbench/components/ResourceAvatar.js.map +1 -0
  322. package/resource-workbench/components/ResourceCards.d.ts +39 -0
  323. package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
  324. package/resource-workbench/components/ResourceCards.js +41 -0
  325. package/resource-workbench/components/ResourceCards.js.map +1 -0
  326. package/resource-workbench/components/ResourceInspector.d.ts +26 -0
  327. package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
  328. package/resource-workbench/components/ResourceInspector.js +22 -0
  329. package/resource-workbench/components/ResourceInspector.js.map +1 -0
  330. package/resource-workbench/components/ResourceList.d.ts +39 -0
  331. package/resource-workbench/components/ResourceList.d.ts.map +1 -0
  332. package/resource-workbench/components/ResourceList.js +41 -0
  333. package/resource-workbench/components/ResourceList.js.map +1 -0
  334. package/resource-workbench/components/ResourceTable.d.ts +47 -0
  335. package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
  336. package/resource-workbench/components/ResourceTable.js +78 -0
  337. package/resource-workbench/components/ResourceTable.js.map +1 -0
  338. package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
  339. package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
  340. package/resource-workbench/components/ResourceWorkbench.js +170 -0
  341. package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
  342. package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
  343. package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
  344. package/resource-workbench/components/SelectionCheckbox.js +16 -0
  345. package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
  346. package/resource-workbench/components/StatusBadge.d.ts +31 -0
  347. package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
  348. package/resource-workbench/components/StatusBadge.js +75 -0
  349. package/resource-workbench/components/StatusBadge.js.map +1 -0
  350. package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
  351. package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
  352. package/resource-workbench/components/ViewSwitcher.js +37 -0
  353. package/resource-workbench/components/ViewSwitcher.js.map +1 -0
  354. package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
  355. package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
  356. package/resource-workbench/hooks/useResourceCollection.js +133 -0
  357. package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
  358. package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
  359. package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
  360. package/resource-workbench/hooks/useResourceFilters.js +105 -0
  361. package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
  362. package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
  363. package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
  364. package/resource-workbench/hooks/useResourceSelection.js +123 -0
  365. package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
  366. package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
  367. package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
  368. package/resource-workbench/hooks/useViewPreference.js +60 -0
  369. package/resource-workbench/hooks/useViewPreference.js.map +1 -0
  370. package/resource-workbench/index.d.ts +34 -0
  371. package/resource-workbench/index.d.ts.map +1 -0
  372. package/resource-workbench/index.js +19 -0
  373. package/resource-workbench/index.js.map +1 -0
  374. package/resource-workbench/types.d.ts +165 -0
  375. package/resource-workbench/types.d.ts.map +1 -0
  376. package/resource-workbench/types.js +2 -0
  377. package/resource-workbench/types.js.map +1 -0
  378. package/runner/RunnerDetailView.d.ts +44 -0
  379. package/runner/RunnerDetailView.d.ts.map +1 -0
  380. package/runner/RunnerDetailView.js +154 -0
  381. package/runner/RunnerDetailView.js.map +1 -0
  382. package/runner/RunnerListPanel.d.ts +26 -1
  383. package/runner/RunnerListPanel.d.ts.map +1 -1
  384. package/runner/RunnerListPanel.js +68 -46
  385. package/runner/RunnerListPanel.js.map +1 -1
  386. package/runner/index.d.ts +7 -1
  387. package/runner/index.d.ts.map +1 -1
  388. package/runner/index.js +3 -0
  389. package/runner/index.js.map +1 -1
  390. package/runner/shared.d.ts +31 -0
  391. package/runner/shared.d.ts.map +1 -0
  392. package/runner/shared.js +55 -0
  393. package/runner/shared.js.map +1 -0
  394. package/runner/useRunner.d.ts +37 -0
  395. package/runner/useRunner.d.ts.map +1 -0
  396. package/runner/useRunner.js +24 -0
  397. package/runner/useRunner.js.map +1 -0
  398. package/session/__tests__/group-sessions.test.js +3 -3
  399. package/session/__tests__/group-sessions.test.js.map +1 -1
  400. package/skill/SkillDetailView.d.ts +70 -7
  401. package/skill/SkillDetailView.d.ts.map +1 -1
  402. package/skill/SkillDetailView.js +107 -39
  403. package/skill/SkillDetailView.js.map +1 -1
  404. package/skill/SkillDiffDialog.d.ts +42 -0
  405. package/skill/SkillDiffDialog.d.ts.map +1 -0
  406. package/skill/SkillDiffDialog.js +72 -0
  407. package/skill/SkillDiffDialog.js.map +1 -0
  408. package/skill/SkillFileBrowser.d.ts +31 -0
  409. package/skill/SkillFileBrowser.d.ts.map +1 -0
  410. package/skill/SkillFileBrowser.js +105 -0
  411. package/skill/SkillFileBrowser.js.map +1 -0
  412. package/skill/SkillUploader.d.ts +39 -0
  413. package/skill/SkillUploader.d.ts.map +1 -0
  414. package/skill/SkillUploader.js +141 -0
  415. package/skill/SkillUploader.js.map +1 -0
  416. package/skill/index.d.ts +18 -0
  417. package/skill/index.d.ts.map +1 -1
  418. package/skill/index.js +9 -0
  419. package/skill/index.js.map +1 -1
  420. package/skill/internal/computeArtifactHash.d.ts +9 -0
  421. package/skill/internal/computeArtifactHash.d.ts.map +1 -0
  422. package/skill/internal/computeArtifactHash.js +14 -0
  423. package/skill/internal/computeArtifactHash.js.map +1 -0
  424. package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
  425. package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
  426. package/skill/internal/fetchAndUnpackArtifact.js +34 -0
  427. package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
  428. package/skill/usePushSkill.d.ts +53 -0
  429. package/skill/usePushSkill.d.ts.map +1 -0
  430. package/skill/usePushSkill.js +57 -0
  431. package/skill/usePushSkill.js.map +1 -0
  432. package/skill/useSkillArtifact.d.ts +37 -0
  433. package/skill/useSkillArtifact.d.ts.map +1 -0
  434. package/skill/useSkillArtifact.js +76 -0
  435. package/skill/useSkillArtifact.js.map +1 -0
  436. package/skill/useSkillDiff.d.ts +31 -0
  437. package/skill/useSkillDiff.d.ts.map +1 -0
  438. package/skill/useSkillDiff.js +97 -0
  439. package/skill/useSkillDiff.js.map +1 -0
  440. package/skill/useSkillDuplicateCheck.d.ts +34 -0
  441. package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
  442. package/skill/useSkillDuplicateCheck.js +58 -0
  443. package/skill/useSkillDuplicateCheck.js.map +1 -0
  444. package/skill/useSkillUpload.d.ts +69 -0
  445. package/skill/useSkillUpload.d.ts.map +1 -0
  446. package/skill/useSkillUpload.js +157 -0
  447. package/skill/useSkillUpload.js.map +1 -0
  448. package/skill/useSkillVersions.d.ts +46 -0
  449. package/skill/useSkillVersions.d.ts.map +1 -0
  450. package/skill/useSkillVersions.js +104 -0
  451. package/skill/useSkillVersions.js.map +1 -0
  452. package/src/action-menu/ActionMenu.tsx +151 -0
  453. package/src/action-menu/index.ts +9 -0
  454. package/src/action-menu/types.ts +70 -0
  455. package/src/agent/AgentCreationWizard.tsx +201 -0
  456. package/src/agent/AgentDetailView.tsx +817 -321
  457. package/src/agent/index.ts +16 -0
  458. package/src/agent/internal/agentToInput.ts +95 -0
  459. package/src/agent/steps/CapabilitiesStep.tsx +363 -0
  460. package/src/agent/steps/IdentityStep.tsx +259 -0
  461. package/src/agent/steps/ReviewStep.tsx +211 -0
  462. package/src/agent/steps/types.ts +53 -0
  463. package/src/agent/useCreateAgent.ts +76 -0
  464. package/src/agent/useUpdateAgent.ts +55 -0
  465. package/src/dependency-graph/DependencyGraph.tsx +153 -0
  466. package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
  467. package/src/dependency-graph/index.ts +15 -0
  468. package/src/dependency-graph/types.ts +131 -0
  469. package/src/dependency-graph/useDependencyGraph.ts +158 -0
  470. package/src/empty-state/EmptyState.tsx +90 -0
  471. package/src/empty-state/index.ts +9 -0
  472. package/src/empty-state/types.ts +81 -0
  473. package/src/empty-state/useEmptyState.ts +85 -0
  474. package/src/feedback/StigmerToaster.tsx +45 -0
  475. package/src/feedback/index.ts +3 -0
  476. package/src/feedback/toast.ts +13 -0
  477. package/src/feedback/types.ts +7 -0
  478. package/src/index.ts +270 -8
  479. package/src/inline-edit/InlineEditImage.tsx +208 -0
  480. package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
  481. package/src/inline-edit/InlineEditResourceList.tsx +325 -0
  482. package/src/inline-edit/InlineEditSelect.tsx +150 -0
  483. package/src/inline-edit/InlineEditText.tsx +211 -0
  484. package/src/inline-edit/InlineEditTextarea.tsx +209 -0
  485. package/src/inline-edit/index.ts +28 -0
  486. package/src/inline-edit/types.ts +47 -0
  487. package/src/inline-edit/useInlineFieldSave.ts +62 -0
  488. package/src/internal/Tabs.tsx +4 -164
  489. package/src/library/ImportResourceDialog.tsx +227 -0
  490. package/src/library/index.ts +18 -8
  491. package/src/library/serialize-resource-yaml.ts +356 -0
  492. package/src/library/useExportResource.ts +183 -0
  493. package/src/library/useImportResource.ts +253 -0
  494. package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
  495. package/src/mcp-server/McpServerDetailView.tsx +392 -105
  496. package/src/mcp-server/index.ts +16 -0
  497. package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
  498. package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
  499. package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
  500. package/src/mcp-server/steps/ReviewStep.tsx +297 -0
  501. package/src/mcp-server/steps/types.ts +85 -0
  502. package/src/mcp-server/useCreateMcpServer.ts +76 -0
  503. package/src/mcp-server/useUpdateMcpServer.ts +55 -0
  504. package/src/resource-creation/CreationPicker.tsx +292 -0
  505. package/src/resource-creation/StepIndicator.tsx +156 -0
  506. package/src/resource-creation/TemplateCard.tsx +143 -0
  507. package/src/resource-creation/TemplateGallery.tsx +222 -0
  508. package/src/resource-creation/WizardNav.tsx +163 -0
  509. package/src/resource-creation/WizardShell.tsx +124 -0
  510. package/src/resource-creation/index.ts +45 -0
  511. package/src/resource-creation/templates/agent-templates.ts +160 -0
  512. package/src/resource-creation/templates/index.ts +7 -0
  513. package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
  514. package/src/resource-creation/templates/types.ts +64 -0
  515. package/src/resource-creation/types.ts +105 -0
  516. package/src/resource-creation/useTemplateFilter.ts +117 -0
  517. package/src/resource-creation/useWizardState.ts +223 -0
  518. package/src/resource-detail/ConfirmDialog.tsx +127 -0
  519. package/src/resource-detail/ResourceActionBar.tsx +157 -0
  520. package/src/resource-detail/ResourceDetailShell.tsx +184 -0
  521. package/src/resource-detail/Section.tsx +78 -0
  522. package/src/resource-detail/index.ts +34 -0
  523. package/src/resource-detail/types.ts +177 -0
  524. package/src/resource-detail/useConfirmAction.ts +70 -0
  525. package/src/resource-detail/useCopyResource.ts +74 -0
  526. package/src/resource-detail/useDeleteResource.ts +110 -0
  527. package/src/resource-detail/useDetailTabs.ts +93 -0
  528. package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
  529. package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
  530. package/src/resource-workbench/components/FilterBar.tsx +173 -0
  531. package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
  532. package/src/resource-workbench/components/ResourceCards.tsx +126 -0
  533. package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
  534. package/src/resource-workbench/components/ResourceList.tsx +121 -0
  535. package/src/resource-workbench/components/ResourceTable.tsx +222 -0
  536. package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
  537. package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
  538. package/src/resource-workbench/components/StatusBadge.tsx +119 -0
  539. package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
  540. package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
  541. package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
  542. package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
  543. package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
  544. package/src/resource-workbench/index.ts +73 -0
  545. package/src/resource-workbench/types.ts +220 -0
  546. package/src/runner/RunnerDetailView.tsx +410 -0
  547. package/src/runner/RunnerListPanel.tsx +126 -111
  548. package/src/runner/index.ts +13 -1
  549. package/src/runner/shared.tsx +124 -0
  550. package/src/runner/useRunner.ts +59 -0
  551. package/src/session/__tests__/group-sessions.test.ts +5 -3
  552. package/src/skill/SkillDetailView.tsx +371 -165
  553. package/src/skill/SkillDiffDialog.tsx +213 -0
  554. package/src/skill/SkillFileBrowser.tsx +289 -0
  555. package/src/skill/SkillUploader.tsx +481 -0
  556. package/src/skill/index.ts +34 -0
  557. package/src/skill/internal/computeArtifactHash.ts +13 -0
  558. package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
  559. package/src/skill/usePushSkill.ts +101 -0
  560. package/src/skill/useSkillArtifact.ts +107 -0
  561. package/src/skill/useSkillDiff.ts +128 -0
  562. package/src/skill/useSkillDuplicateCheck.ts +92 -0
  563. package/src/skill/useSkillUpload.ts +231 -0
  564. package/src/skill/useSkillVersions.ts +165 -0
  565. package/src/styles.css +28 -0
  566. package/src/tabs/Tabs.tsx +184 -0
  567. package/src/tabs/index.ts +2 -0
  568. package/src/version-history/DiffFileList.tsx +111 -0
  569. package/src/version-history/DiffSummary.tsx +61 -0
  570. package/src/version-history/DiffViewer.tsx +163 -0
  571. package/src/version-history/MultiFileDiffView.tsx +114 -0
  572. package/src/version-history/VersionTimeline.tsx +232 -0
  573. package/src/version-history/VersionTimelineEntry.tsx +254 -0
  574. package/src/version-history/computeDiff.ts +61 -0
  575. package/src/version-history/computeMultiFileDiff.ts +97 -0
  576. package/src/version-history/index.ts +22 -0
  577. package/src/version-history/types.ts +129 -0
  578. package/styles.css +1 -1
  579. package/tabs/Tabs.d.ts +58 -0
  580. package/tabs/Tabs.d.ts.map +1 -0
  581. package/tabs/Tabs.js +80 -0
  582. package/tabs/Tabs.js.map +1 -0
  583. package/tabs/index.d.ts +3 -0
  584. package/tabs/index.d.ts.map +1 -0
  585. package/tabs/index.js +2 -0
  586. package/tabs/index.js.map +1 -0
  587. package/version-history/DiffFileList.d.ts +22 -0
  588. package/version-history/DiffFileList.d.ts.map +1 -0
  589. package/version-history/DiffFileList.js +37 -0
  590. package/version-history/DiffFileList.js.map +1 -0
  591. package/version-history/DiffSummary.d.ts +21 -0
  592. package/version-history/DiffSummary.d.ts.map +1 -0
  593. package/version-history/DiffSummary.js +16 -0
  594. package/version-history/DiffSummary.js.map +1 -0
  595. package/version-history/DiffViewer.d.ts +31 -0
  596. package/version-history/DiffViewer.d.ts.map +1 -0
  597. package/version-history/DiffViewer.js +60 -0
  598. package/version-history/DiffViewer.js.map +1 -0
  599. package/version-history/MultiFileDiffView.d.ts +30 -0
  600. package/version-history/MultiFileDiffView.d.ts.map +1 -0
  601. package/version-history/MultiFileDiffView.js +40 -0
  602. package/version-history/MultiFileDiffView.js.map +1 -0
  603. package/version-history/VersionTimeline.d.ts +29 -0
  604. package/version-history/VersionTimeline.d.ts.map +1 -0
  605. package/version-history/VersionTimeline.js +87 -0
  606. package/version-history/VersionTimeline.js.map +1 -0
  607. package/version-history/VersionTimelineEntry.d.ts +22 -0
  608. package/version-history/VersionTimelineEntry.d.ts.map +1 -0
  609. package/version-history/VersionTimelineEntry.js +98 -0
  610. package/version-history/VersionTimelineEntry.js.map +1 -0
  611. package/version-history/computeDiff.d.ts +16 -0
  612. package/version-history/computeDiff.d.ts.map +1 -0
  613. package/version-history/computeDiff.js +54 -0
  614. package/version-history/computeDiff.js.map +1 -0
  615. package/version-history/computeMultiFileDiff.d.ts +15 -0
  616. package/version-history/computeMultiFileDiff.d.ts.map +1 -0
  617. package/version-history/computeMultiFileDiff.js +83 -0
  618. package/version-history/computeMultiFileDiff.js.map +1 -0
  619. package/version-history/index.d.ts +14 -0
  620. package/version-history/index.d.ts.map +1 -0
  621. package/version-history/index.js +9 -0
  622. package/version-history/index.js.map +1 -0
  623. package/version-history/types.d.ts +106 -0
  624. package/version-history/types.d.ts.map +1 -0
  625. package/version-history/types.js +2 -0
  626. package/version-history/types.js.map +1 -0
  627. package/library/ResourceListView.d.ts +0 -174
  628. package/library/ResourceListView.d.ts.map +0 -1
  629. package/library/ResourceListView.js +0 -318
  630. package/library/ResourceListView.js.map +0 -1
  631. package/src/library/ResourceListView.tsx +0 -956
@@ -0,0 +1,150 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import type { InlineEditBaseProps, SelectOption } from "./types";
6
+
7
+ /** Props for {@link InlineEditSelect}. */
8
+ export interface InlineEditSelectProps extends InlineEditBaseProps {
9
+ /** Current selected value. */
10
+ readonly value: string;
11
+ /** Available options. */
12
+ readonly options: readonly SelectOption[];
13
+ /** Called when the user selects a new option. */
14
+ readonly onSave: (newValue: string) => Promise<boolean>;
15
+ }
16
+
17
+ /**
18
+ * Click-to-edit single-choice selector.
19
+ *
20
+ * In read mode, shows the current option label. On click, opens a radio
21
+ * group with all options. Selection triggers immediate save.
22
+ */
23
+ export function InlineEditSelect({
24
+ value,
25
+ options,
26
+ onSave,
27
+ disabled,
28
+ isSaving,
29
+ error,
30
+ className,
31
+ }: InlineEditSelectProps) {
32
+ const [isEditing, setIsEditing] = useState(false);
33
+ const containerRef = useRef<HTMLDivElement>(null);
34
+ const currentLabel = options.find((o) => o.value === value)?.label ?? value;
35
+
36
+ useEffect(() => {
37
+ if (!isEditing) return;
38
+ const handleClickOutside = (e: MouseEvent) => {
39
+ if (containerRef.current && !containerRef.current.contains(e.target as Node)) {
40
+ setIsEditing(false);
41
+ }
42
+ };
43
+ document.addEventListener("mousedown", handleClickOutside);
44
+ return () => document.removeEventListener("mousedown", handleClickOutside);
45
+ }, [isEditing]);
46
+
47
+ const handleSelect = useCallback(
48
+ async (newValue: string) => {
49
+ if (newValue === value) {
50
+ setIsEditing(false);
51
+ return;
52
+ }
53
+ const ok = await onSave(newValue);
54
+ if (ok) setIsEditing(false);
55
+ },
56
+ [value, onSave],
57
+ );
58
+
59
+ if (disabled || !isEditing) {
60
+ return (
61
+ <div className={cn("group/inline-edit", className)}>
62
+ <button
63
+ type="button"
64
+ onClick={() => { if (!disabled) setIsEditing(true); }}
65
+ disabled={disabled}
66
+ className={cn(
67
+ "inline-flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors",
68
+ !disabled && "hover:bg-accent-hover cursor-pointer",
69
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
70
+ )}
71
+ >
72
+ <span className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs font-medium text-foreground">
73
+ {currentLabel}
74
+ </span>
75
+ {!disabled && (
76
+ <ChevronDownIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
77
+ )}
78
+ </button>
79
+ </div>
80
+ );
81
+ }
82
+
83
+ return (
84
+ <div ref={containerRef} className={cn("flex flex-col gap-1", className)}>
85
+ <div className="rounded-lg border border-border bg-background p-1" role="radiogroup">
86
+ {options.map((option) => (
87
+ <button
88
+ key={option.value}
89
+ type="button"
90
+ role="radio"
91
+ aria-checked={option.value === value}
92
+ disabled={isSaving}
93
+ onClick={() => handleSelect(option.value)}
94
+ className={cn(
95
+ "flex w-full items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors",
96
+ option.value === value
97
+ ? "bg-muted-subtle text-foreground"
98
+ : "hover:bg-accent-hover text-foreground",
99
+ "disabled:opacity-50",
100
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
101
+ )}
102
+ >
103
+ <div className={cn(
104
+ "mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",
105
+ option.value === value
106
+ ? "border-primary bg-primary"
107
+ : "border-muted-foreground",
108
+ )}>
109
+ {option.value === value && (
110
+ <div className="size-1.5 rounded-full bg-primary-foreground" />
111
+ )}
112
+ </div>
113
+ <div className="min-w-0 flex-1">
114
+ <span className="text-sm font-medium">{option.label}</span>
115
+ {option.description && (
116
+ <p className="mt-0.5 text-xs text-muted-foreground">{option.description}</p>
117
+ )}
118
+ </div>
119
+ {isSaving && option.value !== value && (
120
+ <Spinner />
121
+ )}
122
+ </button>
123
+ ))}
124
+ </div>
125
+ {error && (
126
+ <p className="px-1 text-xs text-destructive" role="alert">{error}</p>
127
+ )}
128
+ </div>
129
+ );
130
+ }
131
+
132
+ // ---------------------------------------------------------------------------
133
+ // Icons
134
+ // ---------------------------------------------------------------------------
135
+
136
+ function ChevronDownIcon({ className }: { readonly className?: string }) {
137
+ return (
138
+ <svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
139
+ <path d="m4 6 4 4 4-4" />
140
+ </svg>
141
+ );
142
+ }
143
+
144
+ function Spinner() {
145
+ return (
146
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
147
+ <path d="M8 2a6 6 0 1 0 6 6" />
148
+ </svg>
149
+ );
150
+ }
@@ -0,0 +1,211 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import type { InlineEditBaseProps } from "./types";
6
+
7
+ /** Props for {@link InlineEditText}. */
8
+ export interface InlineEditTextProps extends InlineEditBaseProps {
9
+ /** Current field value. */
10
+ readonly value: string;
11
+ /** Called with the new value when the user confirms the edit. */
12
+ readonly onSave: (newValue: string) => Promise<boolean>;
13
+ /** Placeholder shown when value is empty (in both read and edit mode). */
14
+ readonly placeholder?: string;
15
+ /** Optional client-side validation. Return an error string to block save. */
16
+ readonly validate?: (value: string) => string | null;
17
+ /** Render as heading text (larger, bolder). */
18
+ readonly variant?: "default" | "heading";
19
+ }
20
+
21
+ /**
22
+ * Click-to-edit single-line text field.
23
+ *
24
+ * Displays the value as styled text. On click, transitions to an input
25
+ * with inline confirm/cancel controls. Confirm triggers `onSave`;
26
+ * cancel reverts. Escape key also cancels.
27
+ */
28
+ export function InlineEditText({
29
+ value,
30
+ onSave,
31
+ placeholder = "Click to edit",
32
+ validate,
33
+ variant = "default",
34
+ disabled,
35
+ isSaving,
36
+ error,
37
+ className,
38
+ }: InlineEditTextProps) {
39
+ const [isEditing, setIsEditing] = useState(false);
40
+ const [draft, setDraft] = useState(value);
41
+ const [localError, setLocalError] = useState<string | null>(null);
42
+ const inputRef = useRef<HTMLInputElement>(null);
43
+
44
+ useEffect(() => {
45
+ if (isEditing) {
46
+ setDraft(value);
47
+ setLocalError(null);
48
+ requestAnimationFrame(() => inputRef.current?.focus());
49
+ }
50
+ }, [isEditing, value]);
51
+
52
+ const handleConfirm = useCallback(async () => {
53
+ const trimmed = draft.trim();
54
+ if (trimmed === value) {
55
+ setIsEditing(false);
56
+ return;
57
+ }
58
+ if (validate) {
59
+ const err = validate(trimmed);
60
+ if (err) {
61
+ setLocalError(err);
62
+ return;
63
+ }
64
+ }
65
+ const ok = await onSave(trimmed);
66
+ if (ok) setIsEditing(false);
67
+ }, [draft, value, validate, onSave]);
68
+
69
+ const handleCancel = useCallback(() => {
70
+ setIsEditing(false);
71
+ setDraft(value);
72
+ setLocalError(null);
73
+ }, [value]);
74
+
75
+ const handleKeyDown = useCallback(
76
+ (e: React.KeyboardEvent) => {
77
+ if (e.key === "Enter") {
78
+ e.preventDefault();
79
+ handleConfirm();
80
+ } else if (e.key === "Escape") {
81
+ handleCancel();
82
+ }
83
+ },
84
+ [handleConfirm, handleCancel],
85
+ );
86
+
87
+ const displayError = localError || error;
88
+
89
+ if (disabled || !isEditing) {
90
+ return (
91
+ <div className={cn("group/inline-edit", className)}>
92
+ <button
93
+ type="button"
94
+ onClick={() => { if (!disabled) setIsEditing(true); }}
95
+ disabled={disabled}
96
+ className={cn(
97
+ "inline-flex w-full items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition-colors",
98
+ !disabled && "hover:bg-accent-hover cursor-pointer",
99
+ disabled && "cursor-default",
100
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
101
+ )}
102
+ >
103
+ <span
104
+ className={cn(
105
+ "min-w-0 truncate",
106
+ variant === "heading"
107
+ ? "text-lg font-semibold text-foreground"
108
+ : "text-sm text-foreground",
109
+ !value && "text-muted-foreground italic",
110
+ )}
111
+ >
112
+ {value || placeholder}
113
+ </span>
114
+ {!disabled && (
115
+ <PencilIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
116
+ )}
117
+ </button>
118
+ </div>
119
+ );
120
+ }
121
+
122
+ return (
123
+ <div className={cn("flex flex-col gap-1", className)}>
124
+ <div className="flex items-center gap-1.5">
125
+ <input
126
+ ref={inputRef}
127
+ type="text"
128
+ value={draft}
129
+ onChange={(e) => { setDraft(e.target.value); setLocalError(null); }}
130
+ onKeyDown={handleKeyDown}
131
+ disabled={isSaving}
132
+ placeholder={placeholder}
133
+ className={cn(
134
+ "flex-1 rounded-md border border-border bg-input-bg px-2 py-1 text-sm text-foreground",
135
+ "focus:outline-none focus:ring-2 focus:ring-ring",
136
+ "disabled:opacity-50",
137
+ variant === "heading" && "text-lg font-semibold",
138
+ displayError && "border-destructive",
139
+ )}
140
+ />
141
+ <button
142
+ type="button"
143
+ onClick={handleConfirm}
144
+ disabled={isSaving}
145
+ aria-label="Save"
146
+ className={cn(
147
+ "inline-flex size-7 items-center justify-center rounded-md",
148
+ "bg-primary text-primary-foreground hover:bg-primary-hover",
149
+ "disabled:opacity-50",
150
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
151
+ )}
152
+ >
153
+ {isSaving ? <Spinner /> : <CheckIcon className="size-3.5" />}
154
+ </button>
155
+ <button
156
+ type="button"
157
+ onClick={handleCancel}
158
+ disabled={isSaving}
159
+ aria-label="Cancel"
160
+ className={cn(
161
+ "inline-flex size-7 items-center justify-center rounded-md",
162
+ "border border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground",
163
+ "disabled:opacity-50",
164
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
165
+ )}
166
+ >
167
+ <XIcon className="size-3.5" />
168
+ </button>
169
+ </div>
170
+ {displayError && (
171
+ <p className="px-1 text-xs text-destructive" role="alert">{displayError}</p>
172
+ )}
173
+ </div>
174
+ );
175
+ }
176
+
177
+ // ---------------------------------------------------------------------------
178
+ // Icons
179
+ // ---------------------------------------------------------------------------
180
+
181
+ function PencilIcon({ className }: { readonly className?: string }) {
182
+ return (
183
+ <svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
184
+ <path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
185
+ </svg>
186
+ );
187
+ }
188
+
189
+ function CheckIcon({ className }: { readonly className?: string }) {
190
+ return (
191
+ <svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
192
+ <path d="m3 8.5 3.5 3.5 6.5-8" />
193
+ </svg>
194
+ );
195
+ }
196
+
197
+ function XIcon({ className }: { readonly className?: string }) {
198
+ return (
199
+ <svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
200
+ <path d="m4 4 8 8M12 4l-8 8" />
201
+ </svg>
202
+ );
203
+ }
204
+
205
+ function Spinner() {
206
+ return (
207
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
208
+ <path d="M8 2a6 6 0 1 0 6 6" />
209
+ </svg>
210
+ );
211
+ }
@@ -0,0 +1,209 @@
1
+ "use client";
2
+
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import type { InlineEditBaseProps } from "./types";
6
+
7
+ /** Props for {@link InlineEditTextarea}. */
8
+ export interface InlineEditTextareaProps extends InlineEditBaseProps {
9
+ /** Current field value. */
10
+ readonly value: string;
11
+ /** Called with the new value when the user confirms. */
12
+ readonly onSave: (newValue: string) => Promise<boolean>;
13
+ /** Placeholder shown when value is empty. */
14
+ readonly placeholder?: string;
15
+ /** Optional client-side validation. */
16
+ readonly validate?: (value: string) => string | null;
17
+ /** Minimum rows for the textarea. @default 3 */
18
+ readonly minRows?: number;
19
+ }
20
+
21
+ /**
22
+ * Click-to-edit multiline text field.
23
+ *
24
+ * In read mode, renders the value as preformatted text with expand/collapse.
25
+ * On click, opens a textarea with confirm/cancel. Ctrl+Enter confirms.
26
+ */
27
+ export function InlineEditTextarea({
28
+ value,
29
+ onSave,
30
+ placeholder = "Click to edit",
31
+ validate,
32
+ minRows = 3,
33
+ disabled,
34
+ isSaving,
35
+ error,
36
+ className,
37
+ }: InlineEditTextareaProps) {
38
+ const [isEditing, setIsEditing] = useState(false);
39
+ const [draft, setDraft] = useState(value);
40
+ const [localError, setLocalError] = useState<string | null>(null);
41
+ const textareaRef = useRef<HTMLTextAreaElement>(null);
42
+
43
+ useEffect(() => {
44
+ if (isEditing) {
45
+ setDraft(value);
46
+ setLocalError(null);
47
+ requestAnimationFrame(() => {
48
+ const ta = textareaRef.current;
49
+ if (ta) {
50
+ ta.focus();
51
+ ta.selectionStart = ta.value.length;
52
+ }
53
+ });
54
+ }
55
+ }, [isEditing, value]);
56
+
57
+ // Auto-resize textarea
58
+ useEffect(() => {
59
+ const ta = textareaRef.current;
60
+ if (!ta) return;
61
+ ta.style.height = "auto";
62
+ ta.style.height = `${ta.scrollHeight}px`;
63
+ }, [draft, isEditing]);
64
+
65
+ const handleConfirm = useCallback(async () => {
66
+ if (draft === value) {
67
+ setIsEditing(false);
68
+ return;
69
+ }
70
+ if (validate) {
71
+ const err = validate(draft);
72
+ if (err) {
73
+ setLocalError(err);
74
+ return;
75
+ }
76
+ }
77
+ const ok = await onSave(draft);
78
+ if (ok) setIsEditing(false);
79
+ }, [draft, value, validate, onSave]);
80
+
81
+ const handleCancel = useCallback(() => {
82
+ setIsEditing(false);
83
+ setDraft(value);
84
+ setLocalError(null);
85
+ }, [value]);
86
+
87
+ const handleKeyDown = useCallback(
88
+ (e: React.KeyboardEvent) => {
89
+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
90
+ e.preventDefault();
91
+ handleConfirm();
92
+ } else if (e.key === "Escape") {
93
+ handleCancel();
94
+ }
95
+ },
96
+ [handleConfirm, handleCancel],
97
+ );
98
+
99
+ const displayError = localError || error;
100
+
101
+ if (disabled || !isEditing) {
102
+ return (
103
+ <div className={cn("group/inline-edit", className)}>
104
+ <button
105
+ type="button"
106
+ onClick={() => { if (!disabled) setIsEditing(true); }}
107
+ disabled={disabled}
108
+ className={cn(
109
+ "w-full rounded-md px-2 py-1.5 text-left transition-colors",
110
+ !disabled && "hover:bg-accent-hover cursor-pointer",
111
+ disabled && "cursor-default",
112
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
113
+ )}
114
+ >
115
+ <div className="flex items-start justify-between gap-2">
116
+ <pre
117
+ className={cn(
118
+ "min-w-0 whitespace-pre-wrap break-words font-mono text-sm text-foreground",
119
+ !value && "text-muted-foreground italic font-sans",
120
+ )}
121
+ >
122
+ {value || placeholder}
123
+ </pre>
124
+ {!disabled && (
125
+ <PencilIcon className="mt-0.5 size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/inline-edit:opacity-100" />
126
+ )}
127
+ </div>
128
+ </button>
129
+ </div>
130
+ );
131
+ }
132
+
133
+ return (
134
+ <div className={cn("flex flex-col gap-1.5", className)}>
135
+ <textarea
136
+ ref={textareaRef}
137
+ value={draft}
138
+ onChange={(e) => { setDraft(e.target.value); setLocalError(null); }}
139
+ onKeyDown={handleKeyDown}
140
+ disabled={isSaving}
141
+ placeholder={placeholder}
142
+ rows={minRows}
143
+ className={cn(
144
+ "w-full resize-y rounded-md border border-border bg-input-bg px-3 py-2 font-mono text-sm text-foreground",
145
+ "focus:outline-none focus:ring-2 focus:ring-ring",
146
+ "disabled:opacity-50",
147
+ displayError && "border-destructive",
148
+ )}
149
+ />
150
+ <div className="flex items-center justify-between">
151
+ <span className="text-[10px] text-muted-foreground">
152
+ {isSaving ? "Saving..." : "Ctrl+Enter to save, Escape to cancel"}
153
+ </span>
154
+ <div className="flex items-center gap-1.5">
155
+ <button
156
+ type="button"
157
+ onClick={handleCancel}
158
+ disabled={isSaving}
159
+ className={cn(
160
+ "rounded-md px-2.5 py-1 text-xs font-medium",
161
+ "border border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground",
162
+ "disabled:opacity-50",
163
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
164
+ )}
165
+ >
166
+ Cancel
167
+ </button>
168
+ <button
169
+ type="button"
170
+ onClick={handleConfirm}
171
+ disabled={isSaving}
172
+ className={cn(
173
+ "inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium",
174
+ "bg-primary text-primary-foreground hover:bg-primary-hover",
175
+ "disabled:opacity-50",
176
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
177
+ )}
178
+ >
179
+ {isSaving && <Spinner />}
180
+ Save
181
+ </button>
182
+ </div>
183
+ </div>
184
+ {displayError && (
185
+ <p className="px-1 text-xs text-destructive" role="alert">{displayError}</p>
186
+ )}
187
+ </div>
188
+ );
189
+ }
190
+
191
+ // ---------------------------------------------------------------------------
192
+ // Icons
193
+ // ---------------------------------------------------------------------------
194
+
195
+ function PencilIcon({ className }: { readonly className?: string }) {
196
+ return (
197
+ <svg className={className} viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
198
+ <path d="M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z" />
199
+ </svg>
200
+ );
201
+ }
202
+
203
+ function Spinner() {
204
+ return (
205
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" className="animate-spin" aria-hidden="true">
206
+ <path d="M8 2a6 6 0 1 0 6 6" />
207
+ </svg>
208
+ );
209
+ }
@@ -0,0 +1,28 @@
1
+ export { InlineEditText } from "./InlineEditText";
2
+ export type { InlineEditTextProps } from "./InlineEditText";
3
+
4
+ export { InlineEditTextarea } from "./InlineEditTextarea";
5
+ export type { InlineEditTextareaProps } from "./InlineEditTextarea";
6
+
7
+ export { InlineEditImage } from "./InlineEditImage";
8
+ export type { InlineEditImageProps } from "./InlineEditImage";
9
+
10
+ export { InlineEditSelect } from "./InlineEditSelect";
11
+ export type { InlineEditSelectProps } from "./InlineEditSelect";
12
+
13
+ export { InlineEditKeyValue } from "./InlineEditKeyValue";
14
+ export type { InlineEditKeyValueProps } from "./InlineEditKeyValue";
15
+
16
+ export { InlineEditResourceList } from "./InlineEditResourceList";
17
+ export type { InlineEditResourceListProps } from "./InlineEditResourceList";
18
+
19
+ export { useInlineFieldSave } from "./useInlineFieldSave";
20
+ export type { UseInlineFieldSaveReturn } from "./useInlineFieldSave";
21
+
22
+ export type {
23
+ InlineEditBaseProps,
24
+ KeyValueRow,
25
+ ResourceRefRow,
26
+ SelectOption,
27
+ InlineFieldSaveResult,
28
+ } from "./types";
@@ -0,0 +1,47 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ /** Shared props for all inline edit components. */
4
+ export interface InlineEditBaseProps {
5
+ /** Whether editing is disabled (component renders as read-only). */
6
+ readonly disabled?: boolean;
7
+ /** `true` while a save operation is in flight. */
8
+ readonly isSaving?: boolean;
9
+ /** Error from the last failed save. Shown inline below the field. */
10
+ readonly error?: string | null;
11
+ /** Additional CSS classes for the root container. */
12
+ readonly className?: string;
13
+ }
14
+
15
+ /** Entry in an inline key-value editor. */
16
+ export interface KeyValueRow {
17
+ readonly key: string;
18
+ readonly value: string;
19
+ /** When `true`, renders a "secret" badge. */
20
+ readonly isSecret?: boolean;
21
+ /** Optional description shown as helper text. */
22
+ readonly description?: string;
23
+ /** When `true`, this row is optional. */
24
+ readonly optional?: boolean;
25
+ }
26
+
27
+ /** Entry in an inline resource reference list (MCP servers, skills, etc.). */
28
+ export interface ResourceRefRow {
29
+ readonly org: string;
30
+ readonly slug: string;
31
+ /** Display label (defaults to slug when omitted). */
32
+ readonly label?: string;
33
+ }
34
+
35
+ /** Single option for InlineEditSelect. */
36
+ export interface SelectOption {
37
+ readonly value: string;
38
+ readonly label: string;
39
+ readonly description?: string;
40
+ }
41
+
42
+ /** Save result returned to the inline component after a field save. */
43
+ export interface InlineFieldSaveResult<T = unknown> {
44
+ readonly success: boolean;
45
+ readonly data?: T;
46
+ readonly error?: string;
47
+ }