@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,16 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ /**
5
+ * Summary bar showing aggregate diff statistics.
6
+ *
7
+ * Renders "N files changed, +X additions, -Y deletions" in a compact
8
+ * single-line format. Uses diff-specific design tokens for coloring.
9
+ *
10
+ * Zero Console dependencies — safe for platform builder embedding.
11
+ */
12
+ export function DiffSummary({ fileCount, additions, deletions, className, }) {
13
+ const fileLabel = fileCount === 1 ? "1 file changed" : `${fileCount} files changed`;
14
+ return (_jsxs("div", { role: "status", "aria-live": "polite", className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [_jsx("span", { children: fileLabel }), additions > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u00B7" }), _jsxs("span", { className: "font-mono text-diff-added-fg", children: ["+", additions, " ", additions === 1 ? "addition" : "additions"] })] })), deletions > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u00B7" }), _jsxs("span", { className: "font-mono text-diff-removed-fg", children: ["-", deletions, " ", deletions === 1 ? "deletion" : "deletions"] })] }))] }));
15
+ }
16
+ //# sourceMappingURL=DiffSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffSummary.js","sourceRoot":"","sources":["../../src/version-history/DiffSummary.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAcpC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,GACQ;IACjB,MAAM,SAAS,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,gBAAgB,CAAC;IAEpF,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,eACH,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,uDAAuD,EACvD,SAAS,CACV,aAED,yBAAO,SAAS,GAAQ,EACvB,SAAS,GAAG,CAAC,IAAI,CAChB,8BACE,8BAAkB,MAAM,uBAAgB,EACxC,gBAAM,SAAS,EAAC,8BAA8B,kBAC1C,SAAS,OAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,IACnD,IACN,CACJ,EACA,SAAS,GAAG,CAAC,IAAI,CAChB,8BACE,8BAAkB,MAAM,uBAAgB,EACxC,gBAAM,SAAS,EAAC,gCAAgC,kBAC5C,SAAS,OAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,IACnD,IACN,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { DiffHunk } from "./types";
2
+ /** Props for {@link DiffViewer}. */
3
+ export interface DiffViewerProps {
4
+ /** Hunks to render — output of `computeDiff()`. */
5
+ readonly hunks: readonly DiffHunk[];
6
+ /** File path displayed in the header. */
7
+ readonly filePath?: string;
8
+ /** Additional CSS classes for the root container. */
9
+ readonly className?: string;
10
+ }
11
+ /**
12
+ * Generic unified diff renderer for a single file.
13
+ *
14
+ * Renders a unified diff with line numbers, `+`/`-` prefix indicators,
15
+ * and hunk separator headers. Uses `--stgm-diff-*` design tokens for
16
+ * all colors — respects light/dark mode and preset overrides.
17
+ *
18
+ * Accessibility: uses a `<table>` with proper column headers, `+`/`-`
19
+ * text indicators alongside color (color is never the sole channel),
20
+ * and ARIA labels on change lines for screen readers.
21
+ *
22
+ * Zero Console dependencies — safe for platform builder embedding.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * const hunks = computeDiff(oldText, newText);
27
+ * <DiffViewer hunks={hunks} filePath="SKILL.md" />
28
+ * ```
29
+ */
30
+ export declare function DiffViewer({ hunks, filePath, className }: DiffViewerProps): import("react/jsx-runtime").JSX.Element;
31
+ //# sourceMappingURL=DiffViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffViewer.d.ts","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAElD,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA6CzE"}
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ /**
5
+ * Generic unified diff renderer for a single file.
6
+ *
7
+ * Renders a unified diff with line numbers, `+`/`-` prefix indicators,
8
+ * and hunk separator headers. Uses `--stgm-diff-*` design tokens for
9
+ * all colors — respects light/dark mode and preset overrides.
10
+ *
11
+ * Accessibility: uses a `<table>` with proper column headers, `+`/`-`
12
+ * text indicators alongside color (color is never the sole channel),
13
+ * and ARIA labels on change lines for screen readers.
14
+ *
15
+ * Zero Console dependencies — safe for platform builder embedding.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const hunks = computeDiff(oldText, newText);
20
+ * <DiffViewer hunks={hunks} filePath="SKILL.md" />
21
+ * ```
22
+ */
23
+ export function DiffViewer({ hunks, filePath, className }) {
24
+ if (hunks.length === 0) {
25
+ return (_jsx("div", { role: "status", className: cn("flex items-center justify-center py-8 text-sm text-muted-foreground", className), children: "No changes" }));
26
+ }
27
+ return (_jsxs("div", { className: cn("overflow-auto rounded-lg border border-border font-mono text-[13px] leading-[1.6]", className), children: [filePath && (_jsx("div", { className: "sticky top-0 z-10 border-b border-border bg-muted px-3 py-1.5 text-xs font-medium text-muted-foreground", children: filePath })), _jsxs("table", { className: "w-full border-collapse", role: "table", children: [_jsx("thead", { className: "sr-only", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "Old line" }), _jsx("th", { scope: "col", children: "New line" }), _jsx("th", { scope: "col", children: "Change" }), _jsx("th", { scope: "col", children: "Content" })] }) }), _jsx("tbody", { children: hunks.map((hunk, hunkIdx) => (_jsx(HunkRows, { hunk: hunk, isFirst: hunkIdx === 0 }, hunkIdx))) })] })] }));
28
+ }
29
+ // ---------------------------------------------------------------------------
30
+ // Hunk rendering
31
+ // ---------------------------------------------------------------------------
32
+ function HunkRows({ hunk, isFirst, }) {
33
+ const header = `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`;
34
+ return (_jsxs(_Fragment, { children: [!isFirst && (_jsx("tr", { children: _jsx("td", { colSpan: 4, className: "select-none bg-diff-hunk-header-bg px-3 py-1 text-[11px] text-diff-hunk-header-fg", "aria-label": `Hunk: ${header}`, children: header }) })), hunk.lines.map((line, lineIdx) => (_jsx(DiffLineRow, { line: line }, lineIdx)))] }));
35
+ }
36
+ // ---------------------------------------------------------------------------
37
+ // Line rendering
38
+ // ---------------------------------------------------------------------------
39
+ const LINE_NUM_CLASSES = "w-[1px] min-w-10 select-none whitespace-nowrap px-2 text-right text-[11px] text-muted-foreground-faint";
40
+ const MARKER_CLASSES = "w-[1px] select-none px-1 text-center";
41
+ function DiffLineRow({ line }) {
42
+ const marker = line.type === "added" ? "+" : line.type === "removed" ? "-" : " ";
43
+ const rowClass = line.type === "added"
44
+ ? "bg-diff-added-bg"
45
+ : line.type === "removed"
46
+ ? "bg-diff-removed-bg"
47
+ : "";
48
+ const markerColor = line.type === "added"
49
+ ? "text-diff-added-fg"
50
+ : line.type === "removed"
51
+ ? "text-diff-removed-fg"
52
+ : "text-muted-foreground-faint";
53
+ const ariaLabel = line.type === "added"
54
+ ? `Added line ${line.newLineNumber}: ${line.content}`
55
+ : line.type === "removed"
56
+ ? `Removed line ${line.oldLineNumber}: ${line.content}`
57
+ : undefined;
58
+ return (_jsxs("tr", { className: rowClass, "aria-label": ariaLabel, children: [_jsx("td", { className: LINE_NUM_CLASSES, children: line.oldLineNumber ?? "" }), _jsx("td", { className: LINE_NUM_CLASSES, children: line.newLineNumber ?? "" }), _jsx("td", { className: cn(MARKER_CLASSES, markerColor), "aria-hidden": "true", children: marker }), _jsx("td", { className: "whitespace-pre-wrap break-all px-2", children: line.content })] }));
59
+ }
60
+ //# sourceMappingURL=DiffViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiffViewer.js","sourceRoot":"","sources":["../../src/version-history/DiffViewer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAapC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAmB;IACxE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CACL,cACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,CACV,2BAGG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,mFAAmF,EACnF,SAAS,CACV,aAEA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oC,YAC/C,IAAI,CAAC,OAAO,GACV,IACF,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { MultiFileDiffResult } from "./types";
2
+ /** Props for {@link MultiFileDiffView}. */
3
+ export interface MultiFileDiffViewProps {
4
+ /** Multi-file diff result from `computeMultiFileDiff()`. */
5
+ readonly diff: MultiFileDiffResult;
6
+ /**
7
+ * Initially selected file path. When omitted, defaults to the first
8
+ * changed file (SKILL.md if present, per the sort order).
9
+ */
10
+ readonly initialSelectedPath?: string;
11
+ /** Additional CSS classes for the root container. */
12
+ readonly className?: string;
13
+ }
14
+ /**
15
+ * Composed multi-file diff view with file list and per-file unified diff.
16
+ *
17
+ * Layout: summary bar at top, file list as a horizontal scrollable bar,
18
+ * and the full unified diff for the selected file below. Designed to
19
+ * work within a dialog or a detail page panel.
20
+ *
21
+ * Zero Console dependencies — safe for platform builder embedding.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * const diff = computeMultiFileDiff(oldFiles, newFiles);
26
+ * <MultiFileDiffView diff={diff} />
27
+ * ```
28
+ */
29
+ export declare function MultiFileDiffView({ diff, initialSelectedPath, className, }: MultiFileDiffViewProps): import("react/jsx-runtime").JSX.Element;
30
+ //# sourceMappingURL=MultiFileDiffView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiFileDiffView.d.ts","sourceRoot":"","sources":["../../src/version-history/MultiFileDiffView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAKnD,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,mBAAmB,EACnB,SAAS,GACV,EAAE,sBAAsB,2CAkDxB"}
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { DiffViewer } from "./DiffViewer";
6
+ import { DiffFileList } from "./DiffFileList";
7
+ import { DiffSummary } from "./DiffSummary";
8
+ /**
9
+ * Composed multi-file diff view with file list and per-file unified diff.
10
+ *
11
+ * Layout: summary bar at top, file list as a horizontal scrollable bar,
12
+ * and the full unified diff for the selected file below. Designed to
13
+ * work within a dialog or a detail page panel.
14
+ *
15
+ * Zero Console dependencies — safe for platform builder embedding.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * const diff = computeMultiFileDiff(oldFiles, newFiles);
20
+ * <MultiFileDiffView diff={diff} />
21
+ * ```
22
+ */
23
+ export function MultiFileDiffView({ diff, initialSelectedPath, className, }) {
24
+ const [selectedPath, setSelectedPath] = useState(initialSelectedPath ?? diff.files[0]?.path ?? null);
25
+ const handleSelect = useCallback((path) => {
26
+ setSelectedPath(path);
27
+ }, []);
28
+ const hunks = selectedPath ? diff.getDiff(selectedPath) : [];
29
+ if (diff.files.length === 0) {
30
+ return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center gap-2 py-12 text-center", className), children: [_jsx(NoDiffIcon, { className: "size-8 text-muted-foreground-faint" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "No differences found" }), _jsx("p", { className: "text-xs text-muted-foreground-subtle", children: "These two versions have identical content." })] }));
31
+ }
32
+ return (_jsxs("div", { className: cn("flex flex-col gap-3", className), children: [_jsx(DiffSummary, { fileCount: diff.files.length, additions: diff.totalAdditions, deletions: diff.totalDeletions }), diff.files.length > 1 && (_jsx("div", { className: "overflow-hidden rounded-lg border border-border", children: _jsx(DiffFileList, { files: diff.files, selectedPath: selectedPath, onSelect: handleSelect }) })), _jsx(DiffViewer, { hunks: hunks, filePath: selectedPath ?? undefined })] }));
33
+ }
34
+ // ---------------------------------------------------------------------------
35
+ // Icons
36
+ // ---------------------------------------------------------------------------
37
+ function NoDiffIcon({ className }) {
38
+ 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 3v10M3 8h10" }), _jsx("circle", { cx: "8", cy: "8", r: "7" })] }));
39
+ }
40
+ //# sourceMappingURL=MultiFileDiffView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiFileDiffView.js","sourceRoot":"","sources":["../../src/version-history/MultiFileDiffView.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAe5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,mBAAmB,EACnB,SAAS,GACc;IACvB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,mBAAmB,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,IAAI,CACnD,CAAC;IAEF,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAChD,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,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EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,IAC1B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { VersionTimelineProps } from "./types";
2
+ /**
3
+ * Accessible vertical timeline for version history.
4
+ *
5
+ * Renders a chronologically-ordered list of version entries with a
6
+ * connecting line, selection state, and optional compare mode. Designed
7
+ * as a generic SDK primitive usable for any versioned resource (skills,
8
+ * and in future, agents, MCP servers).
9
+ *
10
+ * Supports two interaction modes:
11
+ * - **Select mode** (default): single-click selects an entry, fires `onEntrySelect`
12
+ * - **Compare mode** (when `onCompare` is provided): selecting two entries fires
13
+ * `onCompare(fromId, toId)` — designed for T05-D diff viewer integration
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 { versions } = useSkillVersions(org, slug);
21
+ *
22
+ * <VersionTimeline
23
+ * entries={versions}
24
+ * onEntrySelect={(id) => console.log("Selected:", id)}
25
+ * />
26
+ * ```
27
+ */
28
+ export declare function VersionTimeline({ entries, onEntrySelect, onCompare, selectedId, isLoading, emptyMessage, className, }: VersionTimelineProps): import("react/jsx-runtime").JSX.Element;
29
+ //# sourceMappingURL=VersionTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionTimeline.d.ts","sourceRoot":"","sources":["../../src/version-history/VersionTimeline.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,aAAa,EACb,SAAS,EACT,UAAU,EACV,SAAS,EACT,YAA6C,EAC7C,SAAS,GACV,EAAE,oBAAoB,2CA4DtB"}
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useState } from "react";
4
+ import { cn } from "@stigmer/theme";
5
+ import { VersionTimelineEntry } from "./VersionTimelineEntry";
6
+ /**
7
+ * Accessible vertical timeline for version history.
8
+ *
9
+ * Renders a chronologically-ordered list of version entries with a
10
+ * connecting line, selection state, and optional compare mode. Designed
11
+ * as a generic SDK primitive usable for any versioned resource (skills,
12
+ * and in future, agents, MCP servers).
13
+ *
14
+ * Supports two interaction modes:
15
+ * - **Select mode** (default): single-click selects an entry, fires `onEntrySelect`
16
+ * - **Compare mode** (when `onCompare` is provided): selecting two entries fires
17
+ * `onCompare(fromId, toId)` — designed for T05-D diff viewer integration
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 { versions } = useSkillVersions(org, slug);
25
+ *
26
+ * <VersionTimeline
27
+ * entries={versions}
28
+ * onEntrySelect={(id) => console.log("Selected:", id)}
29
+ * />
30
+ * ```
31
+ */
32
+ export function VersionTimeline({ entries, onEntrySelect, onCompare, selectedId, isLoading, emptyMessage = "No version history available", className, }) {
33
+ const [compareSelection, setCompareSelection] = useState(null);
34
+ const handleSelect = useCallback((id) => {
35
+ if (onCompare) {
36
+ if (compareSelection === null) {
37
+ setCompareSelection(id);
38
+ }
39
+ else if (compareSelection === id) {
40
+ setCompareSelection(null);
41
+ }
42
+ else {
43
+ onCompare(compareSelection, id);
44
+ setCompareSelection(null);
45
+ }
46
+ }
47
+ onEntrySelect?.(id);
48
+ }, [onCompare, onEntrySelect, compareSelection]);
49
+ const cancelCompare = useCallback(() => {
50
+ setCompareSelection(null);
51
+ }, []);
52
+ if (isLoading) {
53
+ return _jsx(TimelineSkeleton, { className: className });
54
+ }
55
+ if (entries.length === 0) {
56
+ return _jsx(EmptyState, { message: emptyMessage, className: className });
57
+ }
58
+ const compareLabel = compareSelection
59
+ ? entries.find((e) => e.id === compareSelection)?.label ?? compareSelection.slice(0, 12)
60
+ : null;
61
+ return (_jsxs("div", { className: cn("flex flex-col pt-2", className), children: [compareSelection && (_jsx(CompareInfoBar, { selectedLabel: compareLabel, onCancel: cancelCompare })), _jsx("div", { role: "list", "aria-label": "Version history", children: entries.map((entry, index) => (_jsx(VersionTimelineEntry, { entry: entry, isSelected: entry.id === selectedId, isCompareSource: entry.id === compareSelection, isLast: index === entries.length - 1, onSelect: () => handleSelect(entry.id) }, entry.id))) })] }));
62
+ }
63
+ // ---------------------------------------------------------------------------
64
+ // Compare-mode info bar
65
+ // ---------------------------------------------------------------------------
66
+ function CompareInfoBar({ selectedLabel, onCancel, }) {
67
+ return (_jsxs("div", { role: "status", "aria-live": "polite", className: "mb-3 flex items-center gap-2 rounded-md border border-dashed border-primary bg-primary-subtle px-3 py-2 text-xs", children: [_jsx(CompareIcon, { className: "size-3.5 shrink-0 text-primary" }), _jsxs("span", { className: "flex-1 text-foreground", children: ["Select another version to compare with", " ", _jsx("code", { className: "rounded bg-muted px-1 py-0.5 font-mono text-[10px] font-medium", children: selectedLabel })] }), _jsx("button", { type: "button", onClick: onCancel, className: cn("rounded px-2 py-0.5 text-[10px] font-medium text-muted-foreground transition-colors", "hover:bg-accent-hover hover:text-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Cancel" })] }));
68
+ }
69
+ function CompareIcon({ className }) {
70
+ 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: "M5 12V4M5 4l-3 3M11 4v8M11 12l3-3" }) }));
71
+ }
72
+ // ---------------------------------------------------------------------------
73
+ // Non-happy states
74
+ // ---------------------------------------------------------------------------
75
+ function TimelineSkeleton({ className }) {
76
+ return (_jsx("div", { className: cn("flex flex-col gap-4 pt-2", className), "aria-busy": "true", "aria-label": "Loading version history", children: [1, 2, 3].map((i) => (_jsxs("div", { className: "flex gap-3", children: [_jsxs("div", { className: "flex flex-col items-center", children: [_jsx("div", { className: "size-2.5 animate-pulse rounded-full bg-muted" }), i < 3 && _jsx("div", { className: "mt-1 w-px flex-1 bg-border" })] }), _jsxs("div", { className: "mb-4 flex-1 space-y-2 px-2.5 py-2", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" }), _jsx("div", { className: "h-4 w-12 animate-pulse rounded-full bg-muted" })] }), _jsx("div", { className: "h-3 w-32 animate-pulse rounded bg-muted" })] })] }, i))) }));
77
+ }
78
+ function EmptyState({ message, className, }) {
79
+ return (_jsxs("div", { role: "status", className: cn("flex flex-col items-center gap-2 py-8 text-center", className), children: [_jsx(HistoryIcon, { className: "size-8 text-muted-foreground-faint" }), _jsx("p", { className: "text-sm text-muted-foreground", children: message })] }));
80
+ }
81
+ // ---------------------------------------------------------------------------
82
+ // Icons
83
+ // ---------------------------------------------------------------------------
84
+ function HistoryIcon({ className }) {
85
+ 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 4v4l2.5 1.5" }), _jsx("circle", { cx: "8", cy: "8", r: "6" }), _jsx("path", { d: "M2 8a6 6 0 0 1 6-6" })] }));
86
+ }
87
+ //# sourceMappingURL=VersionTimeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionTimeline.js","sourceRoot":"","sources":["../../src/version-history/VersionTimeline.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,eAAe,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AAS,EAAC,+BAA+B,YAAE,OAAO,GAAK,IACtD,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,SAAS,WAAW,CAAC,EAAE,SAAS,EAAmC;IACjE,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,gBAAgB,GAAG,EAC3B,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,EAC9B,eAAM,CAAC,EAAC,oBAAoB,GAAG,IAC3B,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { VersionTimelineEntryProps } from "./types";
2
+ /**
3
+ * A single row in a version timeline.
4
+ *
5
+ * Renders a version entry with: truncated hash badge, relative timestamp,
6
+ * actor info, tag badge, "current" indicator, and git provenance link.
7
+ * Supports keyboard activation and focus management.
8
+ *
9
+ * All visual properties flow through `--stgm-*` design tokens.
10
+ * Zero Console dependencies — safe for platform builder embedding.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <VersionTimelineEntry
15
+ * entry={version}
16
+ * isSelected={selectedId === version.id}
17
+ * onSelect={() => setSelectedId(version.id)}
18
+ * />
19
+ * ```
20
+ */
21
+ export declare function VersionTimelineEntry({ entry, isSelected, isCompareSource, isLast, onSelect, trailing, }: VersionTimelineEntryProps): import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=VersionTimelineEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionTimelineEntry.d.ts","sourceRoot":"","sources":["../../src/version-history/VersionTimelineEntry.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,UAAU,EACV,eAAe,EACf,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE,yBAAyB,2CA2H3B"}
@@ -0,0 +1,98 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { cn } from "@stigmer/theme";
4
+ /**
5
+ * A single row in a version timeline.
6
+ *
7
+ * Renders a version entry with: truncated hash badge, relative timestamp,
8
+ * actor info, tag badge, "current" indicator, and git provenance link.
9
+ * Supports keyboard activation and focus management.
10
+ *
11
+ * All visual properties flow through `--stgm-*` design tokens.
12
+ * Zero Console dependencies — safe for platform builder embedding.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <VersionTimelineEntry
17
+ * entry={version}
18
+ * isSelected={selectedId === version.id}
19
+ * onSelect={() => setSelectedId(version.id)}
20
+ * />
21
+ * ```
22
+ */
23
+ export function VersionTimelineEntry({ entry, isSelected, isCompareSource, isLast, onSelect, trailing, }) {
24
+ const handleKeyDown = (e) => {
25
+ if (e.key === "Enter" || e.key === " ") {
26
+ e.preventDefault();
27
+ onSelect?.();
28
+ }
29
+ };
30
+ return (_jsxs("div", { role: "listitem", "aria-current": entry.isCurrent ? "true" : undefined, className: "relative flex gap-3", children: [_jsxs("div", { className: "flex flex-col items-center pt-1", children: [_jsx("div", { className: cn("size-2.5 shrink-0 rounded-full border-2", entry.isCurrent
31
+ ? "border-primary bg-primary"
32
+ : isCompareSource
33
+ ? "border-primary border-dashed bg-background"
34
+ : isSelected
35
+ ? "border-primary bg-background"
36
+ : "border-border bg-background"), "aria-hidden": "true" }), !isLast && (_jsx("div", { className: "mt-1 w-px flex-1 bg-border", "aria-hidden": "true" }))] }), _jsxs("button", { type: "button", onClick: onSelect, onKeyDown: handleKeyDown, tabIndex: 0, "aria-selected": isSelected, className: cn("mb-4 flex min-w-0 flex-1 flex-col gap-1 rounded-md px-2.5 py-2 text-left transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isCompareSource
37
+ ? "border border-dashed border-primary bg-primary-subtle"
38
+ : isSelected
39
+ ? "bg-accent-hover"
40
+ : "hover:bg-accent-hover"), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] font-medium text-foreground", title: entry.id, children: entry.label }), isCompareSource && (_jsx("span", { className: "shrink-0 rounded-full bg-primary px-1.5 py-0.5 text-[10px] font-medium text-primary-foreground", children: "A" })), entry.tag && (_jsx("span", { className: "shrink-0 rounded-full bg-primary-subtle px-1.5 py-0.5 text-[10px] font-medium text-primary", children: entry.tag })), entry.isCurrent && (_jsx("span", { className: "shrink-0 rounded-full bg-status-ready-subtle px-1.5 py-0.5 text-[10px] font-medium text-status-ready", children: "current" })), trailing && (_jsx("div", { className: "ml-auto shrink-0", children: trailing }))] }), _jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [_jsx("time", { dateTime: entry.timestamp.toISOString(), title: entry.timestamp.toLocaleString(), children: formatRelativeTime(entry.timestamp) }), entry.actor && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", children: "\u00B7" }), _jsxs("span", { className: "flex items-center gap-1", children: [entry.actor.avatar && (_jsx("img", { src: entry.actor.avatar, alt: "", className: "size-3.5 rounded-full" })), _jsx("span", { children: entry.actor.displayName || entry.actor.id })] })] }))] }), entry.sublabel && (_jsx("p", { className: "text-xs text-muted-foreground", children: entry.sublabel })), entry.gitProvenance && (_jsx(GitProvenanceRow, { provenance: entry.gitProvenance }))] })] }));
41
+ }
42
+ // ---------------------------------------------------------------------------
43
+ // Git provenance inline display
44
+ // ---------------------------------------------------------------------------
45
+ function GitProvenanceRow({ provenance, }) {
46
+ const repoUrl = normalizeGitUrl(provenance.remoteUrl);
47
+ const truncatedCommit = provenance.commit.slice(0, 7);
48
+ const commitUrl = repoUrl
49
+ ? `${repoUrl}/commit/${provenance.commit}`
50
+ : null;
51
+ return (_jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [_jsx(GitIcon, { className: "size-3 shrink-0" }), provenance.ref && (_jsx("span", { className: "font-medium", children: provenance.ref })), commitUrl ? (_jsx("a", { href: commitUrl, target: "_blank", rel: "noopener noreferrer", className: "font-mono text-primary underline-offset-2 hover:underline", onClick: (e) => e.stopPropagation(), children: truncatedCommit })) : (_jsx("code", { className: "font-mono", children: truncatedCommit }))] }));
52
+ }
53
+ // ---------------------------------------------------------------------------
54
+ // Utilities
55
+ // ---------------------------------------------------------------------------
56
+ function formatRelativeTime(date) {
57
+ const now = Date.now();
58
+ const diffMs = now - date.getTime();
59
+ const diffSec = Math.floor(diffMs / 1000);
60
+ const diffMin = Math.floor(diffSec / 60);
61
+ const diffHr = Math.floor(diffMin / 60);
62
+ const diffDays = Math.floor(diffHr / 24);
63
+ if (diffSec < 60)
64
+ return "just now";
65
+ if (diffMin < 60)
66
+ return `${diffMin}m ago`;
67
+ if (diffHr < 24)
68
+ return `${diffHr}h ago`;
69
+ if (diffDays < 7)
70
+ return `${diffDays}d ago`;
71
+ if (diffDays < 30)
72
+ return `${Math.floor(diffDays / 7)}w ago`;
73
+ return date.toLocaleDateString(undefined, {
74
+ month: "short",
75
+ day: "numeric",
76
+ year: date.getFullYear() !== new Date().getFullYear() ? "numeric" : undefined,
77
+ });
78
+ }
79
+ function normalizeGitUrl(url) {
80
+ if (!url)
81
+ return null;
82
+ const cleaned = url.replace(/\.git$/, "");
83
+ if (cleaned.startsWith("https://") || cleaned.startsWith("http://")) {
84
+ return cleaned;
85
+ }
86
+ const sshMatch = cleaned.match(/^(?:git@|ssh:\/\/)([^:/]+)[:/](.+)$/);
87
+ if (sshMatch) {
88
+ return `https://${sshMatch[1]}/${sshMatch[2]}`;
89
+ }
90
+ return null;
91
+ }
92
+ // ---------------------------------------------------------------------------
93
+ // Icons
94
+ // ---------------------------------------------------------------------------
95
+ function GitIcon({ className }) {
96
+ 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("circle", { cx: "8", cy: "4", r: "2" }), _jsx("circle", { cx: "8", cy: "12", r: "2" }), _jsx("path", { d: "M8 6v4" })] }));
97
+ }
98
+ //# sourceMappingURL=VersionTimelineEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionTimelineEntry.js","sourceRoot":"","sources":["../../src/version-history/VersionTimelineEntry.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAGpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,KAAK,EACL,UAAU,EACV,eAAe,EACf,MAAM,EACN,QAAQ,EACR,QAAQ,GACkB;IAC1B,MAAM,aAAa,GAAG,CAAC,CAAsB,EAAE,EAAE;QAC/C,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YACvC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,QAAQ,EAAE,EAAE,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,eACE,IAAI,EAAC,UAAU,kBACD,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAC,qBAAqB,aAG/B,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cACE,SAAS,EAAE,EAAE,CACX,yCAAyC,EACzC,KAAK,CAAC,SAAS;4BACb,CAAC,CAAC,2BAA2B;4BAC7B,CAAC,CAAC,eAAe;gCACf,CAAC,CAAC,4CAA4C;gCAC9C,CAAC,CAAC,UAAU;oCACV,CAAC,CAAC,8B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ED,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACpE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACtE,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,WAAW,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,SAAS,OAAO,CAAC,EAAE,SAAS,EAAmC;IAC7D,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,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,EAC9B,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,EAC/B,eAAM,CAAC,EAAC,QAAQ,GAAG,IACf,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { DiffHunk } from "./types";
2
+ /**
3
+ * Compute a unified diff between two text strings.
4
+ *
5
+ * Returns an array of {@link DiffHunk} objects, each containing the
6
+ * changed and context lines with line numbers. Uses the `diff` library's
7
+ * Myers algorithm internally.
8
+ *
9
+ * Pure function — no side effects, safe to call outside React.
10
+ *
11
+ * @param oldText - The "before" text content.
12
+ * @param newText - The "after" text content.
13
+ * @param contextLines - Number of unchanged context lines around changes (default: 3).
14
+ */
15
+ export declare function computeDiff(oldText: string, newText: string, contextLines?: number): readonly DiffHunk[];
16
+ //# sourceMappingURL=computeDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeDiff.d.ts","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,SAAI,GACf,SAAS,QAAQ,EAAE,CAwCrB"}
@@ -0,0 +1,54 @@
1
+ import { structuredPatch } from "diff";
2
+ /**
3
+ * Compute a unified diff between two text strings.
4
+ *
5
+ * Returns an array of {@link DiffHunk} objects, each containing the
6
+ * changed and context lines with line numbers. Uses the `diff` library's
7
+ * Myers algorithm internally.
8
+ *
9
+ * Pure function — no side effects, safe to call outside React.
10
+ *
11
+ * @param oldText - The "before" text content.
12
+ * @param newText - The "after" text content.
13
+ * @param contextLines - Number of unchanged context lines around changes (default: 3).
14
+ */
15
+ export function computeDiff(oldText, newText, contextLines = 3) {
16
+ const patch = structuredPatch("a", "b", oldText, newText, "", "", {
17
+ context: contextLines,
18
+ });
19
+ return patch.hunks.map((hunk) => {
20
+ const lines = [];
21
+ let oldLine = hunk.oldStart;
22
+ let newLine = hunk.newStart;
23
+ for (const raw of hunk.lines) {
24
+ const prefix = raw[0];
25
+ const content = raw.slice(1);
26
+ if (prefix === "+") {
27
+ lines.push({ type: "added", content, newLineNumber: newLine });
28
+ newLine++;
29
+ }
30
+ else if (prefix === "-") {
31
+ lines.push({ type: "removed", content, oldLineNumber: oldLine });
32
+ oldLine++;
33
+ }
34
+ else {
35
+ lines.push({
36
+ type: "context",
37
+ content,
38
+ oldLineNumber: oldLine,
39
+ newLineNumber: newLine,
40
+ });
41
+ oldLine++;
42
+ newLine++;
43
+ }
44
+ }
45
+ return {
46
+ oldStart: hunk.oldStart,
47
+ oldLines: hunk.oldLines,
48
+ newStart: hunk.newStart,
49
+ newLines: hunk.newLines,
50
+ lines,
51
+ };
52
+ });
53
+ }
54
+ //# sourceMappingURL=computeDiff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeDiff.js","sourceRoot":"","sources":["../../src/version-history/computeDiff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGvC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CACzB,OAAe,EACf,OAAe,EACf,YAAY,GAAG,CAAC;IAEhB,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE;QAChE,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,KAAK,GAAe,EAAE,CAAC;QAC7B,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC5B,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE5B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;gBAC/D,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;gBACjE,OAAO,EAAE,CAAC;YACZ,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,SAAS;oBACf,OAAO;oBACP,aAAa,EAAE,OAAO;oBACtB,aAAa,EAAE,OAAO;iBACvB,CAAC,CAAC;gBACH,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK;SACN,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { MultiFileDiffResult } from "./types";
2
+ /**
3
+ * Compute a multi-file diff between two snapshots of a file tree.
4
+ *
5
+ * Each snapshot is a `Map<path, textContent>`. The function categorises
6
+ * every path as `added`, `removed`, or `modified`, computes per-file
7
+ * unified diffs for modified files, and returns an aggregate result.
8
+ *
9
+ * Pure function — no side effects, safe to call outside React.
10
+ *
11
+ * @param oldFiles - File map for the "before" version.
12
+ * @param newFiles - File map for the "after" version.
13
+ */
14
+ export declare function computeMultiFileDiff(oldFiles: ReadonlyMap<string, string>, newFiles: ReadonlyMap<string, string>): MultiFileDiffResult;
15
+ //# sourceMappingURL=computeMultiFileDiff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeMultiFileDiff.d.ts","sourceRoot":"","sources":["../../src/version-history/computeMultiFileDiff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG5E;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,mBAAmB,CAmDrB"}