@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,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 Agent resource.
7
+ *
8
+ * Wraps `stigmer.agent.update(input)` with loading and error state.
9
+ * The caller must provide a **complete** `AgentInput` — the backend
10
+ * performs full spec replacement. Use `agentToInput()` to reconstruct
11
+ * the input from a fetched agent, modify the desired field, and pass
12
+ * the result here.
13
+ */
14
+ export function useUpdateAgent() {
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.agent.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=useUpdateAgent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateAgent.js","sourceRoot":"","sources":["../../src/agent/useUpdateAgent.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,cAAc;IAC5B,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,KAAiB,EAAkB,EAAE;QAC1C,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,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"}
@@ -0,0 +1,37 @@
1
+ import type { DependencyGraphProps } from "./types";
2
+ /**
3
+ * Accessible CSS-based tree visualization of an agent's dependencies.
4
+ *
5
+ * Renders `MCP Servers`, `Skills`, and `Sub-Agents` (with recursive
6
+ * sub-agent children) as a nested tree with visual connector lines.
7
+ * The root node represents the agent itself.
8
+ *
9
+ * Implements the WAI-ARIA TreeView pattern:
10
+ * - `role="tree"` on the root list
11
+ * - `role="treeitem"` on each node (via {@link DependencyTreeNode})
12
+ * - Arrow-key navigation between visible nodes (roving tabindex)
13
+ * - `Home`/`End` to jump to first/last visible node
14
+ *
15
+ * All visual properties flow through `--stgm-*` design tokens.
16
+ * Zero Console dependencies — safe for platform builder embedding.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const { tree } = useDependencyGraph({
21
+ * agentName: "pr-review-agent",
22
+ * agentOrg: "acme",
23
+ * spec: agent.spec,
24
+ * });
25
+ *
26
+ * {tree && (
27
+ * <DependencyGraph
28
+ * tree={tree}
29
+ * onNodeClick={(node) => {
30
+ * if (node.kind === "mcp-server") navigateTo(`/mcp-servers/${node.ref!.slug}`);
31
+ * }}
32
+ * />
33
+ * )}
34
+ * ```
35
+ */
36
+ export declare function DependencyGraph({ tree, onNodeClick, defaultExpanded, className, }: DependencyGraphProps): import("react/jsx-runtime").JSX.Element;
37
+ //# sourceMappingURL=DependencyGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyGraph.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/DependencyGraph.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,eAAsB,EACtB,SAAS,GACV,EAAE,oBAAoB,2CAiFtB"}
@@ -0,0 +1,88 @@
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 { DependencyTreeNode } from "./DependencyTreeNode";
6
+ /**
7
+ * Accessible CSS-based tree visualization of an agent's dependencies.
8
+ *
9
+ * Renders `MCP Servers`, `Skills`, and `Sub-Agents` (with recursive
10
+ * sub-agent children) as a nested tree with visual connector lines.
11
+ * The root node represents the agent itself.
12
+ *
13
+ * Implements the WAI-ARIA TreeView pattern:
14
+ * - `role="tree"` on the root list
15
+ * - `role="treeitem"` on each node (via {@link DependencyTreeNode})
16
+ * - Arrow-key navigation between visible nodes (roving tabindex)
17
+ * - `Home`/`End` to jump to first/last visible node
18
+ *
19
+ * All visual properties flow through `--stgm-*` design tokens.
20
+ * Zero Console dependencies — safe for platform builder embedding.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * const { tree } = useDependencyGraph({
25
+ * agentName: "pr-review-agent",
26
+ * agentOrg: "acme",
27
+ * spec: agent.spec,
28
+ * });
29
+ *
30
+ * {tree && (
31
+ * <DependencyGraph
32
+ * tree={tree}
33
+ * onNodeClick={(node) => {
34
+ * if (node.kind === "mcp-server") navigateTo(`/mcp-servers/${node.ref!.slug}`);
35
+ * }}
36
+ * />
37
+ * )}
38
+ * ```
39
+ */
40
+ export function DependencyGraph({ tree, onNodeClick, defaultExpanded = true, className, }) {
41
+ const treeRef = useRef(null);
42
+ const handleKeyDown = useCallback((e) => {
43
+ const container = treeRef.current;
44
+ if (!container)
45
+ return;
46
+ const items = Array.from(container.querySelectorAll("[role='treeitem'] > button, [role='treeitem'] > div")).filter((el) => {
47
+ let parent = el.closest("[role='treeitem']")?.parentElement?.closest("[role='treeitem']");
48
+ while (parent) {
49
+ if (parent.getAttribute("aria-expanded") === "false")
50
+ return false;
51
+ parent = parent.parentElement?.closest("[role='treeitem']");
52
+ }
53
+ return true;
54
+ });
55
+ if (items.length === 0)
56
+ return;
57
+ const activeEl = document.activeElement;
58
+ const currentIndex = activeEl ? items.indexOf(activeEl) : -1;
59
+ let nextIndex = null;
60
+ switch (e.key) {
61
+ case "ArrowDown":
62
+ nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : 0;
63
+ break;
64
+ case "ArrowUp":
65
+ nextIndex = currentIndex > 0 ? currentIndex - 1 : items.length - 1;
66
+ break;
67
+ case "Home":
68
+ nextIndex = 0;
69
+ break;
70
+ case "End":
71
+ nextIndex = items.length - 1;
72
+ break;
73
+ default:
74
+ return;
75
+ }
76
+ e.preventDefault();
77
+ items[nextIndex].focus();
78
+ }, []);
79
+ const { root } = tree;
80
+ return (_jsxs("div", { className: cn("py-2", className), children: [_jsxs("div", { className: "mb-3 flex items-center gap-2 px-2", children: [_jsx(TreeIcon, { className: "size-4 text-muted-foreground" }), _jsx("h3", { className: "text-xs font-medium uppercase tracking-wider text-muted-foreground", children: "Dependency Tree" }), _jsxs("span", { className: "text-xs text-muted-foreground", children: [tree.nodeCount, " ", tree.nodeCount === 1 ? "node" : "nodes"] })] }), _jsx("ul", { ref: treeRef, role: "tree", "aria-label": `Dependencies of ${root.label}`, onKeyDown: handleKeyDown, className: "rounded-lg border border-border p-2", children: _jsx(DependencyTreeNode, { node: root, depth: 0, onNodeClick: onNodeClick, defaultExpanded: defaultExpanded }) })] }));
81
+ }
82
+ // ---------------------------------------------------------------------------
83
+ // Header icon
84
+ // ---------------------------------------------------------------------------
85
+ function TreeIcon({ className }) {
86
+ return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M8 2v4M8 6 4 10M8 6l4 4" }), _jsx("circle", { cx: "8", cy: "2", r: "1", fill: "currentColor", stroke: "none" }), _jsx("circle", { cx: "4", cy: "11", r: "1.5" }), _jsx("circle", { cx: "8", cy: "11", r: "1.5" }), _jsx("circle", { cx: "12", cy: "11", r: "1.5" })] }));
87
+ }
88
+ //# sourceMappingURL=DependencyGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyGraph.js","sourceRoot":"","sources":["../../src/dependency-graph/DependencyGraph.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,eAAe,GAAG,IAAI,EACtB,SAAS,GACY;IACrB,MAAM,OAAO,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAE/C,MAAM,aAAa,GAAG,WAAW,CAC/B,CAAC,CAAkC,EAAE,EAAE;QACrC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,SAAS,CAAC,gBAAgB,CACxB,qDAAqD,CACtD,CACF,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE;YACd,IAAI,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;YAC1F,OAAO,MAAM,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AC,KAAK,GAAG,EACjC,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,IAC9B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { DependencyNode } from "./types";
2
+ interface DependencyTreeNodeProps {
3
+ readonly node: DependencyNode;
4
+ readonly depth: number;
5
+ readonly onNodeClick?: (node: DependencyNode) => void;
6
+ readonly defaultExpanded: boolean;
7
+ }
8
+ /**
9
+ * Renders a single node in the dependency tree: icon, kind badge,
10
+ * label, metadata, and (for expandable nodes) an expand/collapse
11
+ * chevron with nested children.
12
+ *
13
+ * Leaf nodes (MCP servers, skills) with a `ref` are clickable —
14
+ * firing `onNodeClick` for consumer-wired navigation.
15
+ *
16
+ * Sub-agent nodes are collapsible containers, and the root agent
17
+ * node always renders its children expanded. Both recurse using
18
+ * the same component, keeping the ARIA tree structure correct
19
+ * (`<li role="treeitem">` wrapping a nested `<ul role="group">`).
20
+ */
21
+ export declare function DependencyTreeNode({ node, depth, onNodeClick, defaultExpanded, }: DependencyTreeNodeProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=DependencyTreeNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyTreeNode.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/DependencyTreeNode.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,SAAS,CAAC;AAExD,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC;AASD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,eAAe,GAChB,EAAE,uBAAuB,2CAmIzB"}
@@ -0,0 +1,99 @@
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
+ const KIND_LABELS = {
6
+ agent: "Agent",
7
+ "mcp-server": "MCP",
8
+ skill: "Skill",
9
+ "sub-agent": "Sub-Agent",
10
+ };
11
+ /**
12
+ * Renders a single node in the dependency tree: icon, kind badge,
13
+ * label, metadata, and (for expandable nodes) an expand/collapse
14
+ * chevron with nested children.
15
+ *
16
+ * Leaf nodes (MCP servers, skills) with a `ref` are clickable —
17
+ * firing `onNodeClick` for consumer-wired navigation.
18
+ *
19
+ * Sub-agent nodes are collapsible containers, and the root agent
20
+ * node always renders its children expanded. Both recurse using
21
+ * the same component, keeping the ARIA tree structure correct
22
+ * (`<li role="treeitem">` wrapping a nested `<ul role="group">`).
23
+ */
24
+ export function DependencyTreeNode({ node, depth, onNodeClick, defaultExpanded, }) {
25
+ const hasChildren = node.children.length > 0;
26
+ const isRoot = node.kind === "agent";
27
+ const isCollapsible = node.kind === "sub-agent" && hasChildren;
28
+ const isAlwaysExpanded = isRoot && hasChildren;
29
+ const [expanded, setExpanded] = useState(defaultExpanded);
30
+ const isNavigable = node.ref != null && onNodeClick != null;
31
+ const showChildren = isAlwaysExpanded || (isCollapsible && expanded);
32
+ const handleClick = useCallback(() => {
33
+ if (isCollapsible) {
34
+ setExpanded((v) => !v);
35
+ }
36
+ else if (isNavigable) {
37
+ onNodeClick(node);
38
+ }
39
+ }, [isCollapsible, isNavigable, onNodeClick, node]);
40
+ const handleKeyDown = useCallback((e) => {
41
+ if (!isCollapsible)
42
+ return;
43
+ if (e.key === "ArrowRight" && !expanded) {
44
+ e.preventDefault();
45
+ setExpanded(true);
46
+ }
47
+ else if (e.key === "ArrowLeft" && expanded) {
48
+ e.preventDefault();
49
+ setExpanded(false);
50
+ }
51
+ }, [isCollapsible, expanded]);
52
+ const content = (_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [isCollapsible && (_jsx(ChevronIcon, { className: cn("size-3.5 shrink-0 text-muted-foreground transition-transform", expanded && "rotate-90") })), _jsx(NodeIcon, { kind: node.kind, className: "size-4 shrink-0 text-muted-foreground" }), !isRoot && (_jsx("span", { className: cn("shrink-0 rounded px-1.5 py-px text-[10px] font-medium leading-tight", kindBadgeClasses(node.kind)), children: KIND_LABELS[node.kind] })), _jsx("span", { className: "min-w-0 truncate text-sm font-medium text-foreground", children: node.qualifiedLabel ?? node.label }), node.metadata &&
53
+ Object.entries(node.metadata).map(([key, value]) => (_jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: value }, key)))] }));
54
+ const isInteractive = isCollapsible || isNavigable;
55
+ const isChild = depth > 0;
56
+ return (_jsxs("li", { role: "treeitem", "aria-expanded": isCollapsible ? expanded : isAlwaysExpanded ? true : undefined, className: cn("list-none", isChild && "relative before:absolute before:left-[-12px] before:top-[14px] before:h-px before:w-3 before:bg-border before:content-['']"), children: [isInteractive ? (_jsx("button", { type: "button", onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: -1, className: cn("flex w-full items-center rounded-md px-2 py-1.5 text-left transition-colors", "hover:bg-accent-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"), children: content })) : (_jsx("div", { className: "flex items-center px-2 py-1.5", children: content })), node.description && !isRoot && (_jsx("p", { className: cn("px-2 pb-1 text-xs text-muted-foreground", isCollapsible ? "ml-[calc(0.5rem+14px+0.5rem)]" : "ml-2"), children: node.description })), showChildren && (_jsx("ul", { role: "group", className: "relative ml-[11px] border-l border-border pl-3", children: node.children.map((child) => (_jsx(DependencyTreeNode, { node: child, depth: depth + 1, onNodeClick: onNodeClick, defaultExpanded: defaultExpanded }, child.id))) }))] }));
57
+ }
58
+ // ---------------------------------------------------------------------------
59
+ // Kind badge styling — uses --stgm-* tokens, no hardcoded colors
60
+ // ---------------------------------------------------------------------------
61
+ function kindBadgeClasses(kind) {
62
+ switch (kind) {
63
+ case "mcp-server":
64
+ return "bg-[var(--stgm-status-running-subtle)] text-[var(--stgm-status-running)]";
65
+ case "skill":
66
+ return "bg-[var(--stgm-status-pending-subtle)] text-[var(--stgm-status-pending)]";
67
+ case "sub-agent":
68
+ return "bg-[var(--stgm-status-ready-subtle)] text-[var(--stgm-status-ready)]";
69
+ case "agent":
70
+ return "bg-muted text-muted-foreground";
71
+ }
72
+ }
73
+ // ---------------------------------------------------------------------------
74
+ // Icons — inline SVGs, consistent with AgentDetailView pattern
75
+ // ---------------------------------------------------------------------------
76
+ function NodeIcon({ kind, className, }) {
77
+ switch (kind) {
78
+ case "agent":
79
+ case "sub-agent":
80
+ return _jsx(AgentIcon, { className: className });
81
+ case "mcp-server":
82
+ return _jsx(McpServerIcon, { className: className });
83
+ case "skill":
84
+ return _jsx(SkillIcon, { className: className });
85
+ }
86
+ }
87
+ function AgentIcon({ className }) {
88
+ return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "5", width: "10", height: "8", rx: "1.5" }), _jsx("path", { d: "M6 9h.01M10 9h.01", strokeWidth: "2" }), _jsx("path", { d: "M8 2v3" })] }));
89
+ }
90
+ function McpServerIcon({ className }) {
91
+ return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "2", y: "2", width: "12", height: "5", rx: "1" }), _jsx("rect", { x: "2", y: "9", width: "12", height: "5", rx: "1" }), _jsx("circle", { cx: "5", cy: "4.5", r: "0.75", fill: "currentColor", stroke: "none" }), _jsx("circle", { cx: "5", cy: "11.5", r: "0.75", fill: "currentColor", stroke: "none" })] }));
92
+ }
93
+ function SkillIcon({ className }) {
94
+ return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M9 1.5 4 9h4l-1 5.5L12 7H8l1-5.5Z" }) }));
95
+ }
96
+ function ChevronIcon({ className }) {
97
+ return (_jsx("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m6 3 5 5-5 5" }) }));
98
+ }
99
+ //# sourceMappingURL=DependencyTreeNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DependencyTreeNode.js","sourceRoot":"","sources":["../../src/dependency-graph/DependencyTreeNode.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAUpC,MAAM,WAAW,GAA6B;IAC5C,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,KAAK;IACnB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,WAAW;CACzB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,IAAI,EACJ,KAAK,EACL,WAAW,EACX,eAAe,GACS;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;IACrC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,WAAW,CAAC;IAC/D,MAAM,gBAAgB,GAAG,MAAM,IAAI,WAAW,CAAC;IAC/C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC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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,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,mCAAmC,GAAG,GAC1C,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAmC;IACjE,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,cAAc,GAAG,GACrB,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type { NodeKind, DependencyNode, DependencyTree, DependencyGraphProps, UseDependencyGraphOptions, UseDependencyGraphReturn, } from "./types";
2
+ export { useDependencyGraph } from "./useDependencyGraph";
3
+ export { DependencyGraph } from "./DependencyGraph";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Hooks
2
+ export { useDependencyGraph } from "./useDependencyGraph";
3
+ // Components
4
+ export { DependencyGraph } from "./DependencyGraph";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dependency-graph/index.ts"],"names":[],"mappings":"AAUA,QAAQ;AACR,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Resource kind in a dependency tree.
3
+ *
4
+ * - `"agent"` — the root agent (always the tree root)
5
+ * - `"mcp-server"` — an MCP server referenced via `mcpServerUsages` or `mcpAccess`
6
+ * - `"skill"` — a skill referenced via `skillRefs`
7
+ * - `"sub-agent"` — an inline sub-agent definition with its own dependencies
8
+ */
9
+ export type NodeKind = "agent" | "mcp-server" | "skill" | "sub-agent";
10
+ /**
11
+ * A single node in the agent dependency tree.
12
+ *
13
+ * The tree is recursive: sub-agent nodes contain their own children
14
+ * (MCP servers and skills they access). Edges are implicit in the
15
+ * parent-child relationship — no separate edge type is needed.
16
+ *
17
+ * Nodes are navigable when `ref` is defined (MCP servers, skills).
18
+ * Sub-agent nodes have no `ref` because they are inline definitions
19
+ * within the agent spec, not standalone resources.
20
+ */
21
+ export interface DependencyNode {
22
+ /**
23
+ * Deterministic identifier. Format: `{kind}:{slug}` for referenced
24
+ * resources, `sub-agent:{name}` for sub-agents, or `agent:{slug}`
25
+ * for the root.
26
+ */
27
+ readonly id: string;
28
+ /** What kind of resource this node represents. */
29
+ readonly kind: NodeKind;
30
+ /** Primary display label (slug for resources, name for sub-agents). */
31
+ readonly label: string;
32
+ /**
33
+ * Qualified label shown when the resource belongs to a different org
34
+ * than the agent (e.g., `"other-org/shared-server"`). Undefined when
35
+ * the resource is in the same org as the parent agent.
36
+ */
37
+ readonly qualifiedLabel?: string;
38
+ /** Short description (sub-agent description, if available). */
39
+ readonly description?: string;
40
+ /**
41
+ * Key-value metadata displayed as secondary info.
42
+ * Examples: `{ tools: "3 tools" }`, `{ model: "gpt-4" }`.
43
+ */
44
+ readonly metadata?: Readonly<Record<string, string>>;
45
+ /** Child nodes. Empty array for leaf nodes (MCP servers, skills). */
46
+ readonly children: readonly DependencyNode[];
47
+ /**
48
+ * Navigation reference for clickable nodes. Defined for MCP servers
49
+ * and skills (standalone resources). Undefined for sub-agents (inline
50
+ * definitions) and the root agent.
51
+ */
52
+ readonly ref?: {
53
+ readonly org: string;
54
+ readonly slug: string;
55
+ };
56
+ }
57
+ /**
58
+ * Complete dependency tree for an agent, rooted at the agent itself.
59
+ */
60
+ export interface DependencyTree {
61
+ /** The agent node with all dependencies as descendants. */
62
+ readonly root: DependencyNode;
63
+ /** Total number of nodes in the tree (including root). */
64
+ readonly nodeCount: number;
65
+ }
66
+ /** Props for {@link DependencyGraph}. */
67
+ export interface DependencyGraphProps {
68
+ /** The dependency tree to render. */
69
+ readonly tree: DependencyTree;
70
+ /**
71
+ * Called when a navigable node is clicked. The `node.ref` field
72
+ * contains the `org` and `slug` for routing. Only fired for nodes
73
+ * where `ref` is defined (MCP servers, skills).
74
+ */
75
+ readonly onNodeClick?: (node: DependencyNode) => void;
76
+ /**
77
+ * Whether sub-agent subtrees start expanded.
78
+ * @default true
79
+ */
80
+ readonly defaultExpanded?: boolean;
81
+ /** Additional CSS classes for the root container. */
82
+ readonly className?: string;
83
+ }
84
+ /** Options for {@link useDependencyGraph}. */
85
+ export interface UseDependencyGraphOptions {
86
+ /** Display name of the agent (used as the root node label). */
87
+ readonly agentName: string;
88
+ /** Organization slug of the agent (used for cross-org label detection). */
89
+ readonly agentOrg: string;
90
+ /**
91
+ * The agent's spec containing dependency references.
92
+ * Pass `undefined` while the agent is loading — the hook returns
93
+ * `null` for `tree` and `true` for `isEmpty`.
94
+ */
95
+ readonly spec: {
96
+ readonly mcpServerUsages: readonly {
97
+ readonly mcpServerRef?: {
98
+ readonly org: string;
99
+ readonly slug: string;
100
+ };
101
+ readonly enabledTools: readonly string[];
102
+ readonly toolApprovalOverrides: readonly unknown[];
103
+ }[];
104
+ readonly skillRefs: readonly {
105
+ readonly org: string;
106
+ readonly slug: string;
107
+ }[];
108
+ readonly subAgents: readonly {
109
+ readonly name: string;
110
+ readonly description: string;
111
+ readonly mcpAccess: readonly {
112
+ readonly mcpServer: string;
113
+ readonly enabledTools: readonly string[];
114
+ }[];
115
+ readonly skillRefs: readonly {
116
+ readonly org: string;
117
+ readonly slug: string;
118
+ }[];
119
+ readonly modelOverride: string;
120
+ }[];
121
+ } | undefined;
122
+ }
123
+ /** Return value of {@link useDependencyGraph}. */
124
+ export interface UseDependencyGraphReturn {
125
+ /** The computed tree, or `null` when spec is undefined. */
126
+ readonly tree: DependencyTree | null;
127
+ /** `true` when the agent has zero dependencies (or spec is undefined). */
128
+ readonly isEmpty: boolean;
129
+ }
130
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IAC7C;;;;O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B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;SACvB,EAAE,CAAC;QACJ,QAAQ,CAAC,SAAS,EAAE,SAAS;YAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;YACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;YAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS;gBAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAC3B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;aAC1C,EAAE,CAAC;YACJ,QAAQ,CAAC,SAAS,EAAE,SAAS;gBAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;aACvB,EAAE,CAAC;YACJ,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;SAChC,EAAE,CAAC;KACL,GAAG,SAAS,CAAC;CACf;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dependency-graph/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import type { UseDependencyGraphOptions, UseDependencyGraphReturn } from "./types";
2
+ /**
3
+ * Pure transformation hook that converts an `AgentSpec` into a
4
+ * {@link DependencyTree} for rendering.
5
+ *
6
+ * No data fetching, no side effects — the tree is computed entirely
7
+ * from the spec fields already available via {@link useAgent}. The
8
+ * result is memoized and only recomputes when the spec reference
9
+ * changes.
10
+ *
11
+ * Returns `null` for `tree` when `spec` is `undefined` (loading state).
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * const { tree, isEmpty } = useDependencyGraph({
16
+ * agentName: agent.metadata.name,
17
+ * agentOrg: agent.metadata.org,
18
+ * spec: agent.spec,
19
+ * });
20
+ *
21
+ * if (!isEmpty && tree) {
22
+ * return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
23
+ * }
24
+ * ```
25
+ */
26
+ export declare function useDependencyGraph({ agentName, agentOrg, spec, }: UseDependencyGraphOptions): UseDependencyGraphReturn;
27
+ //# sourceMappingURL=useDependencyGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDependencyGraph.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/useDependencyGraph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,IAAI,GACL,EAAE,yBAAyB,GAAG,wBAAwB,CAuHtD"}
@@ -0,0 +1,129 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ /**
4
+ * Pure transformation hook that converts an `AgentSpec` into a
5
+ * {@link DependencyTree} for rendering.
6
+ *
7
+ * No data fetching, no side effects — the tree is computed entirely
8
+ * from the spec fields already available via {@link useAgent}. The
9
+ * result is memoized and only recomputes when the spec reference
10
+ * changes.
11
+ *
12
+ * Returns `null` for `tree` when `spec` is `undefined` (loading state).
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * const { tree, isEmpty } = useDependencyGraph({
17
+ * agentName: agent.metadata.name,
18
+ * agentOrg: agent.metadata.org,
19
+ * spec: agent.spec,
20
+ * });
21
+ *
22
+ * if (!isEmpty && tree) {
23
+ * return <DependencyGraph tree={tree} onNodeClick={handleClick} />;
24
+ * }
25
+ * ```
26
+ */
27
+ export function useDependencyGraph({ agentName, agentOrg, spec, }) {
28
+ return useMemo(() => {
29
+ if (!spec)
30
+ return { tree: null, isEmpty: true };
31
+ const { mcpServerUsages, skillRefs, subAgents } = spec;
32
+ const hasDeps = mcpServerUsages.length > 0 ||
33
+ skillRefs.length > 0 ||
34
+ subAgents.length > 0;
35
+ if (!hasDeps)
36
+ return { tree: null, isEmpty: true };
37
+ let nodeCount = 1; // root
38
+ const mcpNodes = mcpServerUsages
39
+ .filter((u) => u.mcpServerRef)
40
+ .map((usage) => {
41
+ nodeCount++;
42
+ const ref = usage.mcpServerRef;
43
+ const toolCount = usage.enabledTools.length;
44
+ return {
45
+ id: `mcp-server:${ref.slug}`,
46
+ kind: "mcp-server",
47
+ label: ref.slug,
48
+ qualifiedLabel: ref.org && ref.org !== agentOrg
49
+ ? `${ref.org}/${ref.slug}`
50
+ : undefined,
51
+ metadata: {
52
+ tools: toolCount > 0
53
+ ? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
54
+ : "all tools",
55
+ },
56
+ children: [],
57
+ ref: { org: ref.org || agentOrg, slug: ref.slug },
58
+ };
59
+ });
60
+ const skillNodes = skillRefs.map((ref) => {
61
+ nodeCount++;
62
+ return {
63
+ id: `skill:${ref.slug}`,
64
+ kind: "skill",
65
+ label: ref.slug,
66
+ qualifiedLabel: ref.org && ref.org !== agentOrg
67
+ ? `${ref.org}/${ref.slug}`
68
+ : undefined,
69
+ children: [],
70
+ ref: { org: ref.org || agentOrg, slug: ref.slug },
71
+ };
72
+ });
73
+ const subAgentNodes = subAgents.map((sa) => {
74
+ nodeCount++;
75
+ const saMcpNodes = sa.mcpAccess.map((access) => {
76
+ nodeCount++;
77
+ const toolCount = access.enabledTools.length;
78
+ return {
79
+ id: `sub-agent:${sa.name}:mcp-server:${access.mcpServer}`,
80
+ kind: "mcp-server",
81
+ label: access.mcpServer,
82
+ metadata: {
83
+ tools: toolCount > 0
84
+ ? `${toolCount} ${toolCount === 1 ? "tool" : "tools"}`
85
+ : "all tools",
86
+ },
87
+ children: [],
88
+ ref: { org: agentOrg, slug: access.mcpServer },
89
+ };
90
+ });
91
+ const saSkillNodes = sa.skillRefs.map((ref) => {
92
+ nodeCount++;
93
+ return {
94
+ id: `sub-agent:${sa.name}:skill:${ref.slug}`,
95
+ kind: "skill",
96
+ label: ref.slug,
97
+ qualifiedLabel: ref.org && ref.org !== agentOrg
98
+ ? `${ref.org}/${ref.slug}`
99
+ : undefined,
100
+ children: [],
101
+ ref: { org: ref.org || agentOrg, slug: ref.slug },
102
+ };
103
+ });
104
+ const metadata = {};
105
+ if (sa.modelOverride) {
106
+ metadata.model = sa.modelOverride;
107
+ }
108
+ return {
109
+ id: `sub-agent:${sa.name}`,
110
+ kind: "sub-agent",
111
+ label: sa.name,
112
+ description: sa.description || undefined,
113
+ metadata: Object.keys(metadata).length > 0 ? metadata : undefined,
114
+ children: [...saMcpNodes, ...saSkillNodes],
115
+ };
116
+ });
117
+ const root = {
118
+ id: `agent:${agentName}`,
119
+ kind: "agent",
120
+ label: agentName,
121
+ children: [...mcpNodes, ...skillNodes, ...subAgentNodes],
122
+ };
123
+ return {
124
+ tree: { root, nodeCount },
125
+ isEmpty: false,
126
+ };
127
+ }, [agentName, agentOrg, spec]);
128
+ }
129
+ //# sourceMappingURL=useDependencyGraph.js.map