@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,24 @@
1
+ import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
2
+ import type { McpServerInput } from "@stigmer/sdk";
3
+ /** Return value of {@link useUpdateMcpServer}. */
4
+ export interface UseUpdateMcpServerReturn {
5
+ /** Update an existing MCP server with a full input. Returns the updated resource. */
6
+ readonly update: (input: McpServerInput) => Promise<McpServer>;
7
+ /** `true` while the update RPC is in flight. */
8
+ readonly isUpdating: boolean;
9
+ /** Error from the last failed update, or `null` when healthy. */
10
+ readonly error: Error | null;
11
+ /** Clear the error state. */
12
+ readonly clearError: () => void;
13
+ }
14
+ /**
15
+ * Mutation hook that updates an existing MCP Server resource.
16
+ *
17
+ * Wraps `stigmer.mcpServer.update(input)` with loading and error state.
18
+ * The caller must provide a **complete** `McpServerInput` — the backend
19
+ * performs full spec replacement. Use `mcpServerToInput()` to reconstruct
20
+ * the input from a fetched server, modify the desired field, and pass
21
+ * the result here.
22
+ */
23
+ export declare function useUpdateMcpServer(): UseUpdateMcpServerReturn;
24
+ //# sourceMappingURL=useUpdateMcpServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateMcpServer.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useUpdateMcpServer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/D,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,6BAA6B;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CAyB7D"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useCallback, useState } from "react";
3
+ import { useStigmer } from "../hooks";
4
+ import { toError } from "../internal/toError";
5
+ /**
6
+ * Mutation hook that updates an existing MCP Server resource.
7
+ *
8
+ * Wraps `stigmer.mcpServer.update(input)` with loading and error state.
9
+ * The caller must provide a **complete** `McpServerInput` — the backend
10
+ * performs full spec replacement. Use `mcpServerToInput()` to reconstruct
11
+ * the input from a fetched server, modify the desired field, and pass
12
+ * the result here.
13
+ */
14
+ export function useUpdateMcpServer() {
15
+ const stigmer = useStigmer();
16
+ const [isUpdating, setIsUpdating] = useState(false);
17
+ const [error, setError] = useState(null);
18
+ const clearError = useCallback(() => setError(null), []);
19
+ const update = useCallback(async (input) => {
20
+ setIsUpdating(true);
21
+ setError(null);
22
+ try {
23
+ return await stigmer.mcpServer.update(input);
24
+ }
25
+ catch (err) {
26
+ setError(toError(err));
27
+ throw err;
28
+ }
29
+ finally {
30
+ setIsUpdating(false);
31
+ }
32
+ }, [stigmer]);
33
+ return { update, isUpdating, error, clearError };
34
+ }
35
+ //# sourceMappingURL=useUpdateMcpServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateMcpServer.js","sourceRoot":"","sources":["../../src/mcp-server/useUpdateMcpServer.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAc9C;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,WAAW,CACxB,KAAK,EAAE,KAAqB,EAAsB,EAAE;QAClD,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACnD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/react",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "React provider and client hook for the Stigmer platform SDK",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -35,17 +35,21 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@stigmer/theme": "0.4.8",
38
+ "@stigmer/theme": "0.5.0",
39
+ "diff": "^8.0.3",
40
+ "fflate": "^0.8.2",
39
41
  "react-markdown": "^10.1.0",
40
42
  "remark-gfm": "^4.0.1",
43
+ "sonner": "^2.0.0",
41
44
  "streamdown": "^2.5.0",
42
45
  "yaml": "^2.8.2"
43
46
  },
