@stigmer/react 0.4.7 → 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 (652) 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/execution/MessageThread.d.ts +1 -0
  90. package/execution/MessageThread.d.ts.map +1 -1
  91. package/execution/MessageThread.js +22 -12
  92. package/execution/MessageThread.js.map +1 -1
  93. package/execution/SetupProgress.d.ts +23 -9
  94. package/execution/SetupProgress.d.ts.map +1 -1
  95. package/execution/SetupProgress.js +30 -14
  96. package/execution/SetupProgress.js.map +1 -1
  97. package/execution/__tests__/thread-keys.test.js +82 -0
  98. package/execution/__tests__/thread-keys.test.js.map +1 -1
  99. package/feedback/StigmerToaster.d.ts +18 -0
  100. package/feedback/StigmerToaster.d.ts.map +1 -0
  101. package/feedback/StigmerToaster.js +31 -0
  102. package/feedback/StigmerToaster.js.map +1 -0
  103. package/feedback/index.d.ts +4 -0
  104. package/feedback/index.d.ts.map +1 -0
  105. package/feedback/index.js +3 -0
  106. package/feedback/index.js.map +1 -0
  107. package/feedback/toast.d.ts +14 -0
  108. package/feedback/toast.d.ts.map +1 -0
  109. package/feedback/toast.js +14 -0
  110. package/feedback/toast.js.map +1 -0
  111. package/feedback/types.d.ts +4 -0
  112. package/feedback/types.d.ts.map +1 -0
  113. package/feedback/types.js +2 -0
  114. package/feedback/types.js.map +1 -0
  115. package/index.d.ts +30 -10
  116. package/index.d.ts.map +1 -1
  117. package/index.js +29 -9
  118. package/index.js.map +1 -1
  119. package/inline-edit/InlineEditImage.d.ts +20 -0
  120. package/inline-edit/InlineEditImage.d.ts.map +1 -0
  121. package/inline-edit/InlineEditImage.js +85 -0
  122. package/inline-edit/InlineEditImage.js.map +1 -0
  123. package/inline-edit/InlineEditKeyValue.d.ts +29 -0
  124. package/inline-edit/InlineEditKeyValue.d.ts.map +1 -0
  125. package/inline-edit/InlineEditKeyValue.js +67 -0
  126. package/inline-edit/InlineEditKeyValue.js.map +1 -0
  127. package/inline-edit/InlineEditResourceList.d.ts +34 -0
  128. package/inline-edit/InlineEditResourceList.d.ts.map +1 -0
  129. package/inline-edit/InlineEditResourceList.js +99 -0
  130. package/inline-edit/InlineEditResourceList.js.map +1 -0
  131. package/inline-edit/InlineEditSelect.d.ts +18 -0
  132. package/inline-edit/InlineEditSelect.d.ts.map +1 -0
  133. package/inline-edit/InlineEditSelect.js +54 -0
  134. package/inline-edit/InlineEditSelect.js.map +1 -0
  135. package/inline-edit/InlineEditText.d.ts +23 -0
  136. package/inline-edit/InlineEditText.d.ts.map +1 -0
  137. package/inline-edit/InlineEditText.js +79 -0
  138. package/inline-edit/InlineEditText.js.map +1 -0
  139. package/inline-edit/InlineEditTextarea.d.ts +22 -0
  140. package/inline-edit/InlineEditTextarea.d.ts.map +1 -0
  141. package/inline-edit/InlineEditTextarea.js +83 -0
  142. package/inline-edit/InlineEditTextarea.js.map +1 -0
  143. package/inline-edit/index.d.ts +16 -0
  144. package/inline-edit/index.d.ts.map +1 -0
  145. package/inline-edit/index.js +8 -0
  146. package/inline-edit/index.js.map +1 -0
  147. package/inline-edit/types.d.ts +42 -0
  148. package/inline-edit/types.d.ts.map +1 -0
  149. package/inline-edit/types.js +2 -0
  150. package/inline-edit/types.js.map +1 -0
  151. package/inline-edit/useInlineFieldSave.d.ts +23 -0
  152. package/inline-edit/useInlineFieldSave.d.ts.map +1 -0
  153. package/inline-edit/useInlineFieldSave.js +44 -0
  154. package/inline-edit/useInlineFieldSave.js.map +1 -0
  155. package/internal/Tabs.d.ts +4 -38
  156. package/internal/Tabs.d.ts.map +1 -1
  157. package/internal/Tabs.js +3 -62
  158. package/internal/Tabs.js.map +1 -1
  159. package/library/ImportResourceDialog.d.ts +43 -0
  160. package/library/ImportResourceDialog.d.ts.map +1 -0
  161. package/library/ImportResourceDialog.js +90 -0
  162. package/library/ImportResourceDialog.js.map +1 -0
  163. package/library/index.d.ts +7 -4
  164. package/library/index.d.ts.map +1 -1
  165. package/library/index.js +4 -2
  166. package/library/index.js.map +1 -1
  167. package/library/serialize-resource-yaml.d.ts +53 -0
  168. package/library/serialize-resource-yaml.d.ts.map +1 -1
  169. package/library/serialize-resource-yaml.js +275 -0
  170. package/library/serialize-resource-yaml.js.map +1 -1
  171. package/library/useExportResource.d.ts +56 -0
  172. package/library/useExportResource.d.ts.map +1 -0
  173. package/library/useExportResource.js +137 -0
  174. package/library/useExportResource.js.map +1 -0
  175. package/library/useImportResource.d.ts +84 -0
  176. package/library/useImportResource.d.ts.map +1 -0
  177. package/library/useImportResource.js +188 -0
  178. package/library/useImportResource.js.map +1 -0
  179. package/mcp-server/McpServerCreationWizard.d.ts +55 -0
  180. package/mcp-server/McpServerCreationWizard.d.ts.map +1 -0
  181. package/mcp-server/McpServerCreationWizard.js +121 -0
  182. package/mcp-server/McpServerCreationWizard.js.map +1 -0
  183. package/mcp-server/McpServerDetailView.d.ts +21 -1
  184. package/mcp-server/McpServerDetailView.d.ts.map +1 -1
  185. package/mcp-server/McpServerDetailView.js +113 -20
  186. package/mcp-server/McpServerDetailView.js.map +1 -1
  187. package/mcp-server/index.d.ts +8 -0
  188. package/mcp-server/index.d.ts.map +1 -1
  189. package/mcp-server/index.js +4 -0
  190. package/mcp-server/index.js.map +1 -1
  191. package/mcp-server/internal/mcpServerToInput.d.ts +12 -0
  192. package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -0
  193. package/mcp-server/internal/mcpServerToInput.js +81 -0
  194. package/mcp-server/internal/mcpServerToInput.js.map +1 -0
  195. package/mcp-server/steps/EnvironmentAuthStep.d.ts +15 -0
  196. package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -0
  197. package/mcp-server/steps/EnvironmentAuthStep.js +55 -0
  198. package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -0
  199. package/mcp-server/steps/IdentityTransportStep.d.ts +19 -0
  200. package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -0
  201. package/mcp-server/steps/IdentityTransportStep.js +73 -0
  202. package/mcp-server/steps/IdentityTransportStep.js.map +1 -0
  203. package/mcp-server/steps/ReviewStep.d.ts +23 -0
  204. package/mcp-server/steps/ReviewStep.d.ts.map +1 -0
  205. package/mcp-server/steps/ReviewStep.js +137 -0
  206. package/mcp-server/steps/ReviewStep.js.map +1 -0
  207. package/mcp-server/steps/types.d.ts +56 -0
  208. package/mcp-server/steps/types.d.ts.map +1 -0
  209. package/mcp-server/steps/types.js +27 -0
  210. package/mcp-server/steps/types.js.map +1 -0
  211. package/mcp-server/useCreateMcpServer.d.ts +45 -0
  212. package/mcp-server/useCreateMcpServer.d.ts.map +1 -0
  213. package/mcp-server/useCreateMcpServer.js +50 -0
  214. package/mcp-server/useCreateMcpServer.js.map +1 -0
  215. package/mcp-server/useUpdateMcpServer.d.ts +24 -0
  216. package/mcp-server/useUpdateMcpServer.d.ts.map +1 -0
  217. package/mcp-server/useUpdateMcpServer.js +35 -0
  218. package/mcp-server/useUpdateMcpServer.js.map +1 -0
  219. package/models/registry.d.ts +4 -1
  220. package/models/registry.d.ts.map +1 -1
  221. package/models/registry.js +6 -2
  222. package/models/registry.js.map +1 -1
  223. package/package.json +8 -4
  224. package/provider.js +1 -1
  225. package/provider.js.map +1 -1
  226. package/resource-creation/CreationPicker.d.ts +60 -0
  227. package/resource-creation/CreationPicker.d.ts.map +1 -0
  228. package/resource-creation/CreationPicker.js +74 -0
  229. package/resource-creation/CreationPicker.js.map +1 -0
  230. package/resource-creation/StepIndicator.d.ts +28 -0
  231. package/resource-creation/StepIndicator.d.ts.map +1 -0
  232. package/resource-creation/StepIndicator.js +40 -0
  233. package/resource-creation/StepIndicator.js.map +1 -0
  234. package/resource-creation/TemplateCard.d.ts +24 -0
  235. package/resource-creation/TemplateCard.d.ts.map +1 -0
  236. package/resource-creation/TemplateCard.js +68 -0
  237. package/resource-creation/TemplateCard.js.map +1 -0
  238. package/resource-creation/TemplateGallery.d.ts +43 -0
  239. package/resource-creation/TemplateGallery.d.ts.map +1 -0
  240. package/resource-creation/TemplateGallery.js +78 -0
  241. package/resource-creation/TemplateGallery.js.map +1 -0
  242. package/resource-creation/WizardNav.d.ts +31 -0
  243. package/resource-creation/WizardNav.d.ts.map +1 -0
  244. package/resource-creation/WizardNav.js +29 -0
  245. package/resource-creation/WizardNav.js.map +1 -0
  246. package/resource-creation/WizardShell.d.ts +41 -0
  247. package/resource-creation/WizardShell.d.ts.map +1 -0
  248. package/resource-creation/WizardShell.js +55 -0
  249. package/resource-creation/WizardShell.js.map +1 -0
  250. package/resource-creation/index.d.ts +21 -0
  251. package/resource-creation/index.d.ts.map +1 -0
  252. package/resource-creation/index.js +14 -0
  253. package/resource-creation/index.js.map +1 -0
  254. package/resource-creation/templates/agent-templates.d.ts +15 -0
  255. package/resource-creation/templates/agent-templates.d.ts.map +1 -0
  256. package/resource-creation/templates/agent-templates.js +148 -0
  257. package/resource-creation/templates/agent-templates.js.map +1 -0
  258. package/resource-creation/templates/index.d.ts +5 -0
  259. package/resource-creation/templates/index.d.ts.map +1 -0
  260. package/resource-creation/templates/index.js +5 -0
  261. package/resource-creation/templates/index.js.map +1 -0
  262. package/resource-creation/templates/mcp-server-templates.d.ts +15 -0
  263. package/resource-creation/templates/mcp-server-templates.d.ts.map +1 -0
  264. package/resource-creation/templates/mcp-server-templates.js +92 -0
  265. package/resource-creation/templates/mcp-server-templates.js.map +1 -0
  266. package/resource-creation/templates/types.d.ts +48 -0
  267. package/resource-creation/templates/types.d.ts.map +1 -0
  268. package/resource-creation/templates/types.js +16 -0
  269. package/resource-creation/templates/types.js.map +1 -0
  270. package/resource-creation/types.d.ts +88 -0
  271. package/resource-creation/types.d.ts.map +1 -0
  272. package/resource-creation/types.js +2 -0
  273. package/resource-creation/types.js.map +1 -0
  274. package/resource-creation/useTemplateFilter.d.ts +43 -0
  275. package/resource-creation/useTemplateFilter.d.ts.map +1 -0
  276. package/resource-creation/useTemplateFilter.js +73 -0
  277. package/resource-creation/useTemplateFilter.js.map +1 -0
  278. package/resource-creation/useWizardState.d.ts +67 -0
  279. package/resource-creation/useWizardState.d.ts.map +1 -0
  280. package/resource-creation/useWizardState.js +143 -0
  281. package/resource-creation/useWizardState.js.map +1 -0
  282. package/resource-detail/ConfirmDialog.d.ts +44 -0
  283. package/resource-detail/ConfirmDialog.d.ts.map +1 -0
  284. package/resource-detail/ConfirmDialog.js +62 -0
  285. package/resource-detail/ConfirmDialog.js.map +1 -0
  286. package/resource-detail/ResourceActionBar.d.ts +42 -0
  287. package/resource-detail/ResourceActionBar.d.ts.map +1 -0
  288. package/resource-detail/ResourceActionBar.js +64 -0
  289. package/resource-detail/ResourceActionBar.js.map +1 -0
  290. package/resource-detail/ResourceDetailShell.d.ts +36 -0
  291. package/resource-detail/ResourceDetailShell.d.ts.map +1 -0
  292. package/resource-detail/ResourceDetailShell.js +65 -0
  293. package/resource-detail/ResourceDetailShell.js.map +1 -0
  294. package/resource-detail/Section.d.ts +18 -0
  295. package/resource-detail/Section.d.ts.map +1 -0
  296. package/resource-detail/Section.js +18 -0
  297. package/resource-detail/Section.js.map +1 -0
  298. package/resource-detail/index.d.ts +15 -0
  299. package/resource-detail/index.d.ts.map +1 -0
  300. package/resource-detail/index.js +10 -0
  301. package/resource-detail/index.js.map +1 -0
  302. package/resource-detail/types.d.ts +146 -0
  303. package/resource-detail/types.d.ts.map +1 -0
  304. package/resource-detail/types.js +2 -0
  305. package/resource-detail/types.js.map +1 -0
  306. package/resource-detail/useConfirmAction.d.ts +41 -0
  307. package/resource-detail/useConfirmAction.d.ts.map +1 -0
  308. package/resource-detail/useConfirmAction.js +30 -0
  309. package/resource-detail/useConfirmAction.js.map +1 -0
  310. package/resource-detail/useCopyResource.d.ts +28 -0
  311. package/resource-detail/useCopyResource.d.ts.map +1 -0
  312. package/resource-detail/useCopyResource.js +46 -0
  313. package/resource-detail/useCopyResource.js.map +1 -0
  314. package/resource-detail/useDeleteResource.d.ts +40 -0
  315. package/resource-detail/useDeleteResource.d.ts.map +1 -0
  316. package/resource-detail/useDeleteResource.js +83 -0
  317. package/resource-detail/useDeleteResource.js.map +1 -0
  318. package/resource-detail/useDetailTabs.d.ts +46 -0
  319. package/resource-detail/useDetailTabs.d.ts.map +1 -0
  320. package/resource-detail/useDetailTabs.js +47 -0
  321. package/resource-detail/useDetailTabs.js.map +1 -0
  322. package/resource-workbench/components/BulkActionBar.d.ts +36 -0
  323. package/resource-workbench/components/BulkActionBar.d.ts.map +1 -0
  324. package/resource-workbench/components/BulkActionBar.js +35 -0
  325. package/resource-workbench/components/BulkActionBar.js.map +1 -0
  326. package/resource-workbench/components/ColumnHeader.d.ts +23 -0
  327. package/resource-workbench/components/ColumnHeader.d.ts.map +1 -0
  328. package/resource-workbench/components/ColumnHeader.js +25 -0
  329. package/resource-workbench/components/ColumnHeader.js.map +1 -0
  330. package/resource-workbench/components/FilterBar.d.ts +33 -0
  331. package/resource-workbench/components/FilterBar.d.ts.map +1 -0
  332. package/resource-workbench/components/FilterBar.js +72 -0
  333. package/resource-workbench/components/FilterBar.js.map +1 -0
  334. package/resource-workbench/components/ResourceAvatar.d.ts +29 -0
  335. package/resource-workbench/components/ResourceAvatar.d.ts.map +1 -0
  336. package/resource-workbench/components/ResourceAvatar.js +51 -0
  337. package/resource-workbench/components/ResourceAvatar.js.map +1 -0
  338. package/resource-workbench/components/ResourceCards.d.ts +39 -0
  339. package/resource-workbench/components/ResourceCards.d.ts.map +1 -0
  340. package/resource-workbench/components/ResourceCards.js +41 -0
  341. package/resource-workbench/components/ResourceCards.js.map +1 -0
  342. package/resource-workbench/components/ResourceInspector.d.ts +26 -0
  343. package/resource-workbench/components/ResourceInspector.d.ts.map +1 -0
  344. package/resource-workbench/components/ResourceInspector.js +22 -0
  345. package/resource-workbench/components/ResourceInspector.js.map +1 -0
  346. package/resource-workbench/components/ResourceList.d.ts +39 -0
  347. package/resource-workbench/components/ResourceList.d.ts.map +1 -0
  348. package/resource-workbench/components/ResourceList.js +41 -0
  349. package/resource-workbench/components/ResourceList.js.map +1 -0
  350. package/resource-workbench/components/ResourceTable.d.ts +47 -0
  351. package/resource-workbench/components/ResourceTable.d.ts.map +1 -0
  352. package/resource-workbench/components/ResourceTable.js +78 -0
  353. package/resource-workbench/components/ResourceTable.js.map +1 -0
  354. package/resource-workbench/components/ResourceWorkbench.d.ts +131 -0
  355. package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -0
  356. package/resource-workbench/components/ResourceWorkbench.js +170 -0
  357. package/resource-workbench/components/ResourceWorkbench.js.map +1 -0
  358. package/resource-workbench/components/SelectionCheckbox.d.ts +24 -0
  359. package/resource-workbench/components/SelectionCheckbox.d.ts.map +1 -0
  360. package/resource-workbench/components/SelectionCheckbox.js +16 -0
  361. package/resource-workbench/components/SelectionCheckbox.js.map +1 -0
  362. package/resource-workbench/components/StatusBadge.d.ts +31 -0
  363. package/resource-workbench/components/StatusBadge.d.ts.map +1 -0
  364. package/resource-workbench/components/StatusBadge.js +75 -0
  365. package/resource-workbench/components/StatusBadge.js.map +1 -0
  366. package/resource-workbench/components/ViewSwitcher.d.ts +21 -0
  367. package/resource-workbench/components/ViewSwitcher.d.ts.map +1 -0
  368. package/resource-workbench/components/ViewSwitcher.js +37 -0
  369. package/resource-workbench/components/ViewSwitcher.js.map +1 -0
  370. package/resource-workbench/hooks/useResourceCollection.d.ts +93 -0
  371. package/resource-workbench/hooks/useResourceCollection.d.ts.map +1 -0
  372. package/resource-workbench/hooks/useResourceCollection.js +133 -0
  373. package/resource-workbench/hooks/useResourceCollection.js.map +1 -0
  374. package/resource-workbench/hooks/useResourceFilters.d.ts +73 -0
  375. package/resource-workbench/hooks/useResourceFilters.d.ts.map +1 -0
  376. package/resource-workbench/hooks/useResourceFilters.js +105 -0
  377. package/resource-workbench/hooks/useResourceFilters.js.map +1 -0
  378. package/resource-workbench/hooks/useResourceSelection.d.ts +44 -0
  379. package/resource-workbench/hooks/useResourceSelection.d.ts.map +1 -0
  380. package/resource-workbench/hooks/useResourceSelection.js +123 -0
  381. package/resource-workbench/hooks/useResourceSelection.js.map +1 -0
  382. package/resource-workbench/hooks/useViewPreference.d.ts +32 -0
  383. package/resource-workbench/hooks/useViewPreference.d.ts.map +1 -0
  384. package/resource-workbench/hooks/useViewPreference.js +60 -0
  385. package/resource-workbench/hooks/useViewPreference.js.map +1 -0
  386. package/resource-workbench/index.d.ts +34 -0
  387. package/resource-workbench/index.d.ts.map +1 -0
  388. package/resource-workbench/index.js +19 -0
  389. package/resource-workbench/index.js.map +1 -0
  390. package/resource-workbench/types.d.ts +165 -0
  391. package/resource-workbench/types.d.ts.map +1 -0
  392. package/resource-workbench/types.js +2 -0
  393. package/resource-workbench/types.js.map +1 -0
  394. package/runner/RunnerDetailView.d.ts +44 -0
  395. package/runner/RunnerDetailView.d.ts.map +1 -0
  396. package/runner/RunnerDetailView.js +154 -0
  397. package/runner/RunnerDetailView.js.map +1 -0
  398. package/runner/RunnerListPanel.d.ts +26 -1
  399. package/runner/RunnerListPanel.d.ts.map +1 -1
  400. package/runner/RunnerListPanel.js +68 -46
  401. package/runner/RunnerListPanel.js.map +1 -1
  402. package/runner/index.d.ts +7 -1
  403. package/runner/index.d.ts.map +1 -1
  404. package/runner/index.js +3 -0
  405. package/runner/index.js.map +1 -1
  406. package/runner/shared.d.ts +31 -0
  407. package/runner/shared.d.ts.map +1 -0
  408. package/runner/shared.js +55 -0
  409. package/runner/shared.js.map +1 -0
  410. package/runner/useRunner.d.ts +37 -0
  411. package/runner/useRunner.d.ts.map +1 -0
  412. package/runner/useRunner.js +24 -0
  413. package/runner/useRunner.js.map +1 -0
  414. package/session/__tests__/group-sessions.test.js +3 -3
  415. package/session/__tests__/group-sessions.test.js.map +1 -1
  416. package/skill/SkillDetailView.d.ts +70 -7
  417. package/skill/SkillDetailView.d.ts.map +1 -1
  418. package/skill/SkillDetailView.js +107 -39
  419. package/skill/SkillDetailView.js.map +1 -1
  420. package/skill/SkillDiffDialog.d.ts +42 -0
  421. package/skill/SkillDiffDialog.d.ts.map +1 -0
  422. package/skill/SkillDiffDialog.js +72 -0
  423. package/skill/SkillDiffDialog.js.map +1 -0
  424. package/skill/SkillFileBrowser.d.ts +31 -0
  425. package/skill/SkillFileBrowser.d.ts.map +1 -0
  426. package/skill/SkillFileBrowser.js +105 -0
  427. package/skill/SkillFileBrowser.js.map +1 -0
  428. package/skill/SkillUploader.d.ts +39 -0
  429. package/skill/SkillUploader.d.ts.map +1 -0
  430. package/skill/SkillUploader.js +141 -0
  431. package/skill/SkillUploader.js.map +1 -0
  432. package/skill/index.d.ts +18 -0
  433. package/skill/index.d.ts.map +1 -1
  434. package/skill/index.js +9 -0
  435. package/skill/index.js.map +1 -1
  436. package/skill/internal/computeArtifactHash.d.ts +9 -0
  437. package/skill/internal/computeArtifactHash.d.ts.map +1 -0
  438. package/skill/internal/computeArtifactHash.js +14 -0
  439. package/skill/internal/computeArtifactHash.js.map +1 -0
  440. package/skill/internal/fetchAndUnpackArtifact.d.ts +16 -0
  441. package/skill/internal/fetchAndUnpackArtifact.d.ts.map +1 -0
  442. package/skill/internal/fetchAndUnpackArtifact.js +34 -0
  443. package/skill/internal/fetchAndUnpackArtifact.js.map +1 -0
  444. package/skill/usePushSkill.d.ts +53 -0
  445. package/skill/usePushSkill.d.ts.map +1 -0
  446. package/skill/usePushSkill.js +57 -0
  447. package/skill/usePushSkill.js.map +1 -0
  448. package/skill/useSkillArtifact.d.ts +37 -0
  449. package/skill/useSkillArtifact.d.ts.map +1 -0
  450. package/skill/useSkillArtifact.js +76 -0
  451. package/skill/useSkillArtifact.js.map +1 -0
  452. package/skill/useSkillDiff.d.ts +31 -0
  453. package/skill/useSkillDiff.d.ts.map +1 -0
  454. package/skill/useSkillDiff.js +97 -0
  455. package/skill/useSkillDiff.js.map +1 -0
  456. package/skill/useSkillDuplicateCheck.d.ts +34 -0
  457. package/skill/useSkillDuplicateCheck.d.ts.map +1 -0
  458. package/skill/useSkillDuplicateCheck.js +58 -0
  459. package/skill/useSkillDuplicateCheck.js.map +1 -0
  460. package/skill/useSkillUpload.d.ts +69 -0
  461. package/skill/useSkillUpload.d.ts.map +1 -0
  462. package/skill/useSkillUpload.js +157 -0
  463. package/skill/useSkillUpload.js.map +1 -0
  464. package/skill/useSkillVersions.d.ts +46 -0
  465. package/skill/useSkillVersions.d.ts.map +1 -0
  466. package/skill/useSkillVersions.js +104 -0
  467. package/skill/useSkillVersions.js.map +1 -0
  468. package/src/action-menu/ActionMenu.tsx +151 -0
  469. package/src/action-menu/index.ts +9 -0
  470. package/src/action-menu/types.ts +70 -0
  471. package/src/agent/AgentCreationWizard.tsx +201 -0
  472. package/src/agent/AgentDetailView.tsx +817 -321
  473. package/src/agent/index.ts +16 -0
  474. package/src/agent/internal/agentToInput.ts +95 -0
  475. package/src/agent/steps/CapabilitiesStep.tsx +363 -0
  476. package/src/agent/steps/IdentityStep.tsx +259 -0
  477. package/src/agent/steps/ReviewStep.tsx +211 -0
  478. package/src/agent/steps/types.ts +53 -0
  479. package/src/agent/useCreateAgent.ts +76 -0
  480. package/src/agent/useUpdateAgent.ts +55 -0
  481. package/src/dependency-graph/DependencyGraph.tsx +153 -0
  482. package/src/dependency-graph/DependencyTreeNode.tsx +282 -0
  483. package/src/dependency-graph/index.ts +15 -0
  484. package/src/dependency-graph/types.ts +131 -0
  485. package/src/dependency-graph/useDependencyGraph.ts +158 -0
  486. package/src/empty-state/EmptyState.tsx +90 -0
  487. package/src/empty-state/index.ts +9 -0
  488. package/src/empty-state/types.ts +81 -0
  489. package/src/empty-state/useEmptyState.ts +85 -0
  490. package/src/execution/MessageThread.tsx +26 -15
  491. package/src/execution/SetupProgress.tsx +35 -14
  492. package/src/execution/__tests__/thread-keys.test.ts +101 -0
  493. package/src/feedback/StigmerToaster.tsx +45 -0
  494. package/src/feedback/index.ts +3 -0
  495. package/src/feedback/toast.ts +13 -0
  496. package/src/feedback/types.ts +7 -0
  497. package/src/index.ts +270 -8
  498. package/src/inline-edit/InlineEditImage.tsx +208 -0
  499. package/src/inline-edit/InlineEditKeyValue.tsx +278 -0
  500. package/src/inline-edit/InlineEditResourceList.tsx +325 -0
  501. package/src/inline-edit/InlineEditSelect.tsx +150 -0
  502. package/src/inline-edit/InlineEditText.tsx +211 -0
  503. package/src/inline-edit/InlineEditTextarea.tsx +209 -0
  504. package/src/inline-edit/index.ts +28 -0
  505. package/src/inline-edit/types.ts +47 -0
  506. package/src/inline-edit/useInlineFieldSave.ts +62 -0
  507. package/src/internal/Tabs.tsx +4 -164
  508. package/src/library/ImportResourceDialog.tsx +227 -0
  509. package/src/library/index.ts +18 -8
  510. package/src/library/serialize-resource-yaml.ts +356 -0
  511. package/src/library/useExportResource.ts +183 -0
  512. package/src/library/useImportResource.ts +253 -0
  513. package/src/mcp-server/McpServerCreationWizard.tsx +206 -0
  514. package/src/mcp-server/McpServerDetailView.tsx +392 -105
  515. package/src/mcp-server/index.ts +16 -0
  516. package/src/mcp-server/internal/mcpServerToInput.ts +95 -0
  517. package/src/mcp-server/steps/EnvironmentAuthStep.tsx +462 -0
  518. package/src/mcp-server/steps/IdentityTransportStep.tsx +531 -0
  519. package/src/mcp-server/steps/ReviewStep.tsx +297 -0
  520. package/src/mcp-server/steps/types.ts +85 -0
  521. package/src/mcp-server/useCreateMcpServer.ts +76 -0
  522. package/src/mcp-server/useUpdateMcpServer.ts +55 -0
  523. package/src/models/registry.ts +10 -2
  524. package/src/provider.tsx +1 -1
  525. package/src/resource-creation/CreationPicker.tsx +292 -0
  526. package/src/resource-creation/StepIndicator.tsx +156 -0
  527. package/src/resource-creation/TemplateCard.tsx +143 -0
  528. package/src/resource-creation/TemplateGallery.tsx +222 -0
  529. package/src/resource-creation/WizardNav.tsx +163 -0
  530. package/src/resource-creation/WizardShell.tsx +124 -0
  531. package/src/resource-creation/index.ts +45 -0
  532. package/src/resource-creation/templates/agent-templates.ts +160 -0
  533. package/src/resource-creation/templates/index.ts +7 -0
  534. package/src/resource-creation/templates/mcp-server-templates.ts +106 -0
  535. package/src/resource-creation/templates/types.ts +64 -0
  536. package/src/resource-creation/types.ts +105 -0
  537. package/src/resource-creation/useTemplateFilter.ts +117 -0
  538. package/src/resource-creation/useWizardState.ts +223 -0
  539. package/src/resource-detail/ConfirmDialog.tsx +127 -0
  540. package/src/resource-detail/ResourceActionBar.tsx +157 -0
  541. package/src/resource-detail/ResourceDetailShell.tsx +184 -0
  542. package/src/resource-detail/Section.tsx +78 -0
  543. package/src/resource-detail/index.ts +34 -0
  544. package/src/resource-detail/types.ts +177 -0
  545. package/src/resource-detail/useConfirmAction.ts +70 -0
  546. package/src/resource-detail/useCopyResource.ts +74 -0
  547. package/src/resource-detail/useDeleteResource.ts +110 -0
  548. package/src/resource-detail/useDetailTabs.ts +93 -0
  549. package/src/resource-workbench/components/BulkActionBar.tsx +122 -0
  550. package/src/resource-workbench/components/ColumnHeader.tsx +105 -0
  551. package/src/resource-workbench/components/FilterBar.tsx +173 -0
  552. package/src/resource-workbench/components/ResourceAvatar.tsx +109 -0
  553. package/src/resource-workbench/components/ResourceCards.tsx +126 -0
  554. package/src/resource-workbench/components/ResourceInspector.tsx +88 -0
  555. package/src/resource-workbench/components/ResourceList.tsx +121 -0
  556. package/src/resource-workbench/components/ResourceTable.tsx +222 -0
  557. package/src/resource-workbench/components/ResourceWorkbench.tsx +695 -0
  558. package/src/resource-workbench/components/SelectionCheckbox.tsx +52 -0
  559. package/src/resource-workbench/components/StatusBadge.tsx +119 -0
  560. package/src/resource-workbench/components/ViewSwitcher.tsx +135 -0
  561. package/src/resource-workbench/hooks/useResourceCollection.ts +261 -0
  562. package/src/resource-workbench/hooks/useResourceFilters.ts +216 -0
  563. package/src/resource-workbench/hooks/useResourceSelection.ts +178 -0
  564. package/src/resource-workbench/hooks/useViewPreference.ts +75 -0
  565. package/src/resource-workbench/index.ts +73 -0
  566. package/src/resource-workbench/types.ts +220 -0
  567. package/src/runner/RunnerDetailView.tsx +410 -0
  568. package/src/runner/RunnerListPanel.tsx +126 -111
  569. package/src/runner/index.ts +13 -1
  570. package/src/runner/shared.tsx +124 -0
  571. package/src/runner/useRunner.ts +59 -0
  572. package/src/session/__tests__/group-sessions.test.ts +5 -3
  573. package/src/skill/SkillDetailView.tsx +371 -165
  574. package/src/skill/SkillDiffDialog.tsx +213 -0
  575. package/src/skill/SkillFileBrowser.tsx +289 -0
  576. package/src/skill/SkillUploader.tsx +481 -0
  577. package/src/skill/index.ts +34 -0
  578. package/src/skill/internal/computeArtifactHash.ts +13 -0
  579. package/src/skill/internal/fetchAndUnpackArtifact.ts +48 -0
  580. package/src/skill/usePushSkill.ts +101 -0
  581. package/src/skill/useSkillArtifact.ts +107 -0
  582. package/src/skill/useSkillDiff.ts +128 -0
  583. package/src/skill/useSkillDuplicateCheck.ts +92 -0
  584. package/src/skill/useSkillUpload.ts +231 -0
  585. package/src/skill/useSkillVersions.ts +165 -0
  586. package/src/styles.css +28 -0
  587. package/src/tabs/Tabs.tsx +184 -0
  588. package/src/tabs/index.ts +2 -0
  589. package/src/version-history/DiffFileList.tsx +111 -0
  590. package/src/version-history/DiffSummary.tsx +61 -0
  591. package/src/version-history/DiffViewer.tsx +163 -0
  592. package/src/version-history/MultiFileDiffView.tsx +114 -0
  593. package/src/version-history/VersionTimeline.tsx +232 -0
  594. package/src/version-history/VersionTimelineEntry.tsx +254 -0
  595. package/src/version-history/computeDiff.ts +61 -0
  596. package/src/version-history/computeMultiFileDiff.ts +97 -0
  597. package/src/version-history/index.ts +22 -0
  598. package/src/version-history/types.ts +129 -0
  599. package/styles.css +1 -1
  600. package/tabs/Tabs.d.ts +58 -0
  601. package/tabs/Tabs.d.ts.map +1 -0
  602. package/tabs/Tabs.js +80 -0
  603. package/tabs/Tabs.js.map +1 -0
  604. package/tabs/index.d.ts +3 -0
  605. package/tabs/index.d.ts.map +1 -0
  606. package/tabs/index.js +2 -0
  607. package/tabs/index.js.map +1 -0
  608. package/version-history/DiffFileList.d.ts +22 -0
  609. package/version-history/DiffFileList.d.ts.map +1 -0
  610. package/version-history/DiffFileList.js +37 -0
  611. package/version-history/DiffFileList.js.map +1 -0
  612. package/version-history/DiffSummary.d.ts +21 -0
  613. package/version-history/DiffSummary.d.ts.map +1 -0
  614. package/version-history/DiffSummary.js +16 -0
  615. package/version-history/DiffSummary.js.map +1 -0
  616. package/version-history/DiffViewer.d.ts +31 -0
  617. package/version-history/DiffViewer.d.ts.map +1 -0
  618. package/version-history/DiffViewer.js +60 -0
  619. package/version-history/DiffViewer.js.map +1 -0
  620. package/version-history/MultiFileDiffView.d.ts +30 -0
  621. package/version-history/MultiFileDiffView.d.ts.map +1 -0
  622. package/version-history/MultiFileDiffView.js +40 -0
  623. package/version-history/MultiFileDiffView.js.map +1 -0
  624. package/version-history/VersionTimeline.d.ts +29 -0
  625. package/version-history/VersionTimeline.d.ts.map +1 -0
  626. package/version-history/VersionTimeline.js +87 -0
  627. package/version-history/VersionTimeline.js.map +1 -0
  628. package/version-history/VersionTimelineEntry.d.ts +22 -0
  629. package/version-history/VersionTimelineEntry.d.ts.map +1 -0
  630. package/version-history/VersionTimelineEntry.js +98 -0
  631. package/version-history/VersionTimelineEntry.js.map +1 -0
  632. package/version-history/computeDiff.d.ts +16 -0
  633. package/version-history/computeDiff.d.ts.map +1 -0
  634. package/version-history/computeDiff.js +54 -0
  635. package/version-history/computeDiff.js.map +1 -0
  636. package/version-history/computeMultiFileDiff.d.ts +15 -0
  637. package/version-history/computeMultiFileDiff.d.ts.map +1 -0
  638. package/version-history/computeMultiFileDiff.js +83 -0
  639. package/version-history/computeMultiFileDiff.js.map +1 -0
  640. package/version-history/index.d.ts +14 -0
  641. package/version-history/index.d.ts.map +1 -0
  642. package/version-history/index.js +9 -0
  643. package/version-history/index.js.map +1 -0
  644. package/version-history/types.d.ts +106 -0
  645. package/version-history/types.d.ts.map +1 -0
  646. package/version-history/types.js +2 -0
  647. package/version-history/types.js.map +1 -0
  648. package/library/ResourceListView.d.ts +0 -174
  649. package/library/ResourceListView.d.ts.map +0 -1
  650. package/library/ResourceListView.js +0 -318
  651. package/library/ResourceListView.js.map +0 -1
  652. package/src/library/ResourceListView.tsx +0 -956