44
47
  "peerDependencies": {
45
48
  "@base-ui/react": "^1.0.0",
46
49
  "@bufbuild/protobuf": "^2.0.0",
47
- "@stigmer/protos": "0.4.8",
48
- "@stigmer/sdk": "0.4.8",
50
+ "@stigmer/protos": "0.5.0",
51
+ "@stigmer/sdk": "0.5.0",
52
+ "@tanstack/react-table": "^8.20.0",
49
53
  "lucide-react": ">=0.400.0",
50
54
  "react": "^19.0.0",
51
55
  "react-dom": "^19.0.0",
@@ -0,0 +1,60 @@
1
+ import type { ResourceTemplate } from "./templates/types";
2
+ /**
3
+ * The creation path the user selected on the picker screen.
4
+ *
5
+ * - `"scratch"` — start the wizard with empty fields
6
+ * - `"template"` — start the wizard with template-provided data
7
+ * - `"import"` — open the import dialog (handled by the consumer)
8
+ */
9
+ export type CreationPath = {
10
+ readonly kind: "scratch";
11
+ } | {
12
+ readonly kind: "template";
13
+ readonly data: Partial<unknown>;
14
+ } | {
15
+ readonly kind: "import";
16
+ };
17
+ /** Props for {@link CreationPicker}. */
18
+ export interface CreationPickerProps<TData> {
19
+ /** Label for the resource type (e.g. "agent", "MCP server"). Used in headings. */
20
+ readonly resourceLabel: string;
21
+ /** Available templates for the gallery view. */
22
+ readonly templates: readonly ResourceTemplate<TData>[];
23
+ /** Called when the user selects a creation path. */
24
+ readonly onSelect: (path: CreationPath) => void;
25
+ /** Additional CSS classes for the root container. */
26
+ readonly className?: string;
27
+ }
28
+ /**
29
+ * "Step 0" landing screen for resource creation flows.
30
+ *
31
+ * Presents three creation entry points as large option cards:
32
+ * 1. **Start from scratch** — blank wizard
33
+ * 2. **Browse templates** — opens the template gallery inline
34
+ * 3. **Import from file** — triggers the import dialog
35
+ *
36
+ * When the user clicks "Browse templates", the picker transitions
37
+ * to show the `TemplateGallery` inline with a back button. Selecting
38
+ * a template emits `onSelect({ kind: "template", data })`.
39
+ *
40
+ * This component is SDK-first with zero Console dependencies. The
41
+ * consumer (e.g. `AgentNewPage`) handles routing, the import dialog,
42
+ * and mounting the wizard.
43
+ *
44
+ * @typeParam TData - The wizard data shape (e.g. `AgentWizardData`).
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <CreationPicker
49
+ * resourceLabel="agent"
50
+ * templates={AGENT_TEMPLATES}
51
+ * onSelect={(path) => {
52
+ * if (path.kind === "scratch") startWizard();
53
+ * if (path.kind === "template") startWizard(path.data);
54
+ * if (path.kind === "import") openImportDialog();
55
+ * }}
56
+ * />
57
+ * ```
58
+ */
59
+ export declare function CreationPicker<TData>({ resourceLabel, templates, onSelect, className, }: CreationPickerProps<TData>): import("react/jsx-runtime").JSX.Element;
60
+ //# sourceMappingURL=CreationPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreationPicker.d.ts","sourceRoot":"","sources":["../../src/resource-creation/CreationPicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAO1D;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEhC,wCAAwC;AACxC,MAAM,WAAW,mBAAmB,CAAC,KAAK;IACxC,kFAAkF;IAClF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IACvD,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,EACpC,aAAa,EACb,SAAS,EACT,QAAQ,EACR,SAAS,GACV,EAAE,mBAAmB,CAAC,KAAK,CAAC,2CAoF5B"}
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { TemplateGallery } from "./TemplateGallery";
6
+ // ---------------------------------------------------------------------------
7
+ // Component
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * "Step 0" landing screen for resource creation flows.
11
+ *
12
+ * Presents three creation entry points as large option cards:
13
+ * 1. **Start from scratch** — blank wizard
14
+ * 2. **Browse templates** — opens the template gallery inline
15
+ * 3. **Import from file** — triggers the import dialog
16
+ *
17
+ * When the user clicks "Browse templates", the picker transitions
18
+ * to show the `TemplateGallery` inline with a back button. Selecting
19
+ * a template emits `onSelect({ kind: "template", data })`.
20
+ *
21
+ * This component is SDK-first with zero Console dependencies. The
22
+ * consumer (e.g. `AgentNewPage`) handles routing, the import dialog,
23
+ * and mounting the wizard.
24
+ *
25
+ * @typeParam TData - The wizard data shape (e.g. `AgentWizardData`).
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <CreationPicker
30
+ * resourceLabel="agent"
31
+ * templates={AGENT_TEMPLATES}
32
+ * onSelect={(path) => {
33
+ * if (path.kind === "scratch") startWizard();
34
+ * if (path.kind === "template") startWizard(path.data);
35
+ * if (path.kind === "import") openImportDialog();
36
+ * }}
37
+ * />
38
+ * ```
39
+ */
40
+ export function CreationPicker({ resourceLabel, templates, onSelect, className, }) {
41
+ const [view, setView] = useState("options");
42
+ const handleTemplateSelect = useCallback((template) => {
43
+ onSelect({ kind: "template", data: template.data });
44
+ }, [onSelect]);
45
+ const handleBackToOptions = useCallback(() => {
46
+ setView("options");
47
+ }, []);
48
+ if (view === "gallery") {
49
+ return (_jsxs("div", { className: cn("flex flex-col gap-4", className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { type: "button", onClick: handleBackToOptions, "aria-label": "Back to creation options", className: cn("inline-flex items-center justify-center rounded-md p-1.5", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: _jsx(BackArrowIcon, {}) }), _jsx("h2", { className: "text-base font-semibold text-foreground", children: "Choose a template" })] }), _jsx(TemplateGallery, { templates: templates, onSelect: handleTemplateSelect })] }));
50
+ }
51
+ return (_jsxs("div", { className: cn("flex flex-col gap-6", className), children: [_jsxs("div", { children: [_jsxs("h2", { className: "text-lg font-semibold text-foreground", children: ["Create a new ", resourceLabel] }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: "Choose how you'd like to get started." })] }), _jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-3", children: [_jsx(OptionCard, { title: "Start from scratch", description: `Create a blank ${resourceLabel} and configure it step by step.`, icon: _jsx(BlankPageIcon, {}), onClick: () => onSelect({ kind: "scratch" }) }), templates.length > 0 && (_jsx(OptionCard, { title: "Browse templates", description: `Start with a pre-built ${resourceLabel} configuration.`, icon: _jsx(GridIcon, {}), onClick: () => setView("gallery"), badge: `${templates.length} available` })), _jsx(OptionCard, { title: "Import from file", description: "Upload a YAML or JSON configuration file.", icon: _jsx(UploadIcon, {}), onClick: () => onSelect({ kind: "import" }) })] })] }));
52
+ }
53
+ // ---------------------------------------------------------------------------
54
+ // Internal components
55
+ // ---------------------------------------------------------------------------
56
+ function OptionCard({ title, description, icon, onClick, badge, }) {
57
+ return (_jsxs("button", { type: "button", onClick: onClick, className: cn("group flex flex-col items-center gap-3 rounded-lg border border-border bg-card p-6 text-center", "transition-colors hover:border-primary hover:bg-accent", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [_jsx("span", { className: "text-muted-foreground transition-colors group-hover:text-foreground", children: icon }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-sm font-medium text-foreground", children: title }), _jsx("span", { className: "text-xs text-muted-foreground", children: description })] }), badge && (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: badge }))] }));
58
+ }
59
+ // ---------------------------------------------------------------------------
60
+ // Icons (inline SVGs — no external dependency)
61
+ // ---------------------------------------------------------------------------
62
+ function BlankPageIcon() {
63
+ return (_jsxs("svg", { className: "size-8", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }), _jsx("polyline", { points: "14 2 14 8 20 8" })] }));
64
+ }
65
+ function GridIcon() {
66
+ return (_jsxs("svg", { className: "size-8", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { width: "7", height: "7", x: "3", y: "3", rx: "1" }), _jsx("rect", { width: "7", height: "7", x: "14", y: "3", rx: "1" }), _jsx("rect", { width: "7", height: "7", x: "14", y: "14", rx: "1" }), _jsx("rect", { width: "7", height: "7", x: "3", y: "14", rx: "1" })] }));
67
+ }
68
+ function UploadIcon() {
69
+ return (_jsxs("svg", { className: "size-8", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), _jsx("polyline", { points: "17 8 12 3 7 8" }), _jsx("line", { x1: "12", x2: "12", y1: "3", y2: "15" })] }));
70
+ }
71
+ function BackArrowIcon() {
72
+ return (_jsxs("svg", { className: "size-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "m12 19-7-7 7-7" }), _jsx("path", { d: "M19 12H5" })] }));
73
+ }
74
+ //# sourceMappingURL=CreationPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreationPicker.js","sourceRoot":"","sources":["../../src/resource-creation/CreationPicker.tsx"],"names":[],"mappings":"AAAA,Y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AAC,CAAC,EAAC,IAAI,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG,EAClD,eAAM,KAAK,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG,IAC7C,CACP,CAAC;AACJ,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,CACL,eACE,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,GAAG,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,2CAA2C,GAAG,EACtD,mBAAU,MAAM,EAAC,eAAe,GAAG,EACnC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG,IACnC,CACP,CAAC;AACJ,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,CACL,eACE,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,gBAAgB,GAAG,EAC3B,eAAM,CAAC,EAAC,UAAU,GAAG,IACjB,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /** Props for {@link StepIndicator}. */
2
+ export interface StepIndicatorProps {
3
+ /** Step definitions to render (only `id` and `label` are used for rendering). */
4
+ readonly steps: readonly {
5
+ readonly id: string;
6
+ readonly label: string;
7
+ }[];
8
+ /** Zero-based index of the currently active step. */
9
+ readonly currentStepIndex: number;
10
+ /** Called when a completed step is clicked (backward navigation). */
11
+ readonly onStepClick?: (index: number) => void;
12
+ /** Additional CSS classes for the root container. */
13
+ readonly className?: string;
14
+ }
15
+ /**
16
+ * Vertical step progress indicator for multi-step wizards.
17
+ *
18
+ * Renders each step as a numbered circle with label. Steps are
19
+ * color-coded by state: completed (filled), active (ring), pending
20
+ * (muted). Completed steps are clickable for backward navigation.
21
+ *
22
+ * Responsive: collapses to a compact horizontal layout on narrow
23
+ * viewports via CSS container queries.
24
+ *
25
+ * Uses `--stgm-*` tokens exclusively. Zero Console dependencies.
26
+ */
27
+ export declare function StepIndicator({ steps, currentStepIndex, onStepClick, className, }: StepIndicatorProps): import("react/jsx-runtime").JSX.Element;
28
+ //# sourceMappingURL=StepIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepIndicator.d.ts","sourceRoot":"","sources":["../../src/resource-creation/StepIndicator.tsx"],"names":[],"mappings":"AAIA,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3E,qDAAqD;IACrD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,qEAAqE;IACrE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,EAAE,kBAAkB,2CA+DpB"}
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ /**
5
+ * Vertical step progress indicator for multi-step wizards.
6
+ *
7
+ * Renders each step as a numbered circle with label. Steps are
8
+ * color-coded by state: completed (filled), active (ring), pending
9
+ * (muted). Completed steps are clickable for backward navigation.
10
+ *
11
+ * Responsive: collapses to a compact horizontal layout on narrow
12
+ * viewports via CSS container queries.
13
+ *
14
+ * Uses `--stgm-*` tokens exclusively. Zero Console dependencies.
15
+ */
16
+ export function StepIndicator({ steps, currentStepIndex, onStepClick, className, }) {
17
+ return (_jsx("nav", { "aria-label": "Wizard progress", className: cn("flex flex-col gap-1", className), children: _jsx("ol", { className: "flex flex-col gap-1", role: "list", children: steps.map((step, index) => {
18
+ const state = getStepState(index, currentStepIndex);
19
+ const isClickable = state === "completed" && onStepClick != null;
20
+ const content = (_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(StepCircle, { index: index, state: state }), _jsx("span", { className: cn("text-sm font-medium transition-colors", state === "active" && "text-foreground", state === "completed" && "text-foreground", state === "pending" && "text-muted-foreground"), children: step.label })] }));
21
+ return (_jsxs("li", { children: [isClickable ? (_jsx("button", { type: "button", onClick: () => onStepClick(index), className: cn("w-full rounded-md px-2 py-2 text-left transition-colors", "hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), "aria-label": `Go back to step ${index + 1}: ${step.label}`, "aria-current": undefined, children: content })) : (_jsx("div", { className: "px-2 py-2", "aria-current": state === "active" ? "step" : undefined, children: content })), index < steps.length - 1 && (_jsx("div", { className: "ml-[18px] h-4 w-px bg-border", "aria-hidden": "true" }))] }, step.id));
22
+ }) }) }));
23
+ }
24
+ function getStepState(index, currentIndex) {
25
+ if (index < currentIndex)
26
+ return "completed";
27
+ if (index === currentIndex)
28
+ return "active";
29
+ return "pending";
30
+ }
31
+ function StepCircle({ index, state, }) {
32
+ return (_jsx("div", { className: cn("flex size-7 shrink-0 items-center justify-center rounded-full text-xs font-medium transition-colors", state === "completed" && "bg-primary text-primary-foreground", state === "active" && "border-2 border-primary text-primary", state === "pending" && "border border-border text-muted-foreground"), "aria-hidden": "true", children: state === "completed" ? (_jsx(CheckIcon, { className: "size-3.5" })) : (_jsx("span", { children: index + 1 })) }));
33
+ }
34
+ // ---------------------------------------------------------------------------
35
+ // Icons
36
+ // ---------------------------------------------------------------------------
37
+ function CheckIcon({ className }) {
38
+ return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m3 8.5 3.5 3.5 6.5-8" }) }));
39
+ }
40
+ //# sourceMappingURL=StepIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepIndicator.js","sourceRoot":"","sources":["../../src/resource-creation/StepIndicator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAcpC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,GACU;IACnB,OAAO,CACL,4BACa,iBAAiB,EAC5B,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,YAE/C,aAAI,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAC,MAAM,YAC5C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACzB,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;gBACpD,MAAM,WAAW,GAAG,KAAK,KAAK,WAAW,IAAI,WAAW,IAAI,IAAI,CAAC;gBAEjE,MAAM,OAAO,GAAG,CACd,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,EAC1C,eACE,SAAS,EAAE,EAAE,CACX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AS,IAAI,4CAA4C,CACpE,iBACW,MAAM,YAEjB,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,CACvB,KAAC,SAAS,IAAC,SAAS,EAAC,UAAU,GAAG,CACnC,CAAC,CAAC,CAAC,CACF,yBAAO,KAAK,GAAG,CAAC,GAAQ,CACzB,GACG,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,SAAS,SAAS,CAAC,EAAE,SAAS,EAAmC;IAC/D,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,sBAAsB,GAAG,GAC7B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { ResourceTemplate } from "./templates/types";
2
+ /** Props for {@link TemplateCard}. */
3
+ export interface TemplateCardProps<TData> {
4
+ /** The template to display. */
5
+ readonly template: ResourceTemplate<TData>;
6
+ /** Called when the card is selected (click or Enter). */
7
+ readonly onSelect: (template: ResourceTemplate<TData>) => void;
8
+ /** Additional CSS classes for the card container. */
9
+ readonly className?: string;
10
+ }
11
+ /**
12
+ * A clickable card that displays a resource template's metadata.
13
+ *
14
+ * Renders the template's name, description, and category badge.
15
+ * Displays a colored initial avatar derived from the template name.
16
+ *
17
+ * Fully keyboard-accessible: focusable, activates on Enter/Space.
18
+ * Uses `--stgm-*` tokens for all structural styling; category badge
19
+ * colors use Tailwind's semantic palette with opacity for dark mode.
20
+ *
21
+ * @typeParam TData - The wizard data shape this template targets.
22
+ */
23
+ export declare function TemplateCard<TData>({ template, onSelect, className, }: TemplateCardProps<TData>): import("react/jsx-runtime").JSX.Element;
24
+ //# sourceMappingURL=TemplateCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateCard.d.ts","sourceRoot":"","sources":["../../src/resource-creation/TemplateCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAO5E,sCAAsC;AACtC,MAAM,WAAW,iBAAiB,CAAC,KAAK;IACtC,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC/D,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AA0CD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,EAClC,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,CAAC,KAAK,CAAC,2CAiE1B"}
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { TEMPLATE_CATEGORY_LABELS } from "./templates/types";
6
+ // ---------------------------------------------------------------------------
7
+ // Category badge colors
8
+ // ---------------------------------------------------------------------------
9
+ const CATEGORY_COLORS = {
10
+ "customer-support": "bg-blue-500/10 text-blue-700 dark:text-blue-400",
11
+ "code-review": "bg-violet-500/10 text-violet-700 dark:text-violet-400",
12
+ "data-analysis": "bg-amber-500/10 text-amber-700 dark:text-amber-400",
13
+ devops: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",
14
+ content: "bg-pink-500/10 text-pink-700 dark:text-pink-400",
15
+ integration: "bg-cyan-500/10 text-cyan-700 dark:text-cyan-400",
16
+ general: "bg-muted text-muted-foreground",
17
+ };
18
+ // ---------------------------------------------------------------------------
19
+ // Initial avatar colors (deterministic from template id)
20
+ // ---------------------------------------------------------------------------
21
+ const AVATAR_COLORS = [
22
+ "bg-blue-500/15 text-blue-700 dark:text-blue-400",
23
+ "bg-violet-500/15 text-violet-700 dark:text-violet-400",
24
+ "bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",
25
+ "bg-amber-500/15 text-amber-700 dark:text-amber-400",
26
+ "bg-pink-500/15 text-pink-700 dark:text-pink-400",
27
+ "bg-cyan-500/15 text-cyan-700 dark:text-cyan-400",
28
+ "bg-rose-500/15 text-rose-700 dark:text-rose-400",
29
+ ];
30
+ function hashCode(str) {
31
+ let hash = 0;
32
+ for (let i = 0; i < str.length; i++) {
33
+ hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
34
+ }
35
+ return Math.abs(hash);
36
+ }
37
+ // ---------------------------------------------------------------------------
38
+ // Component
39
+ // ---------------------------------------------------------------------------
40
+ /**
41
+ * A clickable card that displays a resource template's metadata.
42
+ *
43
+ * Renders the template's name, description, and category badge.
44
+ * Displays a colored initial avatar derived from the template name.
45
+ *
46
+ * Fully keyboard-accessible: focusable, activates on Enter/Space.
47
+ * Uses `--stgm-*` tokens for all structural styling; category badge
48
+ * colors use Tailwind's semantic palette with opacity for dark mode.
49
+ *
50
+ * @typeParam TData - The wizard data shape this template targets.
51
+ */
52
+ export function TemplateCard({ template, onSelect, className, }) {
53
+ const handleClick = useCallback(() => {
54
+ onSelect(template);
55
+ }, [onSelect, template]);
56
+ const handleKeyDown = useCallback((e) => {
57
+ if (e.key === "Enter" || e.key === " ") {
58
+ e.preventDefault();
59
+ onSelect(template);
60
+ }
61
+ }, [onSelect, template]);
62
+ const colorIndex = hashCode(template.id) % AVATAR_COLORS.length;
63
+ const avatarColor = AVATAR_COLORS[colorIndex];
64
+ const initial = template.name.charAt(0).toUpperCase();
65
+ const categoryLabel = TEMPLATE_CATEGORY_LABELS[template.category] ?? template.category;
66
+ return (_jsxs("div", { role: "button", tabIndex: 0, onClick: handleClick, onKeyDown: handleKeyDown, "aria-label": `Use ${template.name} template`, className: cn("group flex cursor-pointer flex-col gap-3 rounded-lg border border-border bg-card p-4", "transition-colors hover:border-primary hover:bg-accent", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", className), children: [_jsxs("div", { className: "flex items-start gap-3", children: [_jsx("span", { className: cn("inline-flex size-9 shrink-0 items-center justify-center rounded-md text-sm font-semibold", avatarColor), "aria-hidden": "true", children: initial }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: template.name }), _jsx("span", { className: cn("mt-1 inline-block rounded-full px-2 py-0.5 text-[10px] font-medium", CATEGORY_COLORS[template.category] ?? CATEGORY_COLORS.general), children: categoryLabel })] })] }), _jsx("p", { className: "line-clamp-2 text-xs leading-relaxed text-muted-foreground", children: template.description })] }));
67
+ }
68
+ //# sourceMappingURL=TemplateCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateCard.js","sourceRoot":"","sources":["../../src/resource-creation/TemplateCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAgB7D,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E;AAE9E,MAAM,eAAe,GAAqC;IACxD,kBAAkB,EAAE,iDAAiD;IACrE,aAAa,EAAE,uDAAuD;IACtE,eAAe,EAAE,oDAAoD;IACrE,MAAM,EAAE,0DAA0D;IAClE,OAAO,EAAE,iDAAiD;IAC1D,WAAW,EAAE,iDAAiD;IAC9D,OAAO,EAAE,gCAAgC;CAC1C,CAAC;AAEF,8EAA8E;AAC9E,yDAAyD;AACzD,8EAA8E;AAE9E,MAAM,aAAa,GAAG;IACpB,iDAAiD;IACjD,uDAAuD;IACvD,0DAA0D;IAC1D,oDAAoD;IACpD,iDAAiD;IACjD,iDAAiD;IACjD,iD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ACtD,MAAM,aAAa,GACjB,wBAAwB,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAEnE,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,gBACZ,OAAO,QAAQ,CAAC,IAAI,WAAW,EAC3C,SAAS,EAAE,EAAE,CACX,sFAAsF,EACtF,wDAAwD,EACxD,yEAAyE,EACzE,SAAS,CACV,aAED,eAAK,SAAS,EAAC,wBAAwB,aAErC,eACE,SAAS,EAAE,EAAE,CACX,0FAA0F,EAC1F,WAAW,CACZ,iBACW,MAAM,YAEjB,OAAO,GACH,EAEP,eAAK,SAAS,EAAC,gBAAgB,aAC7B,YAAG,SAAS,EAAC,qCAAqC,YAAE,QAAQ,CAAC,IAAI,GAAK,EACtE,eACE,SAAS,EAAE,EAAE,CACX,oEAAoE,EACpE,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,eAAe,CAAC,OAAO,CAC9D,YAEA,aAAa,GACT,IACH,IACF,EAEN,YAAG,SAAS,EAAC,4DAA4D,YACtE,QAAQ,CAAC,WAAW,GACnB,IACA,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ResourceTemplate } from "./templates/types";
3
+ /** Props for {@link TemplateGallery}. */
4
+ export interface TemplateGalleryProps<TData> {
5
+ /** Templates to display in the gallery. */
6
+ readonly templates: readonly ResourceTemplate<TData>[];
7
+ /** Called when the user selects a template. */
8
+ readonly onSelect: (template: ResourceTemplate<TData>) => void;
9
+ /**
10
+ * Content to render when no templates match the search/filter.
11
+ * Falls back to a built-in empty message if not provided.
12
+ */
13
+ readonly emptyContent?: ReactNode;
14
+ /** Additional CSS classes for the root container. */
15
+ readonly className?: string;
16
+ }
17
+ /**
18
+ * A searchable, filterable gallery of resource templates.
19
+ *
20
+ * Renders category tabs, a search input, and a responsive card grid.
21
+ * Uses the headless `useTemplateFilter` hook for state — platform
22
+ * builders who want custom rendering can use the hook directly.
23
+ *
24
+ * Keyboard navigation:
25
+ * - Tab moves focus between the search input, category tabs, and cards
26
+ * - Arrow keys (Left/Right) navigate between category tabs
27
+ * - Enter/Space activates the focused tab or card
28
+ *
29
+ * All structural styling via `--stgm-*` tokens. Zero Console or
30
+ * framework dependencies.
31
+ *
32
+ * @typeParam TData - The wizard data shape (e.g. `AgentWizardData`).
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <TemplateGallery
37
+ * templates={AGENT_TEMPLATES}
38
+ * onSelect={(template) => startWizardWithTemplate(template)}
39
+ * />
40
+ * ```
41
+ */
42
+ export declare function TemplateGallery<TData>({ templates, onSelect, emptyContent, className, }: TemplateGalleryProps<TData>): import("react/jsx-runtime").JSX.Element;
43
+ //# sourceMappingURL=TemplateGallery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateGallery.d.ts","sourceRoot":"","sources":["../../src/resource-creation/TemplateGallery.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAS5E,yCAAyC;AACzC,MAAM,WAAW,oBAAoB,CAAC,KAAK;IACzC,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IACvD,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,EACrC,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,GACV,EAAE,oBAAoB,CAAC,KAAK,CAAC,2CA2G7B"}
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useRef } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { TEMPLATE_CATEGORY_LABELS } from "./templates/types";
6
+ import { useTemplateFilter } from "./useTemplateFilter";
7
+ import { TemplateCard } from "./TemplateCard";
8
+ // ---------------------------------------------------------------------------
9
+ // Component
10
+ // ---------------------------------------------------------------------------
11
+ /**
12
+ * A searchable, filterable gallery of resource templates.
13
+ *
14
+ * Renders category tabs, a search input, and a responsive card grid.
15
+ * Uses the headless `useTemplateFilter` hook for state — platform
16
+ * builders who want custom rendering can use the hook directly.
17
+ *
18
+ * Keyboard navigation:
19
+ * - Tab moves focus between the search input, category tabs, and cards
20
+ * - Arrow keys (Left/Right) navigate between category tabs
21
+ * - Enter/Space activates the focused tab or card
22
+ *
23
+ * All structural styling via `--stgm-*` tokens. Zero Console or
24
+ * framework dependencies.
25
+ *
26
+ * @typeParam TData - The wizard data shape (e.g. `AgentWizardData`).
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <TemplateGallery
31
+ * templates={AGENT_TEMPLATES}
32
+ * onSelect={(template) => startWizardWithTemplate(template)}
33
+ * />
34
+ * ```
35
+ */
36
+ export function TemplateGallery({ templates, onSelect, emptyContent, className, }) {
37
+ const { filtered, query, setQuery, activeCategory, setActiveCategory, availableCategories, } = useTemplateFilter({ templates });
38
+ const tabListRef = useRef(null);
39
+ const handleTabKeyDown = useCallback((e) => {
40
+ const tabs = tabListRef.current?.querySelectorAll('[role="tab"]');
41
+ if (!tabs?.length)
42
+ return;
43
+ const currentIndex = Array.from(tabs).findIndex((t) => t === document.activeElement);
44
+ if (currentIndex === -1)
45
+ return;
46
+ let nextIndex = null;
47
+ if (e.key === "ArrowRight") {
48
+ nextIndex = (currentIndex + 1) % tabs.length;
49
+ }
50
+ else if (e.key === "ArrowLeft") {
51
+ nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;
52
+ }
53
+ else if (e.key === "Home") {
54
+ nextIndex = 0;
55
+ }
56
+ else if (e.key === "End") {
57
+ nextIndex = tabs.length - 1;
58
+ }
59
+ if (nextIndex !== null) {
60
+ e.preventDefault();
61
+ tabs[nextIndex].focus();
62
+ tabs[nextIndex].click();
63
+ }
64
+ }, []);
65
+ return (_jsxs("div", { className: cn("flex flex-col gap-4", className), children: [_jsxs("div", { className: "relative", children: [_jsx(SearchIcon, {}), _jsx("input", { type: "search", value: query, onChange: (e) => setQuery(e.target.value), placeholder: "Search templates\u2026", "aria-label": "Search templates", className: cn("w-full rounded-md border border-input bg-input-bg py-2 pl-9 pr-3 text-sm text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring") })] }), availableCategories.length > 1 && (_jsxs("div", { ref: tabListRef, role: "tablist", "aria-label": "Template categories", onKeyDown: handleTabKeyDown, className: "flex flex-wrap gap-1", children: [_jsx(CategoryTab, { label: "All", isActive: activeCategory === null, onClick: () => setActiveCategory(null) }), availableCategories.map((cat) => (_jsx(CategoryTab, { label: TEMPLATE_CATEGORY_LABELS[cat] ?? cat, isActive: activeCategory === cat, onClick: () => setActiveCategory(cat) }, cat)))] })), filtered.length > 0 ? (_jsx("div", { role: "list", "aria-label": "Templates", className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: filtered.map((template) => (_jsx("div", { role: "listitem", children: _jsx(TemplateCard, { template: template, onSelect: onSelect }) }, template.id))) })) : ((emptyContent ?? (_jsx("div", { className: "py-8 text-center text-sm text-muted-foreground", children: "No templates match your search." }))))] }));
66
+ }
67
+ // ---------------------------------------------------------------------------
68
+ // Internal components
69
+ // ---------------------------------------------------------------------------
70
+ function CategoryTab({ label, isActive, onClick, }) {
71
+ return (_jsx("button", { type: "button", role: "tab", "aria-selected": isActive, tabIndex: isActive ? 0 : -1, onClick: onClick, className: cn("rounded-md px-2.5 py-1 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isActive
72
+ ? "bg-primary text-primary-foreground"
73
+ : "bg-muted text-muted-foreground hover:bg-accent hover:text-accent-foreground"), children: label }));
74
+ }
75
+ function SearchIcon() {
76
+ return (_jsxs("svg", { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: 11, cy: 11, r: 8 }), _jsx("path", { d: "m21 21-4.3-4.3" })] }));
77
+ }
78
+ //# sourceMappingURL=TemplateGallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateGallery.js","sourceRoot":"","sources":["../../src/resource-creation/TemplateGallery.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAqB9C,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,eAAe,CAAQ,EACrC,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,GACmB;IAC5B,MAAM,EACJ,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GACpB,GAAG,iBA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the Back button should be displayed. */
4
+ readonly showBack: boolean;
5
+ /** Label for the primary action button. */
6
+ readonly nextLabel: string;
7
+ /** Whether the primary action is disabled. */
8
+ readonly nextDisabled?: boolean;
9
+ /** Whether the primary action is in a loading state. */
10
+ readonly isSubmitting?: boolean;
11
+ /** Called when Back is clicked. */
12
+ readonly onBack: () => void;
13
+ /** Called when Next/Submit is clicked. */
14
+ readonly onNext: () => void;
15
+ /** Called when Cancel is clicked. */
16
+ readonly onCancel?: () => void;
17
+ /** Additional CSS classes for the root container. */
18
+ readonly className?: string;
19
+ }
20
+ /**
21
+ * Navigation footer for the wizard shell.
22
+ *
23
+ * Renders Back / Next|Submit buttons in a standardized layout.
24
+ * The primary (right-side) button adapts its label and loading
25
+ * state based on whether it's the final step.
26
+ *
27
+ * Keyboard: Enter triggers the primary action when focused within
28
+ * the wizard content (not within text areas or other multi-line inputs).
29
+ */
30
+ export declare function WizardNav({ showBack, nextLabel, nextDisabled, isSubmitting, onBack, onNext, onCancel, className, }: WizardNavProps): import("react/jsx-runtime").JSX.Element;
31
+ //# sourceMappingURL=WizardNav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WizardNav.d.ts","sourceRoot":"","sources":["../../src/resource-creation/WizardNav.tsx"],"names":[],"mappings":"AAIA,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,GACV,EAAE,cAAc,2CA+DhB"}