@@ -0,0 +1,141 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useRef, useState } from "react";
4
+ import Markdown from "react-markdown";
5
+ import { cn } from "@stigmer/theme";
6
+ import { MARKDOWN_COMPONENTS, REMARK_PLUGINS, stripFrontmatter } from "../internal/markdown-components";
7
+ import { useSkillUpload } from "./useSkillUpload";
8
+ import { usePushSkill } from "./usePushSkill";
9
+ import { useSkillDuplicateCheck } from "./useSkillDuplicateCheck";
10
+ // ---------------------------------------------------------------------------
11
+ // Main component
12
+ // ---------------------------------------------------------------------------
13
+ /**
14
+ * Skill package upload component with validation and preview.
15
+ *
16
+ * Two-phase flow:
17
+ * 1. **Drop zone** — User drags/drops or clicks to select a .zip file
18
+ * 2. **Preview + confirm** — Validated package summary, file listing,
19
+ * rendered SKILL.md preview, and push button
20
+ *
21
+ * Validates the uploaded ZIP against the Anthropic Agent Skills spec:
22
+ * must contain SKILL.md with valid YAML frontmatter (name, description).
23
+ *
24
+ * Zero Console dependencies — safe for platform builder embedding.
25
+ * All visual properties flow through `--stgm-*` design tokens.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <SkillUploader
30
+ * org="acme"
31
+ * onComplete={(skill) => router.push(`/library/skills/${skill.metadata?.org}/${skill.metadata?.slug}`)}
32
+ * onCancel={() => router.back()}
33
+ * />
34
+ * ```
35
+ */
36
+ export function SkillUploader({ org, tag, onComplete, onCancel, className, }) {
37
+ const upload = useSkillUpload();
38
+ const { push, isPushing, error: pushError, clearError } = usePushSkill();
39
+ const dupCheck = useSkillDuplicateCheck();
40
+ const handleFileProcessed = useCallback(async (file) => {
41
+ dupCheck.reset();
42
+ await upload.processFile(file);
43
+ }, [upload, dupCheck]);
44
+ useEffect(() => {
45
+ if (upload.preview && upload.artifact) {
46
+ const slug = normalizeToSlug(upload.preview.name);
47
+ dupCheck.check({ org, slug, artifactBytes: upload.artifact });
48
+ }
49
+ }, [upload.preview, upload.artifact, org]);
50
+ const handlePush = useCallback(async () => {
51
+ if (!upload.artifact)
52
+ return;
53
+ clearError();
54
+ try {
55
+ const skill = await push({ org, artifact: upload.artifact, tag });
56
+ onComplete?.(skill);
57
+ }
58
+ catch {
59
+ // Error captured in usePushSkill state
60
+ }
61
+ }, [upload.artifact, clearError, push, org, tag, onComplete]);
62
+ const handleReset = useCallback(() => {
63
+ upload.reset();
64
+ dupCheck.reset();
65
+ }, [upload, dupCheck]);
66
+ return (_jsx("div", { className: cn("flex flex-col gap-0 rounded-lg border border-border bg-card", className), children: upload.preview ? (_jsx(PreviewPhase, { preview: upload.preview, isPushing: isPushing, pushError: pushError, onPush: handlePush, onReset: handleReset, onCancel: onCancel, isDuplicate: dupCheck.isDuplicate, isCheckingDuplicate: dupCheck.isChecking })) : (_jsx(DropZonePhase, { onFile: handleFileProcessed, isProcessing: upload.isProcessing, validationError: upload.validationError, onCancel: onCancel })) }));
67
+ }
68
+ // ---------------------------------------------------------------------------
69
+ // Phase 1: Drop Zone
70
+ // ---------------------------------------------------------------------------
71
+ function DropZonePhase({ onFile, isProcessing, validationError, onCancel, }) {
72
+ const [isDragOver, setIsDragOver] = useState(false);
73
+ const inputRef = useRef(null);
74
+ const handleDragOver = useCallback((e) => {
75
+ e.preventDefault();
76
+ e.stopPropagation();
77
+ setIsDragOver(true);
78
+ }, []);
79
+ const handleDragLeave = useCallback((e) => {
80
+ e.preventDefault();
81
+ e.stopPropagation();
82
+ setIsDragOver(false);
83
+ }, []);
84
+ const handleDrop = useCallback((e) => {
85
+ e.preventDefault();
86
+ e.stopPropagation();
87
+ setIsDragOver(false);
88
+ const file = e.dataTransfer.files[0];
89
+ if (file)
90
+ onFile(file);
91
+ }, [onFile]);
92
+ const handleClick = useCallback(() => {
93
+ inputRef.current?.click();
94
+ }, []);
95
+ const handleFileChange = useCallback((e) => {
96
+ const file = e.target.files?.[0];
97
+ if (file)
98
+ onFile(file);
99
+ if (inputRef.current)
100
+ inputRef.current.value = "";
101
+ }, [onFile]);
102
+ return (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { role: "button", tabIndex: 0, "aria-label": "Upload skill package", onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, onKeyDown: (e) => { if (e.key === "Enter" || e.key === " ")
103
+ handleClick(); }, className: cn("flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-dashed p-12 transition-colors cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isDragOver
104
+ ? "border-primary bg-muted-subtle"
105
+ : "border-border hover:border-muted-foreground hover:bg-muted-subtle", isProcessing && "pointer-events-none opacity-60"), children: [_jsx(UploadIcon, { className: cn("size-10 text-muted-foreground", isDragOver && "text-primary") }), isProcessing ? (_jsx("p", { className: "text-sm font-medium text-foreground", children: "Processing..." })) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: "Drop your skill package here" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "or click to browse" })] })), _jsx("p", { className: "mt-2 text-[10px] text-muted-foreground-subtle", children: "Accepts .zip files following the Anthropic Agent Skills format" }), _jsx("input", { ref: inputRef, type: "file", accept: ".zip", onChange: handleFileChange, className: "hidden", "aria-hidden": "true" })] }), validationError && (_jsx("div", { className: "px-4 py-3", children: _jsx("p", { className: "text-sm text-destructive", role: "alert", children: validationError }) })), onCancel && (_jsx("div", { className: "flex justify-end border-t border-border px-4 py-3", children: _jsx("button", { type: "button", onClick: onCancel, className: cn("rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground", "hover:text-foreground hover:bg-muted", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "transition-colors"), children: "Cancel" }) }))] }));
106
+ }
107
+ // ---------------------------------------------------------------------------
108
+ // Phase 2: Preview + Confirm
109
+ // ---------------------------------------------------------------------------
110
+ function PreviewPhase({ preview, isPushing, pushError, onPush, onReset, onCancel, isDuplicate, isCheckingDuplicate, }) {
111
+ const strippedContent = stripFrontmatter(preview.skillMdContent);
112
+ return (_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { className: "border-b border-border px-4 py-3", children: _jsx("h3", { className: "text-sm font-medium text-foreground", children: "Skill Package Preview" }) }), _jsxs("div", { className: "flex flex-col gap-2 border-b border-border px-4 py-3", children: [_jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground w-20 shrink-0", children: "Name" }), _jsx("span", { className: "text-sm font-medium text-foreground font-mono", children: preview.name })] }), preview.description && (_jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground w-20 shrink-0", children: "Description" }), _jsx("span", { className: "text-sm text-foreground", children: preview.description })] }))] }), _jsxs("div", { className: "border-b border-border px-4 py-3", children: [_jsxs("div", { className: "mb-2 flex items-baseline justify-between", children: [_jsxs("span", { className: "text-xs font-medium text-muted-foreground", children: ["Files (", preview.files.filter((f) => !f.isDirectory).length, ")"] }), _jsxs("span", { className: "text-[10px] text-muted-foreground-subtle", children: [formatBytes(preview.totalSize), " total"] })] }), _jsx("div", { className: "rounded-md border border-border overflow-hidden", children: _jsx("table", { className: "w-full text-xs", children: _jsx("tbody", { children: preview.files
113
+ .filter((f) => !f.isDirectory)
114
+ .map((file) => (_jsxs("tr", { className: "border-b border-border last:border-b-0", children: [_jsx("td", { className: "px-3 py-1.5 font-mono text-foreground", children: file.path }), _jsx("td", { className: "px-3 py-1.5 text-right text-muted-foreground tabular-nums", children: formatBytes(file.size) })] }, file.path))) }) }) })] }), strippedContent && (_jsxs("div", { className: "border-b border-border px-4 py-3", children: [_jsx("span", { className: "mb-2 block text-xs font-medium text-muted-foreground", children: "SKILL.md Preview" }), _jsx("div", { className: "max-h-[240px] overflow-y-auto rounded-md border border-border p-3", children: _jsx(Markdown, { remarkPlugins: REMARK_PLUGINS, components: MARKDOWN_COMPONENTS, children: strippedContent }) })] })), isDuplicate && (_jsxs("div", { className: "flex items-start gap-2.5 border-b border-amber-500/20 bg-amber-500/5 px-4 py-3", role: "alert", children: [_jsx(WarningIcon, { className: "mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-sm font-medium text-amber-700 dark:text-amber-300", children: "No changes detected" }), _jsx("p", { className: "mt-0.5 text-xs text-amber-600 dark:text-amber-400", children: "This skill's content is identical to the current version. Pushing will create a new version record with the same content." })] })] })), isCheckingDuplicate && (_jsxs("div", { className: "flex items-center gap-2 border-b border-border px-4 py-2", children: [_jsx(Spinner, {}), _jsx("span", { className: "text-xs text-muted-foreground", children: "Checking for changes..." })] })), pushError && (_jsx("div", { className: "px-4 py-2", children: _jsx("p", { className: "text-sm text-destructive", role: "alert", children: pushError.message }) })), _jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [_jsx("button", { type: "button", onClick: onReset, className: cn("rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground", "hover:text-foreground hover:bg-muted", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "transition-colors"), children: "Choose Different File" }), _jsxs("div", { className: "flex items-center gap-2", children: [onCancel && (_jsx("button", { type: "button", onClick: onCancel, className: cn("rounded-md px-3 py-1.5 text-sm font-medium text-muted-foreground", "hover:text-foreground hover:bg-muted", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "transition-colors"), children: "Cancel" })), _jsx("button", { type: "button", onClick: onPush, disabled: isPushing, className: cn("rounded-md bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground", "hover:bg-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:opacity-50 disabled:cursor-not-allowed", "transition-colors"), children: isPushing ? "Pushing..." : isDuplicate ? "Push Anyway" : "Push Skill" })] })] })] }));
115
+ }
116
+ // ---------------------------------------------------------------------------
117
+ // Utilities
118
+ // ---------------------------------------------------------------------------
119
+ function normalizeToSlug(name) {
120
+ return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
121
+ }
122
+ function formatBytes(bytes) {
123
+ if (bytes < 1024)
124
+ return `${bytes} B`;
125
+ if (bytes < 1024 * 1024)
126
+ return `${(bytes / 1024).toFixed(1)} KB`;
127
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
128
+ }
129
+ // ---------------------------------------------------------------------------
130
+ // Icons
131
+ // ---------------------------------------------------------------------------
132
+ function WarningIcon({ className }) {
133
+ 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 1.5 1 14h14L8 1.5Z" }), _jsx("path", { d: "M8 6v3.5" }), _jsx("circle", { cx: "8", cy: "11.5", r: "0.5", fill: "currentColor", stroke: "none" })] }));
134
+ }
135
+ function Spinner() {
136
+ return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
137
+ }
138
+ function UploadIcon({ className }) {
139
+ return (_jsxs("svg", { className: className, 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", y1: "3", x2: "12", y2: "15" })] }));
140
+ }
141
+ //# sourceMappingURL=SkillUploader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkillUploader.js","sourceRoot":"","sources":["../../src/skill/SkillUploader.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAoBlE,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,GAAG,EACH,GAAG,EACH,UAAU,EACV,QAAQ,EACR,SAAS,GACU;IACnB,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IACzE,MAAM,QAAQ,GAAG,sBAAsB,EAAE,CAAC;IAE1C,MAAM,mBAAmB,GAAG,WAAW,CACrC,KAAK,EAAE,IAAU,EAAE,EAAE;QACnB,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QAC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AAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,GAAG,EAAC,aAAa,EAAC,OAAO,EAAC,SAAS,EAAC,cAAc,iBAAa,MAAM,YACjK,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAmC;IAChE,OAAO,CACL,eACE,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,aAElB,eAAM,CAAC,EAAC,2CAA2C,GAAG,EACtD,mBAAU,MAAM,EAAC,eAAe,GAAG,EACnC,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAG,IACnC,CACP,CAAC;AACJ,CAAC"}
package/skill/index.d.ts CHANGED
@@ -10,4 +10,22 @@ export { SkillPicker } from "./SkillPicker";
10
10
  export type { SkillPickerProps } from "./SkillPicker";
11
11
  export { SkillDetailView } from "./SkillDetailView";
12
12
  export type { SkillDetailViewProps } from "./SkillDetailView";
13
+ export { usePushSkill } from "./usePushSkill";
14
+ export type { PushSkillInput, UsePushSkillReturn } from "./usePushSkill";
15
+ export { useSkillUpload } from "./useSkillUpload";
16
+ export type { SkillUploadPreview, SkillFileEntry, UseSkillUploadReturn, } from "./useSkillUpload";
17
+ export { useSkillArtifact } from "./useSkillArtifact";
18
+ export type { UseSkillArtifactReturn } from "./useSkillArtifact";
19
+ export { SkillUploader } from "./SkillUploader";
20
+ export type { SkillUploaderProps } from "./SkillUploader";
21
+ export { SkillFileBrowser } from "./SkillFileBrowser";
22
+ export type { SkillFileBrowserProps } from "./SkillFileBrowser";
23
+ export { useSkillVersions } from "./useSkillVersions";
24
+ export type { UseSkillVersionsReturn } from "./useSkillVersions";
25
+ export { useSkillDiff } from "./useSkillDiff";
26
+ export type { UseSkillDiffReturn } from "./useSkillDiff";
27
+ export { SkillDiffDialog } from "./SkillDiffDialog";
28
+ export type { SkillDiffDialogProps, SkillDiffDialogState, } from "./SkillDiffDialog";
29
+ export { useSkillDuplicateCheck } from "./useSkillDuplicateCheck";
30
+ export type { UseSkillDuplicateCheckReturn } from "./useSkillDuplicateCheck";
13
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,mBAAmB,E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AAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC"}
package/skill/index.js CHANGED
@@ -4,4 +4,13 @@ export { useSkillSearch } from "./useSkillSearch";
4
4
  export { useSkill } from "./useSkill";
5
5
  export { SkillPicker } from "./SkillPicker";
6
6
  export { SkillDetailView } from "./SkillDetailView";
7
+ export { usePushSkill } from "./usePushSkill";
8
+ export { useSkillUpload } from "./useSkillUpload";
9
+ export { useSkillArtifact } from "./useSkillArtifact";
10
+ export { SkillUploader } from "./SkillUploader";
11
+ export { SkillFileBrowser } from "./SkillFileBrowser";
12
+ export { useSkillVersions } from "./useSkillVersions";
13
+ export { useSkillDiff } from "./useSkillDiff";
14
+ export { SkillDiffDialog } from "./SkillDiffDialog";
15
+ export { useSkillDuplicateCheck } from "./useSkillDuplicateCheck";
7
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skill/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Computes a SHA-256 hex digest of the given bytes using Web Crypto.
3
+ *
4
+ * Returns the same 64-character lowercase hex string that the backend
5
+ * produces for `SkillStatus.versionHash`, enabling client-side
6
+ * duplicate detection before pushing.
7
+ */
8
+ export declare function computeArtifactHash(bytes: Uint8Array): Promise<string>;
9
+ //# sourceMappingURL=computeArtifactHash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeArtifactHash.d.ts","sourceRoot":"","sources":["../../../src/skill/internal/computeArtifactHash.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAK5E"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Computes a SHA-256 hex digest of the given bytes using Web Crypto.
3
+ *
4
+ * Returns the same 64-character lowercase hex string that the backend
5
+ * produces for `SkillStatus.versionHash`, enabling client-side
6
+ * duplicate detection before pushing.
7
+ */
8
+ export async function computeArtifactHash(bytes) {
9
+ const digest = await crypto.subtle.digest("SHA-256", bytes);
10
+ return Array.from(new Uint8Array(digest))
11
+ .map((b) => b.toString(16).padStart(2, "0"))
12
+ .join("");
13
+ }
14
+ //# sourceMappingURL=computeArtifactHash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeArtifactHash.js","sourceRoot":"","sources":["../../../src/skill/internal/computeArtifactHash.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAAiB;IACzD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,KAA+B,CAAC,CAAC;IACtF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Stigmer } from "@stigmer/sdk";
2
+ import type { SkillFileEntry } from "../useSkillUpload";
3
+ /** Unpacked artifact: file entries for browsing + content map for reading. */
4
+ export interface UnpackedArtifact {
5
+ readonly files: SkillFileEntry[];
6
+ readonly contentMap: ReadonlyMap<string, string>;
7
+ }
8
+ /**
9
+ * Fetch a skill artifact by storage key, unzip it, and return the file listing
10
+ * with a content map. Shared by `useSkillArtifact` (single-version browser)
11
+ * and `useSkillDiff` (two-version comparison).
12
+ *
13
+ * Throws on network or decompression errors — callers handle error state.
14
+ */
15
+ export declare function fetchAndUnpackArtifact(stigmer: Stigmer, artifactStorageKey: string): Promise<UnpackedArtifact>;
16
+ //# sourceMappingURL=fetchAndUnpackArtifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAndUnpackArtifact.d.ts","sourceRoot":"","sources":["../../../src/skill/internal/fetchAndUnpackArtifact.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClD;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,gBAAgB,CAAC,CA0B3B"}
@@ -0,0 +1,34 @@
1
+ import { create } from "@bufbuild/protobuf";
2
+ import { GetArtifactRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
3
+ /**
4
+ * Fetch a skill artifact by storage key, unzip it, and return the file listing
5
+ * with a content map. Shared by `useSkillArtifact` (single-version browser)
6
+ * and `useSkillDiff` (two-version comparison).
7
+ *
8
+ * Throws on network or decompression errors — callers handle error state.
9
+ */
10
+ export async function fetchAndUnpackArtifact(stigmer, artifactStorageKey) {
11
+ const request = create(GetArtifactRequestSchema, { artifactStorageKey });
12
+ const response = await stigmer.skill.getArtifact(request);
13
+ const { unzipSync, strFromU8 } = await import("fflate");
14
+ const unzipped = unzipSync(response.artifact);
15
+ const entries = Object.entries(unzipped);
16
+ const files = entries.map(([path, data]) => ({
17
+ path,
18
+ size: data.length,
19
+ isDirectory: data.length === 0 && path.endsWith("/"),
20
+ }));
21
+ const contentMap = new Map();
22
+ for (const [path, data] of entries) {
23
+ if (!path.endsWith("/") && data.length > 0) {
24
+ try {
25
+ contentMap.set(path, strFromU8(data));
26
+ }
27
+ catch {
28
+ contentMap.set(path, "[Binary content]");
29
+ }
30
+ }
31
+ }
32
+ return { files, contentMap };
33
+ }
34
+ //# sourceMappingURL=fetchAndUnpackArtifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAndUnpackArtifact.js","sourceRoot":"","sources":["../../../src/skill/internal/fetchAndUnpackArtifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAU7F;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAgB,EAChB,kBAA0B;IAE1B,MAAM,OAAO,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAE1D,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE9C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,KAAK,GAAqB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7D,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,MAAM;QACjB,WAAW,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;KACrD,CAAC,CAAC,CAAC;IAEJ,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC7C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC;gBACH,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,53 @@
1
+ import type { Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
2
+ /** Input for pushing a skill artifact (ZIP package). */
3
+ export interface PushSkillInput {
4
+ /** Organization that will own the skill. */
5
+ readonly org: string;
6
+ /** Raw ZIP bytes of the skill package (must contain SKILL.md at root). */
7
+ readonly artifact: Uint8Array;
8
+ /** Optional version tag (e.g. "stable", "v1.0"). */
9
+ readonly tag?: string;
10
+ }
11
+ /** Return value of {@link usePushSkill}. */
12
+ export interface UsePushSkillReturn {
13
+ /**
14
+ * Push a skill artifact ZIP to the server.
15
+ *
16
+ * The caller is responsible for providing a valid ZIP containing
17
+ * a SKILL.md with proper YAML frontmatter. Use {@link useSkillUpload}
18
+ * to validate the ZIP before pushing.
19
+ *
20
+ * Resolves with the server-persisted `Skill` resource including
21
+ * populated metadata (id, slug, version hash).
22
+ */
23
+ readonly push: (input: PushSkillInput) => Promise<Skill>;
24
+ /** `true` while the push request is in flight. */
25
+ readonly isPushing: boolean;
26
+ /** Error from the last failed push, or `null` when healthy. */
27
+ readonly error: Error | null;
28
+ /** Reset `error` to `null`. */
29
+ readonly clearError: () => void;
30
+ }
31
+ /**
32
+ * Mutation hook that pushes a skill artifact ZIP to the server.
33
+ *
34
+ * Accepts raw ZIP bytes and calls `stigmer.skill.push()` directly.
35
+ * The ZIP must contain a valid SKILL.md with YAML frontmatter — use
36
+ * {@link useSkillUpload} to validate before pushing.
37
+ *
38
+ * Follows the established SDK mutation hook pattern: `isPushing` flag,
39
+ * `error` state, `clearError` reset, result returned from the promise.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * const { push, isPushing, error } = usePushSkill();
44
+ * const upload = useSkillUpload();
45
+ *
46
+ * // After upload.processFile(file) succeeds:
47
+ * if (upload.artifact) {
48
+ * const skill = await push({ org: "acme", artifact: upload.artifact });
49
+ * }
50
+ * ```
51
+ */
52
+ export declare function usePushSkill(): UsePushSkillReturn;
53
+ //# sourceMappingURL=usePushSkill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePushSkill.d.ts","sourceRoot":"","sources":["../../src/skill/usePushSkill.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAShF,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,oDAAoD;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IACzD,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,IAAI,kBAAkB,CA+BjD"}
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { useCallback, useState } from "react";
3
+ import { create } from "@bufbuild/protobuf";
4
+ import { PushSkillRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/io_pb";
5
+ import { useStigmer } from "../hooks";
6
+ import { toError } from "../internal/toError";
7
+ // ---------------------------------------------------------------------------
8
+ // Hook implementation
9
+ // ---------------------------------------------------------------------------
10
+ /**
11
+ * Mutation hook that pushes a skill artifact ZIP to the server.
12
+ *
13
+ * Accepts raw ZIP bytes and calls `stigmer.skill.push()` directly.
14
+ * The ZIP must contain a valid SKILL.md with YAML frontmatter — use
15
+ * {@link useSkillUpload} to validate before pushing.
16
+ *
17
+ * Follows the established SDK mutation hook pattern: `isPushing` flag,
18
+ * `error` state, `clearError` reset, result returned from the promise.
19
+ *
20
+ * @example
21
+ * ```tsx
22
+ * const { push, isPushing, error } = usePushSkill();
23
+ * const upload = useSkillUpload();
24
+ *
25
+ * // After upload.processFile(file) succeeds:
26
+ * if (upload.artifact) {
27
+ * const skill = await push({ org: "acme", artifact: upload.artifact });
28
+ * }
29
+ * ```
30
+ */
31
+ export function usePushSkill() {
32
+ const stigmer = useStigmer();
33
+ const [isPushing, setIsPushing] = useState(false);
34
+ const [error, setError] = useState(null);
35
+ const clearError = useCallback(() => setError(null), []);
36
+ const push = useCallback(async (input) => {
37
+ setIsPushing(true);
38
+ setError(null);
39
+ try {
40
+ const request = create(PushSkillRequestSchema, {
41
+ org: input.org,
42
+ artifact: input.artifact,
43
+ tag: input.tag ?? "",
44
+ });
45
+ return await stigmer.skill.push(request);
46
+ }
47
+ catch (err) {
48
+ setError(toError(err));
49
+ throw err;
50
+ }
51
+ finally {
52
+ setIsPushing(false);
53
+ }
54
+ }, [stigmer]);
55
+ return { push, isPushing, error, clearError };
56
+ }
57
+ //# sourceMappingURL=usePushSkill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePushSkill.js","sourceRoot":"","sources":["../../src/skill/usePushSkill.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAqC9C,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,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,IAAI,GAAG,WAAW,CACtB,KAAK,EAAE,KAAqB,EAAkB,EAAE;QAC9C,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,CAAC,sBAAsB,EAAE;gBAC7C,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,EAAE;aACrB,CAAC,CAAC;YAEH,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,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,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { SkillFileEntry } from "./useSkillUpload";
2
+ /** Return value of {@link useSkillArtifact}. */
3
+ export interface UseSkillArtifactReturn {
4
+ /** File entries in the skill package, or `null` while loading/on error. */
5
+ readonly files: SkillFileEntry[] | null;
6
+ /** `true` while the artifact is being fetched and unpacked. */
7
+ readonly isLoading: boolean;
8
+ /** Error from the fetch/unpack, or `null` when healthy. */
9
+ readonly error: Error | null;
10
+ /** Get the text content of a file by path, or `null` if not available. */
11
+ readonly getFileContent: (path: string) => string | null;
12
+ /** Re-fetch the artifact from the server. */
13
+ readonly refetch: () => void;
14
+ }
15
+ /**
16
+ * Data hook that fetches and unpacks a skill's ZIP artifact for browsing.
17
+ *
18
+ * Uses `stigmer.skill.getArtifact()` with the skill's storage key,
19
+ * then decompresses the ZIP using `fflate` to expose a file listing
20
+ * and content retrieval.
21
+ *
22
+ * Pass `null` for `artifactStorageKey` to skip fetching (stable no-op).
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const { skill } = useSkill(org, slug);
27
+ * const { files, getFileContent, isLoading } = useSkillArtifact(
28
+ * skill?.status?.artifactStorageKey ?? null
29
+ * );
30
+ *
31
+ * if (files) {
32
+ * const readme = getFileContent("SKILL.md");
33
+ * }
34
+ * ```
35
+ */
36
+ export declare function useSkillArtifact(artifactStorageKey: string | null): UseSkillArtifactReturn;
37
+ //# sourceMappingURL=useSkillArtifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkillArtifact.d.ts","sourceRoot":"","sources":["../../src/skill/useSkillArtifact.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOvD,gDAAgD;AAChD,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACxC,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACzD,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAChC,sBAAsB,CAqDxB"}
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import { useStigmer } from "../hooks";
4
+ import { toError } from "../internal/toError";
5
+ import { fetchAndUnpackArtifact } from "./internal/fetchAndUnpackArtifact";
6
+ // ---------------------------------------------------------------------------
7
+ // Hook implementation
8
+ // ---------------------------------------------------------------------------
9
+ /**
10
+ * Data hook that fetches and unpacks a skill's ZIP artifact for browsing.
11
+ *
12
+ * Uses `stigmer.skill.getArtifact()` with the skill's storage key,
13
+ * then decompresses the ZIP using `fflate` to expose a file listing
14
+ * and content retrieval.
15
+ *
16
+ * Pass `null` for `artifactStorageKey` to skip fetching (stable no-op).
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const { skill } = useSkill(org, slug);
21
+ * const { files, getFileContent, isLoading } = useSkillArtifact(
22
+ * skill?.status?.artifactStorageKey ?? null
23
+ * );
24
+ *
25
+ * if (files) {
26
+ * const readme = getFileContent("SKILL.md");
27
+ * }
28
+ * ```
29
+ */
30
+ export function useSkillArtifact(artifactStorageKey) {
31
+ const stigmer = useStigmer();
32
+ const [files, setFiles] = useState(null);
33
+ const [isLoading, setIsLoading] = useState(false);
34
+ const [error, setError] = useState(null);
35
+ const contentMapRef = useRef(new Map());
36
+ const fetchIdRef = useRef(0);
37
+ const doFetch = useCallback(async () => {
38
+ if (!artifactStorageKey) {
39
+ setFiles(null);
40
+ setError(null);
41
+ return;
42
+ }
43
+ const fetchId = ++fetchIdRef.current;
44
+ setIsLoading(true);
45
+ setError(null);
46
+ try {
47
+ const result = await fetchAndUnpackArtifact(stigmer, artifactStorageKey);
48
+ if (fetchIdRef.current !== fetchId)
49
+ return;
50
+ contentMapRef.current = new Map(result.contentMap);
51
+ setFiles(result.files);
52
+ }
53
+ catch (err) {
54
+ if (fetchIdRef.current !== fetchId)
55
+ return;
56
+ setError(toError(err));
57
+ setFiles(null);
58
+ }
59
+ finally {
60
+ if (fetchIdRef.current === fetchId) {
61
+ setIsLoading(false);
62
+ }
63
+ }
64
+ }, [artifactStorageKey, stigmer]);
65
+ useEffect(() => {
66
+ doFetch();
67
+ }, [doFetch]);
68
+ const getFileContent = useCallback((path) => {
69
+ return contentMapRef.current.get(path) ?? null;
70
+ }, []);
71
+ const refetch = useCallback(() => {
72
+ doFetch();
73
+ }, [doFetch]);
74
+ return useMemo(() => ({ files, isLoading, error, getFileContent, refetch }), [files, isLoading, error, getFileContent, refetch]);
75
+ }
76
+ //# sourceMappingURL=useSkillArtifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkillArtifact.js","sourceRoot":"","sources":["../../src/skill/useSkillArtifact.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EA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IAAI,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACnD,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO;gBAAE,OAAO;YAC3C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;gBAAS,CAAC;YACT,IAAI,UAAU,CAAC,OAAO,KAAK,OAAO,EAAE,CAAC;gBACnC,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC;IAElC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,IAAY,EAAiB,EAAE;QACjE,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,EAC5D,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,CACnD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { MultiFileDiffResult } from "../version-history/types";
2
+ /** Return value of {@link useSkillDiff}. */
3
+ export interface UseSkillDiffReturn {
4
+ /** Multi-file diff result, or `null` while loading / on error / when disabled. */
5
+ readonly diff: MultiFileDiffResult | null;
6
+ /** `true` while both artifacts are being fetched, unpacked, and diffed. */
7
+ readonly isLoading: boolean;
8
+ /** Error from the fetch/unpack/diff, or `null` when healthy. */
9
+ readonly error: Error | null;
10
+ }
11
+ /**
12
+ * Data hook that fetches two skill version artifacts and computes a
13
+ * multi-file diff between them.
14
+ *
15
+ * Takes two artifact storage keys (obtained from `useSkillVersions.getArtifactKey()`).
16
+ * Fetches both ZIPs in parallel, unpacks them, and runs `computeMultiFileDiff`
17
+ * on the extracted text file maps.
18
+ *
19
+ * Pass `null` for either key to disable fetching (stable no-op).
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const { getArtifactKey } = useSkillVersions(org, slug);
24
+ * const { diff, isLoading } = useSkillDiff(
25
+ * getArtifactKey(fromHash),
26
+ * getArtifactKey(toHash),
27
+ * );
28
+ * ```
29
+ */
30
+ export declare function useSkillDiff(fromArtifactKey: string | null, toArtifactKey: string | null): UseSkillDiffReturn;
31
+ //# sourceMappingURL=useSkillDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSkillDiff.d.ts","sourceRoot":"","sources":["../../src/skill/useSkillDiff.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAMpE,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC1C,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,kBAAkB,CAyDpB"